query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
09a1d4d7f088c10796cfea0b98d0836f
PROPIEDADES devuelve el objeto Properties del documento
[ { "docid": "55a80684045de02038ffc5314dc742cb", "score": "0.66029805", "text": "function av_GetDocumentProperties(id_visor, idDocumento){\n\tdoc=va_getDocumento(id_visor,idDocumento);\n\tif(doc==null){\n\t\tdoc=va_getDocumentoAgrupado(id_visor,idDocumento);\n\t}\n\tif(doc!=null && typeof doc.Properties !='undefined'){\n\t\treturn doc.Properties;\n\t}else{\n\t\treturn null;\n\t}\t\n}", "title": "" } ]
[ { "docid": "2cec2752cc34f2f668be2a5a02393bb9", "score": "0.654116", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "b4164110fc499fe8971e445de32f5171", "score": "0.6500305", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "56da049502800c381ebcae3cb2b3d6c9", "score": "0.64706296", "text": "static get properties() {\n return {\n\n };\n }", "title": "" }, { "docid": "bfd054a74ba64d4588f1065033795c6f", "score": "0.63820684", "text": "updateProperties() {\n const stringifiedValues = JSON.stringify(this._settings);\n if (this._scriptProperties) {\n PropertiesService.getScriptProperties().setProperty(this._name, stringifiedValues);\n }\n else {\n PropertiesService.getDocumentProperties().setProperty(this._name, stringifiedValues);\n }\n }", "title": "" }, { "docid": "0eb6dcdc3294a3440e7933a785219d40", "score": "0.63654476", "text": "static get properties() {\n return {\n foo: String,\n whales: Number,\n options: Object,\n query: String,\n url: String\n }\n }", "title": "" }, { "docid": "b211bae9c0699b06e2e5b4dda2f2f411", "score": "0.6311167", "text": "static get properties() {\n return {\n };\n }", "title": "" }, { "docid": "ff45520f5d1c2de2b325e8c124d87053", "score": "0.63006246", "text": "applyProperties (p) {\n\t\tfor (let i in p)\n\t\t\tthis.properties[i] = p[i];\n\t}", "title": "" }, { "docid": "f1b7a6cf8b41936d7f43fd97b0394d0f", "score": "0.6261096", "text": "static getNewProperties() {\n return {};\n }", "title": "" }, { "docid": "4766ebcc5095c611b9c2c90a6252e854", "score": "0.6234546", "text": "static get properties () {\n\t\treturn {\n\t\t\tname: {\n\t\t\t\ttype: String\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b4a8a905c3673eedd3171a8f520bdaa3", "score": "0.62259877", "text": "static get properties(){\n return {};\n }", "title": "" }, { "docid": "414b12bcc2615ffdfd8dbe58e01dc4a7", "score": "0.6202678", "text": "function createProperties()/*:Object*/ {\n var props/*:Object*/ = {};\n\n props[this.FIELDS] = [];\n props[this.SELECTED_FIELD] = \"\";\n props[this.DIRECTIONS] = [];\n props[this.SELECTED_DIRECTION] = \"\";\n\n var sortingColumns/*:String*/ = this.resourceManager.getString('com.coremedia.blueprint.base.queryeditor.QueryEditorSettings', 'sort_directions');\n var columnNames/*:Array*/ = sortingColumns.split(\",\");\n for(var i/*:int*/ = 0; i<columnNames.length; i++) {\n var colName/*:String*/ = columnNames[i];\n var locName/*:String*/ = this.resourceManager.getString('com.coremedia.blueprint.base.queryeditor.QueryEditorSettings', 'sort_direction_'+colName);\n props[this.FIELDS].push({name:colName,localizedName:locName});\n }\n return props;\n }", "title": "" }, { "docid": "9270b5c8e10d036e97b0cdf8dae074dd", "score": "0.61531407", "text": "static get properties() {\n return { ...super.properties,\n lessons: {\n type: Object\n },\n profile: {\n type: Object\n }\n };\n }", "title": "" }, { "docid": "2ccb6a0598a1dd48e2562d494c55ab40", "score": "0.61381227", "text": "static get properties() {\n return {\n };\n }", "title": "" }, { "docid": "cc209b677047deb5aa8d9b24c2e261d8", "score": "0.6126561", "text": "renderProperties(properties) {\n const props = super.renderProperties(properties);\n return Object.assign(props, this.userProperties || {});\n }", "title": "" }, { "docid": "76345dad9105ee5dc4899b0f5d3cb56a", "score": "0.6113712", "text": "static get properties() {\n return {\n ...super.properties,\n\n /**\n * @private\n */\n alaska: {\n type: Boolean,\n reflect: true\n },\n official: {\n type: Boolean,\n reflect: true\n },\n };\n }", "title": "" }, { "docid": "97cf8a32c367c8f04e7f2d9cef71b830", "score": "0.6108867", "text": "getProperties() {\n return this.wrapped.properties != null ? Object.assign({}, this.wrapped.properties) : {};\n }", "title": "" }, { "docid": "ca074d62ca9a3404712571e6f748700e", "score": "0.6097916", "text": "getProperties() {\n var properties = {}, propName, isReserved, isString, isArray;\n for (propName in this) {\n isPrivate = (propName.charAt(0) == \"_\");\n isString = (typeof this[propName] == \"string\");\n isArray = (this[propName] instanceof Array);\n if (!isPrivate && (isString || isArray))\n properties[propName] = this[propName];\n }\n return properties;\n }", "title": "" }, { "docid": "8848f05c4a115a26fc0aada77808fdf2", "score": "0.60856825", "text": "async properties(documentId) {\n const response = await fetch(\n `${PSPDFKIT_SERVER_INTERNAL_URL}/api/documents/${documentId}/properties`,\n {\n method: \"GET\",\n headers: {\n Authorization: `Token token=${AUTH_TOKEN}`,\n },\n }\n ).then((res) => res.json());\n\n return unwrapError(response);\n }", "title": "" }, { "docid": "85044870439ccdf0218d6c6719f9bbd3", "score": "0.6077006", "text": "static get properties() {\n return {\n // ...super.properties,\n\n // this property is DEMO ONLY! Please delete.\n cssClass: { type: String },\n\n departDate_year: {type: Number, reflect: true},\n departDate_month: {type: Number, reflect: true},\n departDate_day: {type: Number, reflect: true},\n\n returnDate_year: {type: Number},\n returnDate_month: {type: Number},\n returnDate_day: {type: Number},\n };\n }", "title": "" }, { "docid": "c32e2de28f086aac2a425e7497a30e9a", "score": "0.60678244", "text": "static get properties() {\n return {\n infoSolicitud: { type: Array }\n };\n }", "title": "" }, { "docid": "857a8a157e96cba7e45b07e3aa51a402", "score": "0.6061343", "text": "static async getInitialProps(props) {\n const conta = props.query.endereco;\n const entidade = await ludiex.methods.nomeEntidade().call();\n\n const professores = await ludiex.methods.obterProfessores().call();\n\n const dadosProfessores = await Promise.all(\n Array(parseInt(professores.length))\n .fill()\n .map((element, index) => {\n return ludiex.methods.obterProfessor(professores[index]).call();\n })\n );\n \n const cadastro = dadosProfessores.map((element) => {\n return element[2].toNumber();\n });\n \n\n return {\n conta: conta,\n nome: entidade,\n professores: professores,\n itens: dadosProfessores,\n cadastro: cadastro\n };\n }", "title": "" }, { "docid": "03a6bd940ba1eac407c54730212285a8", "score": "0.6022776", "text": "static get properties() {\n return {\n message: { type: String },\n name: { type: String },\n pie: { type: Boolean }\n };\n }", "title": "" }, { "docid": "905e3257ab6bd404642e05c54d77d9a1", "score": "0.60207534", "text": "getPropMap() {\n return {\n 'Global': [ 'name', 'nameFrom', 'role', 'state', 'description' ],\n 'Widget': [ 'placeholder', 'value', 'valueForRange', 'minValueForRange',\n 'maxValueForRange', 'textInputType', 'buttonMixed', 'accessKey',\n 'ariaInvalidValue', 'ariaReadonly' ],\n 'HTML': [ 'htmlTag', 'htmlAttributes', 'imageDataUrl' ],\n 'Structure': [ 'posInSet', 'setSize', 'hierarchicalLevel', 'isRootNode' ],\n 'Table': [ 'tableRowCount', 'tableColumnCount', 'tableCellColumnIndex',\n 'tableCellColumnSpan', 'tableCellRowIndex', 'tableCellRowSpan',\n 'tableColumnHeader', 'tableRowHeader' ],\n 'Live region': [ 'liveStatus', 'liveRelevant', 'liveAtomic', 'liveBusy',\n 'containerLiveStatus', 'containerLiveRelevant', 'containerLiveAtomic',\n 'containerLiveBusy' ],\n 'Selection': [ 'anchorOffset', 'anchorAffinity', 'anchorObject',\n 'focusOffset', 'focusAffinity', 'focusObject', 'textSelStart',\n 'textSelEnd' ],\n 'Text': [ 'language', 'wordStarts', 'wordEnds',\n 'lineStartOffsets', 'lineBreaks',\n 'markerStarts', 'markerEnds', 'markerTypes' ],\n 'Relations': 'relationProps',\n 'Document': [ 'docTitle', 'docUrl', 'docLoaded', 'docLoadingProgress' ],\n 'Appearance': [ 'location', 'color', 'backgroundColor', 'colorValue',\n 'display' ],\n 'Scrolling': [ 'scrollX', 'scrollXMin', 'scrollXMax',\n 'scrollY', 'scrollYMin', 'scrollYMax' ],\n 'Functions': '()',\n 'Other': '*' // Show the rest\n };\n }", "title": "" }, { "docid": "c4285f2e49fecab7421848e665aaa952", "score": "0.60059005", "text": "getProperties() {\n return { ...propertiesMap.get(this) };\n }", "title": "" }, { "docid": "dd61e77d8a831f93da66de71031b3941", "score": "0.6004641", "text": "static get properties(){return{/**\n * schema to extract for whatever you wanted it for\n */haxSchema:{name:\"haxSchema\",type:\"String\",notify:!0,observer:\"_haxSchemaChanged\"},/**\n * configure form schema to extract for whatever you wanted it for\n */configureSchema:{name:\"configureSchema\",type:\"Object\",value:{}},/**\n * advanced form schema to extract for whatever you wanted it for\n */advancedSchema:{name:\"advancedSchema\",type:\"Object\",value:{}},/**\n * Optional remote source to pull in\n */source:{name:\"source\",type:\"String\"},/**\n * String based value passed between the elements to stitch together\n */value:{name:\"value\",type:\"String\"}}}", "title": "" }, { "docid": "b0f3537908cd2692d3c8155f6b34037c", "score": "0.600423", "text": "static get properties() {\n return {\n firstDaysNumber: { type: Number },\n firstDayOfWeekDateTime: { type: DateTime },\n\n firstDayOfWeek_year: { type: Number },\n firstDayOfWeek_month: { type: Number },\n firstDayOfWeek_day: { type: Number },\n\n departDate_month: {type: Number},\n departDate_day: {type: Number},\n departDate_year: {type: Number},\n returnDate_month: {type: Number},\n returnDate_day: {type: Number},\n returnDate_year: {type: Number},\n\n displayMonth: { type: Number },\n\n };\n }", "title": "" }, { "docid": "dd2ecbbc0a9c41e89d0c9b192582ef18", "score": "0.6002389", "text": "static get properties() {\n return {\n header: {type:Object},\n body:{type:Object},\n footer: {type:Object},\n displayMenu:{type:Boolean},\n menuList: {type:String},\n newTileFlag:{type:Boolean},\n displayNewTile:{type:String},\n user:{type:Object}\n };\n }", "title": "" }, { "docid": "f3edf4284866e961c06415f8fe9cb40d", "score": "0.5987456", "text": "static get properties() {\n return {\n /**\n * Is the target id.\n */\n for: {\n type: String\n },\n /**\n * The selected text.\n */\n range: {\n type: Object,\n value: null\n },\n /**\n * fields for the prompt popover.\n */\n fields: {\n type: Array,\n value: null\n },\n /**\n * The prefilled value of the prompt\n */\n value: {\n type: Object,\n value: null\n },\n /**\n * The prefilled value of the prompt\n */\n __button: {\n type: Object,\n value: null\n }\n };\n }", "title": "" }, { "docid": "99b58331cea3156f16bf33cb57839447", "score": "0.5980156", "text": "async processDocuments (props) {\n this.schema.type.properties.map((prop) => {\n const isString = typeof props[prop.key] === 'string'\n const isIdField = prop.value.name === 'ArangoId'\n\n if (isIdField && !isString) {\n props[prop.key] = props[prop.key]._id\n }\n })\n\n return props\n }", "title": "" }, { "docid": "db0b105154346f2504187c7c33c8bab8", "score": "0.5979864", "text": "static get properties() {\n return {\n name: {\n Type: String\n },\n count: {\n Type: Number\n }\n }\n }", "title": "" }, { "docid": "fe2b355a99b05caa0ddaccdbad21a512", "score": "0.59722686", "text": "static get properties() {\n return {\n title: { type: String },\n photoURL: { type: String, reflect: true },\n coinAmt: { type: Number },\n };\n }", "title": "" }, { "docid": "a74e27c5c02d28887d571f494627bd04", "score": "0.59689826", "text": "static get properties() {\n return {\n level: { type: String },\n display: { type: String,\n reflect: true },\n color: { type: String },\n margin: { type: String },\n size: { type: String }\n };\n }", "title": "" }, { "docid": "5327fa8d197a447f2ad78d6c14aeefc0", "score": "0.5965752", "text": "function mostrarPropiedades(objeto, propiedadObjeto) {\n let resultado = \"\";\n for (const elemento in objeto) {\n if (objeto.hasOwnProperty(elemento)) {\n resultado += `${propiedadObjeto}.${elemento} = ${objeto[elemento]} \\n`;\n }\n }\n return resultado;\n}", "title": "" }, { "docid": "d53aeae6acb9aeea428b970660f87fea", "score": "0.59583086", "text": "static get properties () {\n return {\n // Simple public properties/attributes\n one: { type: String },\n two: { type: Boolean },\n three: { type: Array },\n // If the property is multiple words and thus camelCase, you can force the default linked attribute to be kebab-case like this:\n fooBarBaz: { type: String, attribute: 'foo-bar-baz' },\n // Setting `reflect: true` will automatically update the attribute value when the property is changed.\n // This way, if you use a CSS attribute selector like this `:host([enabled])`, you can have your styles react to property changes.\n enabled: { type: Boolean, reflect: true },\n // Private properties are prefixed with `_`\n // If it's described here, a change will trigger render().\n // Disable attribute for private properties.\n _privateFoobar: { type: Boolean, attribute: false },\n };\n }", "title": "" }, { "docid": "090da221791b496ac89c3b89956278c7", "score": "0.5953976", "text": "function removeProperties() {\n PropertiesService.getDocumentProperties().deleteAllProperties();\n}", "title": "" }, { "docid": "ec74a62b9889cc049320c2a137c6dbff", "score": "0.5950744", "text": "static get properties() {\n return { ...super.properties\n };\n }", "title": "" }, { "docid": "c6bc7cbfeffa75866706921b52f261ea", "score": "0.59399873", "text": "static get properties() {\n return {\n /**\n * The `icon` attribute grabs a vector-shaped logo of social media you choose\n *\n * @attribute icon\n * @type string\n * @default 'github'\n */\n icon: {\n type: String,\n value: 'github',\n notify: true,\n reflectToAttribute: true,\n observer: '_getPath'\n },\n /**\n * The `size` attribute sets a size of an element\n *\n * @attribute size\n * @type int\n * @default 32\n */\n size: {\n type: Number,\n value: 32,\n notify: true,\n reflectToAttribute: true\n },\n /**\n * The `color` attribute fills the shape with a color you choose\n *\n * @attribute color\n * @type hex\n * @default undefined\n */\n color: {\n type: String,\n notify: true,\n reflectToAttribute: true\n },\n /**\n * The `title` attribute changes the title\n *\n * @attribute change\n * @type string\n */\n title: {\n type: String,\n notify: true,\n reflectToAttribute: true\n }\n };\n }", "title": "" }, { "docid": "ed8c87b0f3557cc62a2af17ab8bada02", "score": "0.5903499", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * Title of the work.\n */\n title: {\n type: String,\n },\n /**\n * License scope\n */\n scope: {\n type: String,\n },\n /**\n * How to present the citation on the interface.\n * Can be popup, footnote, or default behavior which is visible\n */\n displayMethod: {\n type: String,\n reflect: true,\n attribute: \"display-method\",\n },\n /**\n * Person or group that owns / created the work.\n */\n creator: {\n type: String,\n },\n /**\n * Original Source of the work in question\n */\n source: {\n type: String,\n },\n /**\n * Date the work was accessed.\n */\n date: {\n type: String,\n },\n /**\n * License name, calculated or supplied by the end user if we don't have them.\n */\n licenseName: {\n type: String,\n attribute: \"license-name\",\n },\n /**\n * License link for more details\n */\n licenseLink: {\n type: String,\n attribute: \"license-link\",\n },\n /**\n * License short hand. Options cc0,\n */\n license: {\n type: String,\n },\n };\n }", "title": "" }, { "docid": "339fc7c9fb5db0c8dc62c0f16de32775", "score": "0.59030443", "text": "static get properties() {\n return {\n ...super.properties,\n };\n }", "title": "" }, { "docid": "c3926aa8b0ce6c796ef374181bcd3911", "score": "0.5896578", "text": "properties(obj, ...properties) {\n const result = properties.reduce((props, prop) => {\n props[prop] = obj[prop];\n return props;\n }, {});\n return [result];\n }", "title": "" }, { "docid": "353ba5c576b75961577e918918187e15", "score": "0.5875217", "text": "getProperties() {\n const base = this.source ? this.source.getProperties() : {}, properties = this._properties;\n for (const name in properties)\n base[name] = properties[name];\n return base;\n }", "title": "" }, { "docid": "88c307c0c68330af18cc7ae5c6475c3d", "score": "0.58741534", "text": "static get properties() {\n return {\n name: { type: String }\n }\n }", "title": "" }, { "docid": "df1415a59df6abf4bcc2d070999f6df2", "score": "0.5857813", "text": "static get properties() {\n let props = {\n \"source\": {\n \"name\": \"source\",\n \"type\": \"String\",\n \"value\": \"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n};\n if (super.properties) {\n props = Object.assign(props, super.properties);\n }\n return props;\n }", "title": "" }, { "docid": "27cb801226b87debd489673dbd1f2559", "score": "0.58568907", "text": "function createProdotto(){}", "title": "" }, { "docid": "c337328c96f0b836b1309cb299216950", "score": "0.5845131", "text": "transferInitialProperties() {\n Object.keys(this.initialProperties).forEach((key) => {\n if (this.hasOwnProperty(key)) {\n this.properties[key] = this[key];\n }\n });\n }", "title": "" }, { "docid": "c22ff8440de8cdb5ea6c08ab5b195f21", "score": "0.5821594", "text": "static get properties() { return {\n client:{type:Object},\n query:{type:Object},\n variables:{type:Object},\n data:{type:Object},\n loading:{type:Boolean},\n error:{type:Object}\n}}", "title": "" }, { "docid": "917e06f62f414348c4e4bd1245fe8dc6", "score": "0.58211225", "text": "function checkDocumentProperties() {\n Logger.log(PropertiesService.getDocumentProperties().getProperties());\n}", "title": "" }, { "docid": "1d58e5f7c69fb5f28ea54bcfd6efddf8", "score": "0.58055556", "text": "function updateProperties() {\n\tgenUI.genPropertiesForm();\n\t\n\tvar selectedObj = selected[0];\n\tvar formName = \"propertiesFormId\";\n\t\n\tvar text = \"\";\n\tvar textsize = \"\";\n\tvar textcolour = \"\";\n\tvar width = \"\";\n\tvar height = \"\";\n\tvar colour = \"\";\n\tvar url = \"\";\n\t\n\t\n\tif (selectedObj) {\n\t\ttext = selectedObj.getLabel();\n\t\ttextsize = selectedObj.getTextSize();\n\t\ttextcolour = selectedObj.getTextColour();\n\t\twidth = selectedObj.getXSize();\n\t\theight = selectedObj.getYSize();\n\t\tcolour = selectedObj.getColour();\n\t\tif (selectedObj.attributes.type === \"QMLab.ImageNode\" ) {\n\t\t\turl = selectedObj.getImageURL();\n\t\t}\n\t\tif(selectedObj.attributes.type === \"QMLab.Agent\" ){\n\t\t\turl = selectedObj.getImage();\n\t\t}\n\t}\n\t\n\tsetPropertyDisplayValues(text, textsize, textcolour, width, height, colour, url)\n}", "title": "" }, { "docid": "e10cb324ee733066851e25023d3c4612", "score": "0.580452", "text": "dumpProperties() {\n\t\tlet fullPropList = Object.keys(this.properties).map(p => parseInt(p));\n\n\t\t// Include dynamic props in the dump\n\t\tfullPropList.push(bacnet.enum.PropertyIdentifier.PROTOCOL_OBJECT_TYPES_SUPPORTED);\n\t\tfullPropList.push(bacnet.enum.PropertyIdentifier.OBJECT_IDENTIFIER);\n\t\tfullPropList.push(bacnet.enum.PropertyIdentifier.PROPERTY_LIST);\n\t\tfullPropList.push(bacnet.enum.PropertyIdentifier.OBJECT_LIST);\n\n\t\tlet props = {};\n\t\tfullPropList.forEach(key => {\n\t\t\tconst property = this.getProperty(key);\n\t\t\tconst keyName = Util.getPropName(key);\n\t\t\tprops[keyName] = property.valueAsString();\n\t\t});\n\t\treturn props;\n\t}", "title": "" }, { "docid": "1f981687165788a3e8f9be0466f05bb1", "score": "0.58026886", "text": "static get properties(){\n return{\n \n } \n }", "title": "" }, { "docid": "f933111993a7ef57c8311f2482d06f7d", "score": "0.57933164", "text": "static get properties() {\n return {\n guidebook: {type: Object},\n active: {type: Boolean},\n };\n }", "title": "" }, { "docid": "175722cf5c3eb2b6fc4a280f1ba83d89", "score": "0.57864934", "text": "applyProperties (opt) {\n return {};\n }", "title": "" }, { "docid": "56419c3e292598bdef3700be57537bd0", "score": "0.57768214", "text": "setProperties(props, update=true){\n if(props === undefined){return;}\n // var keys = [];\n // for(let key in props){\n // this._modelProperties[key]=props[key];\n // }\n\n Object.assign(this._modelProperties, props);\n if(update){\n this.notifyPropertySet(props);\n }\n }", "title": "" }, { "docid": "ca529165d7d4293e1072f3fb9d0126de", "score": "0.57740396", "text": "static get properties() {\n return {\n title: { type: String },\n invert: { type: Boolean, reflect: true },\n icon: { type: String },\n link: { type: String },\n iconEnable: { type: Boolean, reflect: true },\n disabled: { type: Boolean, reflect: true },\n };\n }", "title": "" }, { "docid": "419b31be97fe36ef1e70f3c930a350cf", "score": "0.57701206", "text": "static get properties() {\n return {\n \"imageUrl\": {\n \"name\": \"imageUrl\",\n \"type\": \"String\",\n \"value\": \"\\\"\\\"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"heading\": {\n \"name\": \"heading\",\n \"type\": \"String\",\n \"value\": \"\\\"\\\"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"text\": {\n \"name\": \"text\",\n \"type\": \"String\",\n \"value\": \"\\\"\\\"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"cardHeight\": {\n \"name\": \"cardHeight\",\n \"type\": \"String\",\n \"value\": \"\\\"\\\"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"cardWidth\": {\n \"name\": \"cardWidth\",\n \"type\": \"String\",\n \"value\": \"\\\"\\\"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"cardTitle\": {\n \"name\": \"cardTitle\",\n \"type\": \"String\",\n \"value\": \"\\\"\\\"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n}\n;\n }", "title": "" }, { "docid": "d33311783e46ee8d86bc0231156a53ae", "score": "0.5764499", "text": "function SetPESProperties($scope, $modalInstance, title, message, object) {\n $scope.title = title;\n $scope.message = message;\n\n $scope.properties = {};\n\n if(!object.policyIdentifierID) {\n object.$getPesProperties(function() {\n $scope.properties = angular.copy(object);\n });\n } else {\n $scope.properties = angular.copy(object);\n }\n\n $scope.cancel = function () {\n $modalInstance.dismiss('cancel');\n };\n\n $scope.ok = function () {\n $modalInstance.close($scope.properties);\n };\n}", "title": "" }, { "docid": "96108948248f757cd9d67676ac587ec4", "score": "0.5763963", "text": "toObject() {\n\t\tvar out = {};\n\t\t\n\t\tthis.properties.forEach((v, k) => {\n\t\t\tout[k] = v;\n\t\t});\n\t\t\n\t\treturn out;\n\t}", "title": "" }, { "docid": "19e4a1dc63fe3c721117d0796f26ea45", "score": "0.57574594", "text": "getProperties(options) {\n const operationArguments = {\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec);\n }", "title": "" }, { "docid": "94468bd98ff575e1a2b974c86ad0feb0", "score": "0.57398045", "text": "setProperties(properties){\n const {name, email, password} = properties;\n\n this.name = name;\n this.email = email;\n this.password = password;\n }", "title": "" }, { "docid": "4f85fb962d66c71b3c99c2e87a1797c6", "score": "0.5730271", "text": "function getProperties() {\n\n\tvar selected = $('#' + String(e_selectedId));\n\tvar selectedcss = e_properties[e_selectedId];\n\n\tif(typeof(selectedcss) != 'undefined') {\n\n\t\t// Loops through the css properties, sets each to properties in element array,\n\t\t// changes the values in the form\n\t\tfor (i=0; i<(properties.length); i++) {\n\t\t\tvar property = String(properties[i]);\n\n\t\t\tselectedcss[property] = selected.css(property);\n\t\t\t$('#e_'+property).val(selectedcss[property]);\n\t\t} \n\n\t\t// Exceptions: Change all the properties that are not CSS\n\t\tselectedcss['text'] = selected.text();\n\t\t$('#e_text').text(selectedcss['text']);\n\n\t}\n}", "title": "" }, { "docid": "a2ffd89e420e52d2dc71f5adb3ded000", "score": "0.57298183", "text": "reactProps() {\n this.syncronizePropertiesAndAttributes();\n return this.properties;\n }", "title": "" }, { "docid": "ae669ac1e325cef2a88c9e9c664d7896", "score": "0.57296646", "text": "get properties() {\n\t\treturn [\"allowDrag\",\"allowDrop\",\"animation\",\"autoHideToggleElement\",\"autoLoadState\",\"autoSaveState\",\"autoSort\",\"dataSource\",\"disabled\",\"displayLoadingIndicator\",\"displayMember\",\"dragFeedbackFormatFunction\",\"dragOffset\",\"editable\",\"expandMode\",\"filterable\",\"filterInputPlaceholder\",\"filterMode\",\"hasThreeStates\",\"itemsMember\",\"loadingIndicatorPlaceholder\",\"loadingIndicatorPosition\",\"locale\",\"localizeFormatFunction\",\"messages\",\"overflow\",\"readonly\",\"rightToLeft\",\"scrollMode\",\"selectedIndexes\",\"selectionDisplayMode\",\"selectionMode\",\"selectionTarget\",\"showLines\",\"showRootLines\",\"sort\",\"sortDirection\",\"sorted\",\"theme\",\"toggleElementPosition\",\"toggleMode\",\"unfocusable\",\"valueMember\"];\n\t}", "title": "" }, { "docid": "3683126d24f3602cb793b64d793c5da5", "score": "0.57119113", "text": "function displayProperties() {\n var properties = [];\n for (var prop in document) {\n properties.push(prop);\n }\n\n properties.sort();\n\n for (var prop in properties) {\n console.log(properties[prop])\n }\n}", "title": "" }, { "docid": "f56a76249a8b7a7a81345800a8466ca8", "score": "0.56851", "text": "static get properties() {\n return {\n text: {\n type: String\n },\n customclass: {\n type: String,\n value: 'primary'\n },\n color: {\n type: String,\n value: 'green'\n }\n }\n }", "title": "" }, { "docid": "01319d3f97d88b7d8d8533627f290013", "score": "0.56843174", "text": "static get properties() {\n return {\n todos: { type: Array }\n };\n }", "title": "" }, { "docid": "1204e9e0ef20f1f4f36f3bfd604f93c5", "score": "0.5679536", "text": "static get properties() {\r\n return {\r\n greeting: {\r\n type: String\r\n }\r\n }\r\n }", "title": "" }, { "docid": "2bc6f20b0ff8a34e5cf5166b5fa49d57", "score": "0.56788737", "text": "function convertPropertiedFields(m) {\n var properties = {};\n var fields = [];\n\n for (var i in m.fields) {\n var field = m.fields[i];\n\n if (field.date_format == null ||\n field.date_format == \"\") {\n delete field[\"date_format\"];\n\t }\n\n if (field.property != null) { // \"\" is allowed.\n var property = properties[field.property];\n if (property == null) {\n property = properties[field.property] = {\n enabled: true,\n dynamic: false,\n properties: {},\n fields: []\n };\n }\n\n property.fields.push(field);\n } else {\n fields.push(field);\n }\n\n delete field[\"property\"];\n field.display_order = i;\n }\n\n for (var i in m.mappings) {\n var mapping = m.mappings[i];\n\n properties[mapping.name] = mapping;\n\n delete mapping[\"name\"];\n mapping.display_order = i;\n\n convertPropertiedFields(mapping);\n }\n\n delete m[\"mappings\"];\n\n m.properties = properties;\n\n m.fields = fields;\n if (m.fields == null || m.fields.length <= 0) {\n delete m[\"fields\"];\n }\n }", "title": "" }, { "docid": "5cc49619fd1cb500de42c0a469386d78", "score": "0.5670835", "text": "static get properties() {\n return {\n /**\n * Language\n */\n lang: {\n type: String,\n value: \"en\",\n reflectToAttribute: true\n },\n /**\n * target of the controls\n */\n target: {\n type: Object,\n value: null\n }\n };\n }", "title": "" }, { "docid": "73260683f65070f36762e091f0ffd7a7", "score": "0.5667754", "text": "_createProperties (proto, $, options) {\n let _properties = this.properties\n\n for (let k in _properties) {\n let v = _properties[k]\n\n let { name, ownerProp, value } = this._getPropertyInfos(k, options)\n\n // private property name\n let privateName = '_' + name\n\n // should the owner's instance call the update() method after the setter\n let update = v.update\n\n let p = ownerProp ? $ : proto\n let props = ownerProp ? '__ownerProps' : '__props'\n\n proto[props][privateName] = value\n\n let setter = function (value) {\n if (value !== this[privateName]) {\n this[privateName] = value\n }\n }\n\n if (update) {\n if (_.isFunction(update)) {\n setter = function (value) {\n if (value !== this[privateName]) {\n this[privateName] = value\n update.call(this)\n }\n }\n }\n else {\n setter = function (value) {\n if (value !== this[privateName]) {\n this[privateName] = value\n if (this.$) {\n this.$.update()\n }\n else {\n this.update()\n }\n }\n }\n }\n }\n\n // create getter and setter\n this._createProperty(p, name,\n v.get || function () { return this[privateName] },\n v.set || setter\n )\n }\n }", "title": "" }, { "docid": "bbff8365063d793325f5f19b704e4672", "score": "0.566681", "text": "acceptProperties(...ar) {\r\n\r\n ar.forEach(p => {\r\n if (typeof (p) === \"string\") {\r\n p = {\r\n name: p\r\n }\r\n }\r\n\r\n let ix = this.acceptedProperties.indexOf(a => {\r\n return e.name === p.name\r\n })\r\n\r\n if (ix === -1) {\r\n this.acceptedProperties.push(p);\r\n\r\n // if (this.context.field[p.name] !== undefined || p.default) {\r\n // this[p.name] = this._processProp(p.name, this.context.field[p.name] || p.default);\r\n // }\r\n }\r\n else {\r\n // merge new (subclassed) accepted properties\r\n this.acceptedProperties[ix] = {\r\n ...this.acceptedProperties[ix],\r\n ...p\r\n }\r\n\r\n }\r\n\r\n if (typeof (this.context.field[p.name]) !== \"undefined\") {\r\n this[p.name] = this._processProp(p.name, this.context.field[p.name]);\r\n }\r\n else if (typeof (p.default) !== \"undefined\") {\r\n this[p.name] = this._processProp(p.name, p.default);\r\n }\r\n\r\n });\r\n }", "title": "" }, { "docid": "487e618abd710135d286674ac05d806d", "score": "0.56661314", "text": "static get properties() {\n return {\n message: { type: String },\n myBool: { type: Boolean },\n myArray: { type: Array },\n basePath: { type: String }\n\n };\n }", "title": "" }, { "docid": "81e3b6ed89096d74f30b0d5f3559fb87", "score": "0.5662509", "text": "function updateGeneralProperties() {\n pageHandler.getGeneralProperties().then(\n response => setPropertiesInPage(response.properties));\n}", "title": "" }, { "docid": "37238f08b96644c79e9003e526f618e3", "score": "0.5660234", "text": "function getSettings() {\n \n var dprops = PropertiesService.getDocumentProperties().getProperties();\n var uprops = PropertiesService.getUserProperties().getProperties();\n \n var settings = {};\n \n settings['fig'] = 'figur_Figure_figure _null_null_null_figure _null_null_null';\n settings['tab'] = 'table_Table_table _null_null_null_table _null_null_null';\n settings['equ'] = 'equat_Equation_equation _null_null_null_equation _null_null_null';\n \n for (var i in uprops) {\n if (i.substr(0,5) === 'cross') {\n settings[i.substr(6,i.length)] = uprops[i];\n }\n }\n \n for (var i in dprops) {\n if (i.substr(0,5) === 'cross') {\n settings[i.substr(6,i.length)] = dprops[i];\n }\n }\n\n return settings\n}", "title": "" }, { "docid": "56de3009b407d132e3e3d42c5456d829", "score": "0.5659217", "text": "function mostrarProps(meuCarro, meuCarro) {\n var resultado = \"\";\n for (var i in meuCarro) {\n if (meuCarro.hasOwnProperty(i)) {\n resultado += meuCarro + \".\" + i + \" = \" + meuCarro[i] + \"\\n\";\n }\n }\n return resultado;\n}", "title": "" }, { "docid": "c621976c5b856e0dcd685f83c623956b", "score": "0.5654359", "text": "function FileProperties(props) {\n props = props || {};\n\n function _get(val) {\n return function () {\n return props[val];\n };\n }\n\n this.__defineGetter__(\"dateCreated\", _get(\"dateCreated\")); //tablet only\n this.__defineGetter__(\"dateModified\", _get(\"dateModified\"));\n this.__defineGetter__(\"directory\", _get(\"directory\"));\n this.__defineGetter__(\"fileExtension\", _get(\"fileExtension\"));\n this.__defineGetter__(\"isHidden\", _get(\"isHidden\"));\n this.__defineGetter__(\"isReadonly\", _get(\"isReadonly\")); //handset only\n this.__defineGetter__(\"mimeType\", _get(\"mimeType\")); //handset only\n this.__defineGetter__(\"size\", _get(\"size\"));\n}", "title": "" }, { "docid": "efebbcab786cd1f32468613876e0f49e", "score": "0.5627146", "text": "static get properties() {\n return {\n editor: {\n type: Object,\n value: null\n },\n hidden: {\n type: Boolean,\n value: true,\n reflectToAttribute: true\n },\n observer: {\n type: Object,\n value: null\n },\n range: {\n type: Object,\n value: null,\n observer: \"_updateToolbar\"\n },\n toolbar: {\n type: Object,\n value: null\n }\n };\n }", "title": "" }, { "docid": "72e54b486f79ac2b5c586c5c17bf5f91", "score": "0.56260306", "text": "static get properties () {\n return {\n template: {\n type: String,\n attribute: 'template'\n },\n parsedString: {\n type: String\n /*,\n computed: 'parse(template)' */\n },\n fetchedWordlistCount: {\n type: Number,\n value: 0\n },\n capitalize: {\n type: Boolean\n },\n partsOfSpeechMap: {\n type: Object\n },\n templateEntropy: {\n type: Number,\n reflect: true,\n attribute: 'template-entropy'\n },\n maxWordLength: {\n type: Number,\n attribute: 'max-word-length'\n }\n }\n }", "title": "" }, { "docid": "38daf8afb89c0a193dfd8b9bb4bf0c4a", "score": "0.5623044", "text": "addPropertyTypes(name = '_propertyTypes')\n {\n const _properties = this.config;\n if (_properties && typeof _properties === 'object')\n {\n const _names = Object.keys(_properties);\n if (_names.length)\n {\n const _requires = this.file.requires;\n const _result = {};\n _names.sort().forEach(\n name =>\n {\n const _property = _properties[name];\n if (!_property.readonly)\n {\n let _type = _property.type;\n if (_type)\n {\n const _isArray = _type.indexOf('[]') !== -1;\n _type = _type\n .replace('[]', '')\n .replace('|null', '');\n if (_type.indexOf('.') === -1)\n {\n const _nativeType = this.camelize(_type);\n if (global[_nativeType])\n {\n _type = _nativeType;\n }\n }\n else\n {\n if (!_requires.getItem(_type))\n {\n _requires.setItem(_type);\n }\n _type = this.camelize(_type);\n }\n _result[name] = _isArray\n ? [ _type ]\n : _type;\n }\n }\n }\n );\n if (Object.keys(_result).length)\n {\n const _prop = this.addProperty(\n {\n desc : this.tr('Tipos de datos de las propiedades de la clase.').split('\\n'),\n name : name,\n override : true,\n value : _result\n }\n );\n _prop.value = _prop.value.replace(/\\'/g, '')\n }\n }\n }\n }", "title": "" }, { "docid": "163eee774f6563ae44e0d275beb71d46", "score": "0.561944", "text": "get properties() {\n\t\treturn [\"accept\",\"animation\",\"appendTo\",\"autoUpload\",\"directory\",\"disabled\",\"dropZone\",\"hideFooter\",\"itemTemplate\",\"locale\",\"localizeFormatFunction\",\"messages\",\"multiple\",\"name\",\"readonly\",\"responseHandler\",\"rightToLeft\",\"setHeaders\",\"showProgress\",\"theme\",\"uploadUrl\",\"unfocusable\",\"validateFile\"];\n\t}", "title": "" }, { "docid": "51d36c6828ded885a4f33de3adfa8507", "score": "0.56186455", "text": "static get properties() {\n return {\n 'checkable': {\n value: false,\n type: 'boolean'\n },\n 'checked': {\n value: false,\n type: 'boolean'\n },\n 'checkMode': {\n value: 'checkbox',\n type: 'string'\n },\n 'dropDownHeight': {\n value: null,\n type: 'number?'\n },\n 'expanded': {\n value: false,\n type: 'boolean'\n },\n 'label': {\n value: '',\n type: 'any'\n },\n 'level': {\n value: null,\n type: 'number?'\n },\n 'separator': {\n value: false,\n type: 'boolean'\n },\n 'value': {\n value: null,\n type: 'any'\n }\n };\n }", "title": "" }, { "docid": "bc039f71be4eb43275bcd3b6ab80f46d", "score": "0.5597037", "text": "newPropertiesSheet() {\n this.properties_sheet = new ObjectStorageBucketProperties(this.artefact)\n }", "title": "" }, { "docid": "da66aadac2bfdfa53ef7b596ae329611", "score": "0.55958027", "text": "static get properties() {\n return {\n source: {\n type: Array,\n value: function () {\n return [];\n }\n },\n files: {\n type: Array,\n value: function () {\n return [];\n }\n },\n payload: {\n type: Object,\n value: function () {\n return {};\n }\n },\n uploadUrl: {\n type: String\n },\n uploadAttribute: {\n type: String,\n value: 'files'\n },\n autoUpload: {\n type: Boolean\n }\n };\n }", "title": "" }, { "docid": "812f8a8acd58cde642dc5504ec562da3", "score": "0.55953974", "text": "_initProperties(props, defaults, update){\n console.assert(this._modelProperties !== undefined, \"Tried to call initProperties before model properties array created. Did you call initProperties before super(args, props) in a constructor?\");\n if(defaults !== undefined){\n this.setProperties(defaults, false);\n }\n var propsPresent = (typeof props)===\"object\";\n if((props===undefined) || Object.entries(props).length<1){propsPresent=false};\n this.setProperties(props, propsPresent);\n }", "title": "" }, { "docid": "374c1ad27e676b28411ec55b8c9ee906", "score": "0.5584019", "text": "function addProperties(node, props) {\n // Find the relevant property section\n for (var propId in props) {\n var prop = props[propId];\n if (prop.objectid === node.objectid) {\n addSubProperties(node, prop.properties);\n }\n }\n}", "title": "" }, { "docid": "eb2d82d2524417ba76ec369555170bc9", "score": "0.5575541", "text": "get properties() {\n\t\treturn [\"allowDrag\",\"allowDrop\",\"alternationCount\",\"alternationEnd\",\"alternationStart\",\"animation\",\"autoSort\",\"dataSource\",\"disabled\",\"displayLoadingIndicator\",\"displayMember\",\"dragFeedbackFormatFunction\",\"dragOffset\",\"dropAction\",\"editable\",\"filterable\",\"filterCallback\",\"filterMode\",\"filterInputPlaceholder\",\"grouped\",\"groupMember\",\"horizontalScrollBarVisibility\",\"incrementalSearchDelay\",\"incrementalSearchMode\",\"itemHeight\",\"itemMeasureMode\",\"items\",\"itemTemplate\",\"loadingIndicatorPlaceholder\",\"loadingIndicatorPosition\",\"locale\",\"localizeFormatFunction\",\"messages\",\"name\",\"placeholder\",\"readonly\",\"rightToLeft\",\"selectedIndexes\",\"selectedValues\",\"selectionMode\",\"selectionChangeAction\",\"sorted\",\"sortDirection\",\"theme\",\"topVisibleIndex\",\"unfocusable\",\"value\",\"valueMember\",\"verticalScrollBarVisibility\",\"virtualized\"];\n\t}", "title": "" }, { "docid": "9c92b4053b2c77571293f9e75be7d578", "score": "0.5573304", "text": "function loadObjectProperties(grip) {\n return ({ dispatch, client }) => {\n dispatch({\n type: constants.LOAD_OBJECT_PROPERTIES,\n objectId: grip.actor,\n [PROMISE]: client.getProperties(grip)\n });\n };\n}", "title": "" }, { "docid": "251d6377dd2f7bc8fbacefbc99ff74b6", "score": "0.5554706", "text": "serialize() {\n\t\tvar prop = this.properties;\n\t\tvar schema = this.constructor.schema;\n\t\t\n\t\tvar out = {};\n\t\t\n\t\tprop.forEach((value, key) => {\n\t\t\tvar type = schema.get(key);\n\t\t\t\n\t\t\tvar serializer;\n\t\t\tif (type.serialize) {\n\t\t\t\tserializer = type.serialize;\n\t\t\t} else if (type.dataType) {\n\t\t\t\tserializer = type.dataType.serialize;\n\t\t\t}\n\t\t\t\n\t\t\tif (typeof serializer !== 'function') {\n\t\t\t\tout[key] = value;\n\t\t\t} else {\n\t\t\t\tout[key] = serializer(value);\n\t\t\t}\n\t\t});\n\t\t\n\t\treturn out;\n\t}", "title": "" }, { "docid": "7bf6475957ac5737ae19d6941872cdea", "score": "0.55368674", "text": "getLicenseeProperties() {\r\n return this.licenseeProperties;\r\n }", "title": "" }, { "docid": "34295277d116312e1cf41ee3e31b3e32", "score": "0.5533505", "text": "toJSON() {\n\t\t\treturn propKeys.reduce((obj, key) => {\n\t\t\t\tobj[key] = this[key];\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\t\t}", "title": "" }, { "docid": "15b607348ade3dafe8b02e3cc45812c1", "score": "0.55302584", "text": "static get properties() {\n return {\n greeting: {type: String},\n };\n }", "title": "" }, { "docid": "fc7f92cbbc76c29c1ba31c05d0db8db0", "score": "0.5527624", "text": "getAll(properties) {\n let entries = {};\n properties.forEach(propName => {\n let resolvedProperty = util_1.removeLeadingDashes(propName);\n let property = this.get(resolvedProperty);\n if (property)\n entries[util_1.toCamelCase(resolvedProperty)] = property;\n });\n return entries;\n }", "title": "" }, { "docid": "101dc1e581304ca9243222bc2b22e51b", "score": "0.5524785", "text": "static get properties() {\n return {\n name: {\n type:String,\n value:'Default value for name'\n }\n };\n }", "title": "" }, { "docid": "60da98ce5886149dfc07a0f85ac8359c", "score": "0.5521861", "text": "function updateProps(temp_settings) {\n \n var docProps = PropertiesService.getDocumentProperties();\n var dprops = docProps.getProperties()\n \n for (var i in dprops) {\n if (i.substr(0,6) === \"cross_\") {\n docProps.deleteProperty(i)\n }\n }\n \n for (var i in temp_settings) {\n var setting = temp_settings[i];\n var code = setting[0].substr(0,3);\n \n var pkey = 'cross_' + code;\n var pvalue = '';\n for (var j = 0; j < (setting.length - 1); j++) {\n pvalue += setting[j] + '_'\n }\n pvalue += setting[setting.length - 1];\n docProps.setProperty(pkey, pvalue);\n }\n \n updateDocument();\n}", "title": "" }, { "docid": "7bd216f321eaa182821f87e2d79234f0", "score": "0.5514598", "text": "static get properties() {\n return {\n /**\n * heading for zoom modal\n */\n heading: {\n type: String,\n },\n\n /**\n * details for zoom modal\n */\n details: {\n type: String,\n },\n /**\n * Image source.\n */\n src: {\n type: String,\n reflect: true,\n attribute: \"src\",\n },\n /**\n * tooltip for the zoom button\n */\n tooltip: {\n type: String,\n },\n /**\n * gallery item's alt text\n */\n zoomAlt: {\n type: String,\n attribute: \"zoom-alt\",\n },\n };\n }", "title": "" }, { "docid": "62a7985ec42e51f2755870b10b6f79e0", "score": "0.5513427", "text": "get schema() {\r\n\r\n let obj = {\r\n ...this.context.field\r\n }\r\n if (obj.id && obj.id.length === 15 && obj.id.startsWith(\"exf\")) {\r\n delete obj.id\r\n }\r\n\r\n obj = JSON.parse(JSON.stringify(obj, (key, value) => {\r\n if (key.startsWith(\"_\"))\r\n return undefined;\r\n return value;\r\n }, 2))\r\n\r\n this.acceptedProperties.forEach(p => {\r\n if (typeof (p.default) !== \"undefined\") {\r\n if (p.default != this[p.name])\r\n obj[p.name] = this[p.name]\r\n }\r\n })\r\n return obj;\r\n }", "title": "" }, { "docid": "acd3cf43bd52b57bf103d77505acbf48", "score": "0.5510705", "text": "function PersistProperties() {\n if (customPropertiesAreLoaded) {\n customProperties.saveAsync(savePropertiesCallback);\n }\n}", "title": "" }, { "docid": "bcd9e1319370c0ba3a6acebfb036532c", "score": "0.55106986", "text": "function getProperties(node, props) {\n if (props === 'all') {\n props = [];\n for (const prop in node) {\n props.push(prop);\n }\n }\n else if (!props) {\n props = [];\n }\n const mapping = {};\n for (const prop of props) {\n try {\n const firstChar = prop.charCodeAt(0);\n if (firstChar >= 65 && firstChar <= 90) {\n continue;\n }\n const val = node[prop];\n const type = typeof val;\n if (type == 'string' || type == 'number' || type == 'boolean') {\n mapping[prop] = val;\n }\n }\n catch (e) {\n // do nothing\n }\n }\n // let's add one special one that's useful for some purposes\n mapping.source_url = window.location.href;\n // for some pages, the strings for various text-y things get crazy long\n // we're going to play around with truncating them to see if this helps with\n // some memory issues\n // todo: is 300 a good limit?\n utils_1.Utilities.truncateDictionaryStrings(mapping, 300, [\"xpath\"]);\n return mapping;\n }", "title": "" }, { "docid": "9fd2321fe6e7fdfd2d26b75febe50fac", "score": "0.5496398", "text": "function Produto(nome, preco) {\n this.nome = nome;\n this.preco = preco;\n}", "title": "" }, { "docid": "9fd2321fe6e7fdfd2d26b75febe50fac", "score": "0.5496398", "text": "function Produto(nome, preco) {\n this.nome = nome;\n this.preco = preco;\n}", "title": "" }, { "docid": "f4a45a58e8540bb2f4b35b2401dd14c4", "score": "0.5487942", "text": "static get properties() {\n return {\n /**\n * heading for zoom modal\n */\n heading: {\n type: String\n },\n\n /**\n * details for zoom modal\n */\n details: {\n type: String\n },\n /**\n * Image source.\n */\n src: {\n type: String,\n reflect: true,\n attribute: \"src\"\n },\n /**\n * tooltip for the zoom button\n */\n tooltip: {\n type: String\n },\n /**\n * gallery item's alt text\n */\n zoomAlt: {\n type: String,\n attribute: \"zoom-alt\"\n }\n };\n }", "title": "" } ]
951ba02eb328a2a8e7c5cb968a384cfa
Makes sure that the game is in the loop
[ { "docid": "cc416c980bd59cc86164be357421280f", "score": "0.6867026", "text": "function startGame() {\n window.setInterval(gameLoop, 10);\n }", "title": "" } ]
[ { "docid": "0c43e08141c20604bb5bed4db5f8e128", "score": "0.8007111", "text": "gameLoop(){\n do {\n this.print(); \n this.location(); \n this.winCheck(); \n } while (this.gameOn === true);\n }", "title": "" }, { "docid": "c6c9dced6dfd528f89971fc268b1d058", "score": "0.7725249", "text": "function gameLoop() {\n\t\tif (data.running) {\n\t\t\tupdate();\n\t\t\trender();\n\t\t}\n\t\telse if( data.atoms.length <= 1 )\t// game not running and none atoms spawned\n\t\t{\t\t\t\t\t\t\t\t\t//\tmeans we are on START OF GAME\n\t\t\n\t\t}\n\t\telse\t\t\t\t\t\t\t\t// game not running and several atoms has\n\t\t{\t\t\t\t\t\t\t\t\t// spawned means we're at END OF GAME\n\t\t}\n\t} // end gameLoop()", "title": "" }, { "docid": "cbcf6c6cd607c84fc6f5948dea5b1fb5", "score": "0.7665988", "text": "function gameLoop() {\n // setInterval to check game state\n\n // collision detection\n\n\n // check cactus outside canvas\n\n // check if game over\n}", "title": "" }, { "docid": "50b93dc420cf405f703ce99162e90747", "score": "0.7557731", "text": "function _loop() {\n\t\t_doBehaviors();\n\t\t_checkDeathrattles();\n\t\t_decrementThreatTimer();\n\t\t_decrementCooldownTimers();\n\t\t_decreaseDamageTimer();\n\t\t_self.decreaseHitTimer();\n\t\t_checkTarget();\n\t\t_trackBody();\n\t\t//_checkCourse();\n\t}", "title": "" }, { "docid": "08a814822c9fb8e25e082ae2172b4661", "score": "0.75456804", "text": "function loop() {\n draw();\n check();\n }", "title": "" }, { "docid": "dc7cb2b7f576c818901ccbf6bf5fb2b1", "score": "0.7501872", "text": "function runGame() {\n\tcheckClear();\n\tspawn();\n\texisting();\n\tcountDown();\n\tif (timer == 0) {\n\t\tgameOn = false;\n\t}\n}", "title": "" }, { "docid": "4db07187914aadee24a2912f30060601", "score": "0.74865764", "text": "function loop() {\n switchGameState();\n\tstage.update();\n\tmouseChecking();\n //console.log(GAME_STATE);\n}", "title": "" }, { "docid": "b34aea047aa321915d9577c1f6200a4d", "score": "0.7418222", "text": "function gameLoop() {\n if(!(game.gameOver || game.paused)) {\n updateLogic();\n renderingStep();\n checkGameOver();\n window.requestAnimationFrame(gameLoop);\n }\n}", "title": "" }, { "docid": "dddf1a400fa46f0a62051a7dd63d0379", "score": "0.72956717", "text": "function loop(){\n if (stats.time == 0) {\n cancelAnimationFrame(loop)\n clearInterval(globalTime);\n pubsub.emit('gameOver', stats.score)\n init(difficult);\n\n \n } else{\n setActive();\n spawn();\n requestAnimationFrame(loop);\n }\n uiTime.innerHTML = stats.time\n uiScore.innerHTML = stats.score\n }", "title": "" }, { "docid": "90d5e8142dd8d300f5e64740ab98b06e", "score": "0.72187895", "text": "function gameLoop(){\n\t//CONTROLS WHAT SHOWS\n\tif (gamestate == \"MENU\"){\n\t\tclear();\t\t\n\t\tdraw(); //Draw current game in BG\n\t\tmenu();\n\t}\n\tif (gamestate == \"INGAME\"){\t\n\t\tcheckTime();\n\t\tfogOfWar();\t\n\t\tclear();\n\t\taddEnemy();\t\n\t\tgetInput();\t\t\n\t\tcheckCollision();\n\t\tmoveEnemy();\t\n\t\tmoveBullets();\n\t\tmovePlayer();\t\n\t\tdraw();\n\t\tupdateLives();\n\t\tcheckDestroyed();\n\t}\n}", "title": "" }, { "docid": "212875977500cc923f77467c30f3870d", "score": "0.7192984", "text": "function gameLoop() {\r\n\tclearCanvas();\r\n\tdrawStarfield();\r\n\tif (alive && gameStarted && health > 0) {\r\n\t\thitTest();\r\n\t\tshipCollision();\r\n\t\tmoveLaser();\r\n\t\tmoveEnemies();\r\n\t\tdrawEnemies();\r\n\t\tdrawShip();\r\n\t\tdrawLaser();\r\n\t}\r\n\tscoreTotal();\r\n\tvar game = setTimeout(gameLoop, 1000 / 30);\r\n}", "title": "" }, { "docid": "bbe6882e3d51a6968b57c09593dfcdf8", "score": "0.71850485", "text": "function gameLoop() {\n\t\n\tgameLogic();\n\trender();\n\t\n}", "title": "" }, { "docid": "f196fe29231adbc2dcc0c3eed60515d4", "score": "0.71665955", "text": "gameLoop() {\n if (this.paused === true) {\n return;\n }\n if (this.slowMotionFramesLeft > 0) {\n this.slowMotionNumOfSkippedFrames++;\n if (\n this.slowMotionNumOfSkippedFrames %\n Math.round(this.normalFPS / this.slowMotionFPS) !==\n 0\n ) {\n return;\n }\n this.slowMotionFramesLeft--;\n this.slowMotionNumOfSkippedFrames = 0;\n }\n // catch keyboard input and freeze it\n this.keyboardArray[0].getInput();\n this.keyboardArray[1].getInput();\n this.state();\n }", "title": "" }, { "docid": "9854b846cf8f8080cdccd6a86d771f2f", "score": "0.71369445", "text": "function gameLoop() {\n clearCanvas();\n drawStarfield()\n if (alive && gameStarted && lives > 0) {\n hitTest();\n shipCollision();\n moveLaser();\n moveEnemies();\n drawEnemies();\n drawShip();\n drawLaser();\n }\n scoreTotal();\n game = setTimeout(gameLoop, 1000 / 30);\n}", "title": "" }, { "docid": "a4aaddaf25fde4ad9a2d854041f54630", "score": "0.7130961", "text": "function mainGameLoop() {\n\n clearTimeout(gameState.gameTimer);\n gameState.gameTimer = null;\n frameZIndexCounter = 0;\n if (gameState.currentMode == \"miniGame\") {\n updateLights();\n updateHands();\n }\n gameState.currentGame.processFrame();\n gameState.gameTimer = setTimeout(\"mainGameLoop()\", 42);\n\n}", "title": "" }, { "docid": "ba8656f221563d79531867f52ebbe9d6", "score": "0.71297693", "text": "forfeit() {\n if (this.game != undefined) {\n this.endGame(1);\n }\n }", "title": "" }, { "docid": "dec1ffe75903f0b4afda429eff7e3eeb", "score": "0.7099472", "text": "function gameloop()\n{\n\tmovePaddless();\n}", "title": "" }, { "docid": "f0e952306c63bf98ab841745ee05f27d", "score": "0.7096041", "text": "function hndLoop(_event) {\n /* test.update(); */\n if (Endabgabe.gameCondition == GamesConditions.PLAY) {\n if (!Endabgabe.enemies.getChild(0)) {\n worldGenerator.createNewWorld(Endabgabe.worldNumber);\n movableCamara = true;\n }\n if (movableCamara) {\n if (Endabgabe.avatar.mtxLocal.translation.x > Endabgabe.worldNumber * Endabgabe.worldLength) {\n camaraNode.mtxLocal.translation = new fc.Vector3(Endabgabe.avatar.mtxWorld.translation.x, 0, 0);\n }\n if (Endabgabe.avatar.mtxLocal.translation.x >= (Endabgabe.worldNumber + 1) * Endabgabe.worldLength) {\n movableCamara = false;\n Endabgabe.worldNumber++;\n camaraNode.mtxLocal.translation = new fc.Vector3(Endabgabe.worldLength * Endabgabe.worldNumber, 0, 0);\n worldGenerator.deleteoldWorld(Endabgabe.worldNumber);\n }\n }\n Endabgabe.avatar.update();\n for (let enemy of Endabgabe.enemies.getChildren()) {\n enemy.update();\n }\n for (let item of Endabgabe.items.getChildren()) {\n item.update();\n }\n Endabgabe.viewport.draw();\n }\n else {\n /* avatar.setPause();\n for (let enemy of enemies.getChildren() as Enemy[]) {\n enemy.setPause();\n } */\n }\n }", "title": "" }, { "docid": "f1a164c134140fb31d9b83e5116f2d3e", "score": "0.7044367", "text": "startGame() {\n\t\tthis.completed = false;\n\t\tthis.gameOver = false;\n\t}", "title": "" }, { "docid": "701a569c17b24ea12b34e904977d56ed", "score": "0.70271575", "text": "function gameLoop(){\n clearCanvas();\n drawStarfield();\n\n if(alive && gameStarted && lives > 0){\n hitTest();\n shipCollision();\n moveLaser();\n moveEnemies();\n drawEnemies();\n drawShip();\n drawLaser();\n }\n \n scoreTotal();\n\n game = setTimeout(gameLoop, 1000/30);\n}", "title": "" }, { "docid": "8266e2cfd7f04aa837547a52e7ca26ec", "score": "0.7026412", "text": "loop() {\n\t\tif (this.level < 0) return;\n\t\tif(!this.paused){\n\t\t\t\tthis.update();\n\t\t\t\tthis.render();\n\t\t}\n }", "title": "" }, { "docid": "63dabe2f801911592992ae9be102a050", "score": "0.7018052", "text": "function gameLoop() {\n setTimeout(gameLoop, 40);\n moveMissiles();\n drawMissiles();\n collide();\n}", "title": "" }, { "docid": "87bf4df70ffb562f10d7b35ba2577c27", "score": "0.6994363", "text": "function loop(delta){\n state(delta); //Set to game by default\n}", "title": "" }, { "docid": "d3b66f1d2dd376f6c5d953261e030028", "score": "0.6967807", "text": "function snake_loop() {\n\n snake_move();\n\n setTimeout( snake_loop, 60 );\n\n }", "title": "" }, { "docid": "faa18ead29bc86708fb66db4ae56e81b", "score": "0.6956565", "text": "function gameloop(){\n\tif(game_over==true){\n\t\tpen.clearRect(W,H,0,0);\n\t\talert(\"GAME OVER Bro\");\n\t}\n\tdraw();\n\tupdate();\n}", "title": "" }, { "docid": "b0cc2922b2c33c74d8dd6b2336a40625", "score": "0.69239914", "text": "function main_Game_loop()\r\n\t{\t\r\n\t\tcreate_gameArea();\r\n\t\tin_It_snake();\r\n\t\tgenrate_Food();\r\n\t\ton_KeyPress();\r\n\t\tsnake_Movement_Right();\r\n\t\t\t\r\n\t}", "title": "" }, { "docid": "61f112f35e32ef4d7cbf6b0513df0964", "score": "0.6920389", "text": "GameLoop() {\n\t\tthis.animationFrameID = requestAnimationFrame(this.GameLoop.bind(this));\n\t\tif(MANAGER.gameEnable){\n\t\t\tthis.addedTime = this.pausePassedTime ? this.pausePassedTime : 0;\n\t\t\tthis.pausePassedTime = 0;\n\t\t\tthis.update();\n\t\t\tthis.render();\n\t\t\t\n }\n\t}", "title": "" }, { "docid": "fc12d15e71453545e1b02cee463ef484", "score": "0.69186544", "text": "gameLoop() {\n this.computeFps();\n this.move();\n this.draw();\n }", "title": "" }, { "docid": "8b35513a317eac382e9e5b479dc0e91a", "score": "0.6915452", "text": "function returnToGame(){\n run = true;\n return\n}", "title": "" }, { "docid": "3dc9caabf3f0f3b79e179b57b94dbb29", "score": "0.68898624", "text": "mainLoop() {\n while (this.roundSpeed > 0) {\n let tickNum = 0;\n while (this.running) {\n spaceInvaders.draw();\n tickNum++;\n this.tickBullets();\n if (!(tickNum % this.roundSpeed)) {\n this.tickInvaders();\n }\n\n if (!Math.random(1 * this.roundSpeed)) {\n this.enemyShoot();\n }\n\n basic.pause(250);\n\n if (this.playerShot) {\n this.running = false;\n for (let i = 0; i < 3; i++) {\n led.unplot(this.player.position, this.player.elevation);\n basic.pause(500);\n led.plot(this.player.position, this.player.elevation);\n basic.pause(500);\n }\n\n if (this.player.lives > -1) {\n this.running = true;\n }\n\n this.playerShot = false;\n }\n }\n basic.pause(250);\n basic.clearScreen();\n\n if (this.win) {\n basic.showNumber(21 - this.roundSpeed);\n basic.pause(2000);\n this.roundSpeed--;\n this.makeRound();\n this.running = false;\n this.draw();\n basic.pause(1000);\n this.running = true;\n } else {\n basic.showNumber(21 - this.roundSpeed);\n basic.showString(\"Game over...\");\n return;\n }\n }\n }", "title": "" }, { "docid": "77c3a0722289b9459aa422da8c9a1ef0", "score": "0.6888522", "text": "function gameLoop() {\n //Only run these updates in play state\n if (gameState == constants.PLAY_STATE) {\n //Check if theres a scenery object. If not, generate a random number\n if (game.getChildByName(\"bgObj\") == null) {\n numGen = Math.floor(Math.random() * 100);\n randomSceneryUpdate();\n }\n\n //If there is a scenery object, update it\n if (game.getChildByName(\"bgObj\") != null) {\n sceneryObject.update();\n }\n catHead.update();\n scoreBoard.update();\n collisionCheck();\n }\n\n //Background update can always run\n background.update();\n background2.update();\n\n //If shooting flag is true, check shooting\n if (shooting) {\n checkShooting();\n }\n\n //If exploding, remove after time\n if (exploding) {\n timer++;\n if (timer > constants.EXPLOSION_TIMER) {\n game.removeChild(heartsplosion);\n timer = 0;\n exploding = false;\n }\n }\n stage.update();\n}", "title": "" }, { "docid": "abe275b218bec59a1ac28ac36d5385ac", "score": "0.6879029", "text": "function GameLoop() {\n // Do nothing when the game is paused.\n // Unfortunately this is potentially quite wasteful and inefficient. There exist ways to mimic a process sleep\n // in JavaScript that may be more reasonable. See http://stackoverflow.com/questions/951021/what-is-the-javascript-version-of-sleep\n if (_gamePaused) {\n return;\n }\n\n // If no player-controlled Tetris piece exists, then spawn a new one\n if (!_pieceInPlay) {\n if (!SpawnNewPiece()) {\n // A piece failed to spawn because it would have overlapped with a fixed square.\n // Game over!\n SetGameOver();\n return;\n }\n }\n\n // Redraw the Tetris board, blocks, and player piece\n Draw();\n\n // Handle blocks and the player piece falling due to gravity\n ProcessGravity();\n\n // Check to see if any rows need to be cleared.\n // TODO: It is inefficient and excessive to call this on every GameLoop call. We could do better by only checking for rows to clear\n // when we mark squares as 'fixed' after a player's piece stops moving and is settles at the bottom.\n CheckForRowsCleared();\n}", "title": "" }, { "docid": "b7eba8fbca9a63041e7e4ce4fbdeb697", "score": "0.6874034", "text": "function update() {\n // At every frame, check if the user has won the game\n checkWinCondition();\n}", "title": "" }, { "docid": "3f441ecd84c2c41e6993ccdac4d1cff1", "score": "0.68722165", "text": "function gameLoop() {\n /*\n b2world.Step(\n 1 / fps //frame-rate\n , 10 //velocity iterations\n , 10 //position iterations - The quality of the simulation\n );\n */\n //b2world.DrawDebugData();\n //b2world.ClearForces();\n\n if(playerAvatar !== undefined){\n if(keys[66] === true){\n //resetAvatar();\n }\n\n if(keys[65] === true){\n // a\n socket.emit('rotate left');\n //rotate(playerAvatar, -100);\n //rotate(playerAvatar, -20);\n }\n\n if(keys[68] === true){\n // d\n socket.emit('rotate right');\n //rotate(playerAvatar, 20);\n //rotate(playerAvatar, 100);\n }\n\n if(keys[83] === true){\n // s : thrust down\n socket.emit('thrust down');\n //push(playerAvatar, -100);\n }\n\n if(keys[87] === true){\n // w : thrust up\n socket.emit('thrust up');\n //push(playerAvatar, 150);\n }\n\n if(keys[32] === true){\n if(!shooting){\n shooting = true;\n socket.emit('shoot'); // send update\n //shoot(playerAvatar);\n function functRef() {\n shooting = false;\n }\n setTimeout(functRef, 1500);\n }\n }\n }\n\n setTimeout(gameLoop, 1000/fps);\n }", "title": "" }, { "docid": "3691cea1ca6ab4ef7696b3cf6bf576ea", "score": "0.68635374", "text": "GameLoop() {\n\t\tthis.animationFrameID = requestAnimationFrame(this.GameLoop.bind(this));\n\t\tif(MANAGER.gameEnable){\n\t\t\tthis.addedTime = this.pausePassedTime ? this.pausePassedTime : 0;\n\t\t\tthis.update();\n\t\t\tthis.renderer.render(this.scene, this.camera[this.activeCamera]);\n\t\t\tthis.pausePassedTime = 0;\n\t\t\tthis.time = Date.now();\n }\n\t}", "title": "" }, { "docid": "225fbc35425c637994e9c7228aa3b383", "score": "0.6840314", "text": "function hasGameStarted() {\n if (!startGame) { //if starGame not equal to false then click has occured.\n setTimeout(function() {\n $(\"h2\").remove();\n startGame = true;\n level = 0;\n gamePattern = [];\n nextSequence();\n },400);\n }\n }", "title": "" }, { "docid": "ec22cb264527069d93ac62df5f48aa21", "score": "0.68393534", "text": "function game_loop(){\r\n if(game_over==true){\r\n clearInterval(t);\r\n alert(\"Game Over. \\nPress F5 for Replay\\nYour Score: \"+score);\r\n return;\r\n }\r\n draw();\r\n update();\r\n}", "title": "" }, { "docid": "1bea548adf427cdcbbcf1a48062cae78", "score": "0.68254906", "text": "function run(){\n init();\n int = setInterval(gameLoop, interval);\n}", "title": "" }, { "docid": "daf09e4a8c47bb102d009a2aced430d7", "score": "0.68239564", "text": "function loop() {\n if (game.status == \"playing\") {\n spawn_fruit()\n move_snake()\n const fruit_eaten = eat_fruit()\n manage_body(snake, fruit_eaten)\n }\n}", "title": "" }, { "docid": "278abc293e56f69d76e5a61194df9286", "score": "0.6809465", "text": "function gameLoop(delta) {\n //Update the current game state:\n state(delta);\n}", "title": "" }, { "docid": "22727b78c6d85f9929a94f60b67737b8", "score": "0.6809095", "text": "function updateGameLoop(){\n\n // don't continue if game isn't running\n if(!gameOver) {\n // increase hair length\n $(\"article\").append(growHair);\n // listen for clicks\n $(\"p\").click(hairClicked);\n // check hair length\n checkLastChild();\n }\n}", "title": "" }, { "docid": "1cd8512e7e919833d435ad16739eb374", "score": "0.6807797", "text": "function clockLoop()\n{\n\tif ( g_paused )\n\treturn;\n\n\tvar transition = 400;\n\n\tg_levelDirector.myClock += 1;\n\n\tif (g_levelDirector.myCurrentLevel < 4)\n\t{\n\tg_levelDirector.myCurrentLevel = (g_levelDirector.myClock - (g_levelDirector.myClock % transition)) / transition;\n\t}\n\t\n\tif(g_universe == \"Heaven\"){\n\tg_fuzzle.score += (g_levelDirector.myCurrentLevel+1);\n\t}\n\telse{\n\tg_fuzzle.score += (g_levelDirector.myCurrentLevel+1) * 3;\n\tg_helltimer += 1;\n\t}\n}", "title": "" }, { "docid": "035be817a851c980a211628a8686f985", "score": "0.6807097", "text": "function gameLoop(){\n\tupdatePhysics();\n\tupdateSprites();\n\tsendGameState();\n}", "title": "" }, { "docid": "a9b75dc174b4ac9d0d9f2d8134380e2e", "score": "0.68069744", "text": "function systemLoop() {\n\n // call the current view:\n gameData.state.callback();\n\n // global reset for all views, \n // currently returns to main.\n if (gameData.tools.listener.keys.resetGame) {\n gameData.reset();\n setGameState(gameData, GameState.MAIN_MENU);\n }\n\n // resets the listener for lockout features.\n gameData.tools.listener.update();\n\n // keeps the overall loop going. \n window.requestAnimationFrame(systemLoop);\n }", "title": "" }, { "docid": "74ae5bb9c31d188d3165bddf40ec470b", "score": "0.6798266", "text": "function loop() {\n if (game.status === \"playing\") {\n move_snake()\n const fruit_eaten = eat_fruit()\n snake_body_movement(snake.body, snake.length, snake.head, fruit_eaten)\n spawn_fruit()\n }\n}", "title": "" }, { "docid": "30a51875631a4a02090d374d9daf8fe0", "score": "0.6791687", "text": "function gameLoop(){\n\tdraw();\n\tupdate();\n}", "title": "" }, { "docid": "8b72507a491323623c8d81fcb5b8d0c9", "score": "0.6788594", "text": "function gameOfLifeLoop(grid, stopButton, clearButton) {\n gameOfLifetimeout(grid, stopButton, clearButton, false);\n}", "title": "" }, { "docid": "fdd595847adbd631da51b3c5764ab8ca", "score": "0.6788546", "text": "function Playloop(){\n playing = true;\n (function(){\n if(i < 16){\n snareLoop.playIf(i);\n kickLoop.playIf(i);\n hHLoop.playIf(i);\n crashLoop.playIf(i);\n i++;\n }\n if(i >= 16) {\n i = 0;\n snareLoop.playIf(i);\n kickLoop.playIf(i);\n hHLoop.playIf(i);\n crashLoop.playIf(i);\n }\n })();\n }", "title": "" }, { "docid": "82fac2b7dc2ed7c7952c79db76d1bb36", "score": "0.6747038", "text": "function gameLoop() {\r\n\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n gameUI();\r\n\r\n if (state == 1) {\r\n mainMenu(ctx);\r\n }\r\n\r\n if (state == 2) {\r\n drawFruit(ctx);\r\n drawSnake(ctx); \r\n gameUI();\r\n collisions(); \r\n moveSnake();\r\n }\r\n\r\n if (state == 3) {\r\n gameOver();\r\n }\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "36117a2d27ae2e848920a5e014a22339", "score": "0.6729341", "text": "function checkFinishGame() {\n if (car.right() >= canvasArea.canvas.width) {\n \n stopGame();\n newScreen.winScren();\n setTimeout(unHideButton, 2000);\n setTimeout(resetGame, 1000);\n }\n }", "title": "" }, { "docid": "fc9caf6ae50fd28641da61ed4c3800f7", "score": "0.6712444", "text": "static async runGameLoop() {\n const game = Game;\n switch (game.currentState) {\n case INITIAL:\n // DRAW INITIAL SCREEN\n await game.drawInitialScreen();\n break;\n case GAME_PLAYING:\n // DRAW GAME PLAYING SCREEN\n await game.drawGamePlayingScreen();\n break;\n case GAME_OVER:\n // DRAW GAME OVER SCREEN\n await game.drawGameOverScreen();\n break;\n }\n // CONTROLS THE ANIMATION BY RERUNNING THE GAME LOOP\n window.requestAnimationFrame(function () {\n game.runGameLoop();\n });\n\n }", "title": "" }, { "docid": "e1c5fded71d3db3bcbdd0e63d22b02bf", "score": "0.6711305", "text": "function gameLoop() {\n stats.begin(); // Begin measuring\n //calling method that check wether to enable or diable spinn button\n checkBet();\n stage.update();\n stats.end(); // end measuring\n}", "title": "" }, { "docid": "673e6dfd545f09d1c318a4c4dc527f0f", "score": "0.6708011", "text": "function gameLoop() {\n update(timeElapsed);\n render();\n past = current;\n current = performance.now();\n timeElapsed = current - past;\n\n if (!quit) {\n requestAnimationFrame(gameLoop);\n }\n}", "title": "" }, { "docid": "18a1d469a089d43a038f9e7206e237c2", "score": "0.6704195", "text": "function continueGame(){\n\tinitializeGame();\n\tloadGame();\n}", "title": "" }, { "docid": "18a1d469a089d43a038f9e7206e237c2", "score": "0.6704195", "text": "function continueGame(){\n\tinitializeGame();\n\tloadGame();\n}", "title": "" }, { "docid": "1c31080e8709b2460a00427944a91b33", "score": "0.66988355", "text": "function loop() {}", "title": "" }, { "docid": "0997705b96ea4948192f0da5b7bc8daf", "score": "0.6696622", "text": "function stage6LoopAndCheck() {\n drawObjectivesStage6();\n drawImageStage5();\n thisBall.update();\n thisBall.draw();\n thisTarget.draw();\n if (isCollided(thisBall, thisTarget)) {\n thisBall.isActive = false;\n clearInterval(timer);\n instructionStage = 1;\n }\n if (outOfBounds(thisBall)) {\n instructionStage = 0;\n }\n}", "title": "" }, { "docid": "bbbbe075cc1111918164c506846533b3", "score": "0.6694677", "text": "function gameLoop () {\n\n if (game.isOver()) {\n\n } else {\n // clear previous frame\n // ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // draw this frame\n game.animate();\n }\n\n // prepare to draw next frame\n window.requestAnimationFrame(gameLoop);\n}", "title": "" }, { "docid": "223a2a328362a500386eac4d6f8f9a32", "score": "0.6693982", "text": "function GameLoop() {\n\n if (!$scope.GameState.running) return;\n\n var tetrominoCanFall = Game.checkIfTetrominoCanMoveDown($scope.GameState.fallingTetromino, $scope.GameState.board);\n if (tetrominoCanFall) {\n\n Game.modifyBoard($scope.GameState.fallingTetromino, $scope.GameState.board, Game.BoardActions.REMOVE);\n $scope.GameState.fallingTetromino.y++;\n Game.modifyBoard($scope.GameState.fallingTetromino, $scope.GameState.board, Game.BoardActions.ADD);\n\n } else {\n\n //tetromino is solidified. Check for game over and Send the next one.\n if ($scope.GameState.fallingTetromino.y == 0) {\n GameOver();\n } else {\n\n //solidify tetromino\n Game.modifyBoard($scope.GameState.fallingTetromino, $scope.GameState.board, Game.BoardActions.SOLIDIFY);\n\n //clear completed lines\n var currentLevel = $scope.GameState.level;\n var howManyLinesCompleted = 0;\n while (Game.checkForTetris($scope.GameState)) {\n howManyLinesCompleted++;\n }\n\n if (howManyLinesCompleted > 0) {\n\n if (howManyLinesCompleted == 1)\n $(\"#Game\").effect(\"shake\", { direction: \"left\", distance: \"5\", times: 3 }, 500);\n else if (howManyLinesCompleted == 2)\n $(\"#Game\").effect(\"shake\", { direction: \"left\", distance: \"10\", times: 4 }, 600);\n else if (howManyLinesCompleted == 3)\n $(\"#Game\").effect(\"shake\", { direction: \"left\", distance: \"15\", times: 5 }, 700);\n else if (howManyLinesCompleted == 4) {\n $(\"#Game\").effect(\"shake\", { direction: \"left\", distance: \"30\", times: 4 }, 500);\n $(\"#Game\").effect(\"shake\", { direction: \"up\", distance: \"30\", times: 4 }, 500);\n }\n\n var scoreFontSize = 25 + (howManyLinesCompleted - 1) * 15;\n $(\".GameScoreValue\").animate({ fontSize: scoreFontSize + \"px\" }, \"fast\");\n $(\".GameScoreValue\").animate({ fontSize: \"14px\" }, \"fast\");\n\n //give extra points for multiple lines\n $scope.GameState.score = $scope.GameState.score + 50 * (howManyLinesCompleted - 1);\n if (howManyLinesCompleted == 4) {\n $scope.GameState.score = $scope.GameState.score + 500;\n }\n\n if ($scope.getSoundFX()) {\n if (howManyLinesCompleted == 1)\n soundEffectsService.play(app.SoundEffectEnum.LineComplete1);\n else if (howManyLinesCompleted == 2)\n soundEffectsService.play(app.SoundEffectEnum.LineComplete2);\n else if (howManyLinesCompleted == 3)\n soundEffectsService.play(app.SoundEffectEnum.LineComplete3);\n else if (howManyLinesCompleted == 4)\n soundEffectsService.play(app.SoundEffectEnum.LineComplete4);\n\n if ($scope.GameState.level > currentLevel) soundEffectsService.play(app.SoundEffectEnum.NextLevel);\n }\n\n backgroundAnimationInfo = { Color: $scope.getGameColor($scope.GameState), AlternateColor: makeColorLighter($scope.getGameColor($scope.GameState), 50), Duration: 1500 - ($scope.level - 1) * 30 };\n }\n\n //send next one\n if ($scope.getSoundFX()) soundEffectsService.play(app.SoundEffectEnum.Drop);\n if ($scope.GameState.nextTetromino) {\n $scope.GameState.fallingTetromino = $scope.GameState.nextTetromino;\n } else {\n $scope.GameState.fallingTetromino = GetNextRandomTetromino();\n }\n $scope.GameState.nextTetromino = GetNextRandomTetromino();\n $scope.GameState.nextTetrominoSquares = Tetromino.getSquares($scope.GameState.nextTetromino);\n\n tetrominoCanFall = Game.checkIfTetrominoCanMoveDown($scope.GameState.fallingTetromino, $scope.GameState.board);\n if (!tetrominoCanFall) {\n GameOver();\n } else {\n Game.modifyBoard($scope.GameState.fallingTetromino, $scope.GameState.board, Game.BoardActions.ADD);\n }\n\n\n }\n\n }\n\n //set the game timer. The delay depends on the current level. The higher the level, the fastest the game moves (harder)\n gameInterval = $timeout(GameLoop, Game.getDelay($scope.GameState));\n\n }", "title": "" }, { "docid": "6b05bd12ac06cfa2847ffe69ec92da35", "score": "0.666874", "text": "function checkGameStatus() {\n if (lives > 0 && missileBuffer.length <= 0 && gameRunning) {\n gameWinCall();\n }\n }", "title": "" }, { "docid": "90f63a9247aaf1e0ff65f901dfd7c779", "score": "0.6663582", "text": "async function CheckWinLoss()\n{\n if (brickList.length == 0)\n\t{\n\t\tcollidableMeshList.pop();\n\t\tlevel++;\n\t\tSetLevel();\n if (level !== 19)\n\t\t{\n\t\t\tballPrime.ResetBall();\n\t\t\tvar levelDisplay = new SpriteText(\"Level \" + level, new THREE.Vector3(-1, 8, 0));\n\t\t\tscene.add(levelDisplay);\n\t\t\tlet delay = await WaitDelay(3000);\n\t\t\tscene.remove(levelDisplay);\n\t\t\tballPrime.StartBall();\n }\n\t}\n if (lives == 0)\n\t{\n\t\t//Game Over Man\n\t\ttextScreen = true;\n\t\tcollidableMeshList.pop();\n\t\tscene.remove(paddle.mesh, ballPrime.mesh);\n\t\tRemoveBricks();\n\t\tscene.add(loseGroup);\n\t\ttryAgainScreen = true;\n }\n}", "title": "" }, { "docid": "f283b663ba5f67df23cab93ebbb7b50e", "score": "0.66597766", "text": "function loop() {\n movePlayer(keys, playerOffset, drawPlayer);\n drawPlayer();\n endGame();\n window.requestAnimationFrame(loop);\n}", "title": "" }, { "docid": "e4bc4c3ee59a8c297679ccade75d8262", "score": "0.66596943", "text": "function gameRoomDataLoop() {\n\n}", "title": "" }, { "docid": "f8974f3e446ecfef7eaf1a637bb46155", "score": "0.66526514", "text": "function gameLoop()\n {\n update();\n draw();\n }", "title": "" }, { "docid": "662c5761a053dc7a21b2e10d308782b1", "score": "0.66452074", "text": "function start_game(){\n if (!started){\n game();\n }\n}", "title": "" }, { "docid": "8c8ba2690b64864aa2a361d8442dbf45", "score": "0.66437614", "text": "handleGameLoop() {\n this.x = Math.max(0, this.x);\n this.x = Math.min(750, this.x);\n this.y = 0;\n this.y = 550;\n this.speed = 0;\n }", "title": "" }, { "docid": "9c679bba36cf036bd0fa70afca178ad9", "score": "0.6641201", "text": "function runOrEnd() {\r\n if ([...deadSnake].filter((x) => x === 1).length !== numberOfPlayers) {\r\n setTimeout(gameLoop, fps);\r\n } else {\r\n textAboutWinner();\r\n goToSaveHighScore();\r\n }\r\n}", "title": "" }, { "docid": "cfccdfbf0102b0747a9abe2b82cf61e0", "score": "0.6623233", "text": "function gameLoop() {\n /* \nthis is important because it will only run the makeObstalces code after 9 seconds.\n*/\n setTimeout(makeObstacles, 9000);\n collisionDetection();\n console.log(\"gameloop running\");\n // below will create an obstacle to appear at a certain point in the game.\n}", "title": "" }, { "docid": "08ae89e0414e047f03996575f300e69d", "score": "0.661282", "text": "mainGameLoop() {\n\n // Update the current time, and store the time interval since the last frame.\n const updatedTime = this.getSeconds();\n // Record time interval, but make sure it has an upper limit to prevent wonky behavior like walking through walls\n const timeInterval = Math.min(updatedTime - this.currentTime, 3*this.targetTimeInterval);\n this.currentTime = updatedTime;\n\n\n\n if (this.paused) {\n return;\n }\n // advance the clock\n this.timePassed+=timeInterval;\n\n \n // Run update method for player, and all ghosts\n this.pacLauren.doUpdate(timeInterval);\n gameMap.ghostRefs.forEach((ghost)=>ghost.doUpdate(timeInterval));\n\n // If enough time has gone by, set the next game mode on the agenda\n if (this.timePassed > this.gamePlan[0][1]) {\n this.timePassed=0;\n this.gamePlan.shift();\n // Scatter mode\n if (this.gamePlan[0][0] === 'scatter') {\n gameMap.ghostRefs.forEach(ghost=>ghost.scatterMode=true);\n }\n // Chase mode\n else {\n gameMap.ghostRefs.forEach(ghost=>ghost.scatterMode=false);\n }\n gameMap.ghostRefs.forEach(ghost=>ghost.reverseDirection());\n }\n\n // Handle the fruit logic!\n if (this.fruitThresholds.length>0 && gameMap.foodEaten > this.fruitThresholds[0]) {\n this.addFruit();\n }\n\n if (this.fruit) {\n // returns true if the fruit hasn't timed out, false otherwise\n if (this.fruit.incrementTime(timeInterval)) {\n if (this.fruit.checkFruitCollision([gameMap.playerRef.column, gameMap.playerRef.row])) {\n this.addToScore(this.fruit.getFruit(), this.fruit.column, this.fruit.row);\n\n this.addToFruitRecord(this.fruit);\n\n this.fruit = null;\n }\n }\n else {\n this.fruit = null;\n }\n }\n\n // Check if every food has been eaten. If it has, go to the next level!\n if (gameMap.foodEaten >= gameMap.foodTotal) {\n this.victory();\n }\n\n if (this.paused) {\n this.runAnimations(false);\n }\n }", "title": "" }, { "docid": "bae544284c576a1dec7d2e3ece72ad37", "score": "0.6612617", "text": "function loop() {\n\t\tide.stepFrame();\n\t\t// world.doOneCycle();\n\t}", "title": "" }, { "docid": "eff1e69b985873994a0b82188a2018fe", "score": "0.6597444", "text": "function game() {\n do {\n\n let playerSelection = playerPlay();\n let computerSelection = computerPlay();\n console.log(\"computer : \" + computerSelection);\n console.log(\" palyer : \" + playerSelection);\n let result = playSingleRound(playerSelection, computerSelection);\n console.log(` ${result} The score [ player : ${scorePlayer} | Computer : ${scoreComputer} ] `);\n } while ((scoreComputer < 5) && (scorePlayer < 5))\n console.log(\"Game Over\");\n if (scoreComputer == 5) { console.log(\" YAAAA3 Computer Wins this time!!! :(\"); } else {\n console.log(\"WOOOHOO YOU Win the game !!! :)\");\n }\n\n}", "title": "" }, { "docid": "bcee4272baaa8083ba61c9070760264b", "score": "0.65905684", "text": "function runTheGameEndlessly() {\n console.log('A completer')\n}", "title": "" }, { "docid": "3ce69c8df5bd4c626e068ff6289249c7", "score": "0.65859145", "text": "function onFinish() {\n runLoop = false;\n}", "title": "" }, { "docid": "b41923f09237cfe3c10db66a934bc1f0", "score": "0.6582657", "text": "function gameLoop() {\n currentStateFunction.update();\n if (stateChanged) {\n changeState(currentState);\n } //if ends\n stage.update(); // Refreshes our stage\n}", "title": "" }, { "docid": "99ddd4e2b1f5b0038103c1dd8a3a4783", "score": "0.6582436", "text": "function gameLoop(e) {\n\n\t\t// bomb_Sprite synchronizes with bomb_Body :\n\n\t\tbomb_Sprite.center = {\n\t\t\tx : chipmunk.cpBodyGetPos(bomb_Body).x,\n\t\t\ty : cpY(chipmunk.cpBodyGetPos(bomb_Body).y)\n\t\t};\n\n\t\t// Move the shadow\n\n\t\tshadow.x = bomb_Sprite.x;\n\t\tshadow.scale(bomb_Sprite.y / shadow.y);\n\n\t\t// blocks_Sprite synchronizes with blocks_Body :\n\t\t// TODO: Check this using _underscore\n\n\t\tvar i = blocks_Sprite.length;\n\n\t\t// Check http://docs.platino.io/#!/guide/chipmunk2d for more info:\n\n\t\twhile (i--) {\n\n\t\t\tif (!chipmunk.cpBodyIsSleeping(blocks_Body[i])) {\n\n\t\t\t\tblocks_Sprite[i].center = {\n\t\t\t\t\tx : chipmunk.cpBodyGetPos(blocks_Body[i]).x,\n\t\t\t\t\ty : cpY(chipmunk.cpBodyGetPos(blocks_Body[i]).y)\n\t\t\t\t};\n\t\t\t\tblocks_Sprite[i].angle = cpAngle(chipmunk.cpBodyGetAngle(blocks_Body[i]));\n\n\t\t\t};\n\n\t\t\tblocks_Sprite[i].changeFaceExpression(bomb_Sprite.center);\n\t\t};\n\n\t\t// bomb countdown, when zero is reached, bomb explodes!\n\n\t\t//A) THE BOMB IS READY > (bombExploded === false)\n\n\t\tif (!bombExploded) {\n\n\t\t\t//B) THE BOMB EXPLODES > bomb_Sprite.checkTimer() returns true > Check lib/bomb.js\n\n\t\t\tif (bomb_Sprite.checkTimer()) {\n\n\t\t\t\tbombExploded = true;\n\t\t\t\texplode();\n\n\t\t\t};\n\n\t\t\t// C) THE BOMB HAS ALREADY EXPLODED > (bombExploded === true)\n\n\t\t} else {\n\n\t\t\t// After the explosion, we need to know when the blocks have stopped to reset the screen:\n\n\t\t\tvar everythingStopped = true;\n\n\t\t\tvar i = blocks_Sprite.length;\n\n\t\t\twhile (i--) {\n\n\t\t\t\tvar velocity = Math.floor(chipmunk.cpBodyGetVel(blocks_Body[i]).y);\n\t\t\t\t//Y VELOCITY OF THE BODY\n\t\t\t\tvar velAbs = Math.abs(velocity);\n\t\t\t\t//ABSOLUTE VALUE OF THE BODY\n\n\t\t\t\tif (velAbs > 1) {\n\t\t\t\t\teverythingStopped = false;\n\t\t\t\t\tbreak;\n\t\t\t\t};\n\n\t\t\t};\n\n\t\t\tif (everythingStopped) {// ONLY IF ALL BLOCKS ARE STOPPED, WE RESET THE SCREEN\n\n\t\t\t\tresetScreen();\n\t\t\t};\n\n\t\t};\n\n\t\t//The following code corresponds to stepPhysics(e.delta). Check http://docs.platino.io/#!/guide/chipmunk2d for more info :\n\n\t\tvar fixed_dt = 1.0 / TICKS_PER_SECOND;\n\t\t_accumulator += e.delta * 0.001;\n\n\t\twhile (_accumulator > fixed_dt) {\n\t\t\tchipmunk.cpSpaceStep(space, fixed_dt);\n\t\t\t_accumulator -= fixed_dt;\n\t\t};\n\n\t}", "title": "" }, { "docid": "3b2731dc65585f507c9b193b467a7e85", "score": "0.6580067", "text": "function onPause() {\n runLoop = false;\n}", "title": "" }, { "docid": "1823914422c9a6ce9868bdfdbae6503b", "score": "0.65784925", "text": "function gameLoop() {\n\n // Update entities.\n state.graphics.clear();\n //state.entities.forEach(invoke('update'));\n\n entities.updateAll();\n commands.update();\n space.collisions.check(entities);\n\n renderer.render(stage);\n\n requestAnimationFrame(gameLoop);\n stats.update();\n }", "title": "" }, { "docid": "90c2502456efc073c666b352fa424f6b", "score": "0.6578177", "text": "function gameLoop() {\n\t\t\t//Press Space in KeyHandler\n\t\t\tif (this.GameStarted) {\n\t\t\t\t\n\t\t\t\tif(this.blocksLeft == 0 && !sent) {\n\t\t\t\t\tthis.win = true;\n\t\t\t\t\t\n\t\t\t\t\tif (this.hitPoints != 0 && this.hitPoints <= 1 && this.canAddScore) { //Ammount of Blocks That Has Been Hit And If It Can Be Added/Not\n\t\t\t\t\t\taddScore(this.BlockWorth); //Adds 250 Only\n\t\t\t\t\t\tthis.canAddScore = false;\n\t\t\t\t\t} else if(this.hitPoints > 1 && this.canAddScore){\n\t\t\t\t\t\tvar ac = this.BlockWorth * (hitPoints * 1.5); //Bonus Points\n\t\t\t\t\t\taddScore(ac); //Adds Original Score(250) With amount of extra points times 1.5 making blocks more Worth foreach block hitted in one run\n\t\t\t\t\t\tthis.canAddScore = false;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tthis.hitPoints = 0; //Reset Hitpoints When Score Has Been Added When Ball Hits Plank\n\t\t\t\t\tInsertHighscore(this.Name,this.score);\n\t\t\t\t\tthis.sent = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this.Name == \"DEMO\") {\n\t\t\t\t\tif(b.getX()<(p.getX()+15)) {\n\t\t\t\t\t\tleft = true;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleft = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (b.getX()>(p.getX()+p.getWidth()-15)) {\n\t\t\t\t\t\tright = true;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tright = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.sticky = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tp.movePlanka(left, right);\n\t\t\t\t\n\t\t\t\t//console.log(this.stuck);\n\t\t\t\tif(!this.stuck) {\n\t\t\t\t\tb.moveBall(this.debug);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tb.followPlank(p.getX()+this.stuckDistance, p.getY()-10);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(b.getY()> this.height) {\n\t\t\t\t\t\n\t\t\t\t\tlifeSystem();\n\t\t\t\t}\n\t\t\t\tif (this.sticky) {\n\t\t\t\t\t\n\t\t\t\t\tthis.stickyCounter++;\n\t\t\t\t\t\n\t\t\t\t\tif(this.stickyCounter>3000) {\n\t\t\t\t\t\n\t\t\t\t\tthis.sticky = false;\n\t\t\t\t\tthis.stickyCounter = 0;\n\t\t\t\t\tthis.stuck = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this.ghostball) {\n\t\t\t\t\t\n\t\t\t\t\tthis.ghostCounter++;\n\t\t\t\t\t\n\t\t\t\t\tif(this.ghostCounter > 750) {\n\t\t\t\t\t\tthis.ghostCounter = 0;\n\t\t\t\t\t\tthis.ghostball = false;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tb.setSKey(sKey);\n\t\t\t\tcollision();\n\t\t\t\tb.speedUp();\n\t\t\t\tif (!this.canSpawnPUBool) {\n\t\t\t\t\t//console.log(this.canSpawnPUTimer);\n\t\t\t\t\tthis.canSpawnPUTimer++;\n\t\t\t\t\tif (this.canSpawnPUTimer == 200) {\n\t\t\t\t\t\tthis.canSpawnPUBool = !this.canSpawnPUBool;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.canSpawnPUBool) {\n\t\t\t\t\t\tthis.puIntervall++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!this.GameStarted) { //Pre-Game Stuff\n\t\t\t\tp.movePlanka(left, right); //Movement of Plank\n\t\t\t\tvar x = p.x + (p.width/2); //Planks X pos\n\t\t\t\tvar y = p.y - (p.height*1) //Planks Y pos\n\t\t\t\tb.followPlank(x,y); //Follows Plank In Pregame, Can Be Used For Power Up\n\t\t\t\t\n\t\t\t\tif(this.Name == \"DEMO\") {\n\t\t\t\t\tthis.GameStarted = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tdraw();\n\t\t\tthis.yHitTimer++;\n\t\t\tthis.xHitTimer++;\n\n\t\t\tif(this.game) {\n\t\t\t\tsetTimeout(\"gameLoop();\", GLSleep);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dd1bb4a19455bfa68ec49f482678e173", "score": "0.6576807", "text": "function gameLoop (){\n ctx.clearRect(0, 0, game.width, game.height);\n if (p1.alive) {\n p1.render()\n gameWin()\n arrLeprechaun.forEach(element => element.render())\n arrProjectiles.forEach(element => element.render())\n detectHit(p1, arrLeprechaun)\n detectProjectile(arrProjectiles, arrLeprechaun)\n detectParameters(arrLeprechaun, p1)\n } else {\n document.addEventListener('keydown', (e) => {\n if (e.which === 13) {\n location.reload();\n }\n })\n }\n }", "title": "" }, { "docid": "514924938e977b4fb8901b5c45594ea8", "score": "0.65752876", "text": "function runGame(e){ //alert(\"runGame()\");\n \n var i;\n \n if(!e.paused){\n \n updateTimer(e.runTime); //changes the time displayed on game timer\n movePropellers(); //animates the propellers\n moveBirds();\n \n for(i = 0; i < movingArr.length; i++){ //process all moving objects\n \n if(!movingArr[i].landed) { //only objects that have not landed\n updatePosition(movingArr[i]); //calculates next position\n renderPosition(movingArr[i]); //moves object to next position\n }\n }\n\n detectLanding(parcel); //checks whether parcel has landed\n\n // updateDebugText();\n stage.update(); //redraws the stage\n }\n}", "title": "" }, { "docid": "f89b2854dd16d7c01e70e5e95ea0e12a", "score": "0.65640813", "text": "function loop(){\r\n ctx.drawImage(backImage, 0, 0, theCanvas.width, theCanvas.height);\r\n drawObjects();\r\n update();\r\n if (! gameOver) {\r\n requestAnimationFrame(loop);\r\n }\r\n}", "title": "" }, { "docid": "3ca9272bedf7651e8137421ce35369e5", "score": "0.65562916", "text": "get isLoop() {\n return true;\n }", "title": "" }, { "docid": "3752089bcb54d2d805fc0fa7f0e142f5", "score": "0.6548513", "text": "function checkGameEnd() {\n\tif (monsters.length < 1)\n\t\tspawnMonsters();\n}", "title": "" }, { "docid": "ccc902dd04d31339c8853f4a49910908", "score": "0.6541585", "text": "function giveup(){\n continue_game();\n}", "title": "" }, { "docid": "acf985e3b6490645c62267dd08e3e0cb", "score": "0.6541413", "text": "function run(){\n game.update()\n game.gameOver()\n game.MainMenu()\n requestAnimationFrame(run);\n}", "title": "" }, { "docid": "274d3ac778f9f57304fb1e1f16e7bacc", "score": "0.6539213", "text": "function loadGameLoop(){ \r\n drawStartScreen();\r\n}", "title": "" }, { "docid": "bd4e3179e019b3dec3a4efa12afbd832", "score": "0.6538679", "text": "function endOfTheGame() {\n if (puzzleCollection.every((puzzlePiece) => puzzlePiece.dx === puzzlePiece.sx && puzzlePiece.dy === puzzlePiece.sy)) {\n gameWon = true; // enable other features (confetti)\n select(\"#newGame\").elt.className = \"\"; // new game button will appear \n clearInterval(timerInterval); // stop timer, counting time it takes to solve puzzle\n\n // hide background music button and play winning music\n select(\"#backGroundMusic\").elt.className = \"hidden\";\n music.src = \"sound/winner.mp3\";\n music.volume = 0.8;\n music.play();\n }\n}", "title": "" }, { "docid": "f60370878d66b30fd749170097380c7e", "score": "0.6534413", "text": "function drawingLoopGame () {\n\t\n\n\tctx.clearRect(0, 0, 1000, 1000);\n\tspctx.clearRect(0, 0, 300, 300);\n\n\tmovingBackground(backgroundWaves1, backgroundWaves2);\n\n\tctx.lineWidth = 8;\n\tctx.strokeStyle = \"#000000\";\n\tctx.strokeRect(0, 0, 1000, 1000);\n\n\tlevelSwitcher();\n\n\t//--------------movement system----------------\n\tmovementSystem();\n\t// side controls\n\n\t\n\tdisplayStats();\n\tmeter();\n\n\n\n\t//request next frame\n\tif (!retryCount) {\n\t\tsetInterval(\n\t\t\trequestAnimationFrame(function () {\n\n\t\t\tdrawingLoopGame();\t\n\t\t\n\t\t\t})\n\t\t, 1000 / 60)\n\t}\n\n\telse if (retryCount) {\n\n\t\treturn;\n\t}; \n\t\t\n}", "title": "" }, { "docid": "a324d6080b4e07baf2e15338edfe61ca", "score": "0.65333253", "text": "runGame(){\n this.print();\n let answer = true;\n while(answer){\n answer = this.ask();\n }\n }", "title": "" }, { "docid": "ccc68d6119e8d5ad856e1bd8c6f6468c", "score": "0.65273577", "text": "function doGetReady () {\n game.state.current = game.state.game\n SWOOSHING.play()\n}", "title": "" }, { "docid": "40c923f91f4971514df4384e821e163c", "score": "0.6516783", "text": "run(){\n this.gameRules();\n\n this.player1 = new player(this.player1);\n this.player2 = new player(this.player2);\n\n console.log('Game Details');\n\n //run loop until one of the playes reaches the max games. \n while(this.player1.points < this.maxGames && this.player2.points < this.maxGames){\n \n //for each round, make sure the entered gesture is valid. \n this.validateGesture(this.player1);\n \n //if game mode is single, randomly select a gesture value for the computer.\n if(this.gameMode == 'Single'){\n this.player2.selection = this.player2.chooseRandomGesture(this.gestureOptions);\n }else{\n \n //if game mode is multiplayer, lets get the input from the human for the second player.\n this.validateGesture(this.player2);\n }\n\n //get the round winner between the two players. \n this.validateResults();\n }\n\n this.diplayWinner();\n\n }", "title": "" }, { "docid": "9b76732b7ea82ad32d5ea500e422a097", "score": "0.6515311", "text": "function gameLoop() {\r\n\t//hide btn\r\n\tdocument.getElementsByName(\"Return\")[0].style.visibility = endOfGame[1].isHidden;\r\n\tdocument.getElementsByName(\"Menu\")[0].style.visibility = endOfGame[1].isHidden;\r\n\t// Position the player paddle first\r\n\tdrawPlayer();\r\n\t\r\n\t// Position the ball and check to stop play\r\n\tif (!drawBall()) {\r\n\t\tself.clearInterval(timer);\r\n\t\tif (totalBlocks<=0) {\r\n\t\t\t// Finished Level\r\n\t\t\tlevel++;\r\n\t\t\tif (level >= levelDefs.length) {\r\n\t\t\t\t// Finished Game\r\n\t\t\t\t//window.alert(\"YOU WIN!\");\r\n\t\t\t\tdocument.getElementById(\"breakOver\").innerHTML=endOfGame[0].text;\r\n\t\t\t\tdocument.getElementById(\"breakOver\").style.display=endOfGame[0].display;\r\n\t\t\t\tdocument.getElementsByName(\"Return\")[0].value=endOfGame[0].resetbtn;\r\n\t\t\t\tdocument.getElementsByName(\"Return\")[0].style.visibility = endOfGame[0].isHidden;\r\n\t\t\t\tdocument.getElementsByName(\"Menu\")[0].style.visibility = endOfGame[0].isHidden;\r\n\t\t\t\tplaySound(SND_WIN);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Play next level\r\n\t\t\t\tnewLevel();\r\n\t\t\t\tplaySound(SND_NEWLEVEL);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Died - need new life\r\n\t\t\tlives--;\r\n\t\t\tif(lives<=0){\r\n\t\t\t\t//game over\r\n\t\t\t\t//window.alert(\"GAME OVER!\");\r\n\t\t\t\tdocument.getElementById(\"breakOver\").innerHTML=endOfGame[1].text;\r\n\t\t\t\tdocument.getElementById(\"breakOver\").style.display=endOfGame[0].display;\r\n\t\t\t\tdocument.getElementsByName(\"Return\")[0].value=endOfGame[0].resetbtn;\r\n\t\t\t\tdocument.getElementsByName(\"Return\")[0].style.visibility = endOfGame[0].isHidden;\r\n\t\t\t\tdocument.getElementsByName(\"Menu\")[0].style.visibility = endOfGame[0].isHidden;\r\n\t\t\t\tplaySound(SND_GAMEOVER);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//new life\r\n\t\t\t\tdropNewBall();\r\n\t\t\t\tplaySound(SND_NEWBALL);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "b8f50f7784e342ef4d6000b5b23aa33c", "score": "0.65140074", "text": "function gameLoop(){\n // let deltaTime = timestamp-lastTime;\n // lastTime = timestamp;\n ctx.clearRect(0,0,gameWidth,gameHeight);\n game.update();\n game.draw();\n if(game.gameState!=\"gameover\")requestAnimationFrame(gameLoop);\n}", "title": "" }, { "docid": "7f41351d07362c22e227609dca811dce", "score": "0.65134615", "text": "function gameLoop() {\r\n stats.update();\r\n checkControls();\r\n stage.update();\r\n // render using requestAnimationFrame\r\n requestAnimationFrame(gameLoop);\r\n // render the scene\r\n renderer.render(scene, camera);\r\n }", "title": "" }, { "docid": "dedfc46b65116ce7edd9592923d5d62d", "score": "0.6512055", "text": "function update_loop() {\n player_snake.clean_tail();\n // enemy actions\n for ( var i = 0; i < scope.ai_snakes; i++ ) {\n ai_snake[i].clean_tail();\n ai_snake[i].compute_action(player_snake.x+player_snake.dir_x,player_snake.y+player_snake.dir_y,candy.x,candy.y);\n if ( ai_snake[i].is_alive() ) {\n response = ai_snake[i].update();\n if ( response === HIT_CANDY ) {\n candy.findSpawn();\n } else if ( response !== null ) {\n ai_snake[i].kill();\n score(kill_bonus);\n } \n }\n }\n // player action\n next_action(); \n response = player_snake.update();\n if ( response === HIT_CANDY ) {\n got_candy();\n } else if ( response !== null ) {\n died();\n return;\n } \n }", "title": "" }, { "docid": "25acf8f546e7c03a461c71d7378a0c82", "score": "0.6511221", "text": "function gameLoop(time) {\r\n\r\n update();\r\n render();\r\n\r\n requestAnimationFrame(gameLoop);\r\n }", "title": "" }, { "docid": "cab5b8abb90ead7057855a6a07948f93", "score": "0.65075254", "text": "function tryNewGame() {\r\n if (gameovertime > gameoverdelay) \r\n {\r\n newGame();\r\n // g_snakes[playerId].changeGameover(false);\r\n gameover = false;\r\n if (firststartgame)\r\n {\r\n firststartgame = false;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "d8aa4c13763a4055e6495763854990f4", "score": "0.65049106", "text": "function startGame() {\n\t/* YOUR CODE HERE */\n\tsetTimeout(endGame, DURATION);\n}", "title": "" }, { "docid": "5ea6a8e9a751a4c588cde55057117999", "score": "0.6503443", "text": "function gameLoop() {\r\n\tif (paused)\r\n\t\treturn;\r\n\r\n\t//calculate delta time\r\n\tlet dt = 1 / app.ticker.FPS;\r\n\tif (dt > 1 / 12) dt = 1 / 12;\r\n\tif (life <= 0) {\r\n\t\tend();\r\n\t\tpaused = true;\r\n\t}\r\n\r\n\t//Update any particles\r\n\tupdateParticle(dt);\r\n\ttimer++;\r\n\tif (timer > 1000) {\r\n\t\ttimer = 0;\r\n\t\tlevel += 1;\r\n\t}\r\n\r\n\t//Player movement\r\n\tif (keys[65]){\r\n\t\tplayer.moveAnticlockwise(distance, centerVoid);\r\n\t}\r\n\telse if (keys[68]){\r\n\t\tplayer.moveClockwise(distance, centerVoid);\r\n\t}\r\n\r\n\t//begin wall logic\r\n\tif (!startScreen) {\r\n\t\t//add walls every so often\r\n\t\tif (wallTimer == 0) {\r\n\t\t\tif (darkMode) {\r\n\t\t\t\twalls.push(CreateWall(0xa450a6));\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twalls.push(CreateWall(0xC0C0C0));\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t//Each frame allow walls to shrink down to the center\r\n\t\tfor (let i = 0; i < walls.length; i++) {\r\n\t\t\twalls[i].Shrink();\r\n\t\t\t//Check if the wall is colliding with the player\r\n\t\t\tif (walls[i].scale.x <= 0.15 && walls[i].scale.x > 0.09) {\r\n\t\t\t\tfor (let j = 0; j < walls[i].points.length - 1; j++) {\r\n\t\t\t\t\tif (CollisionTest(walls[i].points[j], walls[i].points[j + 1], player.center, player.radius)) {\r\n\t\t\t\t\t\tlife -= 1;\r\n\t\t\t\t\t\tgameScene.removeChild(walls[i]);\r\n\t\t\t\t\t\twalls.splice(i, 1);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//If the wall is too small remove it entirely\r\n\t\t\tif (walls[i].scale.x <= 0.09) {\r\n\t\t\t\tgameScene.removeChild(walls[i]);\r\n\t\t\t\twalls.splice(i, 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// gains life every 1000pts\r\n\t\tif (score % 1000 == 0) {\r\n\t\t\tlife += 1;\r\n\t\t}\r\n\r\n\t\t// walls increase every level\r\n\t\twallTimer_Max = 10 / level;\r\n\t\twallTimer += dt;\r\n\t\tif (wallTimer > wallTimer_Max) {\r\n\t\t\twallTimer = 0;\r\n\t\t}\r\n\t\tscore += 1;\r\n\t\tchangeFields();\r\n\t}\r\n}", "title": "" }, { "docid": "e8d54d397831d8f3712b3e329a018c99", "score": "0.65009886", "text": "gameLoop (tick) {\n this.state()\n this.renderer.render(this.stage)\n }", "title": "" } ]
25eb7ec25186a4ee5d58f07cc9aa1bd6
UPDATE: I change the tag hook from tagging the only property (e.g= ".deletenote"), to all the classes "mynotes", this helps me to let javaScript recognizes new posted notes.
[ { "docid": "3b6b0310072fbf74f6d921f020cb4336", "score": "0.0", "text": "events() {\n $(\"#my-notes\").on(\"click\", \".delete-note\", this.deleteNote);\n $(\"#my-notes\").on(\"click\", \".edit-note\", this.editNote.bind(this));\n $(\"#my-notes\").on(\"click\", \".update-note\", this.updateNote.bind(this));\n $(\".submit-note\").on(\"click\", this.createNote.bind(this));\n }", "title": "" } ]
[ { "docid": "fa3b29e7f184005e960e2809ddea6d39", "score": "0.6397687", "text": "function refreshNotesForTagList(notes) {\n $(\"#lblTagName\").html($(\"#pageNotesForTag\").data(\"tagName\"));\n refreshAnyNotesList($(\"#taggedNotesList\"), notes);\n}", "title": "" }, { "docid": "4a8f5cfc20f0bbe7707010005c3ce8c7", "score": "0.63324064", "text": "function populate_tagged_notes(tag){\n $('#note_list').empty()\n $.getJSON(tags_url(tag))\n .done(function(response){\n response.tag.notes.forEach(function(note){\n $('#note_list').append(\n note_display(note)\n )\n })\n })\n }", "title": "" }, { "docid": "21d6f8c8b191fdebd1eedae0bc9751bb", "score": "0.6229446", "text": "function hidenotes(){\n\tvar elements = document.getElementsByClassName(\"note\");\n\tfor(var i = 0, length = elements.length; i < length; i++) {\n\t\telements[i].style.display = 'none';\n\t}\n\tvar elements = document.getElementsByClassName(\"imagenote\");\n\tfor(var i = 0, length = elements.length; i < length; i++) {\n\t\telements[i].style.display = 'none';\n\t}\n}", "title": "" }, { "docid": "8d1f913729591a335594c8fe1bbfa333", "score": "0.5990405", "text": "function updateNotes() {\n\t\tslide = Reveal.getCurrentSlide();\n\t\tnotes = $(slide).find('aside.notes').html();\n\n\t\tif(notes.trim().length == 0){\n\t\t\tnotes = noNotesMessage;\n\t\t}\n\n\t $('.sidenotes .content').html(notes);\n\t}", "title": "" }, { "docid": "57339070a0ac5b5a176779fef61147da", "score": "0.598762", "text": "function print_notes(tags){\n var tag_list = ''\n tags.forEach(function(tag){\n if (tags.indexOf(tag) != (tags.length - 1)){\n tag_list += `<a href=\"${tag.name}\" class=\"tag_href\">${tag.name}</a>,&nbsp;`\n }\n else{\n tag_list += `<a href=\"${tag.name}\" class=\"tag_href\">${tag.name}</a>`\n }\n })\n return tag_list\n }", "title": "" }, { "docid": "f31596a40dc189a1ded8cf155a42a5a1", "score": "0.59442866", "text": "function refreshTagsForNote() {\n var assignedTags = $(\"#pageNoteDetail\").data(\"assignedTags\");\n\n var strTags = \"\";\n for ( var i = 0; i < assignedTags.length; i++) {\n if (strTags.length > 0) {\n strTags += \", \";\n }\n strTags += assignedTags[i].name;\n }\n if (strTags.length > 0) {\n strTags = \"[ \" + strTags + \" ]\";\n }\n\n $(\"#noteDetailTags\").val(strTags);\n }", "title": "" }, { "docid": "9ec969b13964ad220a2f6fa06d865f64", "score": "0.590982", "text": "function highlight() {\n [...document.querySelectorAll('.s-post-summary__watched')].forEach(interestingQuestion => {\n interestingQuestion.classList.remove('s-post-summary__watched');\n interestingQuestion.classList.add('sox-tagged-interesting');\n });\n }", "title": "" }, { "docid": "5e6dc15ea608edee24258a3c8b3d980c", "score": "0.57793814", "text": "function appendToNotes(note){\n $(\"#team-notes\").append('<div class=\"team-note\"><p>'+note+'</p></div>');\n }", "title": "" }, { "docid": "d134b02a8fed4e4fd3bf03725e036ccb", "score": "0.57772654", "text": "getNote() {\n return this.noteElem instanceof $ ? this.noteElem : $();\n }", "title": "" }, { "docid": "afbd172bad414695c7c2309e832c26c3", "score": "0.5709845", "text": "function makeTagsMeta () {\n function tagCount (li) {\n const count = li.lastElementChild.textContent;\n if (count.includes(\"K\")) {\n return Number.parseInt(count, 10) * 1000;\n }\n return Number.parseInt(count, 10);\n }\n\n let tags = getAllElems(SETTINGS.metaTags.map((id) => `#tag_li_${id}`).join(\",\"));\n tags = getAllElems(\"#post_tags li[class=' ']\")\n .filter((li) => li.textContent.includes(\"(cosplay)\"))\n // filter out tags with unknown type\n .filter((li) => li.lastElementChild.textContent.trim() !== \"1\"\n || li.previousElementSibling.nodeName === \"LI\")\n .concat(tags)\n .filter((li) => {\n li.classList.add(\"purple\"); // eslint-disable-line no-param-reassign\n li.firstElementChild.classList.add(\"big_tag\"); // eslint-disable-line no-param-reassign\n return !li.firstElementChild.classList.contains(\"removed\");\n })\n .sort((t1, t2) => tagCount(t2) - tagCount(t1));\n if (tags.length <= 0) return;\n\n const span = getElem(\"#post_tags li[class=' ']\")?.previousElementSibling;\n if (!span) return;\n span.insertAdjacentHTML(\"beforeBegin\", `<span>${TEXT.categories[8]}</span>`);\n tags.forEach((tag) => span.before(tag));\n}", "title": "" }, { "docid": "28b055cb67bfe474aa507fa232bf1cf3", "score": "0.5687203", "text": "add(){\n let notes = document.querySelector('.notes');\n notes.appendChild(this.note);\n }", "title": "" }, { "docid": "e07012dc127c7b5761a532a4551b15c3", "score": "0.56723875", "text": "function removeNotes(e) {\n if (e.target.classList.contains('remove-note')) {\n e.target.parentElement.remove()\n }\n // also remove the note from LS\n removeNotesFromLS(e.target.parentElement.textContent)\n\n }", "title": "" }, { "docid": "bc7aced89aade995f5b724ee08136064", "score": "0.56129533", "text": "getNotes(e) {\n\t\treturn this.notes;\n\t}", "title": "" }, { "docid": "cb6462ee4873ac88ce1bbf8f7d78b122", "score": "0.5598937", "text": "addNewNote(e){\n const newNote = { \n data:{\n title: '', \n content: ''\n },\n selected: false\n }\n if(e.target.className == 'sticky-notes-container'){\n this.addNote(newNote);\n }\n }", "title": "" }, { "docid": "edfd9215ec8a4f75ed5fbb3215cc1e54", "score": "0.55940425", "text": "function updatePageNoteDetail(note) {\n // Save the note in the page for later use from \"external\" contexts\n $page.data(\"note\", note);\n\n $page.find(\"#noteTitle\").val(note.title);\n $page.find(\"#noteBody\").val(note.body);\n\n if (note.favorite) {\n // Yellow for favorite\n setButtonTheme($(\"#btnNoteDetailFav\"), \"e\", \"a\");\n } else {\n // Default black for non-favorite\n setButtonTheme($(\"#btnNoteDetailFav\"), \"a\", \"e\");\n }\n\n retrieveTagsForNote(noteId, function(noteId, assignedTags) {\n $(\"#pageNoteDetail\").data(\"assignedTags\", assignedTags);\n refreshTagsForNote();\n });\n }", "title": "" }, { "docid": "16c64a7abedd5cf9f651315cbf493d5f", "score": "0.5569201", "text": "get notes() {\n\t\treturn this.__notes;\n\t}", "title": "" }, { "docid": "13902c4faadc4d192dc97a89ac86f28c", "score": "0.5563992", "text": "constructor(note) {\n\t\tsuper();\n\n\t\t// Get elements\n\t\tthis.title = $(\".note-title\");\n\t\tthis.description = $(\".note-description\");\n\t\tthis.tagSelector = $(\".tag-selector\");\n\t\tthis.remainChars = $(\".char-remaining\");\n\n\t\t// Initialize tag selector\n\t\tsuper.initTagSelector();\n\n\t\t// Initialize ckeditor\n\t\tCKEDITOR.replace(\"editor\"); // eslint-disable-line no-undef\n\t\tthis.editor = CKEDITOR.instances.editor; // eslint-disable-line no-undef\n\n\t\t// If a note is passed, set page contents\n\t\tif(note) {\n\t\t\tif(note.Tags) {\n\t\t\t\t$(\".tag-selector\").val(note.Tags.map(e => {\n\t\t\t\t\treturn e.ID;\n\t\t\t\t})).trigger(\"change\");\n\t\t\t}\n\t\t\tthis.editor.setData(note.Body);\n\t\t}\n\n\t\t// Set chars remaining\n\t\tthis.setRemainingChars();\n\n\t\t// Set listener on description field\n\t\tthis.description.on(\"keyup\", $.proxy(this.setRemainingChars, this));\n\t}", "title": "" }, { "docid": "4043fa3ce7b73629437b0508c7277cd9", "score": "0.5547925", "text": "function newNote() {\n\t\ttempTitle = getTitle();\n\t\tnote = new tiddlyweb.Tiddler(tempTitle, bag);\n\t\tnote.fields = {};\n\t\tnote.tags = [];\n\t\tnote.fields._created = new Date();\n\t\tloadNote();\n\t}", "title": "" }, { "docid": "0e732d10977738fdab9a7abb28c47b48", "score": "0.5538759", "text": "function writeANote(e){\n setNotes(n=> e.target.value);\n }", "title": "" }, { "docid": "90beb1468f5162af9074d2705006f07c", "score": "0.5515138", "text": "function addTags() {\n /**\n * create entry\n * @param {object} entry note or bookmark entry\n */\n function createEntry(entry) {\n /**\n * get Entry Title\n * @return {string} title\n */\n function getEntryTitle() {\n if (entry.href.match(/wikipedia/)) {\n return entry.href.split('/').pop()\n .replace(/[_-]/g, ' ').replace(/.* of /, '');\n } else return entry.tags[0];\n }\n\n const div = $('<div>', {\n class: 'my-card w3-padding my-margin my-entry',\n }).appendTo($('#entries'));\n\n // title\n const titleDiv = $('<div>', {\n class: 'my-section',\n }).appendTo(div);\n\n if (entry.href.match(/http/)) {\n if (entry.href.match(/comparison/i)) entry.tags.push('Comparison');\n if (entry.href.match(/developer/)) entry.tags.push('Developer');\n if (entry.href.match(/wikipedia/)) entry.tags.push('Wikipedia');\n if (entry.href.match(/films/i)) entry.tags.push('Films');\n if (entry.href.match(/\\bai\\b/i)) entry.tags.push('AI');\n } else {\n entry = getNoteTags(entry);\n }\n\n if (entry.tags[0] != 'Bookmark') {\n const href = `${dir}/notes/${entry.href}.html`;\n $('<a>', {\n class: 'my-highlight w3-large my-link',\n href: entry.href.match(/http/) ? entry.href : href,\n html: getEntryTitle(),\n }).appendTo(titleDiv).css({\n padding: 0,\n }).click(() => {\n window.link = '';\n });\n } else {\n $('<span>', {\n class: 'my-highlight w3-large my-click',\n html: getEntryTitle(),\n }).appendTo(titleDiv).css({\n padding: 0,\n }).click(function() {\n execScripts($(this).text());\n });\n }\n\n let icon = getEntryTitle();\n let style = 'ios-filled';\n let size = 18;\n icon = icon.replace(/Windows/, 'windows client');\n icon = icon.replace(/Office/, 'office 365');\n icon = icon.replace(/VSCode/, 'visual studio logo');\n icon = icon.replace(/Windows/, 'windows client');\n icon = icon.replace(/HTML/, 'HTML 5');\n icon = icon.replace(/CSS/, 'CSS3');\n icon = icon.replace(/Devices/, 'Multiple Devices');\n\n if (icon.match(/Windows/)) {\n style = 'ios-glyphs';\n } else if (icon.match(/NodeJS/)) {\n style = 'windows';\n size = 32;\n }\n const skippedIcons = ['GRE', 'TOEFL', 'Integers', 'Getting Started',\n 'G Suite', 'ESLint', 'JSDoc', 'Formula', 'MDN', 'W3Schools'];\n if (!skippedIcons.includes(icon)) {\n createIcon(icon, titleDiv, '', size, style);\n }\n\n // tags\n const tagDiv = $('<div>').appendTo(div);\n\n $(entry.tags).each(function() {\n createTag(this, tagDiv, toggleFilter);\n });\n }\n\n // create tagsDiv\n // Add element when a tag is selected in tag div. otherwise remove it.\n\n const div = $('#tags').addClass('my-margin');\n $('<span>', {\n class: 'w3-bar-item my-padding',\n html: 'Tags',\n }).appendTo($('<div>', {\n class: `w3-bar w3-padding-small w3-card w3-large ${color} my-round-top`,\n }).appendTo(div));\n const tagsDiv = $('<div>', {\n class: 'w3-padding w3-card',\n id: 'tagsDiv',\n }).appendTo(div);\n\n // Get Entries Object\n\n if (entries) {\n entries.concat({\n href: '',\n tags: ['bookmark'],\n }).forEach((entry) => {\n createEntry(entry);\n }); // Create Entry Div\n entries = $('.my-entry'); // Get Created Entry\n }\n\n const tagsArray = []; // All tags need to be show in tag div on load.\n\n // Create Search Button to Filter Tag\n createSearchBtn(tagsDiv.prev(), filterNodes);\n tagsDiv.prev().children().css({\n padding: '4px 8px',\n }); // override w3-bar-item padding;\n\n // Create tags based on entries Tags\n $('#entries .my-tag').each(function() {\n const text = $(this).text();\n const tag = $(this).html();\n const length = $(`#entries .my-tag:contains('${tag}')`).length;\n if (!tagsArray.includes(text) && length > 1) {\n tagsArray.push(text);\n createTag(text, tagsDiv, toggleFilter);\n }\n });\n}", "title": "" }, { "docid": "4d92af0c312bf5372aeed1eab844315b", "score": "0.5477162", "text": "function shownotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n } else {\n notesobj = JSON.parse(notes);\n }\n let html = \"\";\n notesobj.forEach(function (element, index) {\n html += ` <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\"> ${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\" onclick=\"deletenote(this.id)\" href=\"#\" class=\"btn btn-primary\">Delete Note</button>\n </div>\n </div> `;\n });\n let noteselem = document.getElementById(\"notes\");\n if (notesobj.length != 0) {\n noteselem.innerHTML = html;\n } else {\n noteselem.innerHTML = `NOTHING TO SHOW.USE \"ADD A NOTE\" SECTION ABOVE TO ADD NOTE`;\n }\n}", "title": "" }, { "docid": "75dd5020a229737cc71a2015f3c72f3c", "score": "0.54651237", "text": "function iLearnPedsChangeElements() {\n\n if ($('body').hasClass('ilearn-peds') ){\n\n console.log('page residency');\n\n if (theLanguage === \"fr-FR\") {\n\n $('<a class=\"btn btnNotes\" role=\"button\">Voir et écrire vos notes</a> ').appendTo('aside.sidebar');\n $('<div class=\"Notes\" aria-hidden=\"true\"><textarea id=\"MyNotes\" name=\"MyNotes\" placeholder=\"Nous vous encourageons à entrer quelques notes / questions que vous pourriez avoir en parcourant le module afin de les utiliser pour la discussion plus tard.\" rows=\"40\" onkeyup=\"textAreaAdjust(this)\" style=\"overflow:hidden\" ></textarea></div>').insertAfter('a.btnNotes');\n\n } else {\n\n $('<a class=\"btnNotes\" role=\"button\">View or write your notes</a>').appendTo('aside.sidebar');\n $('<div class=\"Notes\" aria-hidden=\"true\"><textarea id=\"MyNotes\" name=\"MyNotes\" placeholder=\"We encourage you to enter some notes/questions you may have as you go through the module to use them for the discussion later on.\" rows=\"40\" onkeyup=\"textAreaAdjust(this)\" style=\"overflow:hidden\"></textarea></div>').insertAfter('a.btnNotes');\n\n }\n\n\n $(\"aside.sidebar a.notes\").wrap('<div class=\"notepad\"></div>');\n $('div.notepad a.notes').append(' <span class=\"fa fa-pencil-square-o fa-fw\"> </span>');\n\n //Hides the sidebar div element with class myProgress\n $('aside.sidebar div.Notes').hide();\n\n\n if (theLanguage === \"fr-FR\") {\n\n $(\"div.notepad a.notes\").text('Voir et écrire vos notes');\n\n } else {\n\n $(\"div.notepad a.notes\").text('View and write your notes');\n\n }\n\n\n //Toggles the textarea#MyNotes on click event on to add notes\n $(\"aside.sidebar a.btnNotes\").click(function (c) {\n\n c.preventDefault();\n\n $('aside.sidebar div.Notes').toggle( \"slow\", function() {\n // Animation complete.\n });\n\n });\n\n }\n\n}", "title": "" }, { "docid": "c17307d7130e8a4b4385a20f8bbc2cdb", "score": "0.5440164", "text": "createNote(e) {\n let ourNewPost = {\n 'title': $(\".new-note-title\").val(),\n 'content': $(\".new-note-body\").val(),\n 'status': 'publish'\n }\n\n $.ajax({\n beforeSend: (xhr) => {\n xhr.setRequestHeader('X-WP-Nonce', universityData.nonce); // WordPress will be using the exact X-WP-Nonce\n },\n url: universityData.root_url + '/wp-json/wp/v2/note/',\n type: 'POST',\n data: ourNewPost,\n success: (response) => {\n $(\".new-note-title, .new-note-body\").val('');\n $(`\n <li data-id=\"${response.id}\">\n <input readonly class=\"note-title-field\" type=\"text\" value=\"${response.title.raw}\">\n <span class=\"edit-note\"> <i class=\"fa fa-pencil\" aria-hidden=\"true\"></i> Edit </span>\n <span class=\"delete-note\"> <i class=\"fa fa-trash-o\" aria-hidden=\"true\"></i> Delete </span>\n <textarea readonly class=\"note-body-field\" rows=\"3\"> ${response.content.raw} </textarea>\n <span class=\"update-note btn btn--blue btn--small\"> <i class=\"fa fa-arrow-right\" aria-hidden=\"true\"></i> Save </span>\n </li>\n `).prependTo(\"#my-notes\").hide().slideDown();\n console.log('congrats');\n console.log(response);\n },\n error: (response) => {\n if(response.responseText == \"You have reached your note limit.\") {\n $(\".note-limit-message\").addClass(\"active\");\n }\n console.log('failed to create note');\n console.log(response);\n }\n });\n }", "title": "" }, { "docid": "41fbbb642efef3d2e1cb702f9aabce4d", "score": "0.543786", "text": "function handleNoteClick (e) {\n \n}", "title": "" }, { "docid": "13cc29228db163d6b1b47de082a5e46d", "score": "0.5412515", "text": "function viewNote(e){\n let title = '', body = '', date = null\n const note = Array.from(e.target.parentElement.children)\n note.forEach(el => {\n if (el.classList.contains('dashbord__notes__note__titles')){\n Array.from(el.children).forEach(t => {\n if (t.classList.contains('dashbord__notes__note__titles__name')){\n title = t.textContent;\n }\n else if (t.classList.contains('dashbord__notes__note__titles__date')){\n date = t.textContent;\n }\n })\n }\n else if (el.classList.contains('content')){\n body = el.textContent;\n }\n\n })\n if (Array.from(items.notesList.children).length >= 1){\n //show note\n if (e.target.classList.contains('fa-eye')){\n items.viewNote.classList.add('--showNoteContent')\n }\n }\n renderNoteCard(title, date, body)\n}", "title": "" }, { "docid": "b2507207e9ff1e2781d2d70496bd0faa", "score": "0.5405099", "text": "function showNote(args){\n if(args!=undefined){\n if(args.hasOwnProperty('id')){\n var bodyElem=jQuery('body:first');\n var wrap=bodyElem.children('section#notifications:last');\n //wrap events\n if(!wrap.hasClass('init')){\n wrap.addClass('init');\n //if the wrap is clicked\n wrap.click(function(e){\n e.preventDefault(); e.stopPropagation();\n //if not hovering note content\n if(!wrap.hasClass('hover')){\n //hide open notes\n hideNote(wrap.children('.notification.active'));\n }\n });\n }\n //add note to queu of notes to display\n if(!wrap[0].hasOwnProperty('showNoteQueu')){\n wrap[0]['showNoteQueu']=[];\n }\n wrap[0]['showNoteQueu'].push(args);\n //show the next note in the queu\n showNextQueuNote(wrap);\n }\n }\n}", "title": "" }, { "docid": "c88625a7fabc70e039f18157b5276cf3", "score": "0.54044175", "text": "function addNotesToNotesContainer(note) {\r\n const noteDateTime = new Date(note.id).toUTCString()\r\n\r\n let noteDiv = document.createElement('div')\r\n\r\n noteDiv.classList.add('note');\r\n document.getElementById('NotesContainer').appendChild(noteDiv);\r\n noteDiv.innerHTML = `\\\r\n <div class=\"note-title\">${note.title}</div>\\\r\n <div class=\"note-content\">${note.content}</div>\\\r\n <div class=\"mini ui buttons note-buttons \">\r\n <button class=\"ui button delete-button \"><i class=\"trash alternate icon\"></i></button>/\r\n <button class=\"ui button pinToTop-button\"><i class=\"exchange icon\"></i></button>/\r\n <button class=\"ui button changeColor-button\"><i class=\"paint brush icon\"></i></button>/\r\n </div>\r\n <div class=\"note-date\">${noteDateTime}</div>\\\r\n `\r\n \r\n noteDiv.children[2].children[0].addEventListener('click', e => deleteNote(note, noteDiv))\r\n noteDiv.children[2].children[1].addEventListener('click', e => pinToTop(notes.indexOf(note)))\r\n noteDiv.children[2].children[2].addEventListener('click', e => changeColor(noteDiv))\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "7905d14fffc9465065e0242904ed0e10", "score": "0.5376968", "text": "function setNotesLayout(event){\n\tnew Event(event).stop();\n\t\n\t// change the selected tag\n\t$$(\".noteWidget\").each(function(aLink){\n\t\tvar checkTag = aLink.getChildren('div')[0];\n\t\tif(aLink == event.target){\n\t\t\tif(checkTag.getStyle('display')=='none')\n\t\t\t checkTag.setStyle('display', 'block');\n\t\t}\n\t\telse{\n\t\t\tif(checkTag.getStyle('display')=='block')\n\t\t\t checkTag.setStyle('display', 'none');\t\t\n\t\t};\t\t \n\t});\n\n\t$(\"pageWrapper\").retrieve(\"notesWidget\")\n\t.resetLayout(event.target.getProperty('id'));\n}", "title": "" }, { "docid": "209638735b9d68d09c9d2eea7b679021", "score": "0.5375103", "text": "function addNewNote(text = \"\") {\n // create div\n const note = document.createElement(\"div\");\n // add class note\n note.classList.add(\"note\");\n // if text parameter has text, give hidden class to textarea, otherwise give hidden class to div\n note.innerHTML = `\n <div class=\"tools\">\n <button class=\"edit\"><i class=\"fas fa-edit\"></i></button>\n <button class=\"delete\"><i class=\"fas fa-trash-alt\"></i></button>\n </div>\n <div class=\"main ${text ? \"\" : \"hidden\"}\"></div>\n <textarea class=\"${text ? \"hidden\" : \"\"}\"></textarea>\n `;\n // get variables from note\n const editBtn = note.querySelector(\".edit\");\n const deleteBtn = note.querySelector(\".delete\");\n const main = note.querySelector(\".main\");\n const textArea = note.querySelector(\"textarea\");\n // inside textArea is text\n textArea.value = text;\n // inside main is text parsed in markdown\n main.innerHTML = marked(text);\n\n // listen for click on delete button to remove note from DOM and updateLS\n deleteBtn.addEventListener(\"click\", () => {\n note.remove();\n updateLS();\n });\n // listen for click on edit button to toggle hidden class between main, textarea\n editBtn.addEventListener(\"click\", () => {\n main.classList.toggle(\"hidden\");\n textArea.classList.toggle(\"hidden\");\n });\n // listen for input on textArea\n textArea.addEventListener(\"input\", e => {\n // destructure target to get value\n const { value } = e.target;\n // inside main is value parsed in markdown\n main.innerHTML = marked(value);\n // update local storage\n updateLS();\n });\n // append note to body (DOM)\n document.body.appendChild(note);\n}", "title": "" }, { "docid": "487bb5aef05cbad8052a73f72d2cf31a", "score": "0.5369942", "text": "function highlightNotes(){\r\n var notes = $(\"#LoadCoversations\").find(\"[id$='_notes'] .clearboth\");\r\n\r\n $.each(notes, function( index, value ) {\r\n var customize = false;\r\n\r\n var note = value.children[1];\r\n var outerdiv = note.parentNode.parentNode;\r\n var innerdiv = outerdiv.children[0];\r\n\r\n var b_color, label_name, label_color = \"\";\r\n\r\n if( note.innerText.match(\"##SUMMARY\") ){\r\n customize = true;\r\n b_color = color_summary;\r\n label_name = \"Summary\";\r\n label_color = \"#5cf441\";\r\n }\r\n else if(note.innerText.match(\"##Complexity\")){\r\n customize = true;\r\n b_color = color_complexity;\r\n label_name = \"Complexity\";\r\n label_color = \"#4295f4\";\r\n //label_color = \"darkorchid\";\r\n }\r\n\r\n if (customize){\r\n // add label to note (by Loi)\r\n if(label){\r\n outerdiv.querySelector(\"span .conLasi\").outerHTML = \"<span class='conLasi'>\" + label_name + \" <span class='conLa' style='background-color:\" + label_color + \"'></span></span>\";;\r\n }\r\n // highlight note\r\n if(highlight){\r\n outerdiv.style = \"background-color : \" + b_color;\r\n innerdiv.style = \"background-color : \" + b_color;\r\n }\r\n\r\n }\r\n });\r\n}", "title": "" }, { "docid": "3830531cbc651fcabfc03383a7db2246", "score": "0.5362698", "text": "function openPostIt(){\n var template = document.getElementById(\"make-note\");\n template.removeAttribute(\"hidden\");\n}", "title": "" }, { "docid": "763a1c7a0eebb200a8e2e98237536c35", "score": "0.535502", "text": "function generateNotes(noOfNotes = 1) {\n const MAX_NO_OF_TAGS = 3;\n\n const notes = [];\n const icons = ['hash.svg', 'list.svg', 'up.svg', 'down.svg']; // from public/img folder\n\n for (let i = 0; i < noOfNotes; i++) {\n const noOfTags = Math.floor(Math.random() * MAX_NO_OF_TAGS);\n\n notes.push({\n id: uid(),\n title: randomExt.string(10, 4),\n body: randomExt.string(20, 6),\n date: randomExt.date(new Date()),\n icon: icons[Math.floor(Math.random() * icons.length)],\n tags: (() => {\n const tags = [];\n for (let i = 0; i < noOfTags; i++) {\n tags.push(randomExt.string(6, 3));\n }\n return tags;\n })()\n });\n }\n\n return notes;\n}", "title": "" }, { "docid": "8d46f9518d5356b12d2b132db7729d25", "score": "0.5352121", "text": "handler () {\n notes.listNote()\n }", "title": "" }, { "docid": "48ffedb3bb81be3e60bce1d0a5a0c285", "score": "0.5348393", "text": "function newNote() {\n\t\ttempTitle = getTitle();\n\t\tnote = new tiddlyweb.Tiddler(tempTitle, bag);\n\t\tnote.fields = {};\n\t\tnote.fields.created = new Date();\n\t\tloadNote();\n\t}", "title": "" }, { "docid": "04ab855fa3a7c72d80b588f9d4562eec", "score": "0.53474784", "text": "function renderNote(note, currentBox, isAppendTo) {\n \n if (mini_mode) {\n var metaHtml = '';\n } else {\n // var metaHtml = note.ref_title.length > 0 ? noteMetaIncludeTitleTemplate : noteMetaTemplate;\n // if(typeof(foo) !== 'undefined' && foo != null) {/you can use foo! }\n var metaHtml = noteMetaTemplate;\n metaHtml = metaHtml.replace(/{code}/g, note.code);\n metaHtml = metaHtml.replace(/{ref_title}/g, note.ref_title);\n metaHtml = metaHtml.replace(/{ref_url}/g, note.ref_url);\n metaHtml = metaHtml.replace(/{email}/g, note.username);\n metaHtml = metaHtml.replace(/{created_at}/g, note.created_at);\n metaHtml = metaHtml.replace(/{updated_at}/g, note.updated_at);\n metaHtml = metaHtml.replace(/{updated_at2}/g, note.updated_at2);\n }\n\n var html = noteTemplate;\n html = html.replace(/{code}/g, note.code);\n html = html.replace(/{sec_code}/g, note.secCode);\n html = html.replace(/{tags}/g, note.tags);\n html = html.replace(/{meta}/g, metaHtml);\n \n var content = note.content;\n if (note.comment.length > 0) {\n content = content + '<blockquote class=\"nb_c\">' + note.comment + '</blockquote>';\n }\n html = html.replace(/{content}/g, content);\n \n _html = '';\n if (_list_mode != 'notebook') {\n _html = '<div class=\"uh\">Located in \"<span class=\"vh\" id=\"nb{book_code}_loc_book\">{name}</span>\" &gt; <span \\\n class=\"vh\" id=\"nb{code}_loc_note\">Go to note</span></div>';\n _html = _html.replace(/{book_code}/g, note.bookCode);\n _html = _html.replace(/{code}/g, note.code);\n _html = _html.replace(/{name}/g, getBook(note.bookCode).name);\n }\n \n html = html.replace(/{location_block}/g, _html);\n \n var e = $(html);\n if (currentBox) {\n e.insertAfter(currentBox);\n } else {\n if (!note.isNew) {\n var container_id = '#nb' + note.secCode + '_notes_container';\n } else { \n var container_id = '#' + $('.notes-container')[$('.notes-container').length - 1].id;\n }\n (isAppendTo ? e.appendTo(container_id) : e.prependTo(container_id));\n }\n\n e.data('obj', note);\n e.data('dirty', []);\n e.data('pos', note.pos);\n note.contentMD5 = $.md5(note.content);\n //note.content = null; // we don't need it again!\n note.commentMD5 = $.md5(note.comment);\n //note.comment = null;\n \n // bind events\n \n var prefix = '#nb' + note.code;\n \n var objContent = $(prefix + '_content');\n objContent.data('flag', 'uncollapsed');\n objContent.data('html', objContent.html());\n \n // location\n $('#nb' + note.bookCode + '_loc_book').bind2('click', function() {\n getOuterBox(getCode(this)).trigger('click');\n });\n \n $(prefix + '_drag').bind2('mousedown', function() {\n $('#main_container').css('position', 'static'); // 否则,里面的item拖不出去!\n _editor.hideEditor();\n });\n \n // NOTE: 拖动之后,不会触发mouseup了!\n $(prefix + '_drag').bind2('mouseup', function() {\n $('#main_container').css('position', 'relative');\n });\n \n // collapse\n $(prefix + '_collapse').bind2('click', function() {\n collapse(getCode(this));\n });\n\n // 这个时候直接切换高亮效果比较好,否则会感觉滞后!\n $(prefix + '_content').bind2('mousedown', function() {\n onInnerboxMousedown(getCode(this));\n });\n \n // click的时候 window.getSelection().getRangeAt(0) 才有效!\n $(prefix + '_content').bind2('click', function() {\n onInnerboxClick(getCode(this));\n });\n \n // Comment\n $(prefix + '_comment').click(function() {\n code = getCode(this);\n onInnerboxMousedown(code);\n _editor.addComment(code);\n });\n \n // Edit tags\n $(prefix + '_9').click(function() {\n openTagsEditDialog(getCode(this));\n });\n \n // ref_title\n function onEditRefTitle(code) {\n $('#nb' + code + '_6').html(editRefTitleTemplate.replace(/{code}/g, code));\n $('#ref-title-input').val(getOuterBox(code).data('obj').ref_title);\n $('#ref-title-input').focus();\n $('#btn-edit-ref-title-ok').one('click', function() {\n code = $(this).attr('code');\n setTimeout(function() { \n v = $('#ref-title-input').val().trim();\n $('#nb' + code + '_6').html(v);\n if (v != getOuterBox(code).data('obj').ref_title) { \n setNoteDirtyFlag(code, 'FLAG_REF_TITLE');\n }\n _editor.adjustPosition();\n }, 50);\n });\n _editor.adjustPosition();\n }\n \n // edit ref_title\n $(prefix + '_6').bind2('click', function() {\n if ($('#ref-title-input').length == 0) {\n onEditRefTitle(getCode(this));\n }\n });\n \n // menu\n $(prefix + '_dropdown').bind2('click', function() {\n canHideNoteMenuNow = false;\n menu = $('#note-dropdown-menu');\n _this = $(this);\n if (menu.is(\":visible\") == true && lastClickedElement[0] == _this[0]) { \n menu.data('code', null);\n menu.hide();\n } else {\n menu.data('code', getCode(this));\n menu.show();\n menu.focus();\n menu.offset({ top : _this.offset().top + 20, left : _this.offset().left - menu.width() + 20 });\n }\n lastClickedElement = _this;\n setTimeout(function(){ canHideNoteMenuNow = true; }, 200);\n });\n \n return e;\n}", "title": "" }, { "docid": "15eb267c49672a5525938f8203b15991", "score": "0.5306867", "text": "function Show_new_note(item = \"\"){\n let new_note = document.createElement(\"div\");\n new_note.innerHTML = `\n \n <section class=\"notes\">\n\t\t\t\t\t\t\n <div class=\"tools\">\n <button type=\"button\" class=\"edit\" id=\"search\"><i class=\"fas fa-edit\"></i></button>\n <button type=\"button\" class=\"delete\" id=\"search\"><i class=\"fa fa-trash-alt\"></i></button>\n </div>\n \n <div class=\"main ${item ? \"\" : \"hidden\"}\"> \n \n </div> \n\n <textarea class=\"${item ? \"hidden\" : \"\"}\"></textarea>\n\n </section>\n \n `;\n\n document.body.appendChild(new_note);\n\n //add all variables\n let edit_btn = new_note.querySelector(\".edit\");\n let delete_btn = new_note.querySelector(\".delete\");\n \n // toggling between the editable and non-editable (i.e main and textarea)\n let main = new_note.querySelector(\".main\");\n let text_area = new_note.querySelector(\"textarea\");\n text_area.value = item;\n main.innerHTML = marked(item); //mark for regular text too\n\n edit_btn.addEventListener(\"click\" , () => {\n main.classList.toggle(\"hidden\");\n new_note.querySelector(\".tools\").classList.toggle(\"tglcolor\"); //red is denoted by the completed/marked notes.\n text_area.classList.toggle(\"hidden\");\n });\n\n //add eventlistener to txtarea and make it marked - use (marked) library\n text_area.addEventListener(\"input\" , (e) => { \n let value = e.target.value;\n main.innerHTML = marked(value); //this is the SYNTAX for marked\n\n UpdateLS(); // keep in local storage, so on refreshing our data will not be missed\n });\n\n //delete the note\n delete_btn.addEventListener(\"click\" , () => {\n new_note.remove();\n\n UpdateLS() // remove content from LS on deleting\n })\n\n}", "title": "" }, { "docid": "1264cea5253fec42584421b0985ae999", "score": "0.5279698", "text": "newNote(){\n console.log(\"ich gehe hier rein\");\n let noteSection = $(\".note-section\");\n let updateField = $(\".update-field\");\n\n let idNew = Number(NoteModel.notesIdCounter);\n //NoteModel.notesIdCounter++;\n let titleNew = $(`#title`).val();\n let contentNew = $(`#content`).val();\n let badgeNew = $(\"#prio input[type='radio']:checked\").val();\n let dateNew = new Date();\n let ddNew = String(dateNew.getDate()).padStart(2, '0');\n let mmNew = String(dateNew.getMonth() + 1).padStart(2, '0'); //January is 0!\n let yyyyNew = dateNew.getFullYear();\n dateNew = yyyyNew + '/' + mmNew + '/' + ddNew;\n\n //check for empty input fields\n if (titleNew ===\"\")\n alert(\"Gib bitte einen Titel ein\");\n if (contentNew ===\"\")\n alert(\"Gib bitte einen Text ein\");\n\n let tagListNew =[];\n let contactListNew =[];\n let noteNew =\n {\n id:idNew,\n cardTitle: titleNew,\n badge: badgeNew,\n cardBody: contentNew,\n date: dateNew,\n tag: [],\n contact: []\n }\n console.log(noteNew);\n\n //Should add selected tags to tagList\n $(\".tags-list\").find('input:checkbox:checked').each(function()\n {\n let checkedTag = $(this).attr(\"id\").slice(7,9);\n tagListNew.push(checkedTag);\n });\n\n for(let id of tagListNew){\n let t = this.getTagById(Number(id));\n noteNew.tag.push(t);\n }\n\n //Adds selected tags to contactList\n $(\".contact-list\").find('input:checkbox:checked').each(function()\n {\n let checkedContact = $(this).attr(\"id\").slice(11,13);\n contactListNew.push(checkedContact);\n });\n\n //Adds selected contacts to note\n for(let id of contactListNew){\n let c = this.getContactById(Number(id));\n noteNew.contact.push(c);\n }\n\n this.addNote(noteNew, $(\"#note-list\"));\n this.printNote(noteNew, noteNew.parent);\n }", "title": "" }, { "docid": "3b3446bcbb1eef4d337935f534e5935b", "score": "0.52684116", "text": "function createNoteObject() {\n var noteTitle = document.getElementById('new-note-title').value;\n if (noteTitle == '') {\n noteTitle = 'New Note' + idIndex;\n }\n\n var content = document.getElementById('note-contents').value;\n var note = noteElement(noteTitle, content, idIndex, false);\n\n // adding objects to array\n listNotes.push(note);\n printArray();\n }", "title": "" }, { "docid": "ff1cd649c012ab7df810bdb9855128d8", "score": "0.5261238", "text": "function _createNotes() {\n notes = [{\n id: utilsService.makeId(),\n type: 'NoteText',\n isPinned: false,\n isArchived: false,\n info: {\n txt: 'Fullstack Me Baby!',\n url: '',\n title: '',\n label: '',\n todos: []\n },\n style: {\n backgroundColor: '#f94144',\n color: '#f94144',\n fontSize: '1rem',\n }\n }, {\n id: utilsService.makeId(),\n type: \"NoteImg\",\n isPinned: true,\n isArchived: false,\n info: {\n txt: '',\n url: 'https://s3.amazonaws.com/cdn-origin-etr.akc.org/wp-content/uploads/2015/10/12220511/puppy-800x534.jpg',\n title: 'Me playing Mi',\n label: '',\n todos: []\n },\n style: {\n backgroundColor: '#f8961e',\n color: '#61a5c2',\n fontSize: '1rem',\n }\n },\n {\n id: utilsService.makeId(),\n type: \"NoteImg\",\n isPinned: true,\n isArchived: false,\n info: {\n txt: '',\n url: 'https://images.unsplash.com/photo-1546587348-d12660c30c50?ixid=MnwxMjA3fDB8MHxzZWFyY2h8MjV8fG5hdHVyYWx8ZW58MHx8MHx8&ixlib=rb-1.2.1&w=1000&q=80',\n title: 'Me playing Mi',\n label: '',\n todos: []\n },\n style: {\n backgroundColor: '#61a5c2',\n color: '#f8961e',\n fontSize: '1rem',\n }\n },\n {\n id: utilsService.makeId(),\n type: 'NoteTodos',\n isPinned: false,\n isArchived: false,\n info: {\n txt: '',\n title: '',\n url: '',\n label: 'Todos',\n todos: [\n { id: utilsService.makeId(), txt: 'Do that', doneAt: null },\n { id: utilsService.makeId(), txt: 'Do this', doneAt: new Date() },\n { id: utilsService.makeId(), txt: 'Finish css', doneAt: new Date() },\n { id: utilsService.makeId(), txt: 'Go to sleep', doneAt: new Date() },\n { id: utilsService.makeId(), txt: 'Finish animations', doneAt: new Date() }]\n },\n style: {\n backgroundColor: '#9d4edd',\n color: '#f9c74f',\n fontSize: '1rem',\n }\n },\n {\n id: utilsService.makeId(),\n type: 'NoteVideo',\n isPinned: false,\n isArchived: false,\n info: {\n txt: '',\n url: '',\n title: '',\n ytId: 'gOMhN-hfMtY',\n label: '',\n todos: []\n },\n style: {\n backgroundColor: '#577590',\n color: '#ffe66d',\n fontSize: '1rem',\n }\n },\n {\n id: utilsService.makeId(),\n type: 'NoteVideo',\n isPinned: false,\n isArchived: false,\n info: {\n txt: '',\n url: '',\n title: '',\n ytId: 'hRK7PVJFbS8',\n label: '',\n todos: []\n },\n style: {\n backgroundColor: 'f9c74f',\n color: '#f9c74f',\n fontSize: '1rem',\n }\n },\n {\n id: utilsService.makeId(),\n type: 'NoteVideo',\n isPinned: false,\n isArchived: false,\n info: {\n txt: '',\n url: '',\n title: '',\n ytId: '3PJmE-ucx_o',\n label: '',\n todos: []\n },\n style: {\n backgroundColor: '#adb5bd',\n color: '#adb5bd',\n fontSize: '1rem',\n }\n }\n ]\n _saveNotesToStorage()\n}", "title": "" }, { "docid": "b17befde6101289cb537507444535643", "score": "0.5260763", "text": "_setNotes(notes) {\n this.notes = notes;\n this.view.updateNoteList(notes);\n this.view.updateNotePreviewVisibility(notes.length > 0);\n }", "title": "" }, { "docid": "29e8c8aa217f42b81b587cf36b95715a", "score": "0.52569026", "text": "function addNote(text = \"\") {\n const note = document.createElement(\"div\");\n note.classList.add(\"note\");\n note.innerHTML = `\n <div class=\"tools\">\n <button class=\"edit\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"delete\">\n <i class=\"fas fa-trash-alt\"></i>\n </button>\n </div>\n\n <div class=\"main ${text ? \"\" : \"hidden\"}\"> </div>\n <textarea class=\"${\n text ? \"hidden\" : \"\"\n }\" name=\"textarea\" id=\"textarea\"></textarea>\n `;\n const editBtn = note.querySelector(\".edit\");\n const deleteBtn = note.querySelector(\".delete\");\n const main = note.querySelector(\".main\");\n const textarea = note.querySelector(\"textarea\");\n\n textarea.value = text;\n main.innerHTML = marked(text);\n\n deleteBtn.addEventListener(\"click\", () => {\n note.remove();\n updateLS();\n });\n editBtn.addEventListener(\"click\", () => {\n main.classList.toggle(\"hidden\");\n textarea.classList.toggle(\"hidden\");\n textarea.focus();\n });\n textarea.addEventListener(\"input\", (e) => {\n const { value } = e.target;\n main.innerHTML = marked(value);\n updateLS();\n });\n document.body.appendChild(note);\n}", "title": "" }, { "docid": "bb1cb2539d18c8f22c8abe805c4fc577", "score": "0.5255468", "text": "function post() {\r\n\r\n\t\tvar slideElement = Reveal.getCurrentSlide(),\r\n\t\t\tnotesElement = slideElement.querySelector( 'aside.notes' );\r\n\r\n\t\tvar messageData = {\r\n\t\t\tnotes: '',\r\n\t\t\tmarkdown: false,\r\n\t\t\tsocketId: socketId,\r\n\t\t\tstate: Reveal.getState()\r\n\t\t};\r\n\r\n\t\t// Look for notes defined in a slide attribute\r\n\t\tif( slideElement.hasAttribute( 'data-notes' ) ) {\r\n\t\t\tmessageData.notes = slideElement.getAttribute( 'data-notes' );\r\n\t\t}\r\n\r\n\t\t// Look for notes defined in an aside element\r\n\t\tif( notesElement ) {\r\n\t\t\tmessageData.notes = notesElement.innerHTML;\r\n\t\t\tmessageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';\r\n\t\t}\r\n\r\n\t\tsocket.emit( 'statechanged', messageData );\r\n\r\n\t}", "title": "" }, { "docid": "e1e3a4bf10ed31cb97006c8f170254cc", "score": "0.52428246", "text": "eachNote(note, i) {\n // This is how we get the new text from the note, and update the note\n\t\treturn (\n\t\t\t<Note key={note.id} index={note.id} onChange={this.update} onRemove={this.remove}>\n\t\t\t\t {note.note}\n\t\t\t</Note>\n\t\t)\n\t}", "title": "" }, { "docid": "43836f5e833d75ee7b576cd32d7f0ade", "score": "0.52155405", "text": "function notesToHtml(obj, id, elemType, note, cls) {\n let insHere = document.getElementById(`${id}`);\n let elem = document.createElement(`${elemType}`);\n //set default to none and make it so that class is optional \n if (typeof(cls) != 'undefined') {\n this.cls = cls;\n elem.className = cls;\n }\n //set note to optional put in before if it it there and leave it out if it's not\n if (typeof(note) != 'undefined') {\n this.note = note;\n elem.innerHTML = note + obj;\n } else {\n elem.innerHTML = obj;\n }\n \n\n insHere.append(elem);\n}", "title": "" }, { "docid": "21647004d2690a14286e284c0ea900bf", "score": "0.52140427", "text": "createNote(e) {\n var ourNewPost = {\n 'title' : $(\".new-note-title\").val(),\n 'content' : $(\".new-note-body\").val(),\n 'status': 'publish'\n }\n $.ajax({\n beforeSend: (xhr) => {\n xhr.setRequestHeader('X-WP-Nonce', universityData.nonce);\n },\n url: universityData.root_url + '/wp-json/wp/v2/note/',\n type: 'POST',\n data: ourNewPost,\n success: (response) => {\n $(\".new-note-title, .new-note-body\").val('');\n $(`\n <li data-id=\"${response.id}\">\n <input readonly class=\"note-title-field\" value=\"${response.title.raw}\">\n <span class=\"edit-note\"><i class=\"fa fa-pencil\" aria-hidden=\"ture\"></i>Edit</span>\n <span class=\"delete-note\"><i class=\"fa fa-trash-o\" aria-hidden=\"ture\"></i>Delete</span>\n <textarea readonly class=\"note-body-field\">${response.content.raw}</textarea>\n <span class=\"update-note btn btn--blue btn small\"><i class=\"fa fa-arrow-right\" aria-hidden=\"ture\"></i>Save</span>\n </li>\n `).prependTo(\"#my-notes\").hide().slideDown();\n console.log(\"Note Created\");\n console.log(response);\n },\n //In error property I show to user a message that he/she reached limit.\n error: (response) => {\n if(response.responseText == \"You have reached your note limit.\") {\n $(\".note-limit-message\").addClass(\"active\");\n }\n console.log(\"Sorry\");\n console.log(response);\n },\n });\n }", "title": "" }, { "docid": "3142029c31092c4527cc7add8c3846d7", "score": "0.5213216", "text": "function addNewNote(){\n openNote = 0;\n document.querySelector('.notesBody').style.display = 'none';\n document.querySelector('.noteViewer').style.display = 'block';\n}", "title": "" }, { "docid": "042398ab3a467fa548fa13e78fdbae26", "score": "0.52102846", "text": "function showNotes5() {\n let notes5 = localStorage.getItem(\"notes5\");\n if (notes5 == null) {\n notesObj5 = [];\n } else {\n notesObj5 = JSON.parse(notes5);\n }\n let html5 = \"\";\n notesObj5.forEach(function (element, index) {\n html5 += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 21rem; display: flex; margin: 3px;\">\n <div class=\"card-body\">\n <h6 class=\"card-title\">Note ${index + 1}</h6>\n <p class=\"card-text\" style=\"text-transform: none;\"><h5 style=\"text-transform: none;\">${element[0]}</h5></p>\n <h6 style=\"text-transform: none;\"><p>Commented By :</p>${element[1]}</h6>\n <h6 style=\"text-transform: none;\"><p>Time :</p><small>${element[3]} | ${element[4]} ${element[5]}, ${element[6]}</small></h6>\n </div>\n </div>`;\n });\n let notesElm5 = document.getElementById(\"notes5\");\n if (notesObj5.length != 0) {\n notesElm5.innerHTML = html5;\n } else {\n notesElm5.innerHTML = `Nothing to show! Use \"Add a comment\" section above to add notes.`;\n }\n}", "title": "" }, { "docid": "0c85b4cdbe476e5953cc93b3139670cc", "score": "0.5196838", "text": "function NoteStorage() {\r\n }", "title": "" }, { "docid": "1f67cde49b4d59dd71ee8c1d8c9ba8a2", "score": "0.5193514", "text": "function note(_data) {\n\n}", "title": "" }, { "docid": "ec81ee8d72543b5f82710cc00169ff99", "score": "0.5191778", "text": "function addNote(note) {\r\n let divElement = document.createElement('div');\r\n divElement.classList.add('note');\r\n let titleElement = document.createElement('h1');\r\n titleElement.innerHTML = note.title;\r\n let descriptionElement = document.createElement('p');\r\n descriptionElement.innerHTML = note.description;\r\n divElement.appendChild(titleElement);\r\n divElement.appendChild(descriptionElement);\r\n container.appendChild(divElement);\r\n}", "title": "" }, { "docid": "44da859c3e0c4d54c86d1e071b602965", "score": "0.5190141", "text": "annotate(node, notes, opts) {\n this.notes = notes;\n this.opts = opts || 0;\n this.key = this.opts.key || 0;\n notes.locator = this._annotateSubtree(node);\n //console.log('notes:', notes);\n return notes;\n }", "title": "" }, { "docid": "9368770dc0f09208dd4b5b2bf0f38ff2", "score": "0.5177829", "text": "function nodeadded(event) {\n if( event.relatedNode.nodeName == \"SECTION\" ) {\n if ( event.relatedNode.className == \"blocks-lesson\" ) {\n processNotes();\n }\n }\n\n }", "title": "" }, { "docid": "d6519f4fd099e42c1617be8a4cf6b576", "score": "0.51733357", "text": "newTag(){\n let tagNameNew = $(\"#tagname\").val();\n let tagNew = {\n id: NoteModel.tagsIdCounter,\n tagName: tagNameNew,\n notes: []\n }\n\n tagNew.notes.push(tagNameNew);\n super.notifyObservers(\"printTag\",tagNew);\n\n $(\".tags-Edit\").empty();\n this.printTagListCorr();\n }", "title": "" }, { "docid": "1a144971b671181a0df233d6622ac715", "score": "0.5173243", "text": "function createSticky() {\n // Make sure we refresh the pathname as the lib is not doing it for us.\n $.fn.postitall.defaults.page = window.location.pathname;\n // Create the sticky\n $.PostItAll.new(\n \"<p style='text-align:center'>your note here</p>\",\n {\n // onChange: function(id) {\n // console.log(\"onChange: \" + id);\n // saveStickies();\n // },\n onDelete: function(id) {\n console.log(\"onDelete\");\n deleteSticky(id);\n },\n }\n );\n}", "title": "" }, { "docid": "2df7fe79df493b123b59d9c5f278df81", "score": "0.51676005", "text": "function removeNote(e){\n \n if (e.target.classList.contains('remove-note')){\n e.target.parentElement.remove();\n }\n}", "title": "" }, { "docid": "2180a49e4c94bafb69abf7cccb556e44", "score": "0.5167555", "text": "function NowaNotatka(title, note, date, pinned) {\n this.Title = title.value || title;\n this.Note = note.value || note;\n this.Datee = date.innerText = `Utworzono dnia: ${dniTygodnia[obecnaData.getDay()]} ${obecnaData.getDay()} ${miesiace[obecnaData.getMonth()]} ${obecnaData.getFullYear()}`;\n this.Pinned = pinned;\n\n\n this.Print = function () { // metoda zwracająca listę nienumerowaną, zawierającą tytuł, notatkę oraz datę utworzenia\n return `<li>${this.Title}</li><li>${this.Note}</li><li>${this.Datee}</li>`;\n }\n \n }", "title": "" }, { "docid": "f918a85c7c0a287a0da495adabb6ea18", "score": "0.51668465", "text": "setNotes(state, notes) {\n state.notes = notes\n }", "title": "" }, { "docid": "efae4341eb82da990290886a0192448d", "score": "0.515204", "text": "function listNotes() {\n const notes = loadNotes()\n console.log(chalk.red.bold('here are your notes :'))\n notes.forEach(el => {\n console.log(el.title)\n });\n}", "title": "" }, { "docid": "ccb477136f34a98f1c31b8116b391f64", "score": "0.51489943", "text": "function createNotesPanel() {\n\n\t\tnotesPanel = $('.sidenotes');\n\n\t\tif(!notesPanel) {\n\t\t\tnotesPanel = $('<div></div>');\n\t\t\tnotesPanel.addClass('sidenotes');\n\t\t\tslideshow.append(notesPanel);\n\t\t}\n\t}", "title": "" }, { "docid": "c6b95cae67f360c5aec30481acea30e9", "score": "0.5146409", "text": "handler(){\r\n Notes.listNotes()\r\n }", "title": "" }, { "docid": "d4822f8051893c4297002634f57cdc98", "score": "0.51435685", "text": "function showNotes(){\r\n let notes = localStorage.getItem(\"notes\");\r\n\r\n if (notes == null)\r\n notesObj = [];\r\n else\r\n notesObj = JSON.parse(notes);\r\n\r\n let html = \"\";\r\n\r\n notesObj.forEach(function(element, index) {\r\n if(element.important){\r\n html += `<div ondblclick=\"imp(this, ${index})\" class=\"noteCard my-2 mx-2 card imp\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\"> ${element.title}</h5>\r\n <p class=\"card-text\"> ${element.text} </p>\r\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete Note</button>\r\n </div>\r\n </div>`;\r\n }\r\n else{\r\n html += `<div ondblclick=\"imp(this, ${index})\" class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\"> ${element.title}</h5>\r\n <p class=\"card-text\"> ${element.text} </p>\r\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete Note</button>\r\n </div>\r\n </div>`;\r\n }\r\n });\r\n\r\n let notesEle = document.getElementById(\"notes\");\r\n if(notesObj.length != 0)\r\n notesEle.innerHTML = html;\r\n else\r\n notesEle.innerHTML = `Nothing to Show. Please add a note using \"Add a Note\" section.`;\r\n\r\n}", "title": "" }, { "docid": "98aee5ed58690e01e7d66d1eb6e21897", "score": "0.5126245", "text": "function printMetaData(tiddler) {\n\t\t// print meta information\n\t\tvar fieldInfo = {\n\t\t\t_created: { label: \"created on\" },\n\t\t\t_modified: { label: \"last modified on\" }\n\t\t};\n\t\t$(\"#notemeta\").empty();\n\t\tvar container = $('<div class=\"paddedbox\" />').appendTo(\"#notemeta\")[0];\n\t\tvar list = $(\"<ul />\").appendTo(container)[0];\n\t\tfor(var fieldname in tiddler.fields) {\n\t\t\tif(fieldname.indexOf(\"_\") !== 0) {\n\t\t\t\tvar val = tiddler.fields[fieldname];\n\t\t\t\tif(val) {\n\t\t\t\t\tvar label = fieldInfo[fieldname] ? fieldInfo[fieldname].label : fieldname;\n\t\t\t\t\t$(\"<li />\").text(label + \": \" + val).appendTo(list);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar tags = tiddler.tags || [];\n\t\tif(tags.length > 0) {\n\t\t\tvar tagArea = $(\"<li />\").appendTo(list);\n\t\t\t$(\"<span />\").text(\"tags : \").appendTo(tagArea);\n\t\t\tfor(var i = 0; i < tags.length; i++) {\n\t\t\t\t$(\"<span />\").text(tags[i]).appendTo(tagArea);\n\t\t\t\t$('<a class=\"removeTag\">remove</a>').data(\"tag\", tags[i]).click(function(ev) {\n\t\t\t\t\tvar tag = $(ev.target).data(\"tag\");\n\t\t\t\t\tremoveTag(tag);\n\t\t\t\t\tstoreNote();\n\t\t\t\t\tev.preventDefault();\n\t\t\t\t}).appendTo(tagArea);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "d676c3ccb912f3e82fa3d0341f86f3c7", "score": "0.51254326", "text": "function unTagFromPost(obj, ev) {\n ev.preventDefault();\n ev.stopPropagation();\n var $obj = $(obj);\n var untag_id = parseInt($obj.parent()\n .attr('id')\n .match(/\\d/g)\n .join(''));\n $obj.parent()\n .addClass('__disabled');\n ///taggedPeopleDb.splice( taggedPeopleDb.indexOf(untag_id), 1 );\n //delete taggedPeopleDb[taggedPeopleDb.indexOf(untag_id)];\n taggedPeopleDb.remove(taggedPeopleDb.pindexof(untag_id));\n if (taggedPeopleSameName.length) taggedPeopleSameName.remove(taggedPeopleSameName.pindexof(untag_id));\n if (taggedPeopleDb.length <= 0) ga('._people')\n .remove();\n //if(taggedPeopleSameNamePName.length) taggedPeopleSameNamePName.remove(taggedPeopleSameNamePName.pindexof($obj.parent().find('a').text().toLowerCase()));\n //delete jb_create_tooltip_cnt[untag_id];\n //post_bottom_tagged_ln($this,$txt,all_friends);\n if (ga('.li_people#post-tagged-' + untag_id)\n .length) {\n ga('body')\n .prepend('<section style=\"display:none;\" id=\"rmv_tag_from_jbTooltip\">' + jb_create_tooltip_cnt + '</section>')\n ///$('section#rmv_tag_from_jbTooltip').find('#post-tagged-'+untag_id).remove();\n ga('#tagged-people-n-post-' + untag_id)\n .remove();\n if (taggedPeopleDb.length >= 2) {\n var first_u_tg = $('section#rmv_tag_from_jbTooltip')\n .find(':first');\n ga('.li_people#post-tagged-' + untag_id)\n .attr('id', first_u_tg.attr('id'))\n .find('a')\n .attr('href', '/profile?q=' + first_u_tg.attr('id')\n .match(/\\d/g)\n .join(''))\n .text(first_u_tg.find('a')\n .text());\n first_u_tg.remove();\n var oftcnt = '<div class=\"tooltip-tagged-p mb0 soh-s\" id=\"' + first_u_tg.attr('id') + '\"><img src=\"' + first_u_tg.find('img')\n .attr('src') + '\"><a href=\"/user/' + first_u_tg.attr('id')\n .match(/\\d/g)\n .join('') + '\" hrefattr=\"true\" class=\"o\">' + first_u_tg.find('a')\n .text() + '</a><div title=\"' + lang.remove_tag + '\" onclick=\"return unTagFromPost(this,event);\" class=\"x-delete-post-tag ic10 ic10_close tg_del foh-s\"></div></div>';\n jboxTitleTip($('.li_people#' + first_u_tg.attr('id')), oftcnt, '', first_u_tg.attr('id')\n .match(/\\d/g)\n .join(''));\n } else ga('.li_people#post-tagged-' + untag_id)\n .remove();\n jb_create_tooltip_cnt = ga('section#rmv_tag_from_jbTooltip')\n .html();\n if (jb_create_tooltip_cnt === '') {\n ga('.and_other_people')\n .remove();\n ga('.and-separator')\n .html('&nbsp;' + lang.and + '&nbsp;')\n }\n ga('section#rmv_tag_from_jbTooltip')\n .remove();\n //return;\n }\n if (jb_create_tooltip_cnt != '' && !$('section#rmv_tag_from_jbTooltip')\n .length && !$('.li_people#post-tagged-' + untag_id)\n .length) {\n ga('body')\n .prepend('<section style=\"display:none;\" id=\"rmv_tag_from_jbTooltip\">' + jb_create_tooltip_cnt + '</section>')\n ga('section#rmv_tag_from_jbTooltip')\n .find('#post-tagged-' + untag_id)\n .remove();\n jb_create_tooltip_cnt = $('section#rmv_tag_from_jbTooltip')\n .html();\n ga('section#rmv_tag_from_jbTooltip')\n .remove();\n }\n if (taggedPeopleDb.length == 2) {\n ga('.and_other_people')\n .remove();\n ga('.and-separator')\n .html('&nbsp;' + lang.and + '&nbsp;');\n //alert('and')\n } else if (taggedPeopleDb.length == 1) {\n ga('.and-separator')\n .remove();\n ga('.li_people#post-tagged-' + untag_id)\n .remove();\n } else if (taggedPeopleDb.length >= 3) {\n ga('#jb-tooltip-tagged-in-post')\n .html((taggedPeopleDb.length - 2));\n } else {\n remove_all_post_tags();\n }\n}", "title": "" }, { "docid": "57f220ddbdb3e6db819d516799404a6e", "score": "0.5121046", "text": "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function (element, index) {\n // if the imp field for this note is set to 0, don't modify it. Else, make modifications.\n if(notesObj[index][\"imp\"] == 0){\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 19rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\"> ${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\"> Delete Note </button>\n <button id=\"${index}\" onclick=\"markImp(this.id)\" type=\"button\" class=\"btn btn-danger\"> Mark important </button>\n <button disabled id=\"${index}\" onclick=\"unmarkImp(this.id)\" type=\"button\" class=\"btn btn-success\" style=\"margin-top: 6px;\"> Mark normal </button>\n </div>\n </div>`;\n }\n else{\n // in case the \"imp\" field of this note is 1, mark it as important by changing the color, etc.\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 19rem; background-color: #ff1a1a; color: white; font-weight: bold;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" style=\"font-weight: bold; font-size: 30px;\">${element.title}</h5>\n <p class=\"card-text\" style=\"font-size: 25px;\"> ${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\"> Delete Note </button>\n <button disabled id=\"${index}\" onclick=\"markImp(this.id)\" type=\"button\" class=\"btn btn-danger\"> Mark important </button>\n <button id=\"${index}\" onclick=\"unmarkImp(this.id)\" type=\"button\" class=\"btn btn-success\" style=\"margin-top: 6px;\"> Mark normal </button>\n </div>\n </div>`;\n }\n \n });\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `<h3 style=\"color: whitesmoke;\">Nothing to show! Use \"Add a Note\" section above to add notes.</h3>`;\n }\n}", "title": "" }, { "docid": "e18b331478ec25fe2730db2d66d7ccb1", "score": "0.51178646", "text": "function handleNoteSave(){\n\n var noteData;\n var newNote = $('.bootbox-body textarea').val(); //TODO deleted the .trim() from the end here as was throwing an error in console\n\n if(newNote) {\n noteData = {\n _id: $(this).data('article')._id,\n noteText: newNote\n };\n $.post('/api/notes', noteData).then(function() {\n\n bootbox.hideAll();\n\n });\n\n }\n\n }", "title": "" }, { "docid": "37d08883d6702a2d3e88b9b97b212c63", "score": "0.5117545", "text": "function saveNote(title, content, tags){\r\n\t\t\t\t//split tags by comma or space\r\n\t\t\t\tvar tagSplit = tags.split(/[ ,]+/);\r\n\r\n\t\t\t\t//define a note\r\n\t\t\t\tvar note = {\r\n\t\t\t\t\ttitle:title,\r\n\t\t\t\t note:content,\r\n\t\t\t\t\ttags:tagSplit\r\n\t\t\t\t}\r\n\t\t\t\t// create transaction\r\n\t\t\t\tvar dbTransaction = db.transaction([\"ntos\"],\"readwrite\");\r\n\t\t\t\t// define data object store\r\n\t\t\t\tvar dataStore = dbTransaction.objectStore(\"ntos\");\r\n\t\t\t\t// add data to store\r\n\t\t\t\tvar addRequest = dataStore.add(note);\r\n\t\t\t\t// success handler\r\n\t\t\t\taddRequest.onsuccess = function(e) {\r\n\t\t\t\t console.log(\"data stored...\");\r\n\t\t\t\t //update user on note stored\r\n\t\t\t\t\tons.notification.confirm('Return to notes?') // check with user\r\n \t\t\t\t.then(function(index) {\r\n \t\t\t\tif (index === 1) { // 'ok' button\r\n \t\t\t\tdocument.querySelector('#navigator').popPage(); // return to previous page\r\n \t\t\t\t} else if (index === 0) { // check 'cancel' button\r\n\t\t\t\t\t\t\tdocument.querySelector('#navigator').replacePage('create.html', {'animation': 'none'});\r\n\t\t\t\t\t\t}\r\n \t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\t// error handler\r\n\t\t\t\taddRequest.onerror = function(e) {\r\n\t\t\t\tconsole.log(e.target.error.name);\r\n\t\t\t\t// handle error...\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "88654c285f056754a10ab5a62af705d5", "score": "0.5109453", "text": "createdCallback() {\n this.classList.add(...FireNote.CLASSES);\n this.innerHTML = FireNote.TEMPLATE;\n this.messageElement = this.querySelector('.message');\n this.dateElement = this.querySelector('.date');\n this.deleteButton = this.querySelector('.delete');\n this.deleteButton.addEventListener('click', () => this.deleteNote());\n\n }", "title": "" }, { "docid": "b01f3ba792285a997240aca29954a436", "score": "0.5104138", "text": "generateNoteDOM(element, note) {\n //create div\n const noteEl = document.createElement('div');\n\n //add clas to div\n noteEl.className = 'note';\n\n //inner html for div\n noteEl.innerHTML = `\n <h2 class=\"toggle\">${note.title}</h2>\n <div class=\"note-text\" id=\"note-text\">\n <p>${note.body}</p>\n <button data-id=\"${note.id}\" class=\"btn edit-button\">Edit</button>\n <button data-id=\"${note.id}\" class=\"btn delete-button\">Delete</button>\n </div>\n <span>${this.generateLastEdited(note.changed)}</span>\n `;\n\n //append div to element\n element.appendChild(noteEl);\n }", "title": "" }, { "docid": "35f0cddc6d353ec14217037da64ac1d2", "score": "0.50939214", "text": "function addNotes(piece) {\r\n\t$('#notesPane').empty();\r\n\r\n\tif (piece['Difficulty Notes'].length == 0 && piece[ensVars.typeOfNotes].length == 0) {\r\n\t\t$('#notesPane').append('<div class=\"noNotes\">No Notes Yet</div>');\r\n\t};\r\n\r\n\tfor (var g = 0; g < piece['Difficulty Notes'].length; g++) {\r\n\t\t$('#notesPane').append('<div class=\"difficultyNote\">' + piece['Difficulty Notes'][g] + '</div>');\r\n\t};\r\n\r\n\tfor (var g = 0; g < piece[ensVars.typeOfNotes].length; g++) {\r\n\t\t$('#notesPane').append('<div class=\"instrumentationNote\">' + piece[ensVars.typeOfNotes][g] + '</div>');\r\n\t};\r\n}", "title": "" }, { "docid": "0c2bc5476885278a60064bfe58617a0e", "score": "0.50901634", "text": "function Note(content){\n\tthis.content = content;\n\n\tthis.toSave = function(){\n\t\treturn ('#' + this.content);\n\t}\n}", "title": "" }, { "docid": "13d3623b145323b9b0e562d3b5f6222c", "score": "0.5089725", "text": "function handleArticleNotes(){\n\n var currentArticle = $(this).parents('.article-holder').data();\n\n $.get('/api/notes/' + currentArticle._id).then(function(data) {\n\n var modalText = [\n // '<ul class=\"list-group list-group-flush note-container pt-3 m-3\">',\n // '</ul>',\n '<div class=\" note-container mb-3\">',\n '</div>',\n '<div class=\"shadow p-3\">',\n '<div class=\"form-group\">',\n '<label for=\"exampleFormControlTextarea1\"><i class=\"fas fa-pen fa-lg ml-3 grey-icon\"></i></label>',\n '<textarea class=\"form-control\" id=\"exampleFormControlTextarea1\" rows=\"3\" placeholder=\"Type you note here\"></textarea>',\n '</div>',\n '<div class=\"form-group\">',\n '<button type=\"button\" class=\"btn btn-primary btn-save-a-note save m-0 btn-iconized-blue\"><i class=\"fas fa-plus\"></i></button>',\n '</div>',\n '</div>'\n ].join(\"\");\n\n bootbox.dialog({\n message: modalText,\n closeButton: true\n });\n\n var noteData = {\n _id: currentArticle._id,\n notes: data || []\n };\n\n $('.btn.save').data('article', noteData);\n\n renderNotesList(noteData);\n\n });\n }", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5085581", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5085581", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5085581", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "ece14c43eee1a516167ac31f34d96f0e", "score": "0.5085581", "text": "get note() {\n\t\treturn this.__note;\n\t}", "title": "" }, { "docid": "9e50a06e7c5162364a2101cfa1b554bb", "score": "0.5071119", "text": "function ProcessMissingTags(sender) {\r\n if (UserInput) {\r\n var Beat = sender.html();\r\n if (HarmonyInterop.AliasValue.length == 0 && HarmonyInterop.AliasType.length == 0 && AliasUser.length == 0) {\r\n BeatText = sender.text();\r\n var taggedTypes = BeatText.match(/#(\\w*)([^\\w.*]$)/g);\r\n var userTypes = BeatText.match(/@(\\w*)$\\w*\\s([^\\w*]$)/g);\r\n var taggedValues = BeatText.match(/#(\\w*\\b\\.*(\\S[^\\.\\s]*))([^\\w.*]$)/g); //match(/#(\\w*?)\\.(\\w*?)( )/g)\r\n if (taggedTypes) {\r\n //console.log(\"!AliasType : this - \" + this + \"taggedtypes\" + taggedTypes);\r\n $.each(taggedTypes, function (index) {\r\n var type = this.toString();\r\n console.log(\"!AliasType : \" + type);\r\n var cleanValue = type.match(/#(\\S*)\\w/g);\r\n if (cleanValue != null) {\r\n var cleanType = cleanValue.toString();\r\n\r\n cleanType = cleanType.replace(\"#\", \"\").trim();\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(cleanType, cleanType, null, null, null, true, null, selectedItems.length);\r\n AddReplacementsMadeItem(\"#\" + cleanType, htmlHolder);\r\n AddSelectedItem(sender, \"#\" + cleanType, \"UserDefined\", cleanType, \"\", \"\", \"\", \"\");\r\n UserInput = false;\r\n //sender.html(Beat.replace(\"#\" + cleanType, htmlHolder));\r\n sender.html(Beat.replace(cleanValue.toString(), htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n\r\n }\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n });\r\n } else if (taggedValues) {\r\n console.log(\"AliasValue not set\");\r\n }\r\n if (userTypes) {\r\n $.each(userTypes, function (index) {\r\n var tagClean = SanitiseBeatText(this);\r\n tagClean = tagClean.replace(/\\W$/g, \"\");\r\n console.log(tagClean + \"- @\" + userTypes.Key);\r\n if (\"@\" + userTypes.Key != tagClean.trim()) {\r\n console.log(\"no usertype match found : @\" + userTypes.Key + \" \" + tagClean.trim());\r\n //replace function did not execute\r\n //lookup name, and use correct casing. GetUserList\r\n if (!HarmonyInterop.typingInterval) {\r\n HarmonyInterop.typingInterval = true;\r\n sysproInterop.callHarmonyService(\"GET\", \"AutoComplete/GetUserList\", { QueryValue: tagClean }, function (result) {\r\n try {\r\n HarmonyInterop.typingInterval = false;\r\n var TypedResult = JSON.parse(result);\r\n if (TypedResult[0].Key != null) {\r\n userTypes.Key = TypedResult[0].Key;\r\n } else {\r\n userTypes.Key = queryValue;\r\n }\r\n if (typeof userTypes.Key == \"undefined\") {\r\n var queryValue = tagClean.substring(1);\r\n userTypes.Key = queryValue;\r\n }\r\n if (userTypes.Key != \"\") {\r\n console.log(\"!!!!!!!!!!!MATCHTYPE - \" + userTypes.Key + \" \" + this);\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(userTypes.Key, userTypes.Key, null, null, null, true, null, selectedItems.length);\r\n AddReplacementsMadeItem(\"@\" + userTypes.Key, htmlHolder);\r\n AddSelectedItem(sender, \"@\" + userTypes.Key, \"HrmUser\", \"UserId\", \"\", \"\", \"\", \"\");\r\n UserInput = false;\r\n sender.html(Beat.replace(userTypes[0].trim(), htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n AliasUser = [];\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n\r\n\r\n }\r\n }\r\n catch (e) {\r\n HarmonyInterop.typingInterval = false;\r\n SYSPRO_VB.showErrorMessage(e.message, \"Error Calling Harmony Service \");\r\n }\r\n });\r\n }\r\n }\r\n if (userTypes.Key != \"\") {\r\n console.log(\"!!!!!!!!!!!MATCHTYPE - \" + userTypes.Key + \" \" + tagClean.replace(\"@\", \"\").trim());\r\n // var htmlHolder = \"<div class='alias-\" + AliasType.DataField1 + \" sys-txt-sm alert alert-info alert-dismissible sys-pd-10 sys-pd-r-20' style='display: inline-block;'><button type='button' style='display: inline-block;' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button><span class='sys-700'>\" + AliasType.DataField1 + \"</span></div> \";\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(userTypes.Key, userTypes.Key, null, null, null, true, null, selectedItems.length);\r\n if (replacementsMade.length > 0) {\r\n //check for duplicates\r\n var replacementDuplicates = $.inArray(\"@\" + userTypes.Key, replacementsMade);\r\n // alert(\"replacementDuplicates\", replacementDuplicates);\r\n if (replacementDuplicates > 0) {\r\n replacementsMade.push({ \"Alias\": \"@\" + userTypes.Key, \"Html\": htmlHolder.split(\"'\").join(\"\\\"\") });\r\n }\r\n } else {\r\n replacementsMade.push({\r\n \"Alias\": \"@\" + userTypes.Key, \"Html\": htmlHolder.split(\"'\").join(\"\\\"\")\r\n });\r\n }\r\n AddSelectedItem(sender, \"@\" + userTypes.Key, \"HrmUser\", \"UserId\", \"\", \"\", \"\", \"\");\r\n UserInput = false;\r\n sender.html(Beat.replace(\"@\" + userTypes.Key, htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n }\r\n\r\n });\r\n }\r\n }\r\n if (HarmonyInterop.AliasValue.length > 0) {\r\n //selected from menu \r\n BeatText = sender.text();\r\n var taggedConcepts = BeatText.match(/#(\\w*\\b\\.*(\\S[^\\.\\s]*))([^\\w.*]$)/g); //.match(/#(\\w*\\b\\.*(\\S[^\\.\\s]*))( )/g); //.match(/#(\\w*?)\\.(\\w*?)( )/g)\r\n if (taggedConcepts) {\r\n $.each(taggedConcepts, function (index) {\r\n var tagClean = SanitiseBeatText(this);\r\n tagClean = tagClean.replace(/\\W$/g, \"\");\r\n var aliasToReplace = HarmonyInterop.getAlias(HarmonyInterop.AliasValue[0].Type, HarmonyInterop.AliasValue[0].DataField1, HarmonyInterop.AliasValue[0].Key, \"\");\r\n var alias = HarmonyInterop.getAlias(HarmonyInterop.AliasValue[0].Type, HarmonyInterop.AliasValue[0].DataField1, HarmonyInterop.AliasValue[0].Key, \"\");\r\n if ((\"#\" + aliasToReplace) == tagClean.trim()) {\r\n //alert(\"!!!!!!!!!!!MATCHVALUE - \" + tagClean + \" - \" + \"#\" + aliasToReplace);\r\n //using AliasType[0].Key to be case sensitive save...\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(alias, HarmonyInterop.AliasType[0].DataField1, HarmonyInterop.AliasValue[0].DataField1, null, HarmonyInterop.AliasValue[0].Key, true, \"\", selectedItems.length);\r\n AddReplacementsMadeItem(\"#\" + alias, htmlHolder);\r\n AddSelectedItem(sender, \"#\" + alias, HarmonyInterop.AliasValue[0].DataField3, HarmonyInterop.AliasType[0].DataField1, \"\", HarmonyInterop.AliasValue[0].DataField1, \"\", HarmonyInterop.AliasValue[0].DataField1);\r\n UserInput = false;\r\n //sender.html(Beat.replace(\"#\" + aliasToReplace, htmlHolder));\r\n sender.html(Beat.replace(tagClean.trim(), htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n\r\n }\r\n });\r\n }\r\n }\r\n\r\n //This gets triggered when user did not select\r\n if (HarmonyInterop.AliasType.length > 0) {\r\n BeatText = sender.text();\r\n var taggedTypes = BeatText.match(/#(\\w*)([^\\w.*]$)/g);\r\n var taggedValues = BeatText.match(/#(\\w*\\b\\.*(\\S[^\\.\\s]*))([^\\w.*]$)/g); //match(/#(\\w*?)\\.(\\w*?)( )/g)\r\n if (taggedTypes) {\r\n $.each(taggedTypes, function (index) {\r\n var tagClean = SanitiseBeatText(this);\r\n tagClean = tagClean.replace(/\\W$/g, \"\");\r\n var tempDF1 = HarmonyInterop.AliasType[0].DataField1;\r\n if (tagClean == \"#\" + HarmonyInterop.AliasType[0].Key) {\r\n //alert(\"!!!!!!!!!!!MATCHTYPE - \" + this);\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(HarmonyInterop.AliasType[0].DataField1, HarmonyInterop.AliasType[0].DataField1, null, null, null, true, null, selectedItems.length);\r\n AddReplacementsMadeItem(\"#\" + HarmonyInterop.AliasType[0].DataField1, htmlHolder);\r\n AddSelectedItem(sender, \"#\" + HarmonyInterop.AliasType[0].DataField1, HarmonyInterop.AliasType[0].DataField2, HarmonyInterop.AliasType[0].DataField1, \"\", \"\", \"\", \"\");\r\n UserInput = false;\r\n //sender.html(Beat.replace(\"#\" + tempDF1, htmlHolder));\r\n sender.html(Beat.replace(tagClean, htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n\r\n }\r\n });\r\n } else if (taggedValues) {\r\n //alert(\"AliasValue not set\");\r\n $.each(taggedValues, function (index) {\r\n var value = this.toString();\r\n //removing special characters at end of tagged word\r\n var cleanValue = value.match(/#(\\S*)\\w($[$\\s])/g);\r\n var aliasValue;\r\n var aliasToReplace;\r\n if (cleanValue) {\r\n aliasValue = cleanValue[0].toString().trim();\r\n aliasToReplace = cleanValue[0].toString().trim();\r\n }\r\n else {\r\n aliasValue = value.trim();\r\n aliasToReplace = value.trim();\r\n }\r\n aliasValue = aliasValue.replace(\"#\", \"\");\r\n aliasValue = aliasValue.split(\".\");\r\n\r\n // GetKeyFieldValue - when the user types in a key word, convert to correct key i.e. \"1\" vs \"0000001\"\r\n if (HarmonyInterop.tableSelected != \"\" && HarmonyInterop.categorySelected != \"\" && aliasValue[1] != \"\") {\r\n if (!HarmonyInterop.typingInterval) {\r\n HarmonyInterop.typingInterval = true;\r\n sysproInterop.callHarmonyService(\"GET\", \"AutoComplete/GetKeyFieldValue\", { RootName: HarmonyInterop.tableSelected, KeyColumnName: HarmonyInterop.categorySelected, KeyFieldValue: aliasValue[1] }, function (result) {\r\n try {\r\n HarmonyInterop.typingInterval = false;\r\n var TypedResult = JSON.parse(result);\r\n //if it is null then its a UDF value\r\n if (TypedResult.DataField1 != null) {\r\n HarmonyInterop.fieldSelected = TypedResult.DataField1;\r\n HarmonyInterop.tableSelected = TypedResult.DataField3;\r\n HarmonyInterop.categorySelected = TypedResult.Type;\r\n //if user did not select by clicking this will still be empty - lets set it manually:\r\n var manualObject = [{\r\n \"DataField1\": HarmonyInterop.fieldSelected,\r\n \"DataField2\": \"\",\r\n \"DataField3\": HarmonyInterop.tableSelected,\r\n \"Key\": \"\",\r\n \"Type\": HarmonyInterop.categorySelected\r\n }];\r\n } else {\r\n HarmonyInterop.fieldSelected = aliasValue[1];\r\n HarmonyInterop.categorySelected = aliasValue[0];\r\n //if user did not select by clicking this will still be empty - lets set it manually:\r\n var manualObject = [{\r\n \"DataField1\": HarmonyInterop.fieldSelected,\r\n \"DataField2\": \"\",\r\n \"DataField3\": HarmonyInterop.tableSelected,\r\n \"Key\": \"\",\r\n \"Type\": HarmonyInterop.categorySelected\r\n }];\r\n }\r\n\r\n\r\n var alias = ('#' + HarmonyInterop.categorySelected + \".\" + HarmonyInterop.fieldSelected);\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(HarmonyInterop.categorySelected + \".\" + HarmonyInterop.fieldSelected, HarmonyInterop.categorySelected, HarmonyInterop.fieldSelected, null, null, true, \"\", selectedItems.length);\r\n AddReplacementsMadeItem(alias, htmlHolder);\r\n AddSelectedItem(sender, alias, HarmonyInterop.tableSelected, alias, \"\", \"\", \"\", \"\");\r\n UserInput = false;\r\n sender.html(Beat.replace(aliasToReplace, htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n HarmonyInterop.fieldSelected = \"\";\r\n HarmonyInterop.categorySelected = \"\";\r\n\r\n\r\n }\r\n catch (e) {\r\n HarmonyInterop.typingInterval = false;\r\n SYSPRO_VB.showErrorMessage(e.message, \"Error Calling Harmony Service \");\r\n\r\n }\r\n });\r\n }\r\n }\r\n //var aliasToReplace = cleanValue[0].toString().trim(); //('#' + aliasValue[0] + \".\" + aliasValue[1]);\r\n\r\n\r\n });\r\n }\r\n }\r\n if (typeof AliasUser != \"undefined\") {\r\n BeatText = sender.text();\r\n var userTypes = BeatText.match(/@(\\w*)([^\\w*]$)/g);\r\n if (userTypes) {\r\n $.each(userTypes, function (index) {\r\n var tagClean = SanitiseBeatText(this);\r\n tagClean = tagClean.replace(/\\W$/g, \"\");\r\n if (\"@\" + userTypes.Key != tagClean.trim()) {\r\n console.log(\"no usertype match found : @\" + userTypes.Key + \" \" + this + \"\");\r\n //replace function did not execute\r\n //AliasType will not contain this information\r\n //lookup name, and use correct casing. GetUserList\r\n if (!HarmonyInterop.typingInterval) {\r\n HarmonyInterop.typingInterval = true;\r\n var queryValue = tagClean.substring(1);\r\n sysproInterop.callHarmonyService(\"GET\", \"AutoComplete/GetUserList\", { QueryValue: queryValue }, function (result) {\r\n try {\r\n HarmonyInterop.typingInterval = false;\r\n var TypedResult = JSON.parse(result);\r\n if (TypedResult[0].Key != null) {\r\n userTypes.Key = TypedResult[0].Key;\r\n } else {\r\n userTypes.Key = queryValue;\r\n }\r\n if (typeof userTypes.Key == \"undefined\") {\r\n var queryValue = tagClean.substring(1);\r\n userTypes.Key = queryValue;\r\n }\r\n if (userTypes.Key != \"\") {\r\n console.log(\"!!!!!!!!!!!MATCHTYPE - \" + userTypes.Key + \" \" + this);\r\n var htmlHolder = GenerateHtmlBlockFromHashAlias(userTypes.Key, userTypes.Key, null, null, null, true, null, selectedItems.length);\r\n AddReplacementsMadeItem(\"@\" + userTypes.Key, htmlHolder);\r\n AddSelectedItem(sender, \"@\" + userTypes.Key, \"HrmUser\", \"UserId\", \"\", \"\", \"\", \"\");\r\n UserInput = false;\r\n sender.html(Beat.replace(userTypes[0].trim(), htmlHolder));\r\n UserInput = true;\r\n Beat = sender.html();\r\n //setEndOfContenteditable($(\".harmony-beat-entry\")[0]);\r\n AliasUser = [];\r\n HarmonyInterop.AliasValue = [];\r\n HarmonyInterop.AliasType = [];\r\n HarmonyInterop.tableSelected = \"\";\r\n\r\n\r\n }\r\n }\r\n catch (e) {\r\n HarmonyInterop.typingInterval = false;\r\n SYSPRO_VB.showErrorMessage(e.message, \"Error Calling Harmony Service \");\r\n }\r\n });\r\n }\r\n console.log(userTypes.Key);\r\n }\r\n\r\n });\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "84f97375dab7de316e7f5d71d0bc8859", "score": "0.5067652", "text": "function Note(title = \"\", content = \"\") {\r\n this.title = title;\r\n this.content = content;\r\n this.id = Date.now();\r\n}", "title": "" }, { "docid": "8437f8cc9cb8c0e320042fc090c4c292", "score": "0.50525", "text": "function updateLS() {\n const noteTexts = document.querySelectorAll('textarea');\n const notes = [];\n // Take the values of the textareas to the array\n noteTexts.forEach((note) => notes.push(note.value));\n localStorage.setItem('notes', JSON.stringify(notes));\n}", "title": "" }, { "docid": "4b0c62bd7393430b452884bed3cd8318", "score": "0.5052141", "text": "function ResetObjectTags(tags) {\n $(\".custom-tag-container\").children(\".custom-tag\").remove();\n for (tagid = 0; tagid < tags.length; tagid++) {\n insertHTML = \"<li class=\\\"list-inline-item custom-tag\\\">\" +\n \"<span class=\\\"badge badge-primary\\\"><span class=\\\"h6\\\">\" +\n tags[tagid] + \" &times;</span></span>\";\n insertHTML += \"<input type=\\\"hidden\\\" name=\\\"tags\\\" id=\\\"tags\\\" value=\\\"\" +\n tags[tagid] + \"\\\"></li>\";\n $(\".custom-tag-container\").append($(insertHTML));\n }\n }", "title": "" }, { "docid": "16ab17245fccb380375cde6e445b91fe", "score": "0.50475997", "text": "function renderNotesList(data){\n\n var notesToRender = [];\n var currentNote;\n\n if(!data.notes.length){\n\n currentNote = [\n // '<i class=\"fas fa-pen fa-lg\"></i>',\n ].join(\"\");\n notesToRender.push(currentNote);\n\n } else {\n for(var i=0; i < data.notes.length; i ++) {\n currentNote = $([\n '<div class=\"p-3 shadow\">',\n // '<li class=\"list-group-item mt-3 shadow\">',\n '<p>', data.notes[i].noteText, '</p>',\n '<a class=\"btn btn-primary note-delete btn-delete-article-note m-0 btn-iconized-red red-button\" role=\"button\"><i class=\"fas fa-trash-alt\"></i></a>',\n // '<button class=\"btn note-delete btn-delete-article-note btn-lg\"><i class=\"glyphicon glyphicon-minus\"></i></button>',\n // '</li>',\n ' </div>'\n ].join(\"\"));\n\n currentNote.children('a').data('_id', data.notes[i]._id);\n\n notesToRender.push(currentNote);\n\n }\n\n }\n\n $('.note-container').append(notesToRender); //TODO...verify if this class is inside the html\n\n }", "title": "" }, { "docid": "f5bc26caecf5ee7a2c350ba8d1e89985", "score": "0.5038216", "text": "function getnotes(){\n makerequestnopar(\"http://10.3.50.6/api/note?portfolioId=\" + activeportfolioid,\"GET\",token,function(data){\n var notes = document.getElementById(\"notes-all\");\n notes.innerHTML = \"\";\n for(var i = 0; i < data.length;i++){\n var li = document.createElement(\"div\");\n li.setAttribute(\"class\",\"notes-card\");\n li.setAttribute(\"id\",data[i].noteId + \"note\")\n var content = document.createElement(\"div\");\n content.setAttribute(\"class\",\"notes-content\");\n content.setAttribute(\"id\",\"notes-content\");\n var content_del = document.createElement(\"i\");\n var content_edit = document.createElement(\"i\");\n var p = document.createElement(\"p\");\n p.innerHTML = data[i].message;\n content.appendChild(p);\n content.appendChild(content_edit);\n content.appendChild(content_del);\n content_del.setAttribute(\"id\",data[i].noteId);\n content_del.setAttribute(\"class\",\"fa fa-trash\");\n content_edit.setAttribute(\"id\",data[i].noteId);\n content_edit.setAttribute(\"class\",\"fa fa-edit\");\n content_edit.setAttribute(\"value\",data[i].message);\n notes.appendChild(li);\n li.appendChild(content);\n }\n },true);\n}", "title": "" }, { "docid": "aec7fbbfab50ab32ac9a3c728909135c", "score": "0.50268894", "text": "function highlightNoteInScore(event) {\n\tif (EditorMode == \"xml\") {\n\t\txmlDataNoteIntoView(event);\n\t} else {\n\t\thumdrumDataNoteIntoView(event);\n\t}\n}", "title": "" }, { "docid": "5a82f90b8d0fbf868f56b9f7eeb06bb4", "score": "0.50263554", "text": "function updateLocalStorage()\n{\n let notes = [];\n let notesActual = document.querySelectorAll(`.note`);\n\n notesActual.forEach(element => {\n let note = {\n title: element.querySelector(`.title`).value,\n content: element.querySelector(`.content`).value\n }\n notes.push(note);\n });\n\n let jsonArray = JSON.stringify(notes);\n localStorage.setItem(LOCAL_STORAGE_KEY, jsonArray);\n}", "title": "" }, { "docid": "774b02af287bcbbd9c269850e3e6ed80", "score": "0.501708", "text": "handler(argv) {\n notes.addNote(argv.title, argv.body)\n }", "title": "" }, { "docid": "e887a98e188f0d1e3875559549580cc0", "score": "0.50127345", "text": "function listNotes (notesData) {\n\n let note_listing = document.getElementsByClassName('note-listing')[0];\n\n if (note_listing !== undefined) { /// check if index.html\n note_listing.innerHTML=\"\";\n\n let notesTemplate = document.getElementById(\"notes-template\").innerHTML;\n\n\n let template = Handlebars.compile(notesTemplate);\n let notes = swtichSortBtn(activSortBtn);\n if(notes.length > 0) {\n\n for (let x in notes) {\n\n if(activSortBtn !== \"sortByOnlyCompleted\") {\n notesData = template(notes[x]);\n document.getElementById('main-content').innerHTML += notesData;\n }\n\n if(activSortBtn === \"sortByOnlyCompleted\" && notes[x].noteFinished === \"true\") {\n\n notesData = template(notes[x]);\n document.getElementById('main-content').innerHTML += notesData;\n }\n\n }\n } else {\n document.getElementsByClassName('note-listing')[0].innerHTML = \"<article class='note-wrap'><div class='note'><h3>Es sind keine Notizen vorhanden.</h3></div></article>\";\n }\n\n }\n\n\n }", "title": "" }, { "docid": "6ad00198f217bdccf82921756261176c", "score": "0.50074226", "text": "function getNotesList () {\n var token = authService.getToken();\n return $http.post('http://localhost:3000/api/notes/getAllNotesMeta',{token: token});\n } //end getNote()", "title": "" }, { "docid": "bb7888787a83e783c7976d0917a877f6", "score": "0.5006101", "text": "function refreshNotesList(notes) {\n refreshAnyNotesList($(\"#notesList\"), notes);\n}", "title": "" }, { "docid": "1d7b542d1c6e32972a9ce0c9beb11f51", "score": "0.50026727", "text": "renderNotes(){\n return(\n this.state.notes.map((note) =>\n <StickyNote \n key={note.data.id} \n note={note} \n onDuplicateNote={this.duplicateNote.bind(this)}\n onNoteSelect={this.updateNotesSelection.bind(this)}\n />)\n )\n }", "title": "" }, { "docid": "a3151fc40d7133408981b6914f1fc744", "score": "0.50025153", "text": "function createNotes(){\r\n var noteAdded = 0;\r\n for(var obj in everyNote){\r\n everyNote[obj] = noteObj(\"img/\" + obj + \".png\", noteAdded);\r\n noteAdded++;\r\n }\r\n}", "title": "" }, { "docid": "050c643e134010dfe070f77336d71ce0", "score": "0.5001003", "text": "function $tn(obj){if($d.getElementsByTagName){return $d.getElementsByTagName(obj);}else if($d.all){return $d.all.tags(obj);}}", "title": "" }, { "docid": "3813634aa2b45adab0877084a3c14457", "score": "0.5000562", "text": "function showNotes() {\n const infoButton = document.getElementById(\"infoButton\");\n const notesButton = document.getElementById(\"notesButton\");\n infoButton.classList.remove('selected');\n notesButton.classList.add('selected');\n\n const infoSection = document.getElementById(\"infoSection\");\n infoSection.classList.add(\"displayNone\");\n const notesSection = document.getElementById(\"notesSection\");\n notesSection.classList.remove(\"displayNone\");\n }", "title": "" }, { "docid": "4b3ab66ff8516392a399ff5c717f1673", "score": "0.4990073", "text": "getFootnotes () {\n return this.inflectionData.types.has(this.constructor.inflectionType)\n ? this.inflectionData.types.get(this.constructor.inflectionType).footnotesMap\n : new Map()\n }", "title": "" }, { "docid": "29905aaae8684627787a2fa843db0b7a", "score": "0.49853006", "text": "function looper(){\nvar notebook=document.getElementById(\"notebook\");\nvar gen_val=JSON.parse(localStorage.getItem(\"text-list\"));\nfor(var i=0;i<gen_val.length;i++)\n{\nnotebook.appendChild(makenote(gen_val[i]));\n}\n}", "title": "" }, { "docid": "09720ca7de9396d880aeff5b549c0435", "score": "0.49809134", "text": "function setBPNotes(notes, title) {\n try {\n let i, j, row, note;\n // remove any view notes icons\n $(\"[view-notes\").remove();\n // stop if no notes to add\n if (!notes || !notes.length) {\n return;\n }\n let attachToThisElement;\n let table = getLastTable();\n table.notes = notes;\n let headerIndex = table.headers.indexOf(bpNotesHeader);\n let associationColumn;\n associationColumn = table.identifier;\n // check each row\n for (i = 0; i < table.rows.length; i++) {\n row = table.rows[i];\n // get element to attach note view icon to\n attachToThisElement = document.getElementById(\n title + \"-\" + row.originalOrder + \"-\" + headerIndex\n );\n // set new notes\n for (j = 0; j < notes.length; j++) {\n note = notes[j];\n if (\n note.kind === table.title &&\n note.identifier === row.pristineRow[associationColumn]\n ) {\n attachBPNotesViewElements(\n attachToThisElement,\n table,\n row.originalOrder\n );\n }\n }\n }\n } catch (error) {\n console.log(error);\n errors.handleError(error, table.errorMsgId);\n }\n }", "title": "" }, { "docid": "e0b9e1883ef70c8aecb13610925554f5", "score": "0.49762025", "text": "function makenote() {\r\n alertNote.style.display = \"none\";\r\n let notes = JSON.parse(localStorage.getItem(\"store\"));\r\n if (notes === null) {\r\n return;\r\n }\r\n let div = \"\";\r\n notes.forEach((element, i) => {\r\n div +=\r\n ` <div class=\"card my-2 mx-2 col-md-3\" style=\"width: 18rem;\">\r\n <div class=\"card-body my-2 mx-2\">\r\n <h5 class=\"card-title\">Note ${i + 1}</h5>\r\n <p class=\"card-text\">${element}</p>\r\n <button id=\"${i}\" class=\"btn btn-primary\" onClick=\"onDelete(this.id)\">Delete</button>\r\n </div>\r\n </div>`\r\n\r\n\r\n });\r\n\r\n let parentadiv = document.getElementById(\"noteList\");\r\n\r\n parentadiv.innerHTML = div;\r\n}", "title": "" }, { "docid": "08c55d7e89be4b5f8e0fa9fe8133a104", "score": "0.4974615", "text": "function showNote(event, element, menu, visit){\n event.preventDefault();\n $('#show-note-button-area > button').hide();\n\n if ($('.edit-area').is(':visible')) {\n $('.edit-area').slideUp();\n $('#inline-back-edit').show();\n }else if ($('.create-area').is(':visible')) {\n $('.create-area').slideUp();\n $('#inline-back-create').show();\n }else if ($('.search-results .list-content').html()) {\n $('.search-results').slideUp();\n $('#inline-back-search, #inline-edit, #inline-back-home').show();\n }else{\n $('.list-area').slideUp();\n $('#inline-edit, #inline-back-home').show();\n }\n\n if (menu) {\n id = $(element).parent().next().text();\n }else{\n id = $(element).parent().siblings(\".note-id\").eq(0).text();\n }\n if (visit) {\n dataArray = {\n id: id,\n visit: true\n };\n }else{\n dataArray = {\n id: id,\n };\n }\n $.post('misc_ajax.php', dataArray, function(data){\n note_array = data.split('[separator]');\n $('#note-meta-cat a').text(note_array[0]);\n $('#note-meta-sub-cat a').text(note_array[1]);\n $('#show-note-title').html(note_array[2]).css({'background-color': 'whitesmoke', 'padding': '10px 20px'});\n $('#show-note-content').html(note_array[3]).css({'background-color': 'whitesmoke', 'padding': '10px 20px'});\n $('.show-note-form .note-id').text(id);\n $('#show-note-content ul').css('padding-left','40px');\n $('#show-note-content ol').css('list-style-position','inside');\n $('#show-note-content *').css('margin-bottom','5px');\n $('#show-note-content pre code').each(function(i, block) {\n hljs.highlightBlock(block);\n });\n });\n\n $('.show-note-area').slideDown();\n}", "title": "" }, { "docid": "675ad132b030a19c3a1b1e32bc109939", "score": "0.49701437", "text": "function TextExtTags() {}", "title": "" }, { "docid": "675ad132b030a19c3a1b1e32bc109939", "score": "0.49701437", "text": "function TextExtTags() {}", "title": "" }, { "docid": "89337d52167081c83e97da3714704d7e", "score": "0.49669084", "text": "function decorateExtendedTextInteractions() {\n document.querySelectorAll(QUILL_SEL).forEach((textarea)=>{\n let div = document.createElement(\"div\");\n textarea.parentElement.appendChild(div);\n new Quill(div,{theme:\"snow\"});\n textarea.remove();\n })\n }", "title": "" }, { "docid": "1f949ddc3ba4f123898b465fdd3df1a7", "score": "0.49665186", "text": "function noterPhoto(idPhoto, note)\r\n{\r\n\tajax('post', 'pages/galerie-photo_ajax.php?act=noter_photo','idPhoto='+escape(idPhoto)+'&note='+escape(note), 'noterPhoto2');\r\n}", "title": "" }, { "docid": "7e5e4c380d8f9ebb02ccf0013b46261d", "score": "0.4964711", "text": "function addNote(content, id){\n if(typeof(id)===\"number\"){\n const objectNote={content: content, id:id};\n notes.push(objectNote);\n }\n}", "title": "" } ]
d5396f6636b939776eaa5e7f9e9d0152
Stringify a heading. In `setext: true` mode and when `depth` is smaller than three, creates a setext header: ```markdown Foo === ``` Otherwise, an ATX header is generated: ```markdown Foo ``` In `closeAtx: true` mode, the header is closed with hashes: ```markdown Foo ```
[ { "docid": "cca74e7a1f52c182a3627f27fed9d2d1", "score": "0.7384434", "text": "function heading(node) {\n var self = this\n var depth = node.depth\n var setext = self.options.setext\n var closeAtx = self.options.closeAtx\n var content = self.all(node).join('')\n var prefix\n\n if (setext && depth < 3) {\n return (\n content + lineFeed + repeat(depth === 1 ? equalsTo : dash, content.length)\n )\n }\n\n prefix = repeat(numberSign, node.depth)\n\n return prefix + space + content + (closeAtx ? space + prefix : '')\n}", "title": "" } ]
[ { "docid": "c9f4dc5fc9834fdff1f40d33661e0932", "score": "0.74442786", "text": "function heading(node) {\n var self = this;\n var depth = node.depth;\n var setext = self.options.setext;\n var closeAtx = self.options.closeAtx;\n var content = self.all(node).join('');\n var prefix;\n\n if (setext && depth < 3) {\n return (\n content + lineFeed$n + repeatString(depth === 1 ? equalsTo$3 : dash$9, content.length)\n )\n }\n\n prefix = repeatString(numberSign$3, node.depth);\n\n return prefix + space$h + content + (closeAtx ? space$h + prefix : '')\n }", "title": "" }, { "docid": "ce27139e710a130b62332d680d2dac5c", "score": "0.6471257", "text": "heading(text, level) {\n const { headerIds, modifyAnchors } = this.options;\n const { _headingId } = this;\n\n if (!headerIds) {\n return `<h${level}>${text}</h${level}>`;\n }\n\n const transformOption = modifyAnchors;\n let id = anchorId(stripHTML(text), transformOption);\n const headingId = _headingId;\n\n // Add a number after id if repeated\n if (headingId[id]) {\n id += `-${headingId[id]++}`;\n } else {\n headingId[id] = 1;\n }\n\n // add headerlink\n return `<h${level} id=\"${id}\"><a href=\"#${id}\" class=\"headerlink\" title=\"${stripHTML(text)}\"></a>${text}</h${level}>`;\n }", "title": "" }, { "docid": "88db059fa3cb45e5e3094b9fb3f48d3c", "score": "0.6222243", "text": "header(level, text, options) {\r\n let header = { 1: \"h1\", 2: \"h2\", 3: \"h3\", 4: \"h4\", 5: \"h5\", 6: \"h6\" }[level];\r\n if (!header)\r\n throw Error(`Unrecognized level '${level}' (expected 1, 2, 3, 4, 5, or 6)`);\r\n return this.el(header, text, options);\r\n }", "title": "" }, { "docid": "78ab8964800e2b45abd6f5381df4ee17", "score": "0.6219994", "text": "function setMarkdownHeader(cell, level) {\r\n // Remove existing header or leading white space.\r\n let source = cell.value.text;\r\n const regex = /^(#+\\s*)|^(\\s*)/;\r\n const newHeader = Array(level + 1).join('#') + ' ';\r\n const matches = regex.exec(source);\r\n if (matches) {\r\n source = source.slice(matches[0].length);\r\n }\r\n cell.value.text = newHeader + source;\r\n }", "title": "" }, { "docid": "6e17bc6d40389636836792bef506ff64", "score": "0.61908066", "text": "function setMarkdownHeader(cell, level) {\n var source = cell.value.text;\n var newHeader = Array(level + 1).join('#') + ' ';\n // Remove existing header or leading white space.\n var regex = /^(#+\\s*)|^(\\s*)/;\n var matches = regex.exec(source);\n if (matches) {\n source = source.slice(matches[0].length);\n }\n cell.value.text = newHeader + source;\n }", "title": "" }, { "docid": "70ade45a4ba6dccb68f48d1b75d6cace", "score": "0.60961854", "text": "function heading (ctx, node) {\n const depth = node.depth\n const content = require('../all')(ctx, node)\n\n const headings = ctx.headings || defaultHeadings\n const fn = headings[node.depth - 1]\n\n if (typeof fn !== 'function') {\n throw new Error(`Cannot compile heading of depth ${depth}: not a function`)\n }\n\n return fn(content)\n}", "title": "" }, { "docid": "a45c5008522a3588eb78513256b7aa1c", "score": "0.59583145", "text": "function createHeadingNotation(x, y, level, selection) {\n // Background\n const newElement = new Rectangle();\n newElement.width = DEFAULTS.width;\n newElement.height = DEFAULTS.height;\n newElement.fill = new Color(DEFAULTS.headings.color);\n newElement.cornerRadii = DEFAULTS.radius;\n newElement.stroke = new Color(DEFAULTS.color);\n newElement.strokeWidth = 2;\n newElement.strokePosition = \"OUTER_STROKE\";\n newElement.shadow = new Shadow(0, 0, 2, new Color(DEFAULTS.headings.color), true);\n\n\n selection.insertionParent.addChild(newElement);\n newElement.moveInParentCoordinates(x, y);\n\n // Text\n const textNode = new Text();\n textNode.text = \"H\" + level.toString();\n textNode.fill = new Color(DEFAULTS.color);\n textNode.fontSize = DEFAULTS.fontSize;\n\n selection.insertionParent.addChild(textNode);\n textNode.moveInParentCoordinates(x + 4, y + 28);\n}", "title": "" }, { "docid": "f765ac04a276f07479deec26be8b424d", "score": "0.5935787", "text": "function createHeading(text) {\n\t//@TODO\n\treturn \n}", "title": "" }, { "docid": "f6176d879cb7af401cbbfde28c8569a0", "score": "0.58020824", "text": "function increaseHeadingLevel() {\n return (_, l) => {\n // trim the string and calculate length as there might be whitespace\n const level = l.trim().length;\n\n return `${'#'.repeat(level === 6 ? level : level + 1)} `;\n };\n}", "title": "" }, { "docid": "ea444d106a3d2f000fd7c67bc33b55ed", "score": "0.57920283", "text": "function addMdHeading() {\n const selected = getSelection();\n const chunk = selected.length === 0 ? \"heading text\" : `${selected.text}\\n`;\n const content = EDITOR.value;\n let cursor;\n let pointer;\n let prevChar;\n\n if ((pointer = 4, content.substr(selected.start - pointer, pointer) === \"### \") ||\n (pointer = 3, content.substr(selected.start - pointer, pointer) === \"###\")) {\n setSelection(selected.start - pointer, selected.end);\n replaceSelection(chunk);\n cursor = selected.start - pointer;\n } else if (selected.start > 0 &&\n (prevChar = content.substr(selected.start - 1, 1), !!prevChar && prevChar != \"\\n\")) {\n replaceSelection(`\\n\\n### ${chunk}`);\n cursor = selected.start + 6;\n } else {\n replaceSelection(`### ${chunk}`);\n cursor = selected.start + 4;\n }\n\n setSelection(cursor, cursor + chunk.length);\n}", "title": "" }, { "docid": "f30aa7bdf20259487a65ee86d7c33e54", "score": "0.57748115", "text": "function heading(state, startLine, endLine, silent) {\n var ch, level, tmp,\n pos = state.bMarks[startLine] + state.tShift[startLine],\n max = state.eMarks[startLine];\n\n if (pos >= max) { return false; }\n\n ch = state.src.charCodeAt(pos);\n\n if (ch !== 0x23/* # */ || pos >= max) { return false; }\n\n // count heading level\n level = 1;\n ch = state.src.charCodeAt(++pos);\n while (ch === 0x23/* # */ && pos < max && level <= 6) {\n level++;\n ch = state.src.charCodeAt(++pos);\n }\n\n if (level > 6 || (pos < max && ch !== 0x20/* space */)) { return false; }\n\n if (silent) { return true; }\n\n // Let's cut tails like ' ### ' from the end of string\n\n max = state.skipCharsBack(max, 0x20, pos); // space\n tmp = state.skipCharsBack(max, 0x23, pos); // #\n if (tmp > pos && state.src.charCodeAt(tmp - 1) === 0x20/* space */) {\n max = tmp;\n }\n\n state.line = startLine + 1;\n\n state.tokens.push({ type: 'heading_open',\n hLevel: level,\n lines: [ startLine, state.line ],\n level: state.level\n });\n\n // only if header is not empty\n if (pos < max) {\n state.tokens.push({\n type: 'inline',\n content: state.src.slice(pos, max).trim(),\n level: state.level + 1,\n lines: [ startLine, state.line ],\n children: []\n });\n }\n state.tokens.push({ type: 'heading_close', hLevel: level, level: state.level });\n\n return true;\n}", "title": "" }, { "docid": "781355bcbea726bd39eda5d9f608a92a", "score": "0.5692878", "text": "function headingRenderer(props) {\n var children = React.Children.toArray(props.children);\n var text = children.reduce(flatten, '');\n var slug = text.toLowerCase().replace(/\\W/g, '-');\n return React.createElement('h' + props.level, { id: slug }, props.children);\n}", "title": "" }, { "docid": "dfb6275dfdf41395b7099ddb2eb8c17c", "score": "0.549117", "text": "function showHeader (text) {\n console.log('')\n console.log(chalk.magenta(text + '…'))\n}", "title": "" }, { "docid": "1814649fe3fcde9212c509fdf5af2cb0", "score": "0.54526377", "text": "function prettify(heading) {\n return 'Heading: ' + heading.magneticHeading;\n }", "title": "" }, { "docid": "0c4ca63a36852f83f647df00b3c1e82b", "score": "0.54179764", "text": "function headerV () {\n return h('h1', `transcript (you are ${state.name})`)\n }", "title": "" }, { "docid": "8c16fda4f6a2c734368e3c059675ce6c", "score": "0.53866595", "text": "function createHeading(headingObj) {\n\n let heading = headingObj.size >= 1 && headingObj.size <= 5 ? document.createElement('h' + headingObj.size) : document.createElement('h4');\n\n heading.innerText = (typeof headingObj.text == 'string') ? headingObj.text : 'no text';\n\n if (headingObj.id != undefined && document.getElementById(headingObj.id) == null) {\n\n heading.id = headingObj.id\n\n }\n\n document.body.appendChild(heading);\n\n}", "title": "" }, { "docid": "a5310cf66beaa71c44437df99e275c53", "score": "0.5385326", "text": "function toHast(tree, options) {\n var h = factory(tree, options)\n var node = one(h, tree)\n var foot = footer(h)\n\n if (foot) {\n node.children = node.children.concat(u('text', '\\n'), foot)\n }\n\n return node\n}", "title": "" }, { "docid": "a5310cf66beaa71c44437df99e275c53", "score": "0.5385326", "text": "function toHast(tree, options) {\n var h = factory(tree, options)\n var node = one(h, tree)\n var foot = footer(h)\n\n if (foot) {\n node.children = node.children.concat(u('text', '\\n'), foot)\n }\n\n return node\n}", "title": "" }, { "docid": "e54982f9183646869884ca0457873dfe", "score": "0.5364957", "text": "function setMarkdownHeader(notebook, level) {\r\n if (!notebook.model || !notebook.activeCell) {\r\n return;\r\n }\r\n const state = Private.getState(notebook);\r\n const cells = notebook.model.cells;\r\n level = Math.min(Math.max(level, 1), 6);\r\n notebook.widgets.forEach((child, index) => {\r\n if (notebook.isSelectedOrActive(child)) {\r\n Private.setMarkdownHeader(cells.get(index), level);\r\n }\r\n });\r\n Private.changeCellType(notebook, 'markdown');\r\n Private.handleState(notebook, state);\r\n }", "title": "" }, { "docid": "8b3e8de7e62a01b84ee9f765cae302fb", "score": "0.53334486", "text": "function buildHeading () {\n const el = document.querySelector('.card h1')\n const text = el.innerText\n el.innerText = ''\n Array.from(text).forEach((ch) => {\n const span = document.createElement('span')\n span.innerText = ch\n el.appendChild(span)\n })\n}", "title": "" }, { "docid": "81d6be6ba86ee14bac43af233ace09c2", "score": "0.5327443", "text": "function toHast(tree, options) {\n var h = factory(tree, options)\n var node = one(h, tree)\n var footnotes = footer(h)\n\n if (node && node.children && footnotes) {\n node.children = node.children.concat(u('text', '\\n'), footnotes)\n }\n\n return node\n}", "title": "" }, { "docid": "def89bfbaaae7d8bd11201191197370b", "score": "0.53104883", "text": "function setMarkdownHeader(widget, level) {\n if (!widget.model || !widget.activeCell) {\n return;\n }\n var state = Private.getState(widget);\n level = Math.min(Math.max(level, 1), 6);\n var cells = widget.model.cells;\n var i = 0;\n algorithm_1.each(widget.widgets, function (child) {\n if (widget.isSelected(child)) {\n Private.setMarkdownHeader(cells.get(i), level);\n }\n i++;\n });\n Private.changeCellType(widget, 'markdown');\n Private.handleState(widget, state);\n }", "title": "" }, { "docid": "7b77cbe0baedc445ff260eeb8f4cd54b", "score": "0.52879936", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = string[0] === ' ' ? String(indentPerLevel) : '';\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : clip ? '' : '-';\n return indentIndicator + chomp + '\\n';\n }", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "f99e59b73790feb3eb6325d21ec61e91", "score": "0.5280588", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "01427e5287356dd80a1286a01e4500d4", "score": "0.5279104", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : clip ? '' : '-';\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.52208287", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.52208287", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.52208287", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "e2a159dc0146a08a787847472cb5c995", "score": "0.52208287", "text": "function blockHeader(string, indentPerLevel) {\n var indentIndicator = (string[0] === ' ') ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}", "title": "" }, { "docid": "676e0ef1528bc681d7fe64eace198f7a", "score": "0.52191967", "text": "function makeHeaderFunc(level) {\n return function (match, header) {\n return '\\n\\n</p>\\n<a ' + protect('class=\"target\" name=\"' + mangle(removeHTMLTags(header.rp(PROTECT_REGEXP, expose))) + '\"') + \n '>&nbsp;</a>' + entag('h' + level, header) + '\\n<p>\\n\\n';\n }\n }", "title": "" }, { "docid": "806254c7db0c38db250db0b88cc6327f", "score": "0.5145253", "text": "function printKataHeading(main, kataNumber) {\n const kata1Heading = document.createElement(\"h1\")\n kata1Heading.append(\"KATA \" + kataNumber)\n main.append(kata1Heading)\n}", "title": "" }, { "docid": "41701a4408f85683de65a5ae27350586", "score": "0.51427543", "text": "function articleH(title,hlevel){ return destIn( say( newTag('h'+hlevel), title),newTag('article') );}", "title": "" }, { "docid": "9344907acd4d84ed0f9c4a4121f52a31", "score": "0.51340735", "text": "function isHeading(node) {\n return node.type === 'heading';\n}", "title": "" }, { "docid": "07742fe3413e05f8bdc482c7489e38f1", "score": "0.50914586", "text": "appendHeader(title) {\n\t\tlet header = createDiv(\"header center\");\n\n\t\tfunction heading() {\n\t\t\tlet heading = document.createElement(\"h1\");\n\t\t\theading.innerText = title;\n\n\t\t\treturn heading;\n\t\t}\n\n\t\t// Close button\n\t\tfunction close() {\n\t\t\tlet close = createDiv(\"close center\");\n\t\t\tclose.setAttribute(\"onclick\",\"this.closest('.modal').close()\");\n\t\n\t\t\tclose.appendChild(createDiv(\"line\"));\n\t\t\tclose.appendChild(createDiv(\"line\"));\n\t\n\t\t\treturn close;\n\t\t}\n\t\t\n\t\theader.appendChild(heading());\n\t\theader.appendChild(close());\n\n\t\tthis.append(header);\n\t}", "title": "" }, { "docid": "1a2b208d0960f3919c5ae7d708e236ee", "score": "0.5057596", "text": "function writeHeading(headingElementID, number, font_size){\n\tvar string_H = new String;\n\tif(number > 360){\n\t\tnumber -= 360;\n\t}\n\telse if(number < 0){\n\t\tnumber += 360;\n\t}\n\tstring_H=string_H.concat(number.toString());\n\tdocument.getElementById(headingElementID).innerHTML = string_H;\n\t$(\".\"+headingElementID).css(\"width\", font_size*2.5 + \"px\");\n\t$(\".\"+headingElementID).css(\"font-size\", font_size);\n}", "title": "" }, { "docid": "a20488f114f79f4447287a9bae1993a3", "score": "0.50241065", "text": "function sectionHeading(heading){\n var heading2 = document.createElement(\"h3\");\n var text = document.createTextNode(heading);\n heading2.appendChild(text);\n document.querySelector(\"body\").appendChild(heading2);\n}", "title": "" }, { "docid": "49835bd835922a4e493186568ad19168", "score": "0.5005906", "text": "function Header() {\n var props = {\n style: Text.STYLE_FIXED_WIDTH,\n size: TILE_SIZE\n };\n this.set('1up', new Text(merge(props, {\n txt: '1UP',\n x: 4 * TILE_SIZE,\n y: 0\n })));\n this.add(new Text(merge(props, {\n txt: 'HIGH SCORE',\n x: 9 * TILE_SIZE,\n y: 0\n })));\n this.set('score', new Text(merge(props, {\n txt: score,\n align: 'right',\n x: 7 * TILE_SIZE,\n y: TILE_SIZE\n })));\n this.set('highscore', new Text(merge(props, {\n txt: highscore,\n align: 'right',\n x: 17 * TILE_SIZE,\n y: TILE_SIZE\n })));\n}", "title": "" }, { "docid": "f9a9913a04f23929dc3705c1807de28a", "score": "0.50022626", "text": "function writeHeader() {\n seekHead = createSeekHead();\n\n var\n ebmlHeader = {\n \"id\": 0x1a45dfa3, // EBML\n \"data\": [\n {\n \"id\": 0x4286, // EBMLVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f7, // EBMLReadVersion\n \"data\": 1\n },\n {\n \"id\": 0x42f2, // EBMLMaxIDLength\n \"data\": 4\n },\n {\n \"id\": 0x42f3, // EBMLMaxSizeLength\n \"data\": 8\n },\n {\n \"id\": 0x4282, // DocType\n \"data\": \"webm\"\n },\n {\n \"id\": 0x4287, // DocTypeVersion\n \"data\": 2\n },\n {\n \"id\": 0x4285, // DocTypeReadVersion\n \"data\": 2\n }\n ]\n },\n\n segmentInfo = {\n \"id\": 0x1549a966, // Info\n \"data\": [\n {\n \"id\": 0x2ad7b1, // TimecodeScale\n \"data\": 1e6 // Times will be in miliseconds (1e6 nanoseconds per step = 1ms)\n },\n {\n \"id\": 0x4d80, // MuxingApp\n \"data\": \"webm-writer-js\",\n },\n {\n \"id\": 0x5741, // WritingApp\n \"data\": \"webm-writer-js\"\n },\n segmentDuration // To be filled in later\n ]\n },\n\n tracks = {\n \"id\": 0x1654ae6b, // Tracks\n \"data\": [\n {\n \"id\": 0xae, // TrackEntry\n \"data\": [\n {\n \"id\": 0xd7, // TrackNumber\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x73c5, // TrackUID\n \"data\": DEFAULT_TRACK_NUMBER\n },\n {\n \"id\": 0x9c, // FlagLacing\n \"data\": 0\n },\n {\n \"id\": 0x22b59c, // Language\n \"data\": \"und\"\n },\n {\n \"id\": 0x86, // CodecID\n \"data\": \"V_VP8\"\n },\n {\n \"id\": 0x258688, // CodecName\n \"data\": \"VP8\"\n },\n {\n \"id\": 0x83, // TrackType\n \"data\": 1\n },\n {\n \"id\": 0xe0, // Video\n \"data\": [\n {\n \"id\": 0xb0, // PixelWidth\n \"data\": videoWidth\n },\n {\n \"id\": 0xba, // PixelHeight\n \"data\": videoHeight\n }\n ]\n }\n ]\n }\n ]\n };\n\n ebmlSegment = {\n \"id\": 0x18538067, // Segment\n \"size\": -1, // Unbounded size\n \"data\": [\n seekHead,\n segmentInfo,\n tracks,\n ]\n };\n\n var\n bufferStream = new ArrayBufferDataStream(256);\n\n writeEBML(bufferStream, blobBuffer.pos, [ebmlHeader, ebmlSegment]);\n blobBuffer.write(bufferStream.getAsDataArray());\n\n // Now we know where these top-level elements lie in the file:\n seekPoints.SegmentInfo.positionEBML.data = fileOffsetToSegmentRelative(segmentInfo.offset);\n seekPoints.Tracks.positionEBML.data = fileOffsetToSegmentRelative(tracks.offset);\n }", "title": "" }, { "docid": "3b2c8eac93ce0bf6997b669fb00d7377", "score": "0.4962406", "text": "static get properties() {\n return {\n \n ...super.properties,\n \n /**\n * The default heading level (1-6), eg., 1 for <h1>, if there is no parent.\n */\n \"defaultLevel\": {\n \"type\": Number,\n \"attribute\": \"default-level\"\n },\n /**\n * The relative-heading's UUID.\n */\n \"id\": {\n \"type\": String\n },\n /**\n * The parent relative-heading's UUID.\n */\n \"parentId\": {\n \"type\": String,\n \"attribute\": \"parent-id\"\n },\n /**\n * The heading text.\n */\n \"text\": {\n \"type\": String\n },\n /**\n * The heading level (1-6), eg., 1 for <h1>\n */\n \"level\": {\n \"type\": Number,\n \"reflect\": true\n }\n}\n;\n }", "title": "" }, { "docid": "bdfea802566750291fe1624a1314b5fe", "score": "0.49604335", "text": "function createInitialheader(tree, section) {\n const newShow = document.createElement(\"li\"); // creates the list item\n newShow.className = \"shows__single-title-container\"; // adds a class to the list item\n // creates the labels\n const dateLabel = addsLabel(\"p\", \"shows__label\", \"DATE\");\n const venueLabel = addsLabel(\"p\", \"shows__label\", \"VENUE\");\n const locationLabel = addsLabel(\"p\", \"shows__label\", \"LOCATION\");\n //appends the labels to a list\n newShow.appendChild(dateLabel);\n newShow.appendChild(venueLabel);\n newShow.appendChild(locationLabel);\n //appends the list to the unordered list\n appendComment(section, newShow);\n // appends to the DOM\n appendComment(tree, section);\n }", "title": "" }, { "docid": "f35d49f2a5c2d024454b2d45d8134180", "score": "0.4950309", "text": "function headerStyleForLevel( headerLevel ) {\n\theaderLevel = Math.round( Math.max( Math.min( headerLevel, 6 ), 1 ) );\n\n\tvar size = [\n\t\t6, // h1\n\t\t5, // h2\n\t\t5, // h3\n\t\t4, // h4\n\t\t4, // h5\n\t\t3, // h6\n\t];\n\n\tvar bold = [\n\t\tfalse, // h1\n\t\ttrue, // h2\n\t\tfalse, // h3\n\t\ttrue, // h4\n\t\tfalse, // h5\n\t\ttrue, // h6\n\t];\n\n\tvar italic = [\n\t\tfalse, // h1\n\t\tfalse, // h2\n\t\tfalse, // h3\n\t\tfalse, // h4\n\t\tfalse, // h5\n\t\tfalse, // h6\n\t];\n\n\tvar underline = [\n\t\tfalse, // h1\n\t\tfalse, // h2\n\t\tfalse, // h3\n\t\tfalse, // h4\n\t\tfalse, // h5\n\t\tfalse, // h6\n\t];\n\n\tvar spacing = [\n\t\t'\\n', // h1\n\t\t'\\n', // h2\n\t\t'', // h3\n\t\t'', // h4\n\t\t'', // h5\n\t\t'', // h6\n\t];\n\n\treturn {\n\t\tsize: String( size[ headerLevel - 1 ] ),\n\t\tbold: !! bold[ headerLevel - 1 ],\n\t\titalic: !! italic[ headerLevel - 1 ],\n\t\tunderline: !! underline[ headerLevel - 1 ],\n\t\tadditionalSpacingBefore: spacing[ headerLevel - 1 ]\n\t};\n}", "title": "" }, { "docid": "74e6f1dc405cf0a5b38f6d32faf7b5e4", "score": "0.4875007", "text": "function displayHelpHeader()\n{\n // Construct the header text lines only once.\n if (typeof(displayHelpHeader.headerLines) == \"undefined\")\n {\n displayHelpHeader.headerLines = new Array();\n\n var headerText = EDITOR_PROGRAM_NAME + \" Help \u0001w(\u0001y\"\n + (EDITOR_STYLE == \"DCT\" ? \"DCT\" : \"Ice\")\n + \" mode\u0001w)\";\n var headerTextLen = strip_ctrl(headerText).length;\n\n // Top border\n var headerTextStr = \"\u0001n\u0001h\u0001c\" + UPPER_LEFT_SINGLE;\n for (var i = 0; i < headerTextLen + 2; ++i)\n headerTextStr += HORIZONTAL_SINGLE;\n headerTextStr += UPPER_RIGHT_SINGLE;\n displayHelpHeader.headerLines.push(headerTextStr);\n\n // Middle line: Header text string\n headerTextStr = VERTICAL_SINGLE + \"\u00014\u0001y \" + headerText + \" \u0001n\u0001h\u0001c\"\n + VERTICAL_SINGLE;\n displayHelpHeader.headerLines.push(headerTextStr);\n\n // Lower border\n headerTextStr = LOWER_LEFT_SINGLE;\n for (var i = 0; i < headerTextLen + 2; ++i)\n headerTextStr += HORIZONTAL_SINGLE;\n headerTextStr += LOWER_RIGHT_SINGLE;\n displayHelpHeader.headerLines.push(headerTextStr);\n }\n\n // Print the header strings\n for (var index in displayHelpHeader.headerLines)\n console.center(displayHelpHeader.headerLines[index]);\n}", "title": "" }, { "docid": "371817d59ddc8c9b2a4dbaa56f939ec6", "score": "0.48612538", "text": "function creaHeader(level, nameImg){\n\tvar levelTree = climbTreeStr(level);\n\t$(\".HMR_Banner\").append(\"<a href='\" + levelTree + \"'><img id='HMR_Logo' src='\" + levelTree + \"Assets/Images/HMR_2017g_GC-WebHeaderLogo-140x105.gif' alt='img'></a> <div id='HMR_HeaderText1'><a href='\" + levelTree + \"'>Hackerando la Macchina Ridotta</a></div> <div id='HMR_HeaderText2'>storia e archeologia sperimentale dell&rsquo;informatica</div> <img id='HMR_HeaderRightImg' src='\" + levelTree + \"Assets/Images/\" + nameImg + \"' alt='img'>\");\n}", "title": "" }, { "docid": "ec3e7212389ebd9dbe2f4e79857bfea7", "score": "0.4857702", "text": "constructor(start, end, text, headerLevel, parent)\n {\n super(State.Header, start, end, parent);\n this.headerLevel = headerLevel;\n this.text = text.substring(start, end);\n }", "title": "" }, { "docid": "41cf0aaf9e3eb0b7950d077b4596e9fa", "score": "0.4830286", "text": "function getHeading() {\r\n heading = document.createElement('div');\r\n heading.className = \"ctw-heading\"\r\n heading.id = \"ctw-heading\"\r\n heading.innerText = \"contributions this week\"\r\n return heading\r\n}", "title": "" }, { "docid": "d5e00722f730537f361a918c4ed7e86f", "score": "0.48228794", "text": "getTableHeaderHTML(topheaders = [], subheaders = [], options = this.options) {\n const { useMultiLevelHeaders, useRowspanHeaders } = options, decimalPoint = (options.useLocalDecimalPoint ?\n (1.1).toLocaleString()[1] :\n '.');\n let html = '<thead>', i = 0, len = subheaders && subheaders.length, next, cur, curColspan = 0, rowspan;\n // Clean up multiple table headers. Chart.getDataRows() returns two\n // levels of headers when using multilevel, not merged. We need to\n // merge identical headers, remove redundant headers, and keep it\n // all marked up nicely.\n if (useMultiLevelHeaders &&\n topheaders &&\n subheaders &&\n !isRowEqual(topheaders, subheaders)) {\n html += '<tr>';\n for (; i < len; ++i) {\n cur = topheaders[i];\n next = topheaders[i + 1];\n if (cur === next) {\n ++curColspan;\n }\n else if (curColspan) {\n // Ended colspan\n // Add cur to HTML with colspan.\n html += this.getCellHTMLFromValue('th', 'highcharts-table-topheading', 'scope=\"col\" ' +\n 'colspan=\"' + (curColspan + 1) + '\"', cur);\n curColspan = 0;\n }\n else {\n // Cur is standalone. If it is same as sublevel,\n // remove sublevel and add just toplevel.\n if (cur === subheaders[i]) {\n if (useRowspanHeaders) {\n rowspan = 2;\n delete subheaders[i];\n }\n else {\n rowspan = 1;\n subheaders[i] = '';\n }\n }\n else {\n rowspan = 1;\n }\n html += this.getCellHTMLFromValue('th', 'highcharts-table-topheading', 'scope=\"col\"' +\n (rowspan > 1 ?\n ' valign=\"top\" rowspan=\"' + rowspan + '\"' :\n ''), cur);\n }\n }\n html += '</tr>';\n }\n // Add the subheaders (the only headers if not using multilevels)\n if (subheaders) {\n html += '<tr>';\n for (i = 0, len = subheaders.length; i < len; ++i) {\n if (typeof subheaders[i] !== 'undefined') {\n html += this.getCellHTMLFromValue('th', null, 'scope=\"col\"', subheaders[i]);\n }\n }\n html += '</tr>';\n }\n html += '</thead>';\n return html;\n }", "title": "" }, { "docid": "09dfad534c69eaa119266e34d203a594", "score": "0.48217005", "text": "function units_format_heading(val, unit) {\n if(!unit)\n unit=\"deg\";\n\n if(val===null)\n return \"?\";\n if(isNaN(val))\n return \"?\";\n\n// if(unit==\"deg\")\n// val=val;\n\n var display_unit=\"deg-windrose\";\n var windrose=lang(\"units:heading:windrose:\"+(((val+337.5)/45.0).toFixed(0)%8));\n\n val=sprintf(\"%.0f\", val);\n\n return lang(\"units:heading:\"+display_unit, 0, val, windrose);\n}", "title": "" }, { "docid": "ffa35af9c33d428d7cbf1f1d7c0a6b14", "score": "0.48127544", "text": "static header(path, header, embed, display) {\r\n // Headers need to be normalized to alpha-numeric & with extra spacing removed.\r\n return new Link({\r\n path,\r\n embed,\r\n display,\r\n subpath: normalizeHeaderForLink(header),\r\n type: \"header\",\r\n });\r\n }", "title": "" }, { "docid": "665503c3d9019cd421fff756e535d98d", "score": "0.48053095", "text": "function _printHeader(){\n sys.log(sys.product.meta.getHeaderText());\n }", "title": "" }, { "docid": "80224e61e8f1e47465870b28307f444d", "score": "0.48047966", "text": "function headingsHandlerFunction(selection, documentRoot) {\n console.log(selection.items.length + \" items are selected\");\n\n if (selection.hasArtboards) {\n console.log(\"Selecting artboards not supported\");\n }\n\n selection.items.forEach(function (item) {\n let node = item;\n console.log(node.name);\n let level = 0;\n\n if (node.name.includes(\"[h1]\")) {\n level = 1;\n }\n\n if (node.name.includes(\"[h2]\")) {\n level = 2;\n }\n if (level > 0) {\n createHeadingNotation(\n node.translation.x - DEFAULTS.width,\n node.translation.y - DEFAULTS.height,\n level,\n selection\n );\n }\n });\n}", "title": "" }, { "docid": "6a13fa9517699a90a7669370c0fa9569", "score": "0.48045886", "text": "getTableHeaderHTML(topheaders = [], subheaders = [], options = this.options) {\n const { useMultiLevelHeaders, useRowspanHeaders } = options, decimalPoint = (options.useLocalDecimalPoint ?\n (1.1).toLocaleString()[1] :\n '.');\n let html = '<thead>', i = 0, len = subheaders && subheaders.length, next, cur, curColspan = 0, rowspan;\n // Clean up multiple table headers. Chart.getDataRows() returns two\n // levels of headers when using multilevel, not merged. We need to\n // merge identical headers, remove redundant headers, and keep it\n // all marked up nicely.\n if (useMultiLevelHeaders &&\n topheaders &&\n subheaders &&\n !isRowEqual(topheaders, subheaders)) {\n html += '<tr>';\n for (; i < len; ++i) {\n cur = topheaders[i];\n next = topheaders[i + 1];\n if (cur === next) {\n ++curColspan;\n }\n else if (curColspan) {\n // Ended colspan\n // Add cur to HTML with colspan.\n html += this.getCellHTMLFromValue('th', 'highcharts-table-topheading', 'scope=\"col\" ' +\n 'colspan=\"' + (curColspan + 1) + '\"', cur);\n curColspan = 0;\n }\n else {\n // Cur is standalone. If it is same as sublevel,\n // remove sublevel and add just toplevel.\n if (cur === subheaders[i]) {\n if (useRowspanHeaders) {\n rowspan = 2;\n delete subheaders[i];\n }\n else {\n rowspan = 1;\n subheaders[i] = '';\n }\n }\n else {\n rowspan = 1;\n }\n html += this.getCellHTMLFromValue('th', 'highcharts-table-topheading', 'scope=\"col\"' +\n (rowspan > 1 ?\n ' valign=\"top\" rowspan=\"' + rowspan + '\"' :\n ''), cur);\n }\n }\n html += '</tr>';\n }\n // Add the subheaders (the only headers if not using multilevels)\n if (subheaders) {\n html += '<tr>';\n for (i = 0, len = subheaders.length; i < len; ++i) {\n if (typeof subheaders[i] !== 'undefined') {\n html += this.getCellHTMLFromValue('th', null, 'scope=\"col\"', subheaders[i]);\n }\n }\n html += '</tr>';\n }\n html += '</thead>';\n return html;\n }", "title": "" }, { "docid": "3a4f6a64126253a78d659aa223a68323", "score": "0.48021787", "text": "function groupHeadings($elem, headingTagNames){\n \n if (!$elem) throw 'No jQuery element was provided in argument 1';\n headingTagNames = headingTagNames || ['h1', 'h2'];\n\n var $shadow = $('<div>');\n var $subcontent = $('<div>');\n $elem.children().each(function(){\n var $this = $(this);\n var tagName = $this.prop('tagName').toLowerCase();\n if (~headingTagNames.indexOf(tagName)){\n // Wrap up the old one, push it into shadow.\n $this.addClass('heading-toggle');\n $subcontent.clone().appendTo($shadow);\n $this.clone().appendTo($shadow);\n $subcontent = $('<div>');\n }\n else {\n $this.appendTo($subcontent);\n }\n });\n if ($subcontent){\n $subcontent.clone().appendTo($shadow);\n }\n // Switcharoo\n $elem.empty();\n $shadow.children().appendTo($elem);\n // delete $shadow;\n }", "title": "" }, { "docid": "a6230a8e82ce4d50a0e824f8d4ec591d", "score": "0.48001048", "text": "function headerTemplate(title) {\n return html`<header>${title}</header>`;\n}", "title": "" }, { "docid": "6c218ce9a5f86be62ecc755a8b3b1fca", "score": "0.47956264", "text": "function get_heading_level (text) {\n // zero indexed, as levels are stored in an list\n return text.match(/^#*/)[0].length - 1;\n }", "title": "" }, { "docid": "8bf7d4b8672910b72363086c069d6e4a", "score": "0.47873145", "text": "_checkHeader(start)\n {\n // Headers need to be at the start of a line (or at least the first non-whitespace character)\n // Nested within a ListItem is still fine though, as long as they're at the beginning\n let newline = this._lastNewline(start);\n\n let between = this.text.substring(newline + 1, start);\n if (!RegExp('^' + this._nestRegex() + '$').test(between))\n {\n return start;\n }\n\n if (!stateAllowedInState(State.Header, this.currentRun, start))\n {\n return start;\n }\n\n let headingLevel = 1;\n while (start + 1 < this.text.length && this.text[start + 1] == '#')\n {\n ++headingLevel;\n ++start;\n }\n\n // h6 is the highest heading level possible,\n // and there must be a space after the header declaration\n if (headingLevel > 6 || start == this.text.length - 1 || this.text[start + 1] != ' ')\n {\n // Reset i and continue\n start -= (headingLevel - 1);\n return start;\n }\n\n let end = this.text.indexOf('\\n', start);\n if (end == -1) { end = this.text.length; }\n let header = new Header(start - headingLevel + 1, end, this.text, headingLevel, this.currentRun);\n this.currentRun = header;\n return start;\n }", "title": "" }, { "docid": "9280d8f28a8af63552dc5d0285c62ef6", "score": "0.4777925", "text": "function Header(props) {\n const {\n hideBorder,\n startAdornment,\n endAdornment,\n TitleTextProps,\n children,\n ...restProps\n } = props;\n return /*#__PURE__*/_react.default.createElement(StyledHeader, _extends({\n hideBorder: hideBorder\n }, restProps), startAdornment, /*#__PURE__*/_react.default.createElement(_StyledText, _extends({\n fontSize: _exports.FontSizes.Title3,\n fontWeight: _exports.FontWeights.Medium,\n noWrap: true\n }, TitleTextProps, {\n _css: TitleTextProps === null || TitleTextProps === void 0 ? void 0 : TitleTextProps.css\n }), children), endAdornment);\n}", "title": "" }, { "docid": "2c7fee88683b06df68c5b522fe6fa1fe", "score": "0.477149", "text": "function printObjectivesHeader(){\n var html = \" \\\n <table class='table table-striped hidden' id='objTable'> \\\n <thead> \\\n <tr> \\\n <th>Due Date</th> \\\n \t <th>Title and Description</th> \\\n \t\t <th>Progress</th> \\\n \t\t <th>Created On</th> \\\n \t\t <th>Proposed By</th> \\\n \t\t <th>Archived</th> \\\n </tr> \\\n </thead> \\\n <tbody id='objDetails'> \\\n </tbody> \\\n </table> \\\n \"\n return html;\n}", "title": "" }, { "docid": "ff3b0e0a13859366ecb68e0dfede9776", "score": "0.47682646", "text": "function generateHeadingDivEl(headerText, classes) {\n let headingEl = document.createElement('h1');\n headingEl.setAttribute('class', classes);\n let divEl = generateMainContentDiv();\n headingEl.textContent = headerText;\n divEl.appendChild(headingEl);\n return divEl;\n}", "title": "" }, { "docid": "fb8a09004f1df297d32a42e8ebf0de0c", "score": "0.47677913", "text": "renderHeader() {\n let rowDef;\n const header = this._data.header;\n this._colTypes = [];\n\n for (let index = 0; index < header.length; index++) {\n if (index == 0) {\n this._headerDef = '<data-row>';\n rowDef = '';\n }\n const col = header[index];\n if (col.type !== 'hidden') {\n this._sortColumnIndex = col.isSort ? index : this._sortColumnIndex;\n rowDef += `<data-cell id=\"${col.id}\" class=\"header\" style=\"text-align: center;\"\n type=\"string\"\n data-mode=\"${col.mode}\" data-sort-Dir=\"${col.sortDir}\" data-is-sort=\"${col.isSort}\">${col.name}</data-cell>`;\n } else {\n this._hiddenCellIndex = index;\n }\n this._colTypes.push(col.type);\n }\n if (rowDef.length) {\n this._headerDef = rowDef + '</data-row>';\n }\n }", "title": "" }, { "docid": "fd661e4673246d5bf45ca5c0439fddbe", "score": "0.47592416", "text": "function headerHTML() {\n let headHTML =\n `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Team Webpage</title>\n <script src=\"https://use.fontawesome.com/cd4252186f.js\"></script>\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"style.css\"/>\n </head>\n <body>\n <h1><header>My Team</header></h1>\n <div id = \"cardspace\">`;\n \n fs.writeFile('./dist/TeamPage.html', headHTML, (err) => { if(err) console.log(err)});\n}", "title": "" }, { "docid": "7c7148d7912e30cea0fca3ffe11dd04b", "score": "0.4755558", "text": "heading(...headers) {\n this.lineBreak();\n this.horizontalDivider();\n headers.forEach(header => {\n this.centered(header);\n });\n this.horizontalDivider();\n this.lineBreak();\n }", "title": "" }, { "docid": "749d3d4c0959ab57b7ceafc23245e979", "score": "0.4746558", "text": "function toggleHeadingUp() {\n return __awaiter(this, void 0, void 0, function* () {\n let editor = vscode.window.activeTextEditor;\n let lineIndex = editor.selection.active.line;\n let lineText = editor.document.lineAt(lineIndex).text;\n return yield editor.edit((editBuilder) => {\n if (!lineText.startsWith('#')) {\n editBuilder.insert(new vscode.Position(lineIndex, 0), '# ');\n }\n else if (!lineText.startsWith('######')) {\n editBuilder.insert(new vscode.Position(lineIndex, 0), '#');\n }\n });\n });\n}", "title": "" }, { "docid": "54f07ebd5257b62c40b97cdafcc35b28", "score": "0.4743011", "text": "function Heading() {\n const title = 'Root finding web application';\n return <h1>{title}</h1>\n}", "title": "" }, { "docid": "a53c68268eb66399478cec6fe74e1e6f", "score": "0.47398615", "text": "createHeader() {\n var $text = $('<h4>')\n $text.attr('id', 'modal-title')\n $text.text(this.form.getTitle())\n $text.css('display', 'inline')\n $text.css('float', 'right')\n\n var $logo = $('<img>')\n $logo.addClass('d-inline')\n $logo.css('float', 'left')\n let imagePath = (this.options['base'] || '/') + 'images/logo.png'\n $logo.attr('src', imagePath)\n\n var $close = $('<button>')\n $close.attr('type', 'button')\n $close.addClass('close')\n $close.attr('data-dismiss', 'modal')\n $close.attr('aria-hidden', 'true')\n $close.text('x')\n\n\n var $title = this.$el('<div>', 'modal-title', [$logo, $text])\n var $header = this.$el('<div>', 'modal-header', [$title, $close])\n $header.addClass(HEADER_STYLES[this.options.type])\n\n\t\treturn $header\n }", "title": "" }, { "docid": "d9d1ab88f92ab4db12ed54ecf36ab8fa", "score": "0.47359356", "text": "markdown() {\r\n let result = (this.embed ? \"!\" : \"\") + \"[[\" + this.obsidianLink();\r\n if (this.display) {\r\n result += \"|\" + this.display;\r\n }\r\n else {\r\n result += \"|\" + getFileTitle(this.path);\r\n if (this.type == \"header\" || this.type == \"block\")\r\n result += \" > \" + this.subpath;\r\n }\r\n result += \"]]\";\r\n return result;\r\n }", "title": "" }, { "docid": "b9cfa2943a25edbf0efddec1297a94ce", "score": "0.4733412", "text": "function LogRegHeading({ heading }) {\n return (\n <h1 className={styles.header}>\n {heading}\n </h1>\n )\n}", "title": "" }, { "docid": "c35ab20bbcca1d5c9e5fad9fc819da5b", "score": "0.47184375", "text": "function renderHeader(options) {\n\n var\n graphHeader = $('<div/>').addClass('graph-header'),\n\n // used in fleshing out our header below\n titleText;\n\n // normalize our options object for easier checks below\n options = isUndefined(options) ? {} : options;\n\n // add a title\n titleText = (isUndefined(options.title)) ? 'Graph' : options.title;\n graphHeader.text(titleText);\n\n return graphHeader;\n }", "title": "" }, { "docid": "3755a54774a566a0a6b460e880ea9df9", "score": "0.47143218", "text": "function createHeader(table, numCells) {\n var header = document.createElement(\"tr\");\n \n /* Add a blank cell first. */\n header.appendChild(document.createElement(\"td\"));\n\n /* Add one column for each circle. */\n var label = \"a\";\n for (var i = 0; i < numCells; i++) {\n var cell = document.createElement(\"td\");\n cell.textContent = label;\n header.appendChild(cell);\n\n label = charAfter(label);\n }\n\n table.appendChild(header);\n}", "title": "" }, { "docid": "6fcc3c7e26f97229a7633385f92ce83d", "score": "0.47080737", "text": "function Title(props) {\n return e('h1', null, props.children);\n }", "title": "" }, { "docid": "9790041e4835fd283e2aebfe715d629b", "score": "0.46868888", "text": "function HTMLTestRunner_printHeader()\n{\n\tdocument.writeln( \"<pre>\" );\n\tthis._printHeader();\n}", "title": "" }, { "docid": "943df3effd7553f92721468e7da4b272", "score": "0.46810338", "text": "function headerScout (parent) {\n const headers = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n const children = Array.from(parent.children);\n const heads = children.filter((child) => headers.includes(child.tagName));\n\n for (let child of children) {\n if (child.childElementCount > 0) {\n heads.concat(headerScout(child));\n };\n };\n return heads;\n}", "title": "" }, { "docid": "d17974e70227e70a8832200b6e77e921", "score": "0.46778563", "text": "function parseOrgHeading(n, content) {\n let ret = {\n heading: n === 1 ? null : content[0], // content of the top-level heading\n content: [], // content below the top-level heading that isn't part of any sub-headings\n subheadings: [],\n };\n // look for subheadings with n stars\n let subheadingRegex = new RegExp(`^\\\\s*\\\\*{${n}} `);\n let i = 0;\n if (n > 1) {\n i = 1; // we know content[0] is the top-level heading itself\n while (i < content.length && !content[i].match(subheadingRegex)) {\n ret.content.push(content[i]);\n i++;\n }\n }\n let currentSubheading = [];\n for (let j = i; j < content.length; j++) {\n if (content[j].match(subheadingRegex) && j !== i) {\n ret.subheadings.push(currentSubheading.slice(0));\n currentSubheading = [];\n }\n currentSubheading.push(content[j]);\n }\n\n return ret;\n }", "title": "" }, { "docid": "dc0691ecb31a5867366c4a5e354af536", "score": "0.46729612", "text": "function makeHeader(bigMult, bigShift, smallMult, smallShift){\r\n var bMult = blockToArray(bigMult);\r\n var bShift = blockToArray(bigShift);\r\n var small = [parseInt(smallMult, 10), parseInt(smallShift, 10)];\r\n return numbersToString(bMult) + numbersToString(bShift) +\r\n numbersToString(small);\r\n}", "title": "" }, { "docid": "4be995009a1e6fff41dce7a7d6a2719c", "score": "0.46657413", "text": "function isHeadingLevel2(node) {\n return node.type === \"heading\" && node.depth == 2;\n}", "title": "" }, { "docid": "38cd1fe4a2f8255d85b135eae46fa98c", "score": "0.46652102", "text": "function createCategoryHeader(cat) {\n var top = $(\"<h1>\", {\n text: cat.name,\n class: \"top\",\n });\n var columnHeaders =\n '<div class=\"grid\">\\n\\t\\t\\t<div class=\"column-header name\">'\n .concat(\n text.columnHeaders.activity,\n '</div>\\t\\n\\t\\t\\t<div class=\"column-header info\">'\n )\n .concat(\n text.columnHeaders.info,\n '</div>\\t\\t\\n\\t\\t\\t<div class=\"column-header age\">'\n )\n .concat(\n text.columnHeaders.age,\n '</div>\\n\\t\\t\\t<div class=\"column-header schedule\">'\n )\n .concat(\n text.columnHeaders.schedule,\n '</div>\\t\\n\\t\\t\\t<div class=\"column-header session\">'\n )\n .concat(\n text.columnHeaders.session,\n '</div>\\t\\n\\t\\t\\t<div class=\"column-header price\">'\n )\n .concat(\n text.columnHeaders.price,\n '</div>\\t\\n\\t\\t\\t<div class=\"column-header cours\">'\n )\n .concat(\n text.columnHeaders.duration,\n '</div>\\n\\t\\t\\t<div class=\"column-header location\">'\n )\n .concat(\n text.columnHeaders.location,\n '</div>\\t\\n\\t\\t\\t<div class=\"column-header staff\">'\n )\n .concat(\n text.columnHeaders.staff,\n '</div>\\n\\t\\t\\t<div class=\"column-header start\">'\n )\n .concat(text.columnHeaders.start, \"</div>\\t\\n</div>\");\n var header = $(\"<div>\", {\n class: convertToClassSafe(cat.name) + \" category-header\",\n })\n .attr(\"data-always-visible\", \"true\")\n .append(top)\n .append(columnHeaders);\n return header;\n}", "title": "" }, { "docid": "8a23e4fe799fbd9431fa576d0aee95fc", "score": "0.4660751", "text": "function encode (obj) {\n if (!obj && !(this instanceof TarHeader)) throw new Error(\n \"encode must be called on a TarHeader, or supplied an object\")\n\n obj = obj || this\n var block = obj.block = new Buffer(512)\n\n // if the object has a \"prefix\", then that's actually an extension of\n // the path field.\n if (obj.prefix) {\n // console.error(\"%% header encoding, got a prefix\", obj.prefix)\n obj.path = obj.prefix + \"/\" + obj.path\n // console.error(\"%% header encoding, prefixed path\", obj.path)\n obj.prefix = \"\"\n }\n\n obj.needExtended = false\n\n if (obj.mode) {\n if (typeof obj.mode === \"string\") obj.mode = parseInt(obj.mode, 8)\n obj.mode = obj.mode & 0777\n }\n\n for (var f = 0; fields[f] !== null; f ++) {\n var field = fields[f]\n , off = fieldOffs[f]\n , end = fieldEnds[f]\n , ret\n\n switch (field) {\n case \"cksum\":\n // special, done below, after all the others\n break\n\n case \"prefix\":\n // special, this is an extension of the \"path\" field.\n // console.error(\"%% header encoding, skip prefix later\")\n break\n\n case \"type\":\n // convert from long name to a single char.\n var type = obj.type || \"0\"\n if (type.length > 1) {\n type = tar.types[obj.type]\n if (!type) type = \"0\"\n }\n writeText(block, off, end, type)\n break\n\n case \"path\":\n // uses the \"prefix\" field if > 100 bytes, but <= 255\n var pathLen = Buffer.byteLength(obj.path)\n , pathFSize = fieldSize[fields.path]\n , prefFSize = fieldSize[fields.prefix]\n\n // paths between 100 and 255 should use the prefix field.\n // longer than 255\n if (pathLen > pathFSize &&\n pathLen <= pathFSize + prefFSize) {\n // need to find a slash somewhere in the middle so that\n // path and prefix both fit in their respective fields\n var searchStart = pathLen - 1 - pathFSize\n , searchEnd = prefFSize\n , found = false\n , pathBuf = new Buffer(obj.path)\n\n for ( var s = searchStart\n ; (s <= searchEnd)\n ; s ++ ) {\n if (pathBuf[s] === slash || pathBuf[s] === bslash) {\n found = s\n break\n }\n }\n\n if (found !== false) {\n prefix = pathBuf.slice(0, found).toString(\"utf8\")\n path = pathBuf.slice(found + 1).toString(\"utf8\")\n\n ret = writeText(block, off, end, path)\n off = fieldOffs[fields.prefix]\n end = fieldEnds[fields.prefix]\n // console.error(\"%% header writing prefix\", off, end, prefix)\n ret = writeText(block, off, end, prefix) || ret\n break\n }\n }\n\n // paths less than 100 chars don't need a prefix\n // and paths longer than 255 need an extended header and will fail\n // on old implementations no matter what we do here.\n // Null out the prefix, and fallthrough to default.\n // console.error(\"%% header writing no prefix\")\n var poff = fieldOffs[fields.prefix]\n , pend = fieldEnds[fields.prefix]\n writeText(block, poff, pend, \"\")\n // fallthrough\n\n // all other fields are numeric or text\n default:\n ret = numeric[field]\n ? writeNumeric(block, off, end, obj[field])\n : writeText(block, off, end, obj[field] || \"\")\n break\n }\n obj.needExtended = obj.needExtended || ret\n }\n\n var off = fieldOffs[fields.cksum]\n , end = fieldEnds[fields.cksum]\n\n writeNumeric(block, off, end, calcSum.call(this, block))\n\n return block\n}", "title": "" }, { "docid": "5e9e3545769b8d7d8caea474a36fb427", "score": "0.46455914", "text": "function setHeading(text)\n{\n var heading_div = document.getElementById(\"main-header__heading\");\n heading_div.innerText = text;\n}", "title": "" }, { "docid": "07f09471dc62e1e900283d1a4c03ab50", "score": "0.464102", "text": "static convertHeaders(input) {\n for (var i = 6; i >= 1; i--) {\n /* \n selects characters matching '#n {anything but a line return} where n is the number of #'s and the corresponding header level.'\n */\n let regSelect = new RegExp(`^#{${i}}\\\\s{1}(.+)`, 'gm')\n /* \n replaces the entire match with just the sectioned off portion being our inner value\n */\n input = input.replace(regSelect, `<h${i}>$1</h${i}>`);\n }\n return input;\n }", "title": "" } ]
6183912f48cc2ef90f23ef3b8afc936f
public; return: row array / null;
[ { "docid": "250fea2f803458a9350435dcf4710a0c", "score": "0.0", "text": "function TreeView_getChildRows(sCode, iLevel){\r\n if (iLevel== null) iLevel= 1;\r\n\r\n var vaoRow= new Array();\r\n var voCol= null;\r\n \r\n if (iLevel== this.MAX_LEVEL){\r\n if (this.isRoot(sCode)){\r\n vaoRow= this.oTableData.selectNodes(\"rowset/row\");\r\n return vaoRow;\r\n }\r\n }\r\n \r\n var vaoEle= new Array();\r\n vaoEle[0]= new Object();\r\n vaoEle[0].code= sCode;//this.getNodeCode(oNode);\r\n vaoEle[0].level= 0;\r\n\r\n for (var i= 0; i< vaoEle.length; i++){\r\n if (vaoEle[i].level>= iLevel) continue;\r\n var vaoNode= null;\r\n if (this.isRoot(vaoEle[i].code)){\r\n vaoNode= this.oTableData.selectNodes(\"rowset/row[\"+ this.getPCodeField()+ \" = '' or not(\"+ this.getPCodeField()+ \")]\");\r\n }else{\r\n vaoNode= this.oTableData.selectNodes(\"rowset/row[\"+ this.getPCodeField()+ \" = '\"+ vaoEle[i].code+ \"']\");\r\n }\r\n if (vaoNode== null) continue;\r\n \r\n for (var k= 0; k< vaoNode.length; k++){\r\n if (vaoNode[k]== null) continue;\r\n vaoRow[vaoRow.length]= vaoNode[k];\r\n voCol= vaoNode[k].selectSingleNode(this.getCodeField());\r\n if (voCol== null) continue;\r\n\r\n var voEle= new Object();\r\n voEle.code= voCol.text;\r\n voEle.level= vaoEle[i].level+ 1;\r\n vaoEle[vaoEle.length]= voEle;\r\n }\r\n }\r\n vaoEle.length= 0;\r\n vaoEle= null;\r\n return vaoRow;\r\n}", "title": "" } ]
[ { "docid": "f0c093dd38af1eb3c81ce3c92a9813d5", "score": "0.7451851", "text": "rows () { return this._rows }", "title": "" }, { "docid": "54381c2cc2631093e55ac835cdb2ac40", "score": "0.7292769", "text": "row(){\n return this.__row;\n }", "title": "" }, { "docid": "2773b9860187d23dd0cbd1e8f31787dc", "score": "0.7222787", "text": "getRowData() {\n\t \treturn this.rowData;\n\t }", "title": "" }, { "docid": "807df2ff73167ec8d8b5ff7d83a7e68b", "score": "0.7088034", "text": "function row () {\n\t // TODO: also register row number during parsing\n\t return undefined;\n\t}", "title": "" }, { "docid": "f6f114b77e1039835c685b4167c4a0dc", "score": "0.7012726", "text": "function row () {\n // TODO: also register row number during parsing\n return undefined;\n}", "title": "" }, { "docid": "f6f114b77e1039835c685b4167c4a0dc", "score": "0.7012726", "text": "function row () {\n // TODO: also register row number during parsing\n return undefined;\n}", "title": "" }, { "docid": "0206d1b4178a025d7a140da338e86699", "score": "0.696966", "text": "function row () {\n // TODO: also register row number during parsing\n return undefined;\n }", "title": "" }, { "docid": "2504fd7b94c431a996aa7c0993765ae9", "score": "0.6953548", "text": "getRows(){\r\n return this.rows;\r\n }", "title": "" }, { "docid": "57787b1aa9bf7842421fd81cf121731f", "score": "0.69094276", "text": "get row() {\n return this.i.b;\n }", "title": "" }, { "docid": "2d104d17d73abdb672b575e8ffed1340", "score": "0.6877586", "text": "get rowCollection() {\n return this.rows;\n }", "title": "" }, { "docid": "2d104d17d73abdb672b575e8ffed1340", "score": "0.6877586", "text": "get rowCollection() {\n return this.rows;\n }", "title": "" }, { "docid": "a5d6251926491bffa6214a0a604051a7", "score": "0.68435836", "text": "getRows() {\n return this._rows;\n }", "title": "" }, { "docid": "b81932f18aeef3f24bad9fef07fd3cfc", "score": "0.68169194", "text": "get rows(){\n //Bah, I hate declaring variables up here, but gotta do what ya gotta do.\n let rows = [];\n\n //Map the list view output to the lightning data table format output.\n if(this.records && this.records.data && this.records.data.records){\n //Iterate through the list view records and map them to a friendlier data table-esque format.\n rows = this.records.data.records.records.map(record => {\n let row = {};\n this.columns.forEach(column => {\n if (record.fields[column.fieldName]) {\n row[column.fieldName] = record.fields[column.fieldName].value;\n }\n });\n return row;\n });\n }\n return rows;\n }", "title": "" }, { "docid": "98a5068b4e848a85a7a13ebf201802c8", "score": "0.6575", "text": "constructor(row){\r\n this.row = row \r\n }", "title": "" }, { "docid": "efd59779026fb082c0d5177807e43ad0", "score": "0.655413", "text": "fetchRow() {\n return this.resultInterator.fetchRow();\n }", "title": "" }, { "docid": "0d5f1c43f98372a2cfcd1e42398fe645", "score": "0.64709216", "text": "makeRows() {\n var rows = []\n for (var i = 0; i < this.state.data.length; i++) {\n rows.push(this.makeRow(i))\n }\n return rows\n }", "title": "" }, { "docid": "c16299fb26ac0030e9ec8f9b40cc93b8", "score": "0.6436376", "text": "getValue(row) { return getValue(this, row); }", "title": "" }, { "docid": "39b7509db9c00233aaa12e1e9a739bc9", "score": "0.6424394", "text": "function emptyOrRows(rows) {\n if (!rows) {\n return [];\n }\n return rows;\n}", "title": "" }, { "docid": "8cabea532573b15cf34908342bf9d267", "score": "0.6350603", "text": "toArray() {\n let arr = [];\n for(let i=0;i<this.rows;i++)\n for(let j=0;j<this.cols;j++)\n arr.push(this.data[i][j]);\n return arr;\n }", "title": "" }, { "docid": "8f1e87a9eec1031bba2a6a05ce8f603e", "score": "0.63204217", "text": "value( { col, row } ) {\n let pos = this._transpose( { col: col, row: row } );\n return this._rows[pos.row][pos.col];\n }", "title": "" }, { "docid": "9f2a10f3ee8e2c0c4338267322c3dc57", "score": "0.6314247", "text": "function rowData(row) {\r\n return data.columns.map(function (column) {\r\n return { column: column, value: row[column] }; }); }", "title": "" }, { "docid": "fea65f71a38484e1a0f27caf1876fe5b", "score": "0.6277957", "text": "function getAllRows() {\n\t\tvar allRows = [];\n\t\tfor (var i = 1; i <= data.length; i++)\n\t\t\tallRows.push(i);\n\t\treturn allRows;\n\t}", "title": "" }, { "docid": "46d172bd3f4242df36cbb9382495469c", "score": "0.6267734", "text": "get row() {\n return this.request(`${this.prefix}get_position`, [this]).then(position => position[0]);\n }", "title": "" }, { "docid": "35f0f1608ebfac22f4a1002afecc7650", "score": "0.6238245", "text": "toArray() {\n let arr = [];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n arr.push(this.data[i][j]);\n }\n }\n return arr;\n }", "title": "" }, { "docid": "5818f3f31794ed4874ce5d038df540ce", "score": "0.6213721", "text": "get rows() {\n\t\treturn this.nativeElement ? this.nativeElement.rows : undefined;\n\t}", "title": "" }, { "docid": "28f06049ba9237f7e58485b0b560e629", "score": "0.6192911", "text": "function getRows() {\n return rowsCache;\n }", "title": "" }, { "docid": "50e06f74a929dc15171d0750e1e13259", "score": "0.6192503", "text": "getRow(index) {\n return this.rows[index];\n }", "title": "" }, { "docid": "50e06f74a929dc15171d0750e1e13259", "score": "0.6192503", "text": "getRow(index) {\n return this.rows[index];\n }", "title": "" }, { "docid": "0ee00af892ef3e87070baa23e4aeda90", "score": "0.61603576", "text": "async rows(...args) {\n const r = await this.query(...args);\n return _.has(r, 'rows') ? r.rows.map(camelCase) : [];\n }", "title": "" }, { "docid": "31f016c9251e71aff2de1cfc9a5492ac", "score": "0.61335564", "text": "getTileRows(): Tile[][] {\n const [width, height] = this.getMapSize();\n const rows = [];\n for (let y = 0; y < height; y++) {\n const row = [];\n rows.push(row);\n for (let x = 0; x < width; x++) {\n row.push(this.getTileAtCoordinates(x, y));\n }\n }\n return rows;\n }", "title": "" }, { "docid": "13b8d96b3b50d308ff13cea373789cb8", "score": "0.6132966", "text": "initRows() {\n const { fields, name, dbPath } = this;\n const rowsPath = path.join(dbPath, name, 'data.json');\n\n if (fs.existsSync(rowsPath)) {\n const rows = JSON.parse(fs.readFileSync(rowsPath));\n\n return rows.map(r => new Row(fields, r.data, this, r.id));\n }\n\n fs.writeFileSync(rowsPath, JSON.stringify([])); // if not exists\n\n return [];\n }", "title": "" }, { "docid": "9722ff58d72dc75e14b31b6ec767ef39", "score": "0.6129717", "text": "get rows() {\n let result = [];\n for (const boolRow of this.boolRows) {\n result.push(boolRow.toString(2).padStart(this.width, '0'))\n }\n return result\n }", "title": "" }, { "docid": "aac4a97530beb9fd5b3a158b8c2fa41a", "score": "0.61289704", "text": "getRows(type){\n\t\tvar rows = [];\n\t\t\n\t\tswitch(type){\n\t\t\tcase \"active\":\n\t\t\t\trows = this.activeRows;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"display\":\n\t\t\t\trows = this.table.rowManager.getDisplayRows();\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"visible\":\n\t\t\t\trows = this.getVisibleRows(false, true);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\trows = this.chain(\"rows-retrieve\", type, null, this.rows) || this.rows;\n\t\t}\n\t\t\n\t\treturn rows;\n\t}", "title": "" }, { "docid": "cee927e8465c57ea3222afea80568e23", "score": "0.6128946", "text": "toArray() {\n return this._cells.map((row) => { return row.map((cell) => { return cell.type; }); });\n }", "title": "" }, { "docid": "5bea25ad5840e5a0aa1a74f63354c978", "score": "0.6124522", "text": "renderRows(row){\n return this.cellData[row - 1];\n }", "title": "" }, { "docid": "e37a7a8ac2b573b729f2da694584fd5e", "score": "0.61159617", "text": "get firstRow() {\n return this._i._ac;\n }", "title": "" }, { "docid": "41616db596eb72c330da201d74cbb00a", "score": "0.60758746", "text": "getRowValues(row, column) {\n const { game } = this.state;\n return game.getRowValues(row);\n }", "title": "" }, { "docid": "33487650291977a1c8adcf517d0c9612", "score": "0.6067964", "text": "_modifyRowData(row) {\n return row;\n }", "title": "" }, { "docid": "fa5fbce99213195f489317219896cdcc", "score": "0.60413784", "text": "get rows() {\n return this.children(Row);\n }", "title": "" }, { "docid": "b3f5eebee07702461335137c544c6215", "score": "0.60412115", "text": "toArray() {\n let arr = [];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.cols; j++) {\n arr.push(this.vals[i][j]);\n }\n }\n return arr;\n }", "title": "" }, { "docid": "bc4bdf2a945dcc255f8724895112d07e", "score": "0.60408777", "text": "function RowContext() {}", "title": "" }, { "docid": "bf6c21acc44a7d4254906be2a46d660d", "score": "0.600472", "text": "getRows() {\n return this.range().reverse().map(y =>\n this.range().map(x => this.get(x, y)));\n }", "title": "" }, { "docid": "5f62b001491decf1e3f0bbdf2004ade1", "score": "0.5977363", "text": "function getSelectedRows(){\n /*var selectedArrow=$(\"#queryResultTable\").jqGrid('getGridParam','selarrrow');\n return selectedArrow.slice(0,selectedArrow.length);*/\n \n return selArr.slice(0,selArr.length);\n \n}", "title": "" }, { "docid": "fbd3e06e14e8d610be32993f706d86a5", "score": "0.5954027", "text": "getRow(row_pos){\n let row = [];\n for(let i = 1; i < Utils.column + 1; i++){\n row = row.concat(this.renderSquare(row_pos, i));\n }\n return row;\n }", "title": "" }, { "docid": "cab6a887d935ca4a19e9e94ce94abce0", "score": "0.5950116", "text": "function getRows ( nRow )\n{\n\tvar aNodes = [];\n\tvar aoData = nRow.aoData;\n\tfor ( var i=0, iLen=aoData.length ; i<iLen ; i++ )\n\t{\n\t\tif ( aoData[i].nTr !== null )\n\t\t{\n\t\t\taNodes.push( aoData[i].nTr );\n\t\t}\n\t}\n\treturn aNodes;\n}", "title": "" }, { "docid": "944b80bef640b27ec4f07a55bab25188", "score": "0.5936835", "text": "function setGLArry() {\n var arrGLRows = new Array();\n var tableBK = $('#tblGLTrans').DataTable();\n $.each(gSelectedRows_GL, function(index, value) {\n var row = new OBJ_TableGL(tableBK.row(value).data()[\"TRDATE\"], tableBK.row(value).data()[\"EGCUAM\"], tableBK.row(value).data()[\"CHKNO\"], tableBK\n .row(value).data()[\"EGJRNO\"], tableBK.row(value).data()[\"SHOVAR\"], tableBK\n .row(value).data()[\"EGJSNO\"], tableBK.row(value).data()[\"EGVTXT\"], tableBK\n .row(value).data()[\"EGERDT\"], tableBK.row(value).data()[\"RECNO\"],tableBK.row(value).data()[\"VSER\"]);\n\n arrGLRows.push(row);\n });\n\n return arrGLRows;\n}", "title": "" }, { "docid": "263cf40f8445fb287baba71d44baa293", "score": "0.59278387", "text": "getRow () {\n\t\treturn position.toRow(this.pos);\n\t}", "title": "" }, { "docid": "56238e664abeb0347116e84d85b2d520", "score": "0.59064215", "text": "get frozenRows() {\n return this._ad;\n }", "title": "" }, { "docid": "3c5ca2fb1a6b8b2e26d79cc0c2cd242d", "score": "0.59013635", "text": "function mapPropRows(row){\n\n }", "title": "" }, { "docid": "c1f46850b8bdb6156d02b69e99c66cb0", "score": "0.59011203", "text": "function getRows(accNode)\n{\n try{\n return accNode.rows;\n }\n catch(e){\n return(e);\n }\n}", "title": "" }, { "docid": "3fd9c157f18ef7012d0a576a294ed1e7", "score": "0.5876116", "text": "constructor(dim){\n this.dim = dim;\n this.rows = [];\n }", "title": "" }, { "docid": "3764b5f8c88fd955e78451cb248fd5ee", "score": "0.587521", "text": "safeGetFirstRow() {\n let tableDataRow;\n let isObj = this.result != null && !util_1.isUndefined(this.result);\n let isTableData = this.result instanceof sql_table_data_1.SQLTableData;\n if (isObj && isTableData && this.result.dataRows.length > 0) {\n tableDataRow = this.result.getFirstRow();\n }\n else {\n tableDataRow = new sql_table_data_row_1.SQLTableDataRow();\n tableDataRow.isEmpty = true;\n }\n return tableDataRow;\n }", "title": "" }, { "docid": "dd3dcae448329f22b08af41e2ff0ccb4", "score": "0.5856201", "text": "function getAllAicRows() {\n if (aicGridApi) {\n aicGridApi.stopEditing();\n let rowData = [];\n aicGridApi.forEachNode(node => rowData.push(node.data));\n return rowData;\n }\n }", "title": "" }, { "docid": "193336b70699d59438590840682cf377", "score": "0.5854673", "text": "get rows() {\n if (this.gridRows == null) {\n this.gridRows = new PdfGridRowCollection(this);\n }\n return this.gridRows;\n }", "title": "" }, { "docid": "193336b70699d59438590840682cf377", "score": "0.5854673", "text": "get rows() {\n if (this.gridRows == null) {\n this.gridRows = new PdfGridRowCollection(this);\n }\n return this.gridRows;\n }", "title": "" }, { "docid": "46392f654c4bed1bd5ddbe1db96bba4d", "score": "0.5843991", "text": "toArray() {\n \t return this._array.slice();\n \t }", "title": "" }, { "docid": "fbfd27b5b1b3d929f5e4a906c30e6aa2", "score": "0.5833256", "text": "toArray(){\n if (this.cols!=1){\n console.log(\"cant convert to Array!\");\n return;\n }\n\n let array=[];\n for (let i=0; i<this.rows;i++){\n array.push(this.matrix[i][0]);\n }\n\n return array;\n }", "title": "" }, { "docid": "2c0126bbcf346822ef6dfbc490b99268", "score": "0.5821839", "text": "getRow(y /*int*/, row) {\n if (row === null || row === undefined || row.getSize() < this.width) {\n row = new BitArray(this.width);\n }\n else {\n row.clear();\n }\n const rowSize = this.rowSize;\n const bits = this.bits;\n const offset = y * rowSize;\n for (let x = 0; x < rowSize; x++) {\n row.setBulk(x * 32, bits[offset + x]);\n }\n return row;\n }", "title": "" }, { "docid": "e16a612f9faddb0a34e80f686dd8ea40", "score": "0.5810455", "text": "getRow(i)\n {\n return this.matrix[i];\n }", "title": "" }, { "docid": "fba68ea48d6d0ef9a65d349bb74436ce", "score": "0.58094424", "text": "toArray(){return this._array.slice();}", "title": "" }, { "docid": "63f09ec59a402fcb6e1e95a7025d60cc", "score": "0.58005667", "text": "row(arg1) {\n /** Create new element */\n const row = new strapped.Row();\n\n /** Add to last container of indicated type */\n if ( typeof arg1 == 'string' && arg1.length > 0 )\n this.last(arg1).append(row);\n else if ( this.last('Body') )\n this.last('Body').append(row);\n else\n this.append(row);\n \n /** Allow for call chaining */\n return row;\n }", "title": "" }, { "docid": "452d857e4e0f96d05eafe04b15e99607", "score": "0.57925785", "text": "function createRowTable(data) {\n let newArr = new Array();\n for (var i = 0; i < 5; i++) {\n newArr[i] = data[i];\n }\n removeArr(data);//remove row data\n return newArr;\n}", "title": "" }, { "docid": "5f84d2b665f7e208cd6a2c3a3fc84f50", "score": "0.5790242", "text": "function getAll(result) {\r\n var output = [];\r\n for (var i = 0; i < result.rows.length; i++) {\r\n output.push(result.rows.item(i));\r\n }\r\n return output;\r\n }", "title": "" }, { "docid": "4cc2ea77b5c3b8c0620651075fe0e08b", "score": "0.5788131", "text": "function RowHashMap() {}", "title": "" }, { "docid": "4cc2ea77b5c3b8c0620651075fe0e08b", "score": "0.5788131", "text": "function RowHashMap() {}", "title": "" }, { "docid": "4cc2ea77b5c3b8c0620651075fe0e08b", "score": "0.5788131", "text": "function RowHashMap() {}", "title": "" }, { "docid": "de4248ebbb84a6958f0e0284da153997", "score": "0.5780151", "text": "function getRows(solution) {\n return isArrayValid(solution);\n}", "title": "" }, { "docid": "61f570da6901f7a0dbc33c8b6c6df552", "score": "0.57785314", "text": "function createRecord(){\n const r = new Array(NUM_ROW)\n for(let rI = 0; rI < NUM_ROW; rI++) {\n r[rI] = -1\n }\n return r\n}", "title": "" }, { "docid": "7fd3cde2b1c8038a7050bf1d053b3d72", "score": "0.57670504", "text": "getTableRowData(key) {\n return this.state.tableRows.find(r => r.key == key);\n }", "title": "" }, { "docid": "cb371cb8a700b4b60f1f536057ca6d46", "score": "0.5765498", "text": "_compileRow(dataArray) {\n throw 'Error, this method must be implemented';\n }", "title": "" }, { "docid": "449384db354b95b0a7fa2c386995ed4b", "score": "0.5733385", "text": "setOutput() {\n this.rows = [];\n\n // Add a header row constructed from the column labels, if appropriate.\n if (!this.request.state.offset && !this.attributes.rowNumberOffset) {\n this.rows.push(new Row(0, this.attributes.labels, this.attributes.labels));\n }\n\n // Each table cell ('c') can contain two properties: 'p' contains\n // formatting and 'v' contains the actual cell value.\n\n // Loop through each table row.\n this.raw.table.rows.forEach((row, i) => {\n // Proceed if the row has cells and the row index is within the targeted\n // range. (This avoids displaying too many rows when paging data.)\n if (row.c && i < this.attributes.last) {\n // Get the \"real\" row index (not counting header rows). Create a row\n // object and add it to the output array.\n const counter = (this.request.state.offset + i + 1) - this.attributes.rowNumberOffset;\n this.rows.push(new Row(counter, row.c, this.attributes.labels));\n }\n });\n\n // Remember the new row offset.\n this.request.update({\n offset: this.request.state.offset + this.options.user.fetchSize,\n });\n }", "title": "" }, { "docid": "bd6a31866bae9d9dbe8785915d1b858c", "score": "0.5707828", "text": "function getElementRows(name, index = 0, doc = document) {\n const __TABLE = getElement(name, index, doc);\n const __ROWS = (__TABLE ? __TABLE.rows : undefined);\n\n return __ROWS;\n}", "title": "" }, { "docid": "15337e7a066a01980ba0f70c7ed5962f", "score": "0.5699552", "text": "function echo(err, rows) {\n return rows;\n}", "title": "" }, { "docid": "273336eb81f64455449736353144433c", "score": "0.5689101", "text": "previousRow(){\n return this.__previousRow;\n }", "title": "" }, { "docid": "c85a718b59af4b8b78991669a285f18b", "score": "0.5686131", "text": "getRow(tableName, location) {\r\n //Call getRow method from get.js\r\n return get.getRow(this.db, tableName, location);\r\n }", "title": "" }, { "docid": "c83c1533b6f56b3fe3e4931ff697c3db", "score": "0.5684847", "text": "rowGetter(rowIdx) {\n return this.state.rows[rowIdx]\n }", "title": "" }, { "docid": "f5c331ff563312dda6f039fdbe86a058", "score": "0.56845176", "text": "asArray() {\n const result = new Array();\n this.toArray(result, 0);\n return result;\n }", "title": "" }, { "docid": "5b49c3320c7bd58133f1afa066ef9951", "score": "0.56843203", "text": "getData(i,j) {\n return this.data[i][j]\n \n }", "title": "" }, { "docid": "53d05ed8e384e9c76bfba447eaa83c7b", "score": "0.5682331", "text": "function create_row(){\n var table = document.getElementById('blogPostTable')\n var tbody = document.getElementsByTagName('tbody')[0]\n var new_row = tbody.insertRow(-1)\n var cell1 = new_row.insertCell(0)\n var cell2 = new_row.insertCell(1)\n var cell3 = new_row.insertCell(2)\n return [cell1,cell2,cell3]\n }", "title": "" }, { "docid": "497acc8fd2daac8b3ed3d3b25d103f52", "score": "0.5676893", "text": "rtnNumColsRows() {\n // local variables \n return [this.numCols, this.numRows];\n }", "title": "" }, { "docid": "30f56ce2aff78b9015ae0ff5a77845c0", "score": "0.56744295", "text": "function copyTableRows( rows ) {\n var newTable = [], i;\n\n for( i = 0; i < rows.length; i++ ) {\n newTable.push( JSON.parse( JSON.stringify( rows[i] ) ) );\n }\n\n return newTable;\n }", "title": "" }, { "docid": "82dbdc71ec46dbc43ae1cd5aa5c123dd", "score": "0.566242", "text": "r(rowIndex) {\n return this.row[rowIndex - 1];\n }", "title": "" }, { "docid": "e219bc93c344c65fd886f791b7724407", "score": "0.5658956", "text": "function getClickedRowObject() {\n var row = $scope.table.row(this);\n var data = row.data();\n return {\n data: data,\n row: row\n }\n }", "title": "" }, { "docid": "afdee4e0137681e70dfa8748b26958b4", "score": "0.56556636", "text": "createRows(){\n if(this.state.isSynth){\n return <Synthesiser synthID={this.state.id} rows={this.state.rows}/>\n }else{\n const rows = [];\n for (let i = 0; i < this.state.rows.length; i++ ){\n rows.push( <Row key={i} rowID={this.state.rows[i]} collaborators={this.props.collaborators}/> )\n }\n return rows;\n }\n }", "title": "" }, { "docid": "d34187af3603a8f263064f10ea2b6fe7", "score": "0.56554717", "text": "add(row){\n\n }", "title": "" }, { "docid": "6ac74f70fc20da8db19abdffd11aa274", "score": "0.56548244", "text": "get lastRow() {\n return this._i._ae;\n }", "title": "" }, { "docid": "07e5c3ada8cefd0a3fddde0c35876207", "score": "0.56547457", "text": "getRows(rows){\n\t\tvar output = rows.slice(0);\n\n\t\tthis.rows.forEach(function(row){\n\t\t\tvar index = output.indexOf(row);\n\n\t\t\tif(index > -1){\n\t\t\t\toutput.splice(index, 1);\n\t\t\t}\n\t\t});\n\n\t\treturn output;\n\t}", "title": "" }, { "docid": "8dc38e591896ee5b59a215ebd389b27f", "score": "0.56446505", "text": "getData(numRecords) { return (numRecords !== null ? this.data.slice(0, numRecords) : this.data); }", "title": "" }, { "docid": "ed047c5a74938e4f0cb83f482423df45", "score": "0.56412935", "text": "toArray() {\n \treturn [this._id, this._timestamp, this._data, this._hash, this._previousHash];\n }", "title": "" }, { "docid": "3e16f145eb88bcf9583031096698452d", "score": "0.56300795", "text": "function endRow() {\n out.push(row); // append row to output\n row = [];\n }", "title": "" }, { "docid": "2f317d099f465aad8a9921875e2cad07", "score": "0.5621442", "text": "async queryRow(sql, param){\n\t\ttry{\n\t\t\tconst con = ((typeof this.Tx === 'undefined') || this.Tx === null)? this.pool: this.Tx;\n\t\t\tconst [rows] = await con.query(sql, param);\n\t\t\treturn [rows, false];\n\t\t}catch(err){\n\t\t\tutil.Log(\"SQLQueryRow\", err);\n\t\t\treturn [[], [{key: 'SQL', msg: err.sqlMessage}]];\n\t\t}\n\t}", "title": "" }, { "docid": "050ec39bf891ec27449decb6162d159e", "score": "0.5598144", "text": "get row() {\n return this.gridRow;\n }", "title": "" }, { "docid": "050ec39bf891ec27449decb6162d159e", "score": "0.5598144", "text": "get row() {\n return this.gridRow;\n }", "title": "" }, { "docid": "4e77e346d7754a0226b732beb88508e0", "score": "0.5596401", "text": "function CreateDataObject(tableRef, totalRows,totalCols) {\n var dataArray = [];\n for(var i =0 ; i < totalRows ; i++)\n {\n var dataObj = {};\n for( j = 0 ; j< totalCols ; j++)\n {\n dataObj[j] = tableRef.rows[i].cells[j].innerHTML;\n }\n dataArray.push(dataObj);\n }\n return dataArray;\n}", "title": "" }, { "docid": "769d67ff2d999bc4cccb6353ec7a4137", "score": "0.5590336", "text": "function candyRows(index) {\n\tvar candyRow = giveCandyArrays('rows', index);\n\treturn candyRow;\n}", "title": "" }, { "docid": "9a2bf69a978ed03455ac0015207b29f2", "score": "0.55895406", "text": "toArray() {}", "title": "" }, { "docid": "9a2bf69a978ed03455ac0015207b29f2", "score": "0.55895406", "text": "toArray() {}", "title": "" }, { "docid": "b25b90104d52679c2c4e8901ddbbcd2d", "score": "0.5588475", "text": "getCells() {\n // !!!! IMPLEMENT ME !!!!\n return this.buffer[this.currentBufferIndex];\n }", "title": "" }, { "docid": "84b58987f9310a3a71468a77f9f49308", "score": "0.55815786", "text": "row (y) {\n const [w, h] = [this.width, this.height]\n if (y >= h)\n util.error(`row: y out of range height: ${h} x: ${y}`)\n return this.data.slice(y * w, (y + 1) * w)\n }", "title": "" }, { "docid": "98122e986e0570d35fdc16e56c1598f0", "score": "0.558141", "text": "function defaultGetRowData(dataBlob, sectionID, rowID) {\n return dataBlob[sectionID][rowID];\n}", "title": "" }, { "docid": "9bc27bfbe78229e889282cb4d128c5fa", "score": "0.55806184", "text": "function setBankTabelArry() {\n var arrBankRows = new Array();\n var tableBK = $('#tblBankTrans').DataTable();\n $.each(gSelectedRows_BK, function(index, value) {\n var row = new OBJ_TableBK(tableBK.row(value).data()[\"BDCURD\"], tableBK.row(value).data()[\"BDBLAM\"], tableBK.row(value).data()[\"BDCKNO\"], tableBK\n .row(value).data()[\"PAGENO\"], tableBK.row(value).data()[\"BDALLN\"], tableBK\n .row(value).data()[\"BDRFFD\"], tableBK.row(value).data()[\"BDLMDT\"], tableBK\n .row(value).data()[\"BDVONO\"],tableBK.row(value).data()[\"BDSDRC\"],tableBK.row(value).data()[\"BDBKID\"],tableBK.row(value).data()[\"BDVSER\"]);\n\n arrBankRows.push(row);\n });\n\n return arrBankRows;\n}", "title": "" } ]
81dc5fcd7e21303aef855a5eb36a7b28
get user IP address and location
[ { "docid": "0ec0e51e9a1355a85fc9b6c17c9a5615", "score": "0.6883564", "text": "function getMyLocation() {\n\tgot(urlIp, {json: true })\n\t\t.then((res) => {\n\t\t\tconsole.log(`myPos lat: ${myPosition.latitude}, lon: ${myPosition.longitude}, ${myPosition.city}, ${myPosition.region}, ${myPosition.countryCode}`);\n\t\t\tmyPosition.latitude = res.body.lat;\n\t\t\tmyPosition.longitude = res.body.lon;\n\t\t\tmyPosition.city = res.body.city;\n\t\t\tmyPosition.region = res.body.region;\n\t\t\tmyPosition.countryCode = res.body.countryCode;\n\t\t\tconsole.log(`urlIp lat: ${res.body.lat}, lon: ${res.body.lon}, ${res.body.city}, ${res.body.region}, ${res.body.countryCode}`);\n\t\t\tconsole.log(`myPos lat: ${myPosition.latitude}, lon: ${myPosition.longitude}, ${myPosition.city}, ${myPosition.region}, ${myPosition.countryCode}`);\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconsole.log(error.response.body);\n\t\t});\n}", "title": "" } ]
[ { "docid": "2329f5e7d0ec76c69f488653a1069e71", "score": "0.73506653", "text": "function _getMyIP() {\n return ip.address();\n}", "title": "" }, { "docid": "fc98b82cc188429e7962286baa8bc49c", "score": "0.7170288", "text": "get ip() {}", "title": "" }, { "docid": "ddcdd473bfde25e7abfcb54904cdf4bf", "score": "0.6904156", "text": "function getIpAddressInfo(){\n\t\t$http.get('http://freegeoip.net/json/').then(function(data){\n\t\t\tconsole.log(data);\n\t\t\tipInfo = data.data;\n\t\t});\n\t}", "title": "" }, { "docid": "e4f417099ca195a8e90be17cc881adfe", "score": "0.6871938", "text": "static getUserRegion(userId){\n var user = User.findOne({_id: userId}, {fields: {'status.lastLogin.ipAddr': 1}});\n var geoip = GeoIP.lookup(user.status.lastLogin.ipAddr);\n return geoip;\n }", "title": "" }, { "docid": "69c74a6514d8d276da538bafb5184bac", "score": "0.68459123", "text": "function ipLocation(nsp, ip) {\n\n console.log(\"ip: \"+ip);\n\n if (ip) {\n\n var path = \"http://ipinfo.io/\"+ip+\"/json\";\n\n request.get({\n uri: path,\n rejectUnauthorized: false\n }, function (error, response, body) {\n\n if (helpers.isJson(body)) {\n\n nsp.emit('api', {requestedIpLocation: JSON.parse(body)});\n\n }\n });\n }\n}", "title": "" }, { "docid": "42208d66973b1f806a0a80e181449204", "score": "0.6820422", "text": "function getUserLocation(){\n\t\t\t\tif (navigator.geolocation){\n\t\t\t\t\tnavigator.geolocation.getCurrentPosition(userPosition);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "8ff09f980798cea3ec63cad83bcb9c3b", "score": "0.67963785", "text": "function getIpAddress(req, res, next) {\r\n // Middleware that grabs IP address of the client; should be able to be\r\n // done based on requests but have not done yet; set to Los Angeles\r\n const ipaddress = '74.87.214.86';\r\n // Throw an error if there is an issue with the ipaddress\r\n if (!ipaddress) { return res.send('Cannot get ipaddress') }\r\n // Save the ipaddress into res.locals\r\n res.locals.ipaddress = ipaddress;\r\n next();\r\n}", "title": "" }, { "docid": "680b17c54fcd628f51cef5a04a817791", "score": "0.67134494", "text": "function getUserLocation () {\n\t$.get('https://ipinfo.io', function(location) {\n\t\tlet loc = location.loc;\n\t\tgetWeather(loc);\n\n\t\tlet countryCodes = {\n\t\t\tAF: 'Afghanistan', AX: 'Aland Islands', AL: 'Albania', DZ: 'Algeria', AS: 'American Samoa', AD: 'Andorra', AO: 'Angola', AI: 'Anguilla', AQ: 'Antarctica', AG: 'Antigua And Barbuda', AR: 'Argentina', AM: 'Armenia', AW: 'Aruba', AU: 'Australia', AT: 'Austria', AZ: 'Azerbaijan', BS: 'Bahamas', BH: 'Bahrain', BD: 'Bangladesh', BB: 'Barbados', BY: 'Belarus', BE: 'Belgium', BZ: 'Belize', BJ: 'Benin', BM: 'Bermuda', BT: 'Bhutan', BO: 'Bolivia', BA: 'Bosnia And Herzegovina', BW: 'Botswana', BV: 'Bouvet Island', BR: 'Brazil', IO: 'British Indian Ocean Territory', BN: 'Brunei Darussalam', BG: 'Bulgaria', BF: 'Burkina Faso', BI: 'Burundi', KH: 'Cambodia', CM: 'Cameroon', CA: 'Canada', CV: 'Cape Verde', KY: 'Cayman Islands', CF: 'Central African Republic', TD: 'Chad', CL: 'Chile', CN: 'China', CX: 'Christmas Island', CC: 'Cocos (Keeling) Islands', CO: 'Colombia', KM: 'Comoros', CG: 'Congo', CD: 'Congo, Democratic Republic', CK: 'Cook Islands', CR: 'Costa Rica', CI: 'Cote D\\'Ivoire', HR: 'Croatia', CU: 'Cuba', CY: 'Cyprus', CZ: 'Czech Republic', DK: 'Denmark', DJ: 'Djibouti', DM: 'Dominica', DO: 'Dominican Republic', EC: 'Ecuador', EG: 'Egypt', SV: 'El Salvador', GQ: 'Equatorial Guinea', ER: 'Eritrea', EE: 'Estonia', ET: 'Ethiopia', FK: 'Falkland Islands (Malvinas)', FO: 'Faroe Islands', FJ: 'Fiji', FI: 'Finland', FR: 'France', GF: 'French Guiana', PF: 'French Polynesia', TF: 'French Southern Territories', GA: 'Gabon', GM: 'Gambia', GE: 'Georgia', DE: 'Germany', GH: 'Ghana', GI: 'Gibraltar', GR: 'Greece', GL: 'Greenland', GD: 'Grenada', GP: 'Guadeloupe', GU: 'Guam', GT: 'Guatemala', GG: 'Guernsey', GN: 'Guinea', GW: 'Guinea-Bissau', GY: 'Guyana', HT: 'Haiti', HM: 'Heard Island & Mcdonald Islands', VA: 'Holy See (Vatican City State)', HN: 'Honduras', HK: 'Hong Kong', HU: 'Hungary', IS: 'Iceland', IN: 'India', ID: 'Indonesia', IR: 'Iran, Islamic Republic Of', IQ: 'Iraq', IE: 'Ireland', IM: 'Isle Of Man', IL: 'Israel', IT: 'Italy', JM: 'Jamaica', JP: 'Japan', JE: 'Jersey', JO: 'Jordan', KZ: 'Kazakhstan', KE: 'Kenya', KI: 'Kiribati', KR: 'Korea', KW: 'Kuwait', KG: 'Kyrgyzstan', LA: 'Lao People\\'s Democratic Republic', LV: 'Latvia', LB: 'Lebanon', LS: 'Lesotho', LR: 'Liberia', LY: 'Libyan Arab Jamahiriya', LI: 'Liechtenstein', LT: 'Lithuania', LU: 'Luxembourg', MO: 'Macao', MK: 'Macedonia', MG: 'Madagascar', MW: 'Malawi', MY: 'Malaysia', MV: 'Maldives', ML: 'Mali', MT: 'Malta', MH: 'Marshall Islands', MQ: 'Martinique', MR: 'Mauritania', MU: 'Mauritius', YT: 'Mayotte', MX: 'Mexico', FM: 'Micronesia, Federated States Of', MD: 'Moldova', MC: 'Monaco', MN: 'Mongolia', ME: 'Montenegro', MS: 'Montserrat', MA: 'Morocco', MZ: 'Mozambique', MM: 'Myanmar', NA: 'Namibia', NR: 'Nauru', NP: 'Nepal', NL: 'Netherlands', AN: 'Netherlands Antilles', NC: 'New Caledonia', NZ: 'New Zealand', NI: 'Nicaragua', NE: 'Niger', NG: 'Nigeria', NU: 'Niue', NF: 'Norfolk Island', MP: 'Northern Mariana Islands', NO: 'Norway', OM: 'Oman', PK: 'Pakistan', PW: 'Palau', PS: 'Palestinian Territory, Occupied', PA: 'Panama', PG: 'Papua New Guinea', PY: 'Paraguay', PE: 'Peru', PH: 'Philippines', PN: 'Pitcairn', PL: 'Poland', PT: 'Portugal', PR: 'Puerto Rico', QA: 'Qatar', RE: 'Reunion', RO: 'Romania', RU: 'Russian Federation', RW: 'Rwanda', BL: 'Saint Barthelemy', SH: 'Saint Helena', KN: 'Saint Kitts And Nevis', LC: 'Saint Lucia', MF: 'Saint Martin', PM: 'Saint Pierre And Miquelon', VC: 'Saint Vincent And Grenadines', WS: 'Samoa', SM: 'San Marino', ST: 'Sao Tome And Principe', SA: 'Saudi Arabia', SN: 'Senegal', RS: 'Serbia', SC: 'Seychelles', SL: 'Sierra Leone', SG: 'Singapore', SK: 'Slovakia', SI: 'Slovenia', SB: 'Solomon Islands', SO: 'Somalia', ZA: 'South Africa', GS: 'South Georgia And Sandwich Isl.', ES: 'Spain', LK: 'Sri Lanka', SD: 'Sudan', SR: 'Suriname', SJ: 'Svalbard And Jan Mayen', SZ: 'Swaziland', SE: 'Sweden', CH: 'Switzerland', SY: 'Syrian Arab Republic', TW: 'Taiwan', TJ: 'Tajikistan', TZ: 'Tanzania', TH: 'Thailand', TL: 'Timor-Leste', TG: 'Togo', TK: 'Tokelau', TO: 'Tonga', TT: 'Trinidad And Tobago', TN: 'Tunisia', TR: 'Turkey', TM: 'Turkmenistan', TC: 'Turks And Caicos Islands', TV: 'Tuvalu', UG: 'Uganda', UA: 'Ukraine', AE: 'United Arab Emirates', GB: 'United Kingdom', US: 'United States', UM: 'United States Outlying Islands', UY: 'Uruguay', UZ: 'Uzbekistan', VU: 'Vanuatu', VE: 'Venezuela', VN: 'Viet Nam', VG: 'Virgin Islands, British', VI: 'Virgin Islands, U.S.', WF: 'Wallis And Futuna', EH: 'Western Sahara', YE: 'Yemen', ZM: 'Zambia', ZW: 'Zimbabwe'\n\t\t}\n\t\tlet country = countryCodes[location.country]\n\t\t$('.location__city').html(location.city);\n\t\t$('.location__country').html(country);\n\t}, 'jsonp');\n}", "title": "" }, { "docid": "1957ada72621e2150984620d3ab43c17", "score": "0.6621559", "text": "function getCurrentIP_mi (fetcher) { return fetcher ('https://api.myip.com').then(res => res.json().then ( js => js.ip ) ) }", "title": "" }, { "docid": "fdd70bad312259211e0288a68cdaa3c4", "score": "0.6606337", "text": "function getIPAddress() {\n return DeviceInfo.getIPAddress();\n}", "title": "" }, { "docid": "c6723c66c7c59ab8f0928bc4ee7c7de5", "score": "0.65816456", "text": "function getUserLoc(){\r\n\t\t\t\t\t// try to get user location via W3C standard Geolocation in browsers or via Google Gears\r\n\t\t\t\t\tif(navigator.geolocation){\r\n\t\t\t\t\t navigator.geolocation.getCurrentPosition(markUserLoc, handle_error);\r\n\t\t\t\t\t \r\n\t\t\t\t\t} else if (google.gears) \r\n\t\t\t\t\t// if location not found using W3C standard try with Google Gears if browser supports it\r\n\t\t\t\t\t{\r\n\t\t\t\t\t var geo = google.gears.factory.create('beta.geolocation');\r\n\t\t\t\t\t geo.getCurrentPosition(markUserLoc, handle_error);\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t// Browser doesn't support Geolocation\r\n\t\t\t\t\t\t$('#feedback').text(\"Appearently Your Browser Doesn't Support This function.\");\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}", "title": "" }, { "docid": "50a0cc01c4091561c7294b9694b093a4", "score": "0.652548", "text": "function getGeolocationOfTheUser() {\n\n console.log(\"Inside getGeolocationOfTheUser() in RecMusicByWeather.js\");\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n flagLocationNotFound = true;\n }\n} //End of getGeolocationOfTheUser()", "title": "" }, { "docid": "5d272fd319a74b752d020f05536112c3", "score": "0.65061265", "text": "function currentIP () {\n var options = {\n host: 'ip-api.com',\n port: 80,\n path: '/json'\n };\n\n // Make HTTP query to fetch IP data\n console.log('Making HTTP API call to check IP');\n\n http.get(options, function(response){\n var body = '';\n\n response.on('data', function(chunk){\n \t// Append chunk response\n body += chunk;\n });\n\n response.on('end', function() {\n \t// Parse returned JSON\n var parsed = JSON.parse(body);\n\n // Update latest IP\n console.log('IP API claims the public IP is ' + parsed.query);\n writeIP(parsed.query);\n });\n });\n}", "title": "" }, { "docid": "bdc02b2b3b0be7b055b9876e34745808", "score": "0.6505499", "text": "function grabLocation(req, res, next) {\r\n geoip.lookup('74.87.214.86', (err, data) => {\r\n if (err) throw err;\r\n else {\r\n res.locals.state = data.location.region;\r\n res.locals.city = data.location.city;\r\n res.locals.latitude = data.location.lat;\r\n res.locals.longitude = data.location.lng;\r\n return next();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "59b0eaa3b4ace06b3cada67a060986c8", "score": "0.6482748", "text": "function getUserLoc(){\n // if the HTML 5 geolocator exists/is allowed to run\n if (navigator.geolocation) {\n let pos = {};\n navigator.geolocation.getCurrentPosition(function(position){\n pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n let route = {\n origin: pos,\n destination: office,\n travelMode: \"DRIVING\"\n };\n directionService.route(route, setRoute);\n });\n }\n // if the HTML 5 geolocator does not exist/is not allowed to run\n else {\n Window.alert(\"Could not get user location.\");\n }\n}", "title": "" }, { "docid": "f4d25479d571b85eaef777237bfdb67b", "score": "0.64611554", "text": "function getClientIPGEO(ipServer, geoServer) {\n\t$.get(ipServer, function getIP(ipstring) {\n\t\tclientIP = ipstring; //sets global variable to this callback IP\n\t\t$.get(geoServer + clientIP.substring(7, clientIP.length), function getGeo(jsonGeolocation) {\n\t\t\tGeoObject = jsonGeolocation; //populate geo object\n\t\t\tUserObject.geolocationinfo = jsonGeolocation; //populate field in user object\n\t\t});\n\t});\n}", "title": "" }, { "docid": "da94880a93063b2016583e36e6f793e9", "score": "0.64318675", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(pos) {\n //You have your locaton here\n console.log(\"Latitude: \" + pos.coords.latitude +\n \"Longitude: \" + pos.coords.longitude);\n });\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "44e6017400d76b68797ab858e37c53b9", "score": "0.6424219", "text": "get ipAddress() {\n return this.getStringAttribute('ip_address');\n }", "title": "" }, { "docid": "c3850f15e2fb88df562742e940ee9545", "score": "0.6412011", "text": "function GetIP(){\r\n\t\t$.getJSON(\"https://api.ipify.org?format=json\",function(data){\r\n\t\t\tip = data.ip; \r\n\t\t\tvar fecha = new Date();\r\n\t\t\tdia = fecha.getDate();\r\n\t\t\tmes = fecha.getMonth() + 1;\r\n\t\t\tano = fecha.getFullYear();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "19591dee2f5a077d22279eae57770632", "score": "0.64089495", "text": "function getLatLon(callback){\n\n request.get(\"https://freegeoip.net/json/\"+ip, function(error, response, body){\n\n var locationData = JSON.parse(body);\n lat = locationData.latitude;\n lon = locationData.longitude;\n cityname = locationData.city + \", \" + locationData.region_name;\n callback(null, locationData);\n });\n }", "title": "" }, { "docid": "000f5622c8c6b90eef1f4b3b31a50c11", "score": "0.63941294", "text": "function getIp(req) {\n\t\tvar ip = req.ip || '';\n\t\treturn ip.slice(ip.lastIndexOf(':') + 1);\n\t}", "title": "" }, { "docid": "82adaeff12bb67b0ab261f05e1ac3235", "score": "0.63754433", "text": "function getIP(json) {\n IP_ADDRESS = json.ip;\n}", "title": "" }, { "docid": "b7fc1137c91f8282ba8778a7ad63f9a4", "score": "0.6368198", "text": "getIpAddress() {\n let ifs = require('os').networkInterfaces()\n var addresses = [];\n for (var k in ifs) {\n for (var k2 in ifs[k]) {\n var address = ifs[k][k2];\n if (address.family === 'IPv4' && !address.internal) {\n addresses.push(address.address)\n }\n }\n }\n\n if (!_ipReadyCallback) \n throw \"You must bind to onIpReady() before making a call to this function, the ip addre\" +\n \"ss will be passed to your supplied callback\"\n _.defer(() => addresses.length\n ? _ipReadyCallback(addresses[0])\n : _ipReadyCallback('127.0.0.1'))\n }", "title": "" }, { "docid": "c6bbd41cf30f3054c8e3aabae2353738", "score": "0.63399404", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(getUserPosition, handleLocationAccessError);\n\t} else {\n\t\tresponse = \"Geolocation is not supported by this browser.\";\n\t}\n}", "title": "" }, { "docid": "6e36c5087fe02ed85b0243352e9c2eab", "score": "0.63264817", "text": "function getClientIPAddresses(){\r\n\ttry{\r\n\t\tvar activeX = getDesktopHelperActiveX();\r\n\t\tvar addrStr = activeX.GetClientIPAddresses();\r\n\t\treturn addrStr.split(\";\");\r\n\t}catch(e){\r\n\t\treturn null;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "89c63632757a48b4c29721c834a8ab6e", "score": "0.6290871", "text": "function getClientIp(req) {\n\treturn req.headers['x-forwarded-for'] ||\n\t\treq.connection.remoteAddress ||\n\t\treq.socket.remoteAddress ||\n\t\treq.connection.socket.remoteAddress;\n}", "title": "" }, { "docid": "e8679ecf5b1f1d3a51b67ea3e95243b7", "score": "0.6279436", "text": "function getLocation(){\n if(navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showData);\n }\n}", "title": "" }, { "docid": "6e2f9777efdc47718ea94505ba026650", "score": "0.6276219", "text": "function getLocationBasedOnIpAddress() {\n $.ajax({\n type: \"GET\",\n contentType: \"application/json; charset=utf-8\",\n url: \"http://www.telize.com/geoip/\",\n dataType: \"jsonp\",\n jsonpCallback: \"locationBasedOnIpAddressResultsHandler\"\n });\n}", "title": "" }, { "docid": "189ae6dc1c4830b832a04303bc526809", "score": "0.62712395", "text": "function getIp(result) {\n let arrayIp = [];\n for (let index = 0; index < result.length; index++) {\n let before = result[index].network.remoteAddress;\n\n var s = before;\n var n = s.indexOf(\":\");\n s = s.substring(0, n != -1 ? n : s.length);\n arrayIp.push(s);\n }\n\n getGeoData(arrayIp);\n}", "title": "" }, { "docid": "72e11f88ca74abcd1b30575f41d491a0", "score": "0.62605", "text": "function getClientIp(req) {\n var ipAddress;\n var ipString = req.header('x-forwarded-for'); \n if (ipString) {\n var forwardedIps = ipString.split(',');\n ipAddress = forwardedIps[0];\n }\n if (!ipAddress) {\n ipAddress = req.connection.remoteAddress;\n }\n return ipAddress;\n}", "title": "" }, { "docid": "5c74c669026510db6ee2c3a81ff244a6", "score": "0.6259753", "text": "function getLocation(){\n if (navigator.geolocation){\n navigator.geolocation.getCurrentPosition(showPosition);\n }else{\n //Nothing to do the browser doesn't support geolocation\n return null;\n }\n}", "title": "" }, { "docid": "943a059e78135f47a33ecd372db255c2", "score": "0.625431", "text": "function getLocation() {\n console.log('getting location')\n console.log(navigator.geolocation);\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log( \"Geolocation not supported by browser.\");\n }\n }", "title": "" }, { "docid": "f46a7918d64114011d4345c2b969edb3", "score": "0.6253889", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(getUserPosition, handleLocationAccessError);\n } else {\n response = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "c85d7c6af69bb832e4e2ea24163611e0", "score": "0.6248874", "text": "function getUserLocation()\n{\n\t// Get user's location.\n\tif(navigator.geolocation)\n\t{\n\t\t// Geolocation available.\n\t\t// Get current position.\n\t\tnavigator.geolocation.getCurrentPosition(function(posObj){\n\t\t\t// Update \"myInfo\" object.\n\t\t\tmyInfo.lat = posObj.coords.latitude;\n\t\t\tmyInfo.lng = posObj.coords.longitude;\n\t\t\t// Add class markers to\n\t\t\t// the map.\n\t\t\taddClassToMap();\n\t\t\t// Create Google Maps LatLng object for\n\t\t\t// user's current position.\n\t\t\tvar currentLatLng = new google.maps.LatLng(myInfo.lat,myInfo.lng);\n\t\t\t// Call function to place a marker\n\t\t\t// at the user's current position.\n\t\t\taddUserMarker(currentLatLng);\n\t\t});\n\t}\n\telse\n\t{\n\t\t// Geolocation not available.\n\t}\n}", "title": "" }, { "docid": "c7c00471ddd56dd389d9089b04ea85bf", "score": "0.6248786", "text": "function getMyLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\tmyLat = position.coords.latitude;\n\t\t\tmyLng = position.coords.longitude;\n\t\t\talert(\"Logged In: \" + myLat + \", \" + myLng);\n\t\t\trenderMap();\n\t\t});\n\t}\n\telse {\n\t\talert(\"Geolocation is not supported by your web browser. What a shame!\");\n\t}\n}", "title": "" }, { "docid": "f1af3463625eb54f845ac428db65d16d", "score": "0.622283", "text": "function getLocation() {\n //If browser supports geolocation ask user for permission to access their location data\n //If successful call latLongApiRequest with location dataType\n //Unsuccessful call errorAlert with the returned error\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(latLongApiRequest, errorAlert);\n }\n}", "title": "" }, { "docid": "69fd50b372e29faa1f1f88856d0a7bd0", "score": "0.6220402", "text": "function getGeolocation() {\n if ( navigator.geolocation ) {\n navigator.geolocation.getCurrentPosition( function( position ) {\n facility[ GEO_LOC ].latitude = position.coords.latitude\n facility[ GEO_LOC ].longitude = position.coords.longitude\n })\n }\n }", "title": "" }, { "docid": "3794aa195f04002e69e0ccb043a5e592", "score": "0.6211775", "text": "retrieveUserCordinate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(this.doReverseGeocodeAndSetCordinate);\n } else {\n alert('O suporte a geolocalização não está disponível.')\n }\n }", "title": "" }, { "docid": "213d985e935aa700a8096e6ab2a46678", "score": "0.6209746", "text": "function getUserCurrentLocation() {\n\t\n\tif(navigator.geolocation) {\n\t\t\n\t\t//Get user's current latitude and longitude position\n\t\tnavigator.geolocation.getCurrentPosition(function(position) {\n\t\t\t\n\t\t\t//Browser Geo Location is enabled\n\t\t\tnavgeolocationInUse(true);\n\t\t\t\n\t\t\t//Get user's current latitude position\n\t\t\tcurrentuserLatitude = position.coords.latitude;\n\t\t\t\n\t\t\t//Get user's current longitude\n\t\t\tcurrentuserLongitude = position.coords.longitude;\n\t\t\n\t\t}, function(error) {\n\t\t\t\n\t\t\t//Browser Geo Location is disabled\n\t\t\tnavgeolocationInUse(false);\n\t\t\t\n\t\t});\n\t\t\n\t}\n\t\n\telse {\n\t\t\n\t\t//Browser Geo Location is disabled\n\t\tnavgeolocationInUse(false);\n\t\t\n\t}\n\n}", "title": "" }, { "docid": "16dc5bb4d68169a4efa14a086edb2eca", "score": "0.6202298", "text": "function get_location() {\n if (Modernizr.geolocation) {\n navigator.geolocation.getCurrentPosition(show_map, handle_error, {maximumAge: 75000, enableHighAccuracy: true});\n console.log('We have location support!');\n } else {\n console.error('No HTML5 Geolocation support! Unable to divine current location!');\n }\n }", "title": "" }, { "docid": "f71ce5b232a61c4818b075ea3014775a", "score": "0.6189028", "text": "function getUserLocation() {\n navigator.geolocation.getCurrentPosition((position) => {\n let concatOrigCoords = position.coords.latitude + \",\" + position.coords.longitude;\n setUserOrigin(concatOrigCoords || userOrigin);\n }, (error) => {\n console.log(error);\n }, watchOptions);\n }", "title": "" }, { "docid": "187d3e5b02c4fdb8dfa76621ff941f05", "score": "0.61628366", "text": "getLocalIp() {\n return Object.values(networkInterfaces())\n .flat()\n .find((device) => !device.internal && device.family === 'IPv4')\n .address;\n }", "title": "" }, { "docid": "83f73303c57ba9de9ac658eacb6319f6", "score": "0.6157576", "text": "function getCoords(){\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n console.log(latitude,longitude);\n\n }, function() {\n handleNoGeolocation(true);\n });\n } else {\n // if Browser doesn't support Geolocation\n handleNoGeolocation(false);\n }\n function handleNoGeolocation(errorFlag) {\n if (errorFlag) {\n var content = 'Please turn on Location Services.';\n } else {\n var content = 'Error: Your browser doesn\\'t support geolocation.';\n }\n }\n}", "title": "" }, { "docid": "640c1b1c58bc7e0bfe88d79a68924449", "score": "0.6154354", "text": "function getLocation() {\n $.get(\"http://ipinfo.io/json\", function(location) {\n getWeather(location.loc);\n }, 'jsonp');\n }", "title": "" }, { "docid": "7ffd1fc146b6efbe506a879a904540ac", "score": "0.614919", "text": "getIPAddress() {\n let myIP = \"0.0.0.0\"\n const interfaces = require(\"os\").networkInterfaces()\n for (let devName in interfaces) {\n const iface = interfaces[devName]\n\n iface.forEach( item => {\n if (item.family === \"IPv4\" && item.address !== \"127.0.0.1\" && !item.internal) myIP = item.address\n })\n }\n return myIP\n }", "title": "" }, { "docid": "a8025efcbedfbc8c52b1073dadc61e4e", "score": "0.61484706", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n}", "title": "" }, { "docid": "955977d4bc9e1fcda744f82f5affc648", "score": "0.6146851", "text": "function getLocationData() {\r\n // Perform GET request to ifify.org to get Client's IP address.\r\n var ipify_request = new XMLHttpRequest();\r\n ipify_request.open(\"GET\", \"https://api.ipify.org\", true);\r\n\r\n ipify_request.onload = function() {\r\n if (this.status >= 200 && this.status < 400) {\r\n ip = this.response;\r\n\r\n // Perform GET request to ip-api.com to get Client's Geo-Location\r\n // based on IP address.\r\n var ip_api_request = new XMLHttpRequest();\r\n ip_api_request.open(\"GET\", \"http://ip-api.com/json/\" + ip, true);\r\n\r\n ip_api_request.onload = function() {\r\n if (this.status >= 200 && this.status < 400) {\r\n var data = JSON.parse(this.response);\r\n var region = data.regionName;\r\n var countryCode = data.countryCode;\r\n var location = region + \", \" + countryCode;\r\n\r\n setLocationDisplay(location);\r\n } else {\r\n setLocationDisplay(\"N/A\");\r\n }\r\n };\r\n\r\n ip_api_request.onerror = function() {\r\n setLocationDisplay(\"N/A\");\r\n };\r\n\r\n ip_api_request.send();\r\n } else {\r\n setLocationDisplay(\"N/A\");\r\n }\r\n };\r\n\r\n ipify_request.onerror = function() {\r\n setLocationDisplay(\"N/A\");\r\n };\r\n\r\n ipify_request.send();\r\n}", "title": "" }, { "docid": "2c3745a7e6d4b2ade0b8b76b96552480", "score": "0.6141761", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n }\n }", "title": "" }, { "docid": "cca3eaa775419da39d0efe3ed597244e", "score": "0.6140966", "text": "getRemoteIpAddress() {\n try {\n return this.request.connection.remoteAddress\n } catch {\n return null\n }\n }", "title": "" }, { "docid": "345e0f56df87746ae49d1c455f8a07a1", "score": "0.6133532", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t// alert(location[0]);\n\t} else {\n\t\talert(\"Geolocation is not supported by this browser.\");\n\t}\n}", "title": "" }, { "docid": "0e887afbe236b96ebd331b2501acb02f", "score": "0.61235094", "text": "async function fetchApproxIPLocationIPGEOLOCATION() {\n const url = `https://api.ipgeolocation.io/ipgeo?apiKey=${firebaseConfig.ipgeolocation_key}`;\n return superagent\n .get(url)\n .then(res => {\n if (!res.body.longitude)\n throw new Error('Bad result');\n console.log(res.body);\n return {\n longitude: res.body.longitude,\n latitude: res.body.latitude,\n };\n });\n}", "title": "" }, { "docid": "16612b652293cfbee04f06560f1de5a1", "score": "0.61233634", "text": "function getLocation(){\n\t\tif(navigator.geolocation){\n\t\t\t// console.log(\"geolocation is supported\");\n\t\t\tnavigator.geolocation.getCurrentPosition(getHeader);\n\t\t\tnavigator.geolocation.getCurrentPosition(getInfo);\n\t\t}else{\n\t\t\t$(\"#message\").innerHTML = \"Geolocation is not supported by this browser.\";\n\t\t}\n\t}", "title": "" }, { "docid": "fd878f28eafbd7ad847c8bd0f7ce240f", "score": "0.61174583", "text": "function getIPAddress() {\n\tconst os = require('os');\n\tvar interfaces = os.networkInterfaces();\n\tvar returnIPs = {};\n\n\tdebugLog(IPADDR_DEBUG, \"Diving into interfaces:\" + Object.keys(interfaces).length);\n\tObject.keys(interfaces).forEach(interfaceName => {\n\t\tvar alias = 0;\n\t\tdebugLog(IPADDR_DEBUG, \"Investigating interface:\"+interfaceName);\n\t\tinterfaces[interfaceName].forEach(interfaceEntry => {\n\t\t\tif ('IPv4' != interfaceEntry.family || interfaceEntry.internal !== false) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdebugLog(IPADDR_DEBUG, \"-Data[\"+interfaceEntry.family+\"]:\"+interfaceEntry.address);\n\t\t\treturnIPs[interfaceName+alias] = interfaceEntry.address;\n\t\t\t++alias;\n\t\t});\n\t});\n\tif (Object.keys(returnIPs).length > 1) {\n\t\tfor (let key of returnIPs.keys()) {\n\t\t\tif (key == 'eth0') {\n\t\t\t\treturn returnIPs[key];\n\t\t\t}\n\t\t}\n\t} else {\n\t\treturn returnIPs[Object.keys(returnIPs)[0]];\n\t}\n}", "title": "" }, { "docid": "5e06df003eee278ced556505e4945963", "score": "0.6112223", "text": "function getLocation(){\n\tnavigator.geolocation.getCurrentPosition(locationSuccess, locationError, {enableHighAccuracy: false, timeout: 5000, maximumAge: 900000})\n\t;}", "title": "" }, { "docid": "1ac9470392ae6194f3432fb2d4592d04", "score": "0.61063325", "text": "function getUserInfo() {}", "title": "" }, { "docid": "50d1f9c959d1491f62f7ee7e24f3759d", "score": "0.6092693", "text": "function getMyIP() {\n window.RTCPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;//compatibility for Firefox and chrome\n var pc = new RTCPeerConnection({iceServers:[]}), noop = function(){};\n pc.createDataChannel('');//create a bogus data channel\n pc.createOffer(pc.setLocalDescription.bind(pc), noop);// create offer and set local description\n pc.onicecandidate = function(ice)\n {\n if (ice && ice.candidate && ice.candidate.candidate)\n {\n var thisDeviceIP = /([0-9]{1,3}(\\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/.exec(ice.candidate.candidate)[1];\n\n // console.log('This Court Device IP: ', thisDeviceIP);\n\n\n\n //DAVID TEST: for testing only\n thisDeviceIP = randomCode(8);\n //END TEST\n\n\n\n\n\n showCourt(thisDeviceIP);\n\n pc.onicecandidate = noop;\n\n m_thisDeviceIP = thisDeviceIP;\n return thisDeviceIP;\n }\n };\n}", "title": "" }, { "docid": "c012c2c1364096ccbf3fbf088654cf82", "score": "0.6086622", "text": "function getLocation() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t} else {\n\t\tconsole.log(\"Error: Geolocation is not supported by this browser.\");\n\t}\n\n}", "title": "" }, { "docid": "578cc0f0d4b44d73fd4b67a3ed737ada", "score": "0.6081228", "text": "function getClientIP(socket) {\n let ipAddress;\n // Amazon EC2 / Heroku workaround to get real client IP\n let forwardedIpsStr = socket.request.headers['x-forwarded-for']; \n if (forwardedIpsStr && forwardedIpsStr != undefined) {\n // 'x-forwarded-for' header may return multiple IP addresses in\n // the format: \"client IP, proxy 1 IP, proxy 2 IP\" so take the\n // the first one\n let forwardedIps = forwardedIpsStr.split(',');\n ipAddress = forwardedIps[0];\n console.log('x-forwarded-for');\n }\n if (!ipAddress) {\n // Ensure getting client IP address still works in\n // development environment\n ipAddress = socket.request.connection.remoteAddress;\n console.log('remoteAddress');\n }\n return ipAddress;\n}", "title": "" }, { "docid": "67d5d40f4e146b9eec7f5e0f65fc6b3c", "score": "0.60791516", "text": "function getLocation() {\n console.log(navigator.geolocation);\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "24b69c8156d5f5f6fa0ed53a0e82ed7c", "score": "0.6073084", "text": "function getLocation()\n{\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "5749a5f241216e48afcb0f9c73b6f57b", "score": "0.60562515", "text": "function currentLocation() {\n $.get(\"https://ipapi.co/json/\", function (response) { findLatLon(response.city) });\n}", "title": "" }, { "docid": "d79bb3d511b234746400c5f7931b9509", "score": "0.6055529", "text": "function getCurrentUsersLocation()\n{\n if (navigator.geolocation)\n {\n navigator.geolocation.getCurrentPosition(setMarkerOfUsersPosition);\n }\n else{alert(\"Geolocation is not supported by this browser.\");}\n}", "title": "" }, { "docid": "574511a405bf7f1cd6562c92f6531ccd", "score": "0.6053933", "text": "function getUserLocation(list){\n return new Promise((resolve, reject) => {\n if (window.navigator) {\n window.navigator.geolocation.getCurrentPosition(\n (pos) => {\n console.log(pos);\n resolve({\n list,\n coords: pos.coords\n })\n }, (error) => {\n // try to get location based on IP\n getLocationFromIP()\n .then(res => {\n resolve({\n list,\n coords: {\n latitude: res.location.lat,\n longitude: res.location.lng,\n }\n })\n })\n })\n } else {\n reject({error: \"No Location available\"})\n }\n })\n}", "title": "" }, { "docid": "f8c746b795809a417ef99b3db7f2fa46", "score": "0.6046216", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(saveLocation, locationError);\n } else {\n console.log(\"Geolocation Error : Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "c90aca6567a895fb41d935d33a29fe37", "score": "0.6043267", "text": "function OneNearst() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(UserLocation);\n } else\n console.log(\"error\");\n}", "title": "" }, { "docid": "bc6ba3f75307de68e88f866c6be2fd83", "score": "0.60373276", "text": "function fetchUserLocation() {\n return $http({\n method: 'GET',\n url: 'https://www.travelpayouts.com/whereami',\n params: {locale: translateFactory.locale}\n });\n }", "title": "" }, { "docid": "363346940944304c474c6ab4d53fddf0", "score": "0.6033154", "text": "function findMyLocation(){\n navigator.geolocation.getCurrentPosition(onSuccessGetLocation, onErrorGetLocation);\n }", "title": "" }, { "docid": "19b1d9b2eb477417b1bce4a6442ece5f", "score": "0.6027642", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n console.log(\"cant get coordinates\")\n }\n}", "title": "" }, { "docid": "ae3564f1670e77293cdc071cb20e6f42", "score": "0.6025552", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n infowindow.setPosition(pos);\n infowindow.setContent('You are here');\n infowindow.open(map);\n map.setCenter(pos);\n //userLocation = pos;\n }, function() {\n handleLocationError(true, infowindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infowindow, map.getCenter());\n }\n}", "title": "" }, { "docid": "1328337466d2fba8c9d3dff3c6aebb41", "score": "0.6025493", "text": "function getGeo(){\n\t\tif (navigator.geolocation) {\n\t\t\tnavigator.geolocation.getCurrentPosition(function(position){\n\t\t\t\tvar lat = position.coords.latitude; \n\t\t\t\tvar lon = position.coords.longitude;\n\t\t\t\tgetLocation(lat, lon);\n\t\t\t});\n\t\t\t\n\t\t} else { \n\t\t\tdocument.getElementById(\"inputfield\").value = \"Geolocation is not supported by this browser.\";\n\t\t}\n\t}", "title": "" }, { "docid": "4e9deeaea96964330faa4c97bce979f7", "score": "0.60250217", "text": "function getLocation() {\n\tvar location;\n\t$.ajax({\n\t\tformat: \"jsonp\",\n\t\tdataType: \"jsonp\",\n\t\turl: \"http://ip-api.com/json\",\n\t\tsuccess: function (data) {\n\t\t\tlocation = (data.lat + \",\" + data.lon);\n\t\t\tcity = data.city;\n\t\t\tgetForecast(location);\n\t\t},\n\t\tmethod: \"GET\"\n\t});\n}", "title": "" }, { "docid": "cf384b1f9ba83c2fd31102beb85cd647", "score": "0.6020542", "text": "function randomUserIp() {\n let ip = (Math.floor(Math.random() * 255) + 1) + \".\" + (Math.floor(Math.random() * 255)) + \".\" + (Math.floor(Math.random() * 255)) + \".\" + (Math.floor(Math.random() * 255));\n return ip;\n}", "title": "" }, { "docid": "b869e8aad82bdeae2a3ca3b051e2607e", "score": "0.60177445", "text": "function getIP(url){\n var ip;\n $.ajax({\n async: false,\n dataType: \"json\",\n url: url.concat(\"/api/2/ip\"),\n data: \"format=json\",\n success: function(data){\n\n ip = data.address;\n \n }\n });\n return ip;\n}", "title": "" }, { "docid": "ee21424cb7369720934c42edf7320e9c", "score": "0.6005006", "text": "function ip() {\n\tvar interfaces = require('os').networkInterfaces();\n\treturn Object.keys(interfaces).map(function (key) {\n\t\treturn interfaces[key];\n\t}).reduce(function (last, item) {\n\t\treturn item.reduce(function (last, item) {\n\t\t\tif (item.family === 'IPv4' && item.address !== '127.0.0.1' && !item.internal) {\n\t\t\t\treturn item.address;\n\t\t\t}\n\t\t\treturn last;\n\t\t}) || last;\n\t}) || '0.0.0.0';\n}", "title": "" }, { "docid": "af6252ef60183eff0197cd127a2a94d3", "score": "0.60043836", "text": "function getLocation() {\n\t\t\t\tconsole.log(\"attempt\");\n\t\t\t\tnavigator.geolocation.getCurrentPosition(success, error);\n\t\t}", "title": "" }, { "docid": "e72e6fa8f0a94fb67b52224553c0439e", "score": "0.6001517", "text": "function getLatLon() {\n\t\tif(!navigator.geolocation){\n\t\t\t$(\".error-row\").text(\"Not in San Francisco? Please allow location data to see weather in your area.\");\n\t\t\tgetURL(37.7833,-122.4167);\n\t\t}\n\t\telse{\n\t\t\t$(\".error-row\").addClass(\"hidden\");\n\t\t\tnavigator.geolocation.getCurrentPosition(function(pos){\n\t\t\t\tvar lat = pos.coords.latitude;\n\t\t\t\tvar lon = pos.coords.longitude;\n\t\t\t\tgetURL(lat,lon);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "903c42e34ad2dd9bbf0446a7b47049be", "score": "0.59998834", "text": "function getLocation(){\r\n if(navigator.geolocation){\r\n navigator.geolocation.getCurrentPosition(got_location)\r\n }else{\r\n notiElement.innerHTML = 'Geolocation not supported by your device'\r\n }\r\n}", "title": "" }, { "docid": "2d9b7842cbb2a5469d5db54572f607d7", "score": "0.5999155", "text": "function getIPAddress() {\n var interfaces = require('os').networkInterfaces();\n var ipaddr = '';\n for (var devName in interfaces) {\n var iface = interfaces[devName];\n for (var i = 0; i < iface.length; i++) {\n var alias = iface[i];\n if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal)\n ipaddr = ipaddr + alias.address + ' (' + devName + '); ';\n }\n }\n return ipaddr;\n}", "title": "" }, { "docid": "63e781a8184caf7102da94c64e96c34c", "score": "0.5999013", "text": "function ipaddr_v4(req) {\n var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;\n console.log(\"x-forwarded-for: \"+req.headers['x-forwarded-for']);\n console.log(\"connection.remoteAddress: \"+req.connection.remoteAddress);\n // localhost shows value \"::1\"\n if (ip == \"::1\") { ip = \"127.0.0.1\"; }\n if (ip.substr(0, 7) == \"::ffff:\") { ip = ip.substr(7); }\n console.log(\"ip (before trans): \"+ip);\n // We now have the actual client address. See if mapping / translation is needed\n var newip = iptrans[ip];\n if (newip) {\n // Inform at every use of translation\n // console.log();\n console.log(\"Overriding ip: \" + ip + \" => \" + newip); ip = newip;\n return newip;\n }\n return ip;\n}", "title": "" }, { "docid": "9741ef73a516f5182bc62ac73d74816d", "score": "0.59911036", "text": "function getUserIP(onNewIP) {\n var myPeerConnection = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;\n var pc = new myPeerConnection({\n iceServers: []\n }),\n noop = function () { },\n localIPs = {},\n ipRegex = /([0-9]{1,3}(\\.[0-9]{1,3}){3}|[a-f0-9]{1,4}(:[a-f0-9]{1,4}){7})/g,\n key;\n\n function iterateIP(ip) {\n if (!localIPs[ip]) onNewIP(ip);\n localIPs[ip] = true;\n }\n\n //create a bogus data channel\n pc.createDataChannel(\"\");\n\n // create offer and set local description\n pc.createOffer(function (sdp) {\n sdp.sdp.split('\\n').forEach(function (line) {\n if (line.indexOf('candidate') < 0) return;\n line.match(ipRegex).forEach(iterateIP);\n });\n\n pc.setLocalDescription(sdp, noop, noop);\n }, noop);\n\n //listen for candidate events\n pc.onicecandidate = function (ice) {\n if (!ice || !ice.candidate || !ice.candidate.candidate || !ice.candidate.candidate.match(ipRegex)) return;\n ice.candidate.candidate.match(ipRegex).forEach(iterateIP);\n };\n}", "title": "" }, { "docid": "1de9e0f8cf6ebe4e2d0e1e1980071999", "score": "0.59852415", "text": "function getGeolocation(){\n if(Modernizr.geolocation)\n {\n console.log('geolocation works');\n navigator.geolocation.getCurrentPosition(geoLocationSuccess, geoLocationError);\n }\n\n else\n {\n var geocoder = new google.maps.Geocoder()\n if(google.loader.ClientLocation != null)\n {\n locationCurrent = new google.maps.LatLng(google.loader.ClientLocation.latitude,google.loader.ClientLocation.longitude);\n displayMap();\t\n }\n else{\n locationCurrent = new google.maps.LatLng(geoip_latitude(),geoip_longitude());\n displayMap();\n }\n }\n}", "title": "" }, { "docid": "80ef974dd7c4fb5567fe6972a5043aae", "score": "0.5972533", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n navigator.geolocation.getCurrentPosition(getJobs);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "title": "" }, { "docid": "b9f1046337db675e636c7413dffe98ea", "score": "0.59712", "text": "function getLocData() {\n\tif (navigator.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(displayData);\n\t}\n}", "title": "" }, { "docid": "df9c77a9a636e26094b48c45c6439deb", "score": "0.5967372", "text": "function getMyLocation() {\n \tif (navigator.geolocation) {\n \tnavigator.geolocation.getCurrentPosition(function(position) {\n \t\tmy_lat = position.coords.latitude;\n\t \tmy_long = position.coords.longitude;\n\t \trenderMeOnMap();\n \t});\n \t}\n \t//you're using IE\n \telse {\n \t\talert(\"Geolocation is not supported by your web browser!\");\n \t}\n}", "title": "" }, { "docid": "91a04fe736c75b33214bc9b1df22c3d5", "score": "0.5967097", "text": "getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(this.showPosition);\n } else {\n x.innerHTML = 'Geolocation is not supported by this browser.';\n }\n }", "title": "" }, { "docid": "45345b90ec24d71cf7facbdd047ddf6d", "score": "0.5957355", "text": "function getLocation(){\n //getting the current position\n navigator.geolocation.getCurrentPosition(geoCallback, onError);\n}", "title": "" }, { "docid": "1d28440f74bf518c7ab151c57ee73596", "score": "0.59572995", "text": "get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }", "title": "" }, { "docid": "1d28440f74bf518c7ab151c57ee73596", "score": "0.59572995", "text": "get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }", "title": "" }, { "docid": "1d28440f74bf518c7ab151c57ee73596", "score": "0.59572995", "text": "get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }", "title": "" }, { "docid": "1d28440f74bf518c7ab151c57ee73596", "score": "0.59572995", "text": "get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }", "title": "" }, { "docid": "e9003f155acead6d7e2bf3a7f3df5a9f", "score": "0.59560835", "text": "function getPos(){\n\n\t\tif(!navigator.geolocation || navigator.geolocation=='undefined'){\n\t\t//swal(\"Location sharing not available on your device/computer/browser.\");\n\t\t\t$.get(\"https://ipinfo.io\", function(response) {\n \t\t\t\t\tconsole.log(\"ipinfo get response: \"+response.loc+ \", \"+response.country);\n\t\t\t\t\tvar loc = response.loc.split(',');\n \t\t\t\t\tvar pos = {coords : {\n \t\t\t\t\t\t\tlatitude: loc[0],\n \t\t\t\t\t\t\tlongitude: loc[1]}};\n \t\t\tnewMark(parseFloat(pos.coords.latitude), parseFloat(pos.coords.longitude), urhere,'', '');\n\t\t\t\t lat=pos.coords.latitude;\n\t\t\t\t lng=pos.coords.longitude;\n\t\t\t\t // alert(lat);\n\t\t\t\t console.log('User coord pos: '+pos.coords.latitude+', '+pos.coords.longitude);\n\t\t\t\t centerMap(parseFloat(pos.coords.latitude), parseFloat(pos.coords.longitude));\n\t\t\t\t\n\t\t\t\t}, \"jsonp\");\n\n\t\t}\n\t\telse{\n\t\t\t//note with geolocation, in firefox, if you hit the x to close location sharing or the \"not now\" you don't grant OR deny. \n\t\t\t//It just sits forever expecting some answer it'll never get. so the DENY action is never sent to run the failure option\n\t\t\t//And no, timeout doesn't solve this.\n\t\t\tnavigator.geolocation.getCurrentPosition(\n\t\t\t\tfunction(position) {\n\t\t\t\t newMark(position.coords.latitude, position.coords.longitude, urhere,'', '');\n\t\t\t\t lat=position.coords.latitude;\n\t\t\t\t lng=position.coords.longitude;\n\t\t\t\t // alert(lat);\n\t\t\t\t console.log(\"position stringify: \"+JSON.stringify(position));\n\t\t\t\t console.log('User coord pos: '+position.coords.latitude+', '+position.coords.longitude);\n\t\t\t\t centerMap(position.coords.latitude, position.coords.longitude);\n\t\t\t\t}, \n\t\t\t\tfunction(error){ \n\t\t\t\t/*swal(\"Location sharing is disabled on your broswers. Please enable it on your browser settings.\");//Location sharing denied. Using default location\n newMark(lat, lng, urhere,'', '');\n console.log('loc sharing denied. default coord pos: '+lat+', '+lng);\n centerMap(lat, lng);*/\n $.get(\"https://ipinfo.io\", function(response) {\n \t\t\t\t\tconsole.log(\"ipinfo get response: \"+response.loc+ \", \"+response.country);\n\t\t\t\t\tvar loc = response.loc.split(',');\n \t\t\t\t\tvar pos = {coords : {\n \t\t\t\t\t\t\tlatitude: loc[0],\n \t\t\t\t\t\t\tlongitude: loc[1]}};\n \t\t\tnewMark(parseFloat(pos.coords.latitude), parseFloat(pos.coords.longitude), urhere,'', '');\n\t\t\t\t lat=pos.coords.latitude;\n\t\t\t\t lng=pos.coords.longitude;\n\t\t\t\t // alert(lat);\n\t\t\t\t console.log('User coord pos: '+pos.coords.latitude+', '+pos.coords.longitude);\n\t\t\t\t centerMap(parseFloat(pos.coords.latitude), parseFloat(pos.coords.longitude));\n\t\t\t\t\n\t\t\t\t}, \"jsonp\");\n\n\t\t\t\t}, \n\t\t\t\t{enableHighAccuracy: true,timeout: 3000,maximumAge: Infinity}\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "bc5cec7aef3e099fb7cc14dde554c39b", "score": "0.5954054", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(formatJsonObj, geolocationError); // These params are callback functions\n } else {\n handleLocationError(\"Geolocation is not supported by this browser.\");\n }\n}", "title": "" }, { "docid": "a63e061e17e1d8da0b6581cbe303cc51", "score": "0.59500086", "text": "function getIp(interface) {\n try {\n var ips = require('os').networkInterfaces()[interface];\n var ip;\n ips.forEach(function(element) {\n if (element.family == \"IPv4\") {\n ip = element.address;\n }\n })\n return ip;\n } catch (e) {\n return \"none\";\n }\n \n}", "title": "" }, { "docid": "142ab4d5a1b005e9408a3cbc99ef0ad6", "score": "0.59493554", "text": "function getRemoteAddress(req) {\r\n\t\treturn req.headers['x-forwarded-for'] || req.connection.remoteAddress || req.socket.remoteAddress || req.connection.socket.remoteAddress;\r\n\t}", "title": "" }, { "docid": "64aa0290d8ec4ea01267e30309a1f330", "score": "0.59374434", "text": "function ipInfo(nsp) {\n\n location = [{ ip: '1.1.1.1' }];\n nsp.emit('api', {ipInfo: location});\n\n}", "title": "" }, { "docid": "cce67eeea2e46d2d9bcc231d6dc3ed5e", "score": "0.5934112", "text": "function getLocation(data){\n const address = document.querySelector(\".ip-address__response\");\n const locate = document.querySelector(\".location__response\");\n const timezone = document.querySelector(\".timezone__response\");\n const isp = document.querySelector(\".isp__response\");\n address.textContent = data.ip;\n locate.textContent = `${data.location.city}, ${data.location.region} ${data.location.postalCode}`;\n timezone.textContent = `UTC ${data.location.timezone}`;\n isp.textContent = data.isp; \n}", "title": "" }, { "docid": "702e52e2f8d96653bbb99de7af151322", "score": "0.5924016", "text": "function getIp() {\n const ips = [];\n const nets = networkInterfaces();\n for (const name of Object.keys(nets)) {\n for (const net of nets[name]) {\n // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses\n if (net.family === 'IPv4' && !net.internal) {\n ips.push(net.address);\n }\n }\n }\n\n if( !ips.length ) return noIps();\n if( ips.length === 1 ) return Promise.resolve(ips[0]);\n return promptOnMultipleOptions({\n question: 'Please select your LAN IP address from the list above: ',\n options: ips\n });\n}", "title": "" }, { "docid": "91c2cbe692e2ef63970b167407cd9a5b", "score": "0.5922756", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition, showError);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n}", "title": "" }, { "docid": "8977767c09ce94ad0bff45b2287b8031", "score": "0.5915414", "text": "function getLocation() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition);\n } else {\n x.innerHTML = \"Geolocation is not supported by this browser.\";\n }\n }", "title": "" }, { "docid": "c593a7d5a4973d0d0243b49ecab75260", "score": "0.59129", "text": "function getLocationFromBrowser() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showCoordinates);\n } else {\n console.log(\"Browser geolocation failed, displaying error message\");\n displayError();\n }\n}", "title": "" } ]
3e1200105d0d0a1c4b35c8ffdbeec581
'Filter by' event listener
[ { "docid": "261bf93b21089577440cc3e9467df36c", "score": "0.70152694", "text": "function handleFilterBy() {\n $('.js-bookmark-filter').on('change', function() {\n let selectedRating = $(this).val();\n\n STORE.setFilterBy(selectedRating);\n render();\n });\n }", "title": "" } ]
[ { "docid": "c5d83c38a266a82b70df7d017bdbce25", "score": "0.78036404", "text": "handleEventFiltering() { this.filteredEvents = this.filterByType(this.events, this.eventType); }", "title": "" }, { "docid": "5b505a4d3f113fa5708bddf6ef6daa2c", "score": "0.7208346", "text": "function loadEventListeners() {\n // filter by filterByBussName\n filterByBussName.addEventListener('keyup', filterBYBussNameFunc);\n}", "title": "" }, { "docid": "ca161e65e38a51bcc255b0a3bb6cbf5a", "score": "0.70016015", "text": "addFilterEventListener(){\n const toDo = this;\n const filters = document.getElementsByClassName(\"filter\")\n for(let i = 0; i < filters.length; i++){\n filters[i].addEventListener(\"click\", function(e){\n console.log(\"e: \" + e.target.id);\n if(e.target.id === \"active\"){\n toDo.filterList(false);\n }\n else if(e.target.id === \"completed\"){\n toDo.filterList(true);\n }\n else{\n toDo.filterList(\"all\");\n }\n });\n } \n }", "title": "" }, { "docid": "7ff88055149bff0504cec49a1415e837", "score": "0.6973779", "text": "_onFilterSelected(event) {\n this.filter = event.detail.filter;\n this.render();\n }", "title": "" }, { "docid": "f275e974d93dadb6ad27693143500bfb", "score": "0.68477577", "text": "init(onFilter) {\n nameInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, attackInput.value, defenseInput.value, hpInput.value);\n });\n \n attackInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, attackInput.value, defenseInput.value, hpInput.value);\n });\n defenseInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, attackInput.value, defenseInput.value, hpInput.value);\n });\n hpInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, attackInput.value, defenseInput.value, hpInput.value);\n });\n }", "title": "" }, { "docid": "f7d1a7a19b7f08e6adf876418a6a9f12", "score": "0.684213", "text": "bindEvents() {\n this.node.addEventListener('input', this.filter.bind(this));\n }", "title": "" }, { "docid": "1ed4bdf13b91004d48f83f67ff8f0c49", "score": "0.683631", "text": "filter() {\n let filter = document.getElementById('input').value\n let inpText = filter.toUpperCase()\n\n let showTracks = this.data.filter(track => {\n\n let name = track.trackName.replace(/\\s|&/gi, '').toUpperCase()\n let artist = track.artistName.replace(/\\s|&/gi, '').toUpperCase()\n\n if (name.includes(inpText) || artist.includes(inpText)) { return track }\n })\n\n this.modViewData(showTracks)\n }", "title": "" }, { "docid": "a337853465e74371e288962341146ea9", "score": "0.6826428", "text": "function filterEvents(event) {\n \n var category = $(this).attr('name');\n if(category === \"all\") \n window.parent.refetchFromFrame();\n else {\n window.parent.refetchFromFrame();\n setTimeout(function(){ applyFilter(category); }, 150);\n }\n}", "title": "" }, { "docid": "2d86acc881db8e43fbada7d3d41cb9a7", "score": "0.68166655", "text": "filter(){\n let event_filter=document.getElementsByClassName(\"event_filter\");\n console.log(event_filter);\n for(let i=0;i<event_filter.length;i++){\n event_filter[i].addEventListener(\"click\",(e)=>{\n document.getElementById(\"events\").remove();\n \n if(e.target.innerHTML==\"ALL\")this.showAll(this.all_events);\n if(e.target.innerHTML==\"CONFERENCE\"){\n let conference=this.all_events.filter(value=> value.category===\"Conference\");\n this.showAll(conference);\n } \n if(e.target.innerHTML==\"MUSIC/SHOW\"){\n let show=this.all_events.filter(value=> value.category===\"Music/Show\");\n this.showAll(show);\n }\n if(e.target.innerHTML==\"SPORTS\"){ \n let sports=this.all_events.filter(value=> value.category===\"Sports\");\n this.showAll(sports);\n }\n if(e.target.innerHTML==\"WEDDING\"){\n let wedding=this.all_events.filter(value=> value.category===\"Wedding\")\n this.showAll(wedding);\n }\n })\n }\n \n }", "title": "" }, { "docid": "c83028e6f7073b990b0f0966d933691a", "score": "0.68153036", "text": "filter() {\n if (this.input.value) {\n this.applyFilter();\n } else {\n this.discardFilter();\n }\n }", "title": "" }, { "docid": "2dc1b8ff18670cffb8625b9cefd2c375", "score": "0.6804963", "text": "function filter() {\n // your code here\n}", "title": "" }, { "docid": "fa915abb135a421027da499e5e13b8fa", "score": "0.6708276", "text": "function CustomFilter() {}", "title": "" }, { "docid": "1e8a11e6b1827b6367b2bb935ba6dccd", "score": "0.6691948", "text": "function selectFilter() {\n filter = this.value.toUpperCase();\n studentsFilter = [];\n allStudents.filter(function(student) {\n if (filter === \"ALL\") {\n studentsFilter.push(student);\n }\n if (student.house === filter) {\n studentsFilter.push(student);\n }\n });\n // display the list of students\n displayList(studentsFilter);\n}", "title": "" }, { "docid": "2629fe4389b472cfb5536e4f110bdefa", "score": "0.6645856", "text": "function setFilter() {\n house = this.value;\n currentStudents = filtrering(house);\n visElever();\n }", "title": "" }, { "docid": "0dabf194d37a990303518c20f21acae8", "score": "0.6639609", "text": "function onFilterChange(event) {\n\t\tconst { value } = event.target;\n\t\tsetFilterState(value);\n\t}", "title": "" }, { "docid": "9897b135a9b91689ba1bea11c453df77", "score": "0.66261935", "text": "filterHeroes(type, filter) {\n \n }", "title": "" }, { "docid": "48b3ffa87db31d210471ccf169d3e6de", "score": "0.65974", "text": "_filterArtists() {\n this.artistModel.filterArtists(this._getFacets(), (artists) => {\n if(this.listener && this.listener.artistsFiltered) {\n this.listener.artistsFiltered(artists);\n }\n });\n }", "title": "" }, { "docid": "4d7b81fbefb50f1570c7d7ca56f50ef1", "score": "0.6595541", "text": "_filterSongs() {\n this.songModel.filterSongs(this._getFacets(), (songs) => {\n if(this.listener && this.listener.songsFiltered) {\n this.listener.songsFiltered(songs);\n }\n });\n }", "title": "" }, { "docid": "3f563287ea71ea091a053c6adf9c1df3", "score": "0.65873486", "text": "function inputFilterHandler() {\n\n const inputElements = document.querySelectorAll('.input[data-pattern]');\n const inputArr = [...inputElements];\n for (let i = 0 ; i < inputArr.length; i++) {\n const input = inputArr[i];\n input.addEventListener('keypress', filter, false);\n }\n\n}", "title": "" }, { "docid": "0c42d9e2604e346431df3fc8941b027a", "score": "0.6577876", "text": "function filterProduct(event) {\n var filteredProduct = productList.filter((product) => {\n return product.productName.toLowerCase().indexOf(event.target.value.toLowerCase()) > -1\n })\n displayProduct(filteredProduct); \n}", "title": "" }, { "docid": "83c7d126453e8a5b07c1b241e54e0a2c", "score": "0.657211", "text": "function continueMain() {\n document.getElementById(\"search\").addEventListener(\"keyup\", filterList);\n }", "title": "" }, { "docid": "1833b1985d6aa72c1b74640e5ea620f5", "score": "0.65640444", "text": "function enableItemFilter(){\n const itemFilters = document.querySelectorAll('input[name=\"item-filter\"]');\n for(let i=0; i<itemFilters.length; i++){\n itemFilters[i].addEventListener('click', handleFilterEvent);\n }\n}", "title": "" }, { "docid": "a9159008702e151e9ec5bd5dd4775daf", "score": "0.6526353", "text": "function updateFilter(e) {\n // Sets the filter state, however the filter state can not be used on the same tic it is set without problems\n // So the e.target.value is used instead for the rest of this function\n setFilter(e.target.value)\n if (searchBy === 'Username') {\n // Updates the filtered users state\n setFilteredUsers(users.filter(user => user.username.includes(e.target.value)))\n }\n else if (searchBy === 'ID') {\n // Updates the filtered users state\n setFilteredUsers(users.filter(user => user.user_id.includes(e.target.value)))\n }\n }", "title": "" }, { "docid": "4c34ca2d3b7400ee1f06ccc5720cd76a", "score": "0.6525161", "text": "function changeFilter(ev) {\n // What To Do in here: \n // Refresh wrapper with a new gameList that is filtered according to data-filter\n ev.preventDefault();\n let filteredGames = [];\n const filterType = ev.currentTarget.getAttribute('data-filter');\n if(filterType != 'none') {\n filteredGames = getFilteredList(filterType);\n } else {\n filteredGames = gameList;\n }\n // Storing last used list in local storage\n localStorage.setItem('lastList', JSON.stringify(filteredGames));\n displayListInHtml(filteredGames, wrapper);\n}", "title": "" }, { "docid": "393178560c383d853ab24e94824d17d6", "score": "0.6519382", "text": "filter(f,q){\n return this.changeFilter(f,q);\n }", "title": "" }, { "docid": "ec716f9f1f9e7e19c141525861537293", "score": "0.65019715", "text": "function setFilter(e) {\n filters.searchText = e.target.value;\n}", "title": "" }, { "docid": "93149f7f55ea701286809aaa0258db2a", "score": "0.64710164", "text": "function filterThoseHouses(event) {\n //Filtering based on the attribute name and the value coming from json.//\n const chosenHouse = event.target.value;\n if (chosenHouse === \"*\") {\n //Option of displaying the list based on the students' names.//\n displayList(students);\n } else {\n //Option of displaying the list based on the houses' names.//\n displayList(weFilterByHouse(chosenHouse));\n }\n}", "title": "" }, { "docid": "581719d2347fca6086d6a002923152ec", "score": "0.646837", "text": "function removeFilter() {\n\n}", "title": "" }, { "docid": "3def2a69826a6bf19851660bb819c0dc", "score": "0.64467776", "text": "function setFilter() {\n house = this.value;\n currentStudents = filtering(house);\n showStudents();\n }", "title": "" }, { "docid": "3ea9737e87f1da4f74c3eba3f75e97d5", "score": "0.64389324", "text": "function onSearch() {\n var filter = searchInput.val();\n\n if (filter !== '') {\n clearSearchButton.show();\n }\n else {\n clearSearchButton.hide();\n }\n\n subview.filter(filter);\n }", "title": "" }, { "docid": "ef63ee912e7f5927483f953f0fdeb9d6", "score": "0.64224553", "text": "function filterTrails(e) {\n\t    var clickedFilter = e.target;\n\t\tvar filterType = clickedFilter.getAttribute(\"data-filtering\");\n\t\tvar filterBy = clickedFilter.value;\n\n\t    for (var i = 0; i < trailsToFilter.length; i++) {\n\t        var currentTrail = trailsToFilter[i];\n\t\t\t\n\n\t\t\tif (currentTrail.getAttribute(\"data-\" + filterType) == filterBy) {\n\t\t\t\tif (clickedFilter.checked == true) {\n\t\t\t\t\t//show hidden trail\n\t\t\t\t\tvar index = currentTrail.filtering.indexOf(filterBy);\n\t\t\t\t\tcurrentTrail.filtering.splice(index, 1);\n\t\t\t\t\t//check if there is some filters left\n\t\t\t\t\tif (currentTrail.filtering.length == 0) {\n\t\t\t\t\t\tcurrentTrail.classList.remove(\"hideItem\");\n\t\t\t\t\t\tcurrentTrail.classList.add(\"showItem\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// hide trail\n\t\t\t\t\tcurrentTrail.filtering.push(filterBy);\n\t\t\t\t\tcurrentTrail.classList.remove(\"showItem\");\n\t\t\t\t\tcurrentTrail.classList.add(\"hideItem\");\n\n\t\t\t\t}\t\n\t        }\n\t\t}\n\t}", "title": "" }, { "docid": "b0174babfae23e028f75193c7a5b73b2", "score": "0.63953286", "text": "function loadEvents(){\r\n const filterOptions = document.querySelector(\".filter-todos\");\r\n document.querySelector('form').addEventListener('submit',submit);\r\n document.getElementById('clear').addEventListener('click',clearList);\r\n document.querySelector(\".main-ul\").addEventListener('click',deleteOrTick);\r\n filterOptions.addEventListener(\"change\", filterList);\r\n}", "title": "" }, { "docid": "42c1e259747b60fbc02699ca3daecf89", "score": "0.63835263", "text": "function onKeyPress(event) {\r\n filterSearch();\r\n}", "title": "" }, { "docid": "041f3bea2f55ff4461642bf85554a685", "score": "0.6380084", "text": "filterList(e) {\n let updatedList = this.state.events;\n updatedList = updatedList.filter(function(event){\n return event.event_name.toLowerCase().search(\n e.target.value.toLowerCase()) !== -1;\n });\n this.setState({filteredEvents: updatedList});\n this.render();\n }", "title": "" }, { "docid": "b61ac584d3a0b93bf4468f4b4de4278b", "score": "0.63781065", "text": "function filterPokemons() {\n const filtersObj = {\n type: typeFilter,\n resistant: resistantFilter,\n weaknesses: weaknessesFilter,\n };\n /*\n Pegar valor do campo pelo evento\n console.log(event.target.value);\n Pegar valor direto pela variável do elemento\n console.log(typeFilter.value);\n */\n const selectedFilterByType = filtersObj.type.value;\n const selectedFilterByResistant = filtersObj.resistant.value;\n const selectedFilterByWeaknesses = filtersObj.weaknesses.value;\n\n pokemonsFiltrados = todosOsPokemons;\n if (selectedFilterByType) {\n pokemonsFiltrados = filterData(\n pokemonsFiltrados,\n selectedFilterByType,\n \"type\"\n );\n }\n if (selectedFilterByResistant) {\n pokemonsFiltrados = filterData(\n pokemonsFiltrados,\n selectedFilterByResistant,\n \"resistant\"\n );\n }\n if (selectedFilterByWeaknesses) {\n pokemonsFiltrados = filterData(\n pokemonsFiltrados,\n selectedFilterByWeaknesses,\n \"weaknesses\"\n );\n }\n\n mostrarCards(pokemonsFiltrados);\n\n //executar a função de calculo agregado\n document.getElementById(\"calculo-agregado\").innerText = \"\";\n if (selectedFilterByType != \"\") resultCalc();\n}", "title": "" }, { "docid": "770ee4cea0272d31db7e46b9958f3261", "score": "0.6378044", "text": "filtering(evt) {\n evt.preventDefault();\n\n if (!_.isObject(evt.filter)) {\n this.dataSource.filter({});\n return;\n }\n\n const q = evt.filter.value;\n this.dataSource.filter({ logic: 'or', filters: fields.map(f => buildFilter(q, f)) });\n }", "title": "" }, { "docid": "0681dc77c8b30c745f37e5bee17d26be", "score": "0.6373633", "text": "function handleFiltering(e) {\n e.preventDefault();\n filterParams.starsNum = Number(starsInput.value);\n filterParams.repoType = typeInput.value;\n filterResults();\n}", "title": "" }, { "docid": "fbc70141e252d9ff829c5c3f98843a3f", "score": "0.63671875", "text": "function filterHandler() {\n comicCon.innerHTML = ''\n Comic.renderWithCatFilter(catFilter.value).forEach(comic => {\n comicCon.innerHTML += comic.renderComic()\n //--More Info Card Listener-- //\n moreComicInfoEvent()\n })\n}", "title": "" }, { "docid": "5a27f11e82c150fea5e9dfa87cda9803", "score": "0.6359715", "text": "function processFiltersEvent(key) {\r\n var attrs, filters, filterMutate, processFilter; \r\n attrs = attr(this);\r\n if (attrs) {\r\n filters = attrs(opts.selectorPrefix + '-filter');\r\n filterMutate = attrs(opts.selectorPrefix + '-filter-mutate');\r\n if (filters) {\r\n processFilter = function(filter) {\r\n if (state.filters.hasOwnProperty(filter) && \r\n state.model.hasOwnProperty(key)) {\r\n var val = state.filters[filter].call(this, state.model[key]);\r\n if (typeof val != 'undefined' && filterMutate) {\r\n state.model[key] = val;\r\n }\r\n setupTextNode(this, val);\r\n }\r\n };\r\n if (filters.indexOf(',') != -1) filters = filters.split(',');\r\n if (!(filters instanceof Array)) filters = [filters];\r\n Array.prototype.forEach.call(filters, processFilter, this);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "38eaef0691806e47821e8139a7aa53c3", "score": "0.63396657", "text": "_listenToInternalFilters() {\n entityLinksHelper.listenToChanges(this.dataSource)\n .subscribe(() => {\n this.emitGlobal('searchresponse', this.dataSource.getSearchModelId());\n });\n }", "title": "" }, { "docid": "e28b3628553579cabcd1692a987e1cd3", "score": "0.6337902", "text": "init(onFilter) {\n nameInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, type1Input.value, type2Input.value, shapeInput, speedInput, attackInput);\n });\n\n type1Input.addEventListener('keyup', function() {\n onFilter(nameInput.value, type1Input.value, type2Input.value, shapeInput, speedInput, attackInput);\n });\n\n type2Input.addEventListener('keyup', function() {\n onFilter(nameInput.value, type1Input.value, type2Input.value, shapeInput, speedInput, attackInput);\n });\n\n shapeInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, type1Input.value, type2Input.value, shapeInput, speedInput, attackInput);\n });\n\n speedInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, type1Input.value, type2Input.value, shapeInput, speedInput, attackInput);\n });\n\n attackInput.addEventListener('keyup', function() {\n onFilter(nameInput.value, type1Input.value, type2Input.value, shapeInput, speedInput, attackInput);\n });\n }", "title": "" }, { "docid": "7d97a3e740a506ce6298af389a244fbe", "score": "0.6324481", "text": "function filterStats(event, container) {\n const filter = event.target.value;\n const filters = filter.split(',');\n container.childNodes.forEach(node => {\n if (node.nodeName !== 'DETAILS') {\n return;\n }\n const statsType = node.attributes['data-statsType'];\n if (!filter || filters.includes(statsType) ||\n filters.find(f => statsType.includes(f))) {\n node.style.display = 'block';\n } else {\n node.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "16c848d847c6b1815ffcec454acf1b0b", "score": "0.630837", "text": "filter(criteria) {\n this.adapter.filter(criteria);\n }", "title": "" }, { "docid": "019bf7e2129db0881dd3e33d7e42b3bf", "score": "0.63061464", "text": "function filterWhenChange() {\n var url = link + '?page=' + page + getFilter();\n getData(url);\n}", "title": "" }, { "docid": "69f6ef554b37398c82c63fa1b825ff25", "score": "0.62997776", "text": "function filterChangedHandler(filterEvent) {\n // Just reconstruct the filters table whenever a filter changes.\n // This could be optimized to add/remove only the different filters.\n //$(\"#myGrid\").remove();\n fetchFilters();\n getSummaryData();\n}", "title": "" }, { "docid": "6e92c712ee78ec0cce698a9f6001a1b0", "score": "0.6290702", "text": "function handleFilter() {\n $(\"#country\").keyup(function () {\n let input = $('#country').val()\n $(`#js-country-list`).empty().append(filter(input))\n });\n}", "title": "" }, { "docid": "982b90bfa811e026cf5a3faeb306bfd4", "score": "0.6269167", "text": "function filterYours(){\n\t//TODO: fill in!\n}", "title": "" }, { "docid": "0fb5d400c3d61a143e8823448e6f205a", "score": "0.62552136", "text": "function initEventListener() {\n $scope.$on(vm.controllerId + '.action.getFilter', function (event, data) {\n console.log(data);\n getFilter(data);\n vm.action.getPage();\n });\n }", "title": "" }, { "docid": "bd70ba8ee56bda10d5dfa4a95148c22f", "score": "0.6246253", "text": "function filterTransaction(e) {\n e.preventDefault(); //to prevent form from submitting and refreshing the page\n list.innerHTML = \"\";\n reco.innerHTML = \"\";\n\n //filter function works on any array\n TransactionData = TransactionDataAll.filter(\n (tran) => tran.customername == custname.value //the backets are optional here\n //function returns true/false for each array item\n //basically, whether to include it or not (filter)\n //ignore case:\n //(tran) => tran.customername.toUpperCase() == custname.value.toUpperCase()\n //use === if comparing objects, simple values can use ==\n );\n TransactionData.forEach(addTransactionDOM);\n updateValues();\n}", "title": "" }, { "docid": "0741cc433a6400449d45a407f6dd41b4", "score": "0.62451863", "text": "function filterByTerm(event) {\n setFilterTerm(event.target.value.toLowerCase());\n }", "title": "" }, { "docid": "60ec07a690d4c5e9890cb2d5b81a9b42", "score": "0.6236482", "text": "function filterBYBussNameFunc(e) {\n const text = e.target.value.toLowerCase();\n console.log(text);\n\n e.preventDefault();\n\n document.querySelectorAll('.viewItem').forEach(function(ver) {\n const item = ver.firstChild.textContent;\n\n if (item.toLowerCase().indexOf(text) != -1) {\n ver.style.display = 'block';\n } else {\n ver.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "2d453d6690233416bc099dc148ca5482", "score": "0.6230697", "text": "function filterStudents() {\n if (filterBy == \"all\") {\n studentsOnDisplay = allStudents;\n } else if (filterBy == \"expelled\") {\n studentsOnDisplay = expelledStudentsArray;\n } else {\n studentsOnDisplay = allStudents.filter(isInHouse);\n }\n}", "title": "" }, { "docid": "42f5c4fc9ab1079a0a598308372f14f6", "score": "0.6226693", "text": "initFiltering(){\n let filters = [this.countriesFilter,this.mapsFilter];\n let targets = [this.countriesList, this.mapsList];\n filters.forEach((filter,index)=>{\n filter.addEventListener('input',e=>{\n let value = e.target.value;\n let target = targets[index];\n if(target.nodeName===\"TABLE\"){\n [].slice.call(target.querySelectorAll(\"tbody>tr>td:nth-child(1)\")).forEach(el=>{\n let parent = el.parentNode;\n if(el.textContent.toLowerCase().indexOf(value.toLowerCase())>-1){\n parent.style.display=\"table-row\";\n } else {\n parent.style.display=\"none\";\n }\n })\n }\n if(target.nodeName===\"UL\"){\n [].slice.call(target.querySelectorAll(\"li\")).forEach(el=>{\n if(el.textContent.toLowerCase().indexOf(value.toLowerCase())>-1){\n el.style.display=\"block\";\n } else {\n el.style.display=\"none\";\n }\n })\n }\n })\n })\n }", "title": "" }, { "docid": "f9e4d1a4a5d5babd375d7b940b05d9a5", "score": "0.62224627", "text": "function filtering(selection, entry) {\n\nfilteredData = tableData.filter(event => event[selection] === entry);\n\ndisplayTable(filteredData);\n\n}", "title": "" }, { "docid": "1329ce052f773831c3203d831862748c", "score": "0.6219257", "text": "function filter(event) {\n if (event.which === 13 || event.keyCode === 13) {\n var url = link + '?page=' + page + getFilter();\n getData(url);\n }\n}", "title": "" }, { "docid": "8cfc44efa9dae9df501f275d35473d13", "score": "0.62026703", "text": "function filterRoleDesktop (event){\n let role = event.target.value;\n //const classify = datos.filter(rol => rol['tags'].includes(role));\n let changeViewData = filterData (datos, role);\n if (role === 'All') {\n getData (datos)\n }else{\n getData (changeViewData)\n }\n console.log(changeViewData)\n}", "title": "" }, { "docid": "c5ee260d1289247ead51d404394f18a2", "score": "0.6201521", "text": "_initFilterElements(filters = this.filters) {\n // Listen to changes to all filters so we can trigger a search\n for (const filter of filters) {\n const checkEvent = (filter.nodeName === 'SELECT') ? 'change' : 'keyup';\n filter.addEventListener(checkEvent, () => {\n this.applyFilters();\n });\n }\n }", "title": "" }, { "docid": "14dad9907da3f0a3bd90e083e5b0fa67", "score": "0.6189588", "text": "function filterSelection(e) {\n let x, i;\n // console log which attribute the argument of filterSelection is given\n // to make sure it gets the ID of the button clicked and filters by that\n e = this.getAttribute('id');\n console.log(e)\n x = document.getElementsByClassName(\"book\");\n \n // loop through each book in the current displayed array and remove \"show\" class. \n // If the book contains the argument clicked or the argument is \"all\", \n // then add \"show\" class to books to display them \n for (i = 0; i < x.length; i++) {\n \tx[i].classList.remove(\"show\");\n if (x[i].classList.contains(e) || e == \"all\"){ \n \tx[i].classList.add(\"show\");\n } \n }\n}", "title": "" }, { "docid": "3be72cf0df41df12c86b17fe32d96baa", "score": "0.6185753", "text": "function addFilters(e, tag) {\n if (!filters.find(item => item === tag)) {\n let temp = [...filters];\n temp.unshift(tag);\n setFilters(temp)\n }\n e.stopPropagation();\n }", "title": "" }, { "docid": "4491bee462e7a38e6eb382e4524429e5", "score": "0.61815906", "text": "changeInNameFilter(event) {\n this.state.nameFilter = event.target.value;\n this.contactsThatMatchQuery();\n }", "title": "" }, { "docid": "1d070408b051b42fe4347ff16eb31cea", "score": "0.6173611", "text": "filter(e) {\n this.props.store.filter = e.target.value\n }", "title": "" }, { "docid": "0f8104b63f728bff8f089a47772e22c0", "score": "0.6166911", "text": "function filterNoteList(){ // Separate function to be able to add more filter options, such as search or tags\n\tfilterFav();\n}", "title": "" }, { "docid": "63fb5319737623f0b62f615f0c2c0ac9", "score": "0.6153567", "text": "filter()\n {\n const filterValue = appState.get('filter');\n\n switch (filterValue)\n {\n case 'all':\n this.addAll();\n break;\n\n case 'completed':\n this.addSome((item) => { return item.get('done'); });\n break;\n\n default:\n this.addSome((item) => { return !item.get('done'); });\n break;\n }\n }", "title": "" }, { "docid": "e8d2be889c05093e819fc31ecc4daa58", "score": "0.6151525", "text": "static filterPersons() {\n const personsFiltered = [];\n for (const person of Nacarta.persons) {\n if (!Nacarta.config.filterIdentifier\n || person.id.startsWith(Nacarta.config.filterIdentifier)\n || Nacarta.config.filterIdentifier.startsWith(person.id))\n personsFiltered.push(person);\n }\n Nacarta.persons = personsFiltered;\n }", "title": "" }, { "docid": "6108d3744943209bb66703d8b6b04621", "score": "0.6143719", "text": "applyFilter () {\r\n const requestParameters = this.getRequestParams()\r\n this.$emit('apply-filter', requestParameters)\r\n }", "title": "" }, { "docid": "d1b5f1bbcd0bc410244eef6a4f80a96a", "score": "0.6143436", "text": "function filterExp() {\n let filterType = document.getElementById(\"filter-type\");\n \n if (filterType.value !== \"none\") {\n const expFilteredDB = expDatabase.filter((filter) => {\n return filter.type === filterType.value});\n console.log(expFilteredDB);\n showAllExp(expFilteredDB);\n }\n else {\n showAllExp(expDatabase);\n }\n\n event.preventDefault();\n}", "title": "" }, { "docid": "bc4115769b65cf819f8fd54ccc7175ed", "score": "0.61429226", "text": "function filterItem(e) {\n const searchFilter = e.target.value.toLowerCase().trim();\n \n items.forEach((item) => {\n if(item.textContent.includes(searchFilter)) {\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n })\n}", "title": "" }, { "docid": "af6e0418a28038ae5017f0cdb067361c", "score": "0.614252", "text": "function filter(field, e){\n if(field === 'first_name'){\n saveFilters.current.name = e.target.value;\n } else {\n saveFilters.current[field] = e.target.value;\n }\n // filters the original value with the filters applied\n setFilterData(\n Donor\n .filter(filterByName(saveFilters.current.name))\n .filter(filterByBloodGroup(saveFilters.current.bloodGroup))\n .filter(filterByCity(saveFilters.current.city))\n );\n setIsFilterOn(true);\n }", "title": "" }, { "docid": "f44f7deee351f4d6a36d5538b6d4c616", "score": "0.6141216", "text": "function filterButtonHandler(event) {\n Caman('#image', function () {\n this.revert(true);\n this[event.target.id]().render(function () {\n if (textInput.value) {\n applyText;\n };\n });\n });\n }", "title": "" }, { "docid": "2472fec90a50779c5657d90ee841b2a2", "score": "0.6135909", "text": "function pushFilter(e) {\n const value = e.target.dataset.name;\n if (!jobFilterArr.includes(value)) {\n jobFilterArr.push(value);\n }\n}", "title": "" }, { "docid": "e040a6ea90ce95d1355be484fd1b066e", "score": "0.61358714", "text": "function filterTasks(e) {\n // Get the value from the input filter\n const filterValue = document.querySelector('#filter').value.toLowerCase();\n // Get the list items for iteration in the collection ul\n const listItems = document.querySelectorAll('ul li.collection-item');\n\n listItems.forEach(function(item){\n // Check if each list item contains the substring in the filter value\n if (item.textContent.toLowerCase().includes(filterValue)) {\n item.hidden = false;\n } else {\n // Hide the list item if substring filter value is not in the list item text content\n item.hidden = true;\n }\n });\n}", "title": "" }, { "docid": "b84492645ea4931599fbe672a50af116", "score": "0.6128244", "text": "function _filterBoxHandler() {\n $(\".blf-filterinput\").keyup(function () {\n var filter = $(this).val().toLowerCase();\n if (filter) {\n $(\"#blf-libs\").find(\"li\").each(function (i, li) {\n var id = li.id.toLowerCase();\n if (id.search(filter) === -1) {\n $(li).hide();\n } else {\n $(li).show();\n }\n });\n } else {\n $(\"#blf-libs\").find(\"li\").show();\n }\n });\n\n $(\".blf-clear-filterinput\").click(function () {\n $(\".blf-filterinput\").val(\"\");\n $(\".blf-filterinput\").keyup();\n $(\".blf-filterinput\").focus();\n });\n }", "title": "" }, { "docid": "965fda33b288aff6c25259ce04351e6e", "score": "0.6111463", "text": "filter(predicateFn){const name=this._constructChainName(\"Filter\");const transformedObservable=new Observable(name);this._wireTransformedObservableWithOperation(transformedObservable,value=>{if(predicateFn(value)){// The value passed the filter so we need to emit!\n transformedObservable.emitValue(value);}else{this._debugLogEmitSuppressed(value);}});return transformedObservable;}", "title": "" }, { "docid": "7a34afe88c6021fdce66e61335a6c4aa", "score": "0.61095136", "text": "function OnPokemonNameIDChanged(filter) {\n filterNameID = filter;\n OnFilterCriteriaChanged();\n}", "title": "" }, { "docid": "12dcbfee9e437aba3c362c9242dcbf9b", "score": "0.61085266", "text": "function filterEvents(term){\n\n term = term.trim();\n\n var matchingIDs = [];\n\n for(var i = 0; i < data.length; i++){\n var item = data[i];\n item.visible = false;\n for(var k in item){\n var value = item[k];\n if(typeof value == \"string\"){\n value = value.toLowerCase();\n if(value.indexOf(term) > -1){\n matchingIDs.push(item.id);\n item.visible = true;\n break;\n }\n }\n }\n }\n\n $(\".event-card\").each(function(){\n $(this).hide();\n var thisId = parseInt($(this).data(\"id\"));\n if(matchingIDs.indexOf(thisId) > -1) {\n $(this).show();\n }\n });\n\n if($(\".event-card:visible\").length == 0){\n $(\".no-results\").show();\n } else {\n $(\".no-results\").hide();\n }\n\n updateCounts();\n}", "title": "" }, { "docid": "f12ccc899e0a9d08b7e6c75b030d0868", "score": "0.61016", "text": "function filterPage()\r\n {\r\n filterStaticText();\r\n filterDynamicText();\r\n }", "title": "" }, { "docid": "f7a06b898d8a77fd5630b95f8b22b5eb", "score": "0.60893756", "text": "function filters(){\n\t$('.seg-section').click(function(){\n\t\tvar $filter = $(this);\n\t\tvar name = $filter.text().toLowerCase();\n\t\tif ($filter.hasClass('filtered')){\n\t\t\t$filter.removeClass('filtered');\n\t\t\t$('.card').each(function(){\n\t\t\t\tvar $this = $(this);\n\t\t\t\t$this.show();\n\t\t\t});\n\t\t} else {\n\t\t\t$('.filtered').removeClass('filtered');\n\t\t\t$filter.addClass('filtered');\n\t\t\t$('.card').each(function(){\n\t\t\t\tvar $this = $(this);\n\t\t\t\tif (!$this.hasClass(name)) {\n\t\t\t\t\t$this.hide();\n\t\t\t\t} else {\n\t\t\t\t\t$this.show();\n\t\t\t\t}\n\t\t\t\tif ($this.hasClass('all')) {\n\t\t\t\t\t$this.show();\n\t\t\t\t} \n\t\t\t});\n\t\t}\n\t});\n\t$('.seg-section').keydown(function(e){ // Trigger the click event from the keyboard\n\t\tvar code = e.which;\n\t\t// 13 = Return, 32 = Space\n\t\tif ((code === 13) || (code === 32)) {\n\t\t\t$(this).trigger('click');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d6882008e7945b2fbbb38b919e14f59f", "score": "0.6086077", "text": "filterItems (filter, value){\n this.filters[filter] = value;\n }", "title": "" }, { "docid": "273dd8714b982d07efd2829f0efd755d", "score": "0.6083647", "text": "function bindFilter(elem, col) {\n elem.onkeyup = function() {\n if ((91 > event.keyCode && event.keyCode > 47) || event.keyCode == 8) {\n options.filterText = event.target.value;\n options.filterBy = col;\n bindData()\n }\n }\n return elem\n }", "title": "" }, { "docid": "59dc216bec540cac5e411bf206d15de2", "score": "0.6082772", "text": "handleFilter(author) {\n this.props.filterInterests(author);\n }", "title": "" }, { "docid": "67929acaa33b8030055eab0d1090b847", "score": "0.6079213", "text": "_FilterEntity(e) {\n for(var i = 0; i<this.filters.length; i+=1) {\n if(!this.filters[i](e)) {return false;}\n }\n return true;\n }", "title": "" }, { "docid": "025f748f4d8bbc48a219b59b88a15fcd", "score": "0.60758036", "text": "function listInitFilters(){\n $(\".client-filter\").click(function() {\n var filter = this.id;\n $(\".data\").hide();\n if(filter == \"ALL\"){\n $(\".data\").show();\n }\n else {\n $(\".\"+filter.toLowerCase()).show();\n }\n });\n }", "title": "" }, { "docid": "b6ea7e8a816e533e703a0221e28c174a", "score": "0.60726684", "text": "function filterTasks(e) {\n // get what we type in the filter input\n const text = e.target.value.toLowerCase()\n // loop through all the tasks list\n document.querySelectorAll('.collection-item').forEach(function(task) {\n // get the text content of the first child of the task (the task item) \n const item = task.firstChild.textContent\n // if what we typed inside the filter input is in the task item\n if (item.toLowerCase().indexOf(text) != -1) {\n // display it\n task.style.display = 'block'\n } else {\n task.style.display = 'none'\n }\n })\n}", "title": "" }, { "docid": "116374cd75d2882be528baa7324f76f8", "score": "0.6067685", "text": "_filterByWatched(movie) {\n return movie.watched;\n }", "title": "" }, { "docid": "dcd7bcc303b52078c5f530e731a5daaf", "score": "0.6067425", "text": "function onChangeHotelFilter(e)\n{\n var filter = document.getElementById(\"searchBy\");\n var latency = 700;\n\n if (filter.lastFilterTimeoutID != undefined)\n clearTimeout(filter.lastFilterTimeoutID);\n filter.lastFilterTimeoutID = setTimeout(setHotelFilter, latency);\n}", "title": "" }, { "docid": "fe55781e1175e10e4ab84663b7bf11a1", "score": "0.6066982", "text": "function filterItems(e){\n //get filter text and convert it to lower case\n var text = e.target.value.toLowerCase();\n //get lists \n var items = itemList.getElementsByTagName('li');\n \n //covert to an array\n Array.from(items).forEach(function(item){\n var itemName = item.firstChild.textContent;\n if(itemName.toLowerCase().indexOf(text) != -1){\n item.style.display = 'block';\n }else {\n item.style.display = 'none';\n }\n });\n}", "title": "" }, { "docid": "3824a17633b77163bef80703b7719da5", "score": "0.6058557", "text": "_filterAlbums() {\n this.albumModel.filterAlbums(this._getFacets(), (albums) => {\n if(this.listener && this.listener.albumsFiltered) {\n this.listener.albumsFiltered(albums);\n }\n });\n }", "title": "" }, { "docid": "24469a867770b011fbe8657c211c9c19", "score": "0.60570896", "text": "function activateFilter() {\n\tconst buttons = document.querySelectorAll('button');\n\tconst storeItems = document.querySelectorAll('.item');\n\n\tbuttons.forEach((button) => {\n\t\tbutton.addEventListener('click', (e) => {\n\t\t\te.preventDefault()\n\t\t\tconst filter = e.target.dataset.filter;\n\n\t\t\tstoreItems.forEach((item) => {\n\t\t\t\tif (filter === 'all') {\n\t\t\t\t\titem.style.display = 'block'\n\t\t\t\t} else {\n\t\t\t\t\tif (item.classList.contains(filter)) {\n\t\t\t\t\t\titem.style.display = 'block'\n\t\t\t\t\t} else {\n\t\t\t\t\t\titem.style.display = 'none'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t})\n\t})\n}", "title": "" }, { "docid": "232f57e7f7175bb27e581580757d9678", "score": "0.6051744", "text": "function applyFilter() {\n let value = this.innerText;\n let attribute = this.parentNode.parentNode.querySelector(\"h3\").innerText;\n if(valuesAreArray(attribute)) {\n toggleFilter(this);\n } else {\n let selectedFilter = this.parentNode.querySelector(\".filter-selected\");\n if(selectedFilter != null && !this.classList.contains(\"filter-selected\")) {\n toggleFilter(selectedFilter);\n }\n toggleFilter(this);\n }\n filterCompanies();\n }", "title": "" }, { "docid": "02b1d860738d1f26d9b7967bbb14f08c", "score": "0.6049874", "text": "filter(fnFilter) {\n return this.pipe(filter2(fnFilter));\n }", "title": "" }, { "docid": "ff99df3f790e84dddb1f68fca0ebe057", "score": "0.6048678", "text": "onSearchClick(event) {\n this.filters = event.target.value;\n location.hash = this.createQueryHash(this.filters);\n }", "title": "" }, { "docid": "d8f73d46cf311d4188469257a18d1583", "score": "0.6047939", "text": "function _changeListener(){\r\n\t//update drug filters\r\n\t_filterByDropDown();\r\n\r\n}", "title": "" }, { "docid": "4460d88e0c16dd12c0a0ccd98a3eba4f", "score": "0.60376245", "text": "function filter(key) {\n var userID = document.getElementById(\"advisorName\").innerHTML;\n var searchXmlhttp = new XMLHttpRequest();\n searchXmlhttp.onload = filterAJAXHandler;\n msg = \"?request=filter&identity=\" + \"advisor\" +\"&userID=\" + userID + \"&key=\" + key;\n searchXmlhttp.open(\"GET\", \"http://localhost:8080/\" + msg, true);\n searchXmlhttp.send();\n }", "title": "" }, { "docid": "81f15edba6f833a593b92d1eb991f90f", "score": "0.6035838", "text": "function filter (type, data) {\n removeFilter()\n filterPrices()\n filterStatus()\n $scope.collection.fetch()\n }", "title": "" }, { "docid": "3814cb0e85a6eb73a51d93bdb358f7f5", "score": "0.6033876", "text": "filterBySomeAttribute(attribute, value){\n this.props.filters[attribute].filter(value);\n this.props.updateFilteredData()\n }", "title": "" }, { "docid": "17fce1b11fe9b32bda57c9d291b6327e", "score": "0.60328466", "text": "filterBy (column, search) {\n this.trigger('filterBy:pre', {\n column: column,\n search: search\n })\n\n this.filtering[column] = search\n\n this.filterByColumns(this.filtering)\n\n this.trigger('filterBy:post', {\n column: column,\n search: search\n })\n }", "title": "" }, { "docid": "ba1aa2e8f8becd76fbe57950d6eea4f9", "score": "0.60306644", "text": "function EventFilterUtil() {\n}", "title": "" }, { "docid": "3e095c8f400462d6bfc8086664563122", "score": "0.60244685", "text": "function handleFilterCheck() {\n $('.js-filter-checked').click(event => {\n console.log('handle filter ran');\n toggleFilter(STORE);\n renderShoppingList();\n });\n}", "title": "" }, { "docid": "9ed68f7b9bfad4b29e62735c7b2c85c1", "score": "0.6023982", "text": "dispatchFilterChangeEvent() {\n this.dispatchEvent(\n new CustomEvent(\"filterchange\", {\n detail: {\n typeFilterValues: this.typeFilterValues,\n relatedObjectFilterValue: this.relatedObjectFilterValue\n }\n })\n );\n }", "title": "" }, { "docid": "a6b650b9d3590c1b6e56f174ce310baa", "score": "0.6023594", "text": "takenFilter(e){\n\t\tthis.state.showTaken = !this.state.showTaken;\n\t\tthis.state.takenFilterText = this.state.showTaken ? \"Hide\" : \"Show\"\n\t\tactions.getSearchResults(this.refs.searchInput.value);\n\t}", "title": "" } ]
dedcd8156c954e094b687044d07b2bec
Differents performance values depends on if it's a mesh or a graph
[ { "docid": "819f49533aacbe3fcd93043c4d81ebc2", "score": "0.0", "text": "function setMesh(mesh) {\n isMesh = mesh;\n}", "title": "" } ]
[ { "docid": "cb4ad6a56f55061adadb7cb1c87b88c1", "score": "0.5713751", "text": "endUpdate() {\n this.dot.visibility = this.usedVertices == 0 ? 0 : 1\n let i\n i = this.vertices.length-1\n while(i>=this.usedVertices && i>0) this.vertices[i--].dispose()\n if(i+1<this.vertices.length) this.vertices.splice(i+1, this.vertices.length-(i+1))\n\n this.edge.visibility = this.usedEdges == 0 ? 0 : 1\n i = this.edges.length-1\n while(i>=this.usedEdges && i>0) this.edges[i--].dispose()\n if(i+1<this.edges.length) this.edges.splice(i+1, this.edges.length-(i+1))\n \n if(this.faces.fCount == 0) this.facesMesh.visibility = 0\n else {\n var vertexData = new BABYLON.VertexData();\n vertexData.positions = this.faces.positions\n vertexData.indices = this.faces.indices\n vertexData.applyToMesh(this.facesMesh);\n this.facesMesh.visibility = 1\n }\n\n // check\n const q = this.scene.meshes.filter(mesh=>mesh.name.startsWith(this.name + \"-dot-inst\"))\n if(this.usedVertices > 0) {\n if(this.usedVertices-1 != q.length) {\n\n console.log(q.length, this.usedVertices)\n throw \"Bad! (1)\" \n }\n } else {\n if(q.length != 0) {\n console.log(q.length, this.usedVertices)\n throw \"Bad! (2)\" \n\n }\n\n }\n }", "title": "" }, { "docid": "548387e6746651b9374945dfbae62f70", "score": "0.5636239", "text": "componentWillMount() {\n if (!this.props.decomposition) {\n return;\n }\n let { datasetId, k, persistenceLevel } = this.props.decomposition;\n this.client\n .fetchLayoutForPersistenceLevel(datasetId, k, persistenceLevel)\n .then(function(result) {\n if (result.embedding && result.embedding.layout) {\n // let layout = [].concat(...result.embedding.layout);\n let layout = result.embedding.layout;\n let adjacency = result.embedding.adjacency;\n this.createGeometry(layout, adjacency, 0.02, 0.02);\n\n if (this.props.qoi) {\n let min = Math.min(...this.props.qoi);\n let max = Math.max(...this.props.qoi);\n let color = d3.scaleLinear()\n .domain([min, 0.5*(min+max), max])\n .range(['blue', 'white', 'red']);\n let colorsArray = [];\n for (let i = 0; i < this.props.qoi.length; i++) {\n let colorString = color(this.props.qoi[i]);\n let colorTriplet = colorString.match(/([0-9]+\\.?[0-9]*)/g);\n colorTriplet[0] /= 255;\n colorTriplet[1] /= 255;\n colorTriplet[2] /= 255;\n colorsArray.push(...colorTriplet);\n }\n this.addVertexColors(colorsArray);\n } else {\n let colorsArray = [];\n for (let i=0; i < layout.length; i++) {\n colorsArray.push(1.0, 1.0, 1.0);\n }\n this.addVertexColors(colorsArray);\n }\n } else {\n // For now, if server fails. Render fake data.\n if (this.props.decomposition) {\n let fakeNodePositions = this.createFakeNodePositions();\n let fakeEdgeIndices = this.createFakeEdges(fakeNodePositions);\n this.createGeometry(fakeNodePositions, fakeEdgeIndices);\n let fakeNodeColors = this.createFakeNodeColors();\n this.addVertexColors(fakeNodeColors);\n }\n }\n this.updateBuffers();\n requestAnimationFrame(this.drawScene.bind(this));\n }.bind(this));\n }", "title": "" }, { "docid": "0e4a60568c8e0040c761f9a0fdf6c7a7", "score": "0.56193554", "text": "async function makeMesh(vor, ctx, [Wkm, Hkm], [Wpx, Hpx]) {\n\n console.time('makeMesh')\n\n let mesh = Object.create(vor.__proto__);\n Object.assign(mesh, vor);\n Object.assign(mesh, vor.delaunay)\n const { halfedges, points, triangles } = mesh\n\n mesh.Dkm = [Wkm, Hkm]\n mesh.Dpx = [Wpx, Hpx]\n mesh.km2px = Wpx / Wkm\n mesh.px2km = Wkm / Wpx\n mesh.extent = [+vor.xmax - +vor.xmin, +vor.ymax - +vor.ymin]\n mesh.ctx = ctx\n\n mesh.pt_km2px = ([x, y]) => [x * mesh.km2px, y * mesh.km2px]\n\n\n // calculate valid triangle ids (ie not slivers)\n let [triIDs, invTriIDs] = calcTriIDs(mesh)\n mesh.triIDs = triIDs\n mesh.invTriIDs = invTriIDs\n console.log(invTriIDs)\n console.table(mesh.invTriIDs)\n\n\n // adjacent tris to each tri\n let adj = calcAdj(mesh)\n mesh.adj = adj\n\n\n console.time('everything else in makeMesh')\n mesh.zero = () => {\n let arr = new Array(mesh.triIDs.length)\n arr.fill(0.0)\n return arr;\n }\n\n // get i-th triangle vertex\n // associated with mesh.triangles[] NOT new triIDs\n mesh.point_km = i => {\n return [points[i * 2], points[i * 2 + 1]]\n }\n\n mesh.points_px = mesh.points.map(x => x * mesh.km2px)\n mesh.point_px = i => {\n return [mesh.points_px[i * 2], mesh.points_px[i * 2 + 1]]\n }\n\n mesh.triPaths = Array.from(mesh.triIDs)\n .map(v => mesh.delaunay.trianglePolygon(v))\n mesh.hullPoly = mesh.delaunay.hullPolygon()\n\n let centroids = mesh.triPaths.map(centroid)\n let centroids_px = centroids.map(mesh.pt_km2px)\n\n mesh.vorCentroids = Array.from(mesh.cellPolygons())\n .map(centroid)\n\n mesh.centroids = centroids\n mesh.centroids_px = centroids_px\n mesh.normPts = calcNormPts(mesh)\n\n\n mesh.map = (f) => {\n let mapped = new Array(mesh.adj.length)\n for (let i = 0; i < mapped.length; i++) {\n mapped[i] = f(centroids[i], i, mesh)\n }\n mapped.mesh = mesh;\n return mapped;\n }\n\n mesh.isEdge = i => !adj[i] || adj[i].length < 3\n mesh.isNearEdge = (i, thresh = 0.05) => {\n let c = mesh.centroids[i]\n if (!c) return\n let [x,y] = c\n let [w, h] = mesh.Dkm;\n return mesh.isEdge(i) || x < thresh * w || x > (1.0 - thresh) * w || y < thresh * h || y > (1.0 - thresh) * h;\n }\n\n\n mesh.distance = (i, j) => {\n const [ix, iy] = mesh.centroids[i]\n const [jx, jy] = mesh.centroids[j]\n return Math.sqrt((ix - jx) * (ix - jx) + (iy - jy) * (iy - jy))\n }\n\n // TODO use km not norm\n mesh.trislope = triSlope(mesh)\n\n\n const triPathsPx = mesh.triPaths.map(mesh.pt_km2px)\n mesh = genRenderFns(mesh, ctx)\n\n\n console.timeEnd('everything else in makeMesh')\n console.timeEnd('makeMesh')\n console.log(mesh)\n return mesh;\n\n}", "title": "" }, { "docid": "3a80a2fab393b2259032a6aadab6044f", "score": "0.55169016", "text": "addNode(...objs) {\n if (objs.length > 1) {\n objs.forEach(o => this.addNode(o))\n return\n }\n let g = objs[0]\n const fig = this.figure\n for (let i = 0; i < this.nodes.length; i++) {\n if (g === this.nodes[i].object()) {\n return this.nodes[i]\n }\n }\n g = new NodePos(g, this)\n // nodes would like to be far apart\n const cr = fig.canvasRect(),\n sz = fig.min(cr.w(), cr.h()),\n n = this.numExtraDims + 2\n for (let i = 0; i < this.nodes.length; i++) {\n let g2 = this.nodes[i],\n dist = fig.distance(g2, g, n),\n // dist = fig.sq(fig.minus(g2, g)),\n clamped_dist = new Conditional(new Minus(dist, REPULSION_CLAMP_DIST),\n dist,\n new Average(dist, REPULSION_CLAMP_DIST)),\n bdist = new Min(clamped_dist, cr.w(), cr.h()),\n // repulsion cuts off at canvas size\n potential = fig.divide(this.repulsion * this.sparsity,\n clamped_dist\n // new DebugExpr(\"bdist(\" + g + \",\" + g2 +\")\", bdist)\n )\n // potential = new DebugExpr(\"potential between \" + g + \" and \" + g2, potential)\n fig.costEqual(this.cost, potential, 0)\n }\n if (this.effectiveDimensionFunction) {\n // Add the \"squeeze\" loss to keep nodes inside the effective dimensionality\n let dimension = new Global(v => (this.effectiveDimensionFunction)(v), \"dimension\")\n for (let d = 2; d < n; d++) {\n const x = fig.minus(d, dimension),\n x2 = fig.minus(1, x);\n new Loss(fig, new Conditional(x,\n fig.times(fig.sq(fig.projection(g, d, n)),\n new Conditional(x2,\n fig.times(DIM_COST, fig.divide(x, x2)),\n LARGE_DIM_COST)),\n 0))\n }\n }\n this.nodes.push(g)\n // but keep the node inside the figure\n fig.keepInside(g, cr)\n return g\n }", "title": "" }, { "docid": "d3f7d66a4c0f1d60de62b901198785f2", "score": "0.5514766", "text": "function n(e,r){r.instanced&&r.instancedDoublePrecision&&(e.attributes.add(\"modelOriginHi\",\"vec3\"),e.attributes.add(\"modelOriginLo\",\"vec3\"),e.attributes.add(\"model\",\"mat3\"),e.attributes.add(\"modelNormal\",\"mat3\")),r.instancedDoublePrecision&&(e.vertex.include(_util_DoublePrecision_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"DoublePrecision\"],r),e.vertex.uniforms.add(\"viewOriginHi\",\"vec3\"),e.vertex.uniforms.add(\"viewOriginLo\",\"vec3\"));const n=[_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec3 calculateVPos() {\n ${r.instancedDoublePrecision?\"return model * localPosition().xyz;\":\"return localPosition().xyz;\"}\n }\n `,_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec3 subtractOrigin(vec3 _pos) {\n ${r.instancedDoublePrecision?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec3 originDelta = dpAdd(viewOriginHi, viewOriginLo, -modelOriginHi, -modelOriginLo);\n return _pos - originDelta;`:\"return vpos;\"}\n }\n `,_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec3 dpNormal(vec4 _normal) {\n ${r.instancedDoublePrecision?\"return normalize(modelNormal * _normal.xyz);\":\"return normalize(_normal.xyz);\"}\n }\n `,_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec3 dpNormalView(vec4 _normal) {\n ${r.instancedDoublePrecision?\"return normalize((viewNormal * vec4(modelNormal * _normal.xyz, 1.0)).xyz);\":\"return normalize((viewNormal * _normal).xyz);\"}\n }\n `,r.vertexTangets?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]`\n vec4 dpTransformVertexTangent(vec4 _tangent) {\n ${r.instancedDoublePrecision?\"return vec4(modelNormal * _tangent.xyz, _tangent.w);\":\"return _tangent;\"}\n\n }\n `:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_1__[\"glsl\"]``];e.vertex.code.add(n[0]),e.vertex.code.add(n[1]),e.vertex.code.add(n[2]),2===r.output&&e.vertex.code.add(n[3]),e.vertex.code.add(n[4])}", "title": "" }, { "docid": "df4e7922bb839c497177c3790a718f22", "score": "0.5497041", "text": "componentWillMount() {\n const { selectedDesigns, activeDesigns } = this.props;\n if (!this.props.decomposition) {\n return;\n }\n let { datasetId, k, persistenceLevel } = this.props.decomposition;\n let category = this.props.decomposition.decompositionCategory;\n let field = this.props.decomposition.decompositionField;\n this.client\n .fetchGraphEmbedding(datasetId, category, field, k, persistenceLevel)\n .then(function(result) {\n if (result.embedding && result.embedding.layout) {\n let layout = result.embedding.layout;\n let adjacency = result.embedding.adjacency;\n this.createGeometry(layout, adjacency, 0.02, 0.02);\n\n if (this.props.qoi) {\n let min = Math.min(...this.props.qoi);\n let max = Math.max(...this.props.qoi);\n let color = d3.scaleLinear()\n .domain([min, 0.5*(min+max), max])\n .range(['white', '#b53f51']);\n let colorsArray = [];\n for (let i = 0; i < this.props.qoi.length; i++) {\n if (selectedDesigns.has(i)) {\n colorsArray.push((63/255), (81/255), (181/255));\n } else if (activeDesigns.has(i)) {\n let colorString = color(this.props.qoi[i]);\n let colorTriplet = colorString.match(/([0-9]+\\.?[0-9]*)/g);\n colorTriplet[0] /= 255;\n colorTriplet[1] /= 255;\n colorTriplet[2] /= 255;\n colorsArray.push(...colorTriplet);\n } else {\n colorsArray.push((211/255), (211/255), (211/255));\n }\n }\n this.addVertexColors(colorsArray);\n } else {\n let colorsArray = [];\n for (let i=0; i < layout.length; i++) {\n if (selectedDesigns.has(i)) {\n colorsArray.push((63/255), (81/255), (181/255));\n } else if (activeDesigns.has(i)) {\n colorsArray.push(1.0, 1.0, 1.0);\n } else {\n colorsArray.push((211/255), (211/255), (211/255));\n }\n }\n this.addVertexColors(colorsArray);\n }\n } else {\n if (this.props.decomposition) {\n let errorMessage = 'No decomposition layout provided.';\n this.refs.errorDialog.reportError(errorMessage);\n } else {\n let errorMessage = 'No decomposition provided.';\n this.refs.errorDialog.reportError(errorMessage);\n }\n }\n this.updateBuffers();\n requestAnimationFrame(this.renderGL);\n }.bind(this));\n }", "title": "" }, { "docid": "5d52efcf3595128a1c4a902ea8e43fbd", "score": "0.5467202", "text": "static get_mesh( name, json, bin, inc_data=false ){\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t// Search for Mesh Name\n\t\tlet i, mesh = null, mesh_idx=0;\n\t\tfor( i=0; i < json.meshes.length; i++ ){\n\t\t\tif( json.meshes[i].name == name ){\n\t\t\t\tmesh\t\t= json.meshes[ i ];\n\t\t\t\tmesh_idx\t= i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif( !mesh ){ console.log( \"Unable to find mesh by the nane : %s\", name ); return null; }\n\t\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t// Find if there is any nodes using the mesh.\n\t\tlet n, node = null;\n\t\tfor( n of json.nodes ){\n\t\t\tif( n.mesh == mesh_idx ){ node = n; break; }\n\t\t}\n\t\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\tlet prim, attr, itm,\n\t\t\tprim_len\t= mesh.primitives.length,\n\t\t\tary\t\t\t= new Array();\n\t\n\t\t//console.log( mesh );\n\t\tfor( prim of mesh.primitives ){\n\t\t\t//-------------------------------------------\n\t\t\tattr\t= prim.attributes;\n\t\t\titm\t\t= {\n\t\t\t\tname\t\t: name + (( prim_len != 1 )? \"_p\" + i : \"\"),\n\t\t\t\tdraw_mode \t: ( prim.mode != undefined )? prim.mode : Gltf.MODE_TRIANGLES,\n\t\t\t};\n\t\n\t\t\t//-------------------------------------------\n\t\t\t// Save Position, Rotation and Scale if Available.\n\t\t\tif( node ){\n\t\t\t\tif( node.translation )\titm.position\t= node.translation.slice( 0 );\n\t\t\t\tif( node.rotation )\t\titm.rotation\t= node.rotation.slice( 0 );\n\t\t\t\tif( node.scale )\t\titm.scale\t\t= node.scale.slice( 0 );\n\t\t\t}\n\n\t\t\t//-------------------------------------------\n\t\t\t// Get Primitive\n\t\t\titm.vertices = this.parse_accessor( attr.POSITION, json, bin, inc_data );\n\t\t\tif( prim.indices != undefined ) itm.indices\t= this.parse_accessor( prim.indices,\tjson, bin, inc_data );\n\t\t\tif( attr.NORMAL )\t\titm.normal\t= this.parse_accessor( attr.NORMAL,\t\tjson, bin, inc_data );\n\t\t\tif( attr.TEXCOORD_0 )\titm.uv\t\t= this.parse_accessor( attr.TEXCOORD_0,\tjson, bin, inc_data );\n\t\t\tif( attr.WEIGHTS_0 )\titm.weights\t= this.parse_accessor( attr.WEIGHTS_0,\tjson, bin, inc_data ); \n\t\t\tif( attr.JOINTS_0 )\t\titm.joints\t= this.parse_accessor( attr.JOINTS_0,\tjson, bin, inc_data );\n\t\t\tif( attr.COLOR_0 )\t\titm.color\t= this.parse_accessor( attr.COLOR_0,\tjson, bin, inc_data );\n\t\n\t\t\tary.push( itm )\n\t\t}\n\t\n\t\treturn ary;\n\t}", "title": "" }, { "docid": "feb214c233e08dc3c6317c9e22082338", "score": "0.5431841", "text": "RecalculateNormals() {}", "title": "" }, { "docid": "fc0867e476078cd85fcf652da17f4bcf", "score": "0.54079044", "text": "mesh_loaded(mesh)\n {\n // console.log(this.m_waiting_list_mesh.get(mesh.m_name))\n\n // this.m_meshes.set(mesh.m_name, mesh) \n\n if(this.m_waiting_list_mesh.get(mesh.m_name))\n {\n // let start = performance.now()\n for (var i = 0; i < this.m_waiting_list_mesh.get(mesh.m_name).length; i++)\n // for(const object of this.m_waiting_list_mesh.get(mesh.m_name))\n {\n let object = this.m_waiting_list_mesh.get(mesh.m_name)[i];\n object.mesh = mesh;\n // console.log(object.name + ' got custom mesh ')\n }\n // console.log(performance.now()-start)\n this.m_waiting_list_mesh.delete(mesh.m_name) \n }\n\n }", "title": "" }, { "docid": "ef1badbad0100a28de07d8f6c351d4f8", "score": "0.5407308", "text": "function demoGeometry_610(g)\n{\n return (offX, offY, offZ, scl) => colorGeometry_559 // (Func Mesh Mesh)\n (scale_2116 // (Func Mesh Float3 Mesh)\n (translate_2087 // (Func Mesh Float3 Mesh)\n (g // Mesh\n ,vector_98 // [(Func Float2 Float3) | (Func Float Float Float Float3) | (Func Float Float3) | (Func (Array Float) Float3)]\n (offX // Float\n ,offY // Float\n ,offZ // Float\n ) // Float3\n ) // Mesh\n ,vector_98 // [(Func Float2 Float3) | (Func Float Float Float Float3) | (Func Float Float3) | (Func (Array Float) Float3)]\n (scl // Float\n ,scl // Float\n ,scl // Float\n ) // Float3\n ) // Mesh\n ) // Mesh\n // (Func Float Float Float Float Mesh)\n ;\n}", "title": "" }, { "docid": "b60a627b2a8215859c808cfb036e9292", "score": "0.53952295", "text": "function forceLayoutComplete(el, data) {\r\n\t\r\n\t\r\n\tvar thisObject = el.components[\"forcegraph3d\"].data;\r\n\t\r\n\t// Find min and max values for all axes\r\n\tstats = {};\r\n\t\r\n\tstats.minfX = d3.min(data.nodes, d => d.fx);\r\n\tstats.minfY = d3.min(data.nodes, d => d.fy);\r\n\tstats.minfZ = d3.min(data.nodes, d => d.fz);\r\n\tstats.maxfX = d3.max(data.nodes, d => d.fx);\r\n\tstats.maxfY = d3.max(data.nodes, d => d.fy);\r\n\tstats.maxfZ = d3.max(data.nodes, d => d.fz);\r\n\tstats.minX = d3.min(data.nodes, d => d.x);\r\n\tstats.minY = d3.min(data.nodes, d => d.y);\r\n\tstats.minZ = d3.min(data.nodes, d => d.z);\r\n\tstats.maxX = d3.max(data.nodes, d => d.x);\r\n\tstats.maxY = d3.max(data.nodes, d => d.y);\r\n\tstats.maxZ = d3.max(data.nodes, d => d.z);\r\n\t\r\n\t\r\n\tif (data.links[0][thisObject.valField]) {\r\n\t\tstats.linkMinVal = d3.min(data.links, d => d[thisObject.valField]);\r\n\t\tstats.linkMaxVal = d3.max(data.links, d => d[thisObject.valField]);\r\n\t\tstats.scaleLinkValueV = d3.scaleLinear().domain([stats.linkMinVal, stats.linkMaxVal]).range([.05, 1]);\r\n\t\t\r\n\t\tstats.minV = d3.min(data.nodes, d => d[thisObject.valField]);\r\n\t\tstats.maxV = d3.max(data.nodes, d => d[thisObject.valField]);\r\n\t\tstats.scaleV = d3.scaleLinear().domain([stats.minV, stats.maxV]).range([thisObject.nodeMinSize, thisObject.nodeMaxSize])\r\n\t\tstats.scaleV01 = d3.scaleLinear().domain([stats.minV, stats.maxV]).range([0,1])\r\n\t\t\r\n\t} else {\r\n\t\tstats.linkMinVal = 0\r\n\t\tstats.linkMaxVal = 1;\r\n\t\tstats.scaleLinkValueV = xxx => null;\r\n\t\t\r\n\t\tstats.scaleV = xxx => thisObject.nodeMaxSize/2; // Default radius = 0.5\r\n\t\tstats.scaleV01 = xxx => 1;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\tstats.scaleX = d3.scaleLinear().domain([stats.minX, stats.maxX]).range([0, thisObject.width])\r\n\tstats.scaleY = d3.scaleLinear().domain([stats.minY, stats.maxY]).range([0, thisObject.height])\r\n\tstats.scaleZ = d3.scaleLinear().domain([stats.minZ, stats.maxZ]).range([0, thisObject.depth])\r\n\r\n\tstats.scalefX = d3.scaleLinear().domain([stats.minfX, stats.maxfX]).range([0, thisObject.width])\r\n\tstats.scalefY = d3.scaleLinear().domain([stats.minfY, stats.maxfY]).range([0, thisObject.height])\r\n\tstats.scalefZ = d3.scaleLinear().domain([stats.minfZ, stats.maxfZ]).range([0, thisObject.depth])\r\n\t\t\r\n\t\r\n\r\n\t// Normalize the node coordinates so we fit inside the depth x width x height box specified by the AFrame component\r\n\tfor (var i=0; i<data.nodes.length; i++){\r\n\t\tlet node = data.nodes[i];\r\n\t\t\r\n\t\tnode.x = stats.scaleX(node.x);\r\n\t\tnode.y = stats.scaleY(node.y);\r\n\t\tnode.z = stats.scaleZ(node.z);\r\n\t\t\r\n\t\tnode.fx = stats.scalefX(node.fx);\r\n\t\tnode.fy = stats.scalefY(node.fy);\r\n\t\tnode.fz = stats.scalefZ(node.fz);\r\n\t\t\r\n\t\tnode[thisObject.valField] = stats.scaleV(node[thisObject.valField] );\r\n\t\t\r\n\t\tif (!isFinite(node.z)) node.z = 0; // BAD!\r\n\t\t\r\n\t\tdata.nodes[i] = node;\r\n\t}\r\n\r\n\t\r\n\t\r\n\tconsole.log(data.nodes[3].x);\r\n\tconsole.log(data.nodes[3].y);\r\n\tconsole.log(data.nodes[3].z);\r\n\tconsole.log(data.nodes[3].fx);\r\n\tconsole.log(data.nodes[3].fy);\r\n\tconsole.log(data.nodes[3].fz);\r\n\tconsole.log(data.nodes[3][thisObject.valField]);\r\n\t\r\n\tlet nodes = d3.select('a-scene').selectAll(thisObject.nodeSprite ?'a-image.node' : 'a-sphere.node').data(data.nodes, d=> d._id);\r\n\tnodes.exit().remove();\r\n\t\r\n\t// Shall we construct node labels?\r\n\tnodelabels = null;\r\n\tif (data.nodes[0][\"name\"]) {\r\n\t\tnodelabels = d3.select('a-scene').selectAll('a-entity.nodelabel').data(data.nodes, d=> d._id);\r\n\t\tnodelabels.exit().remove();\r\n\t}\r\n\t\r\n\t\r\n\tthisObject.valAccessor = node => node[thisObject.valField]; // any resizing with cbrt should go here, or better, above in the scaling section\r\n\tthisObject.nameAccessor = node => node[thisObject.nameField];\r\n\tthisObject.colorAccessor = node => node[thisObject.colorField];\r\n\r\n\tif (thisObject.nodeSprite) {\r\n\t\tnodes = nodes.merge(\r\n\t\t\tnodes.enter()\r\n\t\t\t\t.append('a-image')\r\n\t\t\t\t.classed('node', true)\r\n\t\t\t\t.attr('src', thisObject.nodeSprite)\r\n\t\t\t\t.attr('transparent', true)\r\n\t\t\t\t.attr('width', d => thisObject.valAccessor(d))\r\n\t\t\t\t.attr('height', d =>thisObject.valAccessor(d))\r\n\t\t\t\t.attr('position', d => [d.x, d.y, d.z].join(\" \"))\r\n\t\t\t\t);\r\n\t} else {\r\n\t\tnodes = nodes.merge(\r\n\t\t\tnodes.enter()\r\n\t\t\t\t.append('a-sphere')\r\n\t\t\t\t.classed('node', true)\r\n\t\t\t\t.attr('segments-width', AFRAME.utils.device.isMobile () ? 3 : 8)\t// Lower geometry resolution to improve perf\r\n\t\t\t\t.attr('segments-height',AFRAME.utils.device.isMobile () ? 3 : 8 )\r\n\t\t\t\t.attr('radius', d => thisObject.valAccessor(d)/2)\r\n\t\t\t\t.attr('color', d => '' + (thisObject.colorAccessor(d) || thisObject.defaultNodeColor).toString(16))\r\n//\t\t\t\t.attr('lambertoon-material', \"dummy:1\")\r\n//\t\t\t\t.attr('material', null)\r\n\t\t\t\t.attr('position', d => [d.x, d.y, d.z].join(\" \"))\r\n\t\t\t\t.attr('opacity', 0.8)\r\n\t\t);\r\n\t\tif (AFRAME.utils.device.isMobile) \r\n\t\t\tnodes.enter().attr('material','shader:flat; wireframe: true')\r\n\r\n\t} // render the nodes as spheres or sprites\r\n\t\r\n\t\r\n\tif (nodelabels)\r\n\t\tnodelabels = nodelabels.merge(\r\n\t\t\tnodelabels.enter()\r\n\t\t\t\t.append('a-entity')\r\n\t\t\t\t.classed('nodelabel', true)\r\n\t\t\t\t.attr('text', d => \"value:\" + d.name + \"; color:\" + thisObject.labelColor +\" ; align:center\")\r\n\t\t\t\t.attr('position', d => [d.x, d.y - 1.5*thisObject.valAccessor(d)/2, d.z].join(\" \")) // Move the label down 150% of the radius away from the center of the sphere\r\n\t\t\t\t\r\n\t\t\t\t//TODO finish tweaking these scaling params\r\n\t\t\t\t.attr('scale', d => [thisObject.width * thisObject.labelScaleFactor + (3*(stats.scaleV01(thisObject.valAccessor(d)))) , thisObject.height * thisObject.labelScaleFactor +(3*(stats.scaleV01(thisObject.valAccessor(d)))) , 1].join(\" \"))\r\n\t\t);\r\n\t\r\n\t\r\n\t\r\n\r\n\tlet links = d3.select('a-scene').selectAll('a-entity.link').data(data.links, d => d._id);\r\n\tlinks.exit().remove();\r\n\r\n\tlinks = links.merge(\r\n\tlinks.enter()\r\n\t\t.append('a-entity')\r\n\t\t.classed('link', true)\r\n\t\t.attr('line', d => `color: #f0f0f0; opacity: ${thisObject.lineOpacity || stats.scaleLinkValueV(d[thisObject.valField]) || 1}; start: ${d.source.x} ${d.source.y || 0} ${d.source.z || 0}; end: ${d.target.x} ${d.target.y || 0} ${d.target.z || 0}`)\r\n\t);\r\n\t\r\n\t\t\r\n}", "title": "" }, { "docid": "7c1ee645790bc1bd9287aa652da823c3", "score": "0.5385995", "text": "static graph(f,options) { if (!f) return; var origf=f; options=options||{}; options.scale=options.scale||1; options.camera=options.camera||new Element([0.7071067690849304, 0, 0, 0, 0, 0, 0, 0, 0, 0.7071067690849304, 0, 0, 0, 0, 0, 0]); var ww=options.width, hh=options.height, cvs=options.canvas, tpcam=new Element([0,0,0,0,0,0,0,0,0,0,0,-5,0,0,1,0]),tpy=this.Coeff(4,1),tp=new Element(), project=(o)=>{ if (!o) return o; while (o.call) o=o(); return (tot==4 && (o.length==16))?(tpcam).Vee(options.camera.Mul(o).Mul(options.camera.Conjugate)).Wedge(tpy):o};\n // p2d SVG points/lines/rotations/translations/labels . \n if (!(f instanceof Function) || f.length===0) { var lx,ly,lr,color,res,anim=false,to2d=(tot==3)?[0,1,2,3,4,5,6,7]:[0,7,9,10,13,12,14,15];\n if (f instanceof Function) f=f();if (!(f instanceof Array)) f=[].concat.apply([],Object.keys(f).map((k)=>typeof f[k]=='number'?[f[k]]:[f[k],k])); \n function build(f,or) { if (or && f && f instanceof Function) f=f(); lx=-2;ly=-1.85;lr=0;color='#444'; var svg=new DOMParser().parseFromString(`<SVG onmousedown=\"if(evt.target==this)this.sel=undefined\" viewBox=\"-2 -${2*(hh/ww||1)} 4 ${4*(hh/ww||1)}\" style=\"width:${ww||512}px; height:${hh||512}px; background-color:#eee; user-select:none\">\n ${options.grid?Array.apply([],{length:11}).map((x,xi)=>`<line x1=\"-10\" y1=\"${(xi-5)/2}\" x2=\"10\" y2=\"${(xi-5)/2}\" stroke-width=\"0.005\" stroke=\"#CCC\"/><line y1=\"-10\" x1=\"${(xi-5)/2}\" y2=\"10\" x2=\"${(xi-5)/2}\" stroke-width=\"0.005\" stroke=\"#CCC\"/>`):''}\n ${options.conformal?f.map&&f.map((o,oidx)=>{ if((o==Element.graph && or!==false)||(oidx==0&&options.animate&&or!==false)) { anim=true; requestAnimationFrame(()=>{var r=build(origf,(!res)||(document.body.contains(res))).innerHTML; if (res) res.innerHTML=r; }); if (!options.animate) return; }while (o.call) o=o();\n if (o instanceof Array) { lx=ly=lr=0; o=o.map(o=>{ while(o.call)o=o(); return o; }); o.forEach((o)=>{lx+=o.e1;ly+=-o.e2});lx/=o.length;ly/=o.length; return o.length>2?`<POLYGON STYLE=\"pointer-events:none; fill:${color};opacity:0.7\" points=\"${o.map(o=>(o.e1+','+(-o.e2)+' '))}\"/>`:`<LINE style=\"pointer-events:none\" x1=${o[0].e1} y1=${-o[0].e2} x2=${o[1].e1} y2=${-o[1].e2} stroke-width=\"0.005\" stroke=\"${color||'#888'}\"/>`; }\n if (typeof o =='string') { var res2=(o[0]=='_')?'':`<text x=\"${lx}\" y=\"${ly}\" font-family=\"Verdana\" font-size=\"0.1\" style=\"pointer-events:none\" fill=\"${color||'#333'}\" transform=\"rotate(${lr},${lx},${ly})\">&nbsp;${o}&nbsp;</text>`; ly+=0.14; return res2; }\n if (typeof o =='number') { color='#'+(o+(1<<25)).toString(16).slice(-6); return ''; };\n var b1=o.Blade(1).VLength>0.001,b2=o.Blade(2).VLength>0.001,b3=o.Blade(3).VLength>0.001; \n if (b1 && !b2 && !b3) { lx=o.e1; ly=-o.e2; lr=0; return res2=`<CIRCLE onmousedown=\"this.parentElement.sel=${oidx}\" cx=\"${lx}\" cy=\"${ly}\" r=\"0.03\" fill=\"${color||'green'}\"/>`; }\n else if (!b1 && !b2 && b3) { var isLine=Element.Coeff(4,1,3,-1).Dot(o).Length==0; \n if (isLine) { var loc=((Element.Coeff(4,-.5).Add(Element.Coeff(3,-.5))).Dot(o)).Div(o), att=(Element.Coeff(4,1,3,-1)).Dot(o); lx=-loc.e1; ly=loc.e2; lr=Math.atan2(att[8],att[7])/Math.PI*180; return `<LINE style=\"pointer-events:none\" x1=${lx-10} y1=${ly} x2=${lx+10} y2=${ly} stroke-width=\"0.005\" stroke=\"${color||'#888'}\" transform=\"rotate(${lr},${lx},${ly})\"/>`;};\n var loc=o.Div((Element.Coeff(4,1,3,-1)).Dot(o)); lx=-loc.e1; ly=loc.e2; var r=-o.Mul(o.Conjugate).s/(Element.Pow((Element.Coeff(4,1,3,-1)).Dot(o),2).s); r=r**0.5; return `<CIRCLE onmousedown=\"this.parentElement.sel=${oidx}\" cx=\"${lx}\" cy=\"${ly}\" r=\"${r}\" stroke-width=\"0.005\" fill=\"none\" stroke=\"${color||'green'}\"/>`; \n } else if (!b1 && b2 &&!b3) { \n lr=0; var ei=Element.Coeff(4,1,3,-1),eo=Element.Coeff(4,.5,3,.5), nix=o.Wedge(ei), sqr=o.Dot(o).s/nix.Dot(nix).s, r=Math.sqrt(Math.abs(sqr)), attitude=((ei.Wedge(eo)).Dot(nix)).Normalized.Mul(Element.Scalar(r)), pos=o.Div(nix); pos=pos.Div( pos.Dot(Element.Sub(ei))); \n lx=pos.e1; ly=-pos.e2; if (sqr<0) return `<CIRCLE onmousedown=\"this.parentElement.sel=${oidx}\" cx=\"${lx}\" cy=\"${ly}\" r=\"0.03\" stroke-width=\"0.005\" fill=\"none\" stroke=\"${color||'green'}\"/>`;\n lx=pos.e1+attitude.e1; ly=-pos.e2-attitude.e2; var res2=`<CIRCLE onmousedown=\"this.parentElement.sel=${oidx}\" cx=\"${lx}\" cy=\"${ly}\" r=\"0.03\" fill=\"${color||'green'}\"/>`;\n lx=pos.e1-attitude.e1; ly=-pos.e2+attitude.e2; return res2+`<CIRCLE onmousedown=\"this.parentElement.sel=${oidx}\" cx=\"${lx}\" cy=\"${ly}\" r=\"0.03\" fill=\"${color||'green'}\"/>`;\n }\n }):f.map&&f.map((o,oidx)=>{ if((o==Element.graph && or!==false)||(oidx==0&&options.animate&&or!==false)) { anim=true; requestAnimationFrame(()=>{var r=build(origf,(!res)||(document.body.contains(res))).innerHTML; if (res) res.innerHTML=r; }); if (!options.animate) return; } while (o instanceof Function) o=o(); o=(o instanceof Array)?o.map(project):project(o); if (o===undefined) return; \n if (o instanceof Array) { lx=ly=lr=0; o.forEach((o)=>{o=(o.call)?o():o; lx+=((drm[1]==6||drm[1]==14)?-1:1)*o[drm[2]]/o[drm[1]];ly+=o[drm[3]]/o[drm[1]]});lx/=o.length;ly/=o.length; return o.length>2?`<POLYGON STYLE=\"pointer-events:none; fill:${color};opacity:0.7\" points=\"${o.map(o=>((drm[1]==6||drm[1]==14)?-1:1)*o[drm[2]]/o[drm[1]]+','+o[drm[3]]/o[drm[1]]+' ')}\"/>`:`<LINE style=\"pointer-events:none\" x1=${((drm[1]==6||drm[1]==14)?-1:1)*o[0][drm[2]]/o[0][drm[1]]} y1=${o[0][drm[3]]/o[0][drm[1]]} x2=${((drm[1]==6||drm[1]==14)?-1:1)*o[1][drm[2]]/o[1][drm[1]]} y2=${o[1][drm[3]]/o[1][drm[1]]} stroke-width=\"0.005\" stroke=\"${color||'#888'}\"/>`; }\n if (typeof o =='string') { var res2=(o[0]=='_')?'':`<text x=\"${lx}\" y=\"${ly}\" font-family=\"Verdana\" font-size=\"0.1\" style=\"pointer-events:none\" fill=\"${color||'#333'}\" transform=\"rotate(${lr},0,0)\">&nbsp;${o}&nbsp;</text>`; ly+=0.14; return res2; }\n if (typeof o =='number') { color='#'+(o+(1<<25)).toString(16).slice(-6); return ''; };\n if (o[to2d[6]]**2 >0.0001) { lx=options.scale*o[drm[2]]/o[drm[1]]; if (drm[1]==6||drm[1]==14) lx*=-1; ly=options.scale*o[drm[3]]/o[drm[1]]; lr=0; var res2=`<CIRCLE onmousedown=\"this.parentElement.sel=${oidx}\" cx=\"${lx}\" cy=\"${ly}\" r=\"0.03\" fill=\"${color||'green'}\"/>`; ly-=0.05; lx-=0.1; return res2; }\n if (o[to2d[2]]**2+o[to2d[3]]**2>0.0001) { var l=Math.sqrt(o[to2d[2]]**2+o[to2d[3]]**2); o[to2d[2]]/=l; o[to2d[3]]/=l; o[to2d[1]]/=l; lx=0.5; ly=((drm[1]==6)?-1:-1)*o[to2d[1]]; lr=-Math.atan2(o[to2d[2]],o[to2d[3]])/Math.PI*180; var res2=`<LINE style=\"pointer-events:none\" x1=-10 y1=${ly} x2=10 y2=${ly} stroke-width=\"0.005\" stroke=\"${color||'#888'}\" transform=\"rotate(${lr},0,0)\"/>`; ly-=0.05; return res2; }\n if (o[to2d[4]]**2+o[to2d[5]]**2>0.0001) { lr=0; ly+=0.05; lx+=0.1; var res2=`<LINE style=\"pointer-events:none\" x1=${lx} y1=${ly} x2=${lx-o.e02} y2=${ly+o.e01} stroke-width=\"0.005\" stroke=\"${color||'#888'}\"/>`; ly=ly+o.e01/4*3-0.05; lx=lx-o.e02/4*3; return res2; }\n }).join()}`,'text/html').body; return svg.removeChild(svg.firstChild); };\n res=build(f); res.onmousemove=(e)=>{ if (res.sel===undefined || !e.buttons) return;var x=(e.clientX-res.getBoundingClientRect().left)/(res.getBoundingClientRect().width/4||128)-2,y=((e.clientY-res.getBoundingClientRect().top)/(res.getBoundingClientRect().height/4||128)-2)*(res.getBoundingClientRect().height/res.getBoundingClientRect().width||1); if (options.conformal) {f[res.sel][1]=x; f[res.sel][2]=-y; var l=x*x+y*y; f[res.sel][3]=0.5-l*0.5; f[res.sel][4]=0.5+l*0.5; } else {f[res.sel][drm[2]]=(drm[1]==6)?-x:x; f[res.sel][drm[3]]=y; f[res.sel][drm[1]]=1;} if (!anim) res.innerHTML=build(f).innerHTML; }; return res;\n } \n // 1d and 2d functions \n cvs=cvs||document.createElement('canvas'); if(ww)cvs.width=ww; if(hh)cvs.height=hh; var w=cvs.width,h=cvs.height,context=cvs.getContext('2d'), data=context.getImageData(0,0,w,h);\n if (f.length==2) for (var px=0; px<w; px++) for (var py=0; py<h; py++) { var res=f(px/w*2-1, py/h*2-1); res=res.buffer?[].slice.call(res):res.slice?res:[res,res,res]; data.data.set(res.map(x=>x*255).concat([255]),py*w*4+px*4); }\n else if (f.length==1) for (var px=0; px<w; px++) { var res=f(px/w*2-1); res=Math.round((res/2+0.5)*h); if (res > 0 && res < h-1) data.data.set([0,0,0,255],res*w*4+px*4); }\n return context.putImageData(data,0,0),cvs; \n }", "title": "" }, { "docid": "ddfddeb8957dd42fe96bc475f495b580", "score": "0.5375431", "text": "function World(meshInstances, meshList){\n this.meshList = meshList;\n if (meshInstances instanceof Object){\n \n if (meshInstances[0] instanceof Array){\n this.meshInstances = new Float32Array(7*meshInstances.length);\n for (var i in meshInstances){\n for (var j in meshInstances[i]){\n this.meshInstances[i*7 + j] = (meshInstances[i][j]);\n }\n }\n }\n else if((typeof meshInstances[0]) == \"number\"){\n this.meshInstances = new Float32Array(meshInstances.length);\n for (var i in meshInstances){\n this.meshInstances[i] = (meshInstances[i]); \n }\n }\n else{\n throw new Error('this.meshInstances argument is a wrongly formatted Array');\n }\n }\n \n else if (meshInstances instanceof Float32Array){\n this.meshInstances = meshInstances; //[(this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j+2]] - this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j]]), (this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j+2]+1] - this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j]+1]), v3, argb color] Must be a 32-bit unsigned integer array \n }\n else {\n throw new Error('this.meshInstances argument should be Array or Float32Array');\n }\n \n //Arrays where our buffer output goes : We start with a one-to-one mapping between object and buffer\n /*this.renderFaces = [];\n this.renderVertices = [];\n this.renderSortbuddy = [];*/\n //Quickly calculate size for render buffer\n \n //-------------------------Seperate into view object---------------------\n //build meshInstances\n //build meshList\n \n var totalVertices=0;\n var totalFaces=0;\n for (var i=0; i<this.meshInstances.length; i+=7){\n totalVertices+=(this.meshList[this.meshInstances[i+6]].vertices.size);\n totalFaces+=(this.meshList[this.meshInstances[i+6]].faces.size);\n //Push buffer for this object to renderFaces\n }\n var renderVertices = new Buffer('Float32', totalVertices);\n var renderFaces = new Buffer('Uint32', totalFaces);\n /*this.renderFaces.push(new IntBuffer((totalIndices)>>0, totalIndices/2));\n this.renderVertices.push(new FloatBuffer((totalVertices)>>0, totalVertices/2));\n //Divide by four Math.sin(this.meshInstances[i+5])e every face is 4 elements\n this.renderSortbuddy.push(new FloatBuffer(totalIndices/4)>>0, totalIndices/2);*/\n \n \n //Buffers for storing faces and vertices to be drawn\n //Computational vector used every iteration\n //Basically static globals within our render function\n var renderSortbuddy = new Buffer('Float32', Math.ceil(totalFaces/4));\n var cameraPosition = new Float32Array(3);\n var cameraDirection = new Float32Array(3);\n var cameraUp = new Float32Array(3);\n var cameraLeft = new Float32Array(3);\n var rotArray = new Float32Array(3);\n var rotMatrix = new Float32Array(9);\n var faceNormal = new Float32Array(3);\n \n //----------------------------------------------------------------------------\n //---- render\n //---- Puts everything together to render a scene\n this.render = function(cameraPositionArg, cameraDirectionArg, cameraUpArg, width, height, context){\n //Clear Buffers\n renderVertices.clear();\n renderFaces.clear();\n renderSortbuddy.clear();\n //Assign given inputs to faster typed arrays\n for (var i = 0;i<3;i++){\n cameraPosition[i] = cameraPositionArg[i]; \n cameraDirection[i] = cameraDirectionArg[i];\n cameraUp[i] = cameraUpArg[i];\n }\n \n \n for (var i=0;i<this.meshInstances.length;i+=7){\n //Calculate rotation Matrix for rotating mesh vertices by the yaw, pitch and roll stored in the mesh instances\n /*if (!(this.meshInstances[i+3] == this.meshInstances[i+4] == this.meshInstances[i+5] == 0)){*/\n rotMatrix[0] = Math.cos(this.meshInstances[i+3])*Math.cos(this.meshInstances[i+4]);\n rotMatrix[1] = Math.sin(this.meshInstances[i+4])*Math.sin(this.meshInstances[i+5])*Math.cos(this.meshInstances[i+3])-Math.sin(this.meshInstances[i+3])*Math.cos(this.meshInstances[i+5]);\n rotMatrix[2] = Math.sin(this.meshInstances[i+4])*Math.cos(this.meshInstances[i+5])*Math.cos(this.meshInstances[i+3])+Math.sin(this.meshInstances[i+3])*Math.sin(this.meshInstances[i+5]);\n rotMatrix[3] = Math.cos(this.meshInstances[i+4])*Math.sin(this.meshInstances[i+3]);\n rotMatrix[4] = Math.sin(this.meshInstances[i+3])*Math.sin(this.meshInstances[i+4])*Math.sin(this.meshInstances[i+5])+Math.cos(this.meshInstances[i+3])*Math.cos(this.meshInstances[i+5]);\n rotMatrix[5] = Math.sin(this.meshInstances[i+4])*Math.cos(this.meshInstances[i+5])*Math.sin(this.meshInstances[i+3])-Math.sin(this.meshInstances[i+5])*Math.cos(this.meshInstances[i+3]);\n rotMatrix[6] = -1*Math.sin(this.meshInstances[i+4]);\n rotMatrix[7] = Math.sin(this.meshInstances[i+5])*Math.cos(this.meshInstances[i+4]);\n rotMatrix[8] = Math.cos(this.meshInstances[i+4])*Math.cos(this.meshInstances[i+5]);\n //}\n //Actual mesh object referred to via this.meshList[this.meshInstances[i+6]]\n //if the mesh is in view (store meshInstance in meshInstancesInView), transform it's vertices(store), then sort it's frontward facing faces from closest vertex to farthest vertex(store). \n //sort meshInstancesInView accoring to their closest vertex, for each meshInstance in the resulting array draw faces, mapping to transformed verecies, in order\n \n //You crazy but u kinda cool\n for (var j=0;j<3;j++){\n cameraLeft[j] = cameraUp[(j+1)%3]*cameraDirection[(j+2)%3] - cameraUp[(j+2)%3]*cameraDirection[(j+1)%3];\n }\n //HoboMath.cross(cameraUp, cameraDirection, crossProdResutlt, 0);\n var z = Math.sqrt(cameraDirection[0]*(this.meshInstances[i]-cameraPosition[0])+cameraDirection[1]*(this.meshInstances[i+1]-cameraPosition[1])+cameraDirection[2]*(this.meshInstances[i+2]-cameraPosition[2]));\n var theta = Math.PI/4;\n\n //Find meshes certainly in front of our camera view, i.e. Clulling the ones behind\n if (z + this.meshList[this.meshInstances[i+6]].maxWidth > 0){\n //Find meshes in our feild of view, accounting for their width\n if ((width/2 + z*Math.sin(theta) + this.meshList[this.meshInstances[i+6]].maxWidth > Math.abs(cameraLeft[0]*(this.meshInstances[i]-cameraPosition[0])+cameraLeft[1]*(this.meshInstances[i+1]-cameraPosition[1])+cameraLeft[2]*(this.meshInstances[i+2] - cameraPosition[2]))) && (height/2 + z*Math.sin(theta) + this.meshList[this.meshInstances[i+6]].maxWidth > Math.abs(cameraUp[0]*(this.meshInstances[i]-cameraPosition[0])+cameraUp[1]*(this.meshInstances[i+1] - cameraPosition[1])+cameraUp[2]*(this.meshInstances[i+2] - cameraPosition[2])))){ \n var verticiesOffset = renderVertices.size/3;\n //transform all vertices to camera space, acconting for meshPositon\n for (var j=0;j<this.meshList[this.meshInstances[i+6]].vertices.size;j+=3){\n //represents vertex after being rotated\n rotArray[0]=this.meshList[this.meshInstances[i+6]].vertices.array[j]*rotMatrix[0] + this.meshList[this.meshInstances[i+6]].vertices.array[j+1]*rotMatrix[1] + this.meshList[this.meshInstances[i+6]].vertices.array[j+2]*rotMatrix[2];\n rotArray[1]=this.meshList[this.meshInstances[i+6]].vertices.array[j]*rotMatrix[3] + this.meshList[this.meshInstances[i+6]].vertices.array[j+1]*rotMatrix[4] + this.meshList[this.meshInstances[i+6]].vertices.array[j+2]*rotMatrix[5];\n rotArray[2]=this.meshList[this.meshInstances[i+6]].vertices.array[j]*rotMatrix[6] + this.meshList[this.meshInstances[i+6]].vertices.array[j+1]*rotMatrix[7] + this.meshList[this.meshInstances[i+6]].vertices.array[j+2]*rotMatrix[8];\n //cameraLeft[0]*(rotArray[0] + this.meshInstances[i] - cameraPosition[0])\n //check scaling as item moves away from camera\n z = cameraDirection[0]*(rotArray[0] + this.meshInstances[i] - cameraPosition[0]) + cameraDirection[1]*(rotArray[1] + this.meshInstances[i+1] - cameraPosition[1]) + cameraDirection[2]*(rotArray[2] + this.meshInstances[i+2] - cameraPosition[2]);\n renderVertices.push((cameraLeft[0]*(rotArray[0] + this.meshInstances[i] - cameraPosition[0]) + cameraLeft[1]*(rotArray[1] + this.meshInstances[i+1] - cameraPosition[1]) + cameraLeft[2]*(rotArray[2] + this.meshInstances[i+2] - cameraPosition[2]))/(width/2 + z*Math.sin(theta)));\n renderVertices.push((cameraUp[0]*(rotArray[0] + this.meshInstances[i] - cameraPosition[0]) + cameraUp[1]*(rotArray[1] + this.meshInstances[i+1] - cameraPosition[1]) + cameraUp[2]*(rotArray[2] + this.meshInstances[i+2] - cameraPosition[2]))/(height/2 + z*Math.sin(theta)));\n renderVertices.push(z);\n //Rotation matrix applied to renderVertices\n }\n for (var j=0;j<this.meshList[this.meshInstances[i+6]].faces.size;j+=4){\n //THIS IS THE PROBLEM -- Removed if faceprog > 0 and saw everything\n //HoboMath.cross(threeMinusOne, threeMinusTwo, crossProdResutlt,0);\n \n faceNormal[0] = (this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+1]+1] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+1])*(this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+2]+2] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+2]) - (this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+1]+2] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+2])*(this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+2]+1] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+1]);\n faceNormal[1] = (this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+1]+2] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+2])*(this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+2]] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]]) - (this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+1]] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]])*(this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+2]+2] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+2]);\n faceNormal[2] = (this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+1]] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]])*(this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+2]+1] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+1]) - (this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+1]+1] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]+1])*(this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j+2]] - this.meshList[this.meshInstances[i+6]].vertices.array[3*this.meshList[this.meshInstances[i+6]].faces.array[j]]);\n rotArray[0] = faceNormal[0]*rotMatrix[0] + faceNormal[1]*rotMatrix[1] + faceNormal[2]*rotMatrix[2];\n rotArray[1] = faceNormal[0]*rotMatrix[3] + faceNormal[1]*rotMatrix[4] + faceNormal[2]*rotMatrix[5];\n rotArray[2] = faceNormal[0]*rotMatrix[6] + faceNormal[1]*rotMatrix[7] + faceNormal[2]*rotMatrix[8];\n var faceProj = -1*(rotArray[0]*cameraDirection[0] + rotArray[1]*cameraDirection[1] + rotArray[2]*cameraDirection[2])/Math.sqrt(rotArray[0]*rotArray[0] + rotArray[1]*rotArray[1] + rotArray[2]*rotArray[2]);\n if (faceProj > 0){\n renderFaces.push(verticiesOffset + this.meshList[this.meshInstances[i+6]].faces.array[j]);\n renderFaces.push(verticiesOffset + this.meshList[this.meshInstances[i+6]].faces.array[j+1]);\n renderFaces.push(verticiesOffset + this.meshList[this.meshInstances[i+6]].faces.array[j+2]);\n renderFaces.push((this.meshList[this.meshInstances[i+6]].faces.array[j+3]&0xFF000000)|(((((this.meshList[this.meshInstances[i+6]].faces.array[j+3]&0x00FF0000) >> 16)*faceProj) >> 0) << 16)|(((((this.meshList[this.meshInstances[i+6]].faces.array[j+3]&0x0000FF00) >> 8)*faceProj) >> 0) << 8)|(((this.meshList[this.meshInstances[i+6]].faces.array[j+3]&0x000000FF)*faceProj) >> 0));\n }\n }\n }\n }\n }\n\n HoboMath.painsort(renderFaces, renderVertices, renderSortbuddy); //Using the qth set of renderVertices as the values, sort renderFaces\n //Draw to canvas\n var pixelWidth = context.canvas.clientWidth;\n var pixelHeight = context.canvas.clientHeight;\n for (var i=0;i<renderFaces.size;i+=4){\n //context.lineWidth=3; //LARGE LINES\n context.beginPath();\n context.moveTo((pixelWidth/2)*renderVertices.array[3*renderFaces.array[i]], -1*(pixelHeight/2)*renderVertices.array[3*renderFaces.array[i] + 1]);\n context.lineTo((pixelWidth/2)*renderVertices.array[3*renderFaces.array[i + 1]], -1*(pixelHeight/2)*renderVertices.array[3*renderFaces.array[i + 1] + 1]);\n context.lineTo((pixelWidth/2)*renderVertices.array[3*renderFaces.array[i + 2]], -1*(pixelHeight/2)*renderVertices.array[3*renderFaces.array[i + 2] + 1]);\n context.closePath();\n context.fillStyle = 'rgba(' + ((renderFaces.array[i + 3]&0x00FF0000) >> 16).toString() + ',' + ((renderFaces.array[i + 3]&0x0000FF00) >> 8).toString() + ',' + (renderFaces.array[i + 3]&0x000000FF).toString() + ',' + (((renderFaces.array[i + 3]&0xFF000000) >>> 24)/255).toString() + ')';\n context.fill(); \n }\n }\n \n}", "title": "" }, { "docid": "013821fd4d8cdbb2994f70ed5219e1f9", "score": "0.5348592", "text": "function Graph() {\n \n //varibales\n this.vert = [];\n this.nv = 0; \n this.ne = 0;\n this.digraph = false;\n this.weighted = false;\n this.dfs_push = [];\n this.bfs_order = [];\n this.label = \"\";\n this.connectedComp = 0;\n this.adjMatrix = [];\n this.listVerts = \"\";\n\n //methods\n this.readGraph = better_input;\n this.addEdge = addEdgeImpl2;\n this.printGraph = printGraphImpl;\n this.makeGraph = makeGraphImpl;\n this.dfs = dfsImpl;\n this.bfs = bfsImpl;\n this.makeAdjMatrix = makeAdjMatrixImpl2;\n this.isConnected = isConnectedImpl;\n this.componentInfo = componentInfoImpl;\n this.topoSearch = topoSearchImpl;\n\n // variables \n this.Counter = 1;\n\tthis.TcMatrix = [];\n\tthis.Warshall = [];\n\tthis.Floyd = [];\n\tthis.Prim_Edge = [];\n\n \n //methods\n this.hasPath = hasPathImpl; \n\tthis.shortestPath = shortestPathImpl; \n\tthis.isDAG = isDAGImpl;\n\tthis.WarshallFloyd = WarshallFloydImpl; \n\tthis.DfsTC = DfsTCImpl; \n this.Prim = PrimImpl;\n \n\n}", "title": "" }, { "docid": "2a550bda105c4fca1ad4a3d9e2f78da4", "score": "0.5317409", "text": "displayPlayground() {\n const geo = new THREE.PlaneGeometry(1, 1);\n geo.rotateX(-Math.PI / 2);\n const mat = new THREE.MeshBasicMaterial({\n color: 0x00FF00,\n transparent: true,\n opacity: 0.5,\n });\n\n let count = 0;\n for (let i = 0; i < this.grid.size[0]; i++) {\n for (let j = 0; j < this.grid.size[1]; j++) {\n const cell = this.grid.get({ x: i, y: j });\n\n if (cell) {\n const mesh = new THREE.Mesh(geo, mat);\n mesh.position.set(\n i - this.grid.size[0] / 2 + 0.5,\n cell.altitude + 0.2,\n j - this.grid.size[1] / 2 + 0.5,\n );\n count ++;\n this.add(mesh);\n }\n }\n }\n console.log('RATIO: ', count/1024);\n }", "title": "" }, { "docid": "463b2d1e860a0e993ccc847b74669c2a", "score": "0.5311835", "text": "function geometryTest_665()\n{\n return arrayFromJavaScript([demoGeometry_610 // (Func Mesh (Func Float Float Float Float Mesh))\n (sphere_1559 // [(Func Int Mesh) | (Func Mesh)]\n () // Mesh\n ) // (Func Float Float Float Float Mesh)\n ,demoGeometry_610 // (Func Mesh (Func Float Float Float Float Mesh))\n (cylinder_1635 // [(Func Int Mesh) | (Func Mesh)]\n () // Mesh\n ) // (Func Float Float Float Float Mesh)\n ,demoGeometry_610 // (Func Mesh (Func Float Float Float Float Mesh))\n (torus_1818 // [(Func Float Float Int Mesh) | (Func Mesh)]\n () // Mesh\n ) // (Func Float Float Float Float Mesh)\n ,demoGeometry_610 // (Func Mesh (Func Float Float Float Float Mesh))\n (klein_2460 // (Func Mesh)\n () // Mesh\n ) // (Func Float Float Float Float Mesh)\n ,demoGeometry_610 // (Func Mesh (Func Float Float Float Float Mesh))\n (plane_2600 // (Func Mesh)\n () // Mesh\n ) // (Func Float Float Float Float Mesh)\n ,demoGeometry_610 // (Func Mesh (Func Float Float Float Float Mesh))\n (mobius_2730 // (Func Mesh)\n () // Mesh\n ) // (Func Float Float Float Float Mesh)\n ]) // (Array (Func Float Float Float Float Mesh))\n ;\n}", "title": "" }, { "docid": "1cef21047acdf6f067d5dae7df032a8d", "score": "0.52736324", "text": "drawObjects(_fudgeNode, _matrix) {\n if (_fudgeNode.getComponentByName(\"Mesh\")) {\n let mesh = _fudgeNode.getComponentByName(\"Mesh\");\n let transform = _fudgeNode.getComponentByName(\"Transform\");\n let materialComponent = _fudgeNode.getComponentByName(\"Material\");\n materialComponent.Material.Shader.use();\n WebEngine.gl2.bindVertexArray(this.vertexArrayObjects[_fudgeNode.Name]);\n WebEngine.gl2.enableVertexAttribArray(materialComponent.Material.PositionAttributeLocation);\n // Compute the matrices\n let transformMatrix = transform.WorldMatrix;\n if (_fudgeNode.getComponentByName(\"Pivot\")) {\n let pivot = _fudgeNode.getComponentByName(\"Pivot\");\n transformMatrix = WebEngine.Mat4.multiply(pivot.Matrix, transform.WorldMatrix);\n }\n let objectViewProjectionMatrix = WebEngine.Mat4.multiply(_matrix, transformMatrix);\n // Supply matrixdata to shader. \n WebEngine.gl2.uniformMatrix4fv(materialComponent.Material.MatrixUniformLocation, false, objectViewProjectionMatrix.Data);\n // Draw call\n WebEngine.gl2.drawArrays(WebEngine.gl2.TRIANGLES, mesh.BufferSpecification.offset, mesh.VertexCount);\n }\n for (let name in _fudgeNode.getChildren()) {\n let childNode = _fudgeNode.getChildren()[name];\n this.drawObjects(childNode, _matrix);\n }\n }", "title": "" }, { "docid": "5b92f03dd77e442be17cd35a1d3fae8d", "score": "0.5265782", "text": "function mesh() {\n for(var i=0; i< N-1; i++) {\n for(var j=0; j< N-1; j++) {\n\n var a = vec4(2*i/N-1, 2*data[i][j]-1, 2*j/N-1, 1.0);\n var b = vec4(2*(i+1)/N-1, 2*data[(i+1)][j]-1, 2*j/N-1, 1.0);\n var c = vec4(2*(i+1)/N-1, 2*data[(i+1)][j+1]-1, 2*(j+1)/N-1, 1.0);\n var d = vec4(2*i/N-1, 2*data[i][j+1]-1, 2*(j+1)/N-1, 1.0);\n\n pointsArray.push( a);\n pointsArray.push( b);\n pointsArray.push( c);\n\n var t1 = subtract(b, a);\n var t2 = subtract(c, a);\n var normal = normalize(cross(t2, t1));\n normal = vec4(normal[0], normal[1], normal[2], 0.0);\n\n normalsArray.push(normal);\n normalsArray.push(normal);\n normalsArray.push(normal);\n\n pointsArray.push(c);\n pointsArray.push(d);\n pointsArray.push(a);\n\n t1 = subtract(d, c);\n t2 = subtract(a, c);\n normal = normalize(cross(t2, t1));\n normal = vec4(normal[0], normal[1], normal[2], 0.0);\n\n normalsArray.push(normal);\n normalsArray.push(normal);\n normalsArray.push(normal);\n\n index += 6;\n }\n }\n}", "title": "" }, { "docid": "02d1603251e17f621a41a104ce9b35ff", "score": "0.5262862", "text": "function rerenderGeom() {\n // Remove geometries from scene\n if(mesh) {\n scene.remove(mesh);\n geometry.dispose();\n material.dispose();\n }\n if(line) {\n scene.remove(line);\n wireframe.dispose();\n }\n\n //let max = 0;\n //let min = 300;\n\n // Create Plane Geometry\n geometry = new THREE.PlaneGeometry(params.xsize, params.ysize, params.segments, params.segments);\n for (let i = 0; i < geometry.vertices.length; i++) {\n switch(params.noiseFunc) {\n case 'OpenSimplex':\n geometry.vertices[i].z = params.maxHeight * dither((noise2D(geometry.vertices[i].x * params.xoff, geometry.vertices[i].y * params.yoff) + 1)/2, params.steps);\n break;\n case 'Worley':\n if(params.manhattan) {\n geometry.vertices[i].z = params.maxHeight * dither(worley.getManhattan({x:(geometry.vertices[i].x+(params.xsize/2))/params.xsize, y:(geometry.vertices[i].y+(params.ysize/2))/params.ysize}, 1), params.steps);\n }\n else {\n geometry.vertices[i].z = params.maxHeight * dither(worley.getEuclidean({x:(geometry.vertices[i].x+(params.xsize/2))/params.xsize, y:(geometry.vertices[i].y+(params.ysize/2))/params.ysize}, 1), params.steps);\n }\n break;\n default:\n geometry.vectices[i].z = 0;\n }\n //if(geometry.vertices[i].z > max) max = geometry.vertices[i].z;\n //if(geometry.vertices[i].z < min) min = geometry.vertices[i].z;\n }\n geometry.rotateX(-Math.PI / 2);\n geometry.computeFaceNormals();\n geometry.computeVertexNormals();\n //console.log(\"max:\" + max);\n //console.log(\"min:\" + min);\n\n // Handles wireframe mode\n if (params.wireframe) {\n wireframe = new THREE.WireframeGeometry(geometry);\n line = new THREE.LineSegments(wireframe);\n line.material.depthTest = false;\n line.material.opacity = 0.25;\n line.material.transparent = true;\n scene.add(line);\n return;\n }\n\n // Wireframe mode off, add Plane Geometry to scene\n material = new THREE.MeshPhongMaterial({\n side: THREE.DoubleSide,\n color: params.color,\n });\n mesh = new THREE.Mesh(geometry, material);\n scene.add(mesh);\n\n}", "title": "" }, { "docid": "1ea2c526a5cddcf50f60d05e12803f32", "score": "0.52613676", "text": "DistributeNodesInPlane_FORCES()\r\n\t{\r\n\t\tlet localAllNodes = this.allNodes;\r\n\t\tlet localAllNodesLength = localAllNodes.length;\r\n\t\t\r\n\t\t//rozlozime uzly do pocatecni pozice\r\n\t\tthis.DistributeNodesEvenlyInPlane_FORCES(localAllNodes);\r\n\t\t\r\n\t\t//provedeme predem dany pocet iteraci siloveho modelu\r\n\t\t// let numberOfIterations = 500;\r\n\t\tlet numberOfIterations = slider1.GetValue();\r\n\r\n\t\tfor (let i = 0; i < numberOfIterations; i++)\r\n\t\t{\r\n\t\t\tconsole.log(i);\r\n\t\t\tthis.CalculateSinglePhysicsStep_FORCES(localAllNodes);\r\n\t\t}\r\n\t\t\r\n\t\tlet edgeCoordinatesWithoutRadii = this.ReturnEdgeCoordinatesOfAllNodes(localAllNodes, localAllNodesLength);\r\n\t\t\r\n\t\t//zatim bez polomeru\r\n\t\t//maxX-minX\r\n\t\tlet graphWidth = edgeCoordinatesWithoutRadii[1]-edgeCoordinatesWithoutRadii[0];\r\n\t\t//maxY-minY\r\n\t\tlet graphHeight = edgeCoordinatesWithoutRadii[3]-edgeCoordinatesWithoutRadii[2];\r\n\t\t\r\n\t\tlet graphArea = graphWidth*graphHeight;\r\n\t\t\r\n\t\t//proporcialni k plose, ktera nalezi jednomu uzlu\r\n\t\tthis.areaPerNode = graphArea/localAllNodesLength;\r\n\t\t\r\n\t\t//podle faktoru vsem uzlum vypocitame polomer a zjisctime, jaky je nejvetsi (kvuli pozdejsi query do quadtree)\r\n\t\tthis.biggestRadius = 0;\r\n\t\tthis.smallestRadius = Infinity;\r\n\t\t\r\n\t\tlet actRadius;\r\n\t\tfor (let i = 0; i < localAllNodesLength; i++)\r\n\t\t{\r\n\t\t\tactRadius = localAllNodes[i].CalculateRadius_FORCES(this.areaPerNode);\r\n\t\t\t\r\n\t\t\tif (actRadius > this.biggestRadius)\r\n\t\t\t{\r\n\t\t\t\tthis.biggestRadius = actRadius;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (actRadius < this.smallestRadius)\r\n\t\t\t{\r\n\t\t\t\tthis.smallestRadius = actRadius;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tlocalAllNodes[i].CalculateFontParameters();\r\n\t\t}\r\n\t\t\r\n\t\t//dopocitame parametry transformace\r\n\t\tlet edgeCoordinatesWithRadii = this.ReturnEdgeCoordinatesOfAllNodesWithRadii(localAllNodes, localAllNodesLength);\r\n\t\tgraphWidth = edgeCoordinatesWithRadii[1]-edgeCoordinatesWithRadii[0];\r\n\t\tgraphHeight = edgeCoordinatesWithRadii[3]-edgeCoordinatesWithRadii[2];\r\n\t\t\r\n\t\tlet canvasWithoutBorderWidth = canvasWidth-this.border*2;\r\n\t\tlet canvasWithoutBorderHeight = canvasHeight-this.border*2;\r\n\t\t\r\n\t\tthis.translationTwoX = canvasWidth/2;\r\n\t\tthis.translationTwoY = canvasHeight/2;\r\n\t\t\r\n\t\tif (canvasWithoutBorderWidth/graphWidth > canvasWithoutBorderHeight/graphHeight)\r\n\t\t{\r\n\t\t\tthis.scaleOne = canvasWithoutBorderHeight/graphHeight;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.scaleOne = canvasWithoutBorderWidth/graphWidth;\r\n\t\t}\r\n\t\t\r\n\t\tthis.translationOneX = -(edgeCoordinatesWithRadii[0]+edgeCoordinatesWithRadii[1])/2;\r\n\t\tthis.translationOneY = -(edgeCoordinatesWithRadii[2]+edgeCoordinatesWithRadii[3])/2;\r\n\t\t\r\n\t\t//quadTree\r\n\t\t//DULEZITE - quadtree musi zahrnovat celou plochu canvasu + nejaky previs\r\n\t\t//mysi je mozne posunout uzly mimo original hranice grafu a i trochu za hranice canvasu\r\n\t\t//previs dame + 50% vysky/sirky - kdyby tam nahodou byl nejakej uzel s obrovskym polomerem\r\n\t\tlet quadTreeOriginX = (((-canvasWidth/2)-this.translationTwoX)/this.scaleOne)-this.translationOneX;\r\n\t\tlet quadTreeOriginY = (((-canvasHeight/2)-this.translationTwoY)/this.scaleOne)-this.translationOneY;\r\n\t\tlet quadTreeWidth = canvasWidth*2/this.scaleOne;\r\n\t\tlet quadTreeHeight = canvasHeight*2/this.scaleOne;\r\n\t\t\r\n\t\tthis.nodesQuadTree = new QuadTree([quadTreeOriginX, quadTreeOriginY], quadTreeWidth, quadTreeHeight, 1);\r\n\r\n\t\ttry \r\n\t\t{\r\n\t\t\tfor (let i = 0; i < localAllNodesLength; i++)\r\n\t\t\t{\r\n\t\t\t\tthis.nodesQuadTree.InsertPoint(localAllNodes[i].x, localAllNodes[i].y, localAllNodes[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(error) \r\n\t\t{\r\n\t\t\talert(\"Physics went unstable!\");\r\n\t\t\tthis.ClearGraph();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tthis.QueryNodesInView();\r\n\t}", "title": "" }, { "docid": "5eea1c47be5bf94697a5b964720751fa", "score": "0.5261367", "text": "updateColorGradient(){\n const body_data = body_meta_data.find(x => x[\"body name\"] === this.name);\n this.minSpeed = body_data[\"min speed\"];\n this.maxSpeed = body_data[\"max speed\"];\n this.colorGradient = new Float32Array(this.positionVectors.length * 3);\n let kmPosX = this.positionVectors.map(pos => Spacekit.auToKm(pos.x));\n let kmPosY = this.positionVectors.map(pos => Spacekit.auToKm(pos.y));\n let kmPosZ = this.positionVectors.map(pos => Spacekit.auToKm(pos.z));\n let kmPerSecList = [];\n let adjKmPerSec = [];\n //get max and min kmpersec and scale them between the max and min\n for(let i = 0; i < kmPosX.length-1; i++){\n let kmPerSec = Math.sqrt(Math.pow((kmPosX[i+1] - kmPosX[i]),2) + Math.pow((kmPosY[i+1] - kmPosY[i]),2) + Math.pow((kmPosZ[i+1] - kmPosZ[i]),2)) / (secondsPerDay * this._simulation.getJdDelta()) / this._simulation._options.unitsPerAu;\n kmPerSecList.push(kmPerSec);\n }\n for (let i = 0; i < kmPerSecList.length; i++) {\n let unscaled = kmPerSecList[i];\n let scaled = 0;\n // Bodies with larger orbit will have less accurate max and min, so +/- 0.5 on scaled speed \n if(this.name === \"saturn\" || this.name === \"jupiter\" || this.name === \"neptune\" || this.name === \"pluto\" || this.name === \"uranus\"){\n scaled = this.scaleBetween(unscaled, 0.0, 1.0, this.minSpeed-0.5, this.maxSpeed+0.5);\n }\n else{\n scaled = this.scaleBetween(unscaled, 0.0, 1.0, this.minSpeed, this.maxSpeed);\n }\n \n adjKmPerSec.push(parseFloat(scaled.toFixed(2)));\n }\n // Create the colors based on scaled numbers\n for(let i = 0; i < adjKmPerSec.length; i++){\n if(adjKmPerSec[i] >= 0.75){\n this.colorGradient[ i * 3 ] = adjKmPerSec[i];\n this.colorGradient[ i * 3 + 1 ] = 1-adjKmPerSec[i];\n this.colorGradient[ i * 3 + 2 ] = 1-adjKmPerSec[i];\n }\n else if(adjKmPerSec[i] > 0.5){\n this.colorGradient[ i * 3 ] = adjKmPerSec[i] + 0.25;\n this.colorGradient[ i * 3 + 1 ] = adjKmPerSec[i];\n this.colorGradient[ i * 3 + 2 ] = 1-adjKmPerSec[i];\n }\n else if(adjKmPerSec[i] > 0.25){\n this.colorGradient[ i * 3 ] = adjKmPerSec[i] + 0.5;\n this.colorGradient[ i * 3 + 1 ] = adjKmPerSec[i] + 0.5;\n this.colorGradient[ i * 3 + 2 ] = 1-adjKmPerSec[i];\n }\n else{\n this.colorGradient[ i * 3 ] = adjKmPerSec[i];\n this.colorGradient[ i * 3 + 1 ] = adjKmPerSec[i];\n this.colorGradient[ i * 3 + 2 ] = Math.abs(adjKmPerSec[i] - 1);\n }\n }\n }", "title": "" }, { "docid": "b1db4391eea98044cc11de9924730d2d", "score": "0.52598035", "text": "function update() {\r\n // Change size and color of all neurons\r\n for (var layerId = 0; layerId < model.layers.length; layerId++) {\r\n \tvar numberOfNodes = model.layers[layerId].nodes.length;\r\n for (var nodeId = 0; nodeId < numberOfNodes; nodeId++) {\r\n var elementId = nodeId + layerId * maxRows;\r\n var cubeHeight = model.layers[layerId].nodes[nodeId].y * 2;\r\n grid[elementId].scale.y = 0.01 + cubeHeight;\r\n var color = getColorHex(0.01 + cubeHeight);\r\n grid[elementId].material.color.setHex( color ); \r\n }\r\n }\r\n // Change size and color of expected output values\r\n var layerId = model.layers.length - 1;\r\n \tvar numberOfNodes = model.layers[layerId].nodes.length; \t \r\n for (var nodeId = 0; nodeId < numberOfNodes; nodeId++) {\r\n var elementId = nodeId + (layerId + 1) * maxRows;\r\n var cubeHeight = model.layers[layerId].nodes[nodeId].y_ex * 2;\r\n grid[elementId].scale.y = 0.01 + cubeHeight;\r\n var color = getColorHex(0.01 + cubeHeight);\r\n grid[elementId].material.color.setHex( color );\r\n }\r\n renderer.render(scene, camera);\r\n}", "title": "" }, { "docid": "0cf40dced5b2168283a1bdd873cff837", "score": "0.5255424", "text": "calculateTangentsAndBitangents() {\n console.assert(!!(this.vertices &&\n this.vertices.length &&\n this.vertexNormals &&\n this.vertexNormals.length &&\n this.textures &&\n this.textures.length), \"Missing attributes for calculating tangents and bitangents\");\n const unpacked = {\n tangents: [...new Array(this.vertices.length)].map(_ => 0),\n bitangents: [...new Array(this.vertices.length)].map(_ => 0),\n };\n // Loop through all faces in the whole mesh\n const indices = this.indices;\n const vertices = this.vertices;\n const normals = this.vertexNormals;\n const uvs = this.textures;\n for (let i = 0; i < indices.length; i += 3) {\n const i0 = indices[i + 0];\n const i1 = indices[i + 1];\n const i2 = indices[i + 2];\n const x_v0 = vertices[i0 * 3 + 0];\n const y_v0 = vertices[i0 * 3 + 1];\n const z_v0 = vertices[i0 * 3 + 2];\n const x_uv0 = uvs[i0 * 2 + 0];\n const y_uv0 = uvs[i0 * 2 + 1];\n const x_v1 = vertices[i1 * 3 + 0];\n const y_v1 = vertices[i1 * 3 + 1];\n const z_v1 = vertices[i1 * 3 + 2];\n const x_uv1 = uvs[i1 * 2 + 0];\n const y_uv1 = uvs[i1 * 2 + 1];\n const x_v2 = vertices[i2 * 3 + 0];\n const y_v2 = vertices[i2 * 3 + 1];\n const z_v2 = vertices[i2 * 3 + 2];\n const x_uv2 = uvs[i2 * 2 + 0];\n const y_uv2 = uvs[i2 * 2 + 1];\n const x_deltaPos1 = x_v1 - x_v0;\n const y_deltaPos1 = y_v1 - y_v0;\n const z_deltaPos1 = z_v1 - z_v0;\n const x_deltaPos2 = x_v2 - x_v0;\n const y_deltaPos2 = y_v2 - y_v0;\n const z_deltaPos2 = z_v2 - z_v0;\n const x_uvDeltaPos1 = x_uv1 - x_uv0;\n const y_uvDeltaPos1 = y_uv1 - y_uv0;\n const x_uvDeltaPos2 = x_uv2 - x_uv0;\n const y_uvDeltaPos2 = y_uv2 - y_uv0;\n const rInv = x_uvDeltaPos1 * y_uvDeltaPos2 - y_uvDeltaPos1 * x_uvDeltaPos2;\n const r = 1.0 / Math.abs(rInv < 0.0001 ? 1.0 : rInv);\n // Tangent\n const x_tangent = (x_deltaPos1 * y_uvDeltaPos2 - x_deltaPos2 * y_uvDeltaPos1) * r;\n const y_tangent = (y_deltaPos1 * y_uvDeltaPos2 - y_deltaPos2 * y_uvDeltaPos1) * r;\n const z_tangent = (z_deltaPos1 * y_uvDeltaPos2 - z_deltaPos2 * y_uvDeltaPos1) * r;\n // Bitangent\n const x_bitangent = (x_deltaPos2 * x_uvDeltaPos1 - x_deltaPos1 * x_uvDeltaPos2) * r;\n const y_bitangent = (y_deltaPos2 * x_uvDeltaPos1 - y_deltaPos1 * x_uvDeltaPos2) * r;\n const z_bitangent = (z_deltaPos2 * x_uvDeltaPos1 - z_deltaPos1 * x_uvDeltaPos2) * r;\n // Gram-Schmidt orthogonalize\n //t = glm::normalize(t - n * glm:: dot(n, t));\n const x_n0 = normals[i0 * 3 + 0];\n const y_n0 = normals[i0 * 3 + 1];\n const z_n0 = normals[i0 * 3 + 2];\n const x_n1 = normals[i1 * 3 + 0];\n const y_n1 = normals[i1 * 3 + 1];\n const z_n1 = normals[i1 * 3 + 2];\n const x_n2 = normals[i2 * 3 + 0];\n const y_n2 = normals[i2 * 3 + 1];\n const z_n2 = normals[i2 * 3 + 2];\n // Tangent\n const n0_dot_t = x_tangent * x_n0 + y_tangent * y_n0 + z_tangent * z_n0;\n const n1_dot_t = x_tangent * x_n1 + y_tangent * y_n1 + z_tangent * z_n1;\n const n2_dot_t = x_tangent * x_n2 + y_tangent * y_n2 + z_tangent * z_n2;\n const x_resTangent0 = x_tangent - x_n0 * n0_dot_t;\n const y_resTangent0 = y_tangent - y_n0 * n0_dot_t;\n const z_resTangent0 = z_tangent - z_n0 * n0_dot_t;\n const x_resTangent1 = x_tangent - x_n1 * n1_dot_t;\n const y_resTangent1 = y_tangent - y_n1 * n1_dot_t;\n const z_resTangent1 = z_tangent - z_n1 * n1_dot_t;\n const x_resTangent2 = x_tangent - x_n2 * n2_dot_t;\n const y_resTangent2 = y_tangent - y_n2 * n2_dot_t;\n const z_resTangent2 = z_tangent - z_n2 * n2_dot_t;\n const magTangent0 = Math.sqrt(x_resTangent0 * x_resTangent0 + y_resTangent0 * y_resTangent0 + z_resTangent0 * z_resTangent0);\n const magTangent1 = Math.sqrt(x_resTangent1 * x_resTangent1 + y_resTangent1 * y_resTangent1 + z_resTangent1 * z_resTangent1);\n const magTangent2 = Math.sqrt(x_resTangent2 * x_resTangent2 + y_resTangent2 * y_resTangent2 + z_resTangent2 * z_resTangent2);\n // Bitangent\n const n0_dot_bt = x_bitangent * x_n0 + y_bitangent * y_n0 + z_bitangent * z_n0;\n const n1_dot_bt = x_bitangent * x_n1 + y_bitangent * y_n1 + z_bitangent * z_n1;\n const n2_dot_bt = x_bitangent * x_n2 + y_bitangent * y_n2 + z_bitangent * z_n2;\n const x_resBitangent0 = x_bitangent - x_n0 * n0_dot_bt;\n const y_resBitangent0 = y_bitangent - y_n0 * n0_dot_bt;\n const z_resBitangent0 = z_bitangent - z_n0 * n0_dot_bt;\n const x_resBitangent1 = x_bitangent - x_n1 * n1_dot_bt;\n const y_resBitangent1 = y_bitangent - y_n1 * n1_dot_bt;\n const z_resBitangent1 = z_bitangent - z_n1 * n1_dot_bt;\n const x_resBitangent2 = x_bitangent - x_n2 * n2_dot_bt;\n const y_resBitangent2 = y_bitangent - y_n2 * n2_dot_bt;\n const z_resBitangent2 = z_bitangent - z_n2 * n2_dot_bt;\n const magBitangent0 = Math.sqrt(x_resBitangent0 * x_resBitangent0 +\n y_resBitangent0 * y_resBitangent0 +\n z_resBitangent0 * z_resBitangent0);\n const magBitangent1 = Math.sqrt(x_resBitangent1 * x_resBitangent1 +\n y_resBitangent1 * y_resBitangent1 +\n z_resBitangent1 * z_resBitangent1);\n const magBitangent2 = Math.sqrt(x_resBitangent2 * x_resBitangent2 +\n y_resBitangent2 * y_resBitangent2 +\n z_resBitangent2 * z_resBitangent2);\n unpacked.tangents[i0 * 3 + 0] += x_resTangent0 / magTangent0;\n unpacked.tangents[i0 * 3 + 1] += y_resTangent0 / magTangent0;\n unpacked.tangents[i0 * 3 + 2] += z_resTangent0 / magTangent0;\n unpacked.tangents[i1 * 3 + 0] += x_resTangent1 / magTangent1;\n unpacked.tangents[i1 * 3 + 1] += y_resTangent1 / magTangent1;\n unpacked.tangents[i1 * 3 + 2] += z_resTangent1 / magTangent1;\n unpacked.tangents[i2 * 3 + 0] += x_resTangent2 / magTangent2;\n unpacked.tangents[i2 * 3 + 1] += y_resTangent2 / magTangent2;\n unpacked.tangents[i2 * 3 + 2] += z_resTangent2 / magTangent2;\n unpacked.bitangents[i0 * 3 + 0] += x_resBitangent0 / magBitangent0;\n unpacked.bitangents[i0 * 3 + 1] += y_resBitangent0 / magBitangent0;\n unpacked.bitangents[i0 * 3 + 2] += z_resBitangent0 / magBitangent0;\n unpacked.bitangents[i1 * 3 + 0] += x_resBitangent1 / magBitangent1;\n unpacked.bitangents[i1 * 3 + 1] += y_resBitangent1 / magBitangent1;\n unpacked.bitangents[i1 * 3 + 2] += z_resBitangent1 / magBitangent1;\n unpacked.bitangents[i2 * 3 + 0] += x_resBitangent2 / magBitangent2;\n unpacked.bitangents[i2 * 3 + 1] += y_resBitangent2 / magBitangent2;\n unpacked.bitangents[i2 * 3 + 2] += z_resBitangent2 / magBitangent2;\n // TODO: check handedness\n }\n this.tangents = unpacked.tangents;\n this.bitangents = unpacked.bitangents;\n }", "title": "" }, { "docid": "b1b4774a88087ab528cd1d1ef986d1b4", "score": "0.5217147", "text": "function sceneGraphTraversal(s, node, mvMatrix, scene){\n if ('children' in node) { // check if we need this\n for (var c = 0; c < node.children.length; c++) {//for each child in node.children\n if ('mesh' in node.children[c]){ // check if node is dummy: if not dummy node, it will have a mesh object\n var mesh = node.children[c].mesh; // access the mesh object\n for (var f = 0; f < mesh.faces.length; f++){ //loop through the array of its faces\n var face = mesh.faces[f]; // pointer to face\n if (face == s.genFace) { //if face is the face that generated the source\n continue; //Don't reflect with the face (you'll get parent image)\n }\n var vertices = face.getVerticesPos(); //get all vertices for a 'face' in NCS\n // Convert vertices from NCS to WCS:\n var nextmvMatrix = mat4.create(); //Allocate transformation matrix\n mat4.mul(nextmvMatrix, mvMatrix, node.children[c].transform); //Calculate transformation matrix based on hierarchy\n var wc_vertices = []; //Make a new array that will contains vertices (vec3s) in WCS\n for (var v=0; v<vertices.length; v++){\n var wc_vertex= vec3.create(); //allocate a vector for the transfromed vertex\n vec3.transformMat4(wc_vertex, vertices[v], nextmvMatrix);\n wc_vertices.push(wc_vertex);\n };\n //Create the mirror image across each face (plane): s' = s - (2(s-p) dot n )*n ; IF n is normalized\n //calculate plane normal and normalize\n var u1 = vec3.create(); //allocate a vector \"u1\" (vertex 1 to vertex 2)\n var u2 = vec3.create(); //allocate a vector \"u2\" (vertex 1 to vertex 3)\n vec3.subtract(u1, wc_vertices[1], wc_vertices[0]); //calculate the vector\n vec3.subtract(u2, wc_vertices[2], wc_vertices[0]); //calculate the vector\n var norm = vec3.create(); //allocate a vector for the plane normal\n vec3.cross(norm, u1, u2); //calculate plane normal using cross product\n var n = vec3.create();\n vec3.normalize(n, norm); // normalize n\n var p = wc_vertices[0]; // point p on the plane; arbitrarily a vertex\n var vecPS = vec3.create();\n vec3.subtract(vecPS, s.pos, p); // (s-p)\n var dp = 2*vec3.dot(vecPS, n); // (2(s-p) dot n )\n var dpn = vec3.create();\n vec3.scale(dpn, n, dp); //(2(s-p) dot n )*n\n var src = vec3.create(); // s'\n vec3.subtract(src, s.pos, dpn);\n // create image source and fill in fields apropriately\n var imgSrc = {pos:src, order: (s.order + 1), parent:s, genFace:face, rcoeff:s.rcoeff};\n scene.imsources.push(imgSrc); // add source to scene.imsources array\n }\n }\n else{ // node is dummy (no mesh object) -- update transformation matrix\n var nextmvMatrix = mat4.create(); //Allocate transformation matrix\n mat4.mul(nextmvMatrix, mvMatrix, node.children[c].transform); // update transformation matrix\n }\n sceneGraphTraversal(s, node.children[c], nextmvMatrix, scene); // recursive call on child\n }\n }\n}", "title": "" }, { "docid": "9ec77b5d0ac07a2c376afc167c2d06be", "score": "0.5209706", "text": "tick() {\n if (!this.isSetup) {\n throw new Error(\"graph needs to be setup\");\n }\n // move all masses by prog\n // any above 100 should be aggregated and removed\n let diffs = new Map();\n for (let link of this.links) {\n let toMasses = link.toMasses;\n let fromMasses = link.fromMasses;\n for (let toMass of toMasses) {\n toMass.prog += this.prog;\n if (toMass.prog >= 100) {\n if (!diffs.has(link.dst)) {\n diffs.set(link.dst, 0);\n } \n diffs.set(link.dst, diffs.get(link.dst) + toMass.mass);\n }\n }\n for (let fromMass of fromMasses) {\n fromMass.prog += this.prog;\n if (fromMass.prog >= 100) {\n if (!diffs.has(link.src)) {\n diffs.set(link.src, 0);\n }\n diffs.set(link.src, diffs.get(link.src) + fromMass.mass);\n }\n }\n link.toMasses = toMasses.filter((linkmass) => linkmass.prog < 100);\n link.fromMasses = fromMasses.filter((linkmass) => linkmass.prog < 100);\n }\n\n for (let [nodeid, diff] of diffs) {\n this.perturb(nodeid, diff)\n }\n }", "title": "" }, { "docid": "a223f68f92c6c672a0db02433935cd9d", "score": "0.5193782", "text": "function meshCube(point, edgeLength, fn) {\r\n //vertices of the cube\r\n var p = [{x: point.x , y: point.y , z: point.z },\r\n {x: point.x + edgeLength, y: point.y , z: point.z },\r\n {x: point.x + edgeLength, y: point.y + edgeLength, z: point.z },\r\n {x: point.x , y: point.y + edgeLength, z: point.z },\r\n {x: point.x , y: point.y , z: point.z + edgeLength},\r\n {x: point.x + edgeLength, y: point.y , z: point.z + edgeLength},\r\n {x: point.x + edgeLength, y: point.y + edgeLength, z: point.z + edgeLength},\r\n {x: point.x , y: point.y + edgeLength, z: point.z + edgeLength}];\r\n\r\n //scalars at the vertices\r\n //compute now to avoid recomputing points as they are used\r\n var s = [fn(p[0].x, p[0].y, p[0].z),\r\n fn(p[1].x, p[1].y, p[1].z),\r\n fn(p[2].x, p[2].y, p[2].z),\r\n fn(p[3].x, p[3].y, p[3].z),\r\n fn(p[4].x, p[4].y, p[4].z),\r\n fn(p[5].x, p[5].y, p[5].z),\r\n fn(p[6].x, p[6].y, p[6].z),\r\n fn(p[7].x, p[7].y, p[7].z)];\r\n\r\n var mesh = [];\r\n\r\n mesh.extend = function(arr) { //for some reason, arrays.concat is SLOW\r\n var len = this.length;\r\n for (var i = 0; i < arr.length; ++i) {\r\n this[len+i] = arr[i];\r\n };\r\n }\r\n\r\n mesh.extend(meshTetrahedron([p[0], p[6], p[1], p[2]], [s[0], s[6], s[1], s[2]]));\r\n mesh.extend(meshTetrahedron([p[0], p[6], p[2], p[3]], [s[0], s[6], s[2], s[3]]));\r\n mesh.extend(meshTetrahedron([p[0], p[6], p[3], p[7]], [s[0], s[6], s[3], s[7]]));\r\n mesh.extend(meshTetrahedron([p[0], p[6], p[7], p[4]], [s[0], s[6], s[7], s[4]]));\r\n mesh.extend(meshTetrahedron([p[0], p[6], p[4], p[5]], [s[0], s[6], s[4], s[5]]));\r\n mesh.extend(meshTetrahedron([p[0], p[6], p[5], p[1]], [s[0], s[6], s[5], s[1]]));\r\n\r\n return mesh;\r\n}", "title": "" }, { "docid": "46c48d89e89fe440c5b4274e0528747c", "score": "0.5168984", "text": "GetNormals() {}", "title": "" }, { "docid": "6b9b6c3b0b56d506f3dc09e3ead463be", "score": "0.5162083", "text": "mesh(){return this.faceMesh}", "title": "" }, { "docid": "2fd5f344e3273c353306247cd554d544", "score": "0.51523894", "text": "function mesh_36(vertexBuffer)\n{\n return mesh_81 // [(Func (Array Float3) (Array Int) (Array Float3) (Array Float3) Mesh) | !'@200!'@201.(Func '@200 '@201) | !'@202!'@203!'@204.(Func '@202 '@203 '@204) | (Func (Array Float3) (Array Int) Mesh) | (Func (Array Float3) (Array Int) (Array Float3) Mesh)]\n (vertexBuffer // (Array Float3)\n ,indices_292 // (Func (Array Float3) (Array Int))\n (vertexBuffer // (Array Float3)\n ) // (Array Int)\n ) // Mesh\n ;\n}", "title": "" }, { "docid": "5c247a1ea5fb9eefd61a227ba4305bd9", "score": "0.5136813", "text": "function n(n,a){const o=n.fragment;o.uniforms.add(\"normalTexture\",\"sampler2D\"),o.uniforms.add(\"normalTextureSize\",\"vec2\"),a.vertexTangets?(n.attributes.add(\"tangent\",\"vec4\"),n.varyings.add(\"vTangent\",\"vec4\"),2===a.doubleSidedMode?o.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n mat3 computeTangentSpace(vec3 normal) {\n float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w;\n vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz);\n vec3 bitangent = cross(normal, tangent) * tangentHeadedness;\n return mat3(tangent, bitangent, normal);\n }\n `):o.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n mat3 computeTangentSpace(vec3 normal) {\n float tangentHeadedness = vTangent.w;\n vec3 tangent = normalize(vTangent.xyz);\n vec3 bitangent = cross(normal, tangent) * tangentHeadedness;\n return mat3(tangent, bitangent, normal);\n }\n `)):(n.extensions.add(\"GL_OES_standard_derivatives\"),o.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) {\n\n vec3 Q1 = dFdx(pos);\n vec3 Q2 = dFdy(pos);\n\n vec2 stx = dFdx(st);\n vec2 sty = dFdy(st);\n\n float det = stx.t * sty.s - sty.t * stx.s;\n\n vec3 T = stx.t * Q2 - sty.t * Q1; // compute tangent\n T = T - normal * dot(normal, T); // orthogonalize tangent\n T *= inversesqrt(max(dot(T,T), 1.e-10)); // \"soft\" normalize - goes to 0 when T goes to 0\n vec3 B = sign(det) * cross(normal, T); // assume normal is normalized, B has the same lenght as B\n return mat3(T, B, normal); // T and B go to 0 when the tangent space is not well defined by the uv coordinates\n }\n `)),0!==a.attributeTextureCoordinates&&(n.include(_attributes_VertexTextureCoordinates_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"VertexTextureCoordinates\"],a),o.code.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {\n vtc.uv = uv;\n ${a.supportsTextureAtlas?\"vtc.size = normalTextureSize;\":\"\"}\n vec3 rawNormal = textureLookup(normalTexture, vtc).rgb * 2.0 - 1.0;\n return tangentSpace * rawNormal;\n }\n `))}", "title": "" }, { "docid": "9f41dff2df96b82af7fdeae218091795", "score": "0.51366967", "text": "static plane(options = {}) {\n const detailX = options.detailX || options.detail || 1;\n const detailY = options.detailY || options.detail || 1;\n const startX = options.startX || 0;\n const startY = options.startY || 0;\n const width = options.width || 1;\n const height = options.height || 1;\n const mesh = new Mesh$$1()\n .addIndexBuffer('LINES')\n .addIndexBuffer('TRIANGLES')\n .addVertexBuffer('normals', 'ts_Normal')\n .addVertexBuffer('coords', 'ts_TexCoord');\n for (let j = 0; j <= detailY; j++) {\n const t = j / detailY;\n for (let i = 0; i <= detailX; i++) {\n const s = i / detailX;\n mesh.vertices.push(new V3(startX + s * width, startY + t * height, 0));\n mesh.coords.push([s, t]);\n mesh.normals.push(V3.Z);\n if (i < detailX && j < detailY) {\n const offset = i + j * (detailX + 1);\n mesh.TRIANGLES.push(offset, offset + detailX + 1, offset + 1, offset + detailX + 1, offset + detailX + 2, offset + 1);\n }\n }\n }\n for (let i = 0; i < detailX; i++) {\n mesh.LINES.push(i, i + 1);\n mesh.LINES.push((detailX + 1) * detailY + i, (detailX + 1) * detailY + i + 1);\n }\n for (let j = 0; j < detailY; j++) {\n mesh.LINES.push(detailX * j, detailX * (j + 1) + 1);\n mesh.LINES.push(detailX * (j + 1), detailX * (j + 2) + 1);\n }\n mesh.compile();\n return mesh;\n }", "title": "" }, { "docid": "e9de3863ee812e5c838ccddacaec20d8", "score": "0.5135682", "text": "updateGraph(graph) {\n if (this._graph.getGraphName() !== graph.getGraphName()) {\n // reset the maps\n this._nodeMap = {};\n this._edgeMap = {};\n }\n this._graph = graph;\n // update internal layout data\n // nodes\n const newNodeMap = {};\n const newD3Nodes = graph.getNodes().map(node => {\n const id = node.id;\n const locked = node.getPropertyValue('locked') || false;\n const x = node.getPropertyValue('x') || 0;\n const y = node.getPropertyValue('y') || 0;\n const fx = locked ? x : null;\n const fy = locked ? y : null;\n const collisionRadius = node.getPropertyValue('collisionRadius') || 0;\n\n const oldD3Node = this._nodeMap[node.id];\n const newD3Node = oldD3Node\n ? oldD3Node\n : {id, x, y, fx, fy, collisionRadius};\n newNodeMap[node.id] = newD3Node;\n return newD3Node;\n });\n this._nodeMap = newNodeMap;\n this._d3Graph.nodes = newD3Nodes;\n // edges\n const newEdgeMap = {};\n const newD3Edges = graph.getEdges().map(edge => {\n const oldD3Edge = this._edgeMap[edge.id];\n const newD3Edge = oldD3Edge\n ? oldD3Edge\n : {\n id: edge.id,\n source: newNodeMap[edge.getSourceNodeId()],\n target: newNodeMap[edge.getTargetNodeId()],\n };\n newEdgeMap[edge.id] = newD3Edge;\n return newD3Edge;\n });\n this._edgeMap = newEdgeMap;\n this._d3Graph.edges = newD3Edges;\n }", "title": "" }, { "docid": "bf98ea56ea5824a34e240dbbe4884268", "score": "0.5126391", "text": "compute_travel_speed(voronoi_viz) {\n let currentAverage = [];\n let historicalAverage = [];\n\n //iterate over all of the neighours\n for (let i = 0; i < this.neighbors.length; i++) {\n let link = this.neighbors[i].links.out.id;\n let dist = this.neighbors[i].dist;\n\n //iterate over all of the journeys that exist within neighours\n for (let u = 0; u < voronoi_viz.site_db.all_journeys.length; u++) {\n if (link == voronoi_viz.site_db.all_journeys[u].id) {\n let travelTime = voronoi_viz.site_db.all_journeys[u].travelTime;\n let historicalTime = voronoi_viz.site_db.all_journeys[u].normalTravelTime;\n\n let currentSpeed = (dist / travelTime) * voronoi_viz.tools.TO_MPH;\n let historicalSpeed = (dist / historicalTime) * voronoi_viz.tools.TO_MPH;\n\n if (currentSpeed == Infinity || historicalSpeed == Infinity) {\n continue;\n }\n\n historicalAverage.push(historicalSpeed);\n currentAverage.push(currentSpeed);\n }\n }\n }\n if (historicalAverage.length > 0) {\n let historicalSum = historicalAverage.reduce((previous, current) => current += previous);\n this.historicalSpeed = historicalSum / historicalAverage.length;\n }\n\n if (currentAverage.length > 0) {\n let currentSum = currentAverage.reduce((previous, current) => current += previous);\n this.travelSpeed = currentSum / currentAverage.length;\n }\n\n //if this.travelSpeed or this.historicalSpeed are null, we get 0 and thus fill in the \n //cell as the neutral yellow-orange color\n this.speedDeviation = this.travelSpeed - this.historicalSpeed;\n }", "title": "" }, { "docid": "de0a6d7b8d7a750980f93eb71b59c4bd", "score": "0.5123513", "text": "updateAdjacency() {\n const T_MAX = 2 * GRID_SIZE;\n this.adjStoreShelves = {};\n\n /*\n * - Transform 'unitVec' into 3D vector by adding 0 as\n * the z value.\n * - Compute perpendicular vector to 'unitVec' by taking\n * cross product with z-axis. Since 'unitVec' is on\n * x-y plane, a cross product with the z-axis is\n * guaranteed to be on the x-y plane, and orthogonal\n * to both 'unitVec' and the z-axis.\n * - Set this as 'front'\n * - 'back' is simply the reverse direction of 'front'\n */\n let front, back;\n {\n let _u3 = vec3(this.unitVec.x, this.unitVec.y, 0);\n let _front = cross3(_u3, vec3(0,0,1));\n front = gl.NORMALIZE(vec(_front.x, _front.y));\n back = gl.SUB(vec(0,0), front);\n }\n\n // Lambda\n const intersect = (ray, box) => {\n let intersects, t;\n\n ({intersects, t} =\n rayBoxIntersection(currGrid,\n ray,\n box.topLeft,\n box.botRight)\n );\n\n if (intersects &&\n t <= T_MAX &&\n !this.adjStoreShelves.hasOwnProperty(box.id)\n ) {\n return t;\n }\n\n return null;\n };\n\n let currGrid = this.from;\n while (!gl.EQUALS(currGrid, this.to)) {\n let tminFront = Infinity;\n let tminBack = Infinity;\n let minFront = null\n let minBack = null;\n Object.values(STORE_SHELVES).forEach(box => {\n if (!this.adjStoreShelves.hasOwnProperty(box.id)) {\n let tFront = intersect(front, box);\n let tBack = intersect(back, box);\n\n if (tFront !== null && tFront < tminFront) {\n tminFront = tFront;\n minFront = box;\n } else if (tBack !== null && tBack < tminBack) {\n tminBack = tBack;\n minBack = box;\n }\n }\n });\n\n if (minFront !== null) {\n this.adjStoreShelves[minFront.id] = minFront;\n minFront.addIntersections(\n getIntersection(this.to)\n );\n minFront.addIntersections(\n getIntersection(this.from)\n );\n }\n if (minBack !== null) {\n this.adjStoreShelves[minBack.id] = minBack;\n minBack.addIntersections(\n getIntersection(this.to)\n );\n minBack.addIntersections(\n getIntersection(this.from)\n );\n }\n\n let newGrid, p = currGrid;\n do {\n // p = p + 0.3*u\n p = gl.ADD(p, gl.SCALAR_MULT(0.3, this.unitVec));\n newGrid = snapToGrid(p.x, p.y);\n } while (gl.EQUALS(newGrid, currGrid));\n\n currGrid = newGrid;\n }\n }", "title": "" }, { "docid": "8533dde08549ad4fcc2f0d3bc7b5eba2", "score": "0.51225805", "text": "static createNavMeshData(params) {\n\t\t\tif (params.vertCount >= 0xffff)\n\t\t\t\treturn null;\n\t\t\tif (params.vertCount == 0 || params.verts == null)\n\t\t\t\treturn null;\n\t\t\tif (params.polyCount == 0 || params.polys == null)\n\t\t\t\treturn null;\n\n\t\t\tlet nvp = params.nvp;\n\n\t\t\t// Classify off-mesh connection points. We store only the connections\n\t\t\t// whose start poPoly is inside the tile.\n\t\t\tlet offMeshConClass = null;\n\t\t\tlet storedOffMeshConCount = 0;\n\t\t\tlet offMeshConLinkCount = 0;\n\n\t\t\tif (params.offMeshConCount > 0) {\n\t\t\t\toffMeshConClass = new Array(params.offMeshConCount * 2);\n\n\t\t\t\t// Find tight heigh bounds, used for culling out off-mesh start\n\t\t\t\t// locations.\n\t\t\t\tlet hmin = Number.MAX_VALUE;\n\t\t\t\tlet hmax = -Number.MAX_VALUE;\n\n\t\t\t\tif (params.detailVerts != null && params.detailVertsCount != 0) {\n\t\t\t\t\tfor (let i = 0; i < params.detailVertsCount; ++i) {\n\t\t\t\t\t\tlet h = params.detailVerts[i * 3 + 1];\n\t\t\t\t\t\thmin = Math.min(hmin, h);\n\t\t\t\t\t\thmax = Math.max(hmax, h);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (let i = 0; i < params.vertCount; ++i) {\n\t\t\t\t\t\tlet iv = i * 3;\n\t\t\t\t\t\th = params.bmin[1] + params.verts[iv + 1] * params.ch;\n\t\t\t\t\t\thmin = Math.min(hmin, h);\n\t\t\t\t\t\thmax = Math.max(hmax, h);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thmin -= params.walkableClimb;\n\t\t\t\thmax += params.walkableClimb;\n\t\t\t\tlet bmin = new Array(3);\n\t\t\t\tlet bmax = new Array(3);\n\t\t\t\tDetourCommon.vCopy(bmin, params.bmin);\n\t\t\t\tDetourCommon.vCopy(bmax, params.bmax);\n\t\t\t\tbmin[1] = hmin;\n\t\t\t\tbmax[1] = hmax;\n\n\t\t\t\tfor (let i = 0; i < params.offMeshConCount; ++i) {\n\t\t\t\t\tlet p0 = new VectorPtr$1(params.offMeshConVerts, (i * 2 + 0) * 3);\n\t\t\t\t\tlet p1 = new VectorPtr$1(params.offMeshConVerts, (i * 2 + 1) * 3);\n\n\t\t\t\t\toffMeshConClass[i * 2 + 0] = NavMeshBuilder.classifyOffMeshPoint(p0, bmin, bmax);\n\t\t\t\t\toffMeshConClass[i * 2 + 1] = NavMeshBuilder.classifyOffMeshPoint(p1, bmin, bmax);\n\n\t\t\t\t\t// Zero out off-mesh start positions which are not even\n\t\t\t\t\t// potentially touching the mesh.\n\t\t\t\t\tif (offMeshConClass[i * 2 + 0] == 0xff) {\n\t\t\t\t\t\tif (p0[1] < bmin[1] || p0[1] > bmax[1])\n\t\t\t\t\t\t\toffMeshConClass[i * 2 + 0] = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Count how many links should be allocated for off-mesh\n\t\t\t\t\t// connections.\n\t\t\t\t\tif (offMeshConClass[i * 2 + 0] == 0xff)\n\t\t\t\t\t\toffMeshConLinkCount++;\n\t\t\t\t\tif (offMeshConClass[i * 2 + 1] == 0xff)\n\t\t\t\t\t\toffMeshConLinkCount++;\n\n\t\t\t\t\tif (offMeshConClass[i * 2 + 0] == 0xff)\n\t\t\t\t\t\tstoredOffMeshConCount++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Off-mesh connectionss are stored as polygons, adjust values.\n\t\t\tlet totPolyCount = params.polyCount + storedOffMeshConCount;\n\t\t\tlet totVertCount = params.vertCount + storedOffMeshConCount * 2;\n\n\t\t\t// Find portal edges which are at tile borders.\n\t\t\tlet edgeCount = 0;\n\t\t\tlet portalCount = 0;\n\t\t\tfor (let i = 0; i < params.polyCount; ++i) {\n\t\t\t\tlet p = i * 2 * nvp;\n\t\t\t\tfor (let j = 0; j < nvp; ++j) {\n\t\t\t\t\tif (params.polys[p + j] == NavMeshBuilder.MESH_NULL_IDX)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tedgeCount++;\n\n\t\t\t\t\tif ((params.polys[p + nvp + j] & 0x8000) != 0) {\n\t\t\t\t\t\tlet dir = params.polys[p + nvp + j] & 0xf;\n\t\t\t\t\t\tif (dir != 0xf)\n\t\t\t\t\t\t\tportalCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet maxLinkCount = edgeCount + portalCount * 2 + offMeshConLinkCount * 2;\n\n\t\t\t// Find unique detail vertices.\n\t\t\tlet uniqueDetailVertCount = 0;\n\t\t\tlet detailTriCount = 0;\n\t\t\tif (params.detailMeshes != null) {\n\t\t\t\t// Has detail mesh, count unique detail vertex count and use input\n\t\t\t\t// detail tri count.\n\t\t\t\tdetailTriCount = params.detailTriCount;\n\t\t\t\tfor (let i = 0; i < params.polyCount; ++i) {\n\t\t\t\t\tlet p = i * nvp * 2;\n\t\t\t\t\tlet ndv = params.detailMeshes[i * 4 + 1];\n\t\t\t\t\tlet nv = 0;\n\t\t\t\t\tfor (let j = 0; j < nvp; ++j) {\n\t\t\t\t\t\tif (params.polys[p + j] == NavMeshBuilder.MESH_NULL_IDX)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tnv++;\n\t\t\t\t\t}\n\t\t\t\t\tndv -= nv;\n\t\t\t\t\tuniqueDetailVertCount += ndv;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// No input detail mesh, build detail mesh from nav polys.\n\t\t\t\tuniqueDetailVertCount = 0; // No extra detail verts.\n\t\t\t\tdetailTriCount = 0;\n\t\t\t\tfor (let i = 0; i < params.polyCount; ++i) {\n\t\t\t\t\tlet p = i * nvp * 2;\n\t\t\t\t\tlet nv = 0;\n\t\t\t\t\tfor (let j = 0; j < nvp; ++j) {\n\t\t\t\t\t\tif (params.polys[p + j] == NavMeshBuilder.MESH_NULL_IDX)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tnv++;\n\t\t\t\t\t}\n\t\t\t\t\tdetailTriCount += nv - 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet bvTreeSize = params.buildBvTree ? params.polyCount * 2 : 0;\n\t\t\tlet header = new MeshHeader();\n\t\t\tlet navVerts = new Array(3 * totVertCount);\n\t\t\tlet navPolys = new Array(totPolyCount);\n\t\t\tlet navDMeshes = new Array(params.polyCount);\n\t\t\tlet navDVerts = new Array(3 * uniqueDetailVertCount);\n\t\t\tlet navDTris = new Array(4 * detailTriCount);\n\t\t\tlet navBvtree = new Array(bvTreeSize);\n\t\t\tlet offMeshCons = new Array(storedOffMeshConCount);\n\n\t\t\t// Store header\n\t\t\theader.magic = MeshHeader.DT_NAVMESH_MAGIC;\n\t\t\theader.version = MeshHeader.DT_NAVMESH_VERSION;\n\t\t\theader.x = params.tileX;\n\t\t\theader.y = params.tileY;\n\t\t\theader.layer = params.tileLayer;\n\t\t\theader.userId = params.userId;\n\t\t\theader.polyCount = totPolyCount;\n\t\t\theader.vertCount = totVertCount;\n\t\t\theader.maxLinkCount = maxLinkCount;\n\t\t\tDetourCommon.vCopy(header.bmin, params.bmin);\n\t\t\tDetourCommon.vCopy(header.bmax, params.bmax);\n\t\t\theader.detailMeshCount = params.polyCount;\n\t\t\theader.detailVertCount = uniqueDetailVertCount;\n\t\t\theader.detailTriCount = detailTriCount;\n\t\t\theader.bvQuantFactor = 1.0 / params.cs;\n\t\t\theader.offMeshBase = params.polyCount;\n\t\t\theader.walkableHeight = params.walkableHeight;\n\t\t\theader.walkableRadius = params.walkableRadius;\n\t\t\theader.walkableClimb = params.walkableClimb;\n\t\t\theader.offMeshConCount = storedOffMeshConCount;\n\t\t\theader.bvNodeCount = bvTreeSize;\n\n\t\t\tlet offMeshVertsBase = params.vertCount;\n\t\t\tlet offMeshPolyBase = params.polyCount;\n\n\t\t\t// Store vertices\n\t\t\t// Mesh vertices\n\t\t\tfor (let i = 0; i < params.vertCount; ++i) {\n\t\t\t\tlet iv = i * 3;\n\t\t\t\tlet v = i * 3;\n\t\t\t\tnavVerts[v] = params.bmin[0] + params.verts[iv] * params.cs;\n\t\t\t\tnavVerts[v + 1] = params.bmin[1] + params.verts[iv + 1] * params.ch;\n\t\t\t\tnavVerts[v + 2] = params.bmin[2] + params.verts[iv + 2] * params.cs;\n\t\t\t\t// console.log(navVerts)\n\t\t\t}\n\t\t\t// Off-mesh link vertices.\n\t\t\tlet n = 0;\n\t\t\tfor (let i = 0; i < params.offMeshConCount; ++i) {\n\t\t\t\t// Only store connections which start from this tile.\n\t\t\t\tif (offMeshConClass[i * 2 + 0] == 0xff) {\n\t\t\t\t\tlet linkv = i * 2 * 3;\n\t\t\t\t\tlet v = (offMeshVertsBase + n * 2) * 3;\n\t\t\t\t\tarraycopy$3(params.offMeshConVerts, linkv, navVerts, v, 6);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store polygons\n\t\t\t// Mesh polys\n\t\t\tlet src = 0;\n\t\t\tfor (let i = 0; i < params.polyCount; ++i) {\n\t\t\t\tlet p = new Poly(i, nvp);\n\t\t\t\tnavPolys[i] = p;\n\t\t\t\tp.vertCount = 0;\n\t\t\t\tp.flags = params.polyFlags[i];\n\t\t\t\tp.setArea(params.polyAreas[i]);\n\t\t\t\tp.setType(Poly.DT_POLYTYPE_GROUND);\n\t\t\t\tfor (let j = 0; j < nvp; ++j) {\n\t\t\t\t\tif (params.polys[src + j] == NavMeshBuilder.MESH_NULL_IDX)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tp.verts[j] = params.polys[src + j];\n\t\t\t\t\tif ((params.polys[src + nvp + j] & 0x8000) != 0) {\n\t\t\t\t\t\t// Border or portal edge.\n\t\t\t\t\t\tlet dir = params.polys[src + nvp + j] & 0xf;\n\t\t\t\t\t\tif (dir == 0xf) // Border\n\t\t\t\t\t\t\tp.neis[j] = 0;\n\t\t\t\t\t\telse if (dir == 0) // Portal x-\n\t\t\t\t\t\t\tp.neis[j] = NavMesh.DT_EXT_LINK | 4;\n\t\t\t\t\t\telse if (dir == 1) // Portal z+\n\t\t\t\t\t\t\tp.neis[j] = NavMesh.DT_EXT_LINK | 2;\n\t\t\t\t\t\telse if (dir == 2) // Portal x+\n\t\t\t\t\t\t\tp.neis[j] = NavMesh.DT_EXT_LINK | 0;\n\t\t\t\t\t\telse if (dir == 3) // Portal z-\n\t\t\t\t\t\t\tp.neis[j] = NavMesh.DT_EXT_LINK | 6;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Normal connection\n\t\t\t\t\t\tp.neis[j] = params.polys[src + nvp + j] + 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tp.vertCount++;\n\t\t\t\t}\n\t\t\t\tsrc += nvp * 2;\n\t\t\t}\n\t\t\t// Off-mesh connection vertices.\n\t\t\tn = 0;\n\t\t\tfor (let i = 0; i < params.offMeshConCount; ++i) {\n\t\t\t\t// Only store connections which start from this tile.\n\t\t\t\tif (offMeshConClass[i * 2 + 0] == 0xff) {\n\t\t\t\t\tlet p = new Poly(offMeshPolyBase + n, nvp);\n\t\t\t\t\tnavPolys[offMeshPolyBase + n] = p;\n\t\t\t\t\tp.vertCount = 2;\n\t\t\t\t\tp.verts[0] = offMeshVertsBase + n * 2;\n\t\t\t\t\tp.verts[1] = offMeshVertsBase + n * 2 + 1;\n\t\t\t\t\tp.flags = params.offMeshConFlags[i];\n\t\t\t\t\tp.setArea(params.offMeshConAreas[i]);\n\t\t\t\t\tp.setType(Poly.DT_POLYTYPE_OFFMESH_CONNECTION);\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store detail meshes and vertices.\n\t\t\t// The nav polygon vertices are stored as the first vertices on each\n\t\t\t// mesh.\n\t\t\t// We compress the mesh data by skipping them and using the navmesh\n\t\t\t// coordinates.\n\t\t\tif (params.detailMeshes != null) {\n\t\t\t\tlet vbase = 0;\n\t\t\t\tfor (let i = 0; i < params.polyCount; ++i) {\n\t\t\t\t\tlet dtl = new PolyDetail();\n\t\t\t\t\tnavDMeshes[i] = dtl;\n\t\t\t\t\tlet vb = params.detailMeshes[i * 4 + 0];\n\t\t\t\t\tlet ndv = params.detailMeshes[i * 4 + 1];\n\t\t\t\t\tlet nv = navPolys[i].vertCount;\n\t\t\t\t\tdtl.vertBase = vbase;\n\t\t\t\t\tdtl.vertCount = (ndv - nv);\n\t\t\t\t\tdtl.triBase = params.detailMeshes[i * 4 + 2];\n\t\t\t\t\tdtl.triCount = params.detailMeshes[i * 4 + 3];\n\t\t\t\t\t// Copy vertices except the first 'nv' verts which are equal to\n\t\t\t\t\t// nav let verts.\n\t\t\t\t\tif (ndv - nv != 0) {\n\t\t\t\t\t\tarraycopy$3(params.detailVerts, (vb + nv) * 3, navDVerts, vbase * 3, 3 * (ndv - nv));\n\t\t\t\t\t\tvbase += ndv - nv;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Store triangles.\n\t\t\t\tarraycopy$3(params.detailTris, 0, navDTris, 0, 4 * params.detailTriCount);\n\t\t\t} else {\n\t\t\t\t// Create dummy detail mesh by triangulating polys.\n\t\t\t\tlet tbase = 0;\n\t\t\t\tfor (let i = 0; i < params.polyCount; ++i) {\n\t\t\t\t\tlet dtl = new PolyDetail();\n\t\t\t\t\tnavDMeshes[i] = dtl;\n\t\t\t\t\tlet nv = navPolys[i].vertCount;\n\t\t\t\t\tdtl.vertBase = 0;\n\t\t\t\t\tdtl.vertCount = 0;\n\t\t\t\t\tdtl.triBase = tbase;\n\t\t\t\t\tdtl.triCount = (nv - 2);\n\t\t\t\t\t// Triangulate polygon (local indices).\n\t\t\t\t\tfor (let j = 2; j < nv; ++j) {\n\t\t\t\t\t\tlet t = tbase * 4;\n\t\t\t\t\t\tnavDTris[t + 0] = 0;\n\t\t\t\t\t\tnavDTris[t + 1] = (j - 1);\n\t\t\t\t\t\tnavDTris[t + 2] = j;\n\t\t\t\t\t\t// Bit for each edge that belongs to let boundary.\n\t\t\t\t\t\tnavDTris[t + 3] = (1 << 2);\n\t\t\t\t\t\tif (j == 2)\n\t\t\t\t\t\t\tnavDTris[t + 3] |= (1 << 0);\n\t\t\t\t\t\tif (j == nv - 1)\n\t\t\t\t\t\t\tnavDTris[t + 3] |= (1 << 4);\n\t\t\t\t\t\ttbase++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Store and create BVtree.\n\t\t\t// TODO: take detail mesh into account! use byte per bbox extent?\n\t\t\tif (params.buildBvTree) {\n\t\t\t\t// Do not set header.bvNodeCount set to make it work look exactly the same as in original Detour \n\t\t\t\theader.bvNodeCount = NavMeshBuilder.createBVTree(params, navBvtree);\n\t\t\t}\n\n\t\t\t// Store Off-Mesh connections.\n\t\t\tn = 0;\n\t\t\tfor (let i = 0; i < params.offMeshConCount; ++i) {\n\t\t\t\t// Only store connections which start from this tile.\n\t\t\t\tif (offMeshConClass[i * 2 + 0] == 0xff) {\n\t\t\t\t\tlet con = new OffMeshConnection();\n\t\t\t\t\toffMeshCons[n] = con;\n\t\t\t\t\tcon.poly = (offMeshPolyBase + n);\n\t\t\t\t\t// Copy connection end-points.\n\t\t\t\t\tlet endPts = i * 2 * 3;\n\t\t\t\t\tarraycopy$3(params.offMeshConVerts, endPts, con.pos, 0, 6);\n\t\t\t\t\tcon.rad = params.offMeshConRad[i];\n\t\t\t\t\tcon.flags = params.offMeshConDir[i] != 0 ? NavMesh.DT_OFFMESH_CON_BIDIR : 0;\n\t\t\t\t\tcon.side = offMeshConClass[i * 2 + 1];\n\t\t\t\t\tif (params.offMeshConUserID != null)\n\t\t\t\t\t\tcon.userId = params.offMeshConUserID[i];\n\t\t\t\t\tn++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet nmd = new MeshData();\n\t\t\tnmd.header = header;\n\t\t\tnmd.verts = navVerts;\n\t\t\tnmd.polys = navPolys;\n\t\t\tnmd.detailMeshes = navDMeshes;\n\t\t\tnmd.detailVerts = navDVerts;\n\t\t\tnmd.detailTris = navDTris;\n\t\t\tnmd.bvTree = navBvtree;\n\t\t\tnmd.offMeshCons = offMeshCons;\n\t\t\treturn nmd;\n\t\t}", "title": "" }, { "docid": "8033f7a53139572549c6320a53c1b092", "score": "0.5113776", "text": "compute() {\n let offset = 0;\n let size = 0;\n let previousStream = 0;\n\n // Sort elements by stream (ascending)\n this.elements.sort((a, b) => {\n const t = (a.stream > b.stream ? 1 : 0);\n return a.stream < b.stream ? -1 : t;\n });\n\n // Compute values\n for (let i = 0; i < this.elements.length; i += 1) {\n // Reset offset and stride when we change stream\n if (previousStream !== this.elements[i].stream) {\n this.streamStride[previousStream] = offset;\n offset = 0;\n }\n\n switch (this.elements[i].type) {\n case VertexElement.Type.Float:\n case VertexElement.Type.Int:\n size = 4;\n break;\n case VertexElement.Type.Short:\n size = 2;\n break;\n case VertexElement.Type.Byte:\n size = 1;\n break;\n default:\n size = 1;\n break;\n }\n\n this.elements[i].offset = offset;\n size *= this.elements[i].count;\n offset += size;\n previousStream = this.elements[i].stream;\n }\n\n this.streamStride[previousStream] = offset;\n }", "title": "" }, { "docid": "23735edceaa9830c45f4de19e7966d93", "score": "0.51132876", "text": "function computeSpeeds() {\n lowSpeed = semitoneSubdivisions * slowSemitonesPerSec;\n midSpeed = semitoneSubdivisions * midSemitonesPerSec;\n highSpeed = semitoneSubdivisions * fastSemitonesPerSec;\n}", "title": "" }, { "docid": "821d33e0187728a197aae1ce64e8aa4f", "score": "0.511021", "text": "computeAttenuation (hitTest) {\n\n this._floorTopEdges.forEach( (obj) => {\n this.viewer.impl.scene.remove( obj )\n })\n\n this._raycastRays.forEach( (obj) => {\n this.viewer.impl.scene.remove( obj )\n })\n\n this._floorTopEdges = []\n this._raycastRays = []\n\n this.drawVertex(hitTest.point, this._floorTopEdges,\n this._debug_floor_top_edges)\n\n this.selectedDbId = hitTest.dbId\n\n // Do not remake the mesh each time, reuse it and just\n // update its texture - the shader will handle it for you\n let mesh;\n\n if (!this._floorMeshes[this.selectedDbId]) {\n\n mesh = this.buildFloorMesh(\n hitTest.dbId,\n hitTest.face.normal)\n\n this._floorMeshes[hitTest.dbId] = mesh\n\n this.viewer.impl.scene.add(mesh)\n\n } else {\n\n mesh = this._floorMeshes[this.selectedDbId]\n }\n\n // ray trace to determine wall locations on mesh\n\n const psource = new THREE.Vector3 (\n hitTest.point.x,\n hitTest.point.y,\n hitTest.point.z + this._rayTraceOffset)\n\n const map_uv_to_color = this.rayTraceToFindWalls(\n mesh, psource)\n\n const attenuationMax = this.array2dMaxW(map_uv_to_color)\n const attenuationMin = this.array2dMinW(map_uv_to_color)\n\n const tex = this.createTexture(\n map_uv_to_color, attenuationMax)\n\n mesh.material.uniforms.checkerboard.value = tex\n\n this.viewer.impl.invalidate (true)\n\n return {\n min: attenuationMin,\n max: attenuationMax\n }\n }", "title": "" }, { "docid": "0b448dfde08012eb9316a1bd574eef94", "score": "0.50922835", "text": "shouldComponentUpdate(nextProps) {\n // assigns next props to variables in the form np<PropName>\n const {\n nodes: npNodes, selectedRows: npSelectedRows,\n searchedNodes: npSearchedNodes,\n } = nextProps\n\n // assigns current props to variables in the form this<PropName>\n const {\n nodes: thisNodes, selectedRows: thisSelectedRows,\n searchedNodes: thisSearchedNodes,\n } = this.props\n\n // update conditions\n if (npNodes.length !== thisNodes.length) {\n return true\n }\n if (npSelectedRows.length !== thisSelectedRows.length) {\n return true\n }\n if (npSearchedNodes !== thisSearchedNodes) {\n return true\n }\n\n /*\n Returns true if any node properties change\n */\n // Return the first node that differs, if any\n return nextProps.nodes.some((newNode) => (\n // Iterate through each property and filter the ones that differ\n\n Object.keys(newNode).filter((prop) => { // Ignore trivial properties\n if (prop !== 'average_response_ms'\n && prop !== 'message'\n && prop !== 'time'\n ) {\n // find this X property in old node by searching thisNodes array\n const oldNodeProp = thisNodes.find((node) => node.id === newNode.id)[prop]\n switch (prop) {\n case 'conflicts':// conflicts needs to be compared with strings otherwise can return a false true\n return JSON.stringify(newNode[prop]) !== JSON.stringify(oldNodeProp)\n case 'standard_deviation_ms':// ignores small deviations which causes all the noderows to be rerendered\n if (newNode[prop] > oldNodeProp) {\n return newNode[prop] > oldNodeProp + 0.01\n }\n if (newNode[prop] < oldNodeProp) {\n return newNode[prop] < oldNodeProp - 0.01\n }\n return newNode[prop] !== oldNodeProp\n default:\n return newNode[prop] !== oldNodeProp\n }\n }\n return false\n }).length\n ))\n }", "title": "" }, { "docid": "b215fb030c43fec86155b8cfbf21d285", "score": "0.5090673", "text": "_getParticleMesh(size) {\n let d = new THREE.DodecahedronGeometry(size);\n return new THREE.EdgesGeometry(d);\n }", "title": "" }, { "docid": "5769391a14aab6e347903d5321c60bb6", "score": "0.50900674", "text": "autoLayout(forceLayout) {\n if (forceLayout) {\n this.layoutTimes = 0;\n }\n devLog('this.layoutTimes:', this.layoutTimes);\n if (this.layoutTimes > 300) {\n this.graphSetting.autoLayouting = false;\n return;\n }\n this.layoutTimes++;\n this.__origin_nodes.forEach(thisNode => {\n thisNode.Fx = 0;\n thisNode.Fy = 0;\n });\n const __by_node = true; // parseInt(this.layoutTimes / 10) % 2 === 1\n const __by_line = true; // parseInt(this.layoutTimes / 10) % 2 === 0\n if (__by_node) {\n for (const i in this.__origin_nodes) {\n const __node1 = this.__origin_nodes[i];\n if (__node1.lot.placed === true) {\n // var __thisNode = this.__origin_nodes[i]\n // __thisNode.targetNodes.forEach(thisTN_level1 => {\n // this.addGravityByNode(__thisNode, thisTN_level1)\n // thisTN_level1.targetNodes.forEach(thisTN_level2 => {\n // this.addGravityByNode(__thisNode, thisTN_level2)\n // })\n // })\n // 循环点,综合点与其他所有点点斥力及方向\n for (const j in this.__origin_nodes) {\n const __node2 = this.__origin_nodes[j];\n if (__node2.lot.placed === true) {\n // 循环点,计算i点与j点点斥力及方向\n if (i !== j) {\n // if (this.allNodes[i].lot.level === this.allNodes[j].lot.level) {\n this.addGravityByNode(__node1, __node2);\n // }\n }\n }\n }\n }\n }\n }\n if (__by_line) {\n for (const i in this.__origin_nodes) {\n // 循环线,设置每个点承受点力及力点方向\n if (this.__origin_nodes[i].lot.parent) {\n this.addElasticByLine(this.__origin_nodes[i].lot.parent, this.__origin_nodes[i]);\n // break\n }\n }\n }\n // if (this.layoutTimes % 5 === 0) { // 为提高布局效率,计算五次后更新位置\n for (const i in this.__origin_nodes) {\n this.applyToNodePosition(this.__origin_nodes[i]);\n }\n // }\n window.setTimeout(() => { this.autoLayout(); }, 30);\n }", "title": "" }, { "docid": "0181c2a4ce2d4aaafadd0f58bc7b4d3b", "score": "0.50840324", "text": "function smoothCalc()\r\n{\r\n\t// it has 52 thousands normals into the model.arrays.normals, where 3 values duplicate for 2 times\r\n\t// if we count 9(actually 3 values) as a group, it gives you 52236/9 = 5804, which is the amount for the faces\r\n\t\r\n\t// gives you a copy for indices, hold once we not sure it is a dup or not\r\n\tvar indices = [...model.arrays.indices];// it is kind of copy all the things in arrays.indices to indices \r\n\twhile(indices.length>0){\r\n \t\t// while loop condition and remove the first item from indices\r\n\t\t// now indices.length -=1, duplicate have a value\r\n\t\tvar duplicate = [indices.shift()];\r\n\t\t\r\n\t\t// a is set to the thing we get above\r\n\t\tvar a = duplicate[0];\r\n\t\t//go through remaining to get the dup\r\n\t\tfor(var j =0;j<indices.length;j++){\r\n\t\t\tvar b = indices[j];\r\n\t\t\tif(model.arrays.vertices[a*3+0] == model.arrays.vertices[b*3+0]&& model.arrays.vertices[a*3+1] == model.arrays.vertices[b*3+1] \r\n\t\t\t&& model.arrays.vertices[a*3+2] == model.arrays.vertices[b*3+2]){\r\n\t\t\t\t//you have a duplicate\r\n\t\t\t\tduplicate.push(b);\r\n\t\t\t\tindices.splice(j,1);//replace 1 item at index j\r\n\t\t\t\tj--;//because you take one item away, you need to update j to avoid skip items\r\n\t\t\t}\r\n\t\t}\r\n\t\t// now we have all the duplicate, which means we find all the face normals that share the same vertex as a set\r\n\t\t// for smoothing, we want to get a average for these duplicates and resign it back to the face normals\r\n\t\tvar sumX = 0;\r\n\t\tvar sumY = 0;\r\n\t\tvar sumZ = 0;\r\n\t\tfor(var k=0;k<duplicate.length;k++){\r\n\t\t\tvar c = duplicate[k];\r\n\t\t\tsumX += model.arrays.normals[c*3+0];\r\n\t\t\tsumY += model.arrays.normals[c*3+1];\r\n\t\t\tsumZ += model.arrays.normals[c*3+2];\r\n\t\t}\r\n\t\tfor(var k=0;k<duplicate.length;k++){\r\n\t\t\tvar c = duplicate[k];\r\n\t\t\tmodel.arrays.normals[c*3+0] = sumX/duplicate.length;\r\n\t\t\tmodel.arrays.normals[c*3+1] = sumY/duplicate.length;\r\n\t\t\tmodel.arrays.normals[c*3+2] = sumZ/duplicate.length;\r\n\t\t}\r\n\t}\r\n assignVertexBuffersData(gl, buffers, model);\r\n\t\r\n}", "title": "" }, { "docid": "b71d09ec01f5877c1a77422ea1dfa82f", "score": "0.5082255", "text": "function Graph() {\n let graph = Viva.Graph.graph();\n let graphics = Viva.Graph.View.webglGraphics();\n let renderer = React.useRef();\n let container = React.useRef();\n let layout = Viva.Graph.Layout.forceDirected(graph, {\n springLength: 30,\n springCoeff: 0.0008,\n dragCoeff: 0.009,\n gravity: -1.2,\n theta: 0.8,\n });\n // console.log(data);\n\n // graph.addLink(1, 2);\n // let data = JSON.stringify(jsonData);\n \n // console.log(Object.keys(data));\n let data = {\n \"DIPLOBLASTIC\": [\"CHARACTERIZING\", \"THE\", \"OVUM\", \"WHEN\", \"IT\", \"HAS\", \"TWO\", \"PRIMARY\", \"GERMINALLAYERS\"], \"DEFIGURE\": [\"TO\", \"DELINEATE\", \"[OBS\", \"]THESE\", \"TWO\", \"STONES\", \"AS\", \"THEY\", \"ARE\", \"HERE\", \"DEFIGURED\", \"WEEVER\"], \"LOMBARD\": [\"OF\", \"OR\", \"PERTAINING\", \"TO\", \"LOMBARDY\", \"OR\", \"THE\", \"INHABITANTS\", \"OF\", \"LOMBARDY\"], \"BAHAISM\": [\"THE\", \"RELIGIOUS\", \"TENETS\", \"OR\", \"PRACTICES\", \"OF\", \"THE\", \"BAHAIS\"], \"FUMERELL\": [\"SEE\", \"FEMERELL\"], \"ROYALET\": [\"A\", \"PETTY\", \"OR\", \"POWERLESS\", \"KING\", \"[R\", \"]THERE\", \"WERE\", \"AT\", \"THIS\", \"TIME\", \"TWO\", \"OTHER\", \"ROYALETS\", \"AS\", \"ONLY\", \"KINGS\", \"BY\", \"HISLEAVE\", \"FULLER\"], \"TROPHIED\": [\"ADORNED\", \"WITH\", \"TROPHIES\", \"THE\", \"TROPHIED\", \"ARCHES\", \"STORIED\", \"HALLS\", \"INVADE\", \"POPE\"], \"ZEQUIN\": [\"SEE\", \"SEQUIN\"], \"MILLWRIGHT\": [\"A\", \"MECHANIC\", \"WHOSE\", \"OCCUPATION\", \"IS\", \"TO\", \"BUILD\", \"MILLS\", \"OR\", \"TO\", \"SET\", \"UPTHEIR\", \"MACHINERY\"], \"PHOTOGRAPHOMETER\": [\"AN\", \"INSTRUMENT\", \"FOR\", \"DETERMINING\", \"THE\", \"SENSIBILITY\", \"OF\", \"THE\", \"PLATESEMPLOYED\", \"IN\", \"PHOTOGRAPHIC\", \"PROCESSES\", \"TO\", \"LUMINOUS\", \"RAYS\"], \"SCHEELIUM\": [\"THE\", \"METAL\", \"TUNGSTEN\", \"[OBS\", \"]\"], \"ALVEOLATE\": [\"DEEPLY\", \"PITTED\", \"LIKE\", \"A\", \"HONEYCOMB\"], \"LIMULUS\": [\"THE\", \"ONLY\", \"EXISTING\", \"GENUS\", \"OF\", \"MEROSTOMATA\", \"IT\", \"INCLUDES\", \"ONLY\", \"A\", \"FEWSPECIES\", \"FROM\", \"THE\", \"EAST\", \"INDIES\", \"AND\", \"ONE\", \"LIMULUS\", \"POLYPHEMUS\", \"FROM\", \"THEATLANTIC\", \"COAST\", \"OF\", \"NORTH\", \"AMERICA\", \"CALLED\", \"ALSO\", \"MOLUCCA\", \"CRAB\", \"KING\", \"CRAB\", \"HORSESHOE\", \"CRAB\", \"AND\", \"HORSEFOOT\"], \"OSMUND\": [\"A\", \"FERN\", \"OF\", \"THE\", \"GENUS\", \"OSMUNDA\", \"OR\", \"FLOWERING\", \"FERN\", \"THE\", \"MOSTREMARKABLE\", \"SPECIES\", \"IS\", \"THE\", \"OSMUND\", \"ROYAL\", \"OR\", \"ROYAL\", \"FERN\", \"OSMUNDAREGALIS\", \"WHICH\", \"GROWS\", \"IN\", \"WET\", \"OR\", \"BOGGY\", \"PLACES\", \"AND\", \"HAS\", \"LARGE\", \"BIPINNATEFRONDS\", \"OFTEN\", \"WITH\", \"A\", \"PANICLE\", \"OF\", \"CAPSULES\", \"AT\", \"THE\", \"TOP\", \"THE\", \"ROOTSTOCKCONTAINS\", \"MUCH\", \"STARCH\", \"AND\", \"HAS\", \"BEEN\", \"USED\", \"IN\", \"STIFFENING\", \"LINEN\"], \"POTTEEN\": [\"SEE\", \"POTEEN\"], \"UNDERRUN\": [\"TO\", \"RUN\", \"OR\", \"PASS\", \"UNDER\", \"ESPECIALLY\", \"NAUT\", \"TO\", \"PASS\", \"ALONG\", \"ANDUNDER\", \"AS\", \"A\", \"CABLE\", \"FOR\", \"THE\", \"PURPOSE\", \"OF\", \"TAKING\", \"IT\", \"IN\", \"OR\", \"OF\", \"EXAMININGIT\"], \"EMPLASTIC\": [\"FIT\", \"TO\", \"BE\", \"APPLIED\", \"AS\", \"A\", \"PLASTER\", \"GLUTINOUS\", \"ADHESIVE\", \"AS\", \"EMPLASTIC\", \"APPLICATIONS\"], \"RHYTHMICS\": [\"THE\", \"DEPARTMENT\", \"OF\", \"MUSICAL\", \"SCIENCE\", \"WHICH\", \"TREATS\", \"OF\", \"THE\", \"LENGTH\", \"OFSOUNDS\"], \"PLEUROPTERA\": [\"A\", \"GROUP\", \"OF\", \"ISECTIVORA\", \"INCLUDING\", \"THE\", \"COLUGO\"], \"UNBLOODY\": [\"NOT\", \"BLOODY\", \"DRYDEN\", \"UNBLOODY\", \"SACRIFICE\", \"A\", \"A\", \"SACRIFICE\", \"INWHICH\", \"NO\", \"VICTIM\", \"IS\", \"SLAIN\", \"B\", \"R\", \"C\", \"CH\", \"THE\", \"MASS\"], \"CINCINNUS\": [\"A\", \"FORM\", \"OF\", \"MONOCHASIUM\", \"IN\", \"WHICH\", \"THE\", \"LATERAL\", \"BRANCHES\", \"ARISEALTERNATELY\", \"ON\", \"OPPOSITE\", \"SIDES\", \"OF\", \"THE\", \"FALSE\", \"AXIS\", \"CALLED\", \"ALSOSCORPIOID\", \"CYME\", \"CIN\", \"CIN\", \"NAL\", \"A\"], \"INDOCILITY\": [\"THE\", \"QUALITY\", \"OR\", \"STATE\", \"OF\", \"BEING\", \"INDOCILE\", \"DULLNESS\", \"OF\", \"INTELLECT\", \"UNTEACHABLENESS\", \"INTRACTABLENESS\", \"THE\", \"STIFFNESS\", \"AND\", \"INDOCILITY\", \"OF\", \"THE\", \"PHARISEES\", \"W\", \"MONTAGU\"], \"TELEOCEPHIAL\": [\"AN\", \"EXTENSIVE\", \"ORDER\", \"OF\", \"BONY\", \"FISHES\", \"INCLUDING\", \"MOST\", \"OF\", \"THE\", \"COMMONMARKET\", \"SPECIES\", \"AS\", \"BASS\", \"SALMON\", \"COD\", \"PERCH\", \"ETC\"], \"CANEBRAKE\": [\"A\", \"THICKET\", \"OF\", \"CANES\", \"ELLICOTT\"], \"QUININIC\": [\"PERTAINING\", \"TO\", \"OR\", \"DESIGNATING\", \"A\", \"NITROGENOUS\", \"ACID\", \"OBTAINED\", \"AS\", \"AYELLOW\", \"CRYSTALLINE\", \"SUBSTANCE\", \"BY\", \"THE\", \"OXIDATION\", \"OF\", \"QUININE\"], \"RICINIC\": [\"PERTAINING\", \"TO\", \"OR\", \"DERIVED\", \"FROM\", \"CASTOR\", \"OIL\", \"FORMERLY\", \"DESIGNATING\", \"AN\", \"ACID\", \"NOW\", \"CALLED\", \"RICINOLEIC\", \"ACID\"], \"TELLURAL\": [\"OF\", \"OR\", \"PERTAINING\", \"TO\", \"THE\", \"EARTH\", \"[R\", \"]\"], \"OTHERNESS\": [\"THE\", \"QUALITY\", \"OR\", \"STATE\", \"OF\", \"BEING\", \"OTHER\", \"OR\", \"DIFFERENT\", \"ALTERITY\", \"OPPOSITENESS\"], \"FASCICLE\": [\"A\", \"SMALL\", \"BUNDLE\", \"OR\", \"COLLECTION\", \"A\", \"COMPACT\", \"CLUSTER\", \"AS\", \"A\", \"FASCICLEOF\", \"FIBERS\", \"A\", \"FASCICLE\", \"OF\", \"FLOWERS\", \"OR\", \"ROOTS\"], \"REENJOYMENT\": [\"RENEWED\", \"ENJOIMENT\"], \"LONGIROSTER\": [\"ONE\", \"OF\", \"THE\", \"LONGIROSTRES\"], \"RHAPSODIZE\": [\"TO\", \"UTTER\", \"AS\", \"A\", \"RHAPSODY\", \"OR\", \"IN\", \"THE\", \"MANNER\", \"OF\", \"A\", \"RHAPSODY\", \"STERNE\"], \"WATER VIOLET\": [\"SEE\", \"UNDER\", \"VIOLET\"], \"TRUNCHEONED\": [\"HAVING\", \"A\", \"TRUNCHEON\"], \"UNDERWENT\": [\"IMP\", \"OF\", \"UNDERGO\"], \"APITPAT\": [\"WITH\", \"QUICK\", \"BEATING\", \"OR\", \"PALPITATION\", \"PITAPAT\", \"CONGREVE\"], \"BRISKET\": [\"THAT\", \"PART\", \"OF\", \"THE\", \"BREAST\", \"OF\", \"AN\", \"ANIMAL\", \"WHICH\", \"EXTENDS\", \"FROM\", \"THEFORE\", \"LEGS\", \"BACK\", \"BENEATH\", \"THE\", \"RIBS\", \"ALSO\", \"APPLIED\", \"TO\", \"THE\", \"FORE\", \"PART\", \"OF\", \"AHORSE\", \"FROM\", \"THE\", \"SHOULDERS\", \"TO\", \"THE\", \"BOTTOM\", \"OF\", \"THE\", \"CHEST\"], \"KEPHALIN\": [\"ONE\", \"OF\", \"A\", \"GROUP\", \"OF\", \"NITROGENOUS\", \"PHOSPHORIZED\", \"PRINCIPLES\", \"SUPPOSEDBY\", \"THUDICHUM\", \"TO\", \"EXIST\", \"IN\", \"BRAIN\", \"TISSUE\"], \"METELY\": [\"ACCORDING\", \"TO\", \"MEASURE\", \"OR\", \"PROPORTION\", \"PROPORTIONABLE\", \"PROPORTIONATE\", \"[OBS\", \"]\"], \"JOHNSON GRASS\": [\"A\", \"TALL\", \"PERENNIAL\", \"GRASS\", \"SORGHUM\", \"HALEPENSE\", \"VALUABLE\", \"IN\", \"THESOUTHERN\", \"AND\", \"WESTERN\", \"STATES\", \"FOR\", \"PASTURE\", \"AND\", \"HAY\", \"THE\", \"ROOTSTOCKS\", \"ARELARGE\", \"AND\", \"JUICY\", \"AND\", \"ARE\", \"EAGERLY\", \"SOUGHT\", \"BY\", \"SWINE\", \"CALLED\", \"ALSO\", \"CUBAGRASS\", \"MEANS\", \"GRASS\", \"EVERGREEN\", \"MILLET\", \"AND\", \"ARABIAN\", \"MILLET\"], \"MOP\": [\"A\", \"MADE\", \"UP\", \"FACE\", \"A\", \"GRIMACE\", \"WHAT\", \"MOPS\", \"AND\", \"MOWES\", \"IT\", \"MAKES\", \"BEAU\", \"FL\"], \"SYMPOSIAC\": [\"OF\", \"OR\", \"PERTAINING\", \"TO\", \"COMPOTATIONS\", \"AND\", \"MERRYMAKING\", \"HAPPENINGWHERE\", \"COMPANY\", \"IS\", \"DRINKING\", \"TOGETHER\", \"AS\", \"SYMPOSIAC\", \"MEETINGS\", \"SYMPOSIAC\", \"DISPUTATIONS\", \"AMONGST\", \"MY\", \"ACQUAINTANCE\", \"ARBUTHNOT\"], \"ULVA\": [\"A\", \"GENUS\", \"OF\", \"THIN\", \"PAPERY\", \"BRIGHT\", \"GREEN\", \"SEAWEEDS\", \"INCLUDING\", \"THEKINDS\", \"CALLED\", \"SEA\", \"LETTUCE\"], \"-ANA\": [\"A\", \"SUFFIX\", \"TO\", \"NAMES\", \"OF\", \"PERSONS\", \"OR\", \"PLACES\", \"USED\", \"TO\", \"DENOTE\", \"ACOLLECTION\", \"OF\", \"NOTABLE\", \"SAYINGS\", \"LITERARY\", \"GOSSIP\", \"ANECDOTES\", \"ETC\", \"THUS\", \"SCALIGERANA\", \"IS\", \"A\", \"BOOK\", \"CONTAINING\", \"THE\", \"SAYINGS\", \"OF\", \"SCALIGER\", \"JOHNSONIANAOF\", \"JOHNSON\", \"ETC\"], \"PHARISEAN\": [\"FOLLOWING\", \"THE\", \"PRACTICE\", \"OF\", \"PHARISEES\", \"PHARISAIC\", \"[OBS\", \"]\", \"PHARISEAN\", \"DISCIPLES\", \"MILTON\"], \"PUTRIDNESS\": [\"PUTRIDITY\", \"FLOYER\"], \"TOUSEL\": [\"SAME\", \"AS\", \"TOUSLE\", \"[COLLOQ\", \"]\"], \"TETRAGON\": [\"A\", \"PLANE\", \"FIGURE\", \"HAVING\", \"FOUR\", \"SIDES\", \"AND\", \"ANGLES\", \"A\", \"QUADRANGLE\", \"AS\", \"ASQUARE\", \"A\", \"RHOMBUS\", \"ETC\"], \"HARELD\": [\"THE\", \"LONG\", \"TAILED\", \"DUCK\", \"SEE\", \"OLD\", \"SQUAW\"], \"PYCNOSTYLE\": [\"SEE\", \"UNDER\", \"INTERCOLUMNIATION\", \"N\"], \"BOLE\": [\"THE\", \"TRUNK\", \"OR\", \"STEM\", \"OF\", \"A\", \"TREE\", \"OR\", \"THAT\", \"WHICH\", \"IS\", \"LIKE\", \"IT\", \"ENORMOUS\", \"ELM\", \"TREE\", \"BOLES\", \"DID\", \"STOOP\", \"AND\", \"LEAN\", \"TENNYSON\"], \"BASISOLUTE\": [\"PROLONGED\", \"AT\", \"THE\", \"BASE\", \"AS\", \"CERTAIN\", \"LEAVES\"], \"HISTORIOGRAPHY\": [\"THE\", \"ART\", \"OF\", \"EMPLOYMENT\", \"OF\", \"AN\", \"HISTORIOGRAPHER\"], \"CURSORILY\": [\"IN\", \"A\", \"RUNNING\", \"OR\", \"HASTY\", \"MANNER\", \"CARELESSLY\"], \"GLOSSARIST\": [\"A\", \"WRITER\", \"OF\", \"GLOSSES\", \"OR\", \"OF\", \"A\", \"GLOSSARY\", \"A\", \"COMMENTATOR\", \"ASCHOLIAST\", \"TYRWHITT\"], \"APOTACTITE\": [\"ONE\", \"OF\", \"A\", \"SECT\", \"OF\", \"ANCIENT\", \"CHRISTIANS\", \"WHO\", \"IN\", \"SUPPOSED\", \"IMITATIONOF\", \"THE\", \"FIRST\", \"BELIEVERS\", \"RENOUNCED\", \"ALL\", \"THEIR\", \"POSSESSIONS\"], \"FRITHY\": [\"WOODY\", \"[OBS\", \"]\", \"SKELTON\"], \"ZECHIN\": [\"SEE\", \"SEQUIN\"], \"BESTAR\": [\"TO\", \"SPRINKLE\", \"WITH\", \"OR\", \"AS\", \"WITH\", \"STARS\", \"TO\", \"DECORATE\", \"WITH\", \"OR\", \"ASWITH\", \"STARS\", \"TO\", \"BESTUD\", \"BESTARRED\", \"WITH\", \"ANEMONES\", \"W\", \"BLACK\"], \"CARICATURIST\": [\"ONE\", \"WHO\", \"CARICATURES\"], \"CHAMAL\": [\"THE\", \"ANGORA\", \"GOAT\", \"SEE\", \"ANGORA\", \"GOAT\", \"UNDER\", \"ANGORA\"], \"OPINIATED\": [\"OPINIONATED\", \"[OBS\", \"]\"], \"PELICOSAURIA\": [\"A\", \"SUBORDER\", \"OF\", \"THEROMORPHA\", \"INCLUDING\", \"TERRESTRIAL\", \"REPTILES\", \"FROMTHE\", \"PERMIAN\", \"FORMATION\"], \"PICKERY\": [\"PETTY\", \"THEFT\", \"[SCOT\", \"]\", \"HOLINSHED\"], \"DOUR\": [\"HARD\", \"INFLEXIBLE\", \"OBSTINATE\", \"SOUR\", \"IN\", \"ASPECT\", \"HARDY\", \"BOLD\", \"[SCOT\", \"]A\", \"DOUR\", \"WIFE\", \"A\", \"SOUR\", \"OLD\", \"CARLIN\", \"C\", \"READE\"], \"AGERATUM\": [\"A\", \"GENUS\", \"OF\", \"PLANTS\", \"ONE\", \"SPECIES\", \"OF\", \"WHICH\", \"A\", \"MEXICANUM\", \"HASLAVENDER\", \"BLUE\", \"FLOWERS\", \"IN\", \"DENSE\", \"CLUSTERS\"], \"BEDSTAFF\": [\"A\", \"WOODEN\", \"PIN\", \"STUCK\", \"ANCIENTLY\", \"ON\", \"THE\", \"SIDES\", \"OF\", \"THE\", \"BEDSTEAD\", \"TOHOLD\", \"THE\", \"CLOTHES\", \"FROM\", \"SLIPPING\", \"ON\", \"EITHER\", \"SIDE\", \"JOHNSON\", \"HOSTESS\", \"ACCOMMODATE\", \"US\", \"WITH\", \"A\", \"BEDSTAFF\", \"B\", \"JONSON\", \"SAY\", \"THERE\", \"IS\", \"NO\", \"VIRTUE\", \"IN\", \"CUDGELS\", \"AND\", \"BEDSTAVES\", \"BROME\"], \"GLADFUL\": [\"FULL\", \"OF\", \"GLADNESS\", \"JOYFUL\", \"GLAD\", \"[R\", \"]\", \"GLAD\", \"FUL\", \"NESS\", \"N\", \"[R\", \"]SPENSER\", \"IT\", \"FOLLOWED\", \"HIM\", \"WITH\", \"GLADFUL\", \"GLEE\", \"SPENSER\"], \"INDOXYL\": [\"A\", \"NITROGENOUS\", \"SUBSTANCE\", \"C\", \"H\", \"NO\", \"ISOMERIC\", \"WITH\", \"OXINDOL\", \"OBTAINED\", \"AS\", \"AN\", \"OILY\", \"LIQUID\"], \"NOTHINGISM\": [\"NIHILITY\", \"NOTHINGNESS\", \"[R\", \"]\"], \"GNARL\": [\"TO\", \"GROWL\", \"TO\", \"SNARL\", \"AND\", \"WOLVES\", \"ARE\", \"GNARLING\", \"WHO\", \"SHALL\", \"GNAW\", \"THEE\", \"FIRST\", \"SHAK\"], \"ANGIOSPERMATOUS\": [\"SAME\", \"AS\", \"ANGIOSPERMOUS\"], \"INCUNABULUM\": [\"A\", \"WORK\", \"OF\", \"ART\", \"OR\", \"OF\", \"HUMAN\", \"INDUSTRY\", \"OF\", \"AN\", \"EARLY\", \"EPOCH\", \"ESPECIALLY\", \"A\", \"BOOK\", \"PRINTED\", \"BEFORE\", \"A\", \"D\"], \"MORIGERATION\": [\"OBSEQUIOUSNESS\", \"OBEDIENCE\", \"[OBS\", \"]\", \"EVELYN\"], \"INCOMPARED\": [\"PEERLESS\", \"INCOMPARABLE\", \"[OBS\", \"]\", \"SPENSER\"], \"OVERSWAY\": [\"TO\", \"BEAR\", \"SWAY\", \"OVER\"], \"SUBSECUTE\": [\"TO\", \"FOLLOW\", \"CLOSELY\", \"OR\", \"SO\", \"AS\", \"TO\", \"OVERTAKE\", \"TO\", \"PURSUE\", \"[OBS\", \"]TO\", \"FOLLOW\", \"AND\", \"DETAIN\", \"HIM\", \"IF\", \"BY\", \"ANY\", \"POSSIBILITY\", \"HE\", \"COULD\", \"BESUBSECUTED\", \"AND\", \"OVERTAKEN\", \"E\", \"HALL\"], \"BACILLUS\": [\"A\", \"VARIETY\", \"OF\", \"BACTERIUM\", \"A\", \"MICROSCOPIC\", \"ROD\", \"SHAPED\", \"VEGETABLEORGANISM\"], \"ETHEREALITY\": [\"THE\", \"STATE\", \"OF\", \"BEING\", \"ETHEREAL\", \"ETHEREALNESS\", \"SOMETHING\", \"OF\", \"THAT\", \"ETHEREALITY\", \"OF\", \"THOUGHT\", \"AND\", \"MANNER\", \"WHICH\", \"BELONGED\", \"TOWORDSWORTH\", \"S\", \"EARLIER\", \"LYRICS\", \"J\", \"C\", \"SHAIRP\"], \"REJOICER\": [\"ONE\", \"WHO\", \"REJOICES\"], \"SINGULT\": [\"A\", \"SIGH\", \"OR\", \"SOBBING\", \"ALSO\", \"A\", \"HICCOUGH\", \"[OBS\", \"]\", \"SPENSER\", \"W\", \"BROWNE\"], \"MELAINOTYPE\": [\"SEE\", \"MELANOTYPE\"], \"STOPPED\": [\"MADE\", \"BY\", \"COMPLETE\", \"CLOSURE\", \"OF\", \"THE\", \"MOUTH\", \"ORGANS\", \"SHUT\", \"SAID\", \"OFCERTAIN\", \"CONSONANTS\", \"P\", \"B\", \"T\", \"D\", \"ETC\", \"H\", \"SWEET\"], \"WESTERING\": [\"PASSING\", \"TO\", \"THE\", \"WEST\", \"TOWARD\", \"HEAVEN\", \"S\", \"DESCENT\", \"HAD\", \"SLOPED\", \"HIS\", \"WESTERING\", \"WHEEL\", \"MILTON\"], \"CHINAMAN\": [\"A\", \"NATIVE\", \"OF\", \"CHINA\", \"A\", \"CHINESE\"], \"FORESKIN\": [\"THE\", \"FOLD\", \"OF\", \"SKIN\", \"WHICH\", \"COVERS\", \"THE\", \"GLANS\", \"OF\", \"THE\", \"PENIS\", \"THEPREPUCE\"], \"CEPHALOTOME\": [\"AN\", \"INSTRUMENT\", \"FOR\", \"CUTTING\", \"INTO\", \"THE\", \"FETAL\", \"HEAD\", \"TO\", \"FACILITATEDELIVERY\"], \"OVERLOOKER\": [\"ONE\", \"WHO\", \"OVERLOOKS\"]\n }\n Object.keys(data).forEach(function (key) {\n let val = data[key];\n console.log(val);\n data[key].forEach(word => {\n graph.addLink(key, word);\n })\n});\n // for (let i = 0; i < data.length; i++) {\n // graph.addLink(data[i], i + 1);\n // }\n React.useEffect(() => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n renderer = Viva.Graph.View.renderer(graph, {\n container: container.current,\n graphics: graphics,\n layout: layout,\n });\n // console.log(renderer);\n renderer.run();\n\n return () => {\n renderer.dispose();\n };\n }, []);\n return (\n <div\n style={{\n backgroundColor: \"rgb(31,41,55)\",\n width: \"100%\",\n height: \"100vh\",\n }}\n ref={container}\n />\n );\n}", "title": "" }, { "docid": "6fdb18a29eb3b4e140b1b3e3f6b868c6", "score": "0.506612", "text": "function computePlane(){\n\tvar front = 0;\n\tvar rear = faceArray.size();\n\tvar p0 = new THREE.Vector3();\n\tvar n0 = new THREE.Vector3();\n\tfor(var j = 0;j < rear;j++){\n\t\tvisited[faceArray.get(j).index] = 1;\n\t\tp0.add(faceArray.get(j).centroid);\n\t\tn0.add(faceArray.get(j).normal);\n\t}\n\tp0.divideScalar(rear);\n\tn0.divideScalar(rear);\n\tn0.normalize();\n\tresult = {para1:p0, para2:n0, para3:100.0, geoType:0};\n\treturn result;\n}", "title": "" }, { "docid": "befbed87d423c1880aca467140c986be", "score": "0.5063908", "text": "function betweenerGPU() {\r\n\t\tvar betweenVectorOffset = HW3_LIBRARY.graphSize,\r\n\t\t\tdirectedGraph = HW3_LIBRARY.directedGraph[graphIndex],\r\n\t\t\ti,\r\n\t\t\trow,\r\n\t\t\trowOffset,\r\n\t\t\tgpuBuffer = gpuBufferArray[graphIndex],\r\n\t\t\tbuffer = gpuBuffer.data;\r\n\t\t\r\n\t\t//GPU work: add the connection graph columns together to get direct occurences\r\n\t\t//PERFORMANCE WIN?\r\n\t\tturbojs.run(gpuBuffer, DIRECT_CONNECTS);\r\n\t\t\r\n\t\tfor(row = 0; row < HW3_LIBRARY.cellCount; row++) {\r\n\t\t\trowOffset = row * HW3_LIBRARY.cellCount;\r\n\t\t\t\r\n\t\t\tfor(i = 0; i < HW3_LIBRARY.cellCount; i++) {\r\n\t\t\t\tif(directedGraph[rowOffset + i] === 0) {\r\n\t\t\t\t\tHW3_LIBRARY.getEncountersOfShortestPaths(directedGraph, i, row, buffer, betweenVectorOffset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//invoke GPU on gpuBuffer using ADD_ROWS shader\r\n\t\t//obsolete but I worked really hard on it and it paved the way for new computation\r\n\t\t//turbojs.run(gpuBuffer, ADD_ROWS);\r\n\t\t\r\n\t\t//Output\r\n\t\t//Either match or slight loss -depending on toString() implementation\r\n\t\tif(HW3_LIBRARY.verboseMode) {\r\n\t\t\toutput[graphIndex] = HW3_LIBRARY.stringifyMatrix(directedGraph) + buffer[betweenVectorOffset];\r\n\t\t\tfor(i = 1; i < HW3_LIBRARY.cellCount; i++) {\r\n\t\t\t\toutput[graphIndex] += \",\" + buffer[betweenVectorOffset + i];\r\n\t\t\t}\r\n\t\t\toutput[graphIndex] += \"<hr><br>\";\r\n\t\t}\r\n\t\t\r\n\t\tgraphIndex++;\r\n\t\t\r\n\t\treturn;\r\n\t}", "title": "" }, { "docid": "c36bc0d251cc3011e933dbee983daa04", "score": "0.5060064", "text": "function Mesh(vertices, faces){\n //Checks format of vertices input and formats Float32Array appropriately.\n if (vertices instanceof Array){\n if (vertices[0] instanceof Array){\n this.vertices = new Buffer('Float32',3*vertices.length);\n for (var i in vertices){\n for (var j in vertices[i]){\n this.vertices.push(vertices[i][j]);\n }\n }\n }\n else if((typeof vertices[0]) == \"number\"){\n this.vertices = new Buffer('Float32',vertices.length);\n for (var i in vertices){\n this.vertices.push(vertices[i]); \n }\n }\n else{\n throw new Error('Vertices argument is a wrongly formatted Array');\n }\n }\n else if (vertices instanceof Float32Array){\n this.vertices = vertices; //[x,y,z] Must be a 32-bit floating array \n }\n else {\n throw new Error('Vertices argument should be Array or Float32Array');\n }\n \n //Checks format of faces input and formates Uint32Array appropriately.\n if (faces instanceof Array){\n if (faces[0] instanceof Array){\n this.faces = new Buffer('Uint32',4*faces.length);\n for (var i in faces){\n for (var j in faces[i]){\n this.faces.push(faces[i][j]);\n }\n }\n }\n else if((typeof faces[0]) == \"number\"){\n this.faces = new Buffer('Uint32',faces.length);\n for (var i in faces){\n this.vertices.push(faces[i]); \n }\n }\n else{\n throw new Error('Faces argument is a wrongly formatted Array');\n }\n }\n else if (faces instanceof Uint32Array){\n this.faces = faces; //[(this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j+2]] - this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j]]), (this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j+2]+1] - this.meshList[this.meshInstances[i+6]].vertices[this.meshList[this.meshInstances[i+6]].faces[j]+1]), v3, argb color] Must be a 32-bit unsigned integer array \n }\n else {\n throw new Error('Faces argument should be Array or Uint32Array');\n }\n \n //Assigns proper prototype and calculates maxWidth\n this.prototype = MeshPrototype;\n this.maxWidth = 0;\n for (var i=0; i<this.vertices.size; i+=3) {\n var length = this.vertices.array[i]*this.vertices.array[i] + this.vertices.array[i+1]*this.vertices.array[i+1] + this.vertices.array[i+2]*this.vertices.array[i+2];\n if (this.maxWidth < length){\n this.maxWidth = length;\n }\n }\n this.maxWidth = Math.sqrt(this.maxWidth);\n}", "title": "" }, { "docid": "ad7202d1e12cb6c67ef12502870a73a0", "score": "0.5038171", "text": "static get gpuSkinning() {}", "title": "" }, { "docid": "f4b4e23ab097e91e82b7ecce1a39ae1b", "score": "0.5034982", "text": "function meshFromUV_1377(f, uCount, vCount, uStart, vStart, uLength, vLength, uJoin, vJoin)\n{\n let uMax = uJoin // Bool\n ? float_41 // (Func Int Float)\n (uCount // Int\n ) // Float\n : float_41 // (Func Int Float)\n (op_sub_754 // [!'@686.(Func '@686 '@686 '@686) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (uCount // Int\n ,1 // Int\n ) // Int\n ) // Float\n // Float\n ;\n let vMax = vJoin // Bool\n ? float_41 // (Func Int Float)\n (vCount // Int\n ) // Float\n : float_41 // (Func Int Float)\n (op_sub_754 // [!'@687.(Func '@687 '@687 '@687) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (vCount // Int\n ,1 // Int\n ) // Int\n ) // Float\n // Float\n ;\n let uvs = cartesianProduct_2010 // (Func (Array Float) (Array Float) (Func Float Float Float3) (Array Float3))\n (op_dot_dot_1762 // (Func Int Int (Array Int))\n (0 // Int\n ,uCount // Int\n ) // (Array Int)\n ,op_dot_dot_1762 // (Func Int Int (Array Int))\n (0 // Int\n ,vCount // Int\n ) // (Array Int)\n ,(u, v) => vector_98 // [(Func Float Float Float Float3) | (Func Float Float3) | (Func (Array Float) Float3) | (Func Float2 Float3)]\n (op_add_842 // [!'@690.(Func '@690 '@690 '@690) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (op_mul_886 // [!'@689.(Func '@689 '@689 '@689) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (op_div_908 // [!'@688.(Func '@688 '@688 '@688) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (u // Float\n ,uMax // Float\n ) // Float\n ,uLength // Float\n ) // Float\n ,uStart // Float\n ) // Float\n ,op_add_842 // [!'@693.(Func '@693 '@693 '@693) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (op_mul_886 // [!'@692.(Func '@692 '@692 '@692) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (op_div_908 // [!'@691.(Func '@691 '@691 '@691) | (Func Int Int Int) | (Func Float Float Float) | (Func Float2 Float2 Float2) | (Func Float3 Float3 Float3)]\n (v // Float\n ,vMax // Float\n ) // Float\n ,vLength // Float\n ) // Float\n ,vStart // Float\n ) // Float\n ,0 // Int\n ) // Float3\n // (Func Float Float Float3)\n ) // (Array Float3)\n ;\n let points = map_53 // (Func (Array Float3) (Func Float3 Float3) (Array Float3))\n (uvs // (Array Float3)\n ,(uvw) => f // (Func Float Float Float3)\n (x_134 // (Func Float3 Float)\n (uvw // Float3\n ) // Float\n ,y_149 // (Func Float3 Float)\n (uvw // Float3\n ) // Float\n ) // Float3\n // (Func Float3 Float3)\n ) // (Array Float3)\n ;\n let indices = quadStripToMeshIndices_1078 // (Func (Array Float3) Int Bool Bool (Array Int))\n (points // (Array Float3)\n ,vCount // Int\n ,uJoin // Bool\n ,vJoin // Bool\n ) // (Array Int)\n ;\n return mesh_113 // [(Func (Array Float3) (Array Int) (Array Float3) (Array Float3) Mesh) | (Func (Array Float3) Mesh) | !'@694!'@695!'@696.(Func '@694 '@695 '@696) | (Func (Array Float3) (Array Int) Mesh) | (Func (Array Float3) (Array Int) (Array Float3) Mesh)]\n (points // (Array Float3)\n ,indices // (Array Int)\n ,uvs // (Array Float3)\n ) // Mesh\n ;\n}", "title": "" }, { "docid": "601787021a72da2771609dc940f69d80", "score": "0.5034321", "text": "function update_renderer() {\n clear_scene();\n\n $.each(points, function(idx, val) {\n var color = red;\n if(idx === 0) {\n color = green; // Start node\n }\n else if(idx === 1) {\n color = white; // End node\n }\n var node = new THREE.Mesh(new THREE.SphereGeometry(100000, 8, 8), color);\n objects.push(node);\n translate_to(node, val);\n scene.add(node);\n });\n\n // Draw line segments. Solution segments with different color\n $.each(solution.graph, function(row, row_data) {\n $.each(row_data, function(col, val) {\n if(val === 1) {\n connect(points[row], points[col], lineMat2);\n }\n else if(val === 2) {\n connect(points[row], points[col], lineMat);\n }\n });\n });\n render();\n }", "title": "" }, { "docid": "dfe99e8874491ddb34265b594f7f5589", "score": "0.5032669", "text": "function mesh_113(vertexBuffer, indexBuffer, uvBuffer)\n{\n return mesh_2107 // [(Func (Array Float3) (Array Int) (Array Float3) (Array Float3) Mesh) | !'@163!'@164.(Func '@163 '@164) | !'@165!'@166!'@167.(Func '@165 '@166 '@167) | !'@168!'@169!'@170.(Func '@168 '@169 '@170) | !'@171!'@172!'@173!'@174.(Func '@171 '@172 '@173 '@174)]\n (vertexBuffer // (Array Float3)\n ,indexBuffer // (Array Int)\n ,uvBuffer // (Array Float3)\n ,setAll_2034 // (Func (Array Float3) Float3 (Array Float3))\n (vertexBuffer // (Array Float3)\n ,origin // Float3\n ) // (Array Float3)\n ) // Mesh\n ;\n}", "title": "" }, { "docid": "c5433d76894f166fb383e44196fb6a70", "score": "0.50294894", "text": "function duodec(a, b, c, d, e ) \n{\n \nvar vertices = [\n // vertices of the interior cube\n vec3(r,r,r), //0\n vec3(r,r,-r), //1\n vec3(r,-r,r), //2\n vec3(r,-r,-r), //3\n vec3(-r,r,r), //4\n vec3(-r,r,-r), //5\n vec3(-r,-r,r), //6\n vec3(-r,-r,-r), //7\n //vertices of rectangle in y-z plane\n vec3(0,iGR,GR), //8\n vec3(0,iGR,-GR), //9\n vec3(0,-iGR,GR), //10\n vec3(0,-iGR,-GR), //11\n //vertices of rectangle in x-y plane\n vec3(iGR, GR,0), //12\n vec3(iGR,-GR,0), //13\n vec3(-iGR, GR,0), //14\n vec3(-iGR,-GR,0), //15\n //vertices of rectangle in x-z plane\n vec3(GR,0, iGR), //16\n vec3(GR,0,-iGR), //17\n vec3(-GR,0, iGR), //18\n vec3(-GR,0,-iGR) //19\n ];\n var vertexColors = [\n [ 0.0, 0.0, 0.0, 1.0 ], // black\n [ 1.0, 0.0, 0.0, 1.0 ], // red\n [ 1.0, 1.0, 0.0, 1.0 ], // yellow\n [ 0.0, 1.0, 0.0, 1.0 ], // green\n [ 0.0, 0.0, 1.0, 1.0 ], // blue\n [ 0.5, 0.1, 0.1, 1.0 ], // maroon\n [ 0.0, 1.0, 1.0, 1.0 ], // cyan\n [ 1.0, 0.5, 1.0, 1.0 ], // ?\n [ 0.0, 0.0, 0.0, 1.0 ], // black\n [ 1.0, 0.0, 0.0, 1.0 ], // red\n [ 1.0, 1.0, 0.0, 1.0 ], // yellow\n [ 0.0, 1.0, 0.0, 1.0 ], // green\n [ 0.0, 0.0, 1.0, 1.0 ], // blue\n [ 1.0, 0.0, 1.0, 1.0 ], // magenta\n [ 0.0, 1.0, 0.5, 1.0 ], // ?2\n [ 0.25, 0.75, 0.5, 1.0 ], // ?\n [ 0.1, 0.4, 0.45, 1.0 ], // dark turquoise\n [ 1.0, 0.0, 0.0, 1.0 ], // red\n [ 0.9, 0.9, 0.7, 1.0 ], // weird yellow\n [ 0.0, 1.0, 0.0, 1.0 ], // green\n [ 0.0, 0.0, 1.0, 1.0 ], // blue\n [ 1.0, 0.0, 1.0, 1.0 ], // magenta\n [ 0.0, 1.0, 1.0, 1.0 ], // cyan\n [ 1.0, 1.0, 1.0, 1.0 ] // white\n ];\n\n var indices = [ a, b, c, a, c, d, a, d, e];\n\n for ( var i = 0; i < indices.length; ++i ) {\n points.push(vertices[indices[i]] );\n\n temp = (a%10);\n colors.push(master[temp]);\n }\n}", "title": "" }, { "docid": "ccb4413d94a1d94bf45070a48bc125c3", "score": "0.50127816", "text": "applyColorGradient(){\n //define color gradient for use by both vertices and edges\n\n const colorGradient = this.settings.gradientType === \"Linear\"? new LinearColorGradient(\n this.settings.startColor, this.settings.endColor, this.maxDegree - this.minDegree + 1) :\n new PolarColorGradient(this.settings.startColor, this.settings.endColor, this.maxDegree - this.minDegree + 1)\n\n if(this.settings.applyColorGradientVertex && this.settings.applyColorGradient){\n for(let i = 0; i < this.vertices.length; i++){\n colorGradient.assignColor(this.vertices[i], this.minDegree)\n if(this.vertices[i].color === undefined){ console.warn(\"Color gradient could not apply color to vertex\", this.vertices[i])}\n }\n } else{//default vertex color\n for(let i = 0; i < this.vertices.length; i++){\n this.vertices[i].color = \"rgb(0,255,255)\"\n }\n }\n if(this.settings.applyColorGradientEdge && this.settings.applyColorGradient){\n //TODO : refactor edges to use multiple colors\n //do nothing for now\n for(let j = 0; j < this.edges.length; j++){\n const v = this.vertices;\n const e = this.edges[j]\n const color1 = colorGradient.getColorGradientColor(v[e.start], this.minDegree)\n const color2 = colorGradient.getColorGradientColor(v[e.end], this.minDegree)\n this.edges[j].color = [color1, color2]\n this.edges[j].alpha = 0.5\n }\n\n } else{ //default edge colors\n for(let j = 0; j < this.edges.length; j++){\n this.edges[j].alpha = 0.1\n if(this.isThreeDimensional){\n this.edges[j].color = this.edgeInitialColor;\n } else{\n this.edges[j].color = \"rgb(0,0,0)\"\n }\n }\n }\n this.settings.shouldRecolor = false\n }", "title": "" }, { "docid": "16c896accb3d5ad0e3cb7a6ff11b4525", "score": "0.5009007", "text": "function quad(a, b, c, d,vertices,parte) {\n\n var colorAmbiente=\"\"\n var colorDifusa=\"\"\n var colorEspec=\"\"\n var colorBrillo=\"\"\n if (parte==\"hoja\"){\n\n colorAmbiente=hojaAmbient\n colorDifusa=hojaDiffuse\n colorEspec=hojaSpecular\n colorBrillo=hojaShininess\n nVertHoja+=6\n }\n if (parte==\"cazoleta\"){\n\n colorAmbiente=cazoletaAmbient\n colorDifusa=cazoletaDiffuse\n colorEspec=cazoletaSpecular\n colorBrillo=cazoletaShininess\n nVertCazoleta+=6\n }\n if (parte==\"mango\"){\n\n colorAmbiente=mangoAmbient\n colorDifusa=mangoDiffuse\n colorEspec=mangoSpecular\n colorBrillo=mangoShininess\n nVertMango+=6\n }\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = cross(t1, t2);\n var normal = vec3(normal);\n\n //Para el punto a guardo su normal, su brillo (del material indicado por el argumento parte)\n //Y el producto de la normal con el color del material\n pointsArray.push(vertices[a]);\n normalsArray.push(normal);\n materialShininessArray.push(colorBrillo)\n ambientProductArray.push(mult(lightAmbient, colorAmbiente))\n diffuseProductArray.push(mult(lightDiffuse, colorDifusa))\n specularProductArray.push(mult(lightSpecular, colorEspec))\n\n\n\n pointsArray.push(vertices[b]);\n normalsArray.push(normal);\n materialShininessArray.push(colorBrillo)\n ambientProductArray.push(mult(lightAmbient, colorAmbiente))\n diffuseProductArray.push(mult(lightDiffuse, colorDifusa))\n specularProductArray.push(mult(lightSpecular, colorEspec))\n\n pointsArray.push(vertices[c]);\n normalsArray.push(normal);\n materialShininessArray.push(colorBrillo)\n ambientProductArray.push(mult(lightAmbient, colorAmbiente))\n diffuseProductArray.push(mult(lightDiffuse, colorDifusa))\n specularProductArray.push(mult(lightSpecular, colorEspec))\n\n\n pointsArray.push(vertices[a]);\n normalsArray.push(normal);\n materialShininessArray.push(colorBrillo)\n ambientProductArray.push(mult(lightAmbient, colorAmbiente))\n diffuseProductArray.push(mult(lightDiffuse, colorDifusa))\n specularProductArray.push(mult(lightSpecular, colorEspec))\n\n pointsArray.push(vertices[c]);\n normalsArray.push(normal);\n materialShininessArray.push(colorBrillo)\n ambientProductArray.push(mult(lightAmbient, colorAmbiente))\n diffuseProductArray.push(mult(lightDiffuse, colorDifusa))\n specularProductArray.push(mult(lightSpecular, colorEspec))\n\n pointsArray.push(vertices[d]);\n normalsArray.push(normal);\n materialShininessArray.push(colorBrillo)\n ambientProductArray.push(mult(lightAmbient, colorAmbiente))\n diffuseProductArray.push(mult(lightDiffuse, colorDifusa))\n specularProductArray.push(mult(lightSpecular, colorEspec))\n}", "title": "" }, { "docid": "a2a4b7e5e07dab4104ae27d28f691888", "score": "0.5008217", "text": "mergeHarderInner(geometry, typedArrayDic, isFirst = false) {\n let gl = this._glContext.gl;\n let baseLen = this._vertices.position.length / this._vertices.components.position;\n if (this === geometry) {\n console.assert('don\\'t merge same geometry!');\n }\n\n let allVertexAttribs = Geometry._allVertexAttribs(this._vertices);\n\n allVertexAttribs.forEach((attribName)=> {\n let thisLength = this._vertices[attribName].length;\n let geomLength = geometry._vertices[attribName].length;\n\n let float32array = typedArrayDic[attribName];\n\n if (isFirst) {\n float32array.set(this._vertices[attribName], 0);\n }\n float32array.set(geometry._vertices[attribName], thisLength);\n\n this._vertices[attribName] = float32array;\n\n if (typeof this._vboObj[attribName] !== 'undefined') {\n gl.bindBuffer(gl.ARRAY_BUFFER, this._vboObj[attribName]);\n gl.bufferData(gl.ARRAY_BUFFER, this._vertices[attribName], this._performanceHint);\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\n }\n });\n\n\n for (let i = 0; i < this._indicesArray.length; i++) {\n let len = geometry._indicesArray[i].length;\n for (let j = 0; j < len; j++) {\n let idx = geometry._indicesArray[i][j];\n this._indicesArray[i].push(baseLen + idx);\n }\n if (this._materials[i]) {\n this._materials[i].setVertexN(this, this._materials[i].getVertexN(geometry));\n }\n }\n this._vertexN += geometry._vertexN;\n }", "title": "" }, { "docid": "767487c7e958f7814aa9cdd6e83d8a56", "score": "0.500714", "text": "getConnectivityTableForDirectedGraph() {\n for (let i = 0; i < this.currentVertices; i++) {\n minimumSpanningTree.getMSTFromDepthFirstSearch(this, i); //created and exported Object\n this.unMarkAllVertexAsUnvisited(); //un-marking so that next operation could be performed on the graph\n }\n }", "title": "" }, { "docid": "fe34d9ee114b4b9ac1e8876c73fcc22e", "score": "0.5003845", "text": "separate() {\n this.res.zero();\n\n let m;\n let count = 0;\n scene.entities.forEach(e => {\n if (e !== this.entity) {\n \n Vec2.sub(this._temp, this.entity.pos, e.pos);\n m = this._temp.mag();\n\n if (m < this.minDistance && m > 0) {\n count++;\n this._temp.normalize();\n this._temp.div(m);\n this.res.add(this._temp.x, this._temp.y);\n }\n }\n });\n\n if (count > 0) {\n this.res.div(count);\n this.res.normalize();\n this.res.mult(100);//window.maxSteer);\n\n let steer = this.res.clone();\n steer.sub(this.entity.vel);\n\n steer.limit(window.maxTest);\n\n this.applyForce(steer);\n }\n }", "title": "" }, { "docid": "19c63f2e8421e76a017b3120a3a67f4a", "score": "0.49993733", "text": "function algo(publicAPI,model,numberOfInputs,numberOfOutputs){if(model.inputData){model.inputData=model.inputData.map(_vtk2.default);}else{model.inputData=[];}if(model.inputConnection){model.inputConnection=model.inputConnection.map(_vtk2.default);}else{model.inputConnection=[];}if(model.output){model.output=model.output.map(_vtk2.default);}else{model.output=[];}if(model.inputArrayToProcess){model.inputArrayToProcess=model.inputArrayToProcess.map(_vtk2.default);}else{model.inputArrayToProcess=[];}// Cache the argument for later manipulation\nmodel.numberOfInputs=numberOfInputs;// Methods\nfunction setInputData(dataset){var port=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(model.deleted){vtkErrorMacro('instance deleted - cannot call any method');return;}if(port>=model.numberOfInputs){var msg='algorithm '+publicAPI.getClassName()+' only has ';msg+=''+model.numberOfInputs;msg+=' input ports. To add more input ports, use addInputData()';vtkErrorMacro(msg);return;}if(model.inputData[port]!==dataset||model.inputConnection[port]){model.inputData[port]=dataset;model.inputConnection[port]=null;if(publicAPI.modified){publicAPI.modified();}}}function getInputData(){var port=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(model.inputConnection[port]){model.inputData[port]=model.inputConnection[port]();}return model.inputData[port];}function setInputConnection(outputPort){var port=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(model.deleted){vtkErrorMacro('instance deleted - cannot call any method');return;}if(port>=model.numberOfInputs){var msg='algorithm '+publicAPI.getClassName()+' only has ';msg+=''+model.numberOfInputs;msg+=' input ports. To add more input ports, use addInputConnection()';vtkErrorMacro(msg);return;}model.inputData[port]=null;model.inputConnection[port]=outputPort;}function getInputConnection(){var port=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return model.inputConnection[port];}function addInputConnection(outputPort){if(model.deleted){vtkErrorMacro('instance deleted - cannot call any method');return;}model.numberOfInputs++;setInputConnection(outputPort,model.numberOfInputs-1);}function addInputData(dataset){if(model.deleted){vtkErrorMacro('instance deleted - cannot call any method');return;}model.numberOfInputs++;setInputData(dataset,model.numberOfInputs-1);}function getOutputData(){var port=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(model.deleted){vtkErrorMacro('instance deleted - cannot call any method');return null;}if(publicAPI.shouldUpdate()){publicAPI.update();}return model.output[port];}publicAPI.shouldUpdate=function(){var localMTime=model.mtime;var count=numberOfOutputs;var minOutputMTime=Infinity;while(count--){if(!model.output[count]){return true;}var mt=model.output[count].getMTime();if(mt<localMTime){return true;}if(mt<minOutputMTime){minOutputMTime=mt;}}count=model.numberOfInputs;while(count--){if(model.inputConnection[count]&&model.inputConnection[count].filter.shouldUpdate()){return true;}}count=model.numberOfInputs;while(count--){if(publicAPI.getInputData(count)&&publicAPI.getInputData(count).getMTime()>minOutputMTime){return true;}}return false;};function getOutputPort(){var port=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var outputPortAccess=function outputPortAccess(){return getOutputData(port);};// Add reference to filter\noutputPortAccess.filter=publicAPI;return outputPortAccess;}// Handle input if needed\nif(model.numberOfInputs){// Reserve inputs\nvar count=model.numberOfInputs;while(count--){model.inputData.push(null);model.inputConnection.push(null);}// Expose public methods\npublicAPI.setInputData=setInputData;publicAPI.setInputConnection=setInputConnection;publicAPI.addInputData=addInputData;publicAPI.addInputConnection=addInputConnection;publicAPI.getInputData=getInputData;publicAPI.getInputConnection=getInputConnection;}if(numberOfOutputs){publicAPI.getOutputData=getOutputData;publicAPI.getOutputPort=getOutputPort;}publicAPI.update=function(){var ins=[];if(model.numberOfInputs){var _count=0;while(_count<model.numberOfInputs){ins[_count]=publicAPI.getInputData(_count);_count++;}}if(publicAPI.shouldUpdate()&&publicAPI.requestData){publicAPI.requestData(ins,model.output);}};publicAPI.getNumberOfInputPorts=function(){return model.numberOfInputs;};publicAPI.getNumberOfOutputPorts=function(){return numberOfOutputs;};publicAPI.getInputArrayToProcess=function(inputPort){var arrayDesc=model.inputArrayToProcess[inputPort];var ds=model.inputData[inputPort];if(arrayDesc&&ds){return ds['get'+arrayDesc.fieldAssociation]().getArray(arrayDesc.arrayName);}return null;};publicAPI.setInputArrayToProcess=function(inputPort,arrayName,fieldAssociation){var attributeType=arguments.length>3&&arguments[3]!==undefined?arguments[3]:'Scalars';while(model.inputArrayToProcess.length<inputPort){model.inputArrayToProcess.push(null);}model.inputArrayToProcess[inputPort]={arrayName:arrayName,fieldAssociation:fieldAssociation,attributeType:attributeType};};}// ----------------------------------------------------------------------------", "title": "" }, { "docid": "0d44bbe0fb29d5ee0b7398620f6ae76b", "score": "0.49921927", "text": "edgeElasticity(edge) { return 32 }", "title": "" }, { "docid": "69175d256a372b8abf39da8a22e0ad3d", "score": "0.49855503", "text": "get subMeshCount() {}", "title": "" }, { "docid": "8cfb749c856ef1d8bc5ffe8cc0279620", "score": "0.49793318", "text": "function preCompute() {\n // Reset edges of vertices\n vertices.forEach(v => {\n v.inEdges = [];\n v.outEdges = [];\n });\n\n edges.forEach(e => {\n e.source.outEdges.push(e);\n e.target.inEdges.push(e);\n });\n\n // Utitlity\n n = vertices.length;\n }", "title": "" }, { "docid": "cce3562d68982eba379e07225be63a94", "score": "0.4979046", "text": "function march_gpu(grid_p, grid_val, normals, shape_in, ntriang, edgeTable, triTable)\n{\n\tvar isolevel = 0;\t//We set this\n\t//var triangles;\t//Shouldn't be needed because we have the shape setup?\n\t\n\t//var i;\n\tvar ntriang;\n\tvar cubeindex;\n\tvar vertlist = [];\n\t\n\n\t/*\n\t Determine the index into the edge table which\n\t tells us which vertices are inside of the surface\n\t*/\n\tcubeindex = 0;\n\tif (grid_val[0] < isolevel) cubeindex |= 1;\n\tif (grid_val[1] < isolevel) cubeindex |= 2;\n\tif (grid_val[2] < isolevel) cubeindex |= 4;\n\tif (grid_val[3] < isolevel) cubeindex |= 8;\n\tif (grid_val[4] < isolevel) cubeindex |= 16;\n\tif (grid_val[5] < isolevel) cubeindex |= 32;\n\tif (grid_val[6] < isolevel) cubeindex |= 64;\n\tif (grid_val[7] < isolevel) cubeindex |= 128;\n\n\t/* Cube is entirely in/out of the surface */\n\tif (edgeTable[cubeindex] == 0)\n\t return(ntriang);\n\n\t/* Find the vertices where the surface intersects the cube */\n\tif (edgeTable[cubeindex] & 1)\n\t vertlist[0] =\n\t\t VertexInterp(isolevel,grid_p[0],grid_p[1],grid_val[0],grid_val[1]);\n\tif (edgeTable[cubeindex] & 2)\n\t vertlist[1] =\n\t\t VertexInterp(isolevel,grid_p[1],grid_p[2],grid_val[1],grid_val[2]);\n\tif (edgeTable[cubeindex] & 4)\n\t vertlist[2] =\n\t\t VertexInterp(isolevel,grid_p[2],grid_p[3],grid_val[2],grid_val[3]);\n\tif (edgeTable[cubeindex] & 8)\n\t vertlist[3] =\n\t\t VertexInterp(isolevel,grid_p[3],grid_p[0],grid_val[3],grid_val[0]);\n\tif (edgeTable[cubeindex] & 16)\n\t vertlist[4] =\n\t\t VertexInterp(isolevel,grid_p[4],grid_p[5],grid_val[4],grid_val[5]);\n\tif (edgeTable[cubeindex] & 32)\n\t vertlist[5] =\n\t\t VertexInterp(isolevel,grid_p[5],grid_p[6],grid_val[5],grid_val[6]);\n\tif (edgeTable[cubeindex] & 64)\n\t vertlist[6] =\n\t\t VertexInterp(isolevel,grid_p[6],grid_p[7],grid_val[6],grid_val[7]);\n\tif (edgeTable[cubeindex] & 128)\n\t vertlist[7] =\n\t\t VertexInterp(isolevel,grid_p[7],grid_p[4],grid_val[7],grid_val[4]);\n\tif (edgeTable[cubeindex] & 256)\n\t vertlist[8] =\n\t\t VertexInterp(isolevel,grid_p[0],grid_p[4],grid_val[0],grid_val[4]);\n\tif (edgeTable[cubeindex] & 512)\n\t vertlist[9] =\n\t\t VertexInterp(isolevel,grid_p[1],grid_p[5],grid_val[1],grid_val[5]);\n\tif (edgeTable[cubeindex] & 1024)\n\t vertlist[10] =\n\t\t VertexInterp(isolevel,grid_p[2],grid_p[6],grid_val[2],grid_val[6]);\n\tif (edgeTable[cubeindex] & 2048)\n\t vertlist[11] =\n\t\t VertexInterp(isolevel,grid_p[3],grid_p[7],grid_val[3],grid_val[7]);\n\n\t/* Create the triangle */\n\tvar pos0;\n\tvar pos1;\n\tvar pos2;\n\tfor (var i=0; triTable[cubeindex][i]!=-1; i+=3) {\n\t //triangles[ntriang].p[0] = vertlist[triTable[cubeindex][i ]];\n\t //triangles[ntriang].p[1] = vertlist[triTable[cubeindex][i+1]];\n\t //triangles[ntriang].p[2] = vertlist[triTable[cubeindex][i+2]];\n\t\tpos0 = vertlist[triTable[cubeindex][i ]];\n\t\tpos1 = vertlist[triTable[cubeindex][i+1]];\n\t\tpos2 = vertlist[triTable[cubeindex][i+2]];\n\t \n\t\tshape_in.positions.push(pos0, pos1, pos2);\n\t\tshape_in.indices.push(ntriang*3, ntriang*3+1, ntriang*3+2);\n\t\t \n\t\t//shape_in.normals.push(vec3(0,1,0), vec3(0,1,0), vec3(0,1,0));\t//TODO: Generate normals with the gradient of the density function\n\t\t//Generate 3 normals, one for each vertex sent in\n\t\t//Need to do the interpolation between the normals from the vertices\n\t\t//pos0 first:\n\t\tif(Math.abs(pos0[0] - Math.trunc(pos0[0])) < 0.01 && Math.abs(pos0[1] - Math.trunc(pos0[1])) < 0.01 && Math.abs(pos0[2] - Math.trunc(pos0[2])) < 0.01)\t//Trunc to deal with negatives correctly\n\t\t{\n\t\t\tvar norm_coord = vec3(Math.round(pos0[0]), Math.round(pos0[1]), Math.round(pos0[2]));\n\t\t\tshape_in.normals.push(normals[(norm_coord[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(norm_coord[2]+65536)%RES_RATIO*(RES_RATIO+1)+(norm_coord[0]+65536)%RES_RATIO]);\n\t\t}\n\t\telse if (Math.abs(pos0[0] - Math.trunc(pos0[0])) > 0.01)\t//Vertex is on x-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.floor(pos0[0]), Math.round(pos0[1]), Math.round(pos0[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.ceil(pos0[0]), Math.round(pos0[1]), Math.round(pos0[2]));\n\t\t\tvar lerp_x = pos0[0] - Math.trunc(pos0[0]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse if (Math.abs(pos0[1] - Math.trunc(pos0[1])) > 0.01)\t//Vertex is on y-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.round(pos0[0]), Math.floor(pos0[1]), Math.round(pos0[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.round(pos0[0]), Math.ceil(pos0[1]), Math.round(pos0[2]));\n\t\t\tvar lerp_x = pos0[1] - Math.trunc(pos0[1]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse if (Math.abs(pos0[2] - Math.trunc(pos0[2])) > 0.01)\t//Vertex is on z-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.round(pos0[0]), Math.round(pos0[1]), Math.floor(pos0[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.round(pos0[0]), Math.round(pos0[1]), Math.ceil(pos0[2]));\n\t\t\tvar lerp_x = pos0[2] - Math.trunc(pos0[2]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse console.log(\"Hey, something broke in the marching cubes normal gen\");\n\t\t\n\t\t//And now for pos1 and pos2, a similar treatment:\n\t\tif(Math.abs(pos1[0] - Math.trunc(pos1[0])) < 0.01 && Math.abs(pos1[1] - Math.trunc(pos1[1])) < 0.01 && Math.abs(pos1[2] - Math.trunc(pos1[2])) < 0.01)\t//Trunc to deal with negatives correctly\n\t\t{\n\t\t\tvar norm_coord = vec3(Math.round(pos1[0]), Math.round(pos1[1]), Math.round(pos1[2]));\n\t\t\tshape_in.normals.push(normals[(norm_coord[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(norm_coord[2]+65536)%RES_RATIO*(RES_RATIO+1)+(norm_coord[0]+65536)%RES_RATIO]);\n\t\t}\n\t\telse if (Math.abs(pos1[0] - Math.trunc(pos1[0])) > 0.01)\t//Vertex is on x-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.floor(pos1[0]), Math.round(pos1[1]), Math.round(pos1[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.ceil(pos1[0]), Math.round(pos1[1]), Math.round(pos1[2]));\n\t\t\tvar lerp_x = pos1[0] - Math.trunc(pos1[0]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse if (Math.abs(pos1[1] - Math.trunc(pos1[1])) > 0.01)\t//Vertex is on y-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.round(pos1[0]), Math.floor(pos1[1]), Math.round(pos1[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.round(pos1[0]), Math.ceil(pos1[1]), Math.round(pos1[2]));\n\t\t\tvar lerp_x = pos1[1] - Math.trunc(pos1[1]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse if (Math.abs(pos1[2] - Math.trunc(pos1[2])) > 0.01)\t//Vertex is on z-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.round(pos1[0]), Math.round(pos1[1]), Math.floor(pos1[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.round(pos1[0]), Math.round(pos1[1]), Math.ceil(pos1[2]));\n\t\t\tvar lerp_x = pos1[2] - Math.trunc(pos1[2]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse console.log(\"Hey, something broke in the marching cubes normal gen\");\n\t\t\n\t\t//pos2:\n\t\tif(Math.abs(pos2[0] - Math.trunc(pos2[0])) < 0.01 && Math.abs(pos2[1] - Math.trunc(pos2[1])) < 0.01 && Math.abs(pos2[2] - Math.trunc(pos2[2])) < 0.01)\t//Trunc to deal with negatives correctly\n\t\t{\n\t\t\tvar norm_coord = vec3(Math.round(pos2[0]), Math.round(pos2[1]), Math.round(pos2[2]));\n\t\t\tshape_in.normals.push(normals[(norm_coord[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(norm_coord[2]+65536)%RES_RATIO*(RES_RATIO+1)+(norm_coord[0]+65536)%RES_RATIO]);\n\t\t}\n\t\telse if (Math.abs(pos2[0] - Math.trunc(pos2[0])) > 0.01)\t//Vertex is on x-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.floor(pos2[0]), Math.round(pos2[1]), Math.round(pos2[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.ceil(pos2[0]), Math.round(pos2[1]), Math.round(pos2[2]));\n\t\t\tvar lerp_x = pos2[0] - Math.trunc(pos2[0]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse if (Math.abs(pos2[1] - Math.trunc(pos2[1])) > 0.01)\t//Vertex is on y-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.round(pos2[0]), Math.floor(pos2[1]), Math.round(pos2[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.round(pos2[0]), Math.ceil(pos2[1]), Math.round(pos2[2]));\n\t\t\tvar lerp_x = pos2[1] - Math.trunc(pos2[1]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse if (Math.abs(pos2[2] - Math.trunc(pos2[2])) > 0.01)\t//Vertex is on z-parallel line\n\t\t{\n\t\t\tvar lerp_pos1 = vec3(Math.round(pos2[0]), Math.round(pos2[1]), Math.floor(pos2[2]));\t//The distinction between x,y,z is here\n\t\t\tvar lerp_pos2 = vec3(Math.round(pos2[0]), Math.round(pos2[1]), Math.ceil(pos2[2]));\n\t\t\tvar lerp_x = pos2[2] - Math.trunc(pos2[2]);\t//Also, these are different\n\t\t\tvar lerp_val1 = normals[(lerp_pos1[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos1[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos1[0]+65536)%RES_RATIO];\n\t\t\tvar lerp_val2 = normals[(lerp_pos2[1]+65536)%RES_RATIO*(RES_RATIO+1)*(RES_RATIO+1)+(lerp_pos2[2]+65536)%RES_RATIO*(RES_RATIO+1)+(lerp_pos2[0]+65536)%RES_RATIO];\n\t\t\tshape_in.normals.push(normalize(lerpvec3(lerp_val1, lerp_val2, lerp_x)));\t\t\t\n\t\t}\n\t\telse console.log(\"Hey, something broke in the marching cubes normal gen\");\n\t\t\n\t\tntriang++;\n\t}\n\n\treturn(ntriang);\n}", "title": "" }, { "docid": "5c5a05822b960755da66cb4bb7704c4f", "score": "0.49741703", "text": "getConvergence () {\n if (this.previousPositions.length < 10) return 999999;\n\n let prevX = 0.0;\n let prevY = 0.0;\n let currX = 0.0;\n let currY = 0.0;\n\n // average 5 previous positions\n for (let i = 0; i < 5; i++) {\n for (let j = 0; j < this.numPatches; j++) {\n prevX += this.previousPositions[i][j][0];\n prevY += this.previousPositions[i][j][1];\n }\n }\n prevX /= 5;\n prevY /= 5;\n\n // average 5 positions before that\n for (let i = 5; i < 10; i++) {\n for (let j = 0; j < this.numPatches; j++) {\n currX += this.previousPositions[i][j][0];\n currY += this.previousPositions[i][j][1];\n }\n }\n currX /= 5;\n currY /= 5;\n\n // calculate difference\n const diffX = currX - prevX;\n const diffY = currY - prevY;\n let msavg = ((diffX * diffX) + (diffY * diffY));\n msavg /= this.previousPositions.length\n return msavg;\n }", "title": "" }, { "docid": "fd3fb2a4437008ca431a1aa7317a6600", "score": "0.49733627", "text": "function Graph()\r\n{\r\n \r\n this.VT = [];\r\n this.vert = [];\r\n\tthis.nv = 0; // ... (complete next)\r\n\tthis.ne = 0; \r\n this.digraph = false; \r\n this.weighted = false; \r\n\tthis.dfs_push = []; \r\n this.bfs_order = []; \r\n this.dfs_pop = []; \r\n this.label = \"\"; \r\n this.connectedComp = 0; \r\n this.adjMatrix = []; \r\n\r\n\t// member methods\r\n\t\r\n\tthis.read_graph = better_input; // ... (complete next)\r\n\tthis.readGraph = better_input; \r\n this.addEdge = addEdgeImpl2; \r\n\tthis.printGraph = printGraphImpl; \r\n\tthis.list_vert = \"\";\r\n\tthis.dfs = dfsImpl; \r\n this.bfs = bfsImpl; \r\n\tthis.makeAdjMatrix = makeAdjMatrixImpl2; \r\n this.isConnected = isConnectedImpl; \r\n this.componentInfo = componentInfoImpl; \r\n this.topoSearch = topoSearchImpl; \r\n this.prim = primImpl; \r\n this.prim1 = primImpl1;\r\n this.prim2 = primImpl2; \r\n this.make_graph = make_graphImpl; \r\n}", "title": "" }, { "docid": "cf9ddd585ca644511d5a891c7bd3669d", "score": "0.49724385", "text": "createTileMaps() {\n if ((this.m_volumeData === null) || (this.m_volumeHeader === null)) {\n return;\n }\n // this.m_volTexture is null before smooth shader\n const volTexture = this.m_volTexture;\n const xDim = this.m_volumeHeader.m_pixelWidth;\n const yDim = this.m_volumeHeader.m_pixelHeight;\n const zDim = this.m_volumeHeader.m_pixelDepth;\n\n // const off = xDim/2 + (yDim/2) * xDim + (zDim/2)*xDim*yDim;\n // const valLog = this.m_volumeData[off];\n // console.log(`createTileMaps with ${valLog}`);\n\n // remove old rendered mesh\n if (this.m_mesh !== null) {\n this.m_scene.remove(this.m_mesh);\n this.m_mesh = null;\n this.m_material = null;\n }\n\n this.m_matIndex = -1;\n // let numMaterials = 0;\n // let w = 0;\n // let h = 0;\n let wPhys = 0.0;\n let hPhys = 0.0;\n\n //\n // 2 3\n //\n // 0 1\n //\n this.m_geometry.faceVertexUvs[0][0][0].y = 1.0;\n this.m_geometry.faceVertexUvs[0][0][1].y = 1.0;\n this.m_geometry.faceVertexUvs[0][0][2].y = 0.0;\n this.m_geometry.faceVertexUvs[0][1][0].y = 0.0;\n this.m_geometry.faceVertexUvs[0][1][1].y = 0.0;\n this.m_geometry.faceVertexUvs[0][1][2].y = 1.0;\n\n if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Z) {\n // Transverse (Z)\n // w = xDim;\n // h = yDim;\n // const xyDim = xDim * yDim;\n wPhys = this.m_volumeBox.x;\n hPhys = this.m_volumeBox.y;\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Y) {\n // Coronal (Y)\n // w = xDim;\n // h = zDim;\n // const xyDim = xDim * yDim;\n wPhys = this.m_volumeBox.x;\n hPhys = this.m_volumeBox.z;\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_X) {\n // Sagital (X)\n // w = yDim;\n // h = zDim;\n // const xyDim = xDim * yDim;\n wPhys = this.m_volumeBox.y;\n hPhys = this.m_volumeBox.z;\n }\n\n //\n // fix screen coordinates\n //\n // v2 ----- v3\n // | |\n // | |\n // v0 ----- v1\n const wScreen = this.m_width;\n const hScreen = this.m_height;\n\n // m_wProjScreen and m_hProjScreen\n // are parameters, described working rectangle area of rendered texture.\n // Both parameters are in range [0..1]\n // They need to keep correct aspect ratio for 2d image despite n real browser window dimensions\n this.m_wProjScreen = wScreen;\n this.m_hProjScreen = this.m_wProjScreen * hPhys / wPhys;\n if (this.m_hProjScreen > hScreen) {\n this.m_hProjScreen = hScreen;\n this.m_wProjScreen = this.m_hProjScreen * wPhys / hPhys;\n if (this.m_wProjScreen > wScreen) {\n console.log('Too bad logic');\n }\n }\n // normalize to [0..1]\n this.m_wProjScreen /= wScreen;\n this.m_hProjScreen /= hScreen;\n\n // console.log(`wProjScreen = ${this.m_wProjScreen} hProjScreen = ${this.m_hProjScreen}`);\n\n // scale to 2: screen size in [0..2]\n const MULT_TWICE = 2;\n const wProjScreen = this.m_wProjScreen * MULT_TWICE;\n const hProjScreen = this.m_hProjScreen * MULT_TWICE;\n\n this.m_geometry.vertices[2].x = -1.0;\n this.m_geometry.vertices[2].y = +1.0;\n this.m_geometry.vertices[0].x = -1.0;\n this.m_geometry.vertices[3].y = +1.0;\n\n // assign screen rect to render , in [-1..+1]\n this.m_geometry.vertices[1].x = wProjScreen - 1.0;\n this.m_geometry.vertices[3].x = wProjScreen - 1.0;\n this.m_geometry.vertices[0].y = 1.0 - hProjScreen;\n this.m_geometry.vertices[1].y = 1.0 - hProjScreen;\n\n this.m_geometry.verticesNeedUpdate = true;\n this.m_geometry.uvsNeedUpdate = true;\n\n const matTex2d = new MaterialTex2d();\n this.m_materialsTex2d = matTex2d;\n // this.m_materialsTex2d.push(matTex2d);\n\n const sliceIndex = Math.floor(this.m_sliderPosition * zDim);\n matTex2d.create(volTexture, xDim, yDim, zDim, this.m_sliceAxis, sliceIndex, this.m_isRoiVolume);\n const mat = matTex2d.m_material;\n if (this.m_material === null) {\n this.m_material = mat;\n this.m_mesh = new THREE.Mesh(this.m_geometry, this.m_material);\n this.m_scene.add(this.m_mesh);\n }\n this.updateTexMapWithNewSliderPos();\n\n this.createMarkLinesAndText();\n const SCREEN_MULT = 2.0;\n // update 2d tools with new volume data\n if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Z) {\n this.m_distanceTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_areaTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_rectTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_textTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_deleteTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_editTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n this.m_contrastBrightTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.y / (SCREEN_MULT * this.m_hProjScreen));\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_Y) {\n this.m_distanceTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_areaTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_rectTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_textTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_deleteTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_editTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_contrastBrightTool.setPixelSize(this.m_volumeBox.x / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n } else if (this.m_sliceAxis === Graphics2d.SLICE_AXIS_X) {\n this.m_distanceTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_areaTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_rectTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_textTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_deleteTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_editTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n this.m_contrastBrightTool.setPixelSize(this.m_volumeBox.y / (SCREEN_MULT * this.m_wProjScreen),\n this.m_volumeBox.z / (SCREEN_MULT * this.m_hProjScreen));\n }\n this.m_pickTool.setProjScreen(this.m_wProjScreen, this.m_hProjScreen);\n this.m_pickTool.setHeader(this.m_volumeHeader);\n this.m_pickTool.setData(this.m_volumeData);\n this.m_materialsTex2d.m_uniforms.xPixelSize.value = 1 / this.m_volumeHeader.m_pixelWidth;\n this.m_materialsTex2d.m_uniforms.yPixelSize.value = 1 / this.m_volumeHeader.m_pixelHeight;\n\n this.m_readyCounter++;\n // console.log('Graphics2d.createTileMaps() is finished');\n }", "title": "" }, { "docid": "25ffdb1fa6f3ddf4f31ca36fa0720f1d", "score": "0.4963083", "text": "function mesh_54(vertexBuffer, indexBuffer)\n{\n return mesh_36 // [(Func (Array Float3) (Array Int) (Array Float3) (Array Float3) Mesh) | !'@185!'@186.(Func '@185 '@186) | !'@187!'@188!'@189.(Func '@187 '@188 '@189) | (Func (Array Float3) (Array Int) Mesh) | (Func (Array Float3) (Array Int) (Array Float3) Mesh)]\n (vertexBuffer // '@99\n ) // '@103\n ;\n}", "title": "" }, { "docid": "efef5db04526eb6ce3d97018c2f4340c", "score": "0.49565923", "text": "updateParticles () {\n this.particles.material.size = 0.1*Math.tanh(this.analyser.barkScaleFrequencyData().overallAmplitude/100)+0.1\n this.particles.geometry.vertices.forEach( (p) => {\n p.addScaledVector(this.flow(p),0.1)\n if (vmath.distSquared(p,this.to.position)<1){\n //when it gets to the end, put it back\n p.set(( Math.random() - 1/2 ) + this.source.position.x,\n ( Math.random() - 1/2 ) + this.source.position.y,\n ( Math.random() - 1/2 ) + this.source.position.z)\n\n\n if (!this.connected) {\n if(this.to.sink){\n this.source.effect.connect(this.analyser)\n this.analyser.connect(this.to.sink)\n } else {\n this.source.effect.connect(this.analyser)\n this.analyser.connect(this.to.effect)\n }\n this.connected = true\n }\n }\n }\n )\n this.particles.geometry.verticesNeedUpdate = true\n this.particles.geometry.computeBoundingSphere()\n // this.particles.geometry.normalize()\n }", "title": "" }, { "docid": "b27401c81dd1fd749930a28d3b785969", "score": "0.49487045", "text": "function computeNodeValues(graph) {\n graph.nodes.forEach(function (node) {\n node.partOfCycle = false;\n node.value = Math.max(Object(__WEBPACK_IMPORTED_MODULE_0_d3_array__[\"e\" /* sum */])(node.sourceLinks, value), Object(__WEBPACK_IMPORTED_MODULE_0_d3_array__[\"e\" /* sum */])(node.targetLinks, value));\n node.sourceLinks.forEach(function (link) {\n if (link.circular) {\n node.partOfCycle = true;\n node.circularLinkType = link.circularLinkType;\n }\n });\n node.targetLinks.forEach(function (link) {\n if (link.circular) {\n node.partOfCycle = true;\n node.circularLinkType = link.circularLinkType;\n }\n });\n });\n }", "title": "" }, { "docid": "a03ea36ed014a57fdc3306cc43c7d27e", "score": "0.49463373", "text": "generateNormals() {\r\n var N = vec3.create();\r\n var tmp1 = vec3.create();\r\n var tmp2 = vec3.create();\r\n var tmp3 = vec3.create();\r\n var subbylad1 = vec3.create();\r\n var subbylad2 = vec3.create();\r\n // console.log(\"tmp1: \" + tmp1);\r\n // console.log(\"tmp2: \" + tmp2);\r\n\r\n // Calculate the johns! THIS SHOULD BE <, not <=. DONT RANDOMLY CHANGE THIS, IDIOT.\r\n for (var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n // First triangle in \"square div\"\r\n this.getVertex(tmp1,i,j);\r\n this.getVertex(tmp2,i,j+1);\r\n this.getVertex(tmp3,i+1,j);\r\n\r\n vec3.sub(subbylad1, tmp2, tmp1);\r\n vec3.sub(subbylad2, tmp3, tmp1);\r\n vec3.cross(N, subbylad1, subbylad2);\r\n vec3.normalize(N, N);\r\n\r\n this.updateNormal(N, i, j);\r\n this.updateNormal(N, i, j+1);\r\n this.updateNormal(N, i+1, j);\r\n \r\n // Second triangle in \"square div\"\r\n this.getVertex(tmp1,i,j+1);\r\n this.getVertex(tmp2,i+1,j+1);\r\n this.getVertex(tmp3,i+1,j);\r\n\r\n vec3.sub(subbylad1, tmp2, tmp1);\r\n vec3.sub(subbylad2, tmp3, tmp1);\r\n vec3.cross(N, subbylad1, subbylad2);\r\n vec3.normalize(N, N);\r\n\r\n this.updateNormal(N, i, j+1);\r\n this.updateNormal(N, i+1, j+1);\r\n this.updateNormal(N, i+1, j);\r\n \r\n // this.vBuffer[vid]\r\n // vec3.sub(tmp1, this.vBuffer[vid+1], this.vBuffer[vid]);\r\n // vec3.sub(tmp2, this.vBuffer[vid+this.div+1], this.vBuffer[vid]);\r\n // N1 = vec3.cross(tmp1, tmp2);\r\n \r\n // vec3.sub(tmp1, this.vBuffer[vid+1+this.div+1], this.vBuffer[vid+1]);\r\n // vec3.sub(tmp2, this.vBuffer[vid+this.div+1], this.vBuffer[vid+1]);\r\n // N2 = vec3.cross(tmp1, tmp2);\r\n \r\n // this.nBuffer[vid] = this.nBuffer[vid]+N1;\r\n // this.nBuffer[vid+1] = this.nBuffer[vid+1]+N1;\r\n // this.nBuffer[vid+this.div+1] = this.nBuffer[vid+this.div+1]+N1;\r\n\r\n // this.nBuffer[vid+1] = this.nBuffer[vid+1]+N2;\r\n // this.nBuffer[vid+1+this.div+1] = this.nBuffer[vid+1+this.div+1]+N2;\r\n // this.nBuffer[vid+this.div+1] = this.nBuffer[vid+this.div+1]+N2;\r\n \r\n\r\n /*\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+1+this.div+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n */\r\n }\r\n }\r\n\r\n // Normalize the johns!\r\n for (var i = 0; i <= this.div; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n var vid = i*(this.div+1) + j;\r\n\r\n vec3.normalize(this.nBuffer[vid], this.nBuffer[vid]);\r\n // console.log(vid);\r\n vec3.normalize(this.nBuffer[vid+1], this.nBuffer[vid+1]);\r\n // console.log(vid+1);\r\n vec3.normalize(this.nBuffer[vid+this.div+1], this.nBuffer[vid+this.div+1]);\r\n // console.log(vid+this.div+1);\r\n\r\n vec3.normalize(this.nBuffer[vid+1], this.nBuffer[vid+1]);\r\n // console.log(vid+1);\r\n vec3.normalize(this.nBuffer[vid+1+this.div+1], this.nBuffer[vid+1+this.div+1]);\r\n // console.log(vid+1+this.div+1);\r\n vec3.normalize(this.nBuffer[vid+this.div+1], this.nBuffer[vid+this.div+1]);\r\n // console.log(vid+this.div+1);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8f70415e6ed25a0baf5d130a8eac6908", "score": "0.4945876", "text": "function optimize() {\n // const allEdges = [];\n // for(let party in sharesAndTags) {\n // if(party != jiff_instance.id)\n // sharesAndTags[party].forEach(edge => {\n // allEdges.push({start:edge.start, end:edge.end, weight:Number.NEGATIVE_INFINITY});\n // });\n // }\n // edges.forEach(edge => allEdges.push(edge));\n // console.log(allEdges);\n\n const allEdges = [];\n for(let party in sharesAndTags) {\n if(party != jiff_instance.id)\n sharesAndTags[party].forEach(edge => {\n allEdges.push({start:edge.start, end:edge.end, weight:Number.NEGATIVE_INFINITY});\n });\n }\n\n // let t = localMST(allEdges);\n let t = localMST(edges, setOfNodesUnknownWeight);\n console.log(t);\n t.forEach(x => displayArc(x, 'annotation'));\n let tt = t.filter(e => e.weight != Number.NEGATIVE_INFINITY);\n console.log(tt);\n tt.forEach(x => displayArc(x, 'solution'));\n}", "title": "" }, { "docid": "7603f93ccebe32559c13ce22ef36c7cf", "score": "0.49458638", "text": "function initBuffers() {\n\n var meshCube, originalVerts;\n if (control.mesh == 1){\n meshCube = Models.cube();\n originalVerts = meshCube.vertices.length;\n } else if (control.mesh == 2) {\n meshCube = Models.cone();\n originalVerts = meshCube.vertices.length;\n } else if (control.mesh == 3) {\n meshCube = Models.torus();\n originalVerts = meshCube.vertices.length;\n } else if(control.mesh == 4) {\n meshCube = Models.cubeTwo();\n originalVerts = meshCube.vertices.length;\n } else if (control.mesh == 5) {\n meshCube = Models.monkey();\n originalVerts = meshCube.vertices.length;\n } else if (control.mesh == 6) {\n meshCube = Models.face();\n originalVerts = meshCube.vertices.length;\n } else if (control.mesh == 7) {\n meshCube = Models.sphere();\n originalVerts = meshCube.vertices.length;\n }\n\n for (var i = 0; i < control.numSubdivides; i++) {\n if (control.subScheme == 0) {\n console.log(\"Scheme is catmull\");\n meshCube = meshCube.catmullSubdivide();\n } else if (control.subScheme == 1) {\n console.log(\"scheme is doosabin\");\n meshCube = meshCube.doosabinSubdivide();\n }\n }\n\n // vertices of the cube\n var vertices = [];\n vertices = meshCube.vectorArray();\n console.log(vertices);\n // get the index array\n var vectorIndex = [];\n vectorIndex = meshCube.elementArray();\n\n // number of indexes\n numElements = vectorIndex.length;\n\n // Wireframe edges\n var wireframeVectors = [];\n wireframeVectors = meshCube.wireframeVertices();\n\n // Number of vertices in wireframe\n numVectors = wireframeVectors.length/3;\n\n // Black \n var blackColor = [0.0, 0.0, 0.0, 1.0];\n // Object color\n var modelColor = [0.4, 0.8, 0.59, 1.0];\n\n var wireframeColors = [];\n for (var c = 0; c < numVectors; c++) {\n wireframeColors.append(blackColor);\n }\n\n var colors = [\n [1.0, 1.0, 1.0, 1.0], // Front face: white\n [1.0, 0.0, 0.0, 1.0], // Back face: red\n [0.0, 1.0, 0.0, 1.0], // Top face: green\n [0.2, 0.6, 0.8], // Bottom face: blue\n [1.0, 1.0, 0.0, 1.0], // Right face: yellow\n [1.0, 0.0, 1.0, 1.0] // Left face: purple\n ];\n var modelColors = [];\n\n // for every face\n var a =3;\n for (var i = 0; i < meshCube.faces.length; i++) {\n // For every vertex of the face\n modelColors.append(colors[a]);\n modelColors.append(colors[a]);\n modelColors.append(colors[a]);\n modelColors.append(colors[a]); \n }\n\n // cubeVecBuffer\n cubeVecBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVecBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\n // Element Array\n cubeVecIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVecIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vectorIndex), gl.STATIC_DRAW);\n\n // Model colour buffer\n cubeVecColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeVecColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(modelColors), gl.STATIC_DRAW);\n\n // wireframe buffer\n cubeWireBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeWireBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(wireframeVectors), gl.STATIC_DRAW);\n\n // Wireframe colors buffer\n cubeWireColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, cubeWireColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(wireframeColors), gl.STATIC_DRAW);\n \n\n var vertexNormals = meshCube.normalArray();\n // Bind lighting normals buffer\n modelVecNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, modelVecNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexNormals), gl.STATIC_DRAW);\n console.log(vertexNormals);\n\n // Set up the data\n document.getElementById(\"originalTxt\").innerHTML = \"Original Vertices: \" + originalVerts\n document.getElementById(\"currentTxt\").innerHTML = \"Current Vertices: \" + meshCube.vertices.length;\n }", "title": "" }, { "docid": "ecbb152f355b617696d4903abfdddc40", "score": "0.49457836", "text": "get size(){// Return the triple count if if was cached.\nvar size=this._size;if(size!==null)return size;// Calculate the number of triples by counting to the deepest level.\nvar graphs=this._graphs,subjects,subject;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;}}}return this._size=size;}", "title": "" }, { "docid": "b943129c0b53e184a8ea3c3c650c2aa6", "score": "0.49441794", "text": "function plotValueFunction(){\n\n let minPlayerScore = 1000; \n let maxPlayerScore = -1000; \n let minDealerScore = 1000; \n let maxDealerScore = -1000;\n\n model.getQValue().items().forEach((arr,i)=> {\n let cState = arr[0]; \n minPlayerScore = Math.min(minPlayerScore, cState.playerScore); \n maxPlayerScore = Math.max(maxPlayerScore, cState.playerScore); \n minDealerScore = Math.min(minDealerScore, cState.dealerScore); \n maxDealerScore = Math.max(maxDealerScore, cState.dealerScore)\n }\n )\n\n const div = {x: Math.abs(minPlayerScore - maxPlayerScore) + 1, y: Math.abs(minDealerScore - maxDealerScore)+1} \n let xRange = tf.linspace(minPlayerScore, maxPlayerScore + 0, div.x).flatten().arraySync();\n let yRange = tf.linspace(minDealerScore, maxDealerScore + 0, div.y).flatten().arraySync();\n\n let mGrd = meshGrid(xRange, yRange)\n\n console.log(xRange, yRange, div, mGrd);\n let a = tf.tensor(mGrd).reshape([mGrd.length*mGrd[0].length,2]).arraySync().map(\n (a,_)=> {\n let actionValue = model.getQValue().get(\n {\n playerScore: Math.floor(a[0]), \n dealerScore: Math.floor(a[1]), \n usableAce: false \n }\n );\n actionValue = (actionValue === -1 )? [0,0] : actionValue;\n\n return Math.max(...actionValue);\n }\n )\n let b = tf.tensor(mGrd).reshape([mGrd.length*mGrd[0].length,2]).arraySync().map(\n (a,_)=> {\n let actionValue = model.getQValue().get(\n {\n playerScore: Math.floor(a[0]), \n dealerScore: Math.floor(a[1]), \n usableAce: true \n }\n );\n actionValue = (actionValue === -1 )? [0,0] : actionValue;\n\n return Math.max(...actionValue);\n }\n )\n\n a = tf.tensor(a, [mGrd.length, mGrd[0].length]).arraySync();\n b = tf.tensor(b, [mGrd.length, mGrd[0].length]).arraySync();\n\n\n console.log(xRange, yRange );\n\n const valueFnNoAceVizData = [{\n x: xRange,\n y : yRange,\n z : a,\n type: 'contour',\n\n colorscale : [[0, darkModeCols.blue()], [0.25, darkModeCols.purple()],[0.5, darkModeCols.magenta()], [.75, darkModeCols.yellow()], [1, darkModeCols.red()]],\n }];\n \n const valueFnAceVizData = [{\n x: xRange,\n y : yRange,\n z : b,\n type: 'contour',\n\n colorscale : [[0, darkModeCols.blue()], [0.25, darkModeCols.purple()],[0.5, darkModeCols.magenta()], [.75, darkModeCols.yellow()], [1, darkModeCols.red()]],\n\n }];\n\n const layoutSetting = {\n title : 'Value Function (No Ace) Plot',\n font : {\n size : 15,\n color: 'white',\n family : 'Helvetica'\n },\n paper_bgcolor : '#222633',\n\n\n }\n const layoutSetting1 = {\n title : 'Value Function (Ace) Plot',\n font : {\n size : 15,\n color: 'white',\n family : 'Helvetica'\n },\n paper_bgcolor : '#222633',\n }\n\n Plotly.newPlot('valueFnNoAceViz', valueFnNoAceVizData, layoutSetting);\n Plotly.newPlot('valueFnAceViz', valueFnAceVizData, layoutSetting1);\n \n}", "title": "" }, { "docid": "e94728910591d5fc7940c982e26c8b91", "score": "0.49428478", "text": "generateTriangles()\r\n {\r\n //Your code here\r\n var deltaX = (this.maxX - this.minX) / this.div;\r\n var deltaY = (this.maxY - this.minY) / this.div;\r\n\r\n for(var i = 0; i <= this.div; i++)\r\n for(var j = 0; j <= this.div; j++){\r\n this.vBuffer.push(this.minX + deltaX * j);\r\n this.vBuffer.push(this.minY + deltaY * i);\r\n this.vBuffer.push(0);\r\n \r\n this.cTerrain.push(0);\r\n this.cTerrain.push(0);\r\n this.cTerrain.push(0);\r\n }\r\n\r\n for(var i = 0; i < this.div; i++)\r\n for(var j = 0; j < this.div; j++){\r\n var vid = i * (this.div + 1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n\r\n this.fBuffer.push(vid + 1);\r\n this.fBuffer.push(vid + 1 + this.div + 1);\r\n this.fBuffer.push(vid + this.div + 1);\r\n }\r\n \r\n this.getIndexFromXY(-1,-1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n this.getIndexFromXY(-1,1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n this.getIndexFromXY(1,-1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n this.getIndexFromXY(1,1,this.div);\r\n this.vBuffer[this.index] = 0;\r\n\r\n this.diamondSquare(0,0,1,this.div,this.vBuffer)\r\n\r\n for(var i = 0; i <= this.div; i++) {\r\n for(var j = 0; j <= this.div; j++) {\r\n this.getNormal(this.minX + deltaX * j, this.minY + deltaY * i, this.div, this.vBuffer);\r\n for(var n_i = 0; n_i < 3; n_i++) {\r\n this.nBuffer.push(this.normal[n_i]);\r\n }\r\n }\r\n }\r\n \r\n this.addColorToTerrain(this.vBuffer, this.cTerrain,this.vBuffer.numItems);\r\n\r\n //\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n \r\n this.addColorToTerrain(this.vBuffer, this.cTerrain,this.numVertices);\r\n }", "title": "" }, { "docid": "dea6238e3b51fc3078d6b6673b9047a8", "score": "0.49428195", "text": "function mesh_81(vertexBuffer, indexBuffer)\n{\n return mesh_113 // [(Func (Array Float3) (Array Int) (Array Float3) (Array Float3) Mesh) | !'@177!'@178.(Func '@177 '@178) | !'@179!'@180!'@181.(Func '@179 '@180 '@181) | !'@182!'@183!'@184.(Func '@182 '@183 '@184) | (Func (Array Float3) (Array Int) (Array Float3) Mesh)]\n (vertexBuffer // (Array Float3)\n ,indexBuffer // (Array Int)\n ,setAll_2034 // (Func (Array Float3) Float3 (Array Float3))\n (vertexBuffer // (Array Float3)\n ,origin // Float3\n ) // (Array Float3)\n ) // Mesh\n ;\n}", "title": "" }, { "docid": "6700ff49e71e52b9b003b846a66a480d", "score": "0.49370807", "text": "for (const node of depth) {\n let weightedPosition = 0;\n let sourceLinkValue = 0;\n let totalWeightedPosition = 0;\n let totalSourceLinkValue = 0;\n for (const sourceLink of node.sourceLinks) {\n const source = sourceLink.source;\n if (source == null) {\n continue;\n }\n totalWeightedPosition += source.position * sourceLink.value;\n totalSourceLinkValue += sourceLink.value;\n // Only provide initial layout for forward links, not back edges\n if (source.depth >= node.depth) {\n continue;\n }\n weightedPosition += source.position * sourceLink.value;\n sourceLinkValue += sourceLink.value;\n }\n if (sourceLinkValue) {\n node.position = weightedPosition / sourceLinkValue;\n } else if (totalSourceLinkValue) {\n // If all source links were back-edges, then just average them all\n node.position = totalWeightedPosition / totalSourceLinkValue;\n } else {\n // If there are no source links at all, then average the target links\n // This can't happen in a normal Sankey, since all nodes with no\n // sources are in the first depth, but it can happen with a butterfly.\n let targetLinkValue = 0;\n for (const targetLink of node.targetLinks) {\n const target = targetLink.target;\n if (target == null) {\n continue;\n }\n weightedPosition += target.position * targetLink.value;\n targetLinkValue += targetLink.value;\n }\n node.position = weightedPosition / (targetLinkValue || 1);\n }\n }", "title": "" }, { "docid": "92e3ebc2a1ac24633190f6b727e9fa8f", "score": "0.49321002", "text": "get mesh() {\n return this.m_mesh;\n }", "title": "" }, { "docid": "af94d8127cb166732ebef38f605142ba", "score": "0.49269345", "text": "get vertexCount() {}", "title": "" }, { "docid": "44f23ea96e06e3f5a01c0be95b4e6ca6", "score": "0.49262643", "text": "static get stripUnusedMeshComponents() {}", "title": "" }, { "docid": "4ef1c06bf84f997f8af319c9ea987b79", "score": "0.4924967", "text": "vertexWithXY () {}", "title": "" }, { "docid": "aa15f32939d159729268057966e1b6f1", "score": "0.4918519", "text": "function renderDynamoMesh(groupData) {\n var name = groupData.name;\n var status = groupData.transactionType;\n\n if (status == \"remove\") {\n console.log(\"existing object removed\");\n // need to get ALL objects with this name\n var group = scene.getObjectByName(name);\n scene.remove(group);\n nodeGeomGroups.pop(group);\n activeNodes.pop(name);\n return;\n }\n else if (status == \"togglePreview\") {\n console.log(\"hide/show object preview\");\n var group = scene.getObjectByName(name);\n if (groupData.displayPreview == true) {\n group.visible = true;\n }\n else {\n group.visible = false;\n }\n //return;\n }\n\n // TODO Dynamic mesh - should update verts not remove\n // if object already exists remove it and redraw\n if (activeNodes.indexOf(name) >= 0) {\n console.log(\"existing object updated\");\n var group = scene.getObjectByName(name);\n scene.remove(group);\n nodeGeomGroups.pop(group);\n }\n\n // new object\n else {\n console.log(\"new object added\");\n console.log(name);\n activeNodes.push(name);\n }\n\n // Groups make working with sets of objects syntactically clearer\n // but are almost indentical to a traditional object.\n // Here each group contains all the geometry for a single active node.\n var nodeGeomGroup = new THREE.Group();\n nodeGeomGroup.name = name;\n \n // MESHES from render package\n // lists (each mesh) of lists (each meshes vertices/faces)\n var vertices = groupData.vertices;\n var normals = groupData.normals;\n\n // verify groupData contains mesh objects\n if (vertices.length > 0 /*&& faces.length > 0*/)\n {\n // for each mesh construct meshObject and add to group\n for (var i = 0; i < vertices.length; i++)\n {\n var geometry = new THREE.BufferGeometry();\n geometry.addAttribute('position', new THREE.Float32BufferAttribute(vertices[i], 3));\n geometry.addAttribute( 'normal', new THREE.Float32BufferAttribute(normals[i], 3));\n var mesh = new THREE.Mesh(geometry, material);\n var wireframe = new THREE.Mesh(geometry, wireframeMaterial);\n mesh.name = \"meshGeometry\";\n wireframe.name = \"wireframeGeometry\";\n nodeGeomGroup.add(mesh);\n nodeGeomGroup.add(wireframe);\n } \n }\n \n // TODO why do small L-shaped lines initially render for points?\n // LINES from render package\n var lines = groupData.lines;\n\n // verify groupData contains line objects\n if (lines.length > 0)\n {\n var lineMaterial = new THREE.LineBasicMaterial({\n color: 0xffffff,\n linewidth: 10 // doesn't do anything - known issue\n });\n\n // for each line construct lineObject and add to group\n for (var i = 0; i < lines.length; i++) {\n var lineGeometry = new THREE.Geometry();\n lineGeometry.vertices = [];\n\n for (var j = 0; j < lines[i].length; j += 3) {\n lineGeometry.vertices.push(new THREE.Vector3(lines[i][j], lines[i][j + 1], lines[i][j + 2]));\n }\n\n var line = new THREE.Line(lineGeometry, lineMaterial);\n line.name = \"lineGeometry\";\n nodeGeomGroup.add(line);\n }\n }\n\n // Points from render package\n var points = groupData.points;\n\n // verify groupData contains line objects\n if (points.length > 0) {\n\n var pointMaterial = new THREE.PointsMaterial({ color: 0x009eff, size: 5, sizeAttenuation: false, side: THREE.DoubleSide });\n\n // for each point set construct pointObject and add to group\n for (var i = 0; i < points.length; i++) {\n var pointGeometry = new THREE.Geometry();\n pointGeometry.vertices = [];\n\n for (var j = 0; j < points[i].length; j += 3) {\n pointGeometry.vertices.push(new THREE.Vector3(points[i][j], points[i][j + 1], points[i][j + 2]));\n }\n\n var pointCloud = new THREE.Points(pointGeometry, pointMaterial);\n pointCloud.name = \"pointGeometry\";\n nodeGeomGroup.add(pointCloud);\n }\n }\n\n // If displayPreview is false set group visible property before adding to scene\n if (groupData.displayPreview == false) {\n nodeGeomGroup.visible = false;\n }\n\n nodeGeomGroups.push(nodeGeomGroup);\n scene.add(nodeGeomGroup);\n\n console.log(scene);\n}", "title": "" }, { "docid": "5c814442b623628c7eea99b302864fa7", "score": "0.49091125", "text": "function getMeshRendererData(state) {\n\t\treturn state[/* meshRendererData */15];\n\t}", "title": "" }, { "docid": "328c4e1e2f9398c8790bbd444f63212f", "score": "0.49070525", "text": "populateGeometry(tiles, preparedVertices) {\n // Keep track of which material each texutre corresponds to.\n let materials = [];\n let materialMap = {};\n materials.push(new THREE.MeshLambertMaterial( { \n vertexColors: THREE.VertexColors,\n side: THREE.FrontSide,\n //wireframe: true,\n }));\n\n // Extract for simpler code\n let vertices = preparedVertices.vertices;\n let geometry = preparedVertices.geometry;\n\n for (let x = 0; x < wSIZE; x++) {\n for (let y = 0; y < wSIZE; y++) {\n let tile = tiles[x][y];\n // tile.draw == none -> do not draw this tile\n if (tile.draw == 'none') continue;\n\n let v00 = vertices[x][y].index;\n let v10 = vertices[x + 1][y].index;\n let v11 = vertices[x + 1][y + 1].index;\n let v01 = vertices[x][y + 1].index;\n \n let vertexColors = this.computeVertexColors(tiles[x][y], tiles[x][y+1], tiles[x+1][y], tiles[x+1][y+1]);\n\n let face1, face2;\n if (tile.orientation == 'diaga') {\n face1 = new THREE.Face3(v00,v01,v11);\n face2 = new THREE.Face3(v00,v11,v10);\n\n face1.vertexColors[0] = vertexColors[\"00\"];\n face1.vertexColors[1] = vertexColors[\"01\"];\n face1.vertexColors[2] = vertexColors[\"11\"];\n\n face2.vertexColors[0] = vertexColors[\"00\"];\n face2.vertexColors[1] = vertexColors[\"11\"];\n face2.vertexColors[2] = vertexColors[\"10\"];\n \n geometry.faceVertexUvs[0].push(diaga_uvs_0);\n geometry.faceVertexUvs[0].push(diaga_uvs_1);\n } else {\n face1 = new THREE.Face3(v00,v01,v10);\n face2 = new THREE.Face3(v10,v01,v11);\n \n face1.vertexColors[0] = vertexColors[\"00\"];\n face1.vertexColors[1] = vertexColors[\"01\"];\n face1.vertexColors[2] = vertexColors[\"10\"];\n\n face2.vertexColors[0] = vertexColors[\"10\"];\n face2.vertexColors[1] = vertexColors[\"01\"];\n face2.vertexColors[2] = vertexColors[\"11\"];\n\n geometry.faceVertexUvs[0].push(diagb_uvs_0);\n geometry.faceVertexUvs[0].push(diagb_uvs_1);\n }\n\n // Cases:\n // !tile.secondary == both tiles share the same draw mode\n\n face1.materialIndex = this.materialIndex(materials, materialMap, 'lambert', tile.texture);\n face2.materialIndex = this.materialIndex(materials, materialMap, 'lambert', (tile.secondary && tile.secondary.texture) || tile.texture);\n\n geometry.faces.push(face1);\n geometry.faces.push(face2);\n }\n }\n\n geometry.computeFaceNormals();\n geometry.computeVertexNormals();\n\n let mesh = new THREE.Mesh(new THREE.BufferGeometry().fromGeometry(geometry), materials);\n mesh.matrixAutoUpdate = false;\n return mesh;\n }", "title": "" }, { "docid": "d5774250757ae67442cad59b4d00ed21", "score": "0.49062437", "text": "adjust_vertices() {\n let num_verts = this.verts.length;\n let updated_verts = [];\n\n for (let vertex of this.verts) {\n // Create a new vertex for the one which we're about to process. We can't mutate our vertices otherwise\n // it will mess up the weighting of other vertices yet to be processed\n let new_vertex = new Vertex();\n new_vertex.pos = vertex.pos;\n new_vertex.color = vertex.color;\n updated_verts.push(new_vertex);\n\n if (Mesh.is_boundary_vertex(vertex)) {\n let neighbors = Mesh.get_boundary_neighbors(vertex);\n new_vertex.set_to_average(neighbors, [1 / 8, 1 / 8], 3 / 4);\n } else {\n let neighbors = Mesh.get_interior_neighbors(vertex);\n let num_neighbors = neighbors.length;\n let beta = (num_neighbors <= 3) ? 3 / 16 : (3 / (8 * num_neighbors));\n new_vertex.set_to_average(neighbors, Array(num_neighbors).fill(beta), (1 - num_neighbors * beta));\n }\n }\n\n // Update vertex positions once every vertex has been processed\n for (let i = 0; i < num_verts; i++) {\n let old_vertex = this.verts[i];\n let new_vertex = updated_verts[i];\n old_vertex.pos = new_vertex.pos;\n old_vertex.color = new_vertex.color;\n }\n }", "title": "" }, { "docid": "0a5073d021d9932c95b1db79b512e27c", "score": "0.49058297", "text": "handleStats(stats) {\n /* For each data point(Ex: For each API), an array of [total invocations, component name of that data point]. */\n const dataPointArray = stats.data;\n /* index and label mapping of each element in a data point. */\n const labelMapper = {};\n stats.metadata.names.forEach((value, index) => {\n labelMapper[value] = index;\n });\n /* Build data for the graph. */\n const data = [];\n dataPointArray.forEach((dataPoint) => {\n /* Filter well known components. */\n let excludeEndpoints;\n switch (this.state.graphType) {\n case 'endpoint':\n excludeEndpoints = ['AnonymousEndpoint'];\n break;\n case 'sequence':\n excludeEndpoints = ['PROXY_INSEQ', 'PROXY_OUTSEQ', 'PROXY_FAULTSEQ', 'API_OUTSEQ', 'API_INSEQ',\n 'API_FAULTSEQ', 'AnonymousSequence', 'fault'];\n break;\n default:\n excludeEndpoints = [];\n }\n const componentName = dataPoint[labelMapper.componentName];\n const validity = excludeEndpoints.indexOf(componentName) === -1;\n if (validity) {\n data.push([\n componentName,\n dataPoint[labelMapper.totalInvocations],\n ],);\n }\n });\n /* Draw the graph with received stats only if data is present after filtering. */\n if (data.length > 0) {\n this.setState({\n graphData: data,\n isLoading: false,\n });\n }\n }", "title": "" }, { "docid": "d6ba3178807bbd9aa6453e2a2cbe526b", "score": "0.49041307", "text": "function computeNodeValues() {\n nodes.forEach(scaleFunc);\n }", "title": "" }, { "docid": "c5346b47c6bbb99863053d48de3639a1", "score": "0.49038512", "text": "generateTriangles(){\r\n\t//Your code here\r\n\tvar x_amount = (this.maxX - this.minX) / this.div\r\n\tvar y_amount = (this.maxY - this.minY) / this.div\r\n\r\n\tfor (var i = 0; i <= this.div; i++) {\r\n\t\tfor (var j = 0; j <= this.div; j++) {\r\n\t\t\tthis.vBuffer.push(j*x_amount + this.minX)\r\n\t\t\tthis.vBuffer.push(this.minY + i*y_amount)\r\n\t\t\tthis.vBuffer.push(0)\r\n\r\n\t\t\t//causes bug when we would fix the normals\r\n\t\t\t// this.nBuffer.push(0)\r\n\t\t\t// this.nBuffer.push(0)\r\n\t\t\t// this.nBuffer.push(1)\r\n\t\t}\r\n\t}\r\n\r\n\tfor (var i = 0; i < this.div; i++) {\r\n\t\tfor (var j = 0; j < this.div; j++) {\r\n\r\n\t\t\tvar vid = i*(this.div+1) + j\r\n\r\n\t\t\tthis.fBuffer.push(vid)\r\n\t\t\tthis.fBuffer.push(vid + this.div+1)\r\n\t\t\tthis.fBuffer.push(vid + this.div+2)\r\n\r\n\t\t\tthis.fBuffer.push(vid)\r\n\t\t\tthis.fBuffer.push(vid+1)\r\n\t\t\tthis.fBuffer.push(vid + this.div+2)\r\n\t\t}\r\n\t}\r\n\t\r\n\tthis.numVertices = this.vBuffer.length/3;\r\n\tthis.numColors = this.vBuffer.length/3;\r\n\tthis.numFaces = this.fBuffer.length/3;\r\n}", "title": "" }, { "docid": "6f517d0149a05da9340f7d18fcfe8f5d", "score": "0.4893213", "text": "genFace( buffers, geoInfo, facePositionIndexes, materialIndex, faceNormals, faceColors, faceUVs, faceWeights, faceWeightIndices, faceLength ) {\n\n\t\t\tfor ( let i = 2; i < faceLength; i ++ ) {\n\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ 0 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ 1 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ 2 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ ( i - 1 ) * 3 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ ( i - 1 ) * 3 + 1 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ ( i - 1 ) * 3 + 2 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i * 3 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i * 3 + 1 ] ] );\n\t\t\t\tbuffers.vertex.push( geoInfo.vertexPositions[ facePositionIndexes[ i * 3 + 2 ] ] );\n\n\t\t\t\tif ( geoInfo.skeleton ) {\n\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ 0 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ 1 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ 2 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ 3 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 + 1 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 + 2 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ ( i - 1 ) * 4 + 3 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i * 4 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i * 4 + 1 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i * 4 + 2 ] );\n\t\t\t\t\tbuffers.vertexWeights.push( faceWeights[ i * 4 + 3 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ 0 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ 1 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ 2 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ 3 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 + 1 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 + 2 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ ( i - 1 ) * 4 + 3 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i * 4 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i * 4 + 1 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i * 4 + 2 ] );\n\t\t\t\t\tbuffers.weightsIndices.push( faceWeightIndices[ i * 4 + 3 ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geoInfo.color ) {\n\n\t\t\t\t\tbuffers.colors.push( faceColors[ 0 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ 1 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ 2 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ ( i - 1 ) * 3 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ ( i - 1 ) * 3 + 1 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ ( i - 1 ) * 3 + 2 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ i * 3 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ i * 3 + 1 ] );\n\t\t\t\t\tbuffers.colors.push( faceColors[ i * 3 + 2 ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geoInfo.material && geoInfo.material.mappingType !== 'AllSame' ) {\n\n\t\t\t\t\tbuffers.materialIndex.push( materialIndex );\n\t\t\t\t\tbuffers.materialIndex.push( materialIndex );\n\t\t\t\t\tbuffers.materialIndex.push( materialIndex );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geoInfo.normal ) {\n\n\t\t\t\t\tbuffers.normal.push( faceNormals[ 0 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ 1 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ 2 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ ( i - 1 ) * 3 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ ( i - 1 ) * 3 + 1 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ ( i - 1 ) * 3 + 2 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ i * 3 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ i * 3 + 1 ] );\n\t\t\t\t\tbuffers.normal.push( faceNormals[ i * 3 + 2 ] );\n\n\t\t\t\t}\n\n\t\t\t\tif ( geoInfo.uv ) {\n\n\t\t\t\t\tgeoInfo.uv.forEach( function ( uv, j ) {\n\n\t\t\t\t\t\tif ( buffers.uvs[ j ] === undefined ) buffers.uvs[ j ] = [];\n\t\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ 0 ] );\n\t\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ 1 ] );\n\t\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ ( i - 1 ) * 2 ] );\n\t\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ ( i - 1 ) * 2 + 1 ] );\n\t\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i * 2 ] );\n\t\t\t\t\t\tbuffers.uvs[ j ].push( faceUVs[ j ][ i * 2 + 1 ] );\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "63a52733b51968c117b05cb00a71457e", "score": "0.48905483", "text": "function buildGraph$2(){var graph={};// https://jsperf.com/object-keys-vs-for-in-with-closure/3\nvar models=Object.keys(conversions$2);for(var len=models.length,i=0;i<len;i++){graph[models[i]]={// http://jsperf.com/1-vs-infinity\n// micro-opt, but this is simple.\ndistance:-1,parent:null};}return graph;}// https://en.wikipedia.org/wiki/Breadth-first_search", "title": "" }, { "docid": "89b80a8699b889750b54c70bededd27b", "score": "0.48873612", "text": "function u(u,p){const v=u.vertex.code,c=u.fragment.code;1!==p.output&&3!==p.output||(u.include(_Transform_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"],{linearDepth:!0}),u.include(_attributes_TextureCoordinateAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_7__[\"TextureCoordinateAttribute\"],p),u.include(_shading_VisualVariables_glsl_js__WEBPACK_IMPORTED_MODULE_4__[\"VisualVariables\"],p),u.include(_output_OutputDepth_glsl_js__WEBPACK_IMPORTED_MODULE_6__[\"OutputDepth\"],p),u.include(_Slice_glsl_js__WEBPACK_IMPORTED_MODULE_2__[\"Slice\"],p),u.vertex.uniforms.add(\"nearFar\",\"vec2\"),u.varyings.add(\"depth\",\"float\"),p.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),v.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth);\n forwardTextureCoordinates();\n }\n `),u.include(_util_AlphaDiscard_glsl_js__WEBPACK_IMPORTED_MODULE_5__[\"DiscardOrAdjustAlpha\"],p),c.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n void main(void) {\n discardBySlice(vpos);\n ${p.hasColorTexture?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputDepth(depth);\n }\n `)),2===p.output&&(u.include(_Transform_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"],{linearDepth:!1}),u.include(_attributes_NormalAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_8__[\"NormalAttribute\"],p),u.include(_attributes_VertexNormal_glsl_js__WEBPACK_IMPORTED_MODULE_9__[\"VertexNormal\"],p),u.include(_attributes_TextureCoordinateAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_7__[\"TextureCoordinateAttribute\"],p),u.include(_shading_VisualVariables_glsl_js__WEBPACK_IMPORTED_MODULE_4__[\"VisualVariables\"],p),p.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),u.vertex.uniforms.add(\"viewNormal\",\"mat4\"),u.varyings.add(\"vPositionView\",\"vec3\"),v.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n ${0===p.normalType?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:\"\"}\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n forwardTextureCoordinates();\n }\n `),u.include(_Slice_glsl_js__WEBPACK_IMPORTED_MODULE_2__[\"Slice\"],p),u.include(_util_AlphaDiscard_glsl_js__WEBPACK_IMPORTED_MODULE_5__[\"DiscardOrAdjustAlpha\"],p),c.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n void main() {\n discardBySlice(vpos);\n ${p.hasColorTexture?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n\n ${3===p.normalType?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec3 normal = screenDerivativeNormal(vPositionView);`:_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec3 normal = normalize(vNormalWorld);\n if (gl_FrontFacing == false) normal = -normal;`}\n gl_FragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0);\n }\n `)),4===p.output&&(u.include(_Transform_glsl_js__WEBPACK_IMPORTED_MODULE_1__[\"Transform\"],{linearDepth:!1}),u.include(_attributes_TextureCoordinateAttribute_glsl_js__WEBPACK_IMPORTED_MODULE_7__[\"TextureCoordinateAttribute\"],p),u.include(_shading_VisualVariables_glsl_js__WEBPACK_IMPORTED_MODULE_4__[\"VisualVariables\"],p),p.hasColorTexture&&u.fragment.uniforms.add(\"tex\",\"sampler2D\"),v.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n void main(void) {\n vpos = calculateVPos();\n vpos = subtractOrigin(vpos);\n vpos = addVerticalOffset(vpos, localOrigin);\n gl_Position = transformPosition(proj, view, vpos);\n forwardTextureCoordinates();\n }\n `),u.include(_Slice_glsl_js__WEBPACK_IMPORTED_MODULE_2__[\"Slice\"],p),u.include(_util_AlphaDiscard_glsl_js__WEBPACK_IMPORTED_MODULE_5__[\"DiscardOrAdjustAlpha\"],p),u.include(_output_OutputHighlight_glsl_js__WEBPACK_IMPORTED_MODULE_3__[\"OutputHighlight\"]),c.add(_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n void main() {\n discardBySlice(vpos);\n ${p.hasColorTexture?_shaderModules_interfaces_js__WEBPACK_IMPORTED_MODULE_0__[\"glsl\"]`\n vec4 texColor = texture2D(tex, vuv0);\n discardOrAdjustAlpha(texColor);`:\"\"}\n outputHighlight();\n }\n `))}", "title": "" }, { "docid": "68cddb486fad12666fd6db7baa6ac620", "score": "0.48817995", "text": "_buildFastEdgesGeometry() {\n\t\tconst gl = this.gl;\n\t\tlet edges = this.network.indexedEdges;\n\t\tlet positions = this.network.positions;\n\t\tlet colors = this.network.colors;\n\n\t\tlet indicesArray;\n\t\tthis.fastEdgesGeometry = null;\n\t\tthis.fastEdgesIndicesArray = null;\n\t\tlet newGeometry = new Object();\n\t\t//FIXME: If num of vertices > 65k, we need to store the geometry in two different indices objects\n\t\tif (positions.length < 65535) {\n\t\t\tindicesArray = new Uint16Array(edges);\n\t\t\tnewGeometry.indexType = gl.UNSIGNED_SHORT;\n\t\t} else {\n\t\t\tvar uints_for_indices = gl.getExtension(\"OES_element_index_uint\");\n\t\t\tif (uints_for_indices == null) {\n\t\t\t\tindicesArray = new Uint16Array(edges);\n\t\t\t\tnewGeometry.indexType = gl.UNSIGNED_SHORT;\n\t\t\t} else {\n\t\t\t\tindicesArray = new Uint32Array(edges);\n\t\t\t\tnewGeometry.indexType = gl.UNSIGNED_INT;\n\t\t\t}\n\t\t}\n\n\t\t// create the lines buffer 2 vertices per geometry.\n\t\tnewGeometry.vertexObject = gl.createBuffer();\n\t\tnewGeometry.colorObject = gl.createBuffer();\n\t\tnewGeometry.numIndices = indicesArray.length;\n\t\tnewGeometry.indexObject = gl.createBuffer();\n\n\t\tthis.fastEdgesGeometry = newGeometry;\n\t\tthis.fastEdgesIndicesArray = indicesArray;\n\n\t}", "title": "" }, { "docid": "405e974711834d58ab95608b63ceddbf", "score": "0.4878432", "text": "function pass() {\n var a, i, j, l, r, n, n1, n2, e, w, g, k, m;\n\n var outboundAttCompensation,\n coefficient,\n xDist,\n yDist,\n oldxDist,\n oldyDist,\n ewc,\n mass,\n distance,\n size,\n factor,\n minNodeDistance = W.settings.minNodeDistance;\n\n // 1) Initializing layout data\n //-----------------------------\n\n // Resetting positions & computing max values\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n NodeMatrix[np(n, 'old_dx')] = NodeMatrix[np(n, 'dx')];\n NodeMatrix[np(n, 'old_dy')] = NodeMatrix[np(n, 'dy')];\n NodeMatrix[np(n, 'dx')] = 0;\n NodeMatrix[np(n, 'dy')] = 0;\n }\n\n // If outbound attraction distribution, compensate\n if (W.settings.outboundAttractionDistribution) {\n outboundAttCompensation = 0;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n outboundAttCompensation += NodeMatrix[np(n, 'mass')];\n }\n\n outboundAttCompensation /= W.nodesLength;\n }\n\n // 1.bis) Barnes-Hut computation\n //------------------------------\n\n if (W.settings.barnesHutOptimize) {\n\n var minX = Infinity,\n maxX = -Infinity,\n minY = Infinity,\n maxY = -Infinity,\n q,\n q0,\n q1,\n q2,\n q3;\n\n // Setting up\n // RegionMatrix = new Float32Array(W.nodesLength / W.ppn * 4 * W.ppr);\n RegionMatrix = [];\n\n // Computing min and max values\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n minX = Math.min(minX, NodeMatrix[np(n, 'x')]);\n maxX = Math.max(maxX, NodeMatrix[np(n, 'x')]);\n minY = Math.min(minY, NodeMatrix[np(n, 'y')]);\n maxY = Math.max(maxY, NodeMatrix[np(n, 'y')]);\n }\n\n // Build the Barnes Hut root region\n RegionMatrix[rp(0, 'node')] = -1;\n RegionMatrix[rp(0, 'centerX')] = (minX + maxX) / 2;\n RegionMatrix[rp(0, 'centerY')] = (minY + maxY) / 2;\n RegionMatrix[rp(0, 'size')] = Math.max(maxX - minX, maxY - minY);\n RegionMatrix[rp(0, 'nextSibling')] = -1;\n RegionMatrix[rp(0, 'firstChild')] = -1;\n RegionMatrix[rp(0, 'mass')] = 0;\n RegionMatrix[rp(0, 'massCenterX')] = 0;\n RegionMatrix[rp(0, 'massCenterY')] = 0;\n\n // Add each node in the tree\n l = 1;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n\n // Current region, starting with root\n r = 0;\n\n while (true) {\n // Are there sub-regions?\n\n // We look at first child index\n if (RegionMatrix[rp(r, 'firstChild')] >= 0) {\n\n // There are sub-regions\n\n // We just iterate to find a \"leave\" of the tree\n // that is an empty region or a region with a single node\n // (see next case)\n\n // Find the quadrant of n\n if (NodeMatrix[np(n, 'x')] < RegionMatrix[rp(r, 'centerX')]) {\n\n if (NodeMatrix[np(n, 'y')] < RegionMatrix[rp(r, 'centerY')]) {\n\n // Top Left quarter\n q = RegionMatrix[rp(r, 'firstChild')];\n } else {\n\n // Bottom Left quarter\n q = RegionMatrix[rp(r, 'firstChild')] + W.ppr;\n }\n } else {\n if (NodeMatrix[np(n, 'y')] < RegionMatrix[rp(r, 'centerY')]) {\n\n // Top Right quarter\n q = RegionMatrix[rp(r, 'firstChild')] + W.ppr * 2;\n } else {\n\n // Bottom Right quarter\n q = RegionMatrix[rp(r, 'firstChild')] + W.ppr * 3;\n }\n }\n\n // Update center of mass and mass (we only do it for non-leave regions)\n RegionMatrix[rp(r, 'massCenterX')] = (RegionMatrix[rp(r, 'massCenterX')] * RegionMatrix[rp(r, 'mass')] + NodeMatrix[np(n, 'x')] * NodeMatrix[np(n, 'mass')]) / (RegionMatrix[rp(r, 'mass')] + NodeMatrix[np(n, 'mass')]);\n\n RegionMatrix[rp(r, 'massCenterY')] = (RegionMatrix[rp(r, 'massCenterY')] * RegionMatrix[rp(r, 'mass')] + NodeMatrix[np(n, 'y')] * NodeMatrix[np(n, 'mass')]) / (RegionMatrix[rp(r, 'mass')] + NodeMatrix[np(n, 'mass')]);\n\n RegionMatrix[rp(r, 'mass')] += NodeMatrix[np(n, 'mass')];\n\n // Iterate on the right quadrant\n r = q;\n continue;\n } else {\n\n // There are no sub-regions: we are in a \"leave\"\n\n // Is there a node in this leave?\n if (RegionMatrix[rp(r, 'node')] < 0) {\n\n // There is no node in region:\n // we record node n and go on\n RegionMatrix[rp(r, 'node')] = n;\n break;\n } else {\n\n // There is a node in this region\n\n // We will need to create sub-regions, stick the two\n // nodes (the old one r[0] and the new one n) in two\n // subregions. If they fall in the same quadrant,\n // we will iterate.\n\n // Create sub-regions\n RegionMatrix[rp(r, 'firstChild')] = l * W.ppr;\n w = RegionMatrix[rp(r, 'size')] / 2; // new size (half)\n\n // NOTE: we use screen coordinates\n // from Top Left to Bottom Right\n\n // Top Left sub-region\n g = RegionMatrix[rp(r, 'firstChild')];\n\n RegionMatrix[rp(g, 'node')] = -1;\n RegionMatrix[rp(g, 'centerX')] = RegionMatrix[rp(r, 'centerX')] - w;\n RegionMatrix[rp(g, 'centerY')] = RegionMatrix[rp(r, 'centerY')] - w;\n RegionMatrix[rp(g, 'size')] = w;\n RegionMatrix[rp(g, 'nextSibling')] = g + W.ppr;\n RegionMatrix[rp(g, 'firstChild')] = -1;\n RegionMatrix[rp(g, 'mass')] = 0;\n RegionMatrix[rp(g, 'massCenterX')] = 0;\n RegionMatrix[rp(g, 'massCenterY')] = 0;\n\n // Bottom Left sub-region\n g += W.ppr;\n RegionMatrix[rp(g, 'node')] = -1;\n RegionMatrix[rp(g, 'centerX')] = RegionMatrix[rp(r, 'centerX')] - w;\n RegionMatrix[rp(g, 'centerY')] = RegionMatrix[rp(r, 'centerY')] + w;\n RegionMatrix[rp(g, 'size')] = w;\n RegionMatrix[rp(g, 'nextSibling')] = g + W.ppr;\n RegionMatrix[rp(g, 'firstChild')] = -1;\n RegionMatrix[rp(g, 'mass')] = 0;\n RegionMatrix[rp(g, 'massCenterX')] = 0;\n RegionMatrix[rp(g, 'massCenterY')] = 0;\n\n // Top Right sub-region\n g += W.ppr;\n RegionMatrix[rp(g, 'node')] = -1;\n RegionMatrix[rp(g, 'centerX')] = RegionMatrix[rp(r, 'centerX')] + w;\n RegionMatrix[rp(g, 'centerY')] = RegionMatrix[rp(r, 'centerY')] - w;\n RegionMatrix[rp(g, 'size')] = w;\n RegionMatrix[rp(g, 'nextSibling')] = g + W.ppr;\n RegionMatrix[rp(g, 'firstChild')] = -1;\n RegionMatrix[rp(g, 'mass')] = 0;\n RegionMatrix[rp(g, 'massCenterX')] = 0;\n RegionMatrix[rp(g, 'massCenterY')] = 0;\n\n // Bottom Right sub-region\n g += W.ppr;\n RegionMatrix[rp(g, 'node')] = -1;\n RegionMatrix[rp(g, 'centerX')] = RegionMatrix[rp(r, 'centerX')] + w;\n RegionMatrix[rp(g, 'centerY')] = RegionMatrix[rp(r, 'centerY')] + w;\n RegionMatrix[rp(g, 'size')] = w;\n RegionMatrix[rp(g, 'nextSibling')] = RegionMatrix[rp(r, 'nextSibling')];\n RegionMatrix[rp(g, 'firstChild')] = -1;\n RegionMatrix[rp(g, 'mass')] = 0;\n RegionMatrix[rp(g, 'massCenterX')] = 0;\n RegionMatrix[rp(g, 'massCenterY')] = 0;\n\n l += 4;\n\n // Now the goal is to find two different sub-regions\n // for the two nodes: the one previously recorded (r[0])\n // and the one we want to add (n)\n\n // Find the quadrant of the old node\n if (NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'x')] < RegionMatrix[rp(r, 'centerX')]) {\n if (NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'y')] < RegionMatrix[rp(r, 'centerY')]) {\n\n // Top Left quarter\n q = RegionMatrix[rp(r, 'firstChild')];\n } else {\n\n // Bottom Left quarter\n q = RegionMatrix[rp(r, 'firstChild')] + W.ppr;\n }\n } else {\n if (NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'y')] < RegionMatrix[rp(r, 'centerY')]) {\n\n // Top Right quarter\n q = RegionMatrix[rp(r, 'firstChild')] + W.ppr * 2;\n } else {\n\n // Bottom Right quarter\n q = RegionMatrix[rp(r, 'firstChild')] + W.ppr * 3;\n }\n }\n\n // We remove r[0] from the region r, add its mass to r and record it in q\n RegionMatrix[rp(r, 'mass')] = NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'mass')];\n RegionMatrix[rp(r, 'massCenterX')] = NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'x')];\n RegionMatrix[rp(r, 'massCenterY')] = NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'y')];\n\n RegionMatrix[rp(q, 'node')] = RegionMatrix[rp(r, 'node')];\n RegionMatrix[rp(r, 'node')] = -1;\n\n // Find the quadrant of n\n if (NodeMatrix[np(n, 'x')] < RegionMatrix[rp(r, 'centerX')]) {\n if (NodeMatrix[np(n, 'y')] < RegionMatrix[rp(r, 'centerY')]) {\n\n // Top Left quarter\n q2 = RegionMatrix[rp(r, 'firstChild')];\n } else {\n // Bottom Left quarter\n q2 = RegionMatrix[rp(r, 'firstChild')] + W.ppr;\n }\n } else {\n if (NodeMatrix[np(n, 'y')] < RegionMatrix[rp(r, 'centerY')]) {\n\n // Top Right quarter\n q2 = RegionMatrix[rp(r, 'firstChild')] + W.ppr * 2;\n } else {\n\n // Bottom Right quarter\n q2 = RegionMatrix[rp(r, 'firstChild')] + W.ppr * 3;\n }\n }\n\n if (q === q2) {\n\n // If both nodes are in the same quadrant,\n // we have to try it again on this quadrant\n r = q;\n continue;\n }\n\n // If both quadrants are different, we record n\n // in its quadrant\n RegionMatrix[rp(q2, 'node')] = n;\n break;\n }\n }\n }\n }\n }\n\n // 2) Repulsion\n //--------------\n // NOTES: adjustSizes = antiCollision & scalingRatio = coefficient\n\n if (W.settings.barnesHutOptimize) {\n coefficient = W.settings.scalingRatio;\n\n // Applying repulsion through regions\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n\n // Computing leaf quad nodes iteration\n\n r = 0; // Starting with root region\n while (true) {\n\n if (RegionMatrix[rp(r, 'firstChild')] >= 0) {\n\n // The region has sub-regions\n\n // We run the Barnes Hut test to see if we are at the right distance\n distance = Math.sqrt((NodeMatrix[np(n, 'x')] - RegionMatrix[rp(r, 'massCenterX')]) * (NodeMatrix[np(n, 'x')] - RegionMatrix[rp(r, 'massCenterX')]) + (NodeMatrix[np(n, 'y')] - RegionMatrix[rp(r, 'massCenterY')]) * (NodeMatrix[np(n, 'y')] - RegionMatrix[rp(r, 'massCenterY')]));\n\n if (2 * RegionMatrix[rp(r, 'size')] / distance < W.settings.barnesHutTheta) {\n\n // We treat the region as a single body, and we repulse\n\n xDist = NodeMatrix[np(n, 'x')] - RegionMatrix[rp(r, 'massCenterX')];\n yDist = NodeMatrix[np(n, 'y')] - RegionMatrix[rp(r, 'massCenterY')];\n\n if (W.settings.adjustSizes) {\n\n //-- Linear Anti-collision Repulsion\n if (distance > 0) {\n factor = coefficient * NodeMatrix[np(n, 'mass')] * RegionMatrix[rp(r, 'mass')] / distance / distance;\n\n NodeMatrix[np(n, 'dx')] += xDist * factor;\n NodeMatrix[np(n, 'dy')] += yDist * factor;\n } else if (distance < 0) {\n factor = -coefficient * NodeMatrix[np(n, 'mass')] * RegionMatrix[rp(r, 'mass')] / distance;\n\n NodeMatrix[np(n, 'dx')] += xDist * factor;\n NodeMatrix[np(n, 'dy')] += yDist * factor;\n }\n } else {\n\n //-- Linear Repulsion\n if (distance > 0) {\n factor = coefficient * NodeMatrix[np(n, 'mass')] * RegionMatrix[rp(r, 'mass')] / distance / distance;\n\n NodeMatrix[np(n, 'dx')] += xDist * factor;\n NodeMatrix[np(n, 'dy')] += yDist * factor;\n }\n }\n\n // When this is done, we iterate. We have to look at the next sibling.\n if (RegionMatrix[rp(r, 'nextSibling')] < 0) break; // No next sibling: we have finished the tree\n r = RegionMatrix[rp(r, 'nextSibling')];\n continue;\n } else {\n\n // The region is too close and we have to look at sub-regions\n r = RegionMatrix[rp(r, 'firstChild')];\n continue;\n }\n } else {\n\n // The region has no sub-region\n // If there is a node r[0] and it is not n, then repulse\n\n if (RegionMatrix[rp(r, 'node')] >= 0 && RegionMatrix[rp(r, 'node')] !== n) {\n xDist = NodeMatrix[np(n, 'x')] - NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'x')];\n yDist = NodeMatrix[np(n, 'y')] - NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'y')];\n\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (W.settings.adjustSizes) {\n\n //-- Linear Anti-collision Repulsion\n if (distance > 0) {\n factor = coefficient * NodeMatrix[np(n, 'mass')] * NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'mass')] / distance / distance;\n\n NodeMatrix[np(n, 'dx')] += xDist * factor;\n NodeMatrix[np(n, 'dy')] += yDist * factor;\n } else if (distance < 0) {\n factor = -coefficient * NodeMatrix[np(n, 'mass')] * NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'mass')] / distance;\n\n NodeMatrix[np(n, 'dx')] += xDist * factor;\n NodeMatrix[np(n, 'dy')] += yDist * factor;\n }\n } else {\n\n //-- Linear Repulsion\n if (distance > 0) {\n factor = coefficient * NodeMatrix[np(n, 'mass')] * NodeMatrix[np(RegionMatrix[rp(r, 'node')], 'mass')] / distance / distance;\n\n NodeMatrix[np(n, 'dx')] += xDist * factor;\n NodeMatrix[np(n, 'dy')] += yDist * factor;\n }\n }\n }\n\n // When this is done, we iterate. We have to look at the next sibling.\n if (RegionMatrix[rp(r, 'nextSibling')] < 0) break; // No next sibling: we have finished the tree\n r = RegionMatrix[rp(r, 'nextSibling')];\n continue;\n }\n }\n }\n } else {\n coefficient = W.settings.scalingRatio;\n\n // Square iteration\n for (n1 = 0; n1 < W.nodesLength; n1 += W.ppn) {\n for (n2 = 0; n2 < n1; n2 += W.ppn) {\n\n // Common to both methods\n xDist = NodeMatrix[np(n1, 'x')] - NodeMatrix[np(n2, 'x')];\n yDist = NodeMatrix[np(n1, 'y')] - NodeMatrix[np(n2, 'y')];\n\n if (W.settings.adjustSizes) {\n\n //-- Anticollision Linear Repulsion\n distance = Math.sqrt(xDist * xDist + yDist * yDist) - NodeMatrix[np(n1, 'size')] - NodeMatrix[np(n2, 'size')];\n\n if (distance > 0) {\n factor = coefficient * NodeMatrix[np(n1, 'mass')] * NodeMatrix[np(n2, 'mass')] / distance / distance;\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, 'dx')] += xDist * factor;\n NodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n NodeMatrix[np(n2, 'dx')] += xDist * factor;\n NodeMatrix[np(n2, 'dy')] += yDist * factor;\n } else if (distance < 0) {\n factor = 100 * coefficient * NodeMatrix[np(n1, 'mass')] * NodeMatrix[np(n2, 'mass')];\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, 'dx')] += xDist * factor;\n NodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n NodeMatrix[np(n2, 'dx')] -= xDist * factor;\n NodeMatrix[np(n2, 'dy')] -= yDist * factor;\n }\n } else {\n\n //-- Linear Repulsion\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (distance > 0) {\n factor = coefficient * NodeMatrix[np(n1, 'mass')] * NodeMatrix[np(n2, 'mass')] / distance / distance;\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, 'dx')] += xDist * factor;\n NodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n NodeMatrix[np(n2, 'dx')] -= xDist * factor;\n NodeMatrix[np(n2, 'dy')] -= yDist * factor;\n }\n }\n }\n }\n }\n\n // 3) Gravity\n //------------\n g = W.settings.gravity / W.settings.scalingRatio;\n coefficient = W.settings.scalingRatio;\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n factor = 0;\n\n // Common to both methods\n xDist = NodeMatrix[np(n, 'x')];\n yDist = NodeMatrix[np(n, 'y')];\n distance = Math.sqrt(xDist * xDist + yDist * yDist);\n\n if (W.settings.strongGravityMode) {\n\n //-- Strong gravity\n if (distance > 0) factor = coefficient * NodeMatrix[np(n, 'mass')] * g;\n } else {\n\n //-- Linear Anti-collision Repulsion n\n if (distance > 0) factor = coefficient * NodeMatrix[np(n, 'mass')] * g / distance;\n }\n\n // Updating node's dx and dy\n NodeMatrix[np(n, 'dx')] -= xDist * factor;\n NodeMatrix[np(n, 'dy')] -= yDist * factor;\n }\n\n // 4) Attraction\n //---------------\n coefficient = 1 * (W.settings.outboundAttractionDistribution ? outboundAttCompensation : 1);\n\n // TODO: simplify distance\n // TODO: coefficient is always used as -c --> optimize?\n for (e = 0; e < W.edgesLength; e += W.ppe) {\n n1 = EdgeMatrix[ep(e, 'source')];\n n2 = EdgeMatrix[ep(e, 'target')];\n w = EdgeMatrix[ep(e, 'weight')];\n\n // Edge weight influence\n ewc = Math.pow(w, W.settings.edgeWeightInfluence);\n\n // Common measures\n xDist = NodeMatrix[np(n1, 'x')] - NodeMatrix[np(n2, 'x')];\n yDist = NodeMatrix[np(n1, 'y')] - NodeMatrix[np(n2, 'y')];\n\n // Applying attraction to nodes\n if (W.settings.adjustSizes) {\n\n distance = Math.sqrt(xDist * xDist + yDist * yDist - NodeMatrix[np(n1, 'size')] - NodeMatrix[np(n2, 'size')]) - minNodeDistance;\n\n if (W.settings.linLogMode) {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- LinLog Degree Distributed Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc * Math.log(1 + distance) / distance / NodeMatrix[np(n1, 'mass')];\n }\n } else {\n\n //-- LinLog Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc * Math.log(1 + distance) / distance;\n }\n }\n } else {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- Linear Degree Distributed Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc / NodeMatrix[np(n1, 'mass')];\n }\n } else {\n\n //-- Linear Anti-collision Attraction\n if (distance > 0) {\n factor = -coefficient * ewc;\n }\n }\n }\n } else {\n\n distance = Math.sqrt(xDist * xDist + yDist * yDist) - minNodeDistance;\n\n if (W.settings.linLogMode) {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- LinLog Degree Distributed Attraction\n if (distance > 0) {\n factor = -coefficient * ewc * Math.log(1 + distance) / distance / NodeMatrix[np(n1, 'mass')];\n }\n } else {\n\n //-- LinLog Attraction\n if (distance > 0) factor = -coefficient * ewc * Math.log(1 + distance) / distance;\n }\n } else {\n if (W.settings.outboundAttractionDistribution) {\n\n //-- Linear Attraction Mass Distributed\n // NOTE: Distance is set to 1 to override next condition\n distance = 1;\n factor = -coefficient * ewc / NodeMatrix[np(n1, 'mass')];\n } else {\n\n //-- Linear Attraction\n // NOTE: Distance is set to 1 to override next condition\n distance = 1;\n factor = -coefficient * ewc;\n }\n }\n }\n\n // Updating nodes' dx and dy\n // TODO: if condition or factor = 1?\n if (distance > 0) {\n\n // Updating nodes' dx and dy\n NodeMatrix[np(n1, 'dx')] += xDist * factor;\n NodeMatrix[np(n1, 'dy')] += yDist * factor;\n\n NodeMatrix[np(n2, 'dx')] -= xDist * factor;\n NodeMatrix[np(n2, 'dy')] -= yDist * factor;\n }\n }\n\n // 5) Apply Forces\n //-----------------\n var force,\n swinging,\n traction,\n nodespeed,\n alldistance = 0;\n\n // MATH: sqrt and square distances\n if (W.settings.adjustSizes) {\n\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n if (!NodeMatrix[np(n, 'fixed')]) {\n force = Math.sqrt(NodeMatrix[np(n, 'dx')] * NodeMatrix[np(n, 'dx')] + NodeMatrix[np(n, 'dy')] * NodeMatrix[np(n, 'dy')]);\n\n if (force > W.maxForce) {\n NodeMatrix[np(n, 'dx')] = NodeMatrix[np(n, 'dx')] * W.maxForce / force;\n NodeMatrix[np(n, 'dy')] = NodeMatrix[np(n, 'dy')] * W.maxForce / force;\n }\n\n swinging = NodeMatrix[np(n, 'mass')] * Math.sqrt((NodeMatrix[np(n, 'old_dx')] - NodeMatrix[np(n, 'dx')]) * (NodeMatrix[np(n, 'old_dx')] - NodeMatrix[np(n, 'dx')]) + (NodeMatrix[np(n, 'old_dy')] - NodeMatrix[np(n, 'dy')]) * (NodeMatrix[np(n, 'old_dy')] - NodeMatrix[np(n, 'dy')]));\n\n traction = Math.sqrt((NodeMatrix[np(n, 'old_dx')] + NodeMatrix[np(n, 'dx')]) * (NodeMatrix[np(n, 'old_dx')] + NodeMatrix[np(n, 'dx')]) + (NodeMatrix[np(n, 'old_dy')] + NodeMatrix[np(n, 'dy')]) * (NodeMatrix[np(n, 'old_dy')] + NodeMatrix[np(n, 'dy')])) / 2;\n\n nodespeed = 0.1 * Math.log(1 + traction) / (1 + Math.sqrt(swinging));\n\n oldxDist = NodeMatrix[np(n, 'x')];\n oldyDist = NodeMatrix[np(n, 'y')];\n\n // Updating node's positon\n NodeMatrix[np(n, 'x')] = NodeMatrix[np(n, 'x')] + NodeMatrix[np(n, 'dx')] * (nodespeed / W.settings.slowDown);\n NodeMatrix[np(n, 'y')] = NodeMatrix[np(n, 'y')] + NodeMatrix[np(n, 'dy')] * (nodespeed / W.settings.slowDown);\n\n xDist = NodeMatrix[np(n, 'x')];\n yDist = NodeMatrix[np(n, 'y')];\n distance = Math.sqrt((xDist - oldxDist) * (xDist - oldxDist) + (yDist - oldyDist) * (yDist - oldyDist));\n alldistance += distance;\n }\n }\n } else {\n\n for (n = 0; n < W.nodesLength; n += W.ppn) {\n if (!NodeMatrix[np(n, 'fixed')]) {\n\n swinging = NodeMatrix[np(n, 'mass')] * Math.sqrt((NodeMatrix[np(n, 'old_dx')] - NodeMatrix[np(n, 'dx')]) * (NodeMatrix[np(n, 'old_dx')] - NodeMatrix[np(n, 'dx')]) + (NodeMatrix[np(n, 'old_dy')] - NodeMatrix[np(n, 'dy')]) * (NodeMatrix[np(n, 'old_dy')] - NodeMatrix[np(n, 'dy')]));\n\n traction = Math.sqrt((NodeMatrix[np(n, 'old_dx')] + NodeMatrix[np(n, 'dx')]) * (NodeMatrix[np(n, 'old_dx')] + NodeMatrix[np(n, 'dx')]) + (NodeMatrix[np(n, 'old_dy')] + NodeMatrix[np(n, 'dy')]) * (NodeMatrix[np(n, 'old_dy')] + NodeMatrix[np(n, 'dy')])) / 2;\n\n nodespeed = NodeMatrix[np(n, 'convergence')] * Math.log(1 + traction) / (1 + Math.sqrt(swinging));\n\n // Updating node convergence\n NodeMatrix[np(n, 'convergence')] = Math.min(1, Math.sqrt(nodespeed * (NodeMatrix[np(n, 'dx')] * NodeMatrix[np(n, 'dx')] + NodeMatrix[np(n, 'dy')] * NodeMatrix[np(n, 'dy')]) / (1 + Math.sqrt(swinging))));\n\n oldxDist = NodeMatrix[np(n, 'x')];\n oldyDist = NodeMatrix[np(n, 'y')];\n\n // Updating node's positon\n NodeMatrix[np(n, 'x')] = NodeMatrix[np(n, 'x')] + NodeMatrix[np(n, 'dx')] * (nodespeed / W.settings.slowDown);\n NodeMatrix[np(n, 'y')] = NodeMatrix[np(n, 'y')] + NodeMatrix[np(n, 'dy')] * (nodespeed / W.settings.slowDown);\n\n xDist = NodeMatrix[np(n, 'x')];\n yDist = NodeMatrix[np(n, 'y')];\n distance = Math.sqrt((xDist - oldxDist) * (xDist - oldxDist) + (yDist - oldyDist) * (yDist - oldyDist));\n alldistance += distance;\n }\n }\n }\n\n // Counting one more iteration\n W.iterations++;\n\n // Auto stop.\n // The greater the ratio nb nodes / nb edges,\n // the greater the number of iterations needed to converge.\n if (W.settings.autoStop) {\n W.converged = W.iterations > W.settings.maxIterations || alldistance / W.nodesLength < W.settings.avgDistanceThreshold;\n\n // align nodes that are linked to the same two nodes only:\n if (W.converged && W.settings.alignNodeSiblings) {\n // console.time(\"alignment\");\n\n var neighbors = {},\n // index of neighbors\n parallelNodes = {},\n // set of parallel nodes indexed by same <source;target>\n setKey,\n // tmp\n keysN; // tmp\n\n // build index of neighbors:\n for (e = 0; e < W.edgesLength; e += W.ppe) {\n n1 = EdgeMatrix[ep(e, 'source')];\n n2 = EdgeMatrix[ep(e, 'target')];\n\n if (n1 === n2) continue;\n\n neighbors[n1] = neighbors[n1] || {};\n neighbors[n2] = neighbors[n2] || {};\n neighbors[n1][n2] = true;\n neighbors[n2][n1] = true;\n }\n\n // group triplets by same <source, target> (resp. target, source):\n Object.keys(neighbors).forEach(function (n) {\n n = ~~n; // string to int\n keysN = Object.keys(neighbors[n]);\n if (keysN.length == 2) {\n setKey = keysN[0] + ';' + keysN[1];\n if (setKey in parallelNodes) {\n parallelNodes[setKey].push(n);\n } else {\n setKey = keysN[1] + ';' + keysN[0];\n if (!parallelNodes[setKey]) {\n parallelNodes[setKey] = [~~keysN[1], ~~keysN[0]];\n }\n parallelNodes[setKey].push(n);\n }\n }\n });\n\n var setNodes,\n setSource,\n setTarget,\n degSource,\n degTarget,\n sX,\n sY,\n tX,\n tY,\n t,\n distSourceTarget,\n intersectionPoint,\n normalVector,\n nNormaleVector,\n angle,\n angleMin = W.settings.nodeSiblingsAngleMin;\n\n Object.keys(parallelNodes).forEach(function (key) {\n setSource = parallelNodes[key].shift();\n setTarget = parallelNodes[key].shift();\n setNodes = parallelNodes[key].filter(function (setNode) {\n return !NodeMatrix[np(setNode, 'fixed')];\n });\n\n if (setNodes.length == 1) return;\n\n sX = NodeMatrix[np(setSource, 'x')];\n sY = NodeMatrix[np(setSource, 'y')];\n tX = NodeMatrix[np(setTarget, 'x')];\n tY = NodeMatrix[np(setTarget, 'y')];\n\n // the extremity of lowest degree attracts the nodes\n // up to 1/4 of the distance:\n degSource = Object.keys(neighbors[setSource]).length;\n degTarget = Object.keys(neighbors[setTarget]).length;\n t = scaleRange(degSource / (degSource + degTarget), 0, 1, 1 / 4, 3 / 4);\n intersectionPoint = getPointOnLineSegment(sX, sY, tX, tY, t);\n\n // vector normal to the segment [source, target]:\n normalVector = getNormalVector(sX, sY, tX, tY);\n\n distSourceTarget = getDistance(sX, sY, tX, tY);\n\n // normalized normal vector:\n nNormaleVector = getNormalizedVector(normalVector, distSourceTarget);\n\n angle = getVectorAngle(nNormaleVector);\n\n // avoid horizontal vector because node labels overlap:\n if (2 * angleMin > Math.PI) throw new Error('ForceLink.Worker - Invalid parameter: angleMin must be smaller than 2 PI.');\n\n if (angleMin > 0) {\n // TODO layout parameter\n if (angle < angleMin || angle > Math.PI - angleMin && angle <= Math.PI) {\n\n // New vector of angle PI - angleMin\n nNormaleVector = {\n x: Math.cos(Math.PI - angleMin) * 2,\n y: Math.sin(Math.PI - angleMin) * 2\n };\n } else if (angle > 2 * Math.PI - angleMin || angle >= Math.PI && angle < Math.PI + angleMin) {\n\n // New vector of angle angleMin\n nNormaleVector = {\n x: Math.cos(angleMin) * 2,\n y: Math.sin(angleMin) * 2\n };\n }\n }\n\n // evenly distribute nodes along the perpendicular line to\n // [source, target] at the computed intersection point:\n var start = 0,\n sign = 1,\n steps = 1;\n\n if (setNodes.length % 2 == 1) {\n steps = 0;\n start = 1;\n }\n\n for (var i = 0; i < setNodes.length; i++) {\n NodeMatrix[np(setNodes[i], 'x')] = intersectionPoint.x + sign * nNormaleVector.x * steps * (start || i >= 2 ? W.settings.nodeSiblingsScale : W.settings.nodeSiblingsScale * 2 / 3);\n\n NodeMatrix[np(setNodes[i], 'y')] = intersectionPoint.y + sign * nNormaleVector.y * steps * (start || i >= 2 ? W.settings.nodeSiblingsScale : W.settings.nodeSiblingsScale * 2 / 3);\n\n sign = -sign;\n steps += (i + start) % 2;\n }\n });\n\n // console.timeEnd(\"alignment\");\n }\n }\n }", "title": "" }, { "docid": "e9acf9367a25179078d5a56983c6b482", "score": "0.4877122", "text": "onGraphLoaded() {\n //this.camera.near = this.graph.near;\n //this.camera.far = this.graph.far;\n if(this.graphs.length < this.graphNames.length){\n return;\n }\n\n if(this.graphs.length > 1){\n this.graph = this.graphs[this.graphIndex];\n this.graphName = this.graphNames[this.graphIndex];\n }\n\n //TODO: Change reference length according to parsed graph\n //this.axis = new CGFaxis(this, this.graph.referenceLength);\n this.axis = new CGFaxis(this,this.graph.axis_length,0.2);\n this.axis.axis_length = this.graph.axis_length;\n\n // TODO: Change ambient and background details according to parsed graph\n this.gl.clearColor( this.graph.ambient.backR,\n this.graph.ambient.backG,\n this.graph.ambient.backB,\n this.graph.ambient.backA);\n\n this.setGlobalAmbientLight( this.graph.ambient.ambR,\n this.graph.ambient.ambG,\n this.graph.ambient.ambB,\n this.graph.ambient.ambA);\n\n\n this.initLights();\n this.initValuesOfCameras();\n \n this.interface.addCameras();\n this.interface.setActiveCamera(this.camera);\n\n //Add lights interface\n this.interface.addLightsGroup(this.graph.lights);\n \n \n \n this.interface.addGraphics();\n\n this.interface.addOptions();\n this.interface.addInformation();\n\n\n this.sceneInited = true;\n }", "title": "" }, { "docid": "6543265e7ad1d5b94788b9c73f095477", "score": "0.48736593", "text": "_setupLayout() {\n\t\tthis._layoutLastUpdate = null;\n\t\tthis._alpha = 0.001;\n\t\t// this.layoutWorker = new Worker(new URL('../layouts/ngraphLayoutWorker.js', import.meta.url));\n\t\t// this.layoutWorker = new Worker(new URL('../layouts/d3force3dLayoutWorker.js', import.meta.url));\n\t\tthis.newPositions = this.network.positions.slice(0);\n\t\tlet onlayoutUpdate = (data) => {\n\t\t\tthis.newPositions = data.positions;\n\t\t\tif (!this._layoutLastUpdate) {\n\t\t\t\tthis._layoutLastUpdate = performance.now();\n\t\t\t}\n\t\t\tlet layoutElapsedTime = performance.now() - this._layoutLastUpdate;\n\t\t\tif (layoutElapsedTime < 200) {\n\t\t\t\tlayoutElapsedTime = 200;\n\t\t\t} else if (layoutElapsedTime > 2500) {\n\t\t\t\tlayoutElapsedTime = 2500;\n\t\t\t}\n\n\t\t\tthis._alpha = 1.0 / layoutElapsedTime;\n\n\t\t\tlet interpolatorTask = {\n\t\t\t\tname: \"1.1.positionInterpolator\",\n\t\t\t\tcallback: (elapsedTime, task) => {\n\t\t\t\t\tlet maxDisplacement = 0;\n\t\t\t\t\tconst alpha = this._alpha;\n\t\t\t\t\tconst positionsLength = this.network.positions.length;\n\t\t\t\t\tconst newPositions = this.newPositions;\n\t\t\t\t\tconst previousPositions = this.network.positions;\n\t\t\t\t\tfor (let index = 0; index < positionsLength; index++) {\n\t\t\t\t\t\tconst displacement = newPositions[index] - previousPositions[index];\n\n\t\t\t\t\t\tpreviousPositions[index] += alpha * (displacement) * elapsedTime;\n\n\t\t\t\t\t\tmaxDisplacement = Math.max(Math.abs(displacement), maxDisplacement);\n\t\t\t\t\t};\n\n\t\t\t\t\tthis._updateCenterNodesPosition();\n\t\t\t\t\tthis._updateCameraInterpolation(true);\n\t\t\t\t\t// console.log(this.scheduler._averageFPS);\n\n\t\t\t\t\tif (maxDisplacement < 1) {\n\t\t\t\t\t\tthis.scheduler.unschedule(\"1.1.positionInterpolator\");\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tdelay: 0,\n\t\t\t\trepeat: true,\n\t\t\t\tsynchronized: true,\n\t\t\t\timmediateUpdates: false,\n\t\t\t\tredraw: true,\n\t\t\t\tupdateNodesGeometry: true,\n\t\t\t\tupdateEdgesGeometry: true,\n\t\t\t}\n\t\t\tthis.scheduler.schedule({\n\t\t\t\tname: \"1.0.positionChange\",\n\t\t\t\tcallback: (elapsedTime, task) => {\n\t\t\t\t\t// let maxDisplacement = 0;\n\t\t\t\t\t// for (let index = 0; index < this.network.positions.length; index++) {\n\t\t\t\t\t// \tlet displacement = this.newPositions[index] - this.network.positions[index];\n\t\t\t\t\t// \tmaxDisplacement = Math.max(Math.abs(displacement), maxDisplacement);\n\t\t\t\t\t// };\n\t\t\t\t\tthis.scheduler.schedule(interpolatorTask);\n\t\t\t\t\t// console.log(this.scheduler._averageFPS);\n\t\t\t\t},\n\t\t\t\tdelay: 0,\n\t\t\t\trepeat: false,\n\t\t\t\tsynchronized: true,\n\t\t\t\timmediateUpdates: false,\n\t\t\t\tredraw: false,\n\t\t\t\tupdateNodesGeometry: false,\n\t\t\t\tupdateEdgesGeometry: false,\n\t\t\t});\n\t\t};\n\n\t\tlet onLayoutStop = () => {\n\t\t\tthis.onLayoutStopCallback?.();\n\t\t}\n\n\t\tlet onLayoutStart = () => {\n\t\t\tthis._layoutLastUpdate = null;\n\t\t\tthis.onLayoutStartCallback?.();\n\t\t}\n\n\n\t\tthis.layoutWorker = new d3ForceLayoutWorker({\n\t\t\tnetwork: this.network,\n\t\t\tonUpdate: onlayoutUpdate,\n\t\t\tonStop: onLayoutStop,\n\t\t\tonStart: onLayoutStart,\n\t\t\tuse2D: this._use2D\n\t\t});\n\t\tconsole.log(\"Set layout worker\",this.layoutWorker)\n\n\t\tif (this._autoStartLayout) {\n\t\t\tthis.layoutWorker.start();\n\t\t\tconsole.log(\"Start\",this.layoutWorker)\n\t\t}\n\n\n\n\t}", "title": "" }, { "docid": "5f90416d0693d41ef87fce0d7b425690", "score": "0.4873654", "text": "function drawMesh(mesh, modelMatrix, color, Ks, Ls, isTextured, Kd, Ld)\n{\n //set our specular elements according to the passed parameters.\n gl.uniform3fv(shaderProgram.Ks, Ks);\n gl.uniform3fv(shaderProgram.Ls, Ls);\n\n //set our diffuse elements according to our passed parameters\n gl.uniform3fv(shaderProgram.Kd, Kd);\n gl.uniform3fv(shaderProgram.Ld, Ld);\n\n\n gl.uniform1i(shaderProgram.isTextured, isTextured);\n\n if(DEBUG){\n\tconsole.log(Kd);\n\tconsole.log( Ld);\n\tconsole.log( Ks);\n\tconsole.log( Ls);\n\n }\n \n \n //vertex attributesxb\n\n gl.bindBuffer(gl.ARRAY_BUFFER, mesh.positionBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexPositionHandle, POSITION_DATA_SIZE, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(shaderProgram.vertexPositionHandle);\n gl.bindBuffer(gl.ARRAY_BUFFER, mesh.normalBuffer);\n gl.vertexAttribPointer(shaderProgram.vertexNormalHandle, NORMAL_DATA_SIZE, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(shaderProgram.vertexNormalHandle);\n\n //texture stuff..\n\n \n // gl.uniform1i(shaderProgram.isDaytime, isDaytime);\n\n console.log(\"isTextured \" + isTextured);\n console.log(\"isDaytime \" + isDaytime);\n // if(isTextured == true){\n\t \n\t gl.bindBuffer(gl.ARRAY_BUFFER, mesh.textureBuffer);\n\t gl.vertexAttribPointer(shaderProgram.vertexTextureHandle, TEXTURE_DATA_SIZE, gl.FLOAT, false, 0, 0);\n\t gl.enableVertexAttribArray(shaderProgram.vertexTextureHandle);\n\t \n\t //pass in texture\n\t gl.activeTexture(gl.TEXTURE0);\n\t gl.bindTexture(gl.TEXTURE_2D, texture);\n\t \n\t gl.uniform1i(shaderProgram.textureHandle, 0);\n // }\n //set color\n gl.uniform4fv(shaderProgram.colorHandle, color);\n \n //calculate and set normal matrix (just based on model)\n var normalMatrix = mat3.normalFromMat4(mat3.create(), modelMatrix);\n gl.uniformMatrix3fv(shaderProgram.normalMatrixHandle, false, normalMatrix);\n \n //modelview\n var MVPmatrix = mat4.mul(mat4.create(), viewMatrix, modelMatrix);\n\n //bind MV matrix to uModelViewMatrix in shader\n gl.uniformMatrix4fv(shaderProgram.MVmatrixHandle, false, MVPmatrix);\n\n //calculate and set MVP matrix\n mat4.mul(MVPmatrix, projectionMatrix, MVPmatrix);\n gl.uniformMatrix4fv(shaderProgram.MVPmatrixHandle, false, MVPmatrix);\n\n //draw the model!\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, mesh.indexBuffer);\n gl.drawElements(gl.TRIANGLES, mesh.indexBuffer.numItems, gl.UNSIGNED_SHORT, 0);\n\n}", "title": "" }, { "docid": "d42512130044dd318c95ee473ca57d7e", "score": "0.48721772", "text": "assert(this._drapedRenderBatches.length === 0);\n }\n\n renderCacheEfficiency(style: Style): Object {\n const layerCount = style.order.length;\n\n if (layerCount === 0) {\n return {efficiency: 100.0};\n }\n\n let uncacheableLayerCount = 0;\n let drapedLayerCount = 0;\n let reachedUndrapedLayer = false;\n let firstUndrapedLayer;\n\n for (let i = 0; i < layerCount; ++i) {\n const layer = style._layers[style.order[i]];\n if (!this._style.isLayerDraped(layer)) {\n if (!reachedUndrapedLayer) {\n reachedUndrapedLayer = true;\n firstUndrapedLayer = layer.id;\n }\n } else {\n if (reachedUndrapedLayer) {\n ++uncacheableLayerCount;\n }\n ++drapedLayerCount;\n }\n }\n\n if (drapedLayerCount === 0) {\n return {efficiency: 100.0};\n }\n\n return {efficiency: (1.0 - uncacheableLayerCount / drapedLayerCount) * 100.0, firstUndrapedLayer};\n }\n\n getMinElevationBelowMSL(): number {\n let min = 0.0;\n // The maximum DEM error in meters to be conservative (SRTM).\n const maxDEMError = 30.0;\n this._visibleDemTiles.filter(tile => tile.dem).forEach(tile => {\n const minMaxTree = (tile.dem: any).tree;\n min = Math.min(min, minMaxTree.minimums[0]);\n });\n return min === 0.0 ? min : (min - maxDEMError) * this._exaggeration;\n }", "title": "" }, { "docid": "61179e9cd53c7bcf88e0a9cd6fb627c0", "score": "0.4871176", "text": "function color_vertex(c){\n\tfor (var k = selectVertex.length - 1; k >= 0; k--) {\n\t\tvar s = -1;\n\t\tvar i = -1;\n\t\twhile (i < objects.length - 1 && s < selectVertex[k]){\n\t\t\ti++;\n\t\t\ts += objects[i].mesh.geometry.vertices.length;\n\t\t}\n\t\tif (i != -1) {\n\t\t\tvar vector;\n\t\t\tvar position;\n\t\t\ts = 0;\n\t\t\tposition = objects[i].mesh.position;\n\t\t\tvector = new THREE.Vector3;\n\t\t\tvector.x = objects[i].mesh.geometry.vertices[s].x + position.x;\n\t\t\tvector.y = objects[i].mesh.geometry.vertices[s].y + position.y;\n\t\t\tvector.z = objects[i].mesh.geometry.vertices[s].z + position.z;\n\t\t\twhile (!vector_is_equal(vector , vertexSpheres[selectVertex[k]].position)){\n\t\t\t\ts++;\n\t\t\t\tvector.x = objects[i].mesh.geometry.vertices[s].x + position.x;\n\t\t\t\tvector.y = objects[i].mesh.geometry.vertices[s].y + position.y;\n\t\t\t\tvector.z = objects[i].mesh.geometry.vertices[s].z + position.z;\n\t\t\t}\n\t\t\tfor (var j = objects[i].mesh.geometry.faces.length - 1; j >= 0; j--) {\n\t\t\t\tif (objects[i].mesh.geometry.faces[j].a == s){\n\t\t\t\t\tobjects[i].mesh.geometry.faces[j].vertexColors[0].set(c);\n\t\t\t\t}\n\t\t\t\tif (objects[i].mesh.geometry.faces[j].b == s){\n\t\t\t\t\tobjects[i].mesh.geometry.faces[j].vertexColors[1].set(c);\n\t\t\t\t}\n\t\t\t\tif (objects[i].mesh.geometry.faces[j].c == s){\n\t\t\t\t\tobjects[i].mesh.geometry.faces[j].vertexColors[2].set(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\tobjects[i].mesh.geometry.colorsNeedUpdate = true;\n\t\t}\n\t}\n\t//console.log(objects);\n}", "title": "" }, { "docid": "6796a64fe8ade43b0a513ebdf71ddf7b", "score": "0.4869727", "text": "getModelData(){return [this.vertices, this.textureCord, this.normals]}", "title": "" }, { "docid": "bb1462838ea038a3e8eff278c8ca0e80", "score": "0.48654056", "text": "generateTriangles()\r\n{\r\n //Your code here\r\n var deltaX = (this.maxX - this.minX)/this.div;\r\n var deltaY = (this.maxY - this.minY)/this.div;\r\n\r\n for (var i = 0; i <= this.div; i++) {\r\n for (var j = 0; j <= this.div; j++) {\r\n //vertex johns\r\n this.vBuffer.push(this.minX+deltaX*j);\r\n this.vBuffer.push(this.minY+deltaY*i);\r\n this.vBuffer.push(0);\r\n\r\n // //normal vectors are NOT all 0,0,1 for this MP!!! **T O D O ! ! ! ! ! ! ! ! !**\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(0);\r\n this.nBuffer.push(1);\r\n }\r\n }\r\n\r\n // console.log(this.vBuffer[2]);\r\n // this.vBuffer[2] = 1;\r\n // console.log(this.vBuffer[2]);\r\n \r\n for (var i = 0; i < this.div; i++) {\r\n for (var j = 0; j < this.div; j++) {\r\n var vid = i*(this.div+1) + j;\r\n this.fBuffer.push(vid);\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n\r\n this.fBuffer.push(vid+1);\r\n this.fBuffer.push(vid+1+this.div+1);\r\n this.fBuffer.push(vid+this.div+1);\r\n }\r\n }\r\n\r\n //\r\n this.numVertices = this.vBuffer.length/3;\r\n this.numFaces = this.fBuffer.length/3;\r\n}", "title": "" }, { "docid": "d6a791367c3cc19bb7c6f5e7aa46488d", "score": "0.48595643", "text": "parseIntoGraphModel(){\n let horAdj = 0;\n let vertAdj = 0;\n for(let index in this.entityClasses){\n for(let attr in this.entityClasses[index].attributes){\n let tempObject = {\n position: { x: 10 + horAdj, y: 150 + vertAdj},\n attrs: {\n text: {\n fill: '#000',\n text: this.entityClasses[index].attributes[attr].attributeName,\n letterSpacing: 0,\n style: { textShadow: '1px 0 1px #333333' },\n fontSize: 10\n },\n '.outer': {\n fill: '#fff',\n stroke: '#fff',\n filter: { name: 'dropShadow', args: { dx: 0, dy: 2, blur: 2, color: '#222138' }}\n }\n }\n };\n if(this.entityClasses[index].attributes[attr].isIdentifier){ //check to see if foreign key or not\n this.classes[this.entityClasses[index].attributes[attr].attributeName] = new this.erd.Key(tempObject);\n }\n else if(this.entityClasses[index].attributes[attr].isMultiValued){\n this.classes[this.entityClasses[index].attributes[attr].attributeName] = new this.erd.Multivalued({ // style the mutlivalued attribute\n\n position: { x: 10 + horAdj, y: 150 + vertAdj},\n attrs: {\n text: {\n fill: '#000',\n text: this.entityClasses[index].attributes[attr].attributeName,\n letterSpacing: 0,\n style: { 'text-shadow': '1px 0px 1px #333333' }\n },\n '.inner': {\n fill: '#fff',\n stroke: 'none',\n rx: 43,\n ry: 21\n \n },\n '.outer': {\n fill: '#000',\n stroke: '#fff',\n filter: { name: 'dropShadow', args: { dx: 0, dy: 2, blur: 2, color: '#222138' }}\n }\n }\n });\n\n }\n else{\n this.classes[this.entityClasses[index].attributes[attr].attributeName] = new this.erd.Normal(tempObject);\n }\n horAdj+=100;\n vertAdj+=35;\n\n if(this.entityClasses[index].attributes[attr].composedOf.length > 0){\n this.composedClasses[this.entityClasses[index].attributes[attr].attributeName] = this.entityClasses[index].attributes[attr].composedOf;\n }\n }\n \n }\n}", "title": "" }, { "docid": "f1d9e9d63ef33294a4ad4d6172d8c8f1", "score": "0.4854074", "text": "_updateFg () {\n let graph = this.state.schemaViewerEnabled && this.state.schemaViewerActive ? this.state.schema : this.state.graph;\n // React-force-graph reuses material objects for multiple elements, so we need to clone every material so that we can modify individual elements.\n [\"nodes\",\"links\"].forEach((elementType) => {\n graph[elementType].forEach((element) => {\n if (this.state.visMode !== \"2D\") {\n let obj = (element.__lineObj || element.__threeObj);\n if (obj !== undefined) {\n obj._material = obj.material.clone();\n delete obj.material;\n // Sadly this is very hacky but it works. In order to prevent react-force-graph from reusing materials we have to clone the material everytime it tries to reassign it.\n obj.__defineGetter__(\"material\", () => obj._material);\n obj.__defineSetter__(\"material\", (material) => obj._material = material.clone());\n }\n }\n });\n });\n }", "title": "" }, { "docid": "400cdca64f2846b035c15476f6c46466", "score": "0.48517346", "text": "function _computeData(index, state) {\n\t\tvar match = getConfigData$1(index, state);\n\t\tif (match) {\n\t\t\tvar configDataMap = match[0];\n\t\t\tvar width = unsafeGet(\"width\", configDataMap);\n\t\t\tvar height = unsafeGet(\"height\", configDataMap);\n\t\t\tvar depth = unsafeGet(\"depth\", configDataMap);\n\t\t\tvar widthSegment = unsafeGet(\"widthSegment\", configDataMap);\n\t\t\tvar heightSegment = unsafeGet(\"heightSegment\", configDataMap);\n\t\t\tvar depthSegment = unsafeGet(\"depthSegment\", configDataMap);\n\t\t\tvar vertices = createEmpty(/* () */0);\n\t\t\tvar indices = createEmpty(/* () */0);\n\t\t\tvar faceAxes = /* array */[\n\t /* int array */[\n\t\t\t\t\t0,\n\t\t\t\t\t1,\n\t\t\t\t\t3\n\t\t\t\t],\n\t /* int array */[\n\t\t\t\t\t4,\n\t\t\t\t\t5,\n\t\t\t\t\t7\n\t\t\t\t],\n\t /* int array */[\n\t\t\t\t\t3,\n\t\t\t\t\t2,\n\t\t\t\t\t6\n\t\t\t\t],\n\t /* int array */[\n\t\t\t\t\t1,\n\t\t\t\t\t0,\n\t\t\t\t\t4\n\t\t\t\t],\n\t /* int array */[\n\t\t\t\t\t1,\n\t\t\t\t\t4,\n\t\t\t\t\t2\n\t\t\t\t],\n\t /* int array */[\n\t\t\t\t\t5,\n\t\t\t\t\t0,\n\t\t\t\t\t6\n\t\t\t\t]\n\t\t\t];\n\t\t\tvar corners = /* array */[\n\t /* tuple */[\n\t\t\t\t\t-width,\n\t\t\t\t\t-height,\n\t\t\t\t\tdepth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\twidth,\n\t\t\t\t\t-height,\n\t\t\t\t\tdepth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\twidth,\n\t\t\t\t\theight,\n\t\t\t\t\tdepth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\t-width,\n\t\t\t\t\theight,\n\t\t\t\t\tdepth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\twidth,\n\t\t\t\t\t-height,\n\t\t\t\t\t-depth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\t-width,\n\t\t\t\t\t-height,\n\t\t\t\t\t-depth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\t-width,\n\t\t\t\t\theight,\n\t\t\t\t\t-depth\n\t\t\t\t],\n\t /* tuple */[\n\t\t\t\t\twidth,\n\t\t\t\t\theight,\n\t\t\t\t\t-depth\n\t\t\t\t]\n\t\t\t];\n\t\t\tvar _generateFace = function (side, uSegment, vSegment) {\n\t\t\t\tvar offset = vertices.length / 3 | 0;\n\t\t\t\tfor (var i = 0; i <= uSegment; ++i) {\n\t\t\t\t\tfor (var j = 0; j <= vSegment; ++j) {\n\t\t\t\t\t\tvar temp1 = lerp(caml_array_get(corners, caml_array_get(caml_array_get(faceAxes, side), 0)), caml_array_get(corners, caml_array_get(caml_array_get(faceAxes, side), 1)), i / uSegment);\n\t\t\t\t\t\tvar temp2 = lerp(caml_array_get(corners, caml_array_get(caml_array_get(faceAxes, side), 0)), caml_array_get(corners, caml_array_get(caml_array_get(faceAxes, side), 2)), j / vSegment);\n\t\t\t\t\t\tvar temp3 = sub$1(/* Float */0, temp2, caml_array_get(corners, caml_array_get(caml_array_get(faceAxes, side), 0)));\n\t\t\t\t\t\tvar match = add$1(/* Float */0, temp1, temp3);\n\t\t\t\t\t\tvertices.push(match[0], match[1], match[2]);\n\t\t\t\t\t\tif (i < uSegment && j < vSegment) {\n\t\t\t\t\t\t\tindices.push((offset + j | 0) + imul(i, uSegment + 1 | 0) | 0, (offset + j | 0) + imul(i + 1 | 0, uSegment + 1 | 0) | 0, ((offset + j | 0) + imul(i, uSegment + 1 | 0) | 0) + 1 | 0, (offset + j | 0) + imul(i + 1 | 0, uSegment + 1 | 0) | 0, ((offset + j | 0) + imul(i + 1 | 0, uSegment + 1 | 0) | 0) + 1 | 0, ((offset + j | 0) + imul(i, uSegment + 1 | 0) | 0) + 1 | 0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn /* () */0;\n\t\t\t};\n\t\t\t_generateFace(0, widthSegment | 0, heightSegment | 0);\n\t\t\t_generateFace(1, widthSegment | 0, heightSegment | 0);\n\t\t\t_generateFace(2, widthSegment | 0, depthSegment | 0);\n\t\t\t_generateFace(3, widthSegment | 0, depthSegment | 0);\n\t\t\t_generateFace(4, depthSegment | 0, heightSegment | 0);\n\t\t\t_generateFace(5, depthSegment | 0, heightSegment | 0);\n\t\t\treturn /* record */[\n\t /* vertices */vertices,\n\t /* indices */indices\n\t\t\t];\n\t\t} else {\n\t\t\treturn throwMessage(\"configData should exist\");\n\t\t}\n\t}", "title": "" } ]
7dc834b64ebbbdbd20c06482cbcc6547
Creates the slim scroll scrollbar for the sections and slides inside them.
[ { "docid": "43fed246586665e2f7245f35497b70f1", "score": "0.71631116", "text": "function createScrollBarHandler(){\n $(SECTION_SEL).each(function(){\n var slides = $(this).find(SLIDE_SEL);\n\n if(slides.length){\n slides.each(function(){\n createScrollBar($(this));\n });\n }else{\n createScrollBar($(this));\n }\n\n });\n afterRenderActions();\n }", "title": "" } ]
[ { "docid": "69548ac869dfd8c99e900b5b34b9019d", "score": "0.7421033", "text": "function createSlimScrollingHandler(){\n $(SECTION_SEL).each(function(){\n var slides = $(this).find(SLIDE_SEL);\n\n if(slides.length){\n slides.each(function(){\n createSlimScrolling($(this));\n });\n }else{\n createSlimScrolling($(this));\n }\n\n });\n afterRenderActions();\n }", "title": "" }, { "docid": "3743e8a7386d1eb0d06532fc981c1d69", "score": "0.74034697", "text": "function createSlimScrollingHandler(){\r\n $(SECTION_SEL).each(function(){\r\n var slides = $(this).find(SLIDE_SEL);\r\n\r\n if(slides.length){\r\n slides.each(function(){\r\n createSlimScrolling($(this));\r\n });\r\n }else{\r\n createSlimScrolling($(this));\r\n }\r\n\r\n });\r\n afterRenderActions();\r\n }", "title": "" }, { "docid": "f1022eaa9dbc2cac73d63791177c8e80", "score": "0.6908025", "text": "function createScrollBarForAll(){\n if($('body').hasClass(RESPONSIVE)){\n removeResponsiveScrollOverflows();\n }\n else{\n forEachSectionAndSlide(createScrollBar);\n }\n }", "title": "" }, { "docid": "b2386ab5acc1704633d855a86f475568", "score": "0.65854114", "text": "function CustomScrollbar() {\n // $('.sidebar .menu .list').slimscroll({\n // height: 'calc(100vh - 60px)',\n // color: '#546e7a',\n // position: 'left',\n // size: '2px',\n // alwaysVisible: false,\n // borderRadius: '3px',\n // railBorderRadius: '0'\n // });\n\n $('.navbar-right .dropdown-menu .body .menu').slimscroll({\n height: '254px',\n color: 'rgba(0,0,0,0.2)',\n size: '3px',\n alwaysVisible: false,\n borderRadius: '3px',\n railBorderRadius: '0'\n });\n $('.chat-widget').slimscroll({\n height: '300px',\n color: 'rgba(0,0,0,0.4)',\n size: '2px',\n alwaysVisible: false,\n borderRadius: '3px',\n railBorderRadius: '2px'\n });\n\n $('.right-sidebar .slim_scroll').slimscroll({\n height: 'calc(100vh - 70px)',\n color: 'rgba(0,0,0,0.4)',\n size: '2px',\n alwaysVisible: false,\n borderRadius: '3px',\n railBorderRadius: '0'\n });\n\n \n}", "title": "" }, { "docid": "d7728ecfbc2b6f8d65e9ac469a13457b", "score": "0.63272136", "text": "function mkdSideAreaScroll(){\n\n var sideMenu = $('.mkd-side-menu');\n\n if(sideMenu.length){\n sideMenu.niceScroll({\n scrollspeed: 60,\n mousescrollstep: 40,\n cursorwidth: 0,\n cursorborder: 0,\n cursorborderradius: 0,\n cursorcolor: \"transparent\",\n autohidemode: false,\n horizrailenabled: false\n });\n }\n }", "title": "" }, { "docid": "33b53dc7d3dfb07b46c4a2c519ce4d7d", "score": "0.6309886", "text": "function handleScroll() {\n showBackToTop();\n showSection();\n handleDivider();\n}", "title": "" }, { "docid": "aa861fb9b5d815d152a60d3cc04d724a", "score": "0.62451935", "text": "static slimscroll() {\n // Init slimScroll functionality (with data-toggle=\"slimscroll\" attribute)\n jQuery('[data-toggle=\"slimscroll\"]:not(.js-slimscroll-enabled)').each((index, element) => {\n let el = jQuery(element);\n\n // Add .js-slimscroll-enabled class to tag it as activated and init it\n el.addClass('js-slimscroll-enabled').slimScroll({\n height: el.data('height') || '200px',\n size: el.data('size') || '5px',\n position: el.data('position') || 'right',\n color: el.data('color') || '#000',\n opacity: el.data('opacity') || '.25',\n distance: el.data('distance') || '0',\n alwaysVisible: el.data('always-visible') ? true : false,\n railVisible: el.data('rail-visible') ? true : false,\n railColor: el.data('rail-color') ||'#999',\n railOpacity: el.data('rail-opacity') || .3\n });\n });\n }", "title": "" }, { "docid": "941642fc214fec2015088aca111dfc3f", "score": "0.61889493", "text": "function setup() {\n // cache slides\n slides = Array.prototype.slice.call(scrollElement.children, 0);\n slidesLength = slides.length;\n if (!slidesLength) return;\n\n // 滚动容器的宽度 \n slides.forEach(function (slide, index) {\n scrollElementWidth += outerWidth(slide);\n });\n scrollElementWidth = Math.round(scrollElementWidth);\n scrollElementWidth = scrollElementWidth % 2 == 0 ? scrollElementWidth : scrollElementWidth + 1;\n scrollElement.style.width = scrollElementWidth + 'px';\n\n // set continuous to false if only one slide\n // continuous = slides.length < 2 ? false : options.continuous;\n\n //special case if two slides\n // if (browser.transitions && continuous && slides.length < 3) {\n // element.appendChild(slides[0].cloneNode(true));\n // element.appendChild(element.children[1].cloneNode(true));\n // slides = element.children;\n // }\n // 视窗的宽度\n viewportWidth = document.documentElement.getBoundingClientRect().width;\n // 可以滚动的距离\n canScrollDelta = Math.round(scrollElementWidth - viewportWidth);\n canScrollDelta = canScrollDelta % 2 == 0 ? canScrollDelta : canScrollDelta + 1;\n // create an array to store current positions of each slide // slidePos = new Array(slides.length); // determine width of each slide // width = Math.round(container.getBoundingClientRect().width || container.offsetWidth); // element.style.width = (slides.length * width) + 'px'; // element.style.width = 500 + 'px'; // stack elements\n // var pos = slides.length;\n // while(pos--) {\n\n // var slide = slides[pos];\n\n // slide.style.width = 500 + 'px';\n // slide.setAttribute('data-index', pos);\n\n // if (browser.transitions) {\n // slide.style.left = (pos * -width) + 'px';\n // move(pos, index > pos ? -width : (index < pos ? width : 0), 0);\n // }\n // }\n\n // reposition elements before and after index\n // if (continuous && browser.transitions) {\n // move(circle(index-1), -width, 0);\n // move(circle(index+1), width, 0);\n // }\n\n // if (!browser.transitions) element.style.left = (index * -width) + 'px';\n\n // container.style.visibility = 'visible';\n }", "title": "" }, { "docid": "cb6f7a01dcfacbcb7d0620ace646a43c", "score": "0.6148604", "text": "function scrollPanel() {\r\n\tvar block = $('.js-scroll-panel');\r\n\t// block.jScrollPane();\r\n\t// block.scrollbar();\r\n}", "title": "" }, { "docid": "6914a39901b05b24dc674f207a9dd53f", "score": "0.6106009", "text": "function nxMainLeftMenuScroll() {\n const navLeftScroll = new PerfectScrollbar('#main-scroll-sidebar', {\n wheelSpeed: 2,\n wheelPropagation: true,\n minScrollbarLength: 20\n });\n}", "title": "" }, { "docid": "8fd9e55b84dd38f3be72a9675557c1f1", "score": "0.6099373", "text": "function Scanvas({ children }) {\n const sections_array = children.props.children.filter(\n item => item.type.name === \"Section\"\n );\n\n const whellScrol = e => {\n let newTop = top.value + e.deltaY;\n if (newTop >= 0 && newTop <= window.innerHeight) {\n newTop = top.value + e.deltaY;\n top.value = newTop;\n document.getElementById(\"scrollid\").scrollBy(0, e.deltaY);\n }\n };\n\n const barScroll = e => {\n top.value = e.target.scrollTop;\n };\n\n let canvasClone = Children.map(children, item =>\n cloneElement(item, { onWheel: whellScrol })\n );\n\n return (\n <Fragment>\n {canvasClone}\n <div\n className=\"scrollArea\"\n id=\"scrollid\"\n onScroll={barScroll}\n style={{\n position: \"absolute\",\n top: \"0px\",\n right: \"0px\",\n height: \"100vh\",\n overflow: \"scroll\"\n }}\n >\n <div\n id=\"scrollbar\"\n style={{\n height: `${sections_array.length * 100}vh`\n }}\n ></div>\n </div>\n </Fragment>\n );\n}", "title": "" }, { "docid": "c21b84f5a37b7cba10889313d01f5d92", "score": "0.60867816", "text": "function VSA_initScrollbars() {\n\tif(!document.body.children) return;\n\tvar scrollElements = VSA_getElements(\"vscrollable\", \"DIV\", document, \"class\");\n\tfor (var i=0; i<scrollElements.length; i++)\n\t{\n\t\tVSA_scrollAreas[i] = new VScrollArea(i, scrollElements[i]);\n\t}\n}", "title": "" }, { "docid": "c16e7ee2cd5ce15ad5735220cf007c47", "score": "0.6079778", "text": "function mkdfSideAreaScroll(){\n\t\tvar sideMenu = $('.mkdf-side-menu');\n\t\t\n\t\tif(sideMenu.length){\n sideMenu.perfectScrollbar({\n wheelSpeed: 0.6,\n suppressScrollX: true\n });\n\t\t}\n\t}", "title": "" }, { "docid": "249a42ec9bc53e10458b8a02dcecbe99", "score": "0.6050052", "text": "static BeginScrollView() {}", "title": "" }, { "docid": "1f087ba6578e2ec30de617eee08d39a5", "score": "0.60292876", "text": "function initScrollpanel() {\n\t\t$('.scrollpanel').customScrollbar({\n\t\t\tskin: \"default-skin\",\n\t\t\thScroll: false,\n\t\t\tupdateOnWindowResize: true\n\t\t});\n}", "title": "" }, { "docid": "c0fb3cfd6b44c3240e6fb26de860b272", "score": "0.600649", "text": "function createSideScroll() {\n if ($.fn.mCustomScrollbar) {\n destroySideScroll();\n if (!$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('submenu-hover') && $('body').hasClass('fixed-sidebar')) {\n $('.sidebar-inner').mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: true,\n scrollInertia: 150,\n theme: \"light-thin\",\n advanced: {\n updateOnContentResize: true\n }\n });\n }\n if ($('body').hasClass('sidebar-top')) {\n destroySideScroll();\n }\n }\n }", "title": "" }, { "docid": "c82b480e47af887a8b60631334077a41", "score": "0.597548", "text": "get scrollView() {}", "title": "" }, { "docid": "5366bacf53baa612c81b5288f9a2bd08", "score": "0.5955579", "text": "function scroller() {\n // this code adapted from scroller() function by Jim Vallandingham:\n // https://github.com/vlandham/scroll_demo/blob/gh-pages/js/scroller.js\n // (as found in http://vallandingham.me/scroll_demo/ on 19 March 2017)\n\n /**\n * scroller - handles the details\n * of figuring out which section\n * the user is currently scrolled\n * to.\n *\n */\n\n var container = d3.select('body'); // until told otherwise\n // event dispatcher\n var dispatch = d3.dispatch('active', 'progress', 'size'); // ael added size\n\n // d3 selection of all the\n // text sections that will\n // be scrolled through\n var sections = null;\n\n // array that will hold the\n // y coordinate of each section\n // that is scrolled through\n var sectionPositions = [];\n var currentIndex = -1; // somewhat redundantly tracked both here and by the stepController\n // the following are used to switch on and off the inline scrolling of the viz.\n var containerTop, containerMaxScroll, visScrollState = null;\n\n var navHeight = d3.select(\"nav\").node().getBoundingClientRect().height;\n var heightMargin = navHeight+50;\n var switchPos = 200+navHeight; // how far from the top we switch in a new section\n var stickPoint = 10+navHeight\n var textMargin = 10; // NB: tied to scrolly.css\n\n var visSeln = null;\n // ael - permissible vis and text extents\n var visMinExtent, visMaxExtent, textMinWidth, textMaxWidth;\n\n /**\n * scroll - constructor function.\n * Sets up scroller to monitor\n * scrolling of stepElems selection.\n *\n * @param stepElems - d3 selection of\n * elements that will be scrolled\n * through by user.\n */\n function scroll(stepElems, visElem) {\n sections = stepElems;\n visSeln = visElem;\n\n stepElems.style('opacity', (d,i)=>i===0? 1 : 0.1); // first section shown fully, rest faded out\n\n // when window is scrolled call\n // position. When it is resized\n // call resize.\n d3.select(window)\n .on('scroll.scroller', throttledPosition)\n .on('resize.scroller', debouncedResize);\n\n // hack to get resize (and hence position)\n // to be called once for\n // the scroll position on\n // load.\n var timer = d3.timer(function () {\n resize();\n timer.stop();\n });\n }\n\n /**\n * resize - called on load, and\n * also when page is resized.\n * Resizes the vis and the text as needed,\n * then recalculates sectionPositions and\n * calls position() to figure out where\n * the window now is.\n *\n */\n function resize() {\n // ael: first figure out what size we're going to give the text and vis.\n\n // we rely on the page's base css to define the width of #scrolly.\n // vis gets height of window, up to its visMaxExtent.y, unless the proportionally scaled width would leave less than textMinWidth for the text column.\n // i.e., subject to the min vis extent, we want the vis to be the smaller of:\n // leaving width of at least textMinWidth (which includes a narrow gutter, specified as #sections.margin-right)\n // fitting into the window height.\n\n var divWidth = d3.select(\"#scrolly\").node().getBoundingClientRect().width;\n d3.select(\"#sections\").style(\"padding-left\", \"0px\");\n var visRatio = visMaxExtent.x / visMaxExtent.y;\n var visMinWidth = Math.max(visMinExtent.x, visRatio*visMinExtent.y);\n\n var textLimitedMaxWidth = divWidth - textMinWidth;\n var heightLimitedMaxWidth = visRatio * (window.innerHeight - heightMargin);\n var visWidth = Math.max(visMinWidth, Math.min(visMaxExtent.x, Math.min(textLimitedMaxWidth, heightLimitedMaxWidth)));\n var visHeight = visWidth / visRatio;\n var textWidth = Math.max(textMinWidth, Math.min(textMaxWidth, divWidth - visWidth));\n\n textWidth = textWidth | 0;\n d3.select(\"#sections\").style(\"width\", textWidth-textMargin+\"px\"); // margin is supplementary to width value\n visWidth = visWidth | 0;\n visHeight = visHeight | 0;\n visSeln.style(\"width\", visWidth+\"px\").style(\"height\", visHeight+\"px\");\n\n var marginNeeded = Math.max(0, Math.floor((divWidth - visWidth - textWidth)/2));\n d3.select(\"#sections\").style(\"padding-left\", marginNeeded+\"px\");\n visSeln.style(\"padding-right\", marginNeeded+\"px\");\n\n dispatch.call('size', this, { x: visWidth, y: visHeight });\n\n var lastSection = sections.nodes()[sections.size()-1];\n d3.select(lastSection).style(\"padding-bottom\", \"0px\").style(\"margin-bottom\", \"50px\");\n\n // give the page some time to reflow before we measure section positions\n setTimeout(function() {\n // sectionPositions will be each section's\n // starting position relative to the top\n // of the first section.\n sectionPositions = [];\n var startPos;\n sections.each(function (d, i) {\n var top = this.getBoundingClientRect().top;\n if (i === 0) startPos = top;\n sectionPositions.push(top - startPos);\n });\n\n // for the scrolly container, record its top (in page coords) and the max scroll distance during the interactive phase\n var containerRect = container.node().getBoundingClientRect();\n containerTop = containerRect.top + window.pageYOffset; // px from top of page\n containerMaxScroll = containerRect.height - visHeight;\n\n visScrollState = null; // force re-layout\n\n position();\n }, 250);\n }\n var debouncedResize = lively.lang.fun.debounce(500, resize);\n\n /**\n * position - get user's current position.\n * if user has scrolled to new section,\n * dispatch active event with new section\n * index.\n *\n * ael: original logic wasn't coping with sections of\n * different lengths. we now switch to a section when\n * its start comes within a specified distance (switchPos)\n * of the viewport top.\n *\n */\n function position() {\n // reject any position() prior to a resize(), which takes crucial measurements.\n if (!containerTop) return;\n\n var pos = window.pageYOffset - containerTop; // pos of top of visible region relative to start of scrolly\n\n var unstickPoint = containerMaxScroll-stickPoint;\n var newState = pos < -stickPoint ? \"before\" : (pos > unstickPoint ? \"after\" : \"during\");\n var isDuring = newState===\"during\";\n visSeln\n .style(\"position\", isDuring ? \"fixed\" : null)\n .style(\"float\", isDuring ? null : \"right\")\n .style(\"top\", isDuring ? stickPoint+\"px\" : null)\n .style(\"left\", isDuring ? (d3.select(\"#sections\").node().getBoundingClientRect().right+textMargin+1+\"px\") : null)\n .style(\"padding-top\", isDuring ? null : (newState===\"before\" ? \"0px\" : (containerMaxScroll+\"px\")) );\n visScrollState = newState;\n\n var sectionIndex = Math.max(0, d3.bisect(sectionPositions, pos+switchPos)-1);\n\n if (currentIndex !== sectionIndex) {\n dispatch.call('active', this, sectionIndex);\n currentIndex = sectionIndex;\n }\n\n // NB: no \"progress\" calls will be made for the very last section\n var sectionTop = sectionPositions[sectionIndex], sectionLength = (sectionIndex<sectionPositions.length-1) ? sectionPositions[sectionIndex+1]-sectionTop : Infinity;\n var belowSectionTop = pos + switchPos - sectionTop;\n if (belowSectionTop > 0) dispatch.call('progress', this, currentIndex, belowSectionTop/sectionLength);\n }\n\n // augmented version of lively.lang.fun.throttle, for coping if the browser is too busy to service its setTimeout queue. the events from a scroll gesture on a MacBook trackpad seem to induce such issues, at least in Chrome.\n // the standard throttle uses debounce to clear the throttling flag when the incoming events idle - at which point we're presumably safe in assuming that the setTimeout will be scheduled as it should.\n function highRateThrottle (func, wait) {\n var context, args, timeout, throttling, more, result, timeoutSet, whenDone = lively.lang.fun.debounce(wait, function () {\n more = throttling = false;\n });\n return function () {\n context = this;\n args = arguments;\n var later = function () {\n timeout = timeoutSet = null;\n if (more)\n func.apply(context, args);\n whenDone();\n };\n if (!timeout) {\n timeoutSet = Date.now(); // added\n timeout = setTimeout(later, wait);\n }\n if (throttling) {\n more = true;\n // added code. if the timeout should have triggered by now, do it manually.\n if (timeoutSet && (Date.now()-timeoutSet > wait)) {\n clearTimeout(timeout);\n later();\n }\n\n } else {\n result = func.apply(context, args);\n }\n whenDone();\n throttling = true;\n return result;\n };\n }\n var throttledPosition = highRateThrottle(position, 100);\n\n /**\n * container - get/set the parent element\n * of the sections. Useful for if the\n * scrolling doesn't start at the very top\n * of the page.\n *\n * @param value - the new container value\n */\n scroll.container = function (value) {\n if (arguments.length === 0) {\n return container;\n }\n container = value;\n return scroll;\n };\n\n // @v4 There is now no d3.rebind, so this implements\n // a .on method to pass in a callback to the dispatcher.\n scroll.on = function (action, callback) {\n dispatch.on(action, callback);\n };\n\n // ael added\n scroll.setVisExtents = function(options) {\n visMinExtent = options.visMinExtent;\n visMaxExtent = options.visExtent;\n textMinWidth = options.textMinWidth;\n textMaxWidth = options.textMaxWidth;\n\n return scroll;\n }\n\n scroll.resetLastIndex = function() { currentIndex = -1 }\n\n scroll.sectionTop = function(sectionIndex) {\n return window.scrollY + sections.nodes()[0].getBoundingClientRect().top + sectionPositions[sectionIndex] - stickPoint;\n }\n\n return scroll;\n }", "title": "" }, { "docid": "8d2cfbdd2eea6150ce8effe1e89661aa", "score": "0.5913264", "text": "_uiHandleScroll() {\n let self = this;\n\n // If .side-scroll is added to #page-container enable custom scrolling\n if (self._lPage.hasClass('side-scroll')) {\n // Init custom scrolling on Sidebar\n if ((self._lSidebar.length > 0) && !self._lSidebarScroll) {\n self._lSidebarScroll = new SimpleBar(self._lSidebar[0]);\n\n // Enable scrolling lock\n jQuery('.simplebar-scroll-content', self._lSidebar).scrollLock('enable');\n }\n\n // Init custom scrolling on Side Overlay\n if ((self._lSideOverlay.length > 0) && !self._lSideOverlayScroll) {\n self._lSideOverlayScroll = new SimpleBar(self._lSideOverlay[0]);\n\n // Enable scrolling lock\n jQuery('.simplebar-scroll-content', self._lSideOverlay).scrollLock('enable');\n }\n } else {\n // If custom scrolling exists on Sidebar remove it\n if (self._lSidebar && self._lSidebarScroll) {\n // Disable scrolling lock\n jQuery('.simplebar-scroll-content', self._lSidebar).scrollLock('disable');\n\n // Unmount Simplebar\n self._lSidebarScroll.unMount();\n self._lSidebarScroll = null;\n\n // Remove Simplebar leftovers\n self._lSidebar.removeAttr('data-simplebar')\n .html(jQuery('.simplebar-content', self._lSidebar).html());\n }\n\n // If custom scrolling exists on Side Overlay remove it\n if (self._lSideOverlay && self._lSideOverlayScroll) {\n // Disable scrolling lock\n jQuery('.simplebar-scroll-content', self._lSideOverlay).scrollLock('disable');\n\n // Unmount Simplebar\n self._lSideOverlayScroll.unMount();\n self._lSideOverlayScroll = null;\n\n // Remove Simplebar leftovers\n self._lSideOverlay.removeAttr('data-simplebar')\n .html(jQuery('.simplebar-content', self._lSideOverlay).html());\n }\n }\n }", "title": "" }, { "docid": "2b795176b751dfe243fe6e17dfd8e00b", "score": "0.5904401", "text": "function initScrollBar() {\n\t\tif ( !settings.scrollBar ) return;\n\n\t\t// TODO: Holding down the mouse on the bar should \"rapidfire\", like holding down space\n\t\tscrollBar = $( \"<div>\" ).\n\t\t\t\t\t\taddClass( \"sp-scroll-bar\" ).\n\t\t\t\t\t\ton( \"mousedown\", function( e ) {\n\t\t\t\t\t\t\tvar clickStep = Math.round( (e.offsetY || e.clientY) / scrollBar.height() * ( pathList.length - 1) );\n\t\t\t\t\t\t\t// Close in on the clicked part instead of jumping directly to it.\n\t\t\t\t\t\t\t// This mimics the default browser scroll bar behavior.\n\t\t\t\t\t\t\tif ( Math.abs(clickStep - step) > BIG_STEP_SIZE) {\n\t\t\t\t\t\t\t\tclickStep = step + ( 5 * STEP_SIZE * ( clickStep > step ? 1 : -1 ) );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tscrollToStep(clickStep);\n\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\n\t\tscrollHandle = $( \"<div>\" ).\n\t\t\t\t\t\t\taddClass( \"sp-scroll-handle\" ).\n\t\t\t\t\t\t\ton({\n\t\t\t\t\t\t\t\tclick: function( e ) {\n\t\t\t\t\t\t\t\t\te.preventDefault();\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\tmousedown: function( e ) {\n\t\t\t\t\t\t\t\t\tif ( e.button !== 0 ) return;\n\t\t\t\t\t\t\t\t\tisDragging = true;\n\t\t\t\t\t\t\t\t\te.preventDefault();\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});\n\t\t$( document ).on({\n\t\t\tmouseup: function( e ) { isDragging = false; },\n\t\t\tmousemove: function( e ) { if( isDragging ) dragScrollHandler( e ); }\n\t\t});\n\n\t\t$( \"body\" ).prepend( scrollBar.append( scrollHandle ) );\n\n\t}", "title": "" }, { "docid": "594ddcd74904c96354e64c1b76b6a8a3", "score": "0.58760387", "text": "render() {\n const scroller = this, renderer = scroller.renderer, options = scroller.options, size = scroller.size, styledMode = scroller.chart.styledMode, group = renderer.g('scrollbar')\n .attr({\n zIndex: options.zIndex\n })\n .hide() // initially hide the scrollbar #15863\n .add();\n // Draw the scrollbar group\n scroller.group = group;\n // Draw the scrollbar track:\n scroller.track = renderer.rect()\n .addClass('highcharts-scrollbar-track')\n .attr({\n r: options.trackBorderRadius || 0,\n height: size,\n width: size\n }).add(group);\n if (!styledMode) {\n scroller.track.attr({\n fill: options.trackBackgroundColor,\n stroke: options.trackBorderColor,\n 'stroke-width': options.trackBorderWidth\n });\n }\n const trackBorderWidth = scroller.trackBorderWidth =\n scroller.track.strokeWidth();\n scroller.track.attr({\n x: -trackBorderWidth % 2 / 2,\n y: -trackBorderWidth % 2 / 2\n });\n // Draw the scrollbar itself\n scroller.scrollbarGroup = renderer.g().add(group);\n scroller.scrollbar = renderer.rect()\n .addClass('highcharts-scrollbar-thumb')\n .attr({\n height: size - trackBorderWidth,\n width: size - trackBorderWidth,\n r: options.barBorderRadius || 0\n }).add(scroller.scrollbarGroup);\n scroller.scrollbarRifles = renderer\n .path(Scrollbar.swapXY([\n ['M', -3, size / 4],\n ['L', -3, 2 * size / 3],\n ['M', 0, size / 4],\n ['L', 0, 2 * size / 3],\n ['M', 3, size / 4],\n ['L', 3, 2 * size / 3]\n ], options.vertical))\n .addClass('highcharts-scrollbar-rifles')\n .add(scroller.scrollbarGroup);\n if (!styledMode) {\n scroller.scrollbar.attr({\n fill: options.barBackgroundColor,\n stroke: options.barBorderColor,\n 'stroke-width': options.barBorderWidth\n });\n scroller.scrollbarRifles.attr({\n stroke: options.rifleColor,\n 'stroke-width': 1\n });\n }\n scroller.scrollbarStrokeWidth = scroller.scrollbar.strokeWidth();\n scroller.scrollbarGroup.translate(-scroller.scrollbarStrokeWidth % 2 / 2, -scroller.scrollbarStrokeWidth % 2 / 2);\n // Draw the buttons:\n scroller.drawScrollbarButton(0);\n scroller.drawScrollbarButton(1);\n }", "title": "" }, { "docid": "6105f141a5634915cc936c01468060ae", "score": "0.5873088", "text": "function initSideAreaScroll(){\n\t\"use strict\";\n\n\tif($j('.side_menu').length){\n\t\t$j(\".side_menu\").niceScroll({\n\t\t\tscrollspeed: 60,\n\t\t\tmousescrollstep: 40,\n\t\t\tcursorwidth: 0,\n\t\t\tcursorborder: 0,\n\t\t\tcursorborderradius: 0,\n\t\t\tcursorcolor: \"transparent\",\n\t\t\tautohidemode: false,\n\t\t\thorizrailenabled: false\n\t\t});\n\t}\n}", "title": "" }, { "docid": "6508ef0926aee7c05a7e2f6dc1d78fd1", "score": "0.5871896", "text": "function Touchslider(_id/*object*/, _model, _controller) {\n\tvar THIS = this;\n\tthis.model = _model;\n\tthis.controller = _controller;\n\tthis.panels = [];\n\t_id.find(\".sampleList\").each(function(e) {\n\t\tTHIS.panels.push($(this));\n\t});\n\t\n\t//this.currPanel = 0;\n\t\n\tthis.output = function(/*string*/ msg) {\n if (console) {\n console.info(msg);\n }\n }\n\t/* Set number of panels(sections) to scroll */\n\tthis.numPanel = this.panels.length;\n\tthis.init = function(_base/*parent object*/) {\n\t\tTHIS.base = _base;\n\t\t /*\n\t\t Many of the mobile browsers resize the screen and therefore\n\t\t don't give accurate information about the size of the window.\n\t\t We need to save this information so we can use it later when\n\t\t we're sliding the grid.\n\t\t */\n\t\tTHIS.width = 1005*THIS.numPanel + leftOrigin;\n\t\t///touchslider.colWidth = cellWidth + padding;\n\t\t\n\t\ttry {\n\t\t\tdocument.createEvent('TouchEvent');\n\t\t\t/*\n\t\t\t Now that we've finished the layout we'll make our panel respond\n\t\t\t to all of the touch events.\n\t\t\t */\n\t\t\tTHIS.makeTouchable(_id);\n\t\t} catch (e) {\n\t\t\t/*\n\t\t\t * Then we aren't on a device that supports touch\n\t\t\t */\n\t\t\t/*jQuery(this).css({\n\t\t\t\t'height': '385px',\n\t\t\t\t'overflow': 'auto'\n\t\t\t});*/\n\t\t}\n\t}\n\t\n\tthis.makeTouchable = function(/*object*/ gridid) {\n gridid.each(function() {\n this.ontouchstart = function(e) {\n\t\t\t\t//touchslider.output(\"touch start\");\n THIS.touchStart($(this), e);\n //e.preventDefault();\n //e.stopPropagation();\n return true;\n };\n \n this.ontouchend = function(e) {\n\t\t\t\t//touchslider.output(\"touch end\");\n e.preventDefault();\n e.stopPropagation();\n \n if (THIS.sliding) {\n THIS.sliding = false;\n THIS.touchEnd($(this), e);\n return false;\n } else {\n /*\n We never slid so we can just return true\n and perform the default touch end\n */\n return true;\n }\n };\n \n this.ontouchmove = function(e) {\n\t\t\t\t//touchslider.output(\"touch move\");\n THIS.touchMove($(this), e);\n //e.preventDefault();\n //e.stopPropagation();\n //return false;\n };\n });\n }\n\t /**\n\t * A little helper to parse off the 'px' at the end of the left\n\t * CSS attribute and parse it as a number.\n\t */\n this.getLeft = function(/*JQuery*/ elem) {\n\t\t//return parseInt(elem.css('left').substring(0, elem.css('left').length - 2), 10);\n return parseInt(elem.css('left'));\n }\n\t/**\n * When the touch starts we add our sliding class a record a few\n * variables about where the touch started. We also record the\n * start time so we can do momentum.\n */\n this.touchStart = function(/*JQuery*/ elem, /*event*/ e) {\n\t\ttrace(\"touch start\");\n\t\ttouchTrigger = true;\n elem.css({\n '-webkit-transition-duration': '0'\n });\n \n\t\t \n THIS.startX = e.targetTouches[0].clientX;\n\t\t THIS.startY = e.targetTouches[0].clientY;\n THIS.startLeft = THIS.getLeft(elem);\n THIS.touchStartTime = new Date().getTime();\n\t\t \n\t\t \n\t\t //$(\".arrow\").hide();\n\t\t //$(\".dummyNavArea\").hide();\n\t\t \n\t\t \n\t\t //touchslider.output(\"startX:\" + touchslider.startX);\n\t\t //touchslider.output(touchslider.startLeft);\n \n }\n\t /**\n * When the touch ends we need to adjust the grid for momentum\n * and to snap to the grid. We also need to make sure they\n * didn't drag farther than the end of the list in either\n * direction.\n */\n this.touchEnd = function(/*JQuery*/ elem, /*event*/ e) {\n\t\t //trace(THIS.getLeft(elem) +\":\"+elem.parent().width() +\":\"+ THIS.width);\n if (THIS.getLeft(elem) > leftOrigin) {\n /*\n * This means they dragged to the right past the first item\n */\n THIS.doSlide(elem, leftOrigin, '0.2s');\n \n elem.parent().removeClass('sliding');\n THIS.startX = null;\n\t\t\t THIS.startY = null;\n\t\t\t //touchslider.output(\"left llimit\");\n } else if ((Math.abs(THIS.getLeft(elem)) + (elem.parent().width() + workBlockMarginLeft)) > (THIS.width + (workBlockMarginLeft*(workListView.blocks.length)))) {\n /*\n * This means they dragged to the left past the last item\n */\n THIS.doSlide(elem, '-' + ((THIS.width + (workBlockMarginLeft*(workListView.blocks.length - 1))) - (elem.parent().width() + 10)), '0.2s');\n \n elem.parent().removeClass('sliding');\n THIS.startX = null;\n\t\t\t THIS.startY = null;\n\t\t\t \n\t\t\t //touchslider.output(\"right limit\");\n } else {\n /*\n This means they were just dragging within the bounds of the grid\n and we just need to handle the momentum and snap to the grid.\n */\n //touchslider.slideMomentum(elem, e);\n\t\t\t THIS.slidePanel(elem, e);\n }\n\t\t \n\t\t //$(\".arrow\").show();\n\t\t //$(\".dummyNavArea\").show();\n }\n\t/**\n\t *if the user drag a certain number of pixels from the startX,\n\t *slide the panel to the next or previous snap position depending on \n\t *the direction of the user drag\n\t */\n\t this.slidePanel = function(/*jQuery*/ elem, /*event*/ e) {\n\t\t var slideTriggerIndex = 50;\n\t\t \n\t\t if (Math.abs(THIS.startX - THIS.endX) > slideTriggerIndex) {\n\t\t\t if (THIS.slidingLeft) {\n\t\t\t\t \n\t\t\t\t var index = this.model.getCurrWork() + 1;\n\t\t\t\t this.controller.setCurrWorkHandler(index);\n\t\t\t\n\t\t\t\t //THIS.base.curr++;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t var index = this.model.getCurrWork() - 1;\n\t\t\t\t this.controller.setCurrWorkHandler(index);\n\t\t\t\n\t\t\t\t //THIS.base.curr--;\n\t\t\t }\n\t\t\t //alert(touchslider.panels[touchslider.currPanel]);\n\t\t\t //touchslider.doSlide(elem, '-' + (elem.parent().width() * touchslider.currPanel), '0.2s'); \n\t\t\t// controller.clickHandler(section+\"/\"+THIS.panels[THIS.currPanel]);\n\t\t\t//THIS.doSlide(elem, '-' + (640 * THIS.currPanel), '0.3s'); \n\t\t\t\n\t\t\t /*updating code here*/ \n\t\t\t //THIS.base.curr = THIS.currPanel;\n\t\t\t THIS.base.update();\n\t\t\t /*for (var i=0; i<THIS.base.bts.length; i++)\n\t\t\t {\n\t\t\t\tif (THIS.base.curr != i) THIS.base.bts[i].removeClass(\"workActive\");\n\t\t\t\telse THIS.base.bts[i].addClass(\"workActive\");\n\t\t\t }*/\n\t\t }\n\t\t else {\n\t\t\t var index = this.model.getCurrWork();\n\t\t\t this.controller.setCurrWorkHandler(index);\n\t\t\t THIS.base.update();\n\t\t\t //alert(touchslider.panels[touchslider.currPanel]);\n\t\t\t //THIS.doSlide(elem, '-' + ((1005 * this.model.getCurrWork()) - leftOrigin), '0.3s');\n\t\t\t //controller.clickHandler(\"practice/\" + touchslider.panels[touchslider.currPanel]);\n\t\t }\n\t }\n\t\n\tthis.doSlide = function(/*jQuery*/ elem, /*int*/ x, /*string*/ duration) {\n elem.css({\n left: x + 'px',\n '-webkit-transition-property': 'left',\n '-webkit-transition-duration': duration,\n\t\t\t '-webkit-transition-timing-function':'cubic-bezier(0,0,0.25,1)',\n\t\t\t '-moz-transition-property': 'left',\n\t\t\t '-moz-transition-duration': duration,\n\t\t\t '-moz-transition-timing-function':'cubic-bezier(0,0,0.25,1)'\n\n });\n }\n\t/**\n * While they are actively dragging we just need to adjust the\n * position of the grid using the place they started and the\n * amount they've moved.\n */\n this.touchMove = function(/*JQuery*/ elem, /*event*/ e) {\n\t\t\n if (!THIS.sliding) {\n elem.parent().addClass('sliding');\n }\n \n THIS.sliding = true;\n \n if (THIS.startX > e.targetTouches[0].clientX) {\n /*\n * Sliding to the left\n */\n elem.css('left', '-' + (THIS.startX - e.targetTouches[0].clientX - THIS.startLeft) + 'px');\n THIS.slidingLeft = true;\n } else {\n /*\n * Sliding to the right\n */\n var left = (e.targetTouches[0].clientX - THIS.startX + THIS.startLeft);\n elem.css('left', left + 'px');\n THIS.slidingLeft = false;\n }\n\t\t \n\t\t var absDistX = Math.abs(e.targetTouches[0].clientX - THIS.startX);\n\t\t var absDistY= Math.abs(e.targetTouches[0].clientY - THIS.startY);\n\t\t if (absDistX > absDistY) {\n\t\t \te.preventDefault();\n \te.stopPropagation();\n\t\t\t\n\t\t }\n\t\t \n\t\t \n\t\t \n THIS.endX = e.targetTouches[0].clientX;\n }\n\tthis.update = function() {\n\t\t//touchslider.output(subSection);\n\t\ttry {\n\t\t\tif (subSection != 'undefined') {\n\t\t\t\tTHIS.currPanel = THIS.panels.indexOf(subSection);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tTHIS.currPanel = 0;\n\t\t\t}\n\t\t}\n\t\tcatch(e){}\n\t}\n}", "title": "" }, { "docid": "91c2bf1ddb0c17c2a8d3f3112309c056", "score": "0.5855264", "text": "function setSkinListHeightAndScroll() {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.demo-choose-skin');\n\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '4px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "title": "" }, { "docid": "4e7f6f83b56a695354d1428140e817a7", "score": "0.58437186", "text": "function buildScrollbar(newStyles) {\n var selectorHeight = $scrollContent.height();\n var contentHeight = $scrollContent.find(innerContent).height();\n var scrollHeight = selectorHeight / contentHeight * 100; // Update scrollbar if already exists.\n\n var $scroll = $scrollView.find('.st-scrollbar');\n\n if ($scroll.length > 0) {\n if (contentHeight < selectorHeight) {\n // hide scrollbar if content is small enough\n $scroll.height('100%');\n $scroll.hide();\n } else {\n $scroll.height(scrollHeight + '%');\n $scroll.show();\n }\n\n if (newStyles) {\n updateStyles($scroll, newStyles);\n }\n\n return;\n } // Build scrollbar, styles should be inline\n\n\n $scroll = $('<div></div>', {\n \"class\": 'st-scrollbar'\n }).css('background-color', '#000').css('top', 0).css('position', 'sticky').css('opacity', 0);\n\n if (config && config.styles) {\n updateStyles($scroll, config.styles);\n } // hide scrollbar if content is small enough\n\n\n if (contentHeight < selectorHeight) {\n $scroll.height('100%');\n $scroll.hide();\n } else {\n $scroll.height(scrollHeight + '%');\n } // Build scroll wrapper and attach needed events.\n\n\n var $wrapper = $('<div></div>', {\n width: 20,\n height: '100%'\n }).on('mousedown', function (ev) {\n $(this).find('.st-scrollbar').attr('data-y', ev.pageY);\n $(this).on('mousemove', dragScroll);\n }).on('mouseup mouseout', function (ev) {\n $(this).off('mousemove', dragScroll);\n }).on('click', function (ev) {\n if ($(ev.target).hasClass('st-scrollbar')) {\n return;\n }\n\n var $scroll = $(this).find('.st-scrollbar');\n var top = +$scroll.css('top').replace('px', '').replace('%', '');\n var height = $scroll.height();\n var y = ev.clientY;\n var maxHeight = $(this).height();\n var contentHeight = $scrollContent.find(innerContent).height();\n var case1 = height / 2 < y;\n var case2 = y + height / 2 < maxHeight - height / 2;\n\n if (case1 && case2) {\n top = (y - height / 2) / maxHeight * 100;\n } else if (case2 && !case1) {\n top = 0;\n } else if (case1 && !case2) {\n top = (maxHeight - height) / maxHeight * 100;\n }\n\n $scroll.css('top', top + '%');\n $scrollContent.scrollTop(top * contentHeight / 100);\n }).css('position', 'sticky').css('float', 'right').css('top', 0).css('z-index', 110).append($scroll).appendTo($scrollView);\n } // show scrollbar when mouseover the wrapper", "title": "" }, { "docid": "c5897e5bfd2d41d5b3ebc37a21d5a8e4", "score": "0.5835341", "text": "function edgtfSideAreaScroll(){\n\n var sideMenu = $('.edgtf-side-menu');\n\n if(sideMenu.length){ \n sideMenu.niceScroll({ \n scrollspeed: 60,\n mousescrollstep: 40,\n cursorwidth: 0, \n cursorborder: 0,\n cursorborderradius: 0,\n cursorcolor: \"transparent\",\n autohidemode: false, \n horizrailenabled: false \n });\n }\n }", "title": "" }, { "docid": "c5897e5bfd2d41d5b3ebc37a21d5a8e4", "score": "0.5835341", "text": "function edgtfSideAreaScroll(){\n\n var sideMenu = $('.edgtf-side-menu');\n\n if(sideMenu.length){ \n sideMenu.niceScroll({ \n scrollspeed: 60,\n mousescrollstep: 40,\n cursorwidth: 0, \n cursorborder: 0,\n cursorborderradius: 0,\n cursorcolor: \"transparent\",\n autohidemode: false, \n horizrailenabled: false \n });\n }\n }", "title": "" }, { "docid": "c5897e5bfd2d41d5b3ebc37a21d5a8e4", "score": "0.5835341", "text": "function edgtfSideAreaScroll(){\n\n var sideMenu = $('.edgtf-side-menu');\n\n if(sideMenu.length){ \n sideMenu.niceScroll({ \n scrollspeed: 60,\n mousescrollstep: 40,\n cursorwidth: 0, \n cursorborder: 0,\n cursorborderradius: 0,\n cursorcolor: \"transparent\",\n autohidemode: false, \n horizrailenabled: false \n });\n }\n }", "title": "" }, { "docid": "47cb667bf77d3fce64555d5ad71c5801", "score": "0.5820719", "text": "removeScrollHandling() {}", "title": "" }, { "docid": "cffb4c5f4713af1194e4619ac8840313", "score": "0.58192986", "text": "function showScroll(pages) {\r\n var currentWrapper=pages.currentPage.find('.inner-wrapper');\r\n currentWrapper.scrollTop(0);\r\n currentWrapper.perfectScrollbar('destroy');\r\n $('.inner-wrapper').stellar();\r\n var innerWrapper = pages.demandPage.find('.inner-wrapper'),\r\n scrollTop = {};\r\n innerWrapper.css('height',pages.config.height-pages.config.navHeight);\r\n innerWrapper.perfectScrollbar({\r\n wheelSpeed: 50,\r\n suppressScrollX:true\r\n });\r\n innerWrapper.css('height',pages.config.height);\r\n var scrollBar = innerWrapper.find('.ps-scrollbar-y-rail');\r\n if (!pages.toTop){\r\n scrollBar.addClass('stick-top');\r\n }\r\n if (scrollBar.find('.ps-scrollbar-y').height() == 0){\r\n scrollBar.css('display', 'none');\r\n }\r\n scrollBar.css('right', '-15px');\r\n TweenMax.to(scrollBar, 0.5, {right: '0px'});\r\n }", "title": "" }, { "docid": "884a4708e968aeffde097199f24d6a6a", "score": "0.5788436", "text": "function sliderCareers(){\r\n\t$(\".slider-careers .scrollable\").scrollable({circular: true, speed:2000 }).autoscroll({ autoplay: false, interval:5000 });\r\n}", "title": "" }, { "docid": "b45814c77d4ca752a0dadbc0b2d91f06", "score": "0.5787843", "text": "function scrolldown (){\r\n \t\t\t $('.scroller', cont).slimScroll({\r\n scrollTo: list.height()\r\n });\r\n \t\t}", "title": "" }, { "docid": "6136e646dea7b6163c11d2fe3c9a0a95", "score": "0.57831293", "text": "function configureSlider(sliderIdentifier, numToDisplay, numToScroll) {\n\n console.log(`[SLIDER-SENSEI] configureSlider called for ${sliderIdentifier}`);\n\n var sliderObj = {\n \"identifier\": sliderIdentifier, // The unique ID for the slider\n \"numToDisplay\": numToDisplay, // Note: # of DOM nodes should be > than numToDisplay\n \"numToScroll\": numToScroll, // Note: Currently only supports one for now\n \"sliderLeftIndex\": 0, // Index for tracking slider's next movement to left \n \"sliderRightIndex\": -1, // Index for tracking slider's next movement to right \n \"viewPortWidth\": 1000, // Calculated by taking the container width\n \"sliderContentWidth\": 1000, // Calculated by taking the viewPortWidth / display number\n \"children\": [], // Store a reference to all slides as 'children' in the sliderObject\n }\n\n\n\n // Get a reference to the slider content using the identifier\n refForSliderContainer = getSliderContainerForSliderWithID(sliderObj.identifier);\n\n // Get all children sliders that presently exist\n let children = refForSliderContainer.find('.slider-content');\n \n // Duplicate the amount of children nodes if we don't have enough to comfortably wrap around\n if (children.length < numToDisplay * 2) {\n const content = refForSliderContainer.html();\n refForSliderContainer.append(content);\n\n // Update the reference so we now include the new additional children we just created\n children = refForSliderContainer.find('.slider-content');\n }\n\n sliderObj.children = children;\n\n // Get the viewport size so we can use this later for our calculations\n sliderObj.viewPortWidth = refForSliderContainer.width();\n\n // Determine the uniform width for each of the slider objects\n sliderObj.sliderContentWidth = sliderObj.viewPortWidth / sliderObj.numToDisplay;\n\n // Set initial value for the indices:\n\n sliderObj.sliderLeftIndex = 0;\n sliderObj.sliderRightIndex = sliderObj.numToDisplay - 1 \n\n\n // Place the first 'X' amount of slides into the appropriate position based off of numToDisplay\n // Remaining items should be sorted into a overflow zone. We'll choose to put far off in the - area\n const hiddenDisplayRegion = sliderObj.sliderContentWidth * -1;\n\n // Format target width string so we can use it\n const targetWidth = `${sliderObj.sliderContentWidth}px`;\n\n // Loop through all the children. Place the first children in the viewport, and the rest off screen.\n for (var i = 0; i < children.length; ++i) {\n const child = $(children[i]);\n const targetLeft = (i < numToDisplay)\n ? `${sliderObj.sliderContentWidth * i}px`\n : `${hiddenDisplayRegion}px`;\n\n child\n .css('width', targetWidth)\n .css('left', targetLeft);\n }\n\n return sliderObj;\n}", "title": "" }, { "docid": "91fbd3b81c09bc34f063d29701581589", "score": "0.57383436", "text": "function handleScrolling() {\n sections.forEach((section) => {\n switchActiveClass(section);\n });\n}", "title": "" }, { "docid": "4ca5f3a3e16e395f35eba947584d15e8", "score": "0.5726031", "text": "function changeScroll() {\n if($(window).height() > $(window).width()){ \n $(\".thumbnails\").mCustomScrollbar(\"destroy\"); \n $(\".thumbnails\").mCustomScrollbar({\n axis:\"x\",\n theme:\"light-3\",\n advanced:{autoExpandHorizontalScroll:true}\n });\n }else{ \n $(\".thumbnails\").mCustomScrollbar(\"destroy\");\n $(\".thumbnails\").mCustomScrollbar();\n }\n }", "title": "" }, { "docid": "f5870aa765ee21e8e575160cacf537a7", "score": "0.5725252", "text": "function scrollbar(){\n\n $('body').mCustomScrollbar({\n scrollInertia: 150,\n axis :\"y\",\n\n callbacks:{\n whileScrolling:function(){\n var pos=this.mcs.top;\n if(pos<=-200){\n $('.to-scroll').addClass('hide-scroll');\n }else{\n $('.to-scroll').removeClass('hide-scroll');\n }\n }\n }\n });\n }", "title": "" }, { "docid": "98910673efbf6fa1217dd34b01cb15ef", "score": "0.57250303", "text": "function setup_scroll(sel, useHeight) {\n if (!useHeight) { \n $(sel).height(full_scroll_height(sel));\n resize_scroll_with_window(sel); \n };\n $(sel).jScrollPane({\n animateScroll : true,\n animateDuration : 1000,\n animateEase : 'swing',\n verticalGutter : 0,\n hideFocus : true\n });\n}", "title": "" }, { "docid": "c7e90cd7fbc8d1858a56e5505d2cbb4a", "score": "0.5721793", "text": "function setupScrollbarEvents(isHorizontal) {\n var scrollbarVars = getScrollbarVars(isHorizontal);\n var scrollbarVarsInfo = scrollbarVars._info;\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\n var xy = scrollbarVars._x_y;\n var XY = scrollbarVars._X_Y;\n var scroll = _strScroll + scrollbarVars._Left_Top;\n var strActive = 'active';\n var strSnapHandle = 'snapHandle';\n var scrollDurationFactor = 1;\n var increaseDecreaseScrollAmountKeyCodes = [16, 17]; //shift, ctrl\n var trackTimeout;\n var mouseDownScroll;\n var mouseDownOffset;\n var mouseDownInvertedScale;\n\n function getPointerPosition(event) {\n return _msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]; //use screen coordinates in EDGE & IE because the page values are incorrect in frames.\n }\n function getPreparedScrollbarsOption(name) {\n return _currentPreparedOptions.scrollbars[name];\n }\n function increaseTrackScrollAmount() {\n scrollDurationFactor = 0.5;\n }\n function decreaseTrackScrollAmount() {\n scrollDurationFactor = 1;\n }\n function documentKeyDown(event) {\n if (inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n increaseTrackScrollAmount();\n }\n function documentKeyUp(event) {\n if (inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n decreaseTrackScrollAmount();\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _sleeping || _destroyed || nativeOverlayScrollbarsAreActive() || !_scrollbarsDragScrollingCache || (isTouchEvent && !getPreparedScrollbarsOption('touchSupport')) ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function documentDragMove(event) {\n if (onMouseTouchDownContinue(event)) {\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var scrollRaw = (getPointerPosition(event) - mouseDownOffset) * mouseDownInvertedScale;\n var scrollDeltaPercent = scrollRaw / (trackLength - handleLength);\n var scrollDelta = (scrollRange * scrollDeltaPercent);\n scrollDelta = isFinite(scrollDelta) ? scrollDelta : 0;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.i)\n scrollDelta *= -1;\n\n _viewportElement[scroll](MATH.round(mouseDownScroll + scrollDelta));\n\n if (_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, mouseDownScroll + scrollDelta);\n\n if (!_supportPassiveEvents)\n COMPATIBILITY.prvD(event);\n }\n else\n documentMouseTouchUp(event);\n }\n function documentMouseTouchUp(event) {\n event = event || event.originalEvent;\n\n setupResponsiveEventListener(_documentElement,\n [_strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent],\n [documentDragMove, documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart],\n true);\n\n if (_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, true);\n\n _scrollbarsHandlesDefineScrollPos = false;\n removeClass(_bodyElement, _classNameDragging);\n removeClass(scrollbarVars._handle, strActive);\n removeClass(scrollbarVars._track, strActive);\n removeClass(scrollbarVars._scrollbar, strActive);\n\n mouseDownScroll = undefined;\n mouseDownOffset = undefined;\n mouseDownInvertedScale = 1;\n\n decreaseTrackScrollAmount();\n\n if (trackTimeout !== undefined) {\n _base.scrollStop();\n clearTimeout(trackTimeout);\n trackTimeout = undefined;\n }\n\n if (event) {\n var rect = _hostElementNative[LEXICON.bCR]();\n var mouseInsideHost = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;\n\n //if mouse is outside host element\n if (!mouseInsideHost)\n hostOnMouseLeave();\n\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n }\n function onHandleMouseTouchDown(event) {\n if (onMouseTouchDownContinue(event))\n onHandleMouseTouchDownAction(event);\n }\n function onHandleMouseTouchDownAction(event) {\n mouseDownScroll = _viewportElement[scroll]();\n mouseDownScroll = isNaN(mouseDownScroll) ? 0 : mouseDownScroll;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.n || !_isRTL)\n mouseDownScroll = mouseDownScroll < 0 ? 0 : mouseDownScroll;\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = getPointerPosition(event);\n\n _scrollbarsHandlesDefineScrollPos = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._handle, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n setupResponsiveEventListener(_documentElement,\n [_strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strSelectStartEvent],\n [documentDragMove, documentMouseTouchUp, documentOnSelectStart]);\n\n if (_msieVersion || !_documentMixed)\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n function onTrackMouseTouchDown(event) {\n if (onMouseTouchDownContinue(event)) {\n var scrollDistance = MATH.round(_viewportSize[scrollbarVars._w_h]);\n var trackOffset = scrollbarVars._track.offset()[scrollbarVars._left_top];\n var ctrlKey = event.ctrlKey;\n var instantScroll = event.shiftKey;\n var instantScrollTransition = instantScroll && ctrlKey;\n var isFirstIteration = true;\n var easing = 'linear';\n var decreaseScroll;\n var finishedCondition;\n var scrollActionFinsished = function (transition) {\n if (_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, transition);\n };\n var scrollActionInstantFinished = function () {\n scrollActionFinsished();\n onHandleMouseTouchDownAction(event);\n };\n var scrollAction = function () {\n if (!_destroyed) {\n var mouseOffset = (mouseDownOffset - trackOffset) * mouseDownInvertedScale;\n var handleOffset = scrollbarVarsInfo._handleOffset;\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var currScroll = scrollbarVarsInfo._currentScroll;\n var scrollDuration = 270 * scrollDurationFactor;\n var timeoutDelay = isFirstIteration ? MATH.max(400, scrollDuration) : scrollDuration;\n var instantScrollPosition = scrollRange * ((mouseOffset - (handleLength / 2)) / (trackLength - handleLength)); // 100% * positionPercent\n var rtlIsNormal = _isRTL && isHorizontal && ((!_rtlScrollBehavior.i && !_rtlScrollBehavior.n) || _normalizeRTLCache);\n var decreaseScrollCondition = rtlIsNormal ? handleOffset < mouseOffset : handleOffset > mouseOffset;\n var scrollObj = {};\n var animationObj = {\n easing: easing,\n step: function (now) {\n if (_scrollbarsHandlesDefineScrollPos) {\n _viewportElement[scroll](now); //https://github.com/jquery/jquery/issues/4340\n refreshScrollbarHandleOffset(isHorizontal, now);\n }\n }\n };\n instantScrollPosition = isFinite(instantScrollPosition) ? instantScrollPosition : 0;\n instantScrollPosition = _isRTL && isHorizontal && !_rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n\n //_base.scrollStop();\n\n if (instantScroll) {\n _viewportElement[scroll](instantScrollPosition); //scroll instantly to new position\n if (instantScrollTransition) {\n //get the scroll position after instant scroll (in case CSS Snap Points are used) to get the correct snapped scroll position\n //and the animation stops at the correct point\n instantScrollPosition = _viewportElement[scroll]();\n //scroll back to the position before instant scrolling so animation can be performed\n _viewportElement[scroll](currScroll);\n\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.n ? -instantScrollPosition : instantScrollPosition;\n\n scrollObj[xy] = instantScrollPosition;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration: 130,\n complete: scrollActionInstantFinished\n }));\n }\n else\n scrollActionInstantFinished();\n }\n else {\n decreaseScroll = isFirstIteration ? decreaseScrollCondition : decreaseScroll;\n finishedCondition = rtlIsNormal\n ? (decreaseScroll ? handleOffset + handleLength >= mouseOffset : handleOffset <= mouseOffset)\n : (decreaseScroll ? handleOffset <= mouseOffset : handleOffset + handleLength >= mouseOffset);\n\n if (finishedCondition) {\n clearTimeout(trackTimeout);\n _base.scrollStop();\n trackTimeout = undefined;\n scrollActionFinsished(true);\n }\n else {\n trackTimeout = setTimeout(scrollAction, timeoutDelay);\n\n scrollObj[xy] = (decreaseScroll ? '-=' : '+=') + scrollDistance;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration: scrollDuration\n }));\n }\n isFirstIteration = false;\n }\n }\n };\n if (ctrlKey)\n increaseTrackScrollAmount();\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = COMPATIBILITY.page(event)[xy];\n\n _scrollbarsHandlesDefineScrollPos = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._track, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n setupResponsiveEventListener(_documentElement,\n [_strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent],\n [documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart]);\n\n scrollAction();\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n }\n function onTrackMouseTouchEnter(event) {\n //make sure both scrollbars will stay visible if one scrollbar is hovered if autoHide is \"scroll\" or \"move\".\n _scrollbarsHandleHovered = true;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(true);\n }\n function onTrackMouseTouchLeave(event) {\n _scrollbarsHandleHovered = false;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n function onScrollbarMouseTouchDown(event) {\n COMPATIBILITY.stpP(event);\n }\n\n addDestroyEventListener(scrollbarVars._handle,\n _strMouseTouchDownEvent,\n onHandleMouseTouchDown);\n addDestroyEventListener(scrollbarVars._track,\n [_strMouseTouchDownEvent, _strMouseEnter, _strMouseLeave],\n [onTrackMouseTouchDown, onTrackMouseTouchEnter, onTrackMouseTouchLeave]);\n addDestroyEventListener(scrollbarVars._scrollbar,\n _strMouseTouchDownEvent,\n onScrollbarMouseTouchDown);\n\n if (_supportTransition) {\n addDestroyEventListener(scrollbarVars._scrollbar, _strTransitionEndEvent, function (event) {\n if (event.target !== scrollbarVars._scrollbar[0])\n return;\n refreshScrollbarHandleLength(isHorizontal);\n refreshScrollbarHandleOffset(isHorizontal);\n });\n }\n }", "title": "" }, { "docid": "2a430ea10cfe9f76ea3ae27ffd00c708", "score": "0.5706991", "text": "function changeScroll() {\n if($(window).height() > $(window).width()){ \n $(\".thumbnails\").mCustomScrollbar(\"destroy\"); \n $(\".thumbnails\").mCustomScrollbar({\n axis:\"x\",\n theme:\"light-3\",\n advanced:{autoExpandHorizontalScroll:true}\n });\n }else{ \n $(\".thumbnails\").mCustomScrollbar(\"destroy\"); \n $(\".thumbnails\").mCustomScrollbar(); \n }\n }", "title": "" }, { "docid": "ca8f89f9ac10dc93685b91b4add2a1d1", "score": "0.569175", "text": "handleScroll(e) {\n \n }", "title": "" }, { "docid": "1aee583ab131db0f74da629087515f19", "score": "0.5686629", "text": "function setSectionScroll() {\n for (section of sections) {\n let start = section.offsetTop;\n let end = start + section.offsetHeight;\n scrollHeights.push({\n start: start,\n end: end,\n section: section\n });\n }\n}", "title": "" }, { "docid": "ed49149190ecf3e355f9d65227c3d34d", "score": "0.5664333", "text": "function scroll() {\n const slider = document.getElementById('chartDiv');\n let isDown = false;\n let startX;\n let scrollLeft;\n\n slider.addEventListener('mousedown', (e) => {\n isDown = true;\n slider.classList.add('active');\n startX = e.pageX - slider.offsetLeft;\n scrollLeft = slider.scrollLeft;\n });\n slider.addEventListener('mouseleave', () => {\n isDown = false;\n slider.classList.remove('active');\n });\n slider.addEventListener('mouseup', () => {\n isDown = false;\n slider.classList.remove('active');\n });\n slider.addEventListener('mousemove', (e) => {\n if (!isDown) return;\n e.preventDefault();\n const x = e.pageX - slider.offsetLeft;\n const walk = (x - startX) * 2;\n slider.scrollLeft = scrollLeft - walk;\n });\n}", "title": "" }, { "docid": "3b5058b86ac8cbcf0d62404d31ff46a4", "score": "0.5661036", "text": "function gallery_maker(index) {\n var scroller = $('div#scroller-'+index+' div.innerScrollArea.innerScrollArea-'+index);\n var scrollerContent = scroller.children('ul');\n scrollerContent.children().clone().appendTo(scrollerContent);\n var curX = 0;\n scrollerContent.children().each(function(){\n var $this = $(this);\n $this.css('left', curX);\n curX += $this.outerWidth(true);\n });\n var fullW = curX / 2;\n var viewportW = scroller.width();\n\n // Scrolling speed management\n var controller = {curSpeed:0, fullSpeed:2};\n var $controller = $(controller);\n var tweenToNewSpeed = function(newSpeed, duration)\n {\n if (duration === undefined)\n duration = 600;\n $controller.stop(true).animate({curSpeed:newSpeed}, duration);\n };\n\n // Pause on hover\n scroller.hover(function(){\n tweenToNewSpeed(0);\n }, function(){\n tweenToNewSpeed(controller.fullSpeed);\n });\n\n // Scrolling management; start the automatical scrolling\n var doScroll = function()\n {\n var curX = scroller.scrollLeft();\n var newX = curX + controller.curSpeed;\n if (newX > fullW*2 - viewportW)\n newX -= fullW;\n scroller.scrollLeft(newX);\n };\n setInterval(doScroll, 20);\n tweenToNewSpeed(controller.fullSpeed);\n }", "title": "" }, { "docid": "2d6c7a30360a7d53937f65c51a1ce1a6", "score": "0.5643159", "text": "function removeResponsiveScrollOverflows(){\n var scrollOverflowHandler = self.options.scrollOverflowHandler;\n forEachSectionAndSlide(function(element){\n if(element.closest(SECTION_SEL).hasClass(AUTO_HEIGHT_RESPONSIVE)){\n scrollOverflowHandler.remove(element);\n }\n });\n }", "title": "" }, { "docid": "296749bc4af7e8452623b1450e9a3c6b", "score": "0.5620087", "text": "function setScrollPages() {\n\t$('#scrollerpage').empty();\n\tfor(var i=0; i<arrCategory.length; i++){\n\t\t\n\t\t$.li='<div class=\"pages\" style=\"position:relative; float:left; display:block; background-color:#000000;\">';\n\n\t\t\t$.li+='<div data-category=\"'+arrCategory[i].id+'\" style=\"position: absolute; top:0; left:0 color:#ffffff; width:100%; height:40px;\">';\n\t\t\t\n\t\t\t$.li+='<ul id=\"header\">';\n\t\t\t$.li+='<li><h2 class=\"back\"><img src=\"img/bullet/back.png\"/><span style=\"vertical-align:middle; margin-left:5px;\" >'+arrCategory[i].title+'</span></h2></li>';\n\t\t\t$.li+='<li><div class=\"share hidden\" ><img src=\"img/bullet/share.png\" /><div></li>';\t\t\t\n\t\t\t$.li+='</ul>';\n\t\t\t$.li+='</div>';\n\t\t\t\n\t\t\t \n \n\t\t\t$.li+='<div id=\"'+arrCategory[i].id+'\" class=\"page\" style=\"position:absolute; z-index:1; top:40px; bottom:0; left:0; width:100%; overflow:auto;\">';\n\t\t\t\t\n\t\t\t\t$.li+='<div id=\"'+arrCategory[i].id+'-featured\" class=\"featured\" style=\"position:absolute; z-index: 0; background-color:#000000;\"></div>';\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t$.li+='<div class=\"scroller\">';\n\t\t\t\t\t$.li+='<ul>';\n\t\t\t\t\t\t$.li+='<li>';\n\t\t\t\t\t\t\t$.li+='<ul id=\"'+arrCategory[i].id+'-news-featured\" class=\"featured\">';\t\n\t\t\t\t\t\t\t\t$.li+='<li id=\"'+arrCategory[i].id+'-news-featured-title\" class=\"featured\" ></li>';\n\t\t\t\t\t\t\t$.li+='</ul>';\n\t\t\t\t\t\t\t$.li+='<ul id=\"'+arrCategory[i].id+'-news1\" class=\"news1\" style=\"background-color:#ffffff;\">';\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$.li+='</ul>';\n\t\t\t\t\t\t\t$.li+='<ul class=\"status\" style=\"background-color:#ffffff; text-align:center;\"></ul>';\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$.li+='</li>';\n\t\t\t\t\t$.li+='</ul>';\n\t\t\t\t$.li+='</div>';\n\t\t\t$.li+='</div>';\t\n\t\t$.li+='</div>';\n\n\t\t$('#scrollerpage').append($.li);\n\t}\n}", "title": "" }, { "docid": "d2e1655e0bbf43a848d500a3079f8275", "score": "0.56013286", "text": "function setupScrollbarEvents(isHorizontal) {\n var scrollbarVars = getScrollbarVars(isHorizontal);\n var scrollbarVarsInfo = scrollbarVars._info;\n var insideIFrame = _windowElementNative.top !== _windowElementNative;\n var xy = scrollbarVars._x_y;\n var XY = scrollbarVars._X_Y;\n var scroll = _strScroll + scrollbarVars._Left_Top;\n var strActive = 'active';\n var strSnapHandle = 'snapHandle';\n var strClickEvent = 'click';\n var scrollDurationFactor = 1;\n var increaseDecreaseScrollAmountKeyCodes = [16, 17]; //shift, ctrl\n var trackTimeout;\n var mouseDownScroll;\n var mouseDownOffset;\n var mouseDownInvertedScale;\n\n function getPointerPosition(event) {\n return _msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]; //use screen coordinates in EDGE & IE because the page values are incorrect in frames.\n }\n function getPreparedScrollbarsOption(name) {\n return _currentPreparedOptions.scrollbars[name];\n }\n function increaseTrackScrollAmount() {\n scrollDurationFactor = 0.5;\n }\n function decreaseTrackScrollAmount() {\n scrollDurationFactor = 1;\n }\n function stopClickEventPropagation(event) {\n COMPATIBILITY.stpP(event);\n }\n function documentKeyDown(event) {\n if (inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n increaseTrackScrollAmount();\n }\n function documentKeyUp(event) {\n if (inArray(event.keyCode, increaseDecreaseScrollAmountKeyCodes) > -1)\n decreaseTrackScrollAmount();\n }\n function onMouseTouchDownContinue(event) {\n var originalEvent = event.originalEvent || event;\n var isTouchEvent = originalEvent.touches !== undefined;\n return _sleeping || _destroyed || nativeOverlayScrollbarsAreActive() || !_scrollbarsDragScrollingCache || (isTouchEvent && !getPreparedScrollbarsOption('touchSupport')) ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent;\n }\n function documentDragMove(event) {\n if (onMouseTouchDownContinue(event)) {\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var scrollRaw = (getPointerPosition(event) - mouseDownOffset) * mouseDownInvertedScale;\n var scrollDeltaPercent = scrollRaw / (trackLength - handleLength);\n var scrollDelta = (scrollRange * scrollDeltaPercent);\n scrollDelta = isFinite(scrollDelta) ? scrollDelta : 0;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.i)\n scrollDelta *= -1;\n\n _viewportElement[scroll](MATH.round(mouseDownScroll + scrollDelta));\n\n if (_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, mouseDownScroll + scrollDelta);\n\n if (!_supportPassiveEvents)\n COMPATIBILITY.prvD(event);\n }\n else\n documentMouseTouchUp(event);\n }\n function documentMouseTouchUp(event) {\n event = event || event.originalEvent;\n\n setupResponsiveEventListener(_documentElement,\n [_strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent],\n [documentDragMove, documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart],\n true);\n COMPATIBILITY.rAF()(function() {\n setupResponsiveEventListener(_documentElement, strClickEvent, stopClickEventPropagation, true, { _capture: true });\n });\n \n \n if (_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, true);\n\n _scrollbarsHandlesDefineScrollPos = false;\n removeClass(_bodyElement, _classNameDragging);\n removeClass(scrollbarVars._handle, strActive);\n removeClass(scrollbarVars._track, strActive);\n removeClass(scrollbarVars._scrollbar, strActive);\n\n mouseDownScroll = undefined;\n mouseDownOffset = undefined;\n mouseDownInvertedScale = 1;\n\n decreaseTrackScrollAmount();\n\n if (trackTimeout !== undefined) {\n _base.scrollStop();\n clearTimeout(trackTimeout);\n trackTimeout = undefined;\n }\n\n if (event) {\n var rect = _hostElementNative[LEXICON.bCR]();\n var mouseInsideHost = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom;\n\n //if mouse is outside host element\n if (!mouseInsideHost)\n hostOnMouseLeave();\n\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n }\n function onHandleMouseTouchDown(event) {\n if (onMouseTouchDownContinue(event))\n onHandleMouseTouchDownAction(event);\n }\n function onHandleMouseTouchDownAction(event) {\n mouseDownScroll = _viewportElement[scroll]();\n mouseDownScroll = isNaN(mouseDownScroll) ? 0 : mouseDownScroll;\n if (_isRTL && isHorizontal && !_rtlScrollBehavior.n || !_isRTL)\n mouseDownScroll = mouseDownScroll < 0 ? 0 : mouseDownScroll;\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = getPointerPosition(event);\n\n _scrollbarsHandlesDefineScrollPos = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._handle, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n setupResponsiveEventListener(_documentElement,\n [_strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strSelectStartEvent],\n [documentDragMove, documentMouseTouchUp, documentOnSelectStart]);\n COMPATIBILITY.rAF()(function() {\n setupResponsiveEventListener(_documentElement, strClickEvent, stopClickEventPropagation, false, { _capture: true });\n });\n \n\n if (_msieVersion || !_documentMixed)\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n function onTrackMouseTouchDown(event) {\n if (onMouseTouchDownContinue(event)) {\n var handleToViewportRatio = scrollbarVars._info._handleLength / Math.round(MATH.min(1, _viewportSize[scrollbarVars._w_h] / _contentScrollSizeCache[scrollbarVars._w_h]) * scrollbarVars._info._trackLength);\n var scrollDistance = MATH.round(_viewportSize[scrollbarVars._w_h] * handleToViewportRatio);\n var scrollBaseDuration = 270 * handleToViewportRatio;\n var scrollFirstIterationDelay = 400 * handleToViewportRatio;\n var trackOffset = scrollbarVars._track.offset()[scrollbarVars._left_top];\n var ctrlKey = event.ctrlKey;\n var instantScroll = event.shiftKey;\n var instantScrollTransition = instantScroll && ctrlKey;\n var isFirstIteration = true;\n var easing = 'linear';\n var decreaseScroll;\n var finishedCondition;\n var scrollActionFinsished = function (transition) {\n if (_scrollbarsHandlesDefineScrollPos)\n refreshScrollbarHandleOffset(isHorizontal, transition);\n };\n var scrollActionInstantFinished = function () {\n scrollActionFinsished();\n onHandleMouseTouchDownAction(event);\n };\n var scrollAction = function () {\n if (!_destroyed) {\n var mouseOffset = (mouseDownOffset - trackOffset) * mouseDownInvertedScale;\n var handleOffset = scrollbarVarsInfo._handleOffset;\n var trackLength = scrollbarVarsInfo._trackLength;\n var handleLength = scrollbarVarsInfo._handleLength;\n var scrollRange = scrollbarVarsInfo._maxScroll;\n var currScroll = scrollbarVarsInfo._currentScroll;\n var scrollDuration = scrollBaseDuration * scrollDurationFactor;\n var timeoutDelay = isFirstIteration ? MATH.max(scrollFirstIterationDelay, scrollDuration) : scrollDuration;\n var instantScrollPosition = scrollRange * ((mouseOffset - (handleLength / 2)) / (trackLength - handleLength)); // 100% * positionPercent\n var rtlIsNormal = _isRTL && isHorizontal && ((!_rtlScrollBehavior.i && !_rtlScrollBehavior.n) || _normalizeRTLCache);\n var decreaseScrollCondition = rtlIsNormal ? handleOffset < mouseOffset : handleOffset > mouseOffset;\n var scrollObj = {};\n var animationObj = {\n easing: easing,\n step: function (now) {\n if (_scrollbarsHandlesDefineScrollPos) {\n _viewportElement[scroll](now); //https://github.com/jquery/jquery/issues/4340\n refreshScrollbarHandleOffset(isHorizontal, now);\n }\n }\n };\n instantScrollPosition = isFinite(instantScrollPosition) ? instantScrollPosition : 0;\n instantScrollPosition = _isRTL && isHorizontal && !_rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n\n //_base.scrollStop();\n\n if (instantScroll) {\n _viewportElement[scroll](instantScrollPosition); //scroll instantly to new position\n if (instantScrollTransition) {\n //get the scroll position after instant scroll (in case CSS Snap Points are used) to get the correct snapped scroll position\n //and the animation stops at the correct point\n instantScrollPosition = _viewportElement[scroll]();\n //scroll back to the position before instant scrolling so animation can be performed\n _viewportElement[scroll](currScroll);\n\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.i ? (scrollRange - instantScrollPosition) : instantScrollPosition;\n instantScrollPosition = rtlIsNormal && _rtlScrollBehavior.n ? -instantScrollPosition : instantScrollPosition;\n\n scrollObj[xy] = instantScrollPosition;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration: 130,\n complete: scrollActionInstantFinished\n }));\n }\n else\n scrollActionInstantFinished();\n }\n else {\n decreaseScroll = isFirstIteration ? decreaseScrollCondition : decreaseScroll;\n finishedCondition = rtlIsNormal\n ? (decreaseScroll ? handleOffset + handleLength >= mouseOffset : handleOffset <= mouseOffset)\n : (decreaseScroll ? handleOffset <= mouseOffset : handleOffset + handleLength >= mouseOffset);\n\n if (finishedCondition) {\n clearTimeout(trackTimeout);\n _base.scrollStop();\n trackTimeout = undefined;\n scrollActionFinsished(true);\n }\n else {\n trackTimeout = setTimeout(scrollAction, timeoutDelay);\n\n scrollObj[xy] = (decreaseScroll ? '-=' : '+=') + scrollDistance;\n _base.scroll(scrollObj, extendDeep(animationObj, {\n duration: scrollDuration\n }));\n }\n isFirstIteration = false;\n }\n }\n };\n if (ctrlKey)\n increaseTrackScrollAmount();\n\n mouseDownInvertedScale = getHostElementInvertedScale()[xy];\n mouseDownOffset = COMPATIBILITY.page(event)[xy];\n\n _scrollbarsHandlesDefineScrollPos = !getPreparedScrollbarsOption(strSnapHandle);\n addClass(_bodyElement, _classNameDragging);\n addClass(scrollbarVars._track, strActive);\n addClass(scrollbarVars._scrollbar, strActive);\n\n setupResponsiveEventListener(_documentElement,\n [_strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent],\n [documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart]);\n\n scrollAction();\n COMPATIBILITY.prvD(event);\n COMPATIBILITY.stpP(event);\n }\n }\n function onTrackMouseTouchEnter(event) {\n //make sure both scrollbars will stay visible if one scrollbar is hovered if autoHide is \"scroll\" or \"move\".\n _scrollbarsHandleHovered = true;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(true);\n }\n function onTrackMouseTouchLeave(event) {\n _scrollbarsHandleHovered = false;\n if (_scrollbarsAutoHideScroll || _scrollbarsAutoHideMove)\n refreshScrollbarsAutoHide(false);\n }\n function onScrollbarMouseTouchDown(event) {\n COMPATIBILITY.stpP(event);\n }\n\n addDestroyEventListener(scrollbarVars._handle,\n _strMouseTouchDownEvent,\n onHandleMouseTouchDown);\n addDestroyEventListener(scrollbarVars._track,\n [_strMouseTouchDownEvent, _strMouseEnter, _strMouseLeave],\n [onTrackMouseTouchDown, onTrackMouseTouchEnter, onTrackMouseTouchLeave]);\n addDestroyEventListener(scrollbarVars._scrollbar,\n _strMouseTouchDownEvent,\n onScrollbarMouseTouchDown);\n\n if (_supportTransition) {\n addDestroyEventListener(scrollbarVars._scrollbar, _strTransitionEndEvent, function (event) {\n if (event.target !== scrollbarVars._scrollbar[0])\n return;\n refreshScrollbarHandleLength(isHorizontal);\n refreshScrollbarHandleOffset(isHorizontal);\n });\n }\n }", "title": "" }, { "docid": "2b03ccc32b41bca492f111030dd28aac", "score": "0.55918187", "text": "function startSlider() {\n // Elements\n const sliderWrapper = document.querySelector('.slider-wrapper');\n const slider = document.querySelector('.slider');\n const slides = document.querySelectorAll('.slide');\n const sliderArrows = document.querySelectorAll('.slider-arrow');\n const sliderDots = document.querySelectorAll('.slider-dot');\n let isDown = false;\n let Xi;\n let scrollLeft;\n let run = true;\n\n // Listeners\n sliderWrapper.addEventListener('mousedown', e => {\n isDown = true;\n Xi = e.pageX - sliderWrapper.offsetLeft;\n scrollLeft = slider.scrollLeft;\n drag(e);\n });\n sliderWrapper.addEventListener('mouseleave', dragOut);\n sliderWrapper.addEventListener('mouseup', dragOut);\n sliderWrapper.addEventListener('mousemove', drag);\n\n function dragOut(e) {\n isDown = false;\n const x = e.pageX - slider.offsetLeft;\n const walk = x - Xi - slider.getBoundingClientRect().left;\n const offset = 100;\n if(run) {\n\n if(-offset < walk && walk < offset) {\n sliderDots.forEach((dot, i) => {\n if(dot.className.includes('active')) {\n smoothSliderScroll(slides[i])\n }\n })\n run = false;\n return\n } \n if(walk < 0) {\n let flag = true;\n sliderDots.forEach((dot, j) => {\n if (dot.className.includes('active') && flag) {\n smoothSliderScroll(slides[j + 1]);\n dot.classList.remove('active');\n sliderDots[j + 1].classList.add('active');\n flag = false;\n }\n });\n } else if(walk > 0) {\n sliderDots.forEach((dot, i) => {\n if (dot.className.includes('active')) {\n smoothSliderScroll(slides[i - 1]);\n dot.classList.remove('active');\n sliderDots[i - 1].classList.add('active');\n }\n });\n }\n run = false;\n }\n }\n\n function drag(e) {\n if(!isDown) return\n run = true;\n e.preventDefault();\n const x = e.pageX - slider.offsetLeft;\n const walk = x - Xi - slider.getBoundingClientRect().left;\n slider.scrollLeft = scrollLeft - walk;\n }\n\n\n function smoothSliderScroll(target, duration = 350) {\n const targetPosition = target.getBoundingClientRect().left;\n const startPosition = slider.scrollLeft;\n const offset = slider.getBoundingClientRect().left;\n let startTime = null;\n \n function animation(currentTime) {\n if (startTime === null) startTime = currentTime;\n const timeElapsed = currentTime - startTime;\n const run = ease(timeElapsed, startPosition, targetPosition - offset, duration);\n slider.scrollLeft = run;\n if (timeElapsed < duration) requestAnimationFrame(animation);\n }\n requestAnimationFrame(animation);\n }\n \n\n sliderArrows.forEach((arrow, i) =>\n arrow.addEventListener('click', () => {\n if (i) {\n let flag = true;\n sliderDots.forEach((dot, j) => {\n if (dot.className.includes('active') && flag) {\n smoothSliderScroll(slides[j + 1]);\n dot.classList.remove('active');\n sliderDots[j + 1].classList.add('active');\n flag = false;\n }\n });\n } else {\n sliderDots.forEach((dot, i) => {\n if (dot.className.includes('active')) {\n smoothSliderScroll(slides[i - 1]);\n dot.classList.remove('active');\n sliderDots[i - 1].classList.add('active');\n }\n });\n }\n })\n );\n\n sliderDots.forEach((dot, i) =>\n dot.addEventListener('click', () => {\n smoothSliderScroll(slides[i]);\n sliderDots.forEach(dot => dot.classList.remove('active'));\n dot.classList.add('active');\n })\n );\n\n resetSlider();\n function resetSlider() {\n smoothSliderScroll(slides[0]);\n sliderDots.forEach(dot => dot.classList.remove('active'));\n sliderDots[0].classList.add('active');\n }\n}", "title": "" }, { "docid": "838c7daaec1ef218a4428b17ad361094", "score": "0.5584972", "text": "function customizeScroll ()\r\n{\r\n // custom scroll\r\n $ ( '.tree_wrap' ).mCustomScrollbar ( {\r\n scrollButtons : {\r\n enable : true\r\n },\r\n axis : 'yx',\r\n theme : 'inset-2',\r\n scrollbarPosition : 'outside',\r\n scrollInertia : 300\r\n } );\r\n}", "title": "" }, { "docid": "5bf5535e592770ea3af628484a69d233", "score": "0.557757", "text": "render() {\n \n return (\n <div>\n <div style={{height:\"10vh\"}}>\n <PresentationNavigation \n handleNav={this.handleNav}\n />\n </div>\n <ScrollBar option={{wheelSpeed : 0.3, suppressScrollX : true}}>\n <div style={{height:\"76vh\",padding:\"2px\"}}>\n <EditSlidPanel\n updatePresentation={this.updatePresentation}\n />\n </div>\n </ScrollBar> \n </div>\n );\n }", "title": "" }, { "docid": "dda85c4b51d17d74054c79cd142de5af", "score": "0.5567773", "text": "function updateScrollbars(d /* display */, docHeight) { // 322\n var totalHeight = docHeight + 2 * paddingTop(d); // 323\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\"; // 324\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight); // 325\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth; // 326\n var needsV = scrollHeight > d.scroller.clientHeight; // 327\n if (needsV) { // 328\n d.scrollbarV.style.display = \"block\"; // 329\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\"; // 330\n d.scrollbarV.firstChild.style.height = // 331\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\"; // 332\n } else d.scrollbarV.style.display = \"\"; // 333\n if (needsH) { // 334\n d.scrollbarH.style.display = \"block\"; // 335\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\"; // 336\n d.scrollbarH.firstChild.style.width = // 337\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\"; // 338\n } else d.scrollbarH.style.display = \"\"; // 339\n if (needsH && needsV) { // 340\n d.scrollbarFiller.style.display = \"block\"; // 341\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\"; // 342\n } else d.scrollbarFiller.style.display = \"\"; // 343\n // 344\n if (mac_geLion && scrollbarWidth(d.measure) === 0) // 345\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\"; // 346\n } // 347", "title": "" }, { "docid": "f9c447307abfa1deeced8ddf497d9f87", "score": "0.5565817", "text": "refreshVirtualScrollbars() {\n // NOTE: This was at some point changed to only run on platforms with width-occupying scrollbars, but it needs\n // to run with overlayed scrollbars also to make them show/hide as they should.\n\n const\n me = this,\n {\n headerContainer,\n footerContainer,\n virtualScrollers,\n hasVerticalOverflow\n } = me,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some(subGrid => subGrid.overflowingHorizontally),\n method = hasVerticalOverflow ? 'add' : 'remove';\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n }\n else {\n virtualScrollers.classList.add('b-hide-display');\n }\n\n // Auto-widthed padding element at end hides or shows to create matching margin.\n if (DomHelper.scrollBarWidth) {\n headerContainer.classList[method]('b-show-yscroll-padding');\n footerContainer.classList[method]('b-show-yscroll-padding');\n virtualScrollers.classList[method]('b-show-yscroll-padding');\n }\n\n // Change of scrollbar status means height change\n me.onHeightChange();\n }", "title": "" }, { "docid": "64df6906f05169fe04c9c105ed3ec799", "score": "0.55651337", "text": "resizeHandler(){\n this.debug('resizeHandler');\n this.smoothscroll.resizeContainer();\n }", "title": "" }, { "docid": "64df6906f05169fe04c9c105ed3ec799", "score": "0.55651337", "text": "resizeHandler(){\n this.debug('resizeHandler');\n this.smoothscroll.resizeContainer();\n }", "title": "" }, { "docid": "9770e06b4e351a7de225767b35259869", "score": "0.55349064", "text": "function updateScrollbars() {\n let viewbox = svg.viewbox();\n let docSize = getDocSize();\n\n docSize = docSize.merge( viewbox );\n\n /*\n *\n * [-------|-----------|-----------] Zoomed out\n * <-viewbox <-docsize-> viewbox ->\n *\n * |----------[------------]-----------| Zoomed in\n * <-docsize <- viewbox -> docsize->\n *\n */\n\n let H = SVG.get('uiScrollbarH');\n let pH = SVG.get('uiScrollposH');\n let widgetWidth = 12 / viewbox.zoom;\n H.height( widgetWidth );\n H.width( viewbox.width - widgetWidth );\n H.x( viewbox.x );\n H.y( viewbox.y + viewbox.height - H.height() );\n\n let V = SVG.get('uiScrollbarV');\n let pV = SVG.get('uiScrollposV');\n V.height( viewbox.height - widgetWidth );\n V.width( widgetWidth );\n V.x( viewbox.x + viewbox.width - V.width() );\n V.y( viewbox.y );\n\n let viewable = {\n width : Math.max( H.width() * viewbox.width / docSize.width, 1 ),\n height: Math.max( V.height() * viewbox.height / docSize.height, 1 ),\n // relative X and Y positions need to be shifted by negative offsets\n x : (viewbox.x - docSize.x) / docSize.width * H.width(),\n y : (viewbox.y - docSize.y) / docSize.height * V.height(),\n };\n\n pH.height( 12 / viewbox.zoom );\n pH.width( viewable.width );\n //left corner + scaled distance\n pH.x( viewbox.x + viewable.x );\n pH.y( viewbox.y + viewbox.height - pH.height() );\n\n pV.width( 12 / viewbox.zoom );\n pV.height( viewable.height );\n pV.y( viewbox.y + viewable.y );\n pV.x( viewbox.x + viewbox.width - pV.width() );\n}", "title": "" }, { "docid": "2cd2c76db871ae17a81bc52bc59ace23", "score": "0.5516911", "text": "setScene() {\n let viewportHeight = window.innerHeight;\n // TODO: use setpin instead?\n let outerscene = new ScrollMagic.Scene({\n triggerElement: this.rootsel,\n triggerHook: 'onLeave',\n duration: Math.max(1, this.root.node().offsetHeight - viewportHeight),\n })\n .on('enter', () => this.toggleFixed(true, false))\n .on('leave', e => this.toggleFixed(false, e.scrollDirection === 'FORWARD'))\n //.addIndicators()\n .addTo(this.controller);\n\n let slides = this.prose.selectAll('.slide-wrapper');\n slides.each( (dat,i,n) => {\n let wrappernode = n[i];\n let stagenode = d3.select(wrappernode).select('.slide');\n let stageheight = stagenode.node().offsetHeight;\n // we carefully set the duration so that the scenes tile exactly, with \n // no gaps or overlaps.\n let duration = wrappernode.offsetHeight - stageheight;\n if (i === n.length-1) {\n duration += 500; // XXX hack\n } else {\n let nextstage = d3.select(n[i+1]).select('.slide').node();\n duration += nextstage.offsetHeight;\n }\n let slide_scene = new ScrollMagic.Scene({\n triggerElement: wrappernode,\n triggerHook: isMobile() ? 'onEnter' : 'onLeave',\n offset: isMobile() ? stageheight : 0,\n duration: duration,\n })\n //.addIndicators({name: 'inner'+i})\n .on('enter', (e) => {\n let slug = dat.slug;\n console.assert(slug, \"No slug set for this stage\");\n let cb = dat.onEnter ?\n () => dat.onEnter(this.comp, e.scrollDirection === 'FORWARD')\n : () => null;\n if (this.comp.slug != slug) {\n vblog(`Quickchanging. Slide slug = ${slug}, current graphic slug = ${this.comp.slug}`);\n this.comp.quickChange(slug).then(cb);\n } else {\n if (this.comp.state === STATE.defragged && !dat.allow_defragged) {\n vblog('Refragging');\n this.comp.refrag();\n }\n cb();\n }\n vblog(`Entered stage ${i} w direction ${e.scrollDirection}`);\n stagenode.classed('active', true);\n if (dat.progressive) {\n this.comp.acquireScrollLock(i);\n }\n if (dat.proxy) {\n let proxynode = n[i+dat.proxy];\n d3.select(proxynode).select('.slide')\n .classed('active', true);\n }\n })\n // NB: when duration is not set, leave event is fired when the\n // trigger is scrolled past from the opposite scroll direction\n // TODO: this shouldn't be necessary\n .on('leave', (e) => {\n vblog(`Left stage ${i}`);\n stagenode.classed('active', false);\n let exitkey = e.scrollDirection === 'FORWARD' ? 'down' : 'up';\n let exitfn = dat.onExit && dat.onExit[exitkey];\n if (exitfn) {\n exitfn(this.comp);\n }\n if (dat.progressive) {\n this.comp.releaseScrollLock(i);\n }\n if (dat.proxy) {\n let proxynode = n[i+dat.proxy];\n d3.select(proxynode).select('.slide')\n .classed('active', false);\n }\n })\n .addTo(this.controller);\n if (!autoplay && dat.progressive) {\n slide_scene.on('progress', e => {\n this.comp.onScroll(e.progress, i, dat);\n });\n }\n });\n }", "title": "" }, { "docid": "8eb695230e6377be21daf3e848c8ba75", "score": "0.54974306", "text": "function Sections() {\n var _this = this;\n\n this.config = {\n template: '',\n sectionSelector: '.section',\n navSelector: '.bpager__list',\n sectionActiveClass: 'section--active',\n sectionPrevClass: 'section--previous',\n sectionNextClass: 'section--next'\n };\n\n window.sections = [];\n\n this.init = function () {\n var $sections = document.querySelectorAll(this.config.sectionSelector);\n var _this = this;\n\n for (var i = 0; i < $sections.length; i++) {\n var section = {};\n section.el = $sections[i];\n section.num = i + 1;\n\n if (section.el.className.indexOf(this.config.sectionActiveClass) != -1) {\n section.active = true;\n }\n\n if (section.el.querySelector('.sectionNumber')) {\n section.el.querySelector('.sectionNumber').innerHTML = section.num;\n }\n\n section.title = section.el.getAttribute('data-title');\n section.id = section.el.getAttribute('id');\n section.top = section.el.offsetTop;\n section.height = section.el.offsetHeight;\n section.bottom = section.el.offsetTop + section.el.offsetHeight;\n // We\n window.sections.push(section);\n };\n\n this.addNavs();\n this.bindings();\n };\n\n this.bindings = function () {\n\n // Binding keyboard events\n document.onkeydown = function (e) {\n e = e || window.event;\n switch (e.which || e.keyCode) {\n case 33:\n // page up\n _this.changeSection('prev');\n break;\n\n case 38:\n // up\n _this.changeSection('prev');\n break;\n\n case 40:\n // down\n _this.changeSection('next');\n break;\n\n case 34:\n // page down\n _this.changeSection('next');\n break;\n\n default:\n return; // exit this handler for other keys\n }\n };\n\n // Scroll wheel\n var animating;\n\n window.addEventListener('wheel', function (wheelEvent) {\n\n if (animating == true) return; // so we\n\n animating = true;\n\n if (wheelEvent.deltaY > 25) _this.changeSection('next');\n if (wheelEvent.deltaY < -25) _this.changeSection('prev');\n\n window.setTimeout(function () {\n animating = false;\n }, 750);\n });\n\n // Swipe up or down\n // From: http://stackoverflow.com/questions/2264072/detect-a-finger-swipe-through-javascript-on-the-iphone-and-android\n // 🚨 UNTESTED 🚨 UNTESTED 🚨\n // document.addEventListener('touchstart', window.handleTouchStart, false);\n // document.addEventListener('touchmove', window.handleTouchMove, false);\n //\n // var xDown = null;\n // var yDown = null;\n //\n // window.handleTouchStart = function(evt){\n // console.log('touchstart');\n // xDown = evt.originalEvent.touches[0].clientX;\n // yDown = evt.originalEvent.touches[0].clientY;\n // };\n //\n // window.handleTouchMove = function(evt){\n // if ( ! xDown || ! yDown ) {\n // return;\n // }\n //\n // var xUp = evt.originalEvent.touches[0].clientX;\n // var yUp = evt.originalEvent.touches[0].clientY;\n //\n // var xDiff = xDown - xUp;\n // var yDiff = yDown - yUp;\n //\n // if ( Math.abs( xDiff ) < Math.abs( yDiff ) ) {\n // if ( yDiff > 0 ) { // up\n // _this.changeSection('next')\n // } else { // down\n // _this.changeSection('prev')\n // }\n // }\n // /* reset values */\n // xDown = null;\n // yDown = null;\n // };\n };\n\n this.addNavs = function (section) {\n var _this = this;\n var nav = document.querySelector(this.config.navSelector);\n var navItems = \"\";\n\n var _loop = function _loop(i) {\n var section = window.sections[i];\n section.navItem = document.createElement('li');\n section.navItem.className = 'bpager__list_item';\n if (section.active == true) section.navItem.setAttribute('active', true);\n section.navItem.innerHTML = '<a href=\"#' + section.id + '\">\\n <span class=\"tooltip\"><em>s' + section.num + '.</em>' + section.title + '</span>\\n <i></i>\\n </a>\\n </li>';\n\n section.navItem.onclick = function (e) {\n _this.changeSection(section.num);\n e.preventDefault();\n };\n nav.appendChild(section.navItem);\n };\n\n for (var i = 0; i < window.sections.length; i++) {\n _loop(i);\n };\n };\n\n this.changeSection = function (targetSection) {\n var current = window.sections.filter(function (obj) {\n return obj.active == true;\n })[0];\n\n // Get correct section number\n if (targetSection == 'next') targetSection = current.num + 1;\n if (targetSection == 'prev') targetSection = current.num - 1;\n\n if (targetSection > window.sections.length || targetSection < 1) return;\n\n // Deactivate current slide\n current.active = false;\n\n for (var i = 0; i < window.sections.length; i++) {\n var section = window.sections[i];\n section.navItem.setAttribute('active', '');\n\n if (section.num == targetSection) {\n section.active = true;\n section.el.classList.remove(this.config.sectionPrevClass);\n section.el.classList.add(this.config.sectionActiveClass);\n section.navItem.setAttribute('active', true);\n } else if (section.num < targetSection) {\n section.el.classList.add(this.config.sectionPrevClass);\n section.el.classList.remove(this.config.sectionActiveClass);\n } else if (section.num > targetSection) {\n section.el.classList.remove(this.config.sectionPrevClass);\n section.el.classList.remove(this.config.sectionActiveClass);\n }\n }\n };\n\n this.init();\n}", "title": "" }, { "docid": "f0a42fab3bfe671c00d39bef0453c682", "score": "0.5478048", "text": "function HorizontalScroll(_a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.scrollAmount, scrollAmount = _c === void 0 ? SCROLL_AMOUNT : _c, _d = _b.scrollAmountStep, scrollAmountStep = _d === void 0 ? SCROLL_AMOUNT_STEP : _d, _e = _b.container, container = _e === void 0 ? document.documentElement : _e, _f = _b.showScrollbars, showScrollbars = _f === void 0 ? false : _f, _g = _b.preventVerticalScroll, preventVerticalScroll = _g === void 0 ? false : _g;\n var _this = _super.call(this) || this;\n _this.observer = null;\n _this.containerIsIntersecting = false;\n _this.style = null;\n _this.cssClass = \"__horizontal-container-\" + Math.round(Math.random() * 100000);\n _this.preventVerticalScroll = false;\n // ignore keydown events when any of these elements are focused\n _this.blacklist = ['input', 'select', 'textarea'];\n _this.wheel = function (e) {\n e.preventDefault();\n var angle = Math.atan2(e.deltaY, e.deltaX) / Math.PI;\n var forward = !(angle < 0.675 && angle > -0.375);\n var offset = Math.sqrt(Math.pow(e.deltaX, 2) + Math.pow(e.deltaY, 2));\n if (_this.preventVerticalScroll) {\n return;\n }\n switch (e.deltaMode) {\n case WheelEvent.DOM_DELTA_LINE:\n offset *= SCROLL_AMOUNT;\n break;\n case WheelEvent.DOM_DELTA_PAGE:\n offset *= SCROLL_AMOUNT_STEP;\n break;\n default:\n break;\n }\n if (forward) {\n offset *= -1;\n }\n var distance = Math.max(_this.container.scrollLeft + offset, 0);\n if (distance < _this.container.scrollWidth - _this.container.clientWidth) {\n if (e.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n // force spring to new value & don't animate\n _this.spring.setCurrentValue(distance);\n }\n else {\n _this.spring.setEndValue(distance);\n }\n }\n };\n _this.keydown = function (e) {\n // only listen to key events if the container actually is in view\n if (_this.observer && !_this.containerIsIntersecting) {\n return;\n }\n var target = e.target;\n // if any blacklisted elements are focused, we'll won't handle this keydown.\n if (target &&\n target !== document.body &&\n _this.blacklist.includes(target.nodeName.toLowerCase())) {\n return;\n }\n var scrollValue = _this.container.scrollLeft;\n var max = _this.container.scrollWidth - _this.container.clientWidth;\n var prevent = true;\n switch (e.code) {\n case 'Home':\n scrollValue = 0;\n break;\n case 'End':\n scrollValue = max;\n break;\n case 'ArrowUp':\n if (_this.preventVerticalScroll) {\n prevent = true;\n break;\n }\n else {\n scrollValue -= SCROLL_AMOUNT;\n break;\n }\n case 'ArrowDown':\n if (_this.preventVerticalScroll) {\n prevent = true;\n break;\n }\n else {\n scrollValue += SCROLL_AMOUNT;\n break;\n }\n case 'ArrowLeft':\n scrollValue -= SCROLL_AMOUNT;\n break;\n case 'ArrowRight':\n scrollValue += SCROLL_AMOUNT;\n break;\n case 'PageUp':\n scrollValue -= SCROLL_AMOUNT_STEP;\n break;\n case 'PageDown':\n case 'Space':\n scrollValue += SCROLL_AMOUNT_STEP;\n break;\n default:\n prevent = false;\n break;\n }\n // correct scroll value if it's out of bounds\n scrollValue = Math.max(scrollValue, 0);\n scrollValue = Math.min(scrollValue, max);\n // if nothing changed, do nothing\n if (scrollValue === _this.spring.getEndValue()) {\n return;\n }\n if (prevent) {\n e.preventDefault();\n }\n if (_this.spring) {\n if (_this.spring.isAtRest()) {\n _this.spring.setCurrentValue(_this.container.scrollLeft);\n }\n _this.spring.setEndValue(scrollValue);\n }\n };\n if (typeof container === 'undefined') {\n return _this;\n }\n _this.preventVerticalScroll = preventVerticalScroll;\n // bind events\n _this.container = container;\n _this.container.addEventListener('wheel', _this.wheel);\n document.addEventListener('keydown', _this.keydown);\n // set up interaction observer\n if (_this.container !== document.documentElement) {\n if ('IntersectionObserver' in window) {\n _this.observer = new IntersectionObserver(function (_a) {\n var _b = __read(_a, 1), entry = _b[0];\n _this.containerIsIntersecting = entry.isIntersecting;\n });\n _this.observer.observe(_this.container);\n }\n else {\n // tslint:disable-next-line:no-console\n console.warn('[horizontal-scroll] WARN: IntersectionObserver not available, assuming key navigation is always applicable to your container.');\n }\n }\n // add CSS to hide scrollbars\n if (!showScrollbars) {\n _this.container.classList.add(_this.cssClass);\n _this.style = document.createElement('style');\n document.head.appendChild(_this.style);\n var sheet = _this.style.sheet;\n if (sheet) {\n sheet.insertRule(\"\\n .\" + _this.cssClass + \" {\\n overflow-y: hidden;\\n overflow-x: auto;\\n\\n /* prevents unwanted gestures and bounce effects */\\n overscroll-behavior: auto;\\n\\n /* vendor specific hacks to hide scrollbars */\\n scrollbar-width: none;\\n -ms-overflow-style: none;\\n }\\n \");\n var webkitCss = \"::-webkit-scrollbar { display: none; }\";\n if (_this.container !== document.documentElement) {\n webkitCss = \".\" + _this.cssClass + webkitCss;\n }\n sheet.insertRule(webkitCss);\n }\n }\n // init spring\n _this.springSystem = new rebound_1.SpringSystem();\n _this.spring = _this.springSystem.createSpring();\n _this.spring.setCurrentValue(_this.container.scrollLeft);\n _this.spring.setOvershootClampingEnabled(true);\n _this.spring.addListener({\n onSpringUpdate: function (currSpring) {\n var value = currSpring.getCurrentValue();\n _this.emit('scroll', value);\n // disallow gestures on the vertical axis. also disallow on horizontal when we've scrolled\n _this.container.style.overscrollBehaviorY = 'none';\n _this.container.style.overscrollBehaviorX = value > 0 ? 'none' : 'auto';\n _this.container.scrollLeft = value;\n },\n });\n _this.spring.notifyPositionUpdated();\n return _this;\n }", "title": "" }, { "docid": "c794bd17e2514675da31ae4e178c87ab", "score": "0.5475357", "text": "function appendScrollBar() {\r\n // button and thumb image sizes (programmer customizable)\r\n var imgH = 16;\r\n var imgW = 16;\r\n var thumbH = 27;\r\n\r\n // \"up\" arrow, needed first to help size scrollWrapper\r\n var lineup = document.createElement(\"img\");\r\n lineup.id = \"lineup\" + (scrollBars.length - 1);\r\n lineup.className = \"lineup\";\r\n lineup.index = this.index;\r\n lineup.src = \"scrollUp.gif\";\r\n lineup.height = imgH;\r\n lineup.width = imgW;\r\n lineup.alt = \"Scroll Up\";\r\n lineup.style.position = \"absolute\";\r\n lineup.style.top = \"0px\";\r\n lineup.style.left = \"0px\";\r\n\r\n // scrollWrapper defines \"page\" region color and 3-D borders\r\n var wrapper = document.createElement(\"div\");\r\n wrapper.id = \"scrollWrapper\" + (scrollBars.length - 1);\r\n wrapper.className = \"scrollWrapper\";\r\n wrapper.index = this.index;\r\n wrapper.style.position = \"absolute\";\r\n wrapper.style.visibility = \"hidden\";\r\n wrapper.style.top = \"0px\";\r\n wrapper.style.left = this.ownerWidth + this.ownerBorder - \r\n this.quirks.ownerBorder + \"px\";\r\n wrapper.style.borderTop = \"2px solid #666666\";\r\n wrapper.style.borderLeft = \"2px solid #666666\";\r\n wrapper.style.borderRight= \"2px solid #cccccc\";\r\n wrapper.style.borderBottom= \"2px solid #cccccc\";\r\n wrapper.style.backgroundColor = \"#999999\";\r\n if (this.quirks.on) {\r\n this.quirks.scrollBorder = 2;\r\n }\r\n wrapper.style.width = lineup.width + (this.quirks.scrollBorder * 2) + \"px\";\r\n wrapper.style.height = this.ownerHeight + (this.ownerBorder - 4) - \r\n (this.quirks.scrollBorder * 2) + \"px\";\r\n\r\n // \"down\" arrow\r\n var linedn = document.createElement(\"img\");\r\n linedn.id = \"linedown\" + (scrollBars.length - 1);\r\n linedn.className = \"linedown\";\r\n linedn.index = this.index;\r\n linedn.src = \"scrollDn.gif\";\r\n linedn.height = imgH;\r\n linedn.width = imgW;\r\n linedn.alt = \"Scroll Down\";\r\n linedn.style.position = \"absolute\";\r\n linedn.style.top = parseInt(this.ownerHeight) + (this.ownerBorder - 4) - \r\n (this.quirks.ownerBorder) - linedn.height + \"px\";\r\n linedn.style.left = \"0px\";\r\n\r\n // fixed-size draggable thumb \r\n var thumb = document.createElement(\"img\");\r\n thumb.id = \"thumb\" + (scrollBars.length - 1);\r\n thumb.index = this.index;\r\n thumb.src = \"thumb.gif\";\r\n thumb.height = thumbH;\r\n thumb.width = imgW;\r\n thumb.alt = \"Scroll Dragger\";\r\n thumb.style.position = \"absolute\";\r\n thumb.style.top = lineup.height + \"px\";\r\n thumb.style.width = imgW + \"px\";\r\n thumb.style.height = thumbH + \"px\";\r\n thumb.style.left = \"0px\";\r\n\r\n // fill in scrollBar object properties from rendered elements\r\n this.upButton = wrapper.appendChild(lineup);\r\n this.thumb = wrapper.appendChild(thumb);\r\n this.dnButton = wrapper.appendChild(linedn);\r\n this.scrollWrapper = this.rootElem.appendChild(wrapper);\r\n this.buttonLength = imgH;\r\n this.thumbLength = thumbH;\r\n this.scrollWrapperLength = parseInt(getElementStyle(this.scrollWrapper.id, \r\n \"height\", \"height\"));\r\n this.dragZone.left = 0;\r\n this.dragZone.top = this.buttonLength;\r\n this.dragZone.right = this.buttonLength;\r\n this.dragZone.bottom = this.scrollWrapperLength - this.buttonLength - \r\n (this.quirks.scrollBorder * 2)\r\n\r\n // all events processed by scrollWrapper element\r\n this.scrollWrapper.onmousedown = handleScrollClick;\r\n this.scrollWrapper.onmouseup = handleScrollStop;\r\n this.scrollWrapper.oncontextmenu = blockEvent;\r\n this.scrollWrapper.ondrag = blockEvent;\r\n\r\n // OK to show\r\n this.scrollWrapper.style.visibility = \"visible\";\r\n}", "title": "" }, { "docid": "e8ec0c8f7687300f22f8af3ca320221b", "score": "0.54752827", "text": "_updateScrollbars() {\n var iframeSize = this.__iframeSize;\n var paneSize = this.getChildControl(\"iframe\").getBounds();\n var innerSize = this.getChildControl(\"iframe\").getInnerSize();\n\n if (!iframeSize || !innerSize || !innerSize) {\n return;\n }\n\n var showX = false;\n var showY = false;\n\n var scrollbarX = this.getScrollbarX();\n var scrollbarY = this.getScrollbarY();\n\n if (scrollbarX === \"auto\" && scrollbarY === \"auto\") {\n // Check if the container is big enough to show\n // the full content.\n var showX = iframeSize.width > innerSize.width;\n var showY = iframeSize.height > innerSize.height;\n\n // Dependency check\n // We need a special intelligence here when only one\n // of the autosized axis requires a scrollbar\n // This scrollbar may then influence the need\n // for the other one as well.\n if ((showX || showY) && !(showX && showY)) {\n if (showX) {\n showY = iframeSize.height > paneSize.height;\n } else if (showY) {\n showX = iframeSize.width > paneSize.width;\n }\n }\n } else {\n var showX = scrollbarX === \"on\";\n var showY = scrollbarY === \"on\";\n\n // Check auto values afterwards with already\n // corrected client dimensions\n if (\n iframeSize.width > (showX ? paneSize.width : innerSize.width) &&\n scrollbarX === \"auto\"\n ) {\n showX = true;\n }\n\n if (\n iframeSize.height > (showX ? paneSize.height : innerSize.height) &&\n scrollbarY === \"auto\"\n ) {\n showY = true;\n }\n }\n\n this._configureScrollbar(\n \"scrollbar-x\",\n showX,\n innerSize.width,\n iframeSize.width\n );\n\n this._configureScrollbar(\n \"scrollbar-y\",\n showY,\n innerSize.height,\n iframeSize.height\n );\n\n this._updateCornerWidget();\n }", "title": "" }, { "docid": "0729d85b2be967cb79616d638cfe6e8e", "score": "0.5468421", "text": "function setSettingListHeightAndScroll() {\n var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight());\n var $el = $('.right-sidebar .demo-settings');\n\n $el.slimScroll({ destroy: true }).height('auto');\n $el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\n $el.slimscroll({\n height: height + 'px',\n color: 'rgba(0,0,0,0.5)',\n size: '4px',\n alwaysVisible: false,\n borderRadius: '0',\n railBorderRadius: '0'\n });\n}", "title": "" }, { "docid": "99f6aa8a7bbbf045fc4214f2942b7c15", "score": "0.5468306", "text": "function makeScrollable($wrapper, $container, contPadding){\r\n //Get menu width\r\n var divWidth = $wrapper.width();\r\n\r\n //Remove scrollbars\r\n $wrapper.css({\r\n overflow: 'hidden'\r\n });\r\n\r\n //Find last image container\r\n var lastLi = $container.find('img:last-child');\r\n $wrapper.scrollLeft(0);\r\n //When user move mouse over menu\r\n $wrapper.unbind('mousemove').bind('mousemove',function(e){\r\n\r\n //As images are loaded ul width increases,\r\n //so we recalculate it each time\r\n var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + contPadding;\r\n\r\n var left = (e.pageX - $wrapper.offset().left) * (ulWidth-divWidth) / divWidth;\r\n $wrapper.scrollLeft(left);\r\n });\r\n }", "title": "" }, { "docid": "3e1d40f7cac95bdea443779e22eac5cf", "score": "0.5454209", "text": "function sidebarBodyCustomScrollBar() {\n new SimpleBar(document.querySelector('.sidebar .sidebar-body'))\n }", "title": "" }, { "docid": "e3829b413a22d8851784cda8cdf7a62b", "score": "0.54416215", "text": "function scroll(els) {\n sections = els;\n\n // when window is scrolled call position. When it is resized call resize\n d3.select(window)\n .on('scroll.scroller', position)\n .on('resize.scroller', resize);\n\n // manually call resize initially to setup scroller\n resize();\n\n // hack to get position to be called once for the scroll position on load.\n // @v4 timer no longer stops if you return true at the end of the callback function - so here we stop it explicitly.\n var timer = d3.timer(function () {\n position();\n timer.stop();\n });\n }", "title": "" }, { "docid": "dd5f2325ef783b8cfdf9aee4f1abf4c0", "score": "0.5437594", "text": "handleScrolled(evt) {\n this.scrollX += evt.deltaX\n this.scrollY += evt.deltaY\n }", "title": "" }, { "docid": "e7e286103118c06301b705473a39607e", "score": "0.54298645", "text": "function edgtfInitScrollingSections() {\n\t\tvar container = $('.edgtf-scrolling-sections-holder');\n\t\t\n\t\tfunction initResponsiveStyle(scrollingSectionsItem) {\n\t\t\tvar style = '',\n\t\t\t\tresponsiveStyle = '';\n\t\t\t\n\t\t\tscrollingSectionsItem.each(function () {\n\t\t\t\tvar thisItem = $(this),\n\t\t\t\t\titemClass = '',\n\t\t\t\t\tlargeLaptop = '',\n\t\t\t\t\tsmallLaptop = '',\n\t\t\t\t\tipadLandscape = '',\n\t\t\t\t\tipadPortrait = '',\n\t\t\t\t\tmobileLandscape = '',\n\t\t\t\t\tmobilePortrait = '';\n\t\t\t\t\n\t\t\t\tif (typeof thisItem.data('item-class') !== 'undefined' && thisItem.data('item-class') !== false) {\n\t\t\t\t\titemClass = thisItem.data('item-class');\n\t\t\t\t}\n\t\t\t\tif (typeof thisItem.data('1280-1600') !== 'undefined' && thisItem.data('1280-1600') !== false) {\n\t\t\t\t\tlargeLaptop = thisItem.data('1280-1600');\n\t\t\t\t}\n\t\t\t\tif (typeof thisItem.data('1024-1280') !== 'undefined' && thisItem.data('1024-1280') !== false) {\n\t\t\t\t\tsmallLaptop = thisItem.data('1024-1280');\n\t\t\t\t}\n\t\t\t\tif (typeof thisItem.data('768-1024') !== 'undefined' && thisItem.data('768-1024') !== false) {\n\t\t\t\t\tipadLandscape = thisItem.data('768-1024');\n\t\t\t\t}\n\t\t\t\tif (typeof thisItem.data('600-768') !== 'undefined' && thisItem.data('600-768') !== false) {\n\t\t\t\t\tipadPortrait = thisItem.data('600-768');\n\t\t\t\t}\n\t\t\t\tif (typeof thisItem.data('480-600') !== 'undefined' && thisItem.data('480-600') !== false) {\n\t\t\t\t\tmobileLandscape = thisItem.data('480-600');\n\t\t\t\t}\n\t\t\t\tif (typeof thisItem.data('480') !== 'undefined' && thisItem.data('480') !== false) {\n\t\t\t\t\tmobilePortrait = thisItem.data('480');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (largeLaptop.length || smallLaptop.length || ipadLandscape.length || ipadPortrait.length || mobileLandscape.length || mobilePortrait.length) {\n\t\t\t\t\t\n\t\t\t\t\tif (largeLaptop.length) {\n\t\t\t\t\t\tresponsiveStyle += \"@media only screen and (min-width: 1280px) and (max-width: 1600px) {.edgtf-ss-item-content.\" + itemClass + \" { padding: \" + largeLaptop + \" !important; } }\";\n\t\t\t\t\t}\n\t\t\t\t\tif (smallLaptop.length) {\n\t\t\t\t\t\tresponsiveStyle += \"@media only screen and (min-width: 1024px) and (max-width: 1280px) {.edgtf-ss-item-content.\" + itemClass + \" { padding: \" + smallLaptop + \" !important; } }\";\n\t\t\t\t\t}\n\t\t\t\t\tif (ipadLandscape.length) {\n\t\t\t\t\t\tresponsiveStyle += \"@media only screen and (min-width: 768px) and (max-width: 1024px) {.edgtf-ss-item-content.\" + itemClass + \" { padding: \" + ipadLandscape + \" !important; } }\";\n\t\t\t\t\t}\n\t\t\t\t\tif (ipadPortrait.length) {\n\t\t\t\t\t\tresponsiveStyle += \"@media only screen and (min-width: 600px) and (max-width: 768px) {.edgtf-ss-item-content.\" + itemClass + \" { padding: \" + ipadPortrait + \" !important; } }\";\n\t\t\t\t\t}\n\t\t\t\t\tif (mobileLandscape.length) {\n\t\t\t\t\t\tresponsiveStyle += \"@media only screen and (min-width: 480px) and (max-width: 600px) {.edgtf-ss-item-content.\" + itemClass + \" { padding: \" + mobileLandscape + \" !important; } }\";\n\t\t\t\t\t}\n\t\t\t\t\tif (mobilePortrait.length) {\n\t\t\t\t\t\tresponsiveStyle += \"@media only screen and (max-width: 480px) {.edgtf-ss-item-content.\" + itemClass + \" { padding: \" + mobilePortrait + \" !important; } }\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tif (responsiveStyle.length) {\n\t\t\t\tstyle = '<style type=\"text/css\" data-type=\"fluid_edge_ss_shortcodes_custom_css\">' + responsiveStyle + '</style>';\n\t\t\t}\n\t\t\t\n\t\t\tif (style.length) {\n\t\t\t\t$('head').append(style);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction initScrollLogic(scrollingSectionsItem, containerBackgroundHolder) {\n\t\t\tscrollingSectionsItem.each(function () {\n\t\t\t\tvar thisItem = $(this),\n\t\t\t\t\tfirstItem = scrollingSectionsItem.first(),\n\t\t\t\t\titemBackground = '',\n\t\t\t\t\titemBackgroundImage = '',\n\t\t\t\t\tscroll = edgtf.scroll,\n\t\t\t\t\twindowBottomPosition = scroll + edgtf.windowHeight,\n\t\t\t\t\titemTopPosition = thisItem.position().top,\n\t\t\t\t\titemBottomPosition = itemTopPosition + thisItem.outerHeight();\n\t\t\t\t\n\t\t\t\tif (scroll === 0) {\n\t\t\t\t\tscrollingSectionsItem.removeClass('edgtf-item-in-view edgtf-active-item');\n\t\t\t\t\tfirstItem.addClass('edgtf-item-in-view edgtf-active-item');\n\t\t\t\t\t\n\t\t\t\t\tif (typeof firstItem.data('background-color') !== 'undefined' && firstItem.data('background-color') !== false) {\n\t\t\t\t\t\titemBackground = firstItem.data('background-color');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (typeof firstItem.data('background-image') !== 'undefined' && firstItem.data('background-image') !== false) {\n\t\t\t\t\t\titemBackgroundImage = firstItem.data('background-image');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (itemBackground.length && !itemBackgroundImage.length) {\n\t\t\t\t\t\tcontainerBackgroundHolder.css({'background': itemBackground});\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (itemBackgroundImage.length) {\n\t\t\t\t\t\tcontainerBackgroundHolder.css({'background': 'url('+itemBackgroundImage+') center 0 no-repeat'});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (itemBottomPosition > scroll && itemTopPosition < windowBottomPosition) {\n\t\t\t\t\tthisItem.addClass('edgtf-item-in-view');\n\t\t\t\t\tscrollingSectionsItem.removeClass('edgtf-active-item').parent().find('.edgtf-ss-item.edgtf-item-in-view:last').addClass('edgtf-active-item');\n\t\t\t\t\t\n\t\t\t\t\tif (typeof thisItem.data('background-color') !== 'undefined' && thisItem.data('background-color') !== false) {\n\t\t\t\t\t\titemBackground = thisItem.data('background-color');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (typeof thisItem.data('background-image') !== 'undefined' && thisItem.data('background-image') !== false) {\n\t\t\t\t\t\titemBackgroundImage = thisItem.data('background-image');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (itemBackground.length && !itemBackgroundImage.length) {\n\t\t\t\t\t\tcontainerBackgroundHolder.css({'background': itemBackground});\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (itemBackgroundImage.length) {\n\t\t\t\t\t\tcontainerBackgroundHolder.css({'background': 'url('+itemBackgroundImage+') center 0 no-repeat'});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthisItem.removeClass('edgtf-item-in-view');\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn {\n\t\t\tinit: function () {\n\t\t\t\tif (container.length) {\n\t\t\t\t\tcontainer.each(function () {\n\t\t\t\t\t\tvar thisContainer = $(this),\n\t\t\t\t\t\t\tcontainerBackgroundHolder = thisContainer.children('.edgtf-ss-background'),\n\t\t\t\t\t\t\tscrollingSectionsItem = thisContainer.children('.edgtf-ss-item');\n\t\t\t\t\t\t\n\t\t\t\t\t\tinitResponsiveStyle(scrollingSectionsItem);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(window).load(function () {\n\t\t\t\t\t\t\tinitScrollLogic(scrollingSectionsItem, containerBackgroundHolder);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(window).resize(function () {\n\t\t\t\t\t\t\tinitScrollLogic(scrollingSectionsItem, containerBackgroundHolder);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(window).scroll(function () {\n\t\t\t\t\t\t\tinitScrollLogic(scrollingSectionsItem, containerBackgroundHolder);\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\t}", "title": "" }, { "docid": "8840ebf008c819ec5110a3cb080c4954", "score": "0.54179466", "text": "function scrollSection(evt) {\n evt.preventDefault();\n if (menuOpen === true) {\n menuAnimation();\n }\n var bodyarea = document.querySelector('body');\n var worksec = bodyarea.querySelector('#work');\n var aboutsec = bodyarea.querySelector('#about');\n var contactsec = bodyarea.querySelector('#contact');\n\n switch(this.id) {\n case 'main-logo':\n bodyarea.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-work':\n worksec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-about':\n aboutsec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n case 'menu-contact':\n contactsec.scrollIntoView({block: 'start', inline: 'start', behavior: 'smooth'});\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "6071e074f95797030ebd4bc2ce1619a9", "score": "0.5414877", "text": "addSmoothScroll () {\n\t\tthis.headerLinks.smoothScroll();\n\t}", "title": "" }, { "docid": "a7007635d4f1e2c66376f4a3569dc29f", "score": "0.5413368", "text": "function initScrollIndex() {\n if (!scrollNodes || scrollNodes.length === 0) {\n scrollNodes = Mode.getScrollableElements();\n scrollNodes.forEach(function (n) {\n n.removeEventListener('mousedown', scrollableMousedownHandler);\n n.addEventListener('mousedown', scrollableMousedownHandler);\n n.dataset.hint_scrollable = true;\n });\n scrollIndex = 0;\n }\n }", "title": "" }, { "docid": "98e1f53cff475e4991ad6c37aa78fabe", "score": "0.5412469", "text": "_setupScrollEffect() {\n new MouseScroller({\n debounceTime: 1000,\n scrollThreshold: 0.4,\n scrollDownCallback: () => this._stateService.getNextItem(),\n scrollUpCallback: () => this._stateService.getPreviousItem()\n });\n }", "title": "" }, { "docid": "e864ae2faa5ecad5652c37a6b78e81a7", "score": "0.5412233", "text": "function updateScroll() {\r\n var index = selectedObj.index;\r\n var scroller = scrollBars[index];\r\n \r\n var barLength = scroller.scrollWrapperLength - (scroller.quirks.scrollBorder * 2);\r\n var buttonLength = scroller.buttonLength;\r\n var thumbLength = scroller.thumbLength;\r\n var wellTop = buttonLength;\r\n var wellBottom = barLength - buttonLength - thumbLength;\r\n var wellSize = wellBottom - wellTop;\r\n var thumbTop = parseInt(getElementStyle(scroller.thumb.id, \"top\", \"top\"));\r\n var scrollFactor = (thumbTop - buttonLength)/wellSize;\r\n var docElem = scroller.contentElem;\r\n var docTop = Math.abs(parseInt(docElem.style.top));\r\n var scrollHeight = scroller.contentScrollHeight;\r\n var height = scroller.ownerHeight; \r\n shiftTo(scroller.ownerContentID, 0, -(Math.round((scrollHeight - height) * \r\n scrollFactor)));\r\n}", "title": "" }, { "docid": "23010ac650cb5e4945d7987aabce9790", "score": "0.54086506", "text": "function scrollSlider(slide){\r\n if(slide != null){\r\n landscapeScroll(closest(slide, SLIDES_WRAPPER_SEL), slide);\r\n }\r\n }", "title": "" }, { "docid": "4e67df5ae440ce180d96fa93cb12e9d2", "score": "0.54034966", "text": "handleScroll (e) {\n }", "title": "" }, { "docid": "b2f1035a674b11304cdfb769e0444748", "score": "0.540275", "text": "function scrollSlider(slide){\n if(slide.length){\n landscapeScroll(slide.closest(SLIDES_WRAPPER_SEL), slide);\n }\n }", "title": "" }, { "docid": "64b6d490205b4586da25dd38de498848", "score": "0.5400385", "text": "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "title": "" }, { "docid": "f13494a59ba2199b08f3ed2068b70f88", "score": "0.53920865", "text": "function createInfiniteSections(v){\r\n // Scrolling down\r\n if (!v.isMovementUp) {\r\n // Move all previous sections to after the active section\r\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\r\n }\r\n else { // Scrolling up\r\n // Move all next sections to before the active section\r\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\r\n }\r\n\r\n // Maintain the displayed position (now that we changed the element order)\r\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\r\n\r\n // Maintain the active slides visible in the viewport\r\n keepSlidesPosition();\r\n\r\n // save for later the elements that still need to be reordered\r\n v.wrapAroundElements = v.activeSection;\r\n\r\n // Recalculate animation variables\r\n v.dtop = v.element.position().top;\r\n v.yMovement = getYmovement(v.element);\r\n\r\n return v;\r\n }", "title": "" }, { "docid": "ee9655abc67ffb22eb272e4a8986bbf5", "score": "0.5389588", "text": "function createInfiniteSections(v){\n // Scrolling down\n if (!v.isMovementUp) {\n // Move all previous sections to after the active section\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\n }\n else { // Scrolling up\n // Move all next sections to before the active section\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\n }\n\n // Maintain the displayed position (now that we changed the element order)\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\n\n // Maintain the active slides visible in the viewport\n keepSlidesPosition();\n\n // save for later the elements that still need to be reordered\n v.wrapAroundElements = v.activeSection;\n\n // Recalculate animation variables\n v.dtop = v.element.position().top;\n v.yMovement = getYmovement(v.element);\n\n return v;\n }", "title": "" }, { "docid": "ee9655abc67ffb22eb272e4a8986bbf5", "score": "0.5389588", "text": "function createInfiniteSections(v){\n // Scrolling down\n if (!v.isMovementUp) {\n // Move all previous sections to after the active section\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\n }\n else { // Scrolling up\n // Move all next sections to before the active section\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\n }\n\n // Maintain the displayed position (now that we changed the element order)\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\n\n // Maintain the active slides visible in the viewport\n keepSlidesPosition();\n\n // save for later the elements that still need to be reordered\n v.wrapAroundElements = v.activeSection;\n\n // Recalculate animation variables\n v.dtop = v.element.position().top;\n v.yMovement = getYmovement(v.element);\n\n return v;\n }", "title": "" }, { "docid": "ee9655abc67ffb22eb272e4a8986bbf5", "score": "0.5389588", "text": "function createInfiniteSections(v){\n // Scrolling down\n if (!v.isMovementUp) {\n // Move all previous sections to after the active section\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\n }\n else { // Scrolling up\n // Move all next sections to before the active section\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\n }\n\n // Maintain the displayed position (now that we changed the element order)\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\n\n // Maintain the active slides visible in the viewport\n keepSlidesPosition();\n\n // save for later the elements that still need to be reordered\n v.wrapAroundElements = v.activeSection;\n\n // Recalculate animation variables\n v.dtop = v.element.position().top;\n v.yMovement = getYmovement(v.element);\n\n return v;\n }", "title": "" }, { "docid": "ee9655abc67ffb22eb272e4a8986bbf5", "score": "0.5389588", "text": "function createInfiniteSections(v){\n // Scrolling down\n if (!v.isMovementUp) {\n // Move all previous sections to after the active section\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\n }\n else { // Scrolling up\n // Move all next sections to before the active section\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\n }\n\n // Maintain the displayed position (now that we changed the element order)\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\n\n // Maintain the active slides visible in the viewport\n keepSlidesPosition();\n\n // save for later the elements that still need to be reordered\n v.wrapAroundElements = v.activeSection;\n\n // Recalculate animation variables\n v.dtop = v.element.position().top;\n v.yMovement = getYmovement(v.element);\n\n return v;\n }", "title": "" }, { "docid": "61d4dd59e00f2b0e2a81b3895c87466f", "score": "0.53863716", "text": "function scrollingSpy() {\n let scrollPosition = window.scrollY;\n for (let section of sections) {\n if (section.top <= scrollPosition && scrollPosition <= section.bottom) {\n setCurrentSection(section.id);\n document.querySelector('.scroll-navigation li.active').classList.remove('active');\n document.querySelector(`[data-section=${section.id}]`).classList.add('active');\n }\n }\n}", "title": "" }, { "docid": "edde9bc133dec7d8acccc46063d82d3c", "score": "0.5385001", "text": "function createInfiniteSections(v){\n // Scrolling down\n if (!v.isMovementUp) {\n // Move all previous sections to after the active section\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\n }\n else { // Scrolling up\n // Move all next sections to before the active section\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\n }\n\n // Maintain the displayed position (now that we changed the element order)\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\n\n // Maintain the active slides visible in the viewport\n keepSlidesPosition();\n\n // save for later the elements that still need to be reordered\n v.wrapAroundElements = v.activeSection;\n\n // Recalculate animation variables\n v.dtop = v.element.position().top;\n v.yMovement = getYmovement(v.element);\n\n //sections will temporally have another position in the DOM\n //updating this values in case we need them\n v.leavingSection = v.activeSection.index(SECTION_SEL) + 1;\n v.sectionIndex = v.element.index(SECTION_SEL);\n\n return v;\n }", "title": "" }, { "docid": "9ef66de6ff602f3390a397782469b817", "score": "0.53796303", "text": "function sliderScroll(){\n\t\t\t$(' .slider__el ').each(function(){\n\t\t\t\tvar pos = $(this).offset().top;\n\t\t\t\tvar id = $(this).attr('id');\n\t\t\t\tif( $(window).scrollTop() == (pos) && !iOS){\n\t\t\t\t\t$('.slider__el').removeClass('is-animated');\n\t\t\t\t\t$(this).addClass('is-animated');\n\t\t\t\t\t$('.slider__paginator li').removeClass('is-active');\n\t\t\t\t\t$('[href = #'+id+']').parent().addClass('is-active');\n\t\t\t\t}\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "dea266a369e75b04c3ead3105a860d95", "score": "0.53744173", "text": "function createInfiniteSections(v){\r\n // Scrolling down\r\n if (!v.isMovementUp) {\r\n // Move all previous sections to after the active section\r\n $(SECTION_ACTIVE_SEL).after(v.activeSection.prevAll(SECTION_SEL).get().reverse());\r\n }\r\n else { // Scrolling up\r\n // Move all next sections to before the active section\r\n $(SECTION_ACTIVE_SEL).before(v.activeSection.nextAll(SECTION_SEL));\r\n }\r\n\r\n // Maintain the displayed position (now that we changed the element order)\r\n silentScroll($(SECTION_ACTIVE_SEL).position().top);\r\n\r\n // Maintain the active slides visible in the viewport\r\n keepSlidesPosition();\r\n\r\n // save for later the elements that still need to be reordered\r\n v.wrapAroundElements = v.activeSection;\r\n\r\n // Recalculate animation variables\r\n v.dtop = v.element.position().top;\r\n v.yMovement = getYmovement(v.element);\r\n\r\n //sections will temporally have another position in the DOM\r\n //updating this values in case we need them\r\n v.leavingSection = v.activeSection.index(SECTION_SEL) + 1;\r\n v.sectionIndex = v.element.index(SECTION_SEL);\r\n\r\n return v;\r\n }", "title": "" }, { "docid": "b84538e123674052ddcb6b32c8f6ee94", "score": "0.5373286", "text": "function createInfiniteSections(v){\r\n // Scrolling down\r\n if (!v.isMovementUp) {\r\n // Move all previous sections to after the active section\r\n after($(SECTION_ACTIVE_SEL)[0], prevAll(v.activeSection, SECTION_SEL).reverse());\r\n }\r\n else { // Scrolling up\r\n // Move all next sections to before the active section\r\n before($(SECTION_ACTIVE_SEL)[0], nextAll(v.activeSection, SECTION_SEL));\r\n }\r\n\r\n // Maintain the displayed position (now that we changed the element order)\r\n silentScroll($(SECTION_ACTIVE_SEL)[0].offsetTop);\r\n\r\n // Maintain the active slides visible in the viewport\r\n keepSlidesPosition();\r\n\r\n // save for later the elements that still need to be reordered\r\n v.wrapAroundElements = v.activeSection;\r\n\r\n // Recalculate animation variables\r\n v.dtop = v.element.offsetTop;\r\n v.yMovement = getYmovement(v.element);\r\n\r\n //sections will temporally have another position in the DOM\r\n //updating this values in case we need them\r\n v.leavingSection = index(v.activeSection, SECTION_SEL) + 1;\r\n v.sectionIndex = index(v.element, SECTION_SEL);\r\n\r\n return v;\r\n }", "title": "" }, { "docid": "c0b92b0c21836cd4f9184c624c475ce5", "score": "0.5372154", "text": "initScrollbar() {\n if ( !$('body').hasClass('sidebar-minimized') ) {\n $('.sidebar-scrollbar').mCustomScrollbar({\n autoHideScrollbar: true,\n theme: $('body').hasClass('sidebar-dark') ? 'minimal-dark' : 'minimal'\n });\n }\n }", "title": "" }, { "docid": "bd56fe5a2ab5b6e786300d4a0c3bcfcf", "score": "0.53710747", "text": "function makeScrollable($wrapper, $container, contPadding){\n //Get menu width\n var divWidth = $wrapper.width();\n \n //Remove scrollbars\n // $wrapper.css({\n // overflow: 'hidden'\n // });\n \n //Find last image container\n var lastLi = $container.find('div:last-child'); // CHECK IF NEED TOCHANGE TO DIV FOR THE CARDCONTAINER\n $wrapper.scrollLeft(0);\n //When user move mouse over menu\n $wrapper.unbind('mousemove').bind('mousemove',function(e){\n // console.log('pageX: ',e.pageX,' scrollLeft:', $wrapper.scrollLeft(),' %of width: ',($wrapper.scrollLeft()/$wrapper.width())); \n //As images are loaded ul width increases,\n //so we recalculate it each time\n var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + contPadding;\n \n\n if (e.pageX > divWidth/4){\n var left = (e.pageX - $wrapper.offset().left) * (divWidth - ulWidth) / divWidth - divWidth/4;\n } else {\n var left = 0;\n }\n\n $wrapper.scrollLeft(left);\n });\n }", "title": "" }, { "docid": "c4ba7f4cc4911626d4546caa1aa0f3f4", "score": "0.53705907", "text": "function newslidefunction() {\n const slider = document.querySelector('.items');\n let isDown = false;\n let startX;\n let scrollLeft;\n\n slider.addEventListener('mousedown', (e) => {\n isDown = true;\n slider.classList.add('active');\n startX = e.pageX - slider.offsetLeft;\n scrollLeft = slider.scrollLeft;\n });\n slider.addEventListener('mouseleave', () => {\n isDown = false;\n slider.classList.remove('active');\n });\n slider.addEventListener('mouseup', () => {\n isDown = false;\n slider.classList.remove('active');\n });\n slider.addEventListener('mousemove', (e) => {\n if (!isDown) return;\n e.preventDefault();\n const x = e.pageX - slider.offsetLeft;\n const walk = (x - startX) * 3; //scroll-fast\n slider.scrollLeft = scrollLeft - walk;\n });\n}", "title": "" }, { "docid": "d8af4ccb21d7193432adfa4a9e8816f7", "score": "0.53675187", "text": "function handleResize() {\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight + 50);\n step.style(\"height\", stepH + \"px\");\n\n var figureHeight = (window.innerHeight * 2) / 3;\n var figureMarginTop = (window.innerHeight - figureHeight) / 2;\n\n figure\n .style(\"height\", figureHeight + \"px\")\n .style(\"top\", figureMarginTop + \"px\");\n\n // subSticky.style(\"height\", 300 + \"px\").style(\"top\", figureMarginTop + \"px\");\n\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n}", "title": "" }, { "docid": "d319f382a3874bfc3abce5d3c17ba3e2", "score": "0.5365574", "text": "function layout() {\n var slides = document.querySelectorAll('.slide-wrapper');\n toArray(slides).forEach(function(slideWrapper){\n\n slideWrapper.style.paddingLeft = window.innerWidth * 0.05- 2 + 'px';\n slideWrapper.style.paddingRight = window.innerWidth * 0.05 - 2 + 'px';\n\n slideWrapper.style.paddingTop = window.innerHeight * 0.05 - 2 + 'px';\n slideWrapper.style.paddingBottom = window.innerHeight * 0.05 -2 + 'px';\n\n var slide = slideWrapper.querySelector('.slide')\n\n slide.style.width = window.innerWidth * 0.9 + 'px';\n slide.style.height = window.innerHeight * 0.9 + 'px';\n\n });\n dom.slides.style.width = window.innerWidth * (dom.slides.children.length + 1) + 'px';\n dom.slides.style.height = window.innerHeight * (maxOfsubSlideLength + 1) + 'px';\n\n\n window.scrollTo(0,0);\n var transform = 'scale(1.0, 1.0) translate( -' + currentSlide * window.innerWidth + 'px, 0px)';\n\n dom.slides.style.WebkitTransform = transform;\n dom.slides.style.MozTransform = transform;\n dom.slides.style.msTransform = transform;\n dom.slides.style.OTransform = transform;\n dom.slides.style.transform = transform;\n \n dom.slides.style.display = 'block';\n }", "title": "" }, { "docid": "c3f79fd9e4d942d6837ed63c18d86c0d", "score": "0.53606266", "text": "function r(t,e){for(var i in this.wrapper=\"string\"==typeof t?document.querySelector(t):t,this.scroller=this.wrapper.children[0],this.scrollerStyle=this.scroller.style,this.options={disablePointer:!o.hasPointer,disableTouch:o.hasPointer||!o.hasTouch,disableMouse:o.hasPointer||o.hasTouch,startX:0,startY:0,scrollY:!0,directionLockThreshold:5,momentum:!0,bounce:!0,bounceTime:600,bounceEasing:\"\",preventDefault:!0,preventDefaultException:{tagName:/^(INPUT|TEXTAREA|BUTTON|SELECT)$/},HWCompositing:!0,useTransition:!0,useTransform:!0,bindToWrapper:void 0===window.onmousedown},e)this.options[i]=e[i];this.translateZ=this.options.HWCompositing&&o.hasPerspective?\" translateZ(0)\":\"\",this.options.useTransition=o.hasTransition&&this.options.useTransition,this.options.useTransform=o.hasTransform&&this.options.useTransform,this.options.eventPassthrough=!0===this.options.eventPassthrough?\"vertical\":this.options.eventPassthrough,this.options.preventDefault=!this.options.eventPassthrough&&this.options.preventDefault,this.options.scrollY=\"vertical\"!=this.options.eventPassthrough&&this.options.scrollY,this.options.scrollX=\"horizontal\"!=this.options.eventPassthrough&&this.options.scrollX,this.options.freeScroll=this.options.freeScroll&&!this.options.eventPassthrough,this.options.directionLockThreshold=this.options.eventPassthrough?0:this.options.directionLockThreshold,this.options.bounceEasing=\"string\"==typeof this.options.bounceEasing?o.ease[this.options.bounceEasing]||o.ease.circular:this.options.bounceEasing,this.options.resizePolling=void 0===this.options.resizePolling?60:this.options.resizePolling,!0===this.options.tap&&(this.options.tap=\"tap\"),this.options.useTransition||this.options.useTransform||/relative|absolute/i.test(this.scrollerStyle.position)||(this.scrollerStyle.position=\"relative\"),this.x=0,this.y=0,this.directionX=0,this.directionY=0,this._events={},this._init(),this.refresh(),this.scrollTo(this.options.startX,this.options.startY),this.enable()}", "title": "" }, { "docid": "18b807d30d48cd788054658974500ca6", "score": "0.53601086", "text": "function install(inopts) {\n var options = $.extend(true, {}, $.fn.multiscroll.defaults, inopts);\n\n var frame = $(this);\n frame.find('.leftHover').each(function() { installLeftHover($(this), frame, options) });\n frame.find('.rightHover').each(function() { installRightHover($(this), frame, options) });\n\n frame.data('multiscroll', {\n down: false,\n autoscroll: function(speed) { autoscroll(frame, parseInt(speed, 10)) }\n });\n\n frame.mousedown(function(event) {\n autoscroll(frame, 0)\n $.extend(frame.data('multiscroll'), {\n down: true,\n x: event.clientX,\n y: event.clientY,\n scrollLeft: this.scrollLeft,\n scrollTop: this.scrollTop\n })\n frame.addClass('dragging')\n frame.trigger('dragStart')\n return false\n }).mouseup(function(event) {\n var data = frame.data('multiscroll')\n if(data.down) frame.trigger('dragStop')\n frame.removeClass('dragging')\n data.down = false\n }).mouseleave(function(event) {\n var data = frame.data('multiscroll')\n if(data.down) frame.trigger('dragStop')\n frame.removeClass('dragging')\n data.down = false\n }).mousemove(function(event) {\n var data = frame.data('multiscroll')\n if(data && data.down == true) {\n // if we scroll w/o checking, some browsers will have unsightly bouncing\n if(this.scrollWidth > this.clientWidth + crazyScrollSlop) {\n this.scrollLeft = data.scrollLeft + data.x - event.clientX\n }\n if(this.scrollHeight > this.clientHeight + crazyScrollSlop) {\n this.scrollTop = data.scrollTop + data.y - event.clientY\n }\n }\n }).mousewheel(function(event, delta, deltax, deltay) {\n autoscroll(frame, 0);\n // TODO: handle more common deltay scroll too\n if(this.scrollWidth > this.clientWidth + crazyScrollSlop) {\n this.scrollLeft += (deltax * options.wheelSpeed.x)\n }\n return false\n }).css({ 'overflow' : 'hidden' })\n\n autoscroll(frame, options.startingSpeed.x)\n }", "title": "" }, { "docid": "f1b7ff15ac0ef7e2331f844f573e2072", "score": "0.5357379", "text": "function initScrollbar() {\n scrollbarDrag = false;\n scrollbarPos = 0;\n // When the mouse is pressed over the scrollbar, start dragging it\n $(\"#quizInfoScrollBar\").mousedown(function (e) {\n scrollbarDrag = true;\n lastY = e.pageY;\n });\n // If dragging, move the scrollbar on mouse move\n $(window).mousemove(function (e) {\n if (scrollbarDrag) {\n var newY = e.pageY;\n var dy = newY - lastY;\n var norm = 100 * (newY - lastY) / $(\"#quizInfoScroll\").height();\n moveScrollbar(norm);\n lastY = newY;\n }\n });\n // Mousewheel to scroll\n $(\"body\").mousewheel(function (e) {\n if (showingStats) {\n if (e.deltaY > 0) {\n moveScrollbar(-3);\n } else if (e.deltaY < 0) {\n moveScrollbar(3);\n }\n }\n })\n}", "title": "" }, { "docid": "281a5ea300eed833411bf246d376d83c", "score": "0.53554344", "text": "function drawScrollbar() {\n scrollbar = svg.append('g')\n .attr('class', 'scrollbar')\n .attr('transform', 'translate(0,'+(height+margin.bottom)+')')\n .style('opacity', '0.0');\n\n scrollbar.append('rect')\n .attr('x', 0)\n .attr('y', 0)\n .attr('width', width)\n .attr('height', 20)\n .attr('fill', '#fafafa')\n .attr('stroke', '#efefef');\n\n scrollHandle = scrollbar.append('rect')\n .attr('class', 'handle')\n .attr('x', 0)\n .attr('y', 0)\n .attr('data-x', 0)\n .attr('height', 20)\n .attr('stroke', 'teal')\n .attr('fill', '#fff')\n .call(scroll);\n }", "title": "" }, { "docid": "a7ac840fcf09ce3922c140201a1a53f1", "score": "0.53544563", "text": "function scroll(stepElems, visElem) {\n sections = stepElems;\n visSeln = visElem;\n\n stepElems.style('opacity', (d,i)=>i===0? 1 : 0.1); // first section shown fully, rest faded out\n\n // when window is scrolled call\n // position. When it is resized\n // call resize.\n d3.select(window)\n .on('scroll.scroller', throttledPosition)\n .on('resize.scroller', debouncedResize);\n\n // hack to get resize (and hence position)\n // to be called once for\n // the scroll position on\n // load.\n var timer = d3.timer(function () {\n resize();\n timer.stop();\n });\n }", "title": "" }, { "docid": "81a3cc3e73921f4d42fb1f862e81daa1", "score": "0.53461224", "text": "function handleResize() {\n // 1. update height of step elements\n var stepH = Math.floor(window.innerHeight * 0.75);\n stepSel.style('height', stepH + 'px');\n var figureHeight = window.innerHeight / 2\n var figureMarginTop = (window.innerHeight - figureHeight) / 2 \n figure\n .style('height', figureHeight + 'px')\n .style('top', figureMarginTop + 'px');\n // 3. tell scrollama to update new element dimensions\n scroller.resize();\n }", "title": "" }, { "docid": "015c3ad19e3719f01d96e1b68c74f70e", "score": "0.53399354", "text": "onHandleScrollSidebar(){\r\n let smoothScroll = null;\r\n const main = $('.post__content-box');\r\n window.onscroll = () => {\r\n if(window.pageYOffset > main.offsetTop - 30){\r\n smoothScroll = SmoothScrollbar.init($('.sidebar__content'));\r\n }else{\r\n if(smoothScroll) smoothScroll.scrollTop = 0;\r\n SmoothScrollbar.destroyAll()\r\n }\r\n }\r\n }", "title": "" }, { "docid": "38eaac03a5a134028bcd42b95fc06750", "score": "0.53387445", "text": "withScrollableContainers(scrollables) {\n this._scrollables = scrollables;\n return this;\n }", "title": "" }, { "docid": "38eaac03a5a134028bcd42b95fc06750", "score": "0.53387445", "text": "withScrollableContainers(scrollables) {\n this._scrollables = scrollables;\n return this;\n }", "title": "" } ]
764f319768b7569de32a2c84970b4895
Registers specific 'regular' keys
[ { "docid": "725f208407da611bb8be9aef8644494a", "score": "0.0", "text": "function keyTyped() {\n \n // When the user hits the 's' key, the blocks are drawn fresh in their current state and a .png is saved via browser.\n if (key === 's') {\n for (var i = 0; i < width/blockSize; i++) { // Loop over each column\n for (var j = 0; j < height/blockSize; j++) { // Loop over each row of the current column\n blocks[i][j].show(); // Now print the block in its current state, no color update\n }\n }\n saveCanvas('glitch_wp.png', 'png');\n }\n \n // The 'z' key lowers the area of affect for changing colors\n if (key === 'z') {\n if (affect > 0) {\n affect--;\n }\n }\n \n // The 'x' key raises the area of affect\n if (key === 'x') {\n if (affect < (height/blockSize)/2 ) {\n affect++;\n }\n }\n \n // The 'c' key washes the board\n if (key === 'c') {\n updateColors();\n }\n}", "title": "" } ]
[ { "docid": "e7baa80f2d864cbcd2b6f98883570dfb", "score": "0.72603875", "text": "function registerKeys() {\n var usedKeys = ['0', '1', '2'];\n\n usedKeys.forEach(function (keyName) {\n tizen.tvinputdevice.registerKey(keyName);\n });\n }", "title": "" }, { "docid": "a357b23467ff2d25286e5ffab1d608a8", "score": "0.5649846", "text": "initHotkeys() {\n const PREFIX = \"alt+shift+\";\n const keys = Hotkey.getKeys();\n const rkeys = keys.filter(k => k.indexOf(PREFIX) !== -1);\n\n rkeys.forEach(k => Hotkey.removeKey(k));\n\n self.sortedRegions.forEach((r, n) => {\n Hotkey.addKey(PREFIX + (n + 1), function() {\n self.unselectAll();\n r.selectRegion();\n });\n });\n\n // this is added just for the reference to show up in the\n // settings page\n Hotkey.addKey(\"alt+shift+$n\", () => {}, \"Select a region\");\n }", "title": "" }, { "docid": "852f946d4bb41b11da4783bff3e181e7", "score": "0.5539246", "text": "add(key, value) {\n\n }", "title": "" }, { "docid": "bc3f551db07122d5c49696837502ff50", "score": "0.5530855", "text": "function addShortcuts() {\n for(var i = 0 ; i < registeredShortcuts.length; i++) {\n globalShortcut.register(registeredShortcuts[i].keys, ipcMainMethod(registeredShortcuts[i].method));\n }\n }", "title": "" }, { "docid": "5b09e47738e093f26c9376e8fedcf018", "score": "0.54431504", "text": "_migrateLegacyKeys() {\n let api = this._getAPI();\n LEGACY_KEYS.forEach(function (key) {\n let legacyKey = LEGACY_PREFIX + key,\n newKey = PREFIX + key;\n if (legacyKey in api) {\n let data = api.getItem(legacyKey);\n api.removeItem(legacyKey);\n api.setItem(newKey, data);\n }\n });\n }", "title": "" }, { "docid": "888e89420327745c16bfa962ea1878d8", "score": "0.54390115", "text": "static _registerHotkeys() {\n hotkeysService.setTakeScreenshotHotkey(async () => {\n try {\n let screenshotUrl = await screenshotService.takeScreenshot();\n window.ow_eventBus.trigger('screenshot', screenshotUrl);\n } catch (e) {\n console.error(e);\n }\n }),\n hotkeysService.setToggleHotkey(async () => {\n let state = await windowsService.getWindowState(WindowNames.IN_GAME);\n if ((state === 'minimized') || (state === 'closed')) {\n windowsService.restore(WindowNames.IN_GAME)\n } else if ((state === 'normal') || (state === 'maximized')) {\n windowsService.minimize(WindowNames.IN_GAME)\n }\n });\n }", "title": "" }, { "docid": "48be65d79fc72486f81cb360574e054d", "score": "0.54176277", "text": "loadKeyIntoRegister(registerX){\n //go through keys until pressed one is found\n //don't increment program counter if none found\n this._incrementPC = false;\n for(let i = 0; i < this.pressedKeys.length; i++){\n if(this.pressedKeys[i]){\n this.vReg[registerX] = i;\n this._incrementPC = true;\n break;\n }\n }\n }", "title": "" }, { "docid": "2d67f07a17c057a3acd9ae37d8bda295", "score": "0.5377282", "text": "_registerHotkeys() {\n this.hotkeysService.setToggleHotkeyListener(kHotkeyToggle, () => {\n this._onHotkeyTogglePressed();\n });\n\n this.hotkeysService.setToggleHotkeyListener(kHotkeySecondScreen, () => {\n this._onHotkeySecondScreenPressed();\n });\n }", "title": "" }, { "docid": "e41faaa1b3d437d585583fa203d1c43e", "score": "0.53766304", "text": "add(key, value) {\n this.keys[key] = value;\n }", "title": "" }, { "docid": "3d5c3524e0f70ea89631e01a5c7d1c00", "score": "0.53693205", "text": "function keys( regular_expression, callback ) {\n\t_admin_call( \"keys\", regular_expression, callback );\n}", "title": "" }, { "docid": "7654d47b70ea39572df74f650294f19e", "score": "0.5347354", "text": "function setKeys(keyType) {\n var currentKey,\n keyObject,\n tempString = '';\n\n //*****Set keyboard to default and capitalize letters.*****\n if (keyStatusObject.caps && !keyStatusObject.shift && !keyStatusObject.altgrp && !options.isPermanentUppercase) {\n keyType = 'default';\n $('.caps-lock-key').addClass('caps-lock-key-active');\n } else if (!keyStatusObject.caps && !keyStatusObject.shift && !keyStatusObject.altgrp) {\n keyType = 'default';\n }\n\n if (!keyStatusObject.caps && !options.isPermanentUppercase) {\n $('.caps-lock-key').removeClass('caps-lock-key-active');\n }\n\n //*****If we didn't just press [Shift] + [Alt Grp], clear our tracker.*****\n if (keyStatusObject.shift_altgrp != '' && keyType != 'shift_altgrp') {\n keyStatusObject.shift_altgrp = '';\n }\n\n $('.keyboard-key').each(function () {\n tempString = '';\n try {\n currentKey = $(this)\n keyObject = currentKey.data('keyDataObject');\n if (keyObject[keyType].length == 4) {\n currentKey.html('&#x' + keyObject[keyType] + ';');\n currentKey.data('keyval', currentKey.html());\n } else if (keyObject[keyType].length == 5 && keyObject[keyType].match('@')) {\n currentKey.html('&#x' + keyObject[keyType].replace('@', '') + ';');\n currentKey.data('keyval', currentKey.html());\n } else if (keyObject[keyType].constructor === Array) {\n $.each(keyObject[keyType], function (i, value) {\n tempString += '&#x' + value + ';';\n });\n currentKey.html(tempString);\n currentKey.data('keyval', currentKey.html());\n } else if (keyObject[keyType] == '-1' || keyObject[keyType] == '%%' || keyObject[keyType].length == 0) {\n currentKey.html('&nbsp;');\n currentKey.data('keyval', '');\n } else {\n currentKey.html(keyObject[keyType]);\n currentKey.data('keyval', currentKey.html());\n }\n\n if ((!keyStatusObject.shift && keyStatusObject.caps && !keyStatusObject.altgrp) || options.isPermanentUppercase) {\n currentKey.html(currentKey.html().length == 1 ? currentKey.html().toUpperCase() : currentKey.html());\n currentKey.data('keyval', currentKey.html().length == 1 ? currentKey.html() : currentKey.data('keyval'));\n }\n } catch (err) {\n //Nada Aquí\n }\n\n });\n }", "title": "" }, { "docid": "8f5dbcf2705250ae63a06726c3a2db8b", "score": "0.532708", "text": "function getKeys( req, res, next ){\n req.keys = [ res.locals.currentUser._id.toString(),\n User.anybodyId.toString(),\n User.everybodyId.toString() ];\n next();\n}", "title": "" }, { "docid": "eac41f45d2885da5f2c4694fe445b5ed", "score": "0.5305282", "text": "function addKey( keys, seen, key ) {\n\t\tif ( !seen[ key ] ) {\n\t\t\tseen[ key ] = true;\n\t\t\tkeys.push( key );\n\t\t}\n\t}", "title": "" }, { "docid": "bfb342a33ddcbb42812249794ec8cd1b", "score": "0.5301407", "text": "function isReserved(key) {\n return (key === \"add\" || key === \"remove\");\n }", "title": "" }, { "docid": "1079b6c7af3036b13d4da509caac2f77", "score": "0.5298588", "text": "function init() {\n var words = Object.keys(keys),\n i,\n l;\n for (i = 0, l = words.length; i < l; i++) {\n if (!keywords[keys[words[i]]]) {\n keywords[keys[words[i]]] = [];\n }\n keywords[keys[words[i]]].push(words[i]);\n }\n window.addEventListener(\"keydown\", handleDown, false);\n window.addEventListener(\"keyup\", handleUp, false);\n }", "title": "" }, { "docid": "336d20b00a379be1dd82d0331a695c1c", "score": "0.5297443", "text": "function assignKey(key, scope, method){\n var keys, mods, i, mi;\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n key = key.replace(/\\s/g,'');\n keys = key.split(',');\n \n if((keys[keys.length-1])=='')\n keys[keys.length-2] += ',';\n // for each shortcut\n for (i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if(key.length > 1){\n mods = key.slice(0,key.length-1);\n for (mi = 0; mi < mods.length; mi++)\n mods[mi] = _MODIFIERS[mods[mi]];\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = _MAP[key] || key.toUpperCase().charCodeAt(0);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n }", "title": "" }, { "docid": "76758f3b18cc75a2e762a2d49951db36", "score": "0.5288965", "text": "function registerShortcut(characters, callback) {\n for(var i = 0; i < characters.length; i++) {\n globalShortcut.register(characters[i], callback)\n }\n}", "title": "" }, { "docid": "56e50702903ec7ea12fcf6c5ad627f7b", "score": "0.52768785", "text": "static initialize(obj, key) { \n obj['key'] = key;\n }", "title": "" }, { "docid": "fe86e6e63885a8868acd982ffdefe5e5", "score": "0.5275978", "text": "function add_keys(Info,ItemList) {\n\tvar i;\n\tfor (i in ItemList) {\n\t\tInfo.keywords = Set.add(Info.keywords, ItemList[i]);\n\t}\n}", "title": "" }, { "docid": "42c95cfe8c572838e45df3a6bb77277b", "score": "0.5262703", "text": "function createKeyHandler() {\n let keys = {\n singleTick: {},\n };\n document.addEventListener(\"keydown\", function (e) {\n keys[e.key.toLowerCase()] = true;\n keys.singleTick[e.key.toLowerCase()] = true;\n });\n document.addEventListener(\"keyup\", function (e) {\n keys[e.key.toLowerCase()] = false;\n keys.singleTick[e.key.toLowerCase()] = false;\n });\n return keys;\n}", "title": "" }, { "docid": "8acf553edc648857caff94e5198c3bbb", "score": "0.5260662", "text": "function addHotkey(keys, callback) {\n hotkeys(keys, function (e) {\n e.preventDefault();\n callback();\n });\n}", "title": "" }, { "docid": "d3663d422db64880361d402c5cae132f", "score": "0.52556473", "text": "function assignKey(key, scope, method){\n var keys, mods, i, mi;\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n key = key.replace(/\\s/g,'');\n keys = key.split(',');\n\n if((keys[keys.length-1])=='')\n keys[keys.length-2] += ',';\n // for each shortcut\n for (i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if(key.length > 1){\n mods = key.slice(0,key.length-1);\n for (mi = 0; mi < mods.length; mi++)\n mods[mi] = _MODIFIERS[mods[mi]];\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = _MAP[key] || key.toUpperCase().charCodeAt(0);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n }", "title": "" }, { "docid": "16eddda9b6266a0ac2669d486cfc68d8", "score": "0.5252632", "text": "setKey(name) {\n super.setKey(name);\n this.elementsKeys.forEach(key => this[key].setKey(key));\n }", "title": "" }, { "docid": "e943a7978ef274bfa75087e291205383", "score": "0.5231519", "text": "function jRegEnumKeys(strComputerName, cBaseKey, strSubKeyName) \r\n {\r\n var oReg, oMethod, oInParam, oOutParam;\r\n var aKeys = null;\r\n\r\n oReg=GetObject(\"winmgmts:{impersonationLevel=impersonate}!\\\\\\\\\" + strComputerName + \"\\\\root\\\\default:StdRegProv\");\r\n oMethod = oReg.Methods_.Item(\"EnumKey\");\r\n\r\n oInParam = oMethod.InParameters.SpawnInstance_();\r\n oInParam.hDefKey = cBaseKey;\r\n oInParam.sSubKeyName = strSubKeyName;\r\n oOutParam = oReg.ExecMethod_(oMethod.Name, oInParam);\r\n\r\n if ( oOutParam.sNames != null )\r\n aKeys = oOutParam.sNames.toArray();\r\n\r\n // Clean up\r\n oOutParam = null;\r\n oInParam = null;\r\n oMethod = null;\r\n oReg = null;\r\n\r\n return aKeys;\r\n }", "title": "" }, { "docid": "85ffb46cbc3d61907090edd79e233637", "score": "0.52283525", "text": "function onKeyDown(event) {\n keys[String.fromCharCode(event.keyCode)] = true\n}", "title": "" }, { "docid": "80e15aa8d5ea59f5a957a7b2a57b46ea", "score": "0.5221604", "text": "function spotifyTweaksReg() {\n // keys: ./, -> next/previous track\n cb.bindKeyDown(KEY_PERIOD, (e) => cb.clickElement($('.player-controls button[class*=\"forward\"]')[0]), { skipEditable: true });\n cb.bindKeyDown(KEY_COMMA, (e) => cb.clickElement($('.player-controls button[class*=\"back\"]')[0]), { skipEditable: true });\n // keys: s -> toggle shuffle\n cb.bindKeyDown(KEY_S, (e) => cb.clickElement($('.player-controls button[class*=\"shuffle\"]')[0]), { skipEditable: true });\n // keys: r -> switch repeat mode\n cb.bindKeyDown(KEY_R, (e) => cb.clickElement($('.player-controls button[class*=\"repeat\"]')[0]), { skipEditable: true});\n // keys: / -> search\n cb.bindKeyDown(KEY_SLASH, (e) => cb.clickElement($('.navBar div[class*=\"search-icon\"]')[0]), { skipEditable: true, preventDefault: true });\n // keys: ESC -> home screen (works in search field)\n //cb.bindKeyDown(KEY_ESC, (e) => cb.clickElement($('.navBar div[class*=\"home-icon\"]')[0]), { preventDefault: true });\n }", "title": "" }, { "docid": "a7b0697d4628028dc8e70f814cefab06", "score": "0.5219204", "text": "requiredKeys(...keys) {\n for (const k of keys) {\n this.keys.add(k);\n this.rKeys.add(k);\n }\n return this;\n }", "title": "" }, { "docid": "ed8f84e45c43ad5f4f198b9d943572a7", "score": "0.5206624", "text": "prepareKey(){this.prvt=this.generatePrivate();this.pub=this.generatePublic(this.prvt);return{pub:this.pub,pvt:this.prvt};}", "title": "" }, { "docid": "2a758bc87fe162c8d97bf32390a1d360", "score": "0.5141657", "text": "static kx_RefreshDefaults() {\n // each standard alphabet as key in the translator.\n if (!SizedBigInt.kx_tr) {\n SizedBigInt.kx_tr={};\n SizedBigInt.kx_baseLabel = {\n \"2\": { base:2, alphabet:\"01\", ref:\"ECMA-262\" } // never used here, check if necessary to implement\n ,\"2h\": { // BitString representation\n base:2, alphabet:\"01\",\n isDefault:true,\n isHierar:true, // use leading zeros (0!=00).\n ref:\"SizedNaturals\"\n }\n ,\"4h\": {\n base:4,\n isHierar:true, // use hDigit and leading zeros.\n alphabet:\"0123GH\", case:\"upper\",\n regex:'^([0123]*)([GH])?$',\n ref:\"SizedNaturals\"\n }\n ,\"8h\": {\n base:8,\n isHierar:true, // letters are non-hierarchical\n alphabet:\"01234567GHJKLM\", // 2*8-2=14 characters\n regex:'^([0-7]*)([GHJ-M])?$',\n ref:\"SizedNaturals\"\n }\n ,\"16h\": {\n base:16,\n isHierar:true, // upper case are the non-hierarchical \n alphabet:\"0123456789abcdefGHJKLMNPQRSTVZ\", //2*16-2=30 characters\n regex:'^([0-9a-f]*)([GHJ-NP-TVZ])?$',\n ref:\"SizedNaturals\"\n }\n ,\"4js\": { alphabet:\"0123\", isDefault:true, ref:\"ECMA-262\" }\n ,\"8js\": { alphabet:\"01234567\", isDefault:true, ref:\"ECMA-262\" }\n ,\"16js\": { alphabet:\"0123456789abcdef\", isDefault:true, ref:\"ECMA-262\" } // RFC 4648 sec 8 is upper\n ,\"32hex\": { alphabet:\"0123456789abcdefghijklmnopqrstuv\", isDefault:true, ref:\"RFC 4648 sec. 7\" }\n ,\"32nvu\": { alphabet:\"0123456789BCDFGHJKLMNPQRSTUVWXYZ\", ref:\"No-Vowels except U (near non-syllabic)\" }\n ,\"32rfc\": { alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\", ref:\"RFC 4648 sec. 6\" }\n ,\"32ghs\": { alphabet:\"0123456789bcdefghjkmnpqrstuvwxyz\", ref:\"Geohash, classical of 2008\" }\n ,\"64url\": {\n alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",\n isDefault:true, ref:\"RFC 4648 sec. 5\"\n }\n };\n SizedBigInt.kx_baseLabel_setRules();\n // to prepare cache, for example Bae16h, run here SizedBigInt.kx_trConfig('16h')\n } // \\if\n }", "title": "" }, { "docid": "12291ca748243f9dc05339a84603fb72", "score": "0.5140767", "text": "function jQueryPluginJSHotkeys (b) {\n b.hotkeys = {\n version: \"0.8\",\n specialKeys: {\n 8: \"backspace\",\n 9: \"tab\",\n 13: \"return\",\n 16: \"shift\",\n 17: \"ctrl\",\n 18: \"alt\",\n 19: \"pause\",\n 20: \"capslock\",\n 27: \"esc\",\n 32: \"space\",\n 33: \"pageup\",\n 34: \"pagedown\",\n 35: \"end\",\n 36: \"home\",\n 37: \"left\",\n 38: \"up\",\n 39: \"right\",\n 40: \"down\",\n 45: \"insert\",\n 46: \"del\",\n 96: \"0\",\n 97: \"1\",\n 98: \"2\",\n 99: \"3\",\n 100: \"4\",\n 101: \"5\",\n 102: \"6\",\n 103: \"7\",\n 104: \"8\",\n 105: \"9\",\n 106: \"*\",\n 107: \"+\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 112: \"f1\",\n 113: \"f2\",\n 114: \"f3\",\n 115: \"f4\",\n 116: \"f5\",\n 117: \"f6\",\n 118: \"f7\",\n 119: \"f8\",\n 120: \"f9\",\n 121: \"f10\",\n 122: \"f11\",\n 123: \"f12\",\n 144: \"numlock\",\n 145: \"scroll\",\n 191: \"/\",\n 224: \"meta\",\n 219: \"[\",\n 221: \"]\"\n },\n shiftNums: {\n \"`\": \"~\",\n \"1\": \"!\",\n \"2\": \"@\",\n \"3\": \"#\",\n \"4\": \"$\",\n \"5\": \"%\",\n \"6\": \"^\",\n \"7\": \"&\",\n \"8\": \"*\",\n \"9\": \"(\",\n \"0\": \")\",\n \"-\": \"_\",\n \"=\": \"+\",\n \";\": \": \",\n \"'\": '\"',\n \",\": \"<\",\n \".\": \">\",\n \"/\": \"?\",\n \"\\\\\": \"|\"\n }\n };\n\n function a(d) {\n if (typeof d.data !== \"string\") {\n return;\n }\n\n var c = d.handler,\n e = d.data.toLowerCase().split(\" \");\n\n d.handler = function (n) {\n if (this !== n.target && n.which !== 27 && (/textarea|select/i.test(n.target.nodeName) || n.target.type === \"text\")) {\n return;\n }\n\n var h = n.type !== \"keypress\" && b.hotkeys.specialKeys[n.which],\n o = String.fromCharCode(n.which).toLowerCase(),\n m = \"\",\n g = {};\n\n if (n.altKey && h !== \"alt\") {\n m += \"alt+\";\n }\n\n if (n.ctrlKey && h !== \"ctrl\") {\n m += \"ctrl+\";\n }\n\n if (n.metaKey && !n.ctrlKey && h !== \"meta\") {\n m += \"meta+\";\n }\n\n if (n.shiftKey && h !== \"shift\") {\n m += \"shift+\";\n }\n\n if (h) {\n g[m + h] = true;\n } else {\n g[m + o] = true;\n g[m + b.hotkeys.shiftNums[o]] = true;\n\n if (m === \"shift+\") {\n g[b.hotkeys.shiftNums[o]] = true;\n }\n }\n\n for (var j = 0, f = e.length; j < f; j++) {\n if (g[e[j]]) {\n return c.apply(this, arguments);\n }\n }\n };\n }\n\n b.each([\"keydown\", \"keyup\", \"keypress\"], function () {\n b.event.special[this] = {\n add: a\n };\n });\n return b;\n }", "title": "" }, { "docid": "1be97a98ae45338f4d26248f0c293642", "score": "0.513279", "text": "function KeySet()\r\n{\r\n\tvar self = JSINER.extend(this, HashMap);\r\n\tfor( var i = 0; i < arguments.length; i++ )\r\n\t{\r\n\t\tself.add(arguments[i]);\r\n\t}\r\n\treturn self;\r\n}", "title": "" }, { "docid": "e575f564ea04695c2cbc445bebca883f", "score": "0.5130785", "text": "function addKey(keys, seen, key) {\n\t if (!seen[key]) {\n\t seen[key] = true;\n\t keys.push(key);\n\t }\n\t }", "title": "" }, { "docid": "4acbe66e40114e62b56fa0c5146b7f7b", "score": "0.51301247", "text": "function useHotkeys(keys, options) {\n if (options === void 0) { options = {}; }\n var _a = options.document, document = _a === void 0 ? getDefaultDocument() : _a, _b = options.showDialogKeyCombo, showDialogKeyCombo = _b === void 0 ? \"?\" : _b;\n var localKeys = React.useMemo(function () {\n return keys\n .filter(function (k) { return !k.global; })\n .map(function (k) { return ({\n combo: hotkeyParser_1.parseKeyCombo(k.combo),\n config: k,\n }); });\n }, [keys]);\n var globalKeys = React.useMemo(function () {\n return keys\n .filter(function (k) { return k.global; })\n .map(function (k) { return ({\n combo: hotkeyParser_1.parseKeyCombo(k.combo),\n config: k,\n }); });\n }, [keys]);\n // register keys with global context\n var _c = React.useContext(context_1.HotkeysContext), dispatch = _c[1];\n React.useEffect(function () {\n var payload = tslib_1.__spreadArrays(globalKeys.map(function (k) { return k.config; }), localKeys.map(function (k) { return k.config; }));\n dispatch({ type: \"ADD_HOTKEYS\", payload: payload });\n return function () { return dispatch({ type: \"REMOVE_HOTKEYS\", payload: payload }); };\n }, [keys]);\n var invokeNamedCallbackIfComboRecognized = function (global, combo, callbackName, e) {\n var _a, _b;\n var isTextInput = isTargetATextInput(e);\n for (var _i = 0, _c = global ? globalKeys : localKeys; _i < _c.length; _i++) {\n var key = _c[_i];\n var _d = key.config, _e = _d.allowInInput, allowInInput = _e === void 0 ? false : _e, _f = _d.disabled, disabled = _f === void 0 ? false : _f, _g = _d.preventDefault, preventDefault = _g === void 0 ? false : _g, _h = _d.stopPropagation, stopPropagation = _h === void 0 ? false : _h;\n var shouldIgnore = (isTextInput && !allowInInput) || disabled;\n if (!shouldIgnore && hotkeyParser_1.comboMatches(key.combo, combo)) {\n if (preventDefault) {\n e.preventDefault();\n }\n if (stopPropagation) {\n // set a flag just for unit testing. not meant to be referenced in feature work.\n e.isPropagationStopped = true;\n e.stopPropagation();\n }\n (_b = (_a = key.config)[callbackName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);\n }\n }\n };\n var handleGlobalKeyDown = React.useCallback(function (e) {\n // special case for global keydown: if '?' is pressed, open the hotkeys dialog\n var combo = hotkeyParser_1.getKeyCombo(e);\n var isTextInput = isTargetATextInput(e);\n if (!isTextInput && hotkeyParser_1.comboMatches(hotkeyParser_1.parseKeyCombo(showDialogKeyCombo), combo)) {\n dispatch({ type: \"OPEN_DIALOG\" });\n }\n else {\n invokeNamedCallbackIfComboRecognized(true, hotkeyParser_1.getKeyCombo(e), \"onKeyDown\", e);\n }\n }, [globalKeys]);\n var handleGlobalKeyUp = React.useCallback(function (e) { return invokeNamedCallbackIfComboRecognized(true, hotkeyParser_1.getKeyCombo(e), \"onKeyUp\", e); }, [globalKeys]);\n var handleLocalKeyDown = React.useCallback(function (e) {\n return invokeNamedCallbackIfComboRecognized(false, hotkeyParser_1.getKeyCombo(e.nativeEvent), \"onKeyDown\", e.nativeEvent);\n }, [localKeys]);\n var handleLocalKeyUp = React.useCallback(function (e) {\n return invokeNamedCallbackIfComboRecognized(false, hotkeyParser_1.getKeyCombo(e.nativeEvent), \"onKeyUp\", e.nativeEvent);\n }, [localKeys]);\n React.useEffect(function () {\n // document is guaranteed to be defined inside effects\n document.addEventListener(\"keydown\", handleGlobalKeyDown);\n document.addEventListener(\"keyup\", handleGlobalKeyUp);\n return function () {\n document.removeEventListener(\"keydown\", handleGlobalKeyDown);\n document.removeEventListener(\"keyup\", handleGlobalKeyUp);\n };\n }, [handleGlobalKeyDown, handleGlobalKeyUp]);\n return { handleKeyDown: handleLocalKeyDown, handleKeyUp: handleLocalKeyUp };\n}", "title": "" }, { "docid": "7a2f5d85f572d5e032d9126c75490171", "score": "0.5124246", "text": "function $ff4c3bd9116e15cc$var$_createKeys(key) {\n var pc2bytes0 = [\n 0,\n 0x4,\n 0x20000000,\n 0x20000004,\n 0x10000,\n 0x10004,\n 0x20010000,\n 0x20010004,\n 0x200,\n 0x204,\n 0x20000200,\n 0x20000204,\n 0x10200,\n 0x10204,\n 0x20010200,\n 0x20010204\n ], pc2bytes1 = [\n 0,\n 0x1,\n 0x100000,\n 0x100001,\n 0x4000000,\n 0x4000001,\n 0x4100000,\n 0x4100001,\n 0x100,\n 0x101,\n 0x100100,\n 0x100101,\n 0x4000100,\n 0x4000101,\n 0x4100100,\n 0x4100101\n ], pc2bytes2 = [\n 0,\n 0x8,\n 0x800,\n 0x808,\n 0x1000000,\n 0x1000008,\n 0x1000800,\n 0x1000808,\n 0,\n 0x8,\n 0x800,\n 0x808,\n 0x1000000,\n 0x1000008,\n 0x1000800,\n 0x1000808\n ], pc2bytes3 = [\n 0,\n 0x200000,\n 0x8000000,\n 0x8200000,\n 0x2000,\n 0x202000,\n 0x8002000,\n 0x8202000,\n 0x20000,\n 0x220000,\n 0x8020000,\n 0x8220000,\n 0x22000,\n 0x222000,\n 0x8022000,\n 0x8222000\n ], pc2bytes4 = [\n 0,\n 0x40000,\n 0x10,\n 0x40010,\n 0,\n 0x40000,\n 0x10,\n 0x40010,\n 0x1000,\n 0x41000,\n 0x1010,\n 0x41010,\n 0x1000,\n 0x41000,\n 0x1010,\n 0x41010\n ], pc2bytes5 = [\n 0,\n 0x400,\n 0x20,\n 0x420,\n 0,\n 0x400,\n 0x20,\n 0x420,\n 0x2000000,\n 0x2000400,\n 0x2000020,\n 0x2000420,\n 0x2000000,\n 0x2000400,\n 0x2000020,\n 0x2000420\n ], pc2bytes6 = [\n 0,\n 0x10000000,\n 0x80000,\n 0x10080000,\n 0x2,\n 0x10000002,\n 0x80002,\n 0x10080002,\n 0,\n 0x10000000,\n 0x80000,\n 0x10080000,\n 0x2,\n 0x10000002,\n 0x80002,\n 0x10080002\n ], pc2bytes7 = [\n 0,\n 0x10000,\n 0x800,\n 0x10800,\n 0x20000000,\n 0x20010000,\n 0x20000800,\n 0x20010800,\n 0x20000,\n 0x30000,\n 0x20800,\n 0x30800,\n 0x20020000,\n 0x20030000,\n 0x20020800,\n 0x20030800\n ], pc2bytes8 = [\n 0,\n 0x40000,\n 0,\n 0x40000,\n 0x2,\n 0x40002,\n 0x2,\n 0x40002,\n 0x2000000,\n 0x2040000,\n 0x2000000,\n 0x2040000,\n 0x2000002,\n 0x2040002,\n 0x2000002,\n 0x2040002\n ], pc2bytes9 = [\n 0,\n 0x10000000,\n 0x8,\n 0x10000008,\n 0,\n 0x10000000,\n 0x8,\n 0x10000008,\n 0x400,\n 0x10000400,\n 0x408,\n 0x10000408,\n 0x400,\n 0x10000400,\n 0x408,\n 0x10000408\n ], pc2bytes10 = [\n 0,\n 0x20,\n 0,\n 0x20,\n 0x100000,\n 0x100020,\n 0x100000,\n 0x100020,\n 0x2000,\n 0x2020,\n 0x2000,\n 0x2020,\n 0x102000,\n 0x102020,\n 0x102000,\n 0x102020\n ], pc2bytes11 = [\n 0,\n 0x1000000,\n 0x200,\n 0x1000200,\n 0x200000,\n 0x1200000,\n 0x200200,\n 0x1200200,\n 0x4000000,\n 0x5000000,\n 0x4000200,\n 0x5000200,\n 0x4200000,\n 0x5200000,\n 0x4200200,\n 0x5200200\n ], pc2bytes12 = [\n 0,\n 0x1000,\n 0x8000000,\n 0x8001000,\n 0x80000,\n 0x81000,\n 0x8080000,\n 0x8081000,\n 0x10,\n 0x1010,\n 0x8000010,\n 0x8001010,\n 0x80010,\n 0x81010,\n 0x8080010,\n 0x8081010\n ], pc2bytes13 = [\n 0,\n 0x4,\n 0x100,\n 0x104,\n 0,\n 0x4,\n 0x100,\n 0x104,\n 0x1,\n 0x5,\n 0x101,\n 0x105,\n 0x1,\n 0x5,\n 0x101,\n 0x105\n ];\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n // stores the return keys\n var keys = [];\n // now define the left shifts which need to be done\n var shifts = [\n 0,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 1,\n 1,\n 1,\n 0\n ];\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++){\n var left = key.getInt32();\n var right = key.getInt32();\n tmp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= tmp << 4;\n tmp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= tmp << -16;\n tmp = (left >>> 2 ^ right) & 0x33333333;\n right ^= tmp;\n left ^= tmp << 2;\n tmp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= tmp << -16;\n tmp = (left >>> 1 ^ right) & 0x55555555;\n right ^= tmp;\n left ^= tmp << 1;\n tmp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= tmp << 8;\n tmp = (left >>> 1 ^ right) & 0x55555555;\n right ^= tmp;\n left ^= tmp << 1;\n // right needs to be shifted and OR'd with last four bits of left\n tmp = left << 8 | right >>> 20 & 0x000000f0;\n // left needs to be put upside down\n left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n right = tmp;\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i){\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = left << 2 | left >>> 26;\n right = right << 2 | right >>> 26;\n } else {\n left = left << 1 | left >>> 27;\n right = right << 1 | right >>> 27;\n }\n left &= -15;\n right &= -15;\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n var righttmp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n tmp = (righttmp >>> 16 ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ tmp << 16;\n }\n }\n return keys;\n}", "title": "" }, { "docid": "14cfa97e3b93174a1359e8916184f648", "score": "0.5121638", "text": "function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n }", "title": "" }, { "docid": "14cfa97e3b93174a1359e8916184f648", "score": "0.5121638", "text": "function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n }", "title": "" }, { "docid": "14cfa97e3b93174a1359e8916184f648", "score": "0.5121638", "text": "function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n }", "title": "" }, { "docid": "14cfa97e3b93174a1359e8916184f648", "score": "0.5121638", "text": "function assignKey(key, scope, method){\n var keys, mods;\n keys = getKeys(key);\n if (method === undefined) {\n method = scope;\n scope = 'all';\n }\n\n // for each shortcut\n for (var i = 0; i < keys.length; i++) {\n // set modifier keys if any\n mods = [];\n key = keys[i].split('+');\n if (key.length > 1){\n mods = getMods(key);\n key = [key[key.length-1]];\n }\n // convert to keycode and...\n key = key[0]\n key = code(key);\n // ...store handler\n if (!(key in _handlers)) _handlers[key] = [];\n _handlers[key].push({ shortcut: keys[i], scope: scope, method: method, key: keys[i], mods: mods });\n }\n }", "title": "" }, { "docid": "f0e965dda8b60b53081e5df1e4bdad3b", "score": "0.512091", "text": "function add_keymods(key, evt) {\n var shift = evt.shiftKey ? \"Shift\" : \"\";\n var ctrl = evt.ctrlKey ? \"Ctrl\" : \"\";\n return shift + ctrl + key;\n}", "title": "" }, { "docid": "012ae4384d8a9f27f9a45d2acbc6d5fe", "score": "0.51148146", "text": "function normalizeKeyAliases(keys) {\n const memory = {};\n return keys\n .replace(/\\+\\+/g, '+add')\n .split(/[\\s]*\\+[\\s]*/)\n .map(key => (0,string/* trim */.fy)(key.toLowerCase()))\n .map(key => constants.KEY_ALIASES[key] || key)\n .sort()\n .filter(key => !memory[key] && key !== '' && (memory[key] = true))\n .join('+');\n}", "title": "" }, { "docid": "275ca5ceccb8399cd6f8bbb944640d89", "score": "0.508352", "text": "function setUpKeys() {\n document.addEventListener(\"keydown\", (event) => {\n const keyName = event.key;\n if (keyName === \".\") {\n q(\".btn-separator\").click();\n }\n if (keyName === \"Backspace\") {\n q(\".btn-clear\").click();\n }\n if (keyName === \"+\") {\n q(\".btn-add\").click();\n }\n if (keyName === \"-\") {\n q(\".btn-subtract\").click();\n }\n if (keyName === \"*\") {\n q(\".btn-multiply\").click();\n }\n if (keyName === \"/\") {\n q(\".btn-divide\").click();\n }\n if (keyName === \"=\") {\n q(\".btn-calculate\").click();\n }\n if (\n digits.find((digit) => {\n return digit === keyName;\n })\n ) {\n q(`.btn-${keyName}`).click();\n }\n });\n}", "title": "" }, { "docid": "add95d494a317ed78754268dddc4076b", "score": "0.5074777", "text": "function addKeys(data) {\n\tvar keysarea = document.getElementById(\"txt\");\n\t// only add non-duplicates\n\tlet loaded = keysarea.value.split(\"\\n\");\n\tlet candidates = data.split(\"\\n\");\n\tcandidates = candidates.filter((e) => !loaded.includes(e));\n\tif (candidates.length == 0) {\n\t\tshowNotification(`{{ _(\"No new keys are added.\") }}`);\n\t} else {\n\t\tshowNotification(`Added ${candidates.length} keys.`);\n\t}\n\tlet final = candidates.concat(loaded);\n\tkeysarea.value = final.join(\"\\n\");\n}", "title": "" }, { "docid": "d4a89a38be41667b3e2ce3a3a3fd7f6e", "score": "0.507385", "text": "addKey(pref, suff) {\n if (pref in this.d) {\n this.d[pref].push(suff);\n } else {\n this.d[pref] = [suff];\n }\n }", "title": "" }, { "docid": "e99e0115335eb88361ca2e50f3144644", "score": "0.5073838", "text": "function setKeybinds(kitname){\n path = \"Drum Samples/\" + kitname + \"/\";\n ipath = \"Drum Icons/\" + kitname + \"/\";\n setIcons(ipath);\n}", "title": "" }, { "docid": "02651ef4c0e06d44faf96076c2785b3d", "score": "0.50671184", "text": "addKey(keyCode){\n\t\tconsole.log(\"Key Code: \" + keyCode); //for your convenience, you can see what the keyCode you care about is\n\t\tif(this.pressedKeys.indexOf(keyCode) == -1) this.pressedKeys.push(keyCode);\n\t}", "title": "" }, { "docid": "72581ea3b92c8326488d1fbf147bb114", "score": "0.50622046", "text": "setKeys(up, down, left, right, clockwise, counterclockwise, change) {\n this.enabledKeys.up.code = up;\n this.enabledKeys.down.code = down;\n this.enabledKeys.left.code = left;\n this.enabledKeys.right.code = right;\n this.enabledKeys.clockwise.code = clockwise;\n this.enabledKeys.counterclockwise.code = counterclockwise;\n this.enabledKeys.change.code = change;\n\n if (this.isEnabled) this.key = this.enabledKeys;\n }", "title": "" }, { "docid": "56b2183020635aaf552c8eec73fecb62", "score": "0.505809", "text": "function Key () /*!*/ {}", "title": "" }, { "docid": "605fecca64353fe6388013ea5344fe4f", "score": "0.50577253", "text": "function updateKeys() {\n\t\tkeys = [];\n\n\t\tfor (var key in items) {\n\t\t\tkeys.push(key);\n\t\t}\n\n\t\tLocalStorage.length = keys.length;\n\t}", "title": "" }, { "docid": "605fecca64353fe6388013ea5344fe4f", "score": "0.50577253", "text": "function updateKeys() {\n\t\tkeys = [];\n\n\t\tfor (var key in items) {\n\t\t\tkeys.push(key);\n\t\t}\n\n\t\tLocalStorage.length = keys.length;\n\t}", "title": "" }, { "docid": "605fecca64353fe6388013ea5344fe4f", "score": "0.50577253", "text": "function updateKeys() {\n\t\tkeys = [];\n\n\t\tfor (var key in items) {\n\t\t\tkeys.push(key);\n\t\t}\n\n\t\tLocalStorage.length = keys.length;\n\t}", "title": "" }, { "docid": "605fecca64353fe6388013ea5344fe4f", "score": "0.50577253", "text": "function updateKeys() {\n\t\tkeys = [];\n\n\t\tfor (var key in items) {\n\t\t\tkeys.push(key);\n\t\t}\n\n\t\tLocalStorage.length = keys.length;\n\t}", "title": "" }, { "docid": "18f1237a79b95b330c2878929450c19a", "score": "0.5055077", "text": "register(key, class_name){\n\t\tthis.bindings[key] = new class_name(this.state, this.bus);\n }", "title": "" }, { "docid": "380c658a28e02296d56dc40db0f5570f", "score": "0.5043123", "text": "function register(key, path, api, serverMap, clientMap) {\n clientMap[key] = typeof path === 'string' ? getClientFunction(api, path) : path;\n serverMap[key] = path;\n}", "title": "" }, { "docid": "3c5e9c11e2a56194491d33391366432d", "score": "0.50378776", "text": "onDisableKeys() {\n const keys = document.querySelectorAll(\".key\");\n keys.forEach(key => key.setAttribute(\"disabled\", \"true\"));\n }", "title": "" }, { "docid": "59b6d411b1462d9a9ab998bd7fd74835", "score": "0.50339055", "text": "genKeys() {\n const key = forge.random.getBytesSync(16);\n const initVector = forge.random.getBytesSync(16);\n\n return { key, initVector };\n }", "title": "" }, { "docid": "b6e1aa3319df9b0abdc2855745a93575", "score": "0.50306326", "text": "function addDirectionalKeyCode(which) {\r\n DirectionalKeyCodes[which] = 1;\r\n}", "title": "" }, { "docid": "b6e1aa3319df9b0abdc2855745a93575", "score": "0.50306326", "text": "function addDirectionalKeyCode(which) {\r\n DirectionalKeyCodes[which] = 1;\r\n}", "title": "" }, { "docid": "b6e1aa3319df9b0abdc2855745a93575", "score": "0.50306326", "text": "function addDirectionalKeyCode(which) {\r\n DirectionalKeyCodes[which] = 1;\r\n}", "title": "" }, { "docid": "8e36ebbf04fd15041fc4d9d72b3a8464", "score": "0.5029795", "text": "function registerPresets(newPresets) {\n Object.keys(newPresets).forEach(name =>\n registerPreset(name, newPresets[name]),\n );\n}", "title": "" }, { "docid": "60c8801e3bb1321a0757a38dae89d012", "score": "0.5029613", "text": "pushKey(Key) {\n this.keys.push(Key);\n }", "title": "" }, { "docid": "2dd1f9ec8ffb0039e83efdad38d095a0", "score": "0.50195765", "text": "constructor() {\n this.KEY_STATE = Object.freeze({\n RELEASED: { id: 0, value: 'RELEASED' }, // Not down\n PRESSED: { id: 1, value: 'PRESSED' }, // Down but not first time\n DOWN_ONCE: { id: 2, value: 'DOWN_ONCE' }, // Down for the first time\n });\n\n // An array of registered keys that the engine will listen for\n this._registeredKeys = [];\n this._typedKey = '';\n\n this.key_typed_event = Symbol('key_typed_event');\n }", "title": "" }, { "docid": "955cf9b1de878c9d68296ab24c33cbeb", "score": "0.5018789", "text": "function getResources(key) {\n\tvar resources = {};\n\t\n\tresources[\"register.captcha.answer.invalid\"] = \"Please enter the correct number of sheep.\";\n\tresources[\"register.captcha.images.not.found\"] = \"No sheep found!\";\n\tresources[\"register.captcha.refresh\"] = \"You're watching to a cached image, refresh it first!\";\n\tresources[\"register.captcha.too.many.failed.attempts\"] = \"You have failed three times, you can try again in 10 minutes.\";\n\tresources[\"register.captcha.wrong.answer\"] = \"Wrong number of sheep, please try again!\";\n\tresources[\"register.database.could.not.connect\"] = \"Could not connect to the database. Please try again later.\";\n\tresources[\"register.email.already.in.use\"] = \"The entered e-mail address is already in use.\";\n\tresources[\"register.email.invalid\"] = \"The entered e-mail address is invalid.\";\n\tresources[\"register.email.size.invalid\"] = \"The entered e-mail address size is invalid. It should be minimal 7 characters and maximal 80 characters.\";\n\tresources[\"register.password.contains.invalid.characters\"] = \"The password may only contain letters and/or numbers.\";\n\tresources[\"register.password.is.null\"] = \"Please enter a password.\";\n\tresources[\"register.password.size.invalid\"] = \"The entered password should have a size of minimal 5 and maximal 20 characters.\";\n\tresources[\"register.succeeded\"] = \"Registration complete. You can now <a href=\\\"login.html\\\">login</a>!\";\n\tresources[\"register.unable.to.register\"] = \"An error occurred, you were unable to register.\";\n\tresources[\"register.username.already.exists\"] = \"This user name has already been taken, please try another.\";\n\tresources[\"register.username.contains.invalid.characters\"] = \"The user name may only contain letters and/or numbers.\";\n\tresources[\"register.username.is.null\"] = \"Please enter a valid user name.\";\n\tresources[\"register.username.size.invalid\"] = \"The given user name size is invalid. It's size should be at least one character and no more than 20 characters.\";\n\t\n\treturn resources[key];\n}", "title": "" }, { "docid": "457da16083e44da487629bae7141acbf", "score": "0.5014666", "text": "function GostKeys() {\n}", "title": "" }, { "docid": "47a23a87693f25ef416320e701d9c0cf", "score": "0.501344", "text": "function createKeyIDs()\n{\n var keyIds = '{\"kids\":[\"';\n for (var i = 0; i < arguments.length; i++) {\n if (i != 0)\n keyIds += '\",\"';\n keyIds += base64urlEncode(arguments[i]);\n }\n keyIds += '\"]}';\n return keyIds;\n}", "title": "" }, { "docid": "6ae7061f30799cf0acf11741672ebac1", "score": "0.50089145", "text": "function addInitialKeyListener() {\n document.addEventListener(\"keydown\", (e) => {\n if (e.metaKey && e.key === \"/\") {\n const event = new Event(\"cmd\");\n document.dispatchEvent(event);\n }\n if (e.key === \"Escape\") {\n const event = new Event(\"exit\");\n document.dispatchEvent(event);\n }\n })\n}", "title": "" }, { "docid": "f6dee886db18c97a8fae16d5f376860b", "score": "0.50082", "text": "registerShortcut() {\n W.accelerators._registerShortcuts(this.shortcut);\n }", "title": "" }, { "docid": "80c4d16e2207a1dd441ba68078676d3f", "score": "0.5008149", "text": "function addDataKeys(givenKeys) {\n var _this = this;\n\n var _initSeemple = Object(init[\"a\" /* default */])(this),\n keys = _initSeemple.keys;\n\n var newKeys; // accept an array keys or a list of args\n\n if (givenKeys instanceof Array) {\n newKeys = givenKeys;\n } else {\n newKeys = arguments;\n }\n\n Object(foreach[\"a\" /* default */])(newKeys, function (key) {\n if (typeof key !== 'string') {\n throw Object(seempleerror[\"a\" /* default */])('adddatakeys:key_type', {\n key: key\n });\n } // if key is not in a list of keys\n\n\n if (!(key in keys)) {\n // define descriptors for this property\n var _defineProp = Object(defineprop[\"a\" /* default */])(_this, key),\n value = _defineProp.value;\n\n var eventOptions = {\n key: key,\n value: value\n }; // add a key to the list of keys\n\n keys[key] = true; // trigger events which say that data is changed\n\n Object(_triggerone[\"a\" /* default */])(_this, 'set', eventOptions);\n Object(_triggerone[\"a\" /* default */])(_this, 'modify', eventOptions);\n }\n });\n return this;\n}", "title": "" }, { "docid": "deff81603f0f2ae92ea6d7d16940d070", "score": "0.50046086", "text": "static define(strings, ...keys) {\n return {strings, keys};\n }", "title": "" }, { "docid": "a9bf8fe1e7e933b6c6d3887fe1920237", "score": "0.49998662", "text": "function regGetSubKeys(strComputer, strRegPath) \n{ \n\tvar aNames = null; \n\tvar objLocator = new ActiveXObject(\"WbemScripting.SWbemLocator\"); \n\tvar objService = objLocator.ConnectServer(strComputer, \"root\\\\default\"); \n\tvar objReg = objService.Get(\"StdRegProv\"); \n\tvar objMethod = objReg.Methods_.Item(\"EnumKey\"); \n\tvar objInParam = objMethod.InParameters.SpawnInstance_(); \n\tobjInParam.hDefKey = HKLM; \n\tobjInParam.sSubKeyName = strRegPath; \n\tvar objOutParam = objReg.ExecMethod_(objMethod.Name, objInParam); \n\tswitch(objOutParam.ReturnValue) \n\t{ \n case 0: // Success \n aNames = (objOutParam.sNames != null) ? objOutParam.sNames.toArray(): null; \n break; \n\n case 2: // Not Found \n aNames = null; \n break; \n } \n return aNames;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "7e56255fe88493b935d2640a5da4b616", "score": "0.49964762", "text": "function _createKeys(key) {\n var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n // how many iterations (1 for des, 3 for triple des)\n // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n var iterations = key.length() > 8 ? 3 : 1;\n\n // stores the return keys\n var keys = [];\n\n // now define the left shifts which need to be done\n var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n var n = 0, tmp;\n for(var j = 0; j < iterations; j++) {\n var left = key.getInt32();\n var right = key.getInt32();\n\n tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n right ^= tmp;\n left ^= (tmp << 4);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 2) ^ right) & 0x33333333;\n right ^= tmp;\n left ^= (tmp << 2);\n\n tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n left ^= tmp;\n right ^= (tmp << -16);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n left ^= tmp;\n right ^= (tmp << 8);\n\n tmp = ((left >>> 1) ^ right) & 0x55555555;\n right ^= tmp;\n left ^= (tmp << 1);\n\n // right needs to be shifted and OR'd with last four bits of left\n tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n // left needs to be put upside down\n left = ((right << 24) | ((right << 8) & 0xff0000) |\n ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n right = tmp;\n\n // now go through and perform these shifts on the left and right keys\n for(var i = 0; i < shifts.length; ++i) {\n //shift the keys either one or two bits to the left\n if(shifts[i]) {\n left = (left << 2) | (left >>> 26);\n right = (right << 2) | (right >>> 26);\n } else {\n left = (left << 1) | (left >>> 27);\n right = (right << 1) | (right >>> 27);\n }\n left &= -0xf;\n right &= -0xf;\n\n // now apply PC-2, in such a way that E is easier when encrypting or\n // decrypting this conversion will look like PC-2 except only the last 6\n // bits of each byte are used rather than 48 consecutive bits and the\n // order of lines will be according to how the S selection functions will\n // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n var lefttmp = (\n pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n pc2bytes6[(left >>> 4) & 0xf]);\n var righttmp = (\n pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n pc2bytes13[(right >>> 4) & 0xf]);\n tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n keys[n++] = lefttmp ^ tmp;\n keys[n++] = righttmp ^ (tmp << 16);\n }\n }\n\n return keys;\n}", "title": "" }, { "docid": "d63d991850d29a13d8c01be72dd59e18", "score": "0.49945736", "text": "addRecordedKey (state, { key }) {\n let macro = state.selectedStep\n key.order = macro.value.length\n key.id = _.uniqueId('macrostep_')\n macro.value.push(key)\n }", "title": "" }, { "docid": "84da50ff5ff754d86b0472a995e2a41c", "score": "0.49873266", "text": "function updateKeys() {\n keys = [];\n\n for (var key in items) {\n keys.push(key);\n }\n\n LocalStorage.length = keys.length;\n }", "title": "" }, { "docid": "84da50ff5ff754d86b0472a995e2a41c", "score": "0.49873266", "text": "function updateKeys() {\n keys = [];\n\n for (var key in items) {\n keys.push(key);\n }\n\n LocalStorage.length = keys.length;\n }", "title": "" }, { "docid": "aa033f7b8e6ad1c5f0c43454ebbbe167", "score": "0.49839008", "text": "registerNewPreKeyBundle(userId, preKeyBundle) {\n this.store[userId] = preKeyBundle;\n firebase.database().ref('preKeyBundleUsers/' + userId).set({\n status:1,\n identityKey: util.toString(this.store[userId].identityKey),\n registrationId: this.store[userId].registrationId,\n preKey: {\n keyId: this.store[userId].preKey.keyId,\n publicKey: util.toString(this.store[userId].preKey.publicKey)\n },\n signedPreKey: {\n keyId: this.store[userId].signedPreKey.keyId,\n publicKey: util.toString(this.store[userId].signedPreKey.publicKey),\n signature: util.toString(this.store[userId].signedPreKey.signature)\n }\n });\n }", "title": "" }, { "docid": "02a20b473c2f6a6af25276ac083b9828", "score": "0.4982937", "text": "function addDirectionalKeyCode(which) {\n DirectionalKeyCodes[which] = 1;\n}", "title": "" }, { "docid": "02a20b473c2f6a6af25276ac083b9828", "score": "0.4982937", "text": "function addDirectionalKeyCode(which) {\n DirectionalKeyCodes[which] = 1;\n}", "title": "" }, { "docid": "02a20b473c2f6a6af25276ac083b9828", "score": "0.4982937", "text": "function addDirectionalKeyCode(which) {\n DirectionalKeyCodes[which] = 1;\n}", "title": "" }, { "docid": "02a20b473c2f6a6af25276ac083b9828", "score": "0.4982937", "text": "function addDirectionalKeyCode(which) {\n DirectionalKeyCodes[which] = 1;\n}", "title": "" }, { "docid": "02a20b473c2f6a6af25276ac083b9828", "score": "0.4982937", "text": "function addDirectionalKeyCode(which) {\n DirectionalKeyCodes[which] = 1;\n}", "title": "" }, { "docid": "673f041e3ba00abfbc39c94543797029", "score": "0.49776813", "text": "validKeys(e) {\n const valid = {1: true, 2: true, 3: true, 4: true, 5: true,\n 6: true, 7: true, 8: true, 9: true, 0: true, \".\": true};\n if (valid[e.key]) {\n } else {\n e.preventDefault();\n }\n }", "title": "" }, { "docid": "e968104e413fe29e22345e5514b19751", "score": "0.49696025", "text": "function createRegularField(key) {\n return \"'\"+key+\"':row['\"+key+\"']\";\n}", "title": "" }, { "docid": "7e344204260a27df2711c1383fb3bbe6", "score": "0.495914", "text": "async function initMarketWatchKeys() {\r\n const keys = await MARKETWATCH_SYMBOLS.get(\"KEYS\");\r\n if (keys === null) {\r\n await MARKETWATCH_SYMBOLS.put(\"KEYS\", \"\");\r\n }\r\n}", "title": "" }, { "docid": "067c8637b4dd991cbfc32174e6b7ac1a", "score": "0.4958275", "text": "initKeys() {\n\t\tthis.scene.gui=this;\n\t\tthis.processKeyboard=function(){};\n\t\tthis.activeKeys={};\n\t}", "title": "" }, { "docid": "76f98de60417e53226af1863c6d795fb", "score": "0.49572003", "text": "function handleKeyDown(event) {\n currentlyPressedKeys[event.keyCode] = true;\n}", "title": "" }, { "docid": "b8cdda1531db59e8fab499ea84d51232", "score": "0.49442402", "text": "function createKeyIDs() {\n var keyIds = '{\"kids\":[\"';\n for (var i = 0; i < arguments.length; i++) {\n if (i != 0) keyIds += '\",\"';\n keyIds += base64urlEncode(arguments[i]);\n }\n keyIds += '\"]}';\n return keyIds;\n}", "title": "" }, { "docid": "ef6b3558b3b236d42a82718005b062c7", "score": "0.4936756", "text": "function KeyValue() { }", "title": "" }, { "docid": "ef6b3558b3b236d42a82718005b062c7", "score": "0.4936756", "text": "function KeyValue() { }", "title": "" }, { "docid": "ba6bfb5f2de8d41429f5bf874f7a5391", "score": "0.49359924", "text": "function _createKeys(key) {\n\t var pc2bytes0 = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n\t pc2bytes1 = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n\t pc2bytes2 = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n\t pc2bytes3 = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n\t pc2bytes4 = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n\t pc2bytes5 = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n\t pc2bytes6 = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n\t pc2bytes7 = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n\t pc2bytes8 = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n\t pc2bytes9 = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n\t pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n\t pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n\t pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n\t pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n\t // how many iterations (1 for des, 3 for triple des)\n\t // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n\t var iterations = key.length() > 8 ? 3 : 1;\n\n\t // stores the return keys\n\t var keys = [];\n\n\t // now define the left shifts which need to be done\n\t var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n\t var n = 0, tmp;\n\t for(var j = 0; j < iterations; j++) {\n\t var left = key.getInt32();\n\t var right = key.getInt32();\n\n\t tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n\t right ^= tmp;\n\t left ^= (tmp << 4);\n\n\t tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n\t left ^= tmp;\n\t right ^= (tmp << -16);\n\n\t tmp = ((left >>> 2) ^ right) & 0x33333333;\n\t right ^= tmp;\n\t left ^= (tmp << 2);\n\n\t tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n\t left ^= tmp;\n\t right ^= (tmp << -16);\n\n\t tmp = ((left >>> 1) ^ right) & 0x55555555;\n\t right ^= tmp;\n\t left ^= (tmp << 1);\n\n\t tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n\t left ^= tmp;\n\t right ^= (tmp << 8);\n\n\t tmp = ((left >>> 1) ^ right) & 0x55555555;\n\t right ^= tmp;\n\t left ^= (tmp << 1);\n\n\t // right needs to be shifted and OR'd with last four bits of left\n\t tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n\t // left needs to be put upside down\n\t left = ((right << 24) | ((right << 8) & 0xff0000) |\n\t ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n\t right = tmp;\n\n\t // now go through and perform these shifts on the left and right keys\n\t for(var i = 0; i < shifts.length; ++i) {\n\t //shift the keys either one or two bits to the left\n\t if(shifts[i]) {\n\t left = (left << 2) | (left >>> 26);\n\t right = (right << 2) | (right >>> 26);\n\t } else {\n\t left = (left << 1) | (left >>> 27);\n\t right = (right << 1) | (right >>> 27);\n\t }\n\t left &= -0xf;\n\t right &= -0xf;\n\n\t // now apply PC-2, in such a way that E is easier when encrypting or\n\t // decrypting this conversion will look like PC-2 except only the last 6\n\t // bits of each byte are used rather than 48 consecutive bits and the\n\t // order of lines will be according to how the S selection functions will\n\t // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n\t var lefttmp = (\n\t pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n\t pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n\t pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n\t pc2bytes6[(left >>> 4) & 0xf]);\n\t var righttmp = (\n\t pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n\t pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n\t pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n\t pc2bytes13[(right >>> 4) & 0xf]);\n\t tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n\t keys[n++] = lefttmp ^ tmp;\n\t keys[n++] = righttmp ^ (tmp << 16);\n\t }\n\t }\n\n\t return keys;\n\t}", "title": "" }, { "docid": "2f8f88e75953f6b74ee1ddd7c79cbaeb", "score": "0.49354643", "text": "function doSetupSimpleSubstitutionKey() {\n var range = _getActiveRange();\n var startRow = range.getRow();\n var startColumn = range.getColumn();\n for (var curRow = startRow; curRow <= startRow + 26; curRow++) {\n }\n}", "title": "" }, { "docid": "22ae3f11574efe1b5174b54d9acc3338", "score": "0.49353915", "text": "fillDictionary() {\n for (let i = 32; i < 127; i++) {\n this.#dictionary.put(new StringHash(String.fromCharCode(i)), i - 32);\n }\n }", "title": "" }, { "docid": "c6d72a60d077199934193f1174522bb9", "score": "0.4934385", "text": "function createNewUniqueKey(existingKeys) {\n // The base of the key is the current time, in milliseconds since epoch.\n const base = `${new Date().getTime()}`;\n if (!existingKeys.includes(base)) {\n return base;\n }\n\n // But, if the user is a fast-clicker or time-traveler or something, and\n // already has a highlight from this millisecond, then let's attach a\n // suffix and keep incrementing it until we find an unused suffix.\n let suffix = 0;\n let key;\n do {\n key = `${base}-${suffix}`;\n suffix++;\n } while (existingKeys.includes(key));\n\n return key;\n}", "title": "" }, { "docid": "63bc29ddd0c086d8ca7bc01b0723c2bb", "score": "0.49317658", "text": "function keyTyped() {\n // Insert new molecules to the field with key 'm'\n if (curMode == 3 || curMode == 4) {\n if (key == 'm') {\n molecules.push(newCarbon(curMode == 3 ? 'G2D' : 'G3D'));\n console.log(molecules);\n }\n }\n}", "title": "" }, { "docid": "817bfc1d458fbf9e609005d680934176", "score": "0.49266192", "text": "keypress(key, value) {\n this.key[key] = value;\n }", "title": "" }, { "docid": "11ac803c30abc7608dc58138a8fbcf3f", "score": "0.49251544", "text": "function parseKey() {\n\t var specialValues = ['null', 'true', 'false'];\n\t var key = '';\n\t var c = curr();\n\n\t var regexp = /[a-zA-Z_$\\d]/; // letter, number, underscore, dollar character\n\t while (regexp.test(c)) {\n\t key += c;\n\t i++;\n\t c = curr();\n\t }\n\n\t if (specialValues.indexOf(key) === -1) {\n\t chars.push('\"' + key + '\"');\n\t }\n\t else {\n\t chars.push(key);\n\t }\n\t }", "title": "" }, { "docid": "88c6c4fe70c5fddc775d7a460b0d7d10", "score": "0.49244136", "text": "function addDirectionalKeyCode(which) {\n DirectionalKeyCodes[which] = 1;\n}", "title": "" } ]
47fa66573d2a426a2b0f2287a51b6b72
Events at the cart page
[ { "docid": "fc3d6823865664f1fa19b9e21637773c", "score": "0.0", "text": "function listenEvents() {\n const btnPay = document.getElementById('btn-pay');\n const btnClean = document.getElementById('btn-clean');\n\n //When the btn Pay is clicked\n btnPay.addEventListener('click', () => {\n window.location.href = `/pay.html`;\n });\n\n //When the btn Clean is clicked\n btnClean.addEventListener('click', () => {cleanCart()});\n\n //When is clicked deleted a item at a row from table\n const tbody = cart.tableCart.getElementsByTagName('tbody')[0];\n tbody.addEventListener('click', (e) => {clickDelete(e)})\n}", "title": "" } ]
[ { "docid": "e7845801ae9178a5cb06705810c4cb7f", "score": "0.77003914", "text": "_onCartCheckout() {\n this.logger.startEmpty();\n\n this.sidebarToggle( false );\n\n this.container.set( this.pages.checkout );\n\n this.pages.checkout.on( 'render:after', () => {\n console.log( 'onCartCheckout this.page.checkout rendered' );\n } );\n\n this.container.render();\n }", "title": "" }, { "docid": "be154b4db231d897ed140c5b8090eeb5", "score": "0.75403905", "text": "_onCartReceived() {\n this.logger.startEmpty();\n\n const { cart, spinner } = this.elements.header;\n\n cart.show();\n spinner.hide();\n }", "title": "" }, { "docid": "c5e75d97c6f867a1229b258f2db2fa16", "score": "0.7390498", "text": "_bindEvents() {\n Events.on('cartupdated', cart => {\n this.cartItems = cart;\n this._updateCartNav(cart.length);\n });\n }", "title": "" }, { "docid": "f02ef8166ccaf3138622cf635d698733", "score": "0.7335461", "text": "function onAddCartChanged() {\n logger.info('onAddCartChanged called');\n $.trigger('setProduct:add_cart_changed');\n}", "title": "" }, { "docid": "96548c06bb92a6c2871e148680a8f0ca", "score": "0.727069", "text": "function handleCartClick() {\n $.cart_container.animate(Alloy.Animations.bounce);\n verifyAddressEditBeforeNavigation(function() {\n Alloy.Router.navigateToCart({\n switchToCart : true\n });\n });\n}", "title": "" }, { "docid": "e51f5ff76cfd4b0543e379b894da730b", "score": "0.72105426", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n updateCartPreview();\n}", "title": "" }, { "docid": "e3744fb62455bb600ddb28c5dd596f19", "score": "0.7178415", "text": "function bindAddToCartEvent() {\n var self = this;\n var addToCartElement = klevu.dom.find(\".kuModalProductCart\", \".productQuickView\");\n if (addToCartElement.length) {\n klevu.event.attach(addToCartElement[0], \"click\", function (event) {\n self.attachKlevuQuickViewAddToCartBtnEvent(event);\n });\n }\n }", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "85b09e02d2c0e383de183d75bc8c6a56", "score": "0.71754074", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "04ceee8f75db52ef109fa795563f49bd", "score": "0.7126558", "text": "function showCart() {\n cart.renderCart();\n}", "title": "" }, { "docid": "b2615aee0d602471e51a3d79211fe33a", "score": "0.7120707", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "b2615aee0d602471e51a3d79211fe33a", "score": "0.7120707", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "b2615aee0d602471e51a3d79211fe33a", "score": "0.7120707", "text": "function renderCart() {\n loadCart();\n clearCart();\n showCart();\n}", "title": "" }, { "docid": "d4fb0e3e4ae458f422a52c4095b3baa3", "score": "0.6996161", "text": "function handleBuyNow() {\n addToCart();\n history.push(\"/shopping-cart\");\n }", "title": "" }, { "docid": "b95aad6ba6c8323278c8e9b050aadb53", "score": "0.69874907", "text": "displayCart(){\n this.showCart();\n this.removeItem();\n this.incrementQuantity();\n this.totalCart();\n }", "title": "" }, { "docid": "8cd32d9f8f54b2002b5328d8e2cf65dd", "score": "0.6986858", "text": "function addProductToCart() {\n addToCart();\n showToast();\n }", "title": "" }, { "docid": "d613749a2c1fc5ad70ae4f0dfa2a2bca", "score": "0.6974874", "text": "function addToCart (event) {\r\n // load the cart from the storage\r\n const cart = JSON.parse(sessionStorage.getItem('cart'))\r\n // add the ID of the selected item to the cart\r\n cart.push(event.target.id)\r\n // store the cart in the storage\r\n sessionStorage.setItem('cart', JSON.stringify(cart))\r\n\r\n if (cart.length === 0) {\r\n // hide cart notification if the cart is empty\r\n $('#cartCounter').css({ visibility: 'hidden' })\r\n } else {\r\n // show the animated cart notification if it is not empty (with the cart length being the notification number)\r\n $('#cartCounter').css({ visibility: 'visible' })\r\n $('#cartCounter').text(String(cart.length)).animate({ fontSize: '2em' }, 300).animate({ fontSize: '1em' }, 250).animate({ fontSize: '1.5em' }, 200).animate({ fontSize: '1em' }, 100)\r\n\r\n // laad the catalogue\r\n catalogue = JSON.parse(sessionStorage.getItem('catalogue'))\r\n let total = 0\r\n // calculate the total of all the cart items\r\n cart.forEach(index => {\r\n const price = catalogue[Number(index)].price.split(' ').join('')\r\n total = eval(total + '+' + price)\r\n total = total.toFixed(2)\r\n })\r\n // store the updated total\r\n sessionStorage.setItem('cartTotal', JSON.stringify(total))\r\n $('#cartTotal').text(total)\r\n // display the total of the cart as an alert\r\n alert(`Your cart total is currently R ${total}`)\r\n }\r\n}", "title": "" }, { "docid": "33623cf1f2552e3ddd685037f618f6c2", "score": "0.69498056", "text": "function SnipcartEvents(uniqueId) {\n window.Snipcart.events.on('item.updated', (cartItem) => {\n console.log(\"UPDATES:\", cartItem);\n // Function to update cart itmems \n \n window.Snipcart.api.cart.items.update({\n uniqueId: uniqueId,\n name: 'Updated name'\n \n }) \n })}", "title": "" }, { "docid": "5366186e04d8b3fd6e2a2414f75597cd", "score": "0.69241166", "text": "addToCart(){\n const detail = {\n cartProducts: this.productQuantities\n };\n\n const addToCartEvent = new CustomEvent('addtocartevent', {\n detail: detail,\n bubbles: false,\n composed: false\n });\n this.dispatchEvent(addToCartEvent);\n }", "title": "" }, { "docid": "b52afe4eb2b60a43bada9edcebf1e231", "score": "0.6908824", "text": "function cartEvents(e) {\n e.preventDefault();\n if (e.target.classList[2] === 'delete') {\n deleteProductCart(e);\n }\n\n if (e.target.classList[0] === 'sum') {\n modifyAmountOfProduct(e, '+');\n }\n\n if (e.target.classList[0] === 'subs') {\n modifyAmountOfProduct(e, '-');\n }\n\n}", "title": "" }, { "docid": "5139636a5d7689e1d348db89799269f4", "score": "0.6889726", "text": "function addToCartClicked(event) {\r\n let button = event.target\r\n let shopItem = button.parentElement.parentElement\r\n let title = shopItem.getElementsByClassName('shop-item-title')[0].innerText\r\n let price = shopItem.getElementsByClassName('shop-item-price')[0].innerText\r\n let imageSrc = shopItem.getElementsByClassName('img-thumbnail img-fluid')[0].src\r\n addItemToCart(title, price, imageSrc)//allows for the user to view the item image and price\r\n updateCartTotal()\r\n}", "title": "" }, { "docid": "e51b17ae02e9b4a125aa8b47b1d20bea", "score": "0.6878551", "text": "function cartHandler( cartObj ){\n var $element = $('<div />', {\n id : 'shopifiable-cart',\n html : '<div class=\"inner\"><div class=\"quick-view\"><span>'+cartObj.item_count+'</span> Items | <span>$' + (+(cartObj.total_price)/100).toFixed(2) + '</span> | <a href=\"'+storeURL+'cart\">Checkout</a></div><div class=\"item-list\"></div></div>'\n }).appendTo('body');\n\n $element.on('click', '.quick-view', function(event){\n if( $(event.target).is('a') ){\n return;\n }\n\n $element.toggleClass('open');\n if( ! $element.data('loaded') ){\n if( cartObj.item_count >= 1 ){\n var fragment = document.createDocumentFragment();\n $.each(cartObj.items, function(index, prodObj){\n var element = document.createElement('div');\n element.setAttribute('class', 'item');\n element.innerHTML = '<img src=\"'+prodObj.image+'\" /><span class=\"title\">'+prodObj.title+'</span>';\n fragment.appendChild(element);\n });\n $('.item-list', $element).append(fragment);\n }\n $element.data('loaded', true);\n }\n });\n }", "title": "" }, { "docid": "c57600d83d26d9c326c700ebea271eb2", "score": "0.6864994", "text": "function handleCartInfo(cartEvent) {\n console.log(\"submit cart form\");\n /**\n * When users click the submit button, the browser will not direct\n * users to the url defined in HTML form. Instead, it will call this\n * event handler when the event is triggered.\n */\n cartEvent.preventDefault();\n\n $.get(\n \"api/cart\",\n // Serialize the cart form to the data sent by POST request\n $(\"#movie_list\").serialize(),\n (resultDataString) => handleSessionData(resultDataString)\n);\n}", "title": "" }, { "docid": "4fa0961b97429184d69b8a20f589ff93", "score": "0.68584526", "text": "function postToCart(event) {\n event.preventDefault();\n const inputs = event.target.elements; \n const data = {\n cartId: inputs['cartId'].value == \"undefined\" ? null : inputs['cartId'].value,\n itemId: inputs['merchandiseId'].value,\n quantity: inputs['quantity'].value,\n };\n\n postData('/api/add-to-cart', data)\n .then(data => {\n // persist that cartId for subsequent actions\n localStorage.setItem('shopifyCartId', data.id);\n // update the cart ;abel in the navigation\n displayCartSummaryDetails(data.lines.edges.length, data.id);\n });\n}", "title": "" }, { "docid": "11b8513df29f72ed0ac19e2fb437d7d0", "score": "0.68513626", "text": "refreshCart() {\n this.createCart();\n }", "title": "" }, { "docid": "2cf50142cef0e093ac9fd3e87e3466dc", "score": "0.6845193", "text": "function addItem(e) {\n // Get the product id in the cart's table.\n let id = e.currentTarget.parentElement.parentElement.firstElementChild.innerText;\n // Increment counter and total cost.\n cartCounter(products[id]);\n totalCost(products[id]);\n // Refresh cart.\n displayCart();\n}", "title": "" }, { "docid": "abbcfea0c0e5625d6a9ab12d521453cc", "score": "0.6844607", "text": "updateCart() {\n updateAllProducts();\n }", "title": "" }, { "docid": "e498e5147053b3886459a5183cf7b03b", "score": "0.6838929", "text": "addToCartButtonHandler() {\n let that = this;\n\n $(this.config.selectors.addToCart).click(function (event) {\n event.preventDefault();\n\n let id = +this.getAttribute('id'); // found id of added product\n that.getCatalog(id);\n that.animateCart(that.config.selectors.cartHeaderImg);\n })\n }", "title": "" }, { "docid": "a9164e0158756565815ac0d18f84e468", "score": "0.68185884", "text": "onProductAddToCart(product_id){\n this.context.addToCart(product_id);\n }", "title": "" }, { "docid": "b8e5b5dd3d6d0c5c0a2e40c79f49d4e6", "score": "0.6796262", "text": "function renderCart() {\n var cart = GetCartFromStorage();\n renderPrice(cart);\n renderTable(cart);\n }", "title": "" }, { "docid": "cbff66b3ee21c4f59996c18c7ed35524", "score": "0.67700833", "text": "setUpInitialCart() {\n cart = Storage.getCart();\n this.setCartValues(cart);\n this.populateCart(cart);\n cartBtn.addEventListener('click', this.showCart);\n closeCartBtn.addEventListener('click', this.hideCart);\n }", "title": "" }, { "docid": "4fd3a1a4adc80cb4cd82fe0487ad4452", "score": "0.676379", "text": "function ready() {\r\n let removeCartItemButtons = document.getElementsByClassName('btn-danger')\r\n for (let i = 0; i < removeCartItemButtons.length; i++) {\r\n let button = removeCartItemButtons[i]\r\n button.addEventListener('click', removeCartItem)//whenever this button is clicked, items will be removed from the cart\r\n }\r\n // below: when the quantity changes, the total gets updated\r\n let quantityInputs = document.getElementsByClassName('cart-quantity-input')\r\n for (let i = 0; i < quantityInputs.length; i++) {\r\n let input = quantityInputs[i]\r\n input.addEventListener('change', quantityChanged)\r\n }\r\n\r\n let addToCartButtons = document.getElementsByClassName('shop-item-button')\r\n for (let i = 0; i < addToCartButtons.length; i++) {\r\n let button = addToCartButtons[i]\r\n button.addEventListener('click', addToCartClicked)\r\n }\r\n\r\n document.getElementsByClassName('btn-purchase')[0].addEventListener('click', purchaseClicked)//this allows for the purchase button to be functional\r\n}", "title": "" }, { "docid": "146bb8c4833c01dbefb8ea9212655382", "score": "0.67596674", "text": "addItemsToCart(product, count) {\n this.getCart((cartItem) => {\n cleverTapAddToCart() // logs event into clever tap as item get added to cart\n cartItem.addVariantToCart(product, count)\n })\n }", "title": "" }, { "docid": "8543f2313ee50ea67133995c97dd978b", "score": "0.67565614", "text": "addToCart(event) {\n addToCart({\n communityId: communityId,\n productId: this.recordId,\n quantity: event.detail.quantity,\n effectiveAccountId: this.resolvedEffectiveAccountId\n })\n .then(() => {\n this.dispatchEvent(\n new CustomEvent('cartchanged', {\n bubbles: true,\n composed: true\n })\n );\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Success',\n message: 'Your cart has been updated.',\n variant: 'success',\n mode: 'dismissable'\n })\n );\n })\n .catch(() => {\n this.dispatchEvent(\n new ShowToastEvent({\n title: 'Error',\n message:\n '{0} could not be added to your cart at this time. Please try again later.',\n messageData: [this.displayableProduct.name],\n variant: 'error',\n mode: 'dismissable'\n })\n );\n });\n }", "title": "" }, { "docid": "6c47120913dbe80b5794d03e1e38a9a5", "score": "0.6750579", "text": "function addToCartClicked(event) {\n var button = event.target\n var shopItem = button.parentElement.parentElement\n var title = shopItem.getElementsByClassName('shop-item-title')[0].innerText\n var price = shopItem.getElementsByClassName('shop-item-price')[0].innerText\n var imageSrc = shopItem.getElementsByClassName('shop-item-image')[0].src\n addItemToCart(title, price, imageSrc)\n updateCartTotal()\n}", "title": "" }, { "docid": "270a72e93bca5bc36ba4d80ffa84fd11", "score": "0.6742591", "text": "function addCart () {\n setTotalCount(totalCount+count);\n setCount(0);\n }", "title": "" }, { "docid": "afa21c2ea0b29205bb8ff33745edea8c", "score": "0.6731982", "text": "static displayCart(){\r\n let carts = Store.get_list();\r\n carts.forEach( list => {\r\n UI.addToCartList(list)\r\n });\r\n }", "title": "" }, { "docid": "93dc361c82717dbd76966688771e1453", "score": "0.6731838", "text": "function changeCartHandler (response) {\n // Minus button\n if (response.amount > 0)\n $('.to-cart .minus-button[data-item=' + response.id + ']').removeClass('hidden');\n else {\n // For main page\n $('.to-cart .minus-button[data-item=' + response.id + ']').addClass('hidden');\n // For cart page\n $('.cart-products .cart-position[data-item=' + response.id + ']').addClass('hidden');\n }\n\n // Amount counter on product card\n $('span.change-cart[data-item=' + response.id + ']').text(response.amount);\n\n // Total order amount counter on top\n let count = $('.top-bar__cart-icon span');\n let targetAmount = parseInt(count.attr('data-count'), 10) + response.change;\n count.attr('data-count', targetAmount);\n\n // Total sum on top\n let sum = parseFloat($('.top-bar__cart-info span').text());\n let total = (sum + response.change * response.price).toFixed(2);\n $('.top-bar__cart-info span').text(total);\n // Total sum for cart page\n $('.cart-total__main-price .changeable span').text(total);\n let deliveryCost = parseFloat($('.cart-total__delivery-price .value span').text()).toFixed(2);\n $('.cart-total__total-price .changeable span').text(+total + +deliveryCost);\n\n }", "title": "" }, { "docid": "813e07716019a38f9fd6695950b18e52", "score": "0.67250335", "text": "function thisGetUpdatedCart(cart) {\n changeUpdatedCart(cart, 'cart-info');\n}", "title": "" }, { "docid": "635bd8f47b4bc112b996c35a615b720c", "score": "0.6718028", "text": "function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information\n}", "title": "" }, { "docid": "635bd8f47b4bc112b996c35a615b720c", "score": "0.6718028", "text": "function updateCartPreview() {\n // TODO: Get the item and quantity from the form\n // TODO: Add a new element to the cartContents div with that information\n}", "title": "" }, { "docid": "e57bb487a1cd1499a3b44e5e11e8ce23", "score": "0.67133814", "text": "function addProduct(event) {\n const index = event.target.getAttribute(\"data-index\");\n cart[index].quantity++;\n localStorage.setItem(\"cameras\", JSON.stringify(cart));\n location.reload();\n }", "title": "" }, { "docid": "3b0029cb345ffc2bb8372132ad96a654", "score": "0.67022556", "text": "'click .cart-show' (event) {\n $(\".cart-hide\").show();\n $(\".cart-show\").hide();\n $(\".cart\").css('width','25%');\n $(\".cart\").css('height','auto');\n $(\".resume\").fadeIn(300);\n $(\".footer\").fadeIn(300);\n }", "title": "" }, { "docid": "992a36e6421a360ab3a8b7a537df6b35", "score": "0.6699441", "text": "handleSaveACart(event) {\n if (this.globals.loggedIn) {\n this.$refs.saveCartModal.open(event);\n } else {\n this.globals.setCookie('flow', 'cart');\n if (this.globals.siteConfig.isGuestList) {\n this.guestListName = this.i18n.guestList;\n } else {\n this.globals.navigateToUrl('login');\n globalEventBus.$emit(\n 'announce',\n 'For adding to list, you need to login',\n );\n setTimeout(() => {\n this.globals.navigateToUrl('login');\n }, 300);\n }\n }\n }", "title": "" }, { "docid": "4c913c86307a67951cfa51af9e7ea2e4", "score": "0.669715", "text": "addToCart() {\n this.cartService.prepareCartData(this.selectedProduct, this.selectedVariant, this.selectedQuantity);\n this.closeAddToCartModal();\n }", "title": "" }, { "docid": "4c913c86307a67951cfa51af9e7ea2e4", "score": "0.669715", "text": "addToCart() {\n this.cartService.prepareCartData(this.selectedProduct, this.selectedVariant, this.selectedQuantity);\n this.closeAddToCartModal();\n }", "title": "" }, { "docid": "4c913c86307a67951cfa51af9e7ea2e4", "score": "0.669715", "text": "addToCart() {\n this.cartService.prepareCartData(this.selectedProduct, this.selectedVariant, this.selectedQuantity);\n this.closeAddToCartModal();\n }", "title": "" }, { "docid": "40c81a2b74eec62383056afc6023a0c3", "score": "0.66835624", "text": "function setupCartFunctionality() {\n cartItemsDOM.addEventListener(\"click\", function (e) {\n const element = e.target;\n const parent = e.target.parentElement;\n const id = element.dataset.id;\n const parentID = parent.dataset.id;\n\n // remove\n if (element.classList.contains(\"cart-item-remove-btn\")) {\n removeItem(id);\n parent.parentElement.remove();\n }\n // decrease\n if (parent.classList.contains(\"cart-item-decrease-btn\")) {\n const newAmount = decreaseAmount(parentID);\n if (newAmount === 0) {\n removeItem(parentID);\n parent.parentElement.parentElement.remove();\n } else {\n parent.previousElementSibling.textContent = newAmount;\n }\n }\n // increase\n if (parent.classList.contains(\"cart-item-increase-btn\")) {\n const newAmount = increaseAmount(parentID);\n parent.nextElementSibling.textContent = newAmount;\n }\n\n displayCartItemCount();\n displayCartTotal();\n setStorageItem(\"cart\", cart);\n });\n}", "title": "" }, { "docid": "b7e2d7ee47e0c5ee7b681a7e9d6b5d83", "score": "0.6644753", "text": "function GetItemInfo(event) {\n var moustTarget = event.target//getting the target of the mouse click\n var selectedItem = moustTarget.parentElement.parentElement; //targeting the parent element\n var drinkName = selectedItem.getElementsByClassName('drink-name')[0].innerText;\n var drinkPrice = selectedItem.getElementsByClassName('drink-price')[0].innerText.replace(\"$\",\"\");\n var id = selectedItem.dataset.itemId;\n AddToCart(drinkName, drinkPrice, id);\n UpdateCart();\n}", "title": "" }, { "docid": "c96a51f7f48a764d9370c474d8944830", "score": "0.6628652", "text": "addC() {\r\n console.log(\"Cart\");\r\n }", "title": "" }, { "docid": "d77044523f90c5b428781cdcfbd1027b", "score": "0.6621646", "text": "function handleCartInfo(cartEvent) {\n console.log(\"submit cart form\");\n /**\n * When users click the submit button, the browser will not direct\n * users to the url defined in HTML form. Instead, it will call this\n * event handler when the event is triggered.\n */\n cartEvent.preventDefault();\n\n $.get(\n \"api/shoppingCart\",\n // Serialize the cart form to the data sent by POST request\n $(\"#cart\").serialize(),\n (resultDataString) => handleCartArray(resultDataString)\n );\n}", "title": "" }, { "docid": "63191bd45269a83ddfbe948ecc7c8e39", "score": "0.6612053", "text": "emit() {\n this.trigger(_cart);\n }", "title": "" }, { "docid": "1602a9a9b852488a9b04a70446b86ed3", "score": "0.6605871", "text": "function listCart(){\r\n\r\n}", "title": "" }, { "docid": "98729bcf3b7adb7a9bc2e5b8925874fd", "score": "0.65873253", "text": "*onEvent(name, data) {\n // when the event name is 'cartUpdated', we update the cart stored as a workflow property.\n // this allows you to change the workflow depending on the content of the cart if you want to.\n if (name === \"cartUpdated\") {\n this.cart = { ...this.cart, items: data.items };\n }\n // when the event name is 'checkout', we immediately terminate the workflow.\n if (name === \"checkout\") {\n // note: we could add notifications or some other tasks before terminating\n this.terminate();\n }\n }", "title": "" }, { "docid": "54c9cead726315131c888d9eb3b26427", "score": "0.6585727", "text": "function callingCart(){\n\tapiCart.getCart()\n\t\t.then(res => {\n\t\t\tproductos = res.data;\n\t\t\tcarrito.agregarCarrito(productos);\n\t\t\tloadProducts(productos);\n\t\t\tloadTotalProducts(productos, 1)\n\t\t})\n}", "title": "" }, { "docid": "764d9becfc98b367fb698c42ab0cab3b", "score": "0.65856063", "text": "cartHandler(item) {\n this.cart.push(item.id)\n this.props.onSetCart([...this.cart])\n this.cart = []\n }", "title": "" }, { "docid": "4cb2973faed4f78fd019c1bac7206de9", "score": "0.65742815", "text": "function add_to_cart_clicked(event) {\n var button = event.target\n var shop_item = button.parentElement.parentElement\n var image_src = shop_item.getElementsByTagName('img')[0].src\n var name = shop_item.getElementsByClassName('shop-item-name')[0].innerText\n var price = shop_item.getElementsByClassName('shop-item-price')[0].innerText\n\n add_item_to_cart(image_src, name, price)\n update_cart_total()\n}", "title": "" }, { "docid": "d0446183051f1ccaf8af7ed823604024", "score": "0.65719557", "text": "function updateCartPage() {\r\n let totalCount = 0;\r\n let subtotal = 0;\r\n let cartCount = 0;\r\n $(\".qty-cart\").each(function () {\r\n let skuId = $(this).attr(\"sku-id\");\r\n let price = $(`#price-${skuId}`).text();\r\n let total = parseInt($(this).val()) * parseInt(price);\r\n\r\n $(`#product-total-${skuId}`).text(total);\r\n subtotal += total;\r\n totalCount += parseInt($(this).val());\r\n cartCount += 1;\r\n });\r\n $(\".total-count\").text(totalCount);\r\n $(\".subtotal\").text(subtotal);\r\n $(\".total-price\").text(subtotal);\r\n $(\"#cart-count\").text(cartCount);\r\n }", "title": "" }, { "docid": "3d54743faacdbf966584da60b863890f", "score": "0.65705585", "text": "function addItemToCartClicked (event) {\n var button = event.target;\n var shopItem = button.parentElement;\n\n var title = shopItem.getElementsByClassName(\"shop-item-title\")[0].innerText;\n var price = shopItem.getElementsByClassName(\"shop-item-price\")[0].innerText;\n\n console.log(title, price);\n\n addItemToCart(title, price);\n updateCartTotal();\n\n}", "title": "" }, { "docid": "b03fd2da27e7b392184d5462b2c7b7f2", "score": "0.6568288", "text": "function handleQuantity(e, cart) {\n cart.quantity = e.target.value;\n cart.quantity = cart.deposit ? Math.abs(cart.quantity) : (-1 * Math.abs(cart.quantity));\n\n // Find the component in current order\n var i = _.findIndex(carts, function (item) {\n return item.component_id === cart.component_id;\n });\n\n // Update the component in the cookies\n carts.splice(i, 1, cart);\n cookies.set('order_details', carts, { maxAge: 86400 });\n }", "title": "" }, { "docid": "e7ea95d4276ef5ded54dde9ca824553e", "score": "0.65525115", "text": "eventHandlerDetalleShoppingCart(){\n\n // Suscribe al Evento Modal - Detalle del carrito\n $(\"#idCarrito\").click( buildItemsInShoppingCart ) ;\n\n // Suscribe al Evento Iniciar Compra\n $(\"#comprar\").click( iniciarCompra ) ;\n\n }", "title": "" }, { "docid": "23a0929b529224a21c81a92c1c3838f7", "score": "0.65424067", "text": "function addToCart(e) {\n\n let iconText = document.getElementById(\"shopping-cart-icon\").innerText;\n let productItem = createProductItem(e.value - 1, 1);\n\n \n if (getItemIndex(productItem.product.id) >= 0) {\n updateItemQuantityByIndex(getItemIndex(productItem.product.id), 1);\n } else {\n addItemToShoppingCart(productItem);\n document\n .getElementById(\"shopping-cart\")\n .appendChild(renderItem(productItem.product, productItem.quantity));\n document.getElementById(\"shopping-cart-icon\").innerText =\n Number(iconText) + 1;\n \n }\n}", "title": "" }, { "docid": "9ee5724703fe3653aae972527df95e24", "score": "0.6532326", "text": "async onUpdate() {\r\n\t\tthis.parseCart(await this.fetchCart());\r\n\t}", "title": "" }, { "docid": "e7d23c415d0cfa90cf6fdcf12c5df7b9", "score": "0.65254444", "text": "function initializeCartEvents(){\n\t\tvar modal = document.getElementById('cart-modal');\n\n\t\t// Get the button that opens the modal\n\t\tvar btn = document.getElementById(\"cart_btn\");\n\n\t\t// Get the <span> element that closes the modal\n\t\tvar span = document.getElementsByClassName(\"close\")[0];\n\t\t\n\t\t// When the user clicks the button, open the modal \n\t\tbtn.addEventListener(\"click\", function(){\t\t\t\n\t\t\tmodal.style.display = \"block\";\n\t\t});\n\t\t \n\t\t// When the user clicks on <span> (x), close the modal\n\t\tspan.addEventListener(\"click\", function(){\t\n\t\t\tmodal.style.display = \"none\";\n\t\t});\n\t\t\n\t\t// When the user clicks anywhere outside of the modal, close it\n\t\twindow.addEventListener(\"click\", function(event){\n\t\t if (event.target == modal) {\n\t\t modal.style.display = \"none\";\n\t\t }\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "b52f84771afa21bf9b941929c70610c0", "score": "0.65176237", "text": "function updateCartPreview() {\n console.log(\"function: updateCart\");\n var div= document.getElementById('cartContents');\n addElement('p', \"Items in cart: \" + cart.items[counter].product + \"(\" + cart.items[counter].quantity +\")\" , div);\n \n \n}", "title": "" }, { "docid": "c7edd7e50b1cecb9a6fce2ae12e645cc", "score": "0.6513462", "text": "function addToCart(e) {\n // Get the film to be added to the cart\n var film = $(e.target).closest('.film');\n // Create a new item with the name and price of the film\n var item = {};\n item.title = film.find('h3').text();\n item.price = film.find('.price').text();\n\n // Get the previously added items. If there are none, create new array\n var items;\n if(!(items = JSON.parse(Cookie.get(\"items\")))) {\n items = [];\n }\n // Add new item to the cart.\n items.push(item);\n Cookie.set(\"items\", JSON.stringify(items), 1);\n }", "title": "" }, { "docid": "5c1395d6da64cb89bff6e5d679bedcef", "score": "0.6511599", "text": "function addToCartClicked(event) {\n var button = event.target\n var shopItem = button.parentElement.parentElement\n var title = shopItem.getElementsByClassName('shop-item-title')[0].innerText\n var price = shopItem.getElementsByClassName('shop-item-price')[0].innerText\n var imageSrc = shopItem.getElementsByClassName('shop-item-image')[0].src\n //passes title, price annd img src\n addItemToCart(title, price, imageSrc)\n updateCartTotal()\n}", "title": "" }, { "docid": "372326b6ccb0a3cc6ce22c18b0211af1", "score": "0.6511043", "text": "function showCart() {\n let container = document.querySelector(\".cart\");\n container.innerHTML = \"\";\n cart = JSON.parse(mystorage.getItem(\"cart\"));\n cart.forEach((item) => {\n container.innerHTML += `\n \n <div>\n <h3 class=\"product-name\">${item.product_name}</h3>\n <h3 class=\"product-price\">${item.price}</h3>\n <button onclick=\"remove(${item.product_id})\" class=\"remove-btn text-bold\">Remove from Cart</button>\n <button onclick=\"calcuTotal(${item.product_id})\" class=\"remove-btn text-bold\"></button>\n </div>\n `;\n });\n}", "title": "" }, { "docid": "d9f54d267b3f8ff424099d44ac43ac37", "score": "0.6506502", "text": "function ready() {\n /*the loop below will loop through all the remove buttons inside the cart, \n add a click event to that button, which will then call the removecartitem function */\n let removeCartItembuttons = document.getElementsByClassName(\"Removebtn\");\n for (i = 0; i < removeCartItembuttons.length; i++) {\n let button = removeCartItembuttons[i];\n button.addEventListener(\"click\", removecartitem);\n }\n /*the loop below will loop through all the input value inside\n the cart, and a change event is added, which will call the quantitychanged function*/\n let quantityinputs = document.getElementsByClassName(\"cart-quantity-input\");\n for (i = 0; i < quantityinputs.length; i++) {\n let input = quantityinputs[i];\n input.addEventListener(\"change\", quantitychanged);\n }\n}", "title": "" }, { "docid": "ab5557fbd4cc99da074c4b6c5c7e4e01", "score": "0.650277", "text": "function addToCart(){\n $('body').delegate('.add-cart', 'click', function (e) {\n // get the attribute value of element with #add-cart id.\n var id = $(this).attr('data-id');\n\n // get the text (value) of selected quantity\n var qty = $('#qty :selected').text();\n \n if (!qty) {\n qty = 1;\n }\n\n var data = {\n _token: _token,\n _id: id,\n _qty: qty\n };\n\n //prevent form submission\n e.preventDefault();\n\n //Make ajax request to a specific url\n makeAJAXRequest(\n '/cart/add',\n 'POST',\n data,\n function (res) {\n addCartSuccess(res)\n },\n function(res){\n if(res.status == 422){\n makeToast(\"Invalid product please refresh the page!\");\n }\n }\n )\n })\n}", "title": "" }, { "docid": "5e2f47f9a8cfe26676565b50da6ba5d0", "score": "0.64980453", "text": "function updateCartPreview(event) {\n var liElement = document.createElement('li');\n liElement.textContent = event.target.quantity.value + event.target.item.value;\n ulElement.appendChild(liElement);\n // X TODO: Get the item and quantity from the form\n // X TODO: Add a new element to the cartContents div with that information\n}", "title": "" }, { "docid": "084583ef0e5490e53044528659322960", "score": "0.6494569", "text": "constructor() {\n this._bindEvents();\n Model.initCart();\n }", "title": "" }, { "docid": "7302653e40487471728bb8283599ba67", "score": "0.64921683", "text": "function renderCart() {\n logger.info('HEADER RENDERING BASKET CHANGES');\n logger.secureLog(JSON.stringify(currentBasket.toJSON()));\n\n var productItems = currentBasket.getProductItems();\n var numItems = 0;\n _.each(productItems, function(productItem) {\n numItems += productItem.getQuantity();\n });\n var totalPrice = currentBasket.getOrderTotal() || currentBasket.getProductTotal();\n if (currentBasket.getOrderNo() && currentBasket.getOrderNo() !== 'null') {\n totalPrice = currentBasket.calculateBalanceDue();\n }\n var padding = '';\n if (numItems < 10) {\n padding = ' ';\n } else if (numItems < 100) {\n padding = ' ';\n }\n $.product_items_count.setText(padding + numItems);\n if (numItems == 0) {\n $.cart_label.setText(toCurrency(0));\n } else {\n $.cart_label.setText(toCurrency(totalPrice));\n }\n adjustCartLabel();\n}", "title": "" }, { "docid": "09a2c8b92dbd022a5968e8927642f9d8", "score": "0.64854777", "text": "deleteCartItem(itemNumber, event) {\n // sending the data to Google Analytics on delete icon click\n if (typeof dataLayer !== 'undefined') {\n const analyticsObject = {\n code: this.productData.product.code,\n name: this.productData.product.name,\n quantity: this.productData.quantity,\n };\n this.analyticsService.trackRemoveFromCart(analyticsObject);\n }\n this.manageShoppingCartService.deleteCartItem(\n {},\n this.handleDeleteCartItemResponse,\n this.handleDeleteCartItemError,\n itemNumber,\n );\n this.$refs.spinner.showSpinner();\n // sending data to yMarketing on delete icon click\n const cartData = {\n cartCode: this.globals.getCartGuid(),\n productCode: this.productData.product.code,\n productName: this.productData.product.name,\n productPrice: this.productData.totalPrice.value,\n };\n this.yMarketing.trackRemoveFromCart(\n this.productData.product.code,\n this.productData.quantity,\n cartData,\n );\n }", "title": "" }, { "docid": "69410b0f866f7cffb5e750377e5e98cb", "score": "0.6480601", "text": "cartLogic() {\n // When Clear Cart Button is clicked\n clearCartBtn.addEventListener('click', () => {\n this.clearCart();\n })\n\n // When Cart Content is Clicked\n cartContent.addEventListener('click', event => {\n // When remove/trash button is clicked for each item in the cart\n if (event.target.parentElement.classList.contains('remove-item')) {\n let removeItem = event.target.parentElement;\n this.removeItem(removeItem.dataset.id);\n // Clearing the cart in DOM\n cartContent.removeChild(removeItem.parentElement.parentElement);\n this.showCart();\n }\n // When Chevron-up is clicked\n else if (event.target.classList.contains('fa-chevron-up')) {\n let addAmount = event.target;\n let id = addAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n tempItem.amount++;\n Storage.saveCart(cart);\n this.setCartValues(cart);\n addAmount.nextElementSibling.innerText = tempItem.amount;\n }\n // When Chevron-down is clicked\n else if (event.target.classList.contains('fa-chevron-down')) {\n let subAmount = event.target;\n let id = subAmount.dataset.id;\n let tempItem = cart.find(item => item.id === id);\n if (tempItem.amount > 1) {\n tempItem.amount--;\n }\n Storage.saveCart(cart);\n this.setCartValues(cart);\n subAmount.previousElementSibling.innerText = tempItem.amount;\n }\n\n\n });\n }", "title": "" }, { "docid": "e1b83aaa5431ae447bc9a4efeaec3cb4", "score": "0.64792573", "text": "function proceedToCartCheckout(){\n\t\tif(cartItems.length == 0){\n\t\t\tshowPopupMessage(\"error\", \"Add items to cart before checkout!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar checkout_url = window.location.protocol + \"//\" + window.location.hostname + \":\" + window.location.port + contextPath + \"/checkout?type=cart\";\n\t\twindow.location.href = checkout_url;\n\t}", "title": "" }, { "docid": "5669a63f8c32439d932c36089f3d2e50", "score": "0.64679563", "text": "_cartChange() {\n if (DEBUG) {\n console.log('[*] ' + _name + ':_cartChange ---');\n }\n\n var cart = getCartState();\n var message = getCartMessage();\n var cartItems = [];\n var checkout = null;\n\n if (message) {\n Materialize.toast(message, AppConfig.messageDelay);\n }\n\n if (cart.CartItems) {\n cartItems = cart.CartItems;\n }\n\n if (cart.Checkout) {\n checkout = cart.Checkout;\n }\n\n this.setState({\n cart: cart,\n cartItems: cartItems,\n checkout: checkout\n });\n }", "title": "" }, { "docid": "9527694c2725a1c7a708956fa7e7485e", "score": "0.64621884", "text": "function ready() {\n var removeCartItemButtons = document.getElementsByClassName('btn-danger')\n for (var i = 0; i < removeCartItemButtons.length; i++) {\n var button = removeCartItemButtons[i]\n button.addEventListener('click', removeCartItem)\n }\n\n /* QuantityInputs is to be able change the amount of items in the shopping cart, such as 10 headsets or 10 speakers. */\n var quantityInputs = document.getElementsByClassName('cart-quantity-input')\n for (var i = 0; i < quantityInputs.length; i++) {\n var input = quantityInputs[i]\n input.addEventListener('change', quantityChanged)\n }\n /* AddToCartButtons is to add items to the shopping cart*/\n var addToCartButtons = document.getElementsByClassName('shop-item-button')\n for (var i = 0; i < addToCartButtons.length; i++) {\n var button = addToCartButtons[i]\n button.addEventListener('click', addToCartClicked)\n }\n\n document.getElementsByClassName('btn-purchase')[0].addEventListener('click', purchaseClicked)\n}", "title": "" }, { "docid": "2d6c7af05a631eeb2cf3c3e989ff5776", "score": "0.64580154", "text": "function addListeners(){\n $(\".delete-btn\").click(function(){\n var uid = $(this).attr(\"data-uid\");\n if (uid) {\n var cart = getCartFromStorage();\n cart = cart.filter( x => x.uid !== uid);\n saveCartToStorage(cart);\n $(`[data-item-uid=\"${uid}\"]`).remove();\n renderCartPrice();\n renderCartBadge();\n }\n });\n }", "title": "" }, { "docid": "a65f075a039f9d3b570409785f90b152", "score": "0.64527094", "text": "getCartBtns(){\r\n const addCartBtns = [...document.querySelectorAll('.addcartbtn')];\r\n buttonsDOM = addCartBtns;\r\n // for each button check whether the item associated with the button was added to the cart using id of the product \r\n // if else add an event listener to the button to check for click event\r\n buttonsDOM.forEach( button =>{\r\n let id = button.dataset.id;\r\n let inCart = cart.find(item => item.id === id);\r\n if(inCart){\r\n button.innerText = \"in cart\";\r\n button.disabled = true;\r\n }\r\n button.addEventListener('click' , event => {\r\n event.target.innerText = \"in cart\";\r\n event.target.disabled = true;\r\n //get the added product from products\r\n let cartItem = {...Storage.getProduct(id) , count: 1};\r\n //add each product to the cart\r\n cart = [...cart,cartItem];\r\n // console.log(cart);\r\n //save cart in local storage\r\n Storage.saveCart(cart);\r\n //set cart values(total amount of items and total items on nav)\r\n this.setCartValues(cart);\r\n //display cart items on cart\r\n this.addCartItem(cartItem);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "9c5ef503608f236ac5ea92f994a4e421", "score": "0.64507186", "text": "function goToCart(){\n event.preventDefault();\n $(\"#cart\").css(\"display\",\"block\");\n $(\"#delivery\").css(\"display\",\"none\");\n }", "title": "" }, { "docid": "c86ff84c0822c68cfc07c6143db06c59", "score": "0.6448255", "text": "function onAddToCart(response) {\n btnCheckCodeAndCartDisabled(false);\n\n if (response) {\n const isUnsoldExist = matchExistingProductCode(response);\n if (isUnsoldExist) return;\n }\n\n //add to cart\n if (document.activeElement.id !== \"btnAddToList\") return;\n\n //get code list\n const { codes } = addedCodeList();\n\n const PurchaseList = serializeForm(formProductInfo);\n PurchaseList.ProductCatalogName = selectCategory.options[selectCategory.selectedIndex].text;\n PurchaseList.ProductName = selectProductId.options[selectProductId.selectedIndex].text;\n PurchaseList.ProductStocks = [];\n\n //check product is added\n const isAdded = cartStorage.some(item => +item.ProductId === +PurchaseList.ProductId);\n\n if (isAdded) {\n const index = cartStorage.findIndex(item => +item.ProductId === +PurchaseList.ProductId);\n PurchaseList.ProductStocks = cartStorage[index].ProductStocks;\n PurchaseList.AddedProductCodes = cartStorage[index].AddedProductCodes;\n PurchaseList.PurchaseListId = cartStorage[index].PurchaseListId;\n\n codes.forEach(code => {\n if (PurchaseList.ProductStocks.indexOf(code) === -1) {\n //update new code\n PurchaseList.ProductStocks.push({\n ProductStockId: 0,\n ProductCode: code,\n IsSold: false,\n isRemove: false,\n isNew: true\n });\n }\n });\n\n PurchaseList.Quantity = PurchaseList.ProductStocks.filter(item => !item.isRemove).length;\n cartStorage[index] = PurchaseList;\n\n renderTable();\n appendTotalPrice();\n updateCalculation();\n\n //reset\n inputBinding({}, true);\n\n btnCheckCodeAndCartDisabled(true);\n return;\n }\n\n //add to store \n codes.forEach(code => {\n //update new code\n PurchaseList.ProductStocks.push({\n ProductStockId: 0,\n ProductCode: code,\n IsSold: false,\n isRemove: false,\n isNew: true\n });\n });\n\n PurchaseList.Quantity = PurchaseList.ProductStocks.length;\n PurchaseList.PurchaseListId = 0;\n\n cartStorage.push(PurchaseList);\n\n //append new row\n tbody.appendChild(createRow(PurchaseList));\n\n appendTotalPrice();\n updateCalculation();\n\n //reset\n inputBinding({}, true);\n\n btnCheckCodeAndCartDisabled(true);\n }", "title": "" }, { "docid": "fd659699c42b3014ff2bf4b424434cf2", "score": "0.6441071", "text": "poppulateCart(cart){\r\n cart.forEach(item => this.addCartItem(item));\r\n }", "title": "" }, { "docid": "c99dffcc2914cc3f00b29e8f20db315c", "score": "0.64332396", "text": "function ready() {\n cartSlide();\n paketButtons();\n removeCartItem();\n quantityInput();\n clickAddToCart();\n purchase();\n}", "title": "" }, { "docid": "0c476a8cceda666b6f9ffc2832e16d51", "score": "0.64313143", "text": "function addToShoppingCart(event) {\n if (event.target.classList.contains(\"foodButton\")) {\n // cart.push(\"clicked\");\n let i = event.target.getAttribute(\"index\");\n cart.push(foodItems[i]);\n console.log(cart);\n display();\n getTotal();\n getTotalCard();\n }\n}", "title": "" }, { "docid": "49bd78155920cbaa96c9905736ec9030", "score": "0.64205015", "text": "cartUpdateLogic() {\n // to clear all the items in the cart\n clearCartBtn.addEventListener(\"click\", () => {\n const cartItemIds = cart.map((item) => {\n return item.id;\n });\n cartItemIds.forEach((id) => {\n this.removeCartItem(id);\n });\n while (cartContent.children.length > 0) {\n cartContent.removeChild(cartContent.children[0]);\n }\n DisplayCart.hideCart();\n });\n\n // to remove a single item using \"remove\" button &\n // to increase the quantity using \"up\" arrow button &\n // to decrease the quantity using \"down\" arrow button\n cartContent.addEventListener(\"click\", (event) => {\n if (event.target.classList.contains(\"remove-item\")) {\n const id = event.target.dataset.id;\n this.removeCartItem(id);\n cartContent.removeChild(event.target.parentElement.parentElement);\n } else if (event.target.classList.contains(\"fa-chevron-up\")) {\n const id = event.target.dataset.id;\n const selectedItem = cart.find((cartItem) => {\n return cartItem.id === id;\n });\n selectedItem.quantity += 1;\n DisplayCart.getCartValues(cart);\n Storage.addCartLocal(cart);\n event.target.nextElementSibling.innerText = selectedItem.quantity;\n } else if (event.target.classList.contains(\"fa-chevron-down\")) {\n const id = event.target.dataset.id;\n const selectedItem = cart.find((cartItem) => {\n return cartItem.id === id;\n });\n selectedItem.quantity = selectedItem.quantity - 1;\n if (selectedItem.quantity > 0) {\n Storage.addCartLocal(cart);\n DisplayCart.getCartValues(cart);\n event.target.previousElementSibling.innerText = selectedItem.quantity;\n } else {\n this.removeCartItem(id);\n cartContent.removeChild(event.target.parentElement.parentElement);\n if (cartContent.children.length < 1) {\n DisplayCart.hideCart();\n }\n }\n }\n });\n }", "title": "" }, { "docid": "facd900e01cdb68de0e28852b0a2f480", "score": "0.6408377", "text": "function displayCartTotal() {\n let currentCartCost = localStorage.getItem(\"totalCostofItems\");\n currentCartCost = Number(currentCartCost);\n let addItemToCart = document.querySelectorAll(\".addToCart\");\n\n /* Using a for loop to add click events to all HTML elements with the 'addToCart'class and then am displaying an alert\n with the current cart total. */\n\n for (i = 0; i < addItemToCart.length; i++) {\n addItemToCart[i].addEventListener(\"click\", () => {\n location.reload();\n alert(\n \"Your current total is: R\" +\n currentCartCost +\n \" excluding Vat. Navigate to the cart page to see the total cost including vat.\"\n );\n });\n }\n}", "title": "" }, { "docid": "5b0191d6f63dd398dcfc5718ef891d39", "score": "0.6400143", "text": "function setCart(data) {\n if (data.CART == null) {\n //Messaggio carrello vuoto\n let text = '<div class=\"row\" style=\"justify-content: center\">' +\n '<div class=\"alert alert-info alert-dismissible\" role=\"alert\">' +\n '<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>Il tuo carello è vuoto, aggiungi prodotti da <a href=\"#\" data-toggle=\"modal\" data-target=\"#productsModal\" onclick=\"$(\\'#allGroup button\\').click();\">qui</a></div></div>';\n $('#cart-message-alert').append(text);\n $('#subTotal').html(\"\");\n $('#payOrder').html(\"\");\n } else {\n $('#subTotal').html('<p>Numero prodotti: '+parseInt(data.PRODUCTNUMBER)+'</p>' +\n '<h2>Totale: '+ parseInt(data.TOTAL).toFixed(2) + '€</h2>');\n let onclickaction=data.INSITE===true?\"initializeOrderCheckout()\":\"notInSite()\";\n $('#payOrder').html(\"<input type=\\\"button\\\" class=\\\"btn-lg btn-primary\\\" id=\\\"orderCheckout\\\" onclick=\\\"\"+onclickaction+\"\\\" value=\\\"Conferma e ordina\\\">\");\n $.each(data.CART, function(key, val){\n let note=val.note===\"null\"?\"\":val.note;\n text='<tr>'+\n '<th scope=\"row\">'+zeropadInt(val.barcode,3)+'</th>' +\n '<td>'+val.name+'</td>'+\n '<td>'+val.category+'</td>'+\n '<td><div id=\\'productQtyForm'+val.barcode+'\\'>\\n' +\n ' <input id=\"productQtyMinus'+val.barcode+'\" onclick=\\\"quantityMinus('+val.barcode+')\\\" type=\\'button\\' value=\\'-\\' class=\\'qtyminus btn btn-danger\\' field=\\'quantity\\' style=\"border-radius: 0.5rem\"/>\\n' +\n ' <input id=\"productQty'+val.barcode+'\" type=\\'text\\' name=\\'quantity\\' value=\\''+val.quantity+'\\' class=\\'qty text-center align-middle\\' style=\"max-width: 25%\" readonly/>\\n' +\n ' <input id=\"productQtyPlus'+val.barcode+'\" onclick=\\\"quantityPlus('+val.barcode+')\\\" type=\\'button\\' value=\\'+\\' class=\\'qtyplus btn btn-success\\' field=\\'quantity\\' style=\"border-radius: 0.5rem\"/>\\n' +\n ' </div></td>'+\n '<td>'+parseInt(val.price).toFixed(2)+'€</td>'+\n '<td>'+note+'</td>'+\n '</tr>';\n $('#productsRow').append(text);\n });\n }\n}", "title": "" }, { "docid": "9ca6a6c6c4f1a0ceb9644a8e40d8fa4f", "score": "0.6396718", "text": "function addProduct(pid){\r\n //add item into cart\r\n cart.add(pid, 1);\r\n //update cart\r\n showCart();\r\n}", "title": "" } ]
200d4d3691f2608fe8df416dc8d4f7ec
Save Calls Tab 1. Appraisal Form Call. Update Form Status When Appraise open form First Time
[ { "docid": "ce6b65b8b740e275d674fc0492429dea", "score": "0.6655586", "text": "function UpdateFormStatusFormOpen() {\n var JsonObject = {\n empAppraisalSettingId: $(\"#hdnEmpAppraisalSettingId\").val()\n };\n calltoAjax(misApiUrl.changeAppraisalFormStatusToNextLevel, \"POST\", JsonObject,\n function (result) {\n BindMyAppraisal();\n });\n}", "title": "" } ]
[ { "docid": "403b0201c762f6e8f97cc60ab62c2005", "score": "0.62334234", "text": "function callBackFunction() {\n\n if (g_scratchpad.clicked !== \"false\") {\n if (g_form.getValue(\"u_call_back_count\") == \"0\") {\n g_form.setValue(\"u_call_back_count\", 1);\n } else {\n g_form.setValue(\"u_call_back_count\", (parseInt(g_form.getValue(\"u_call_back_count\")) + 1));\n }\n } else {\n\t\tg_form.showFieldMsg(\"u_call_back_count\",\"Increment count by 1 only, before saving.\", \"error\");\n }\n\t\n g_scratchpad.clicked = \"false\";\n}", "title": "" }, { "docid": "9aae359fd16630b895aac54ae8e6fe55", "score": "0.6194199", "text": "formSave() {\n $(document).off('click', '#form-save');\n $(document).on('click', '#form-save', $.proxy(function(){\n //convert form to json object\n var formInJSON = save.saveData(\".\"+this.options.subElement);\n\n var title = formInJSON.title;\n //if sid on the url params then it will become the filename of the editor\n if (\"sid\" in this.params && this.params.sid !== undefined) {\n title = this.params.sid;\n }\n //options for the pcapi\n var options = {\n remoteDir: \"editors\",\n path: encodeURIComponent(title)+\".json\",\n data: JSON.stringify(formInJSON)\n };\n\n //check if the survey is public\n if(this.params.public === 'true'){\n options.urlParams = {\n 'public': 'true'\n };\n }\n\n //store the form to pcapi\n pcapi.updateItem(options).then(function(result){\n utils.giveFeedback(\"Your form has been saved successfully\");\n });\n\n }, this));\n }", "title": "" }, { "docid": "4af7f5ec5e4152e3881fcfb320d2b5a2", "score": "0.6191341", "text": "function Save() {\n if ($('#ab062sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab062sg\",vm.ab062sg).then(function (data) {\n notify.showMessage('success', \"ab062sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab062sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab062sg\", vm.ab062sg).then(function (data) {\n notify.showMessage('success', \"ab062sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab062sg/\";\n });\n }\n }\n }", "title": "" }, { "docid": "5ac409b600bcaac61676164ef192ee0e", "score": "0.61889464", "text": "function ui_save_form()\n{\n var run_obj = get_run_from_form();\n if( run_obj.id == -1 )\n {\n append_db( run_obj );\n }\n else\n {\n update_db( run_obj );\n }\n\n load_run_to_form( default_run );\n save_db();\n draw_list();\n}", "title": "" }, { "docid": "20d17130c969318af810e202135e61ad", "score": "0.6047553", "text": "function save() {\n\n if (SP.UI.ModalDialog.get_childDialog()) {\n scope.dialogResult = SP.UI.DialogResult.OK;\n }\n\n return scope.formCtrl.save();\n\n }", "title": "" }, { "docid": "0bce5af44af1271fdef84488ced62425", "score": "0.60048765", "text": "function onSave() {\n vm.submitted = true;\n var goalForm = $scope.$$childHead.goalForm;\n if (goalForm.$valid) {\n $ionicHistory.goBack();\n }\n }", "title": "" }, { "docid": "56673e54d3b17d510952f5c1ed69d656", "score": "0.5961122", "text": "function refresh()\n{\n \n debugger;\n var save = true;\n savepopup();\n if(save)\n {\n savefields();\n }\n pageid = pageid;\n initPage();\n}", "title": "" }, { "docid": "76a3d55ef539c24920c8f20d171ad683", "score": "0.5961066", "text": "function save(){//保存方法\r\n\t\t var form = formPanel.getForm();\r\n\t\t if (form.isValid()) {\r\n\t\t \t\tif (me.isAdd) {//新增\r\n\t\t \t\t\tFHD.submit({form:form,url:addUrl,callback:function(data){grid.store.load()}});//参数依次为form,url,callback\r\n\t\t \t\t} else {//更新\r\n\t\t \t\t\tFHD.submit({form:form,url:updateUrl,callback:function(data){grid.store.load()}});//参数依次为form,url,callback\r\n\t\t \t\t}\r\n\t\t \t\tme.close();\r\n\t\t \t\tgridList.treeComboxStore.load();\r\n\t\t \t}\r\n\t\t \r\n\t\t }", "title": "" }, { "docid": "26dce821fe2cbc9cede3dad37a0e7bb3", "score": "0.59577787", "text": "function save() {\n $rootScope.$broadcast(\"modal:blockAllOperations\");\n FinanceCubeFormulaPageService.save($scope.financeCube);\n }", "title": "" }, { "docid": "b0067cc14d2cd4e8fa0ba7036e2708b2", "score": "0.59505", "text": "save(form) {\n if (!form.valid)\n return;\n this.formDataService.setWork(this.workType);\n let firstState = this.workflowService.getFirstInvalidStep(STEPS.work);\n this.router.navigate(['address'], { relativeTo: this.route.parent, skipLocationChange: true });\n }", "title": "" }, { "docid": "45a43738553b0fe639a4668fe596071c", "score": "0.590095", "text": "function fnSave() {\n jQuery.ajax({\n type: 'POST',\n url: bittionUrlProjectAndController + 'fnSave',\n dataType: 'json',\n data: {\n data: jQuery('#InvProductSaveWithRecipeForm').bittionSerializeObjectJson()\n },\n success: function (response) {\n if (response['status'] === 'SUCCESS') {\n bittionShowGrowlMessage(response['status'], response['title'], response['content']);\n if(InvProductId.val() == \"\"){\n window.history.pushState('obj', 'newtitle', bittionUrlAction+'/id:'+response['data']['id']);\n }\n InvProductId.val(response['data']['id']);\n InvProductId2.val(response['data']['id']);\n } else {\n bittionShowGrowlMessage(response['status'], response['title'], response['content']);\n }\n },\n error: function (response, status, error) {\n bittionAjaxErrorHandler(response, status, error);\n }\n });\n }", "title": "" }, { "docid": "5a4d1dfb0fe60d529455d2f6d93d3b1f", "score": "0.58729756", "text": "function setGameStatus(objForm) {\n\tdocument.getElementById(\"game_status_note\").innerHTML = \"Please Wait...\";\n\tobjForm.submit();\n}", "title": "" }, { "docid": "23428316d5a228b31ccd74beed4391ea", "score": "0.58640236", "text": "function cust_process_saveAs()\r\n{\r\n\tif ($(\"#cust_saveas_screen_ref_\" + _pageRef).val() === \"\"\r\n\t\t\t|| $(\"#cust_saveas_screen_name_\" + _pageRef).val() === \"\")\r\n\t{\r\n\t\t_showErrorMsg(missing_elt_msg_key, error_msg_title);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t_showProgressBar(true);\r\n\t//set pageref Hidden input\r\n\t$(\"#cust_saveas_pageref_\" + _pageRef).val(_pageRef);\r\n\tvar theForm = $(\"#custSaveAsForm_\"+_pageRef).serializeForm();\r\n\t $.ajax({\r\n\t\t url: jQuery.contextPath+\"/path/customization/CustomizationMaint_updateSaveAsChanges\",\r\n type:\"post\",\r\n\t\t dataType:\"json\",\r\n\t\t data: theForm,\r\n\t\t success: function(data)\r\n\t\t \t\t{\r\n\t\t\t \t\tif(typeof data[\"_error\"] == \"undefined\" || data[\"_error\"] == null)\r\n\t\t\t \t\t{\r\n\t\t\t \t\t\t_showErrorMsg(record_was_Updated_Successfully_key,info_msg_title);\r\n\t\t\t \t\t\tvar newScreenRef = $(\"#cust_saveas_screen_ref_\" + _pageRef).val();\r\n\t\t\t \t\t\tvar newScreenName = $(\"#cust_saveas_screen_name_\" + _pageRef).val();\r\n\t\t\t \t\t\tif($(\"#cust_saveas_dupParent_\"+_pageRef).is(\":checked\"))\r\n\t\t\t \t\t\t{\r\n\t\t\t \t\t\t\tnewScreenName = $(\"#cust_saveas_screen_parent_name_\" + _pageRef).val()+ \" / \"+newScreenName;\r\n\t\t\t \t\t\t}\r\n\t\t\t \t\t\t$(\"#cust_save_as_div_\"+_pageRef).dialog(\"close\");\r\n\t\t\t \t\t\taccordionReloadMenuItem(data[\"custCO\"].screenParentRef);\r\n\t\t\t \t\t\t// loading newly saved as page\r\n\t\t\t \t\t\tvar parentOfScreenParentRef = data[\"custCO\"].parentOfScreenParentRef;\r\n\t\t\t \t\t\tsetTimeout(function() \r\n\t\t\t \t\t\t\t\t{ addMenuTab(data[\"custCO\"].screenRef,newScreenName,save_as_app_name,parentOfScreenParentRef);\r\n\t\t\t\t \t\t\t\t\t// to enable customization directly after loading the new save as page\r\n\t\t\t\t \t\t\t\t\t// need to be moved to call back method of addMeuTab\r\n\t\t\t\t \t\t\t\t\tsetTimeout(function() {enableCustConfiguration(document.getElementById(\"config_icon\"));\r\n\t\t\t\t \t\t\t\t\t\t_showProgressBar(false);\r\n\t\t\t\t \t\t\t\t\t}\r\n\t\t\t\t \t\t\t\t\t,2000);\r\n\t\t\t \t\t\t\t\t},1000);\r\n\t\t\t \t\t}\r\n\t\t\t \t\telse\r\n\t\t\t \t\t{\r\n\t\t\t \t\t\t_showProgressBar(false);\r\n\t\t\t \t\t}\r\n\t\t\t \t\t\r\n\t\t\t \t}\r\n\t\t });\r\n}", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.58202463", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.58202463", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "67cf1c11e357c666b381524577408535", "score": "0.58202463", "text": "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "title": "" }, { "docid": "474731a874a1f6d178c0981db7e17750", "score": "0.58110404", "text": "function BtnProcessApplyClick(){\n SaveProcess(); \n}", "title": "" }, { "docid": "d73e9cacfa295ee4d7437ee150e0bfd5", "score": "0.58075666", "text": "function saveFormChanges() {\n validateFunction();\n // Print that we got here\n console.log(\"Saving Changes\");\n }", "title": "" }, { "docid": "d39b39efa967b16a598bd017752be609", "score": "0.58040684", "text": "function _updateSuccess() {\n\t\t\t\taccount.btnSaved = true;\n\t\t\t\taccount.btnSaveText = 'Saved!';\n\n\t\t\t\t$timeout(_btnSaveReset, 2500);\n\t\t\t}", "title": "" }, { "docid": "e9005a9104e3d62d703087f2db3c63ee", "score": "0.58007383", "text": "function submitFrmCT(act)\r\n{\r\n var parentDocViewId = getval('parentDocViewId');\r\n var formData = \"\";\r\n\r\n if (parentDocViewId == null || parentDocViewId == 'undefined' || parentDocViewId == '')\r\n {\r\n\t var htmlAreaObj = _getWorkAreaDefaultObj();\r\n\t var objAjax = htmlAreaObj.getHTMLAjax();\r\n\t var objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\r\n\t var radioval=get_radio_value();\r\n\r\n\t formData += \"ViewBy=\" + radioval + \"&\";\r\n\r\n\t if(radioval=='ByField')\r\n\t {\r\n\t var doc_level= document.getElementById(\"doc_level\");\r\n\t if(doc_level!=null)\r\n\t {\r\n\t var selecteddoc_level=doc_level.options[doc_level.selectedIndex].value;\r\n\t formData += \"doc_level=\" + selecteddoc_level + \"&\";\r\n\t }\r\n\r\n\t var doc_field= document.getElementById(\"doc_field\");\r\n\t if(doc_field!=null)\r\n\t {\r\n\t //tracker# 13470 BY FIELD DOES NOT WORK IN CHANGE TRACKING\r\n\t //Checking if there are any fields at this level.\r\n\t if(doc_field.options.length > 0)\r\n\t {\r\n\t var selecteddoc_field=doc_field.options[doc_field.selectedIndex].value;\r\n\t formData += \"doc_field=\" + selecteddoc_field + \"&\";\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t formData = formData.substr(0,(formData.length - 1));\r\n\t var url = \"changetrackviewerplm.do?method=\"+act+\"&ajaxcall=y\";\r\n\t testurl(url,formData);\r\n\t if(act=='doc_level')\r\n\t {\r\n\t var url = \"changetrackviewerplm.do?method=view&ajaxcall=y\";\r\n\t testurl(url,formData);\r\n\t }\r\n\t}\r\n //Tracker#: 19238 F2J. CHANGE TRACKING ON COMPETENCIES DOCUMENT\r\n //Tracker#: 18917 F4L - CHANGE TRACKING ON CAPACITY DOCUMENT\r\n\telse if (parentDocViewId == '132' || parentDocViewId == '5800' || parentDocViewId == '155'\r\n\t || parentDocViewId == '3303' || parentDocViewId == '4200' || parentDocViewId == '2900'\r\n\t\t || parentDocViewId == '3500' || parentDocViewId == '6000' || parentDocViewId == '3400'\r\n\t\t || parentDocViewId == '2406' || parentDocViewId == '6800' || parentDocViewId == '6801' || parentDocViewId == '7000' \r\n \t || parentDocViewId == '7300' || parentDocViewId == 212 || parentDocViewId == '321' || parentDocViewId == '6304')\r\n\t \t{\r\n\t\tformData += \"search=\" + document.getElementById(\"search\").value + \"&\";\r\n\t\tformData += \"timeSelector=\" + getSelDropDownValue(\"timeSelector\") + \"&\";\r\n\t\tformData += \"sectionSelector=\" + getSelDropDownValue(\"sectionSelector\") + \"&\";\r\n\t\tformData += \"orderBy=\" + getSelDropDownValue(\"orderBy\") + \"&\";\r\n\t\tformData += \"parentDocViewId=\" + document.getElementById(\"parentDocViewId\").value;\r\n\r\n\t\tvar url = \"changetrackviewerplm.do?method=\"+act+\"&ajaxcall=y\";\r\n\t\ttesturl(url,formData);\r\n\t}\r\n}", "title": "" }, { "docid": "92ac75f03d26c3bbaf410287e31fd03e", "score": "0.57861614", "text": "function MDEC_Save(){\n console.log(\" === MDEC_Save =====\") ;\n console.log( \"mod_MEX_dict: \", mod_MEX_dict);\n\n if(permit_dict.permit_crud && permit_dict.requsr_role_admin){\n\n const upload_dict = {\n table: \"duo_exam\",\n mode: ((mod_MEX_dict.is_addnew) ? \"create\" : \"update\"),\n\n exam_pk: mod_MEX_dict.exam_pk,\n examyear_pk: mod_MEX_dict.examyear_pk,\n depbase_pk: mod_MEX_dict.depbase_pk,\n lvlbase_pk: mod_MEX_dict.lvlbase_pk,\n\n examtype: \"duo\",\n exam_pk: mod_MEX_dict.exam_pk,\n\n subject_pk: mod_MEX_dict.sel_subject_pk,\n subject_code: mod_MEX_dict.sel_subject_name,\n\n examperiod: mod_MEX_dict.examperiod,\n version: el_MDEC_input_version.value,\n secret_exam: el_MDEC_checkbox_secret_exam.checked,\n };\n UploadChanges(upload_dict, urls.url_exam_upload);\n };\n\n// --- hide modal\n $(\"#id_mod_duo_exam_create\").modal(\"hide\");\n }", "title": "" }, { "docid": "ec9578251657d1ec5d4bc41ecb4d0ad1", "score": "0.5780997", "text": "async function saveButtonClicked() {\n await update(activeId, activeName, activeHTML);\n // await update(active._id, active.name, active.html);\n fetchedData();\n }", "title": "" }, { "docid": "80262b5e50ea8ac6c1c0fb717adb47be", "score": "0.5780477", "text": "function save() {\n if (!validateCheckIn()) {\n return;\n }\n if (posting) {\n return;\n }\n $('#pleaseWaitDialog').modal();\n posting = true;\n var visitInfo = getFormData('edit_visit_info');\n console.log(\"Posting with params: \" + JSON.stringify(visitInfo));\n\n var jqxhr = $.post('/api/participant/visit', visitInfo);\n jqxhr.done(function(data) {\n posting = false;\n console.log(\"received response for POST: \" + JSON.stringify(data));\n\n if (data.status === \"OK\") {\n alerts.showSuccessMsg(\"Successfully updated Ashram Visit information.\");\n var participantId = visitInfo[\"participantId\"];\n //console.log(\"Ashram visit info for participant id: \" + participantId + \" is: \" + JSON.stringify(cachedAshramVisitsPerParticipant[participantId]));\n cachedAshramVisitsPerParticipant[participantId] = visitInfo;\n //console.log(\"Updated that with \" + JSON.stringify(visitInfo));\n setGroupItemClassPerCheckInStatus();\n } else {\n if (data.status_message && data.status_message.length > 0) {\n alerts.showWarningMsg(data.status_message);\n }\n }\n });\n\n jqxhr.fail(function() {\n posting = false;\n render(\"#search\");\n $('#pleaseWaitDialog').modal('hide');\n parseAjaxFailureMessageAndAlert(jqxhr);\n });\n\n $.when(jqxhr).done(function() {\n render(\"#search\");\n $('#pleaseWaitDialog').modal('hide');\n });\n }", "title": "" }, { "docid": "f1aae84ede578c26ee72c41e62a75765", "score": "0.5746654", "text": "function protocolEntrySaved(data) {\r\n checkAjaxResult(data);\r\n enableInput(true);\r\n $(\"#invid\").val(\"-1\");\r\n $(\"#inventory,#price\").val(\"\");\r\n loadProtocolList();\r\n loadProtocolSumList();\r\n loadInventoryList();\r\n }", "title": "" }, { "docid": "2036af874d7e491494c4305a40ed6a8d", "score": "0.5734171", "text": "function saveClicked () {\n // TODO - the disabling of the submit button should be in AJS.Dialog.\n var submitButton = $(\".permissions-update-button\").disable();\n if (isEditPage) {\n updateEditPage();\n\n // Notify the user that the changes are not yet saved to the back-end.\n AJS.setVisible(\"#page-permissions-unsaved-changes-msg\", permissionManager.permissionsEdited);\n submitButton.enable();\n closeDialog();\n } else {\n var post = permissionManager.makePermissionStrings();\n post.pageId = AJS.params.pageId;\n $(\"#waitImage\").show();\n\n AJS.safe.post(contextPath + \"/pages/setpagepermissions.action\", post, function(data) {\n $(\"#waitImage\").hide();\n\n // If any permissions set, show padlock\n AJS.setVisible(\"#content-metadata-page-restrictions\", data.hasPermissions);\n submitButton.enable();\n closeDialog();\n }, \"json\");\n }\n }", "title": "" }, { "docid": "7aaabc4229c5665d3780f71402872c4d", "score": "0.5725385", "text": "function activateAuxilaryPageSaveButton() {\n\tsubmitBtnEnableUI('btnSaveAuxiliaryList');\n\tsubmitBtnEnableUI(\"btnSaveAuxiliaryListBtm\");\n}", "title": "" }, { "docid": "c230510dd726dd495689efa461c5937c", "score": "0.57248354", "text": "function BABtnSave_click() {\n BAaddFeedback();\n}", "title": "" }, { "docid": "57d15a0e45cf37bb266ad4f942eef753", "score": "0.56884927", "text": "function menuSaveClick() {\n requestSave();\n}", "title": "" }, { "docid": "6e645309019f33e7c24badf772ea2777", "score": "0.5684968", "text": "function addBckstgApp(){\n\tvar formData=$(\"#app_form\").serialize(); \n\tvar url = $('#sub_url').val();\n\t$.ajax({type:'POST', dataType:'json', url:url, data:formData, timeout:3000,\t\n\t\tsuccess:function (data) {\n\t\t\tif(data.status){\n\t\t\t\t$('.modal-body').remove();\n\t\t\t\t$('#tip_info').removeClass('alert alert-error').addClass('alert alert-success');\n\t\t\t\t$('#tip_info').html(data.info);\n\t\t\t\t$(\".modal-footer\").remove();\n\t\t\t\tsetTimeout(function(){ window.location.reload();},3000);\n\t\t\t}else{\n\t\t\t\t$('#tip_info').removeClass('alert alert-success').addClass('alert alert-error');\n\t\t\t\t$('#tip_info').html(data.info);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "cc600d8a93ab4e7f773461cf5f983dfb", "score": "0.5683713", "text": "function openForm_handler(formid){\n fillCreateForm(formid);\n $('.builder-form-comp').hide();\n $('.builder-form-comp-create').css('display', 'flex').show();\n $('.builder-form-comp-create-view-connect-content').hide();\n $('#builder-form-a-save').attr('statype', 'update');\n $('.builder-form-comp-create-view-connect-h[ts=\"connections\"]').attr('status', 'update');\n\n \n $('#builder-form-a-close').hide();\n $('#builder-form-a-done').hide();\n $('#builder-form-a-save').hide();\n $('#builder-form-a-create').hide();\n $('#builder-form-a-view').hide();\n $('#builder-form-a-close').hide();\n\n \n $('#builder-form-a-done').show();\n $('#builder-form-a-save').show();\n}", "title": "" }, { "docid": "b8a5ef7aa82adcdfffa08c7c46bb3ba6", "score": "0.5680826", "text": "function btnGoTab1() {\n updateData();\n goTab1();\n console.log(\"to Risk Characteristics\");\n}", "title": "" }, { "docid": "c20e4a34aaf5141186ae385a7d46751e", "score": "0.567276", "text": "function user_form_onload(){\t\n\tvar tabs = getFrameObject(parent,'tabsFrame');\n\tif(tabs != null){\n\t\ttabs.setTabEnabled('update', false);\n\t}\n}", "title": "" }, { "docid": "3468dbeef99bd4c2c51abcc1b908ec55", "score": "0.56580985", "text": "function activateAddBillPageSaveButton() {\n\tsubmitBtnEnableUI('btnContinue');\n\tsubmitBtnEnableUI(\"btnContinueBtm\");\n}", "title": "" }, { "docid": "89e6740d9d631a545b74c82bc776ae93", "score": "0.5656271", "text": "function changeMyFormStatus(formAbrhs, status) {\n var jsonObject = {\n userFormAbrhs: formAbrhs,\n status: status\n }\n\n if (status != 1) {\n misConfirm(\"Are you sure you want to \" + (status == 2 ? \"deactive\" : \"delete\") + \" this form?\", \"Confirm\", function (isConfirmed) {\n if (isConfirmed) {\n calltoAjax(misApiUrl.changeMyFormStatus, \"POST\", jsonObject,\n function (result) {\n var resultData = $.parseJSON(JSON.stringify(result));\n if (resultData) {\n misAlert(\"Your form has been \" + (status == 2 ? \"deactivated\" : \"deleted\") + \" successfully.\", \"Success\", \"success\");\n bindAllMyForms();\n }\n else\n misAlert('Your request cannot be processed, please try after some time or contact to MIS team for further assistance.', 'Error', 'error');\n });\n }\n });\n }\n else {\n calltoAjax(misApiUrl.changeMyFormStatus, \"POST\", jsonObject,\n function (result) {\n var resultData = $.parseJSON(JSON.stringify(result));\n if (resultData) {\n misAlert(\"Your form has been activated successfully\", \"Success\", \"success\");\n bindAllMyForms();\n }\n else\n misAlert('Your request cannot be processed, please try after some time or contact to MIS team for further assistance.', 'Error', 'error');\n });\n }\n}", "title": "" }, { "docid": "4297ecc309132ecf2e1452ff551f7199", "score": "0.56364876", "text": "function nextFormTrue() {\n $scope.errAlert = false\n $scope.tabMenu++\n $scope.tabMenuCurrency = $scope.menuModalsCardCredit[$scope.tabMenu]\n }", "title": "" }, { "docid": "b1986847d5681d74a3737ebb78105312", "score": "0.56294626", "text": "function SubmitChanges(status) {\n var newVisitObj = {\n start_date: $('#dateStart').val().replace(/[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/]/g, \".\"),\n end_date: $('#dateEnd').val().replace(/[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/]/g, \".\")\n };\n\n if ($('#select3').val() != \"\") { newVisitObj[\"city\"] = $('#select3').val(); }\n if (document.getElementById(\"newPhotos\").value.trim() != \"\") { newVisitObj[\"photos\"] = document.getElementById(\"newPhotos\").value.trim(); }\n if (document.getElementById(\"newStory\").value.trim() != \"\") { newVisitObj[\"story\"] = document.getElementById(\"newStory\").value.trim(); }\n\n removeAllChildNodes(\"alert_date\");\n removeAllChildNodes(\"alert_cities_list\");\n removeAllChildNodes(\"success\");\n\n if (checkRules4AddUpdate(newVisitObj)) {\n $.getScript(\"SCRIPTS/set_content.js\", function(){\n (status == \"add\") ? addElementOfGlobalDataArray(newVisitObj): updateElementOfGlobalDataArray(newVisitObj);\n createSettingsVisitTab_HTML();\n alertOfSuccess();\n });\n }\n return false;\n}", "title": "" }, { "docid": "e22cdabc37a72d464cef189baaab6e6e", "score": "0.56260073", "text": "function BtnTaskApplyClick(){\n SaveTask(); \n}", "title": "" }, { "docid": "db33259e014b2260ceb300f1b30d1417", "score": "0.5622949", "text": "function save() {\n buttonLogic();\n localStorage.autoRedirect = $('autoRedirect').checked;\n localStorage.enableDanforth = $('enableDanforth').checked;\n localStorage.enableBecker = $('enableBecker').checked;\n localStorage.preferDanforth = $('preferDanforth').checked;\n localStorage.usageOptOut = $('usageOptOut').checked;\n // Make sure the background page sees the changes!\n chrome.extension.getBackgroundPage().parseLocalStorage();\n $('autoRedirectStatus').innerHTML = 'Saved.';\n $('autoRedirectStatus').style.display = 'block';\n setTimeout(function(){ $('autoRedirectStatus').style.display = 'none' }, 1500);\n}", "title": "" }, { "docid": "fc4d80f4491779fb54ce475da3b0a84f", "score": "0.56151825", "text": "onSaveClick() {\n\t\tvar that = this,\n\t\t\tpromise,\n\t\t\tapplicantModel = this.$viewModels.ApplicantDSModel,\n\t\t\tapplicantDS = this.$ds.ApplicantDS;\n\t\t\n\t\tif (this.appMode === this.CREATE) {\n\t\t\t// Manually synchronize model with datasource.\n\t\t\tthis.updateDataSourceRow(applicantModel);\n\t\t}\n\t \n\t\tif (applicantDS.hasChanges()) {\n\t\t\tthis.enableButtons(false, false);\n\t\t\tpromise = applicantDS.sync();\n\t\t\tpromise.done(function () {\n\t\t\t\tthat.enableButtons(true, true);\n\t\t\t\tthat.appMode = that.NONE;\n\t\t\t});\n\t\t\tpromise.fail(function (xhr) {\n\t\t\t\tvar applicantDS = that.$ds.ApplicantDS,\n\t\t\t\t\terrors,\n\t\t\t\t\ti;\n\t\t\t\t\n\t\t\t\tif (that.appMode === that.CREATE) {\n\t\t\t\t\tthat.curRowIndex = that.savedCurRowIndex;\n\t\t\t\t\tthat.appMode = that.NONE;\n\t\t\t\t}\n\t\t\t\tthat.enableButtons(false, true);\n\n\t\t\t\t// Display errors\n\t\t\t\t// Default error handling already shows errors in an error notification\n// errors = applicantDS.transport.jsdo.getErrors();\n// for (i = 0; i < errors.length; i += 1) {\n// if (i === 0) {\n// alert(errors[i].error);\n// } else {\n// console.log(errors[i].error);\n// }\n// }\n\t\t\t\t\n\t\t\t\tapplicantDS.cancelChanges();\n\t\t\t}); // end promise.fail\n\t\t}\n\t}", "title": "" }, { "docid": "dda7c0fe7521546af4740ccb4ddd94e4", "score": "0.5611681", "text": "function updateFormState ( )\n {\n\tif ( ! no_update ) updateMainURL();\n }", "title": "" }, { "docid": "bf629df9e33eace578215bf9b67566c2", "score": "0.56098855", "text": "function SaveAll(event) {\n\n /* IF on the mobile device/offline.*/\n if (OnMobileApp()) {\n \n /* Combine next 2 lines?-KCJ*/\n var WAPage = pega.ui.ClientCache.find('D_CurrentStaffWorkAvailabilities');\n var waList = WAPage.get(\"WorkAvailabilities\");\n var iterator = (waList.type == pega.ui.ClientCache.OBJECT_TYPE_LIST ? waList.iterator() : null);\n var templatePage = null; /*Best value to set to? return if DNE? or var templatePage;-KCJ*/\n var hasErrors = false; /*make string type?-KCJ*/\n var isAvailable = false; /*make string type?-KCJ*/\n\n /* Loop thru work availibility list of days see if can find current day's date label.*/\n while (iterator && iterator.hasNext()) {\n \t\n \t/* Grab next Single Day form.*/\n templatePage = iterator.next();\n\t\t\t\n \t/* Find out if 'Not Available' checkbox has been checked.*/\n isAvailable = templatePage.get(\"IsAvailable\") ? templatePage.get(\"IsAvailable\").getValue() : \"false\";\n\n /* Put .toString after get value?-KCJ*/\n \t/* IF the 'Not Available' checkbox has not been checked.*/\n if (isAvailable.toString() == \"false\" || isAvailable.toString() == \"\") {\n \t\n \t/* Validate the current Single Day form iterated over.*/\n ValidateWorkAvailability(templatePage);\n }\n\n /* IF the are error messages or the page has not been completed by the user.*/\n if (templatePage.hasMessages() || templatePage.get(\"Summary\").getValue() === \"Please enter data\") {\n templatePage.put(\"ErrorMessage\", \"Please complete \" + templatePage.get(\"DateLabel\").getValue());\n templatePage.addMessage(\"Error: \" + \"Please complete \" + templatePage.get(\"DateLabel\").getValue());\n templatePage.remove(\"Summary\"); /*Why remove summary? DELETE?-KCJ*/\n hasErrors = true;\n }\n }\n\t\t\n \t/* IF any of the Work Availability Single Day forms has an error, notify the user.*/\n if (hasErrors) {\n\n /* Inform user to fix errors on page.*/\n WAPage.put('ValidationErrorMessage', \"Please fix errors above.\");\n\n /* Reload section with error messages displayed.*/\n var section = pega.u.d.getSectionByName(\"WorkAvailabilityMultipleDay\", '', document);\n pega.u.d.reloadSection(section, '', '', false, false, '', false);\n return;\n }\n\t\t\n /*DELETE?-KCJ*/\n WAPage.put('ValidationErrorMessage', 'Submit Successful'/* on ' + CB.getCurrentDateTimeAsString()*/);\n\n /*DELETE?-KCJ*/\n /* TB - Legacy Code?\n \n SetWorkAvailabilityDateTime();\n\n var metadata = {\n \"action\": \"callActivity\",\n \"activityName\": \"SaveWorkAvailabilities\",\n \"className\": \"CB-Dec-Data-StaffAvailability\"\n };\n\n window.launchbox.PRPC.ClientStore.addAction(undefined,\n undefined,\n JSON.stringify(metadata),\n WAPage.getJSON(),\n writeSuccessCallback,\n failCallback); */\n } else {/* On Desktop... */\n /* Run activity, 'SaveWorkAvailabilities'.*/\n var oSafeUrl = new SafeURL(\"CB-Dec-Data-StaffAvailability.SaveWorkAvailabilities\");\n pega.util.Connect.asyncRequest('GET', oSafeUrl.toURL(), '');\n }\n}", "title": "" }, { "docid": "70f794cba13269e218042cf711ad9d3a", "score": "0.5606226", "text": "function save(){\n EWD.sockets.sendMessage({\n type: \"saveLabOrder\",\n params: {\n id: \"1\",\n comment: document.getElementById(\"comment\").value,\n selectedTest: document.getElementById(\"testList\").value,\n collectionType: document.getElementById(\"collectionType\").value ,\n howOften: document.getElementById(\"howOften\").value,\n collectionDate: document.getElementById(\"collectionDate\").value,\n collectionSample: document.getElementById(\"collectionSample\").value,\n specimen: document.getElementById(\"specimen\").value,\n urgency: document.getElementById(\"urgency\").value,\n notifyProviders: document.getElementById(\"selectProvHidden\").value, \n howLong: document.getElementById(\"howLong\").value,\n sender: 'ELOM',\n date: new Date().toUTCString() \n }\n });\n }", "title": "" }, { "docid": "f43f5ba45bb41ab1061cef62d7cd1560", "score": "0.55991864", "text": "function submitForm(){\n let servicio1 = getService();\n let cliente1 = getClient();\n showBudget(servicio1, cliente1);\n saveClient(cliente1);\n }", "title": "" }, { "docid": "47d9716a74fa02a54c0049479764ccb9", "score": "0.55985373", "text": "function btnGoTab3() {\n updateData();\n goTab3();\n console.log(\"to Risk Assessment\");\n}", "title": "" }, { "docid": "e2edbb4b2b1b9f2580caccd03b4738ab", "score": "0.55975103", "text": "editExisting(inID) {\n\n // Get the contact from local storage and set it on the forms.\n const contacts = JSON.parse(localStorage.getItem(\"ContactsDB\"));\n const contact = contacts[inID];\n\n // Set flag to indicate editing an existing contact and show the details.\n wxPIM.isEditingExisting = true;\n wxPIM.editingID = inID;\n\n // Clear the details forms.\n $$(\"moduleContacts-personalDetailsForm\").clear();\n $$(\"moduleContacts-businessDetailsForm\").clear();\n\n // Show the form. Note that this has to be done before the call to\n // setValues() below otherwise we get an error due to setting the value of\n // the richtext (my guess is it lazy-builds the DOM and it's not actually\n // there until the show() executes.\n $$(\"moduleContacts-details\").show();\n $$(\"moduleContacts-accordion\").getChildViews()[0].expand();\n\n // Special handling for dates.\n if (contact.birthday) {\n contact.birthday = new Date(contact.birthday);\n }\n\n // Populate the forms. Note that we can't just pass contact to setValues()\n // because Webix stores all the data whether it goes into a form field or\n // not, and doing that means that when we combine the two forms' data\n // later we'll be overwriting data and things won't work as expected, so we\n // have to only pass the data appropriate for each form out of the data\n // object.\n $$(\"moduleContacts-personalDetailsForm\").setValues({\n firstName : contact.firstName,\n lastName : contact.lastName,\n homePhone : contact.homePhone,\n cellPhone : contact.cellPhone,\n personalEMail : contact.personalEMail,\n personalAddress1 : contact.personalAddress1,\n personalAddress2 : contact.personalAddress2,\n personalAddress3 : contact.personalAddress3,\n personalCity : contact.personalCity,\n personalState : contact.personalState,\n personalZip : contact.personalZip,\n im : contact.im,\n imType : contact.imType,\n birthday : contact.birthday,\n personalWebsite : contact.personalWebsite,\n personalComments : contact.personalComments\n });\n $$(\"moduleContacts-businessDetailsForm\").setValues({\n officePhone : contact.officePhone,\n businessEMail : contact.businessEMail,\n businessAddress1 : contact.businessAddress1,\n businessAddress2 : contact.businessAddress2,\n businessAddress3 : contact.businessAddress3,\n businessCity : contact.businessCity,\n businessState : contact.businessState,\n businessZip : contact.businessZip,\n company : contact.company,\n title : contact.title,\n businessWebsite : contact.businessWebsite,\n businessComments : contact.businessComments\n });\n\n // Finally, enable the delete button.\n $$(\"moduleContacts-deleteButton\").enable();\n\n }", "title": "" }, { "docid": "628285430cd7dec97fc58983d88db086", "score": "0.5590308", "text": "function submitBillInfo(requestForm, requestUrl) {\n\tdocument.getElementById('contactText').innerHTML = \"<img src='images/loading.gif' /> 出账信息正在提交,请稍候...\"\n\tdocument.getElementById('go').style.display = \"none\";\n\tdocument.getElementById('back').style.display = \"block\";\n var id=requestForm;\n var url=requestUrl;\n //alert('222');\n\teditInfo(id, url);\n//\tsubmitEnd.onCompletion = function() {\n//\t\tvar dataOld = submitEnd.response;\n//\t\talert(submitEnd.response);\n//\t\tvar data;\n//\t\tvar endno = dataOld.indexOf('<!');\n//\t\tif (endno == -1) {\n//\t\tdata = dataOld;\n//\t\t} else {\n//\t\t\tdata = dataOld.slice(0, endno);\n//\t\t}\n//\n//\t\tvar myArray = data.split(\"|\");\n//\t\tif (myArray[1] == 'undefined') {\n//\t\t\tmyArray[1] = \"\";\n//\t\t}\n//\t\tif (myArray[0] == 'true') {\n//\t\t\tdocument.getElementById('contactText').innerHTML = \"<span class='green'>操作成功!\"\n//\t\t\t\t\t+ myArray[1] + \"</span>\";\n//\t\t} else {\n//\t\t\tdocument.getElementById('contactText').innerHTML = \"<span class='red'>操作失败!\"\n//\t\t\t\t\t+ myArray[1] + \"</span>\";\n//\t\t\t//alert(myArray[1]);\n//\t\t}\n//\t}\n\n\t//submitEnd.runAJAX();\n\n}", "title": "" }, { "docid": "334471c8c3ad7d59df7b6d1bf3049bfc", "score": "0.55883044", "text": "function populate_staff_editinfo(res){\n\n document.getElementById('staff_id_modal').value = res.staff_id;\n document.getElementById('staff_name_modal').value = res.name;\n document.getElementById('staff_phone_1_modal').value = res.phone_1;\n document.getElementById('staff_address_modal').value = res.address;\n if (res.is_active == 1){\n document.getElementById('staff_active_modal').checked = true;\n }\n else{\n document.getElementById('staff_active_modal').checked = false;\n\n }\n \n var save_btn = document.getElementById('btn_search_staff');\n save_btn.onclick = function(){\n edit_staff_info(res.phone_1);\n };\n\n\n}", "title": "" }, { "docid": "b39d2fd6b1aa6ec020a035a310979c61", "score": "0.5587189", "text": "function saveRenewalFlag() {\r\n commonOnSubmit('saveAllRenewalFlag', false, false, false, true);\r\n}", "title": "" }, { "docid": "3d3b04aad3f20c613a40f282587602e2", "score": "0.55808604", "text": "_handleButtonSave()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__USER_SAVE, {\n fields: {\n username: _.escape(this.ui.textUsername.val()),\n first_name: _.escape(this.ui.textFirstName.val()),\n last_name: _.escape(this.ui.textLastName.val()),\n email: _.escape(this.ui.textEmail.val())\n }\n });\n if (this._userPreference)\n {\n this._userPreference.set({'send_email': $(this.ui.checkboxSendEmail).prop('checked')});\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__USER_PREFERENCE_SAVE, {user_preference: this._userPreference});\n }\n }", "title": "" }, { "docid": "89453a670a04139ea0ffc0afa8089c04", "score": "0.55788183", "text": "function saveFormChanges() {\n\n\tvar custMsg = '';\n\tvar msg;\n\n\t$('.cartpage_qty').each(function() {\n\t\tvar prod_id = $(this).attr('id').slice(9);\n\t\tvar qty = $(this).val();\n\n\t\t// Notify customer if they add more of an item to cart than are available in stock\n\t\tmsg = CART.updateItem(prod_id, qty);\n\t\tif (msg) {\n\t\t\tcustMsg += msg;\n\t\t}\n\n\t});\n\n\tORDERFORM.form_data.country_code = $('#cartForm_shipto_country').val();\n\n\tif ($('#cartForm_gift_status').is(':checked')) {\n\t\tORDERFORM.form_data.gift_status = 'Y';\n\t} else {\n\t\tORDERFORM.form_data.gift_status = 'N';\n\t}\n\n\tORDERFORM.form_data.gift_message = $('#cartForm_gift_message').val();\n\n\tORDERFORM.saveState();\n\n\tif (custMsg) {\n\t\talert(custMsg);\n\t}\n\n}", "title": "" }, { "docid": "a6ba8517a369e548f8f9accc9f28aa7d", "score": "0.55646455", "text": "function processSave(param) {\n\n var args = {\n target: [\n\t\t\t{ type: \"FORM\", id: \"frmData_Main\" },\n { type: \"GRID\", id: \"grdData_Sub\" }\n ]\n };\n if (gw_com_module.objValidate(args) == false) return false;\n\n args.handler = { success: successSave };\n gw_com_module.objSave(args);\n\n}", "title": "" }, { "docid": "48d446206ea9a01fb038a94f5b435687", "score": "0.55645293", "text": "function toSaveAddInfoAutoD() {\n\tvar saveargs = gatherAddInfoAutoD();\n//\t$( \"#alertPopUp\" ).empty().append(\"<center id='processingPage'><div style='text-align:center;'>Processing Information...<br /><img src='img/ajax-loader.gif'/></div></center>\");\n\tif(saveAutoDAddInfoQuery(saveargs)==false){\n\t\treturn;\n\t}\n\talerts(\"Process Complete\");\t\n}", "title": "" }, { "docid": "4ff6d5dc9e511d7367a0740be4682ee4", "score": "0.55625147", "text": "function proceedWithForm(key){\n\t\tif(!(key)){\n\t\t\tvar id = Math.floor(Math.random()*10000001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\tgetRadio();\n\t\tvar item \t\t\t\t= {};\n\t\t\titem.formType\t\t= [\"Choose Type of Form: \", formTypeValue];\n\t\t\titem.activity \t\t= [\"Activity: \", $(\"activity\").value];\n\t\t\titem.firstName \t\t= [\"First Name: \", $(\"firstName\").value];\n\t\t\titem.yourLastName \t= [\"Last Name: \", $(\"lastName\").value];\n\t\t\titem.email \t\t\t= [\"Email: \", $(\"email\").value];\n\t\t\titem.flavor\t\t\t= [\"Flavor Type: \", $(\"flavorGroup\").value];\n\t\t\titem.howmany\t\t= [\"How Many People? \", $(\"rangeSlider\").value];\n\t\t\titem.delivery \t\t= [\"Delivery Type: \", $(\"deliveryType\").value];\n\t\t\titem.date\t\t\t= [\"Date to Schedule: \", $(\"duedate\").value];\n\t\t\titem.addinfo\t\t= [\"Additional Information: \", $(\"moreInfo\").value];\n\t\t\t\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Form Saved and Proceeding\");\n\t}", "title": "" }, { "docid": "3c303e29c9af233895665efd1737919a", "score": "0.5539661", "text": "function SaveEmployeeGoals() {\n var JsonObject = {\n EmpAppraisalSettingId: $(\"#hdnEmpAppraisalSettingId\").val(),\n DetailList: getGoalsFormData()\n };\n\n if (goalCheck > 0) {\n calltoAjax(misApiUrl.saveEmployeeAppraisalGoal, \"POST\", JsonObject,\n function (result) {\n\n });\n }\n\n}", "title": "" }, { "docid": "8031ddd3ec0553f088d07f039bf8fd38", "score": "0.55337864", "text": "function doApproveTimeSheets()\n{\n form=document.forms[0];\n var numAddrs = numSelected_TimeSheet();\n var valAddrs = valSelected_TimeSheet();\n document.getElementById('Par_Timesheet_Val').value = valAddrs;\n document.getElementById('Approve_Status').value = \"frmDoubleClk\";\n if (numAddrs < 0)\n {\n \talert(\"There are no Timesheets to approve.\");\n \treturn;\n }\n else if (!numAddrs)\n {\n \talert(\"You have to select atleast one Timesheet to approve from the Available Timesheets.\");\n \treturn;\n }\n form.action=\"approvefax.php\";\n form.submit();\n}", "title": "" }, { "docid": "94ac4f1335945ba52fb2dac1a0aea69f", "score": "0.55337834", "text": "function addUpdateEmployeeAppraisalFormAsync() {\n //console.log('Appraisal form auto saved');\n var JsonObject = {\n empAppraisalSettingId: $(\"#hdnEmpAppraisalSettingId\").val(),\n ReviewPeriod: $(\"#hdnEmpAppraisalSettingId\").val(),\n ExposerFromDate: $(\"#txtReviewFrom\").val(),\n ExposerToDate: $(\"#txtReviewTo\").val(),\n AppraisalParameter: getAppraisalFormData()\n };\n calltoAjaxWithoutLoader(misApiUrl.saveEmployeeAppraisalFormAsync, \"POST\", JsonObject,\n function (result) {\n var data = $.parseJSON(result.Ratings);\n $(\"#lblAppraiseeRatingWeighted\").html(data.SelfOverallRatingWeighted);\n $(\"#lblAppraiserRatingWeighted\").html(data.AppraiserOverallRatingWeighted);\n\n $(\"#lblAppraiseeNormalRating\").html(data.SelfOverallRatingNormal);\n $(\"#lblAppraiserNormalRating\").html(data.AppraiserOverallRatingNormal);\n });\n}", "title": "" }, { "docid": "6db0952eaab0afee4a52faaa70c4a69b", "score": "0.5528591", "text": "function save(form) {\n vm.methods.startLoading();\n var updateUser;\n switch (form) {\n case 'settings':\n var updateSettings = {\n ports : vm.settings.ports,\n micro : vm.settings.micro,\n speaker : vm.settings.speaker,\n downloadPath: vm.settings.downloadPath,\n language : vm.settings.language\n };\n userFactory.httpRequest.updateSettings(updateSettings, function () {\n vm.methods.stopLoading();\n cozenLanguage.updateCurrentLanguage(vm.settings.language);\n goTo.view('app.account.settings', {lang: vm.settings.language});\n }, function () {\n vm.methods.stopLoading();\n var btn = angular.element(document.querySelector('#submit-edit-account-settings'));\n httpRequest.shakeElement(btn);\n });\n break;\n case 'profile':\n updateUser = {\n givenName: vm.userCopy.givenName,\n surname : vm.userCopy.surname,\n email : vm.userCopy.email,\n picture : vm.userCopy.picture,\n bio : vm.userCopy.bio\n };\n userFactory.httpRequest.updateUser(updateUser, function () {\n vm.methods.stopLoading();\n goTo.view('app.account.profile');\n }, function () {\n vm.methods.stopLoading();\n var btn = angular.element(document.querySelector('#submit-edit-account-profile'));\n httpRequest.shakeElement(btn);\n });\n break;\n case 'profile-password':\n updateUser = {\n currentPassword: vm.userCopy.currentPassword,\n newPassword : vm.userCopy.newPassword\n };\n userFactory.httpRequest.updateUserPassword(updateUser, function () {\n vm.methods.stopLoading();\n goTo.view('app.account.profile');\n }, function () {\n vm.methods.stopLoading();\n var btn = angular.element(document.querySelector('#submit-edit-account-profile-password'));\n httpRequest.shakeElement(btn);\n });\n break;\n case 'notifications':\n userFactory.httpRequest.updateNotifications(vm.notifications, function (response) {\n vm.methods.stopLoading();\n goTo.view('app.account.notifications');\n }, function () {\n vm.methods.stopLoading();\n var btn = angular.element(document.querySelector('#submit-edit-account-notifications'));\n httpRequest.shakeElement(btn);\n });\n break;\n }\n }", "title": "" }, { "docid": "b56e96bbc4a0944edd244d51b504671a", "score": "0.55256927", "text": "save() {\n this._updateCurrent(this.state);\n message.success('保存成功!');\n }", "title": "" }, { "docid": "290c9ee30cd87e8df6ef9e3baceb918d", "score": "0.5523206", "text": "function saveTheTrip() {\n var form = TripEditForm.getForm();\n var params = form.getValues();\n params['task'] = tripMode.toString();\n if (isTripFormValid(form)) {\n Ext.Ajax.request({\n waitMsg: 'Please wait...',\n url: 'trip/saveJSON',\n params: params,\n success: function ( result, request ) {\n var jsonData = Ext.util.JSON.decode(result.responseText);\n var resultMessage = jsonData.data; \n switch (jsonData.success) {\n case true:\n tripListDS.commitChanges();\n tripListDS.reload();\n TripEditWindow.hide();\n Ext.MessageBox.alert('Success', 'Successfully saved ' + resultMessage.name);\n break;\n default:\n Ext.MessageBox.alert('Error', buildStringFromArray(resultMessage.errors, \"message\", \",\"));\n \tbreak;\n }\n },\n failure: function(result, request) {\n var jsonData = Ext.util.JSON.decode(result.responseText);\n Ext.MessageBox.alert('error', 'could not connect to the database. retry later');\n }\n });\n } else {\n Ext.MessageBox.alert('Warning', 'Your Form is not valid!');\n }\n\n}", "title": "" }, { "docid": "5da00db08881b6a3d3aa89f8ef7c0b99", "score": "0.5510889", "text": "function handleSaveToFeweekly(tab, inUrl) {\n var url = inUrl || tab.url;\n\n feweekly.log('handleSaveToFeweekly', url);\n\n if (!feweekly.isSubscribed()) {\n feweekly.log('handleSaveToFeweekly', 'user not subscribed');\n authentication.showSubscribeWindow(tab, function () {\n handleSaveToFeweekly(tab, inUrl);\n });\n return;\n }\n\n if (!util.isValidURL(url)) {\n feweekly.log('handleSaveToFeweekly', 'url not valid');\n showInvalidURLNotification(tab);\n return;\n }\n\n loadNotificationUIIntoPage(tab, url, function () {\n console.log('feweekly.addPage.handleSaveToFeweekly');\n });\n }", "title": "" }, { "docid": "8ad2d6e4e0b90489ae364865c4a59e1c", "score": "0.5504612", "text": "function btnGoTab0() {\n updateData();\n goTab0();\n console.log(\"to Project Setup\");\n}", "title": "" }, { "docid": "739ce6fe8a84a5063be77d354798d6e0", "score": "0.5504114", "text": "function LayoutSaveEvent(callBack) {\n // Displaying process-modal\n ShowModal(ModalProcessDetail);\n\n // Clearing/resetting all controls.\n clearDataOnProcessDtModal();\n\n // Going to db to get max of OpSerial\n AsyncGetMaxOpSerial((opSerial) => {\n if (opSerial && opSerial.trim() !== \"\") {\n console.log(\"Assign OpSerial to textbox\");\n console.log(`OpSerial: ${opSerial}`);\n\n JqTxtProcessNo.val(opSerial);\n JqTxtProcessNumber.val(Number(opSerial));\n } else {\n console.log(\"Could not get max of OpSerial\");\n }\n });\n\n JqBtnSaveProcess.unbind().click(() => {\n if (window.StatusUpdateProcess === 1) {\n console.log(\"Updating process\");\n UpdateProcess_New(null, callBack);\n } else {\n console.log(\"Creating new process\");\n SaveNewProcess_New(null, callBack);\n }\n });\n}", "title": "" }, { "docid": "82cc36ae114461f45a93170c2e16beb1", "score": "0.55024755", "text": "function startSave()\r\n\t{\r\n\t\t//Calls save function timer\r\n\t\tif(Auth && !UpdateTimeOut)\r\n\t\t{\r\n\t\t\tif(CanvasInfo[CurrentPage].id) //Calls Update\r\n\t\t\t\tUpdateTimeOut = window.setTimeout(function(){Save(false, null, CanvasInfo[CurrentPage].canvas);}, 5000); //sets a timeout for 5 seconds post action\r\n\t\t\telse\r\n\t\t\t\tUpdateTimeOut = window.setTimeout(function(){Save(true, null, CanvasInfo[CurrentPage].canvas);}, 5000); \r\n\t\t}\t\r\n\t}", "title": "" }, { "docid": "9d211c4f58e1d75aabcf6445d662c974", "score": "0.5501763", "text": "function saveEditForm(){\n\t\t\t\tvar updateManagingPositionURL = constantAPIService.BASE_SERVICE_URL + constantAPIService.routingDetails().EDIT_MANAGING_POSITION;\n\t\t\t\tif($scope.frmEditModal.$valid === false){return;}else{\n\t\t\t\t\t//console.log('you can submit the form');\n\t\t\t\t\t\n\t\t\t\t\t//ON Loading flag\n\t\t\t\t\t$scope.$parent.loadingFlag = true;\n\n\t\t\t\t\tvar managingPosition = peopleSharedAPIService.FormatData(vm.managingField1,vm.managingField2);\n\n\t\t\t\t\tvar dataToServer = peopleSharedAPIService.DataToServerManagingPositon(managingPosition,vm.userId);\n\t\t\t\t\t\n\t\t\t\t\t//this is to check the internet connection\n\t\t\t\t\tif (commonAPIService.checkNetworkConnection() === 'ONL'){\n\t\t\t\t\t\tvm.editFormSubmitWaitingMsg = true;\n\t\t\t\t\t\tpeopleSharedAPIService.UpdateManagingPositon(updateManagingPositionURL,\"PUT\",dataToServer,$scope,vm).then(function(resp){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//This flag is to display the message for the successfully edited\n\t\t\t\t\t\t\t$scope.$parent.loadingFlag = false;\n\t\t\t\t\t\t\tvm.editFormSubmitWaitingMsg = false;\n\t\t\t\t\t\t\tvm.editFormSubmittedMsg = true;\n\n\t\t\t\t\t\t\t//This will update the UI\n\t\t\t\t\t\t\tvm.singlePeopleData.Consultant_Additional_Detail[0].Management_Position = managingPosition.replace(\"||\",\", \");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t////now update the ls for the refresh part\n\t\t\t\t\t\t\t\t//getting the value from local storage\n\t\t\t\t\t\t\tvar peopleInfoLS = peopleSharedAPIService.getFromLS(constantAPIService.MY_PERSONALDETAILS);\n\t\t\t\t\t\t\tif(peopleInfoLS != \"undefined\" && peopleInfoLS != null && peopleInfoLS != \"\")\n\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\t//convert the ls data to object form\n\t\t\t\t\t\t\t\t\tvar temp = JSON.parse(peopleInfoLS)\n\t\t\t\t\t\t\t\t\t//console.log(temp);\n\t\t\t\t\t\t\t\t\tif(temp != null || temp != undefined){\n\t\t\t\t\t\t\t\t\t\tvar consultantAdditonalDetail = temp.Consultant_Additional_Detail;\n\t\t\t\t\t\t\t\t\t\tif(consultantAdditonalDetail.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t//Setting the value of Managing Position\n\t\t\t\t\t\t\t\t\t\t\t\ttemp.Consultant_Additional_Detail[0].Management_Position = commonAPIService.replaceAllOccurance(managingPosition,'||',', ');\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t//var tempStringify = JSON.stringify(temp);\n\t\t\t\t\t\t\t\t\t\t\t\tpeopleSharedAPIService.setToLS(constantAPIService.MY_PERSONALDETAILS,temp);\n\n\t\t\t\t\t\t\t\t\t\t}//consultantAdditionDetail\t\t\n\t\t\t\t\t\t\t\t\t}//if peopleInfoLS\n\n\t\t\t\t\t\t\t}//end of people info \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});///end updateManagingpostion\n\n\t\t\t\t\t}//end of internet check\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$scope.$parent.loadingFlag\t= false;\n\t\t\t\t\t\tcommonAPIService.triggerModel(\"error-alert\",\"alert\",constantAPIService.INTERNET_ERROR_HEADING,constantAPIService.INTERNET_ERROR,\"OK\",\"\",\"\",$scope.alertInfo);\n\t\t\t\t\t}\n\n\t\t\t\t}//scope editfrom Modal \n\t\t\t}", "title": "" }, { "docid": "96fbdd1c723e692dc50355798d8114f7", "score": "0.5499748", "text": "function appStateCalls(pParam) {\r\n\tif(gUser.ID !== \"\") {\r\n \tgUser.Image = pParam.Image;\r\n \tgUser.Active = pParam.Active;\r\n \tgUser.Credit = pParam.Credit;\r\n \tgUser.Registered = pParam.Registered;\r\n \tgUser.Suspended = pParam.Suspended;\r\n \tgUser.New = \"\";\t\r\n \tgUser.Rating = pParam.Rating;\t\r\n\t\t\t\t\r\n\t\tif(pParam.DailyMessage !== \"\") {\r\n\t\t\tmyApp.alert(pParam.DailyMessage, 'Terror Cards');\t\t\t\r\n\t\t\t$(\"#messageDailyLogin\").text(pParam.DailyMessage);\r\n\t\t\t//myApp.popup('.popup-dailylogin');\t\t\t\r\n\t\t}\r\n\t\tif (gUser.Registered === \"0\") {\r\n\t\t\t$('#needRegister').show();\t\r\n\t\t} else {\r\n\t\t\t$('#needRegister').hide();\t\r\n\t\t}\r\n\t\t\r\n\t\t$(\"#creditHolder\").text(\"Credit: \" + pParam.Credit);\r\n\t\t$(\"#mainProfilePic\").attr('src', gUser.Image);\r\n\t\t$(\"#ratingHolder\").text(gUser.Rating + \" % Complete\");\r\n\t\tcallServer(\"cardSets\", null, gUser.ID, populateCardSets);\r\n\t\t//callServer(\"cards\", {year:$(\"#slMyCardYear\").val(), category:$(\"#slMyCardCategory\").val()}, gUser.ID, loadGalleryImages);\r\n\t\tcallServer(\"packs\", null, gUser.ID, market_loadActivePacks);\r\n\t\tcallServer(\"packs\", null, gUser.ID, market_FeaturedPack);\r\n\t\tcallServer(\"messagesFull\", {count:50, place:'board'}, gUser.ID, loadMessagesFull);\r\n\t\tcallServer(\"messagesFull\", {count:10, place:'home'}, gUser.ID, loadMessagesFull); \r\n\t\tcallServer(\"checkList\", null, gUser.ID, loadCheckList);\r\n\t\tcallServer(\"CheckActiveTades\",\"PENDING\",gUser.ID,ShowActiveTradeIdicator);\r\n\t\t//callServer(\"loadInApp\", null, gUser.ID, loadInAppProducts);\r\n \t}\r\n}", "title": "" }, { "docid": "fa6c406ad8528bc074b55fedd382057a", "score": "0.5496362", "text": "function saveData() {\n data.exptDate.endDate = new Date;\n data.exptTimeLine = exptTimeLine;\n var resultJson = JSON.stringify(data);\n jatos.onLoad(function () {\n jatos.submitResultData(resultJson, jatos.endStudyAjax);\n// console.log('data submitted');\n });\n window.location.replace(\"https://www.prolific.ac/submissions/complete?cc=R5VOPY5Q\");\n}", "title": "" }, { "docid": "a484f69b5c0d922e526b69c996a16f52", "score": "0.54941595", "text": "function updateStatus() {\r\n\t\tif (swfReady) {\r\n\t\t\tvar currentStatus = getSWF(\"app\").getStatus();\r\n\t\t\tdocument.forms[\"imForm\"].status.value = currentStatus;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "7434b4236b2638f14b34804ab1aa5a09", "score": "0.54912084", "text": "function showChangeTracking(parentDocViewId)\r\n{\r\n\tcloseMsgBox(); \r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n \tvar objAjax = htmlAreaObj.getHTMLAjax();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n\t//alert(objHTMLData);\r\n\tif(objHTMLData && objHTMLData.hasUserModifiedData() && objHTMLData.isDataModified())\r\n {\r\n var htmlErrors = objAjax.error();\r\n htmlErrors.addError(\"confirmInfo\", szMsg_Changes, false);\r\n var saveFunc =\"\\\"Main.loadWorkAreaWithSave()\\\"\";\t \r\n var canceFunc =\"_showChangeTracking('\"+parentDocViewId+\"')\";\r\n messagingDiv(htmlErrors, saveFunc, canceFunc);\r\n } \r\n else\r\n {\r\n \t_showChangeTracking(parentDocViewId);\r\n }\r\n}", "title": "" }, { "docid": "517fa9fb02e808a97585e643f6a55ebd", "score": "0.54843664", "text": "function save(scope,id,form_id,skip_form_validate)\r\n{\r\n // Validate the form first.\r\n if (! form_id) { form_id = 'popupform'; }\r\n if (skip_form_validate != '1') {\r\n req = validate_form(form_id);\r\n if (req === false) {\r\n close_loading();\r\n return false;\r\n }\r\n }\r\n // Make the update/addition\r\n askConfirm = false;\r\n move = true;\r\n show_loading();\r\n $.ajax({\r\n type: \"POST\",\r\n url: '/app/admin/functions/save.php',\r\n data: 'scope=' + scope + '&id=' + id + '&' + $('#popupform').serialize(),\r\n success: function (theResponse) {\r\n if (debug == 1) { console.log(theResponse); }\r\n var returned = theResponse.split('+++');\r\n // Success\r\n if (returned['0'] == '1') {\r\n handle_success(returned['1']);\r\n $('.remove_save').hide();\r\n needToConfirm = false;\r\n // move = true;\r\n }\r\n // Failed\r\n else {\r\n handle_json_error(returned['1']);\r\n }\r\n },\r\n error: function(error, txt) {\r\n handle_error(error.status);\r\n }\r\n });\r\n return false;\r\n}", "title": "" }, { "docid": "0e97e7d3c85143351d8e0923e742ad83", "score": "0.5483177", "text": "save() {\n if (this.properties.saveCallback) {\n this.properties.saveCallback();\n } else if (this.properties.localStorageReportKey) {\n if ('localStorage' in window && window['localStorage'] !== null) {\n try {\n let report = this.getReport();\n // console.log(JSON.stringify(report));\n window.localStorage.setItem(this.properties.localStorageReportKey, JSON.stringify(report));\n this.modified = false;\n } catch (e) {}\n }\n }\n this.updateMenuButtons();\n }", "title": "" }, { "docid": "d7fdfc5f0b09745e8ac9cd5269e7d370", "score": "0.5477909", "text": "function LoadNew() {\n Pace.start();\n $(\"#tab_detail_header\").html('Create New Way Plan');\n $(\"#tb_id\").val(\"\");\n $(\"#tb_routeno\").val(\"\");\n $(\"#tb_name\").val(\"\");\n $(\"#tb_routedescr\").val(\"\");\n $(\"#tb_routestatus\").val(\"New\");\n $(\"#tb_routeseq\").val(\"\");\n\n $(\"#lbl_created\").text(\"\");\n $(\"#lbl_modified\").text(\"\");\n $(\"#lbl_lastlogin\").text(\"\");\n $(\"#cb_deflocation\").prop(\"checked\", false);\n $(\"#cb_alloworder\").prop(\"checked\", false);\n\n $('#dialogBox_Detail_Form').modal('show');\n\n //for focus on adding new data\n $(\"#tb_routeno\").focus();\n\n //for focus on first page load\n $('#dialogBox_Detail_Form').on('shown.bs.modal', function () {\n $(this).find('#tb_routeno').focus();\n });\n}", "title": "" }, { "docid": "527b182934e1464c3c83b900e637c433", "score": "0.5471839", "text": "function auto_save() {\n // check every 30 seconds to see if we need to autosave the data\n setTimeout(auto_save, 30000);\n if (!should_autosave()) {\n return;\n }\n\n var data = {};\n var json_data = form_to_JSON();\n json_data.buttonClicked = 'save-draft';\n data.id = json_data.id;\n data.json_data = JSON.stringify(json_data);\n data.controller = \"AppraisalsAction\";\n\n jQuery.ajax({\n type: \"POST\",\n url: \"<%=renderResponse.encodeURL(saveDraftAJAXURL.toString())%>\",\n data: data,\n success: function(msg) {\n if (msg == \"success\") {\n // remove any existing success messages from previous auto-save draft or manually saving draft\n jQuery('.portlet-msg-success').remove();\n\n jQuery(\"#<portlet:namespace />flash\").html(\n '<span class=\"portlet-msg-success\"><liferay-ui:message key=\"draft-autosaved\"/></span>'\n );\n } else {\n console.log(msg);\n }\n\n // right now this success auto save message shares the same div used to display error messages.\n // we reset the autosave css class after the message is displayed to not affect other js error messages.\n jQuery('.portlet-msg-success').fadeIn('slow');\n jQuery('.portlet-msg-success').parent().addClass('appraisal-auto-save');\n setTimeout(function() {jQuery('.portlet-msg-success').fadeOut('slow')}, 30000);\n setTimeout(function() {jQuery('.portlet-msg-success').parent().removeClass('appraisal-auto-save')}, 30000);\n }\n });\n\n // reset autosave timestamp after a save.\n jQuery('#<portlet:namespace />autosave_timestamp').val(0);\n }", "title": "" }, { "docid": "4f1ac69dc4eef81379cdb10b4d75ade5", "score": "0.54702437", "text": "function addcall(){\n var text1=$('select[name=\"call_type\"]').find('option:selected').text();\n var text2 = $('select[name=\"call_type_sub\"]').find('option:selected').text();\n var callform = $('form#call').serializeArray();\n var form_name = \"call\";\n var method_name = '0';\n callform.push({name: \"formname\", value:form_name},{name: \"methodname\", value:method_name});\n $.ajax({\n type:'POST',\n data:callform,\n url:\"includes/hesabketab/ajax/ajax.php\",\n success:function(resp){\n addtocalltable(callform,text1,text2,resp);\n $('#payment').trigger('reset');\n $('#Modalcall').modal('hide');\n }\n });\n}", "title": "" }, { "docid": "eb6ed10320149d8cf4e29a1d232d5fd2", "score": "0.5468961", "text": "function submitForm() {\n try {\n if (!vm.application._id) {\n // insert new application \n if (!modelSvc.chcekdDuplicate(vm.application, vm.serverDataList)) {\n dataSvc.saveOrUpdateEntity(vm.application).then(function (result) {\n _afterSave(result.data);\n });\n } else {\n showDuplicateMsg(); // show duplicate message found \n }\n } else {\n // update application\n if (!modelSvc.chcekdDuplicate(vm.application, vm.serverDataList, vm.tempApplication)) {\n dataSvc.saveOrUpdateEntity(vm.application).then(function (result) {\n _afterUpdate(result.data);\n });\n } else {\n showDuplicateMsg(); // show duplicate message found \n }\n }\n } catch (e) {\n showErrorMsg(e);\n }\n }", "title": "" }, { "docid": "c4c83ca79b7832dfa799fef73e1874c9", "score": "0.5465926", "text": "function _eventSuccess() {\n\t\t\t\tef.btnSaved = true;\n\t\t\t\tef.btnSubmitText = _isCreate ? 'Saved!' : 'Updated!';\n\n\t\t\t\tif (_isCreate) {\n\t\t\t\t\tef.showRedirectMsg = true;\n\t\t\t\t\t$timeout(_goToEvents, 2500);\n\t\t\t\t}\n\n\t\t\t\tif (_isEdit) {\n\t\t\t\t\tef.showUpdateDetailLink = true;\n\t\t\t\t\t$timeout(_btnSubmitReset, 2500);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "aa18ddd66292e4dfaf96dc1b03b81d48", "score": "0.54644996", "text": "function enableSaveBillerButton() {\n /* To check the status of fields at 500 ms interval and if Ok enable the Submit button*/\n addEditBillerCountdown = setInterval(\"checkRequiredFieldsStatus();\", 500);\n}", "title": "" }, { "docid": "b0d7d024bd271ad6504ef2a7b23a8efc", "score": "0.54634", "text": "function saveForm() {\n if (document.getElementById(\"formTitle\").value == \"\") {\n alert(\"Title required\")\n } else {\n $.ajax({\n type: 'POST',\n url: 'http://192.168.1.167:2222/items',\n data: '{\"title\":\"' + document.getElementById(\"formTitle\").value + '\", \"description\":\"' + document.getElementById(\"formDescription\").value + '\", \"deadline\":\"' + document.getElementById(\"formDeadline\").value + '\"}',\n contentType: \"application/json\",\n dataType: 'json'\n });\n tab1()\n getDB()\ndocument.getElementById(\"formTitle\").value = null\ndocument.getElementById(\"formDescription\").value = null\n }\n}", "title": "" }, { "docid": "7a49cc04f193397be679deea20b2e083", "score": "0.54519457", "text": "function saveTheActionItem() {\n var form = ActionItemEditForm.getForm();\n var params = form.getValues();\n params['task'] = aiMode.toString();\n if (isActionItemFormValid(form)) {\n Ext.Ajax.request({\n waitMsg: 'Please wait...',\n url: 'actionItem/saveJSON',\n params: params,\n success: function ( result, request ) {\n var jsonData = Ext.util.JSON.decode(result.responseText);\n var resultMessage = jsonData.data; \n switch (jsonData.success) {\n case true:\n \tactionItemListDS.commitChanges();\n \tactionItemListDS.reload();\n \tActionItemEditWindow.hide();\n Ext.MessageBox.alert('Success', 'Successfully saved ' + resultMessage.name);\n break;\n default:\n Ext.MessageBox.alert('Error', buildStringFromArray(resultMessage.errors, \"message\", \",\"));\n \tbreak;\n }\n },\n failure: function(result, request) {\n var jsonData = Ext.util.JSON.decode(result.responseText);\n Ext.MessageBox.alert('error', 'could not connect to the database. retry later');\n }\n });\n } else {\n Ext.MessageBox.alert('Warning', 'Your Form is not valid!');\n }\n\n}", "title": "" }, { "docid": "505394f97d3ddbad7029b739c47644bf", "score": "0.54467106", "text": "function saveProtocolEntry() {\r\n clearErrors();\r\n var dataToSend = prepareDataForAddProtocolEntry();\r\n if(dataToSend == null) {\r\n return;\r\n }\r\n enableInput(false);\r\n execAjax(dataToSend, protocolEntrySaved);\r\n loadProtocolList();\r\n }", "title": "" }, { "docid": "c213a7f8aaf877a506c307d2c9e0e058", "score": "0.54432577", "text": "function saveDailyLogs(formObj) {\n\tif(formObj.tripMode1.value == null || formObj.tripMode1.value == \"\"){\n\t\talert(\"Please select the commute mode used to travel from Home to Work.\");\n\t\tformObj.tripMode1.focus();\n\t\treturn false;\n\t}\n\tif(formObj.tripDist1.value == null || formObj.tripDist1.value == \"\"){\n\t\talert(\"Please enter the distance traveled from Home to Work.\");\n\t\tformObj.tripDist1.focus();\n\t\treturn false;\n\t}\n\tif(formObj.tripMode2.value == null || formObj.tripMode2.value == \"\"){\n\t\talert(\"Please select the commute mode used to travel from Work to Home.\");\n\t\tformObj.tripMode2.focus();\n\t\treturn false;\n\t}\n\tif(formObj.tripDist2.value == null || formObj.tripDist2.value == \"\"){\n\t\talert(\"Please enter the distance traveled from Work to Home.\");\n\t\tformObj.tripDist2.focus();\n\t\treturn false;\n\t}\n\tvar mode1 = formObj.tripMode1.value;\n\tvar mode2 = formObj.tripMode2.value;\n \tif(mode1==\"77\" || mode1==\"76\" ||mode1==\"75\"){\n \t\tdocument.getElementById(\"tripDist1\").value=\"0\";\n \t}\n \tif(mode2==\"77\" || mode2==\"76\" ||mode2==\"75\"){\n \t\tdocument.getElementById(\"tripDist2\").value=\"0\";\n\t}\n\tformObj.submit();\n\treturn true;\n}", "title": "" }, { "docid": "845e907de06b6140ebe9a07850ca5fa5", "score": "0.54405576", "text": "function btn_save_doc_received_unit_assign(p_hdn_tag_obj,p_hdn_value_obj,p_url,p_date,p_dateleader){\r\n\ttry{\r\n\t\tif(date_compare(p_date,document.getElementById('C_SENT_DATE').value) > 0){\r\n\t\t\talert('NGAY THUC HIEN phai nho hon hoac bang ngay hien tai!');\r\n\t\t\tdocument.getElementById('C_SENT_DATE').focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif(date_compare(p_dateleader,document.getElementById('C_APPOINTED_DATE').value) > 0){\r\n\t\t\talert('HAN XU LY khong duoc dat gia tri lon hon han cua lanh dao don vi!');\r\n\t\t\tdocument.getElementById('C_APPOINTED_DATE').focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}catch(e){;}\r\n\t_save_xml_tag_and_value_list(document.forms[0], p_hdn_tag_obj, p_hdn_value_obj, true);\t\r\n\tif (verify(document.forms[0])){\t\r\n\t\t//Hidden luu danh sach the va gia tri tuong ung trong xau XML\t\t\t\r\n\t\tdocument.getElementById('hdn_XmlTagValueList').value = p_hdn_tag_obj.value + '|{*^*}|' + p_hdn_value_obj.value;\t\r\n\t\t//document.getElementsByTagName('form')[0].disabled = true;\r\n\t\tdocument.getElementsByTagName('form')[0].action = p_url;\r\n\t\tdocument.getElementsByTagName('form')[0].submit(); \r\n\t}\t\r\n}", "title": "" }, { "docid": "70648fd4a546e921560bbac6bb478819", "score": "0.5437646", "text": "function infoSaved(data) {\n\tif(data.errors) {\n\t\tfor (error in data.errors)\n\t\t\talertBefore(data.errors[error], '#group_'+error, \n\t\t\t\t\t\t'profile_alert', 'danger', '#profile_form');\n\t\tenableButtons(['button']);\n\t} else {\n\t\trestartButtons();\n\t\temptyPasswords();\n\t\tunsetForm(data.user);\n\t}\n\t$('#loading_page').hide();\n}", "title": "" }, { "docid": "7df31256337c24b95e274954d6ed560e", "score": "0.5437227", "text": "function onSaveSuccess(contact) {\n alert(\"Save Success\");\n }", "title": "" }, { "docid": "813cae48bd3fc0035eb3ec2578bb3ce5", "score": "0.54370743", "text": "function editForm() {\n app.getForm('profile').handleAction({\n cancel: function () {\n app.getForm('profile').clear();\n response.redirect(URLUtils.https('Account-Show'));\n },\n confirm: function () {\n var isProfileUpdateValid = true;\n var hasEditSucceeded = false;\n var Customer = app.getModel('Customer');\n\n if (!Customer.checkUserName()) {\n app.getForm('profile.customer.email').invalidate();\n isProfileUpdateValid = false;\n }\n\n if (app.getForm('profile.customer.email').value() !== app.getForm('profile.customer.emailconfirm').value()) {\n app.getForm('profile.customer.emailconfirm').invalidate();\n isProfileUpdateValid = false;\n }\n\n if (!app.getForm('profile.login.password').value()) {\n app.getForm('profile.login.password').invalidate();\n isProfileUpdateValid = false;\n }\n\n if (isProfileUpdateValid) {\n hasEditSucceeded = Customer.editAccount(app.getForm('profile.customer.email').value(), app.getForm('profile.login.password').value(), app.getForm('profile.login.password').value(), app.getForm('profile'));\n\n if (!hasEditSucceeded) {\n app.getForm('profile.login.password').invalidate();\n isProfileUpdateValid = false;\n }\n }\n\n if (isProfileUpdateValid && hasEditSucceeded) {\n \tif (Site.getCurrent().getCustomPreferenceValue('MailChimpEnable')) {\n if (app.getForm('profile.customer.addtoemaillist').value()) {\n \tvar mailchimpHelper = require('*/cartridge/scripts/util/MailchimpHelper.js');\n \tmailchimpHelper.addNewListMember(app.getForm('profile.customer.firstname').value(), app.getForm('profile.customer.email').value());\n }\n } else {\n \tltkSignupEmail.Signup();\n }\n response.redirect(URLUtils.https('Account-Show'));\n } else {\n response.redirect(URLUtils.https('Account-EditProfile', 'invalid', 'true'));\n }\n },\n changepassword: function () {\n var isProfileUpdateValid = true;\n var hasEditSucceeded = false;\n var Customer = app.getModel('Customer');\n\n if (!Customer.checkUserName()) {\n app.getForm('profile.customer.email').invalidate();\n isProfileUpdateValid = false;\n }\n\n if (!app.getForm('profile.login.currentpassword').value()) {\n app.getForm('profile.login.currentpassword').invalidate();\n isProfileUpdateValid = false;\n }\n\n if (app.getForm('profile.login.newpassword').value() !== app.getForm('profile.login.newpasswordconfirm').value()) {\n app.getForm('profile.login.newpasswordconfirm').invalidate();\n isProfileUpdateValid = false;\n }\n\n if (isProfileUpdateValid) {\n hasEditSucceeded = Customer.editAccount(app.getForm('profile.customer.email').value(), app.getForm('profile.login.newpassword').value(), app.getForm('profile.login.currentpassword').value(), app.getForm('profile'));\n if (!hasEditSucceeded) {\n app.getForm('profile.login.currentpassword').invalidate();\n }\n }\n\n if (isProfileUpdateValid && hasEditSucceeded) {\n response.redirect(URLUtils.https('Account-Show'));\n } else {\n response.redirect(URLUtils.https('Account-EditProfile', 'invalid', 'true'));\n }\n }\n });\n}", "title": "" }, { "docid": "b563dfeb7f45c25b3bff0a9239bee41a", "score": "0.54363626", "text": "function formAboutus() {\n\n var urlFormSave = $Ctr_aboutUs + 'aboutus_update';\n var dataToSave = $(\"#form_aboutus\").serialize();\n console.log(dataToSave);\n $.ajax({\n type: \"POST\",\n cache: true,\n url: urlFormSave,\n data: dataToSave,\n dataType: \"json\",\n success: function (data) {\n if (data.response) {\n\n DialogSuccess(data.message);\n\n } else {\n DialogError(data.message);\n }\n\n },\n error: function (xhr, textStatus, errorThrown) {\n DialogError(xhr.responseText);\n return false;\n }\n });\n}", "title": "" }, { "docid": "18c9752879918b911a2f1a81539de627", "score": "0.5435813", "text": "function SaveNContinueAccoDetails(travelID, additionalInfo) {\n DisplayLoadingDialog(); //checked\n $.ajax({\n url: \"SaveAdminAccoAdditionalInfo/Travel\",\n type: \"POST\",\n data: { TravelID: travelID, AdditionalInformation: additionalInfo },\n success: function (data) {\n $(\"#loading\").dialog(\"close\");\n $(\"#loading\").dialog(\"destroy\");\n if (data.status == true) {\n $(\"#SaveNContAccoDialog\").dialog({\n resizable: false,\n height: 'auto',\n width: 'auto',\n modal: true,\n title: 'Accommodation Details',\n dialogClass: \"noclose\",\n buttons: {\n Ok: function () {\n $(this).dialog(\"close\");\n // window.location = (\"GetConveyanceAdminFormDetails/Travel\");\n $('#newAccomodationAdmin_AdditionalInformation').val('');\n var selected = $(\"#tabs\").tabs(\"option\", \"selected\");\n $(\"#tabs\").tabs(\"option\", \"selected\", selected + 1);\n }\n }\n }); //end dialog\n }\n else if (data.status == \"Error\") {\n $(\"#errorDialog\").dialog({\n resizable: false,\n height: 'auto',\n width: 'auto',\n modal: true,\n title: 'Accommodation Details',\n dialogClass: \"noclose\",\n buttons: {\n Ok: function () {\n $(this).dialog(\"close\");\n }\n }\n }); //end dialog\n }\n else {\n $(\"#SaveNContinueErrorMessege\").dialog({\n resizable: false,\n height: 'auto',\n width: 'auto',\n modal: true,\n title: 'Accommodation Details',\n dialogClass: \"noclose\",\n buttons: {\n Ok: function () {\n $(this).dialog(\"close\");\n }\n }\n }); //end dialog\n }\n },\n error: function (data) {\n $(\"#loading\").dialog(\"close\");\n $(\"#loading\").dialog(\"destroy\");\n $(\"#errorDialog\").dialog({\n resizable: false,\n height: 'auto',\n width: 'auto',\n modal: true,\n title: 'Accommodation Details',\n dialogClass: \"noclose\",\n buttons: {\n Ok: function () {\n $(this).dialog(\"close\");\n }\n }\n }); //end dialog\n }\n });\n}", "title": "" }, { "docid": "ac1a84dd229cc55630994119e5ede02a", "score": "0.5435587", "text": "function btn_save_doc_received_assign(p_hdn_tag_obj,p_hdn_value_obj,p_url,p_date){\r\n\ttry{\r\n\t\tif(date_compare(p_date,document.getElementById('C_ASSIGNED_DATE').value) > 0){\r\n\t\t\talert('NGAY THUC HIEN phai nho hon hoac bang ngay hien tai!');\r\n\t\t\tdocument.getElementById('C_ASSIGNED_DATE').focus();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}catch(e){;}\r\n\t_save_xml_tag_and_value_list(document.forms[0], p_hdn_tag_obj, p_hdn_value_obj, true);\r\n\tif (verify(document.forms[0])){\t\r\n\t\t//Hidden luu danh sach the va gia tri tuong ung trong xau XML\t\t\t\r\n\t\tdocument.getElementById('hdn_XmlTagValueList').value = p_hdn_tag_obj.value + '|{*^*}|' + p_hdn_value_obj.value;\t\r\n\t\t//document.getElementsByTagName('form')[0].disabled = true;\r\n\t\tdocument.getElementsByTagName('form')[0].action = p_url;\r\n\t\tdocument.getElementsByTagName('form')[0].submit(); \r\n\t}\t\r\n}", "title": "" }, { "docid": "8cced0f74e6196b779c69866f4e4d4b8", "score": "0.5432681", "text": "function SaveEmployeeAchievementsByAppraisee() {\n var JsonObject = {\n EmpAppraisalSettingId: $(\"#hdnEmpAppraisalSettingId\").val(),\n DetailList: getAchievementsFormData()\n };\n\n calltoAjax(misApiUrl.saveEmployeeAppraisalAchievementBySelf, \"POST\", JsonObject,\n function (result) {\n $(\"#dynamicAddAchievements\").html('');\n dynamicReloadId = 0;\n $.each(result, function (key, item) {\n generateControlsForReload('dynamicAddAchievements', 20, 1, item.UserAchievementId, item.Comment)\n });\n });\n}", "title": "" }, { "docid": "a3eed9bcfdaf686ed980697ab2920964", "score": "0.5430968", "text": "function msg_SuccessfulSave(){\n new PNotify({\n title: 'Saved',\n text: 'New Record Added.',\n type: 'success'\n });\n }", "title": "" }, { "docid": "c56b311761730acd80f0096304d0ce91", "score": "0.5427694", "text": "function save_options() {\n \tvar updateStartup = ($('updateStartup').checked)? true : false;\n \tvar updateHourly = ($('updateHourly').checked)? true : false;\n\tvar officialStable = ($('officialStable').checked)? true : false;\n \tvar stableMismatch = ($('stableMismatch').checked)? true : false;\n\tchrome.storage.sync.set({\n\t\tupdateStartup: updateStartup,\n\t\tupdateHourly: updateHourly,\n\t\tofficialStable: officialStable,\n\t\tstableMismatch: stableMismatch\n }, function() {\n \tif (updateHourly) { \n \t\tchrome.extension.getBackgroundPage().updateHourly = true;\n \t\tchrome.extension.getBackgroundPage().hourlyUpdate();\n \t}\n \telse {\n \t\tchrome.extension.getBackgroundPage().updateHourly = false;\n \t}\n // \tvar status = $('status');\n // \tstatus.style.fontSize = \"10pt\";\n // \tstatus.style.color = \"#99ccff\";\n // \tstatus.textContent = 'saved';\n // \tsetTimeout(function() {\n // \tstatus.textContent = '';\n // }, 1000);\n });\n}", "title": "" }, { "docid": "a39760a1287812c69440e2496e5aee4a", "score": "0.5418912", "text": "save() {\n let serialized_data = this.serializeData(),\n data_lib = this.iframe.scope.contentWindow[CURRENT_LIB].prepareData(this.onboarding.getData(), true);\n try {\n JSON.parse(serialized_data);\n data_lib = JSON.stringify(data_lib);\n } catch (error) {\n return alert('save: ' + error);\n }\n this.onboarding.data_lib(data_lib);\n this.onboarding.data(serialized_data);\n }", "title": "" }, { "docid": "ee7c486bc191c418048d69fa948fec49", "score": "0.54159456", "text": "function btnGoTab2() {\n updateData();\n goTab2();\n console.log(\"to Impact Assessment\");\n}", "title": "" }, { "docid": "96a69785f4779f90ef60b47036bbe82b", "score": "0.54076296", "text": "goValidatePage(event) {\n if(event.detail === \"saved\"){\n this.mbrPage = true;\n //this.srvAcctPage = true;\n this.wizardAcctRel = false;\n }\n }", "title": "" }, { "docid": "4dedc22a72991dc989364c66227a0147", "score": "0.54010975", "text": "saveOptions () {\n // start by setting the saving indicator as true.\n this.saving = true\n\n // save the enabled apps on storage.\n storage.set('enabledApps', this.enabledApps)\n\n // disable the saving indicator.\n this.saving = false\n\n window.chrome.runtime.sendMessage({updated: true}, function (response) {\n console.log(response.farewell)\n })\n }", "title": "" }, { "docid": "dcb0707714803fe3b7402fa7212763d8", "score": "0.5393143", "text": "function observation_form_handler(){\r\n let formdata = new FormData(this);\r\n let show = Model.add_observation(formdata);\r\n console.log(show);\r\n return false;\r\n}", "title": "" }, { "docid": "dca479745eabfb4e9c488cc41b4a7045", "score": "0.53858525", "text": "handleSave(event) {\n\n // var draftValuesStr = JSON.stringify(event.detail.draftValues);\n // updateRecords({ sobList: this.records, updateObjStr: draftValuesStr, objectName: this.relatedObject })\n // .then(result => {\n \n // this.dispatchEvent(\n // new ShowToastEvent({\n // title: 'Success',\n // message: 'Records updated',\n // variant: 'success'\n // })\n // );\n // // Clear all draft values\n // this.draftValues = [];\n // return refreshApex(this.wiredsObjectData);\n // })\n // .catch(error => {\n // console.log('-------error-------------'+error);\n // console.log(error);\n // });\n\n }", "title": "" }, { "docid": "00fa18b64759843c7898a34005b6c1f4", "score": "0.53835046", "text": "function localform_pageInit(){\r\n\r\n/*\r\n// Added this to fix the 'Pending Brief' status issue with workflows.\r\n var isBriefEntered = sweet_job_lib_isSet(nlapiGetFieldValue('custentity_bo_coachbrief'));\r\n if(isBriefEntered){\r\n nlapiSetFieldValue('custentity_coach_brief_isempty', 'T');\r\n } else {\r\n nlapiSetFieldValue('custentity_coach_brief_isempty', 'F');\r\n }\r\n*/\r\noldItemValue = nlapiGetFieldValue('custentity_bo_item');\r\n\r\n}", "title": "" }, { "docid": "ffd6be3018a35aa5fde69fa212cad2bb", "score": "0.5383167", "text": "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n if (typeof erpListGrid1 == \"undefined\") {\r\n break;\r\n }\r\n document.forms[0].txtXML.value = getChangesOnly(erpListGrid1);\r\n var url = getAppPath() + \"/componentmgr/experiencemgr/processErp.do?\";\r\n postAjaxSubmit(url, \"saveAllErp\", false, false, handleOnSaveErpDone);\r\n break;\r\n case 'CLOSE':\r\n if (isOkToChangePage()) {\r\n closeThis();\r\n }\r\n break;\r\n case 'PROCESS_ERP':\r\n if (isOkToChangePage()) {\r\n var url = getAppPath() + \"/componentmgr/experiencemgr/processErp.do?\";\r\n postAjaxSubmit(url, \"processErp\", false, false, handleOnProcessErpDone);\r\n }\r\n break;\r\n case 'SHOW_ALL':\r\n getObject(\"showAll\").value = \"Y\";\r\n getObject(\"renewalYear\").value = \"\";\r\n showProcessingDivPopup();\r\n document.forms[0].action = getAppPath() + \"/componentmgr/experiencemgr/processErp.do?date=\" + new Date();\r\n document.forms[0].process.value = 'loadAllErp';\r\n submitFirstForm();\r\n break;\r\n case 'SEARCH':\r\n getObject(\"showAll\").value = \"N\";\r\n showProcessingDivPopup();\r\n enableDisableField(getObject(\"renewalDate\"), false);\r\n enableDisableField(getObject(\"processDate\"), false);\r\n enableDisableField(getObject(\"erpIssueStateCode\"), false);\r\n enableDisableField(getObject(\"batchNo\"), false);\r\n document.forms[0].action = getAppPath() + \"/componentmgr/experiencemgr/processErp.do?date=\" + new Date();\r\n document.forms[0].process.value = 'loadAllErp';\r\n submitFirstForm();\r\n break;\r\n case 'DELETE_BATCH':\r\n var batchNo = getObjectValue(\"batchNo\");\r\n if (isEmpty(batchNo)) {\r\n alert(getMessage(\"pm.processErp.deleteBatch.noBatchNo.error\"));\r\n return;\r\n }\r\n if (confirm(getMessage(\"pm.processErp.deleteBatch.confirmation\", new Array(batchNo)))) {\r\n var url = getAppPath() + \"/componentmgr/experiencemgr/processErp.do?process=deleteErpBatch&batchNo=\" + batchNo;\r\n new AJAXRequest(\"get\", url, '', handleOnDeleteErpBatchDone, false);\r\n }\r\n break;\r\n }\r\n}", "title": "" }, { "docid": "5f33d4ee6256400b99888e264ea50321", "score": "0.538246", "text": "function save(settings) {\n // Create the rules object\n var rules = [];\n\n // Get all the rules and add them to our rules object\n $('#rules').find('.mui-panel').each(function () {\n var rule = {};\n\n $(this).find('input[type=hidden]').each(function () {\n rule[$(this).prop('id')] = $(this).val();\n });\n\n rules.push(rule);\n });\n\n if (typeof settings === 'undefined') {\n settings = {\n fill_all_form: $(\"#fill_all_form\").is(':checked'),\n ignore_checkboxes: $(\"#ignore_checkboxes\").is(':checked'),\n ignore_disabled_fields: $(\"#ignore_disabled_fields\").is(':checked'),\n ignore_hidden_fields: $(\"#ignore_hidden_fields\").is(':checked'),\n date_types: $('#date_types').find(\":selected\").val(),\n date_range: $(\"#date_range\").val(),\n date_format: $(\"#date_format\").val(),\n time: $(\"#time\").val(),\n rules: rules,\n date_now: $(\"#date_now\").is(':checked'),\n time_now: $(\"#time_now\").is(':checked')\n };\n }\n\n chrome.storage.sync.set(settings, function () {\n // Update status to let user know options were saved.\n $(\".save-wrapper p span\").fadeIn();\n setTimeout(function () {\n $(\".save-wrapper p span\").fadeOut('slow');\n }, 850);\n });\n}", "title": "" }, { "docid": "c9b2447a4b382016b4ca02920cb39571", "score": "0.5380757", "text": "function submitForm() {\n RecordTypes.update(ctl.recordType, function() {\n $scope.$emit('ase.recordtypes.changed');\n $state.go('rt.list');\n }, function(error) {\n $log.debug('Error while editing recordType: ', error);\n });\n }", "title": "" } ]
8d7b56bc5bc693b25c69b6497e16cc2b
! vuex v3.6.0 (c) 2020 Evan You
[ { "docid": "a03cd763f48383a489d74bafa8223f3a", "score": "0.0", "text": "function n(e){var t=Number(e.version.split(\".\")[0]);if(t>=2)e.mixin({beforeCreate:i});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[i].concat(e.init):i,n.call(this,e)}}function i(){var e=this.$options;e.store?this.$store=\"function\"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}", "title": "" } ]
[ { "docid": "1eea2fda3384eaa87fd40942fdf53f00", "score": "0.6809579", "text": "function vuexInit(){var options=this.$options; // store injection\nif(options.store){this.$store = options.store;}else if(options.parent && options.parent.$store){this.$store = options.parent.$store;}}", "title": "" }, { "docid": "38a17ae9bb6c4effd14e9b767c9a551d", "score": "0.6700461", "text": "mutations() {\n let basicStore = this\n\n return {\n /**\n * [updateObject description]\n * @param Vuex.sate state\n * @param JSON updateProperties\n * {\n * state: 'stateKey', // the actual state JSON variable to be modified\n * key: 'updateKey' // key from the JSON state variable to be modified\n * value: 'updateValue'\n * }\n * @deprecated use vuet-updateStateByModel instead!\n */\n [this.mutationTypes.UPDATE_OBJECT_DEPRECATED](\n state,\n updateProperties\n ) {\n if (updateProperties.value === null) {\n return\n }\n basicStore.update(state, {\n model: updateProperties.state,\n key: updateProperties.key,\n data: updateProperties.value,\n })\n },\n /**\n * @param Vuex.sate state\n * @param JSON updateProperties\n * {\n * model: '', // the model to update\n * key: 'updateKey' // obligatory key; if given the key will be update in model\n * data: mixed // if no key is given; data has to be JSON and has to resemble the model you want to update\n * }\n */\n [this.mutationTypes.UPDATE_STATE_BY_MODEL](\n state,\n updateProperties\n ) {\n basicStore.update(state, updateProperties)\n },\n /**\n * @param Vuex.sate state\n * @param JSON updateProperties\n * {\n * state: 'stateKey', // the actual state JSON variable to be modified\n * value: 'updateValue'\n * }\n */\n [this.mutationTypes.UPDATE_STATE_VARIABLE](\n state,\n updateProperties\n ) {\n state[updateProperties.state] = updateProperties.value\n },\n /**\n * Resets a model to its initial/default values\n *\n * @param Vuex.sate state\n * @param String modelName\n */\n [this.mutationTypes.RESET_MODEL](state, modelName) {\n let modelDefinition = state[modelName + 'Definition']\n\n for (let [key, value] of Object.entries(modelDefinition)) {\n state[modelName][key] = value.defaultValue\n }\n },\n }\n }", "title": "" }, { "docid": "415ea3ff80591d74cbbe0cd3123206f2", "score": "0.632244", "text": "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var actions = vuex.actions;\n\t var getters = vuex.getters;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "415ea3ff80591d74cbbe0cd3123206f2", "score": "0.632244", "text": "function vuexInit() {\n\t var options = this.$options;\n\t var store = options.store;\n\t var vuex = options.vuex;\n\t // store injection\n\t\n\t if (store) {\n\t this.$store = store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t // vuex option handling\n\t if (vuex) {\n\t if (!this.$store) {\n\t console.warn('[vuex] store not injected. make sure to ' + 'provide the store option in your root component.');\n\t }\n\t var state = vuex.state;\n\t var actions = vuex.actions;\n\t var getters = vuex.getters;\n\t // handle deprecated state option\n\t\n\t if (state && !getters) {\n\t console.warn('[vuex] vuex.state option will been deprecated in 1.0. ' + 'Use vuex.getters instead.');\n\t getters = state;\n\t }\n\t // getters\n\t if (getters) {\n\t options.computed = options.computed || {};\n\t for (var key in getters) {\n\t defineVuexGetter(this, key, getters[key]);\n\t }\n\t }\n\t // actions\n\t if (actions) {\n\t options.methods = options.methods || {};\n\t for (var _key in actions) {\n\t options.methods[_key] = makeBoundAction(this.$store, actions[_key], _key);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "1a6276721875f027cfceef6bc6721f3f", "score": "0.62043303", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.6062776", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.6062776", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.6062776", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.6062776", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "fbe846cb8f280d3c5e1137943ef83726", "score": "0.6062776", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c1e262fef05c5187db3d6e4aded1fe3b", "score": "0.6053968", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c1e262fef05c5187db3d6e4aded1fe3b", "score": "0.6053968", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c1e262fef05c5187db3d6e4aded1fe3b", "score": "0.6053968", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "c1e262fef05c5187db3d6e4aded1fe3b", "score": "0.6053968", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "514899756d62842d954b9b0d8943fa7b", "score": "0.6053276", "text": "function vuexInit () {\n var options = this.$options\n // store injection\n if (options.store) {\n this.$store = options.store\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store\n }\n }", "title": "" }, { "docid": "6552bfd3f4dacd7e3a985a5faad95aa5", "score": "0.6052143", "text": "exampleIncrement() {\n this.$store.commit('increment');\n }", "title": "" }, { "docid": "59463cf33727587ea0c605ec9b36e42a", "score": "0.60317475", "text": "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.5970357", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.5970357", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "e33a7681d6aa8e808b612d6b426699e5", "score": "0.5970357", "text": "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function' ?\n options.store() :\n options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" }, { "docid": "28cb21b76a5ddec468afef2ab3b068a7", "score": "0.5945058", "text": "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "title": "" } ]
474e34cb736c4571d91db6b1533f6bb1
returns length between two coordinates
[ { "docid": "ebcda0aac365d9bfab47195a2811ed75", "score": "0.0", "text": "function hypotenuse(root, end) {\n return Math.hypot(end.x - root.x, end.y - root.y);\n }", "title": "" } ]
[ { "docid": "7475a236b74cc5a6daa784d6d59c4aae", "score": "0.8162161", "text": "function getLength(x1, y1, x2, y2) {\r\n // Use pythagorean theorem to determine length from (x1, y1) to (x2, y2)\r\n let rise = y2 - y1;\r\n let run = x2 - x1;\r\n return (rise ** 2 + run ** 2) ** 0.5\r\n}", "title": "" }, { "docid": "c660f2fa5d9d0866201d57aedc711932", "score": "0.8139413", "text": "function getLength(x1, y1, x2, y2) {\r\n // Use pythagorean theorem to determine length from (x1, y1) to (x2, y2)\r\n let rise = y2 - y1;\r\n let run = x2 - x1;\r\n return (rise ** 2 + run ** 2) ** 0.5;\r\n}", "title": "" }, { "docid": "c76d4a8fc7d682ed4acbc3d9442107d6", "score": "0.77130747", "text": "function length(x,y)\n{\n return Math.sqrt(x*x + y*y)\n}", "title": "" }, { "docid": "12e192ee1d0c76b8a05c2005d5e3dcfc", "score": "0.76498306", "text": "function len(x,y) {\n return Math.sqrt(x*x+y*y);\n }", "title": "" }, { "docid": "745aaa289704146fe59bbdbc4a357dec", "score": "0.7644241", "text": "function getLength(x0, y0, x1, y1) {\n // returns the length of a line segment\n const x = x1 - x0;\n const y = y1 - y0;\n return Math.sqrt(x * x + y * y);\n}", "title": "" }, { "docid": "668a39549180cfd93cccf89689b54086", "score": "0.75657415", "text": "function len(v1, v2) {\n const retval = v1.pos.dist(v2.pos);\n // console.log(`len ${retval}`);\n return retval;\n}", "title": "" }, { "docid": "d13ab516492dea64a0ccf41fee66d481", "score": "0.75519824", "text": "getLength() {\n if(this.x0 === null || this.y0 === null || this.x1 === null || this.y1 === null) {\n throw 'Coordinates are not complete';\n }\n \n var a = this.x0 - this.x1;\n var b = this.y0 - this.y1;\n \n return Math.sqrt(a*a + b*b);\n }", "title": "" }, { "docid": "899f5a632cec59e82dad4979c88f14fd", "score": "0.7454846", "text": "getLength(coords) {\n return Math.round(Math.sqrt((coords.x1-coords.x2)*(coords.x1-coords.x2)+(coords.y1-coords.y2)*(coords.y1-coords.y2))); \n }", "title": "" }, { "docid": "e5fdbe563035b258ba270e0093ed068a", "score": "0.7338603", "text": "function len(a, b) {\n return Math.sqrt(Math.pow((b[0] - a[0]), 2) + Math.pow((b[1] - a[1]), 2)); \n}", "title": "" }, { "docid": "c3907adace7b07f8ee132a4b1b0ab712", "score": "0.7248378", "text": "get length() {\n return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));\n }", "title": "" }, { "docid": "246b5c55c051b83b0ab4c0d3880c432e", "score": "0.7187693", "text": "lineLength(pointA, pointB) {\n const len = Snap.len(pointA.x, pointA.y, pointB.x, pointB.y);\n\n return len;\n }", "title": "" }, { "docid": "430220624fe8a230a7fb0cc37f8ba286", "score": "0.71763045", "text": "length() {\n return (Math.sqrt(Math.pow(this.__x), 2) + (Math.pow(this.__y), 2));\n }", "title": "" }, { "docid": "d89ef8aa3208a8545a2c316daaeae74a", "score": "0.71507657", "text": "get length() {\n return Math.hypot(this.x, this.y);\n }", "title": "" }, { "docid": "6de39fc6657182403068618a8d38a7a2", "score": "0.69841236", "text": "length() {\n return Math.sqrt((this.x) * (this.x) + (this.y) * (this.y));\n }", "title": "" }, { "docid": "650ab2ee399bf65309f5fafd29ec8f77", "score": "0.69735867", "text": "get length(){\n return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));\n }", "title": "" }, { "docid": "650ab2ee399bf65309f5fafd29ec8f77", "score": "0.69735867", "text": "get length(){\n return Math.sqrt(Math.pow(this.x,2)+Math.pow(this.y,2));\n }", "title": "" }, { "docid": "01420fb8ee708e289ecd9a626adb9b2b", "score": "0.69057757", "text": "length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "title": "" }, { "docid": "01420fb8ee708e289ecd9a626adb9b2b", "score": "0.69057757", "text": "length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "title": "" }, { "docid": "d877bdd96e1a6a684923c6d080ce1a3c", "score": "0.6901243", "text": "get length() {\n return Math.sqrt((this.x * this.x) + (this.y * this.y));\n }", "title": "" }, { "docid": "f16f4b0d2d8199588870ab467173308b", "score": "0.6891685", "text": "function calcPathLength(startX, startY, endX, endY) {\n var minX = endX - startX;\n var minY = endY - startY;\n return Math.ceil(Math.sqrt((minX*minX)+(minY*minY))); //round up to nearest integer\n}", "title": "" }, { "docid": "1c5c4a7ba2e566c7727202742897033d", "score": "0.68650705", "text": "get length() {\n return Math.sqrt(this.dx ** 2 + this.dy ** 2);\n }", "title": "" }, { "docid": "f3b438ba12b8a0805e88b74057fa7b5e", "score": "0.6840646", "text": "function distance(coord1, coord2) {\n\n}", "title": "" }, { "docid": "414e52383edecc3eaa0022919bcf3584", "score": "0.6836239", "text": "len() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }", "title": "" }, { "docid": "e708e6c466b834a76aeb51b1fd2344a2", "score": "0.6801208", "text": "function geoVecLengthSquare(a, b) {\n\t b = b || [0, 0];\n\t var x = a[0] - b[0];\n\t var y = a[1] - b[1];\n\t return (x * x) + (y * y);\n\t}", "title": "" }, { "docid": "c08a8ca85def639da212e538bd57c62e", "score": "0.67697245", "text": "get length(){\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }", "title": "" }, { "docid": "c4038954c8b6dade375a53ba4e206bc1", "score": "0.6769058", "text": "function dist(p1, p2) {\r\n\treturn length(diff(p2,p1));\r\n}", "title": "" }, { "docid": "bd82199984bfe3c869846122b972ad1e", "score": "0.67230284", "text": "function len_rect(a, b) {\n return Math.abs((a[0] - b[0]) + (a[1] - b[1]));\n}", "title": "" }, { "docid": "362d27689fef7b0066e3c00ac3d238ea", "score": "0.671461", "text": "function length(v) {\r\n return Math.hypot(v.x, v.y);\r\n}", "title": "" }, { "docid": "6b4ec153526923d92560234403159010", "score": "0.6666739", "text": "function distanceTo(coord1,coord2){\r\n return Math.sqrt( (Math.pow( coord2[0]-Math.abs(coord1[0]),2 ))+(Math.pow( Math.abs(coord2[1])-Math.abs(coord1[1]),2 ))); \r\n}", "title": "" }, { "docid": "027c8b3cf106b8463f4c8b1f6eeea777", "score": "0.66459036", "text": "function ptsLength( src, tgt ) { \n\t\treturn Math.sqrt( Math.pow( src.x - tgt.x, 2) + \n\t\t\t\t\t\t\tMath.pow( src.y - tgt.y, 2) );\n\t}", "title": "" }, { "docid": "c3ad868c7b9e754dace6e96a1d43903c", "score": "0.6584778", "text": "static distance(a, b) {\n return Cell.length(Cell.minus(a, b));\n }", "title": "" }, { "docid": "8ad1952b78521e51dbae4b4531b079e7", "score": "0.65384465", "text": "function vectorLength([x, y]) {\n return Math.sqrt(x * x + y * y);\n }", "title": "" }, { "docid": "9dfa880bd962517b72fda8b3e2e25bf2", "score": "0.65270436", "text": "function distance(x1, y1, x2, y2) {return Math.hypot(x2-x1, y2-y1);}", "title": "" }, { "docid": "4d65e7a44c5038efce2642f870582981", "score": "0.6471458", "text": "static distance(a, b) {\n const dx = a.x - b.x;\n const dy = a.y - b.y;\n \n return Math.hypot(dx, dy);\n }", "title": "" }, { "docid": "56a2338b7b5e23c8727e6d6a54966448", "score": "0.64688504", "text": "function dist(x0, y0, x1, y1) { return Math.sqrt(Math.pow(Math.abs(x0-x1),2) + Math.pow(Math.abs(y0-y1),2)); }", "title": "" }, { "docid": "1b387fd6f44bf1bcad8cc5fd6ac8f95a", "score": "0.6468035", "text": "calculateDistanceBetween(p1,p2){\n return Math.sqrt(Math.pow((p2.x - p1.x),2) + Math.pow((p2.y - p1.y),2))\n }", "title": "" }, { "docid": "08c857511b1917db37fa6bb2fe4941fc", "score": "0.64451325", "text": "static distance(a, b) {\n return Math.sqrt((Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2)));\n }", "title": "" }, { "docid": "c616997f9a692b4f53268d93db7bfeed", "score": "0.64380324", "text": "function getDistance(x1, y1, x2, y2)\n{\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) * 1); \n}", "title": "" }, { "docid": "b749c04905bcd255e83c480cbfd283fd", "score": "0.64152783", "text": "function get_length(v) {\n return Math.sqrt(v.x * v.x + v.y * v.y)\n}", "title": "" }, { "docid": "e5592c6ee2a96a29c38677ba5fd4c19f", "score": "0.64120793", "text": "function distBetweenPoints(x1, y1, x2, y2) {\r\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2-y1,2));\r\n}", "title": "" }, { "docid": "96718fe3061ce248038d3d959a964d46", "score": "0.6399555", "text": "function dist( a, b ) {\n\t return Math.sqrt( Math.pow( a.x - b.x, 2 ) + Math.pow( a.y - b.y, 2 ) );\n\t}", "title": "" }, { "docid": "77ef80ab9515965cb74dd7a6aa3edb46", "score": "0.6383599", "text": "function distance(first, second) {\n\tvar x = first.x - second.x;\n\tvar y = first.y - second.y;\n\treturn Math.hypot(x, y);\n}", "title": "" }, { "docid": "1abe3a2544439fe8f678979230f5862b", "score": "0.6380331", "text": "static distance(a, b){\n const dx = a.x - b.x;\n const dy = a.y - b.y;\n\n return Math.hypot(dx, dy);\n }", "title": "" }, { "docid": "57e8b8bb29f07d0b0da4f62cf0408117", "score": "0.6378581", "text": "function distanceBetweenTwoPoints(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2));\n}", "title": "" }, { "docid": "6495c1ab528aa8ab7b8ec33332a89bd7", "score": "0.6375721", "text": "dist (pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "title": "" }, { "docid": "4c73dd87435b727853c08bcb4a59c261", "score": "0.63705015", "text": "getTotalLength() {\n let totalLength = 0;\n\n for (let i = 1; i < this.polygon.length; i++) {\n totalLength += vec2__WEBPACK_IMPORTED_MODULE_1__(\n this.polygon[i][0] * this.scale,\n this.polygon[i][1] * this.scale\n ).distance(\n vec2__WEBPACK_IMPORTED_MODULE_1__(\n this.polygon[i - 1][0] * this.scale,\n this.polygon[i - 1][1] * this.scale\n )\n );\n }\n\n return totalLength;\n }", "title": "" }, { "docid": "455a257b9a71019f214b462613f333d1", "score": "0.63672745", "text": "dist(pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "title": "" }, { "docid": "455a257b9a71019f214b462613f333d1", "score": "0.63672745", "text": "dist(pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "title": "" }, { "docid": "1c79209dee479558c51a82f4143f38ac", "score": "0.63618207", "text": "function getDistance(p1, p2) {\n\treturn Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2);\n}", "title": "" }, { "docid": "cddc347902441fe8da58d82005a4f252", "score": "0.634977", "text": "function distance(x1, y1, x2, y2) {\n\treturn Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2));\n}", "title": "" }, { "docid": "268bc138575b5b306c7d1258d6a35f28", "score": "0.63472956", "text": "function distance(a, b) {\r\n return Math.hypot(a.x - b.x, a.y - b.y);\r\n}", "title": "" }, { "docid": "ba12067962457a57185bcb3f017369e8", "score": "0.6346171", "text": "function Distance (l1,l2){ \n return Math.sqrt(Math.pow(l2.x - l1.x, 2) + Math.pow(l2.y - l1.y, 2) );\n}", "title": "" }, { "docid": "06fbb846fc65d8c3bbf77a6357cbcc1e", "score": "0.63413674", "text": "function dist(a, b)\n{\n return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n}", "title": "" }, { "docid": "9865a92c03a2dac0bcc3a6678e4dbced", "score": "0.63409936", "text": "function getDistance(x1, y1, x2, y2){\n //TODO let\n var xDistance = x2 - x1;\n var yDistance = y2 - y1;\n return Math.sqrt(Math.pow(xDistance,2)+Math.pow(yDistance,2));\n}", "title": "" }, { "docid": "a4c8e0331ae20bcaf1aa8aab186fecdf", "score": "0.63338184", "text": "function distanceBetween(lat1, lon1, lat2, lon2) {\n var radlat1 = Math.PI * lat1/180;\n \tvar radlat2 = Math.PI * lat2/180;\n \tvar theta = lon1-lon2;\n \tvar radtheta = Math.PI * theta/180;\n \tvar dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n \tdist = Math.acos(dist);\n \tdist = dist * 180/Math.PI;\n \tdist = dist * 60 * 1.1515;\n \tdist = dist * 1.609344;\n\n \treturn dist;\n }", "title": "" }, { "docid": "2f7359448af1b02c843c3a142b880182", "score": "0.6325301", "text": "function distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2))\n }", "title": "" }, { "docid": "cf3f33e5e0387b34dfc5ab729582f540", "score": "0.6313529", "text": "function getDistance(x1, y1, x2, y2) {\n\treturn Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2));\n}", "title": "" }, { "docid": "532a2fe17c216c50cd1a208dda890ca2", "score": "0.6304989", "text": "function distance(x1, x2, y1, y2){ \r\n\tlet a = x1 - x2;\r\n\tlet b = y1 - y2;\r\n\tlet c = Math.sqrt( a*a + b*b );\r\n\treturn c;\r\n}", "title": "" }, { "docid": "47f0f8ccf7660276a4eb434b558375e6", "score": "0.6304354", "text": "function distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n }", "title": "" }, { "docid": "70612321e753e658f8d051d8d347c0fa", "score": "0.63026714", "text": "function getDistance(x1, y1, x2, y2)\n{\n var sum1=x1+x2;\n var sum2=y1+y2;\n return(sum1-sum2);\n}", "title": "" }, { "docid": "a493ced28240b124d91235fff9840c08", "score": "0.62969315", "text": "dist (pos1, pos2) {\n\t return Math.sqrt(\n\t Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n\t );\n\t }", "title": "" }, { "docid": "a493ced28240b124d91235fff9840c08", "score": "0.62969315", "text": "dist (pos1, pos2) {\n\t return Math.sqrt(\n\t Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n\t );\n\t }", "title": "" }, { "docid": "6363924cca4da3fc6a7c35eae06e9562", "score": "0.6296279", "text": "function getDistance(pos1,pos2){\n\tdistanceTo = [0,0];\n\tdistanceTo[0] = (pos1[0]-pos2[0]);\n\tdistanceTo[1] = (pos1[1]-pos2[1]);\n\treturn Math.sqrt(Math.pow(distanceTo[0],2)+Math.pow(distanceTo[1],2));\n}", "title": "" }, { "docid": "9e00a3dfd7b99e449d195ff2021db699", "score": "0.62962174", "text": "function distanceBetweenTwoPoints(p1, p2) {\n const a = p1.x - p2.x;\n const b = p1.y - p2.y;\n\n return Math.hypot(a, b);\n}", "title": "" }, { "docid": "c45fa2a1ec1003d0fc6694f6cac9f130", "score": "0.62934136", "text": "function getDistance(pos1, pos2) {\r\n return Math.sqrt(Math.pow(pos1.lat - pos2.lat, 2) + Math.pow(pos1.lng - pos2.lng, 2));\r\n}", "title": "" }, { "docid": "b0d55b68f0c79e55aeb7d5f209763ded", "score": "0.62789994", "text": "static dist(a, b) {\r\n return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2);\r\n }", "title": "" }, { "docid": "cfc2a03dc5918440f16c428a283859db", "score": "0.6278385", "text": "calcLength(){\n return Math.sqrt(Math.pow(this.calcWidth(), 2) + Math.pow(this.calcHeight(), 2)); \n }", "title": "" }, { "docid": "b38507ac0f60e87e98feddff9c3faae8", "score": "0.62757325", "text": "function getDistance(x1,y1,x2,y2)\n {\n return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);\n }", "title": "" }, { "docid": "42fd96750a934a55f6d2a1ed6890881d", "score": "0.62747484", "text": "function dist(x1, y1, x2, y2) {\n var a = x1 - x2;\n var b = y1 - y2;\n var c = Math.sqrt( a*a + b*b );\n return c;\n}", "title": "" }, { "docid": "4380fdba6092e7ea49c519613643bc4d", "score": "0.6274731", "text": "distance(pos1, pos2){\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "title": "" }, { "docid": "d6be795d785d572cc56c168d4624179a", "score": "0.6267446", "text": "function getDistance(a, b) {\n\tconst distance = Math.sqrt(Math.pow(b.x - a.x, 2) + Math.pow(b.y - a.y, 2));\n\treturn parseFloat(distance.toFixed(3));\n}", "title": "" }, { "docid": "4f0a6ec9ec6b3b2d48cd6b35fe4c866e", "score": "0.62655354", "text": "function dist(x,y,x1,y1){\n return Math.sqrt((x-x1)*(x-x1) + (y-y1)*(y-y1));\n}", "title": "" }, { "docid": "0755630af93a5cbb877fad29b06e105d", "score": "0.62580097", "text": "function distance(x1, y1, x2, y2) {\r\n return Math.abs(x1 - x2) + Math.abs(y1 - y2);\r\n}", "title": "" }, { "docid": "89fe71b0df47b6e51c58cae51dfa8bcd", "score": "0.6257614", "text": "function calculateDistance() {\n\t\t\treturn Math.round(Math.sqrt(Math.pow(end.x - start.x, 2) + Math.pow(end.y - start.y, 2)));\n\t\t}", "title": "" }, { "docid": "e656c71f440b10478c2e8fd5fd4ffcb4", "score": "0.62561023", "text": "distanceBetweenPoints(p1, p2)\r\n {\r\n let dx, dy, dz;\r\n\r\n dx = p2[0] - p1[0];\r\n\r\n dy = p2[1] - p1[1];\r\n\r\n dz = p2[2] - p1[2];\r\n\r\n return Math.hypot(dx, dy, dz);\r\n }", "title": "" }, { "docid": "a799d18c8ca871d48b06730a6a75bbc6", "score": "0.6254256", "text": "function distance(p1, p2) {\n return Math.floor(Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2)));\n }", "title": "" }, { "docid": "6f3fc3b3f12579f3a037bde284cc5ec5", "score": "0.62441796", "text": "function dist(p1, p2) {\n var lat1 = p1.latitude, lat2 = p2.latitude, lon1 = p1.longitude, lon2 = p2.longitude;\n \tif ((lat1 == lat2) && (lon1 == lon2)) { return 0 }\n \telse {\n \t\tvar radlat1 = Math.PI * lat1/180;\n \t\tvar radlat2 = Math.PI * lat2/180;\n \t\tvar theta = lon1-lon2;\n \t\tvar radtheta = Math.PI * theta/180;\n \t\tvar dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n \t\tif (dist > 1) { dist = 1 }\n \t\tdist = Math.acos(dist);\n \t\tdist = dist * 180/Math.PI;\n \t\tdist = dist * 60 * 1.1515;\n \t\treturn dist;\n }\n } // End of dist(2)", "title": "" }, { "docid": "eea6bcd1308fc728d0a31446ff8555e4", "score": "0.6242676", "text": "function calculateLength(v) {\n return Math.sqrt(v.x * v.x + v.y * v.y);\n}", "title": "" }, { "docid": "52c8bb36504b89349f81e926552f66c4", "score": "0.6242154", "text": "length() {\n const steps = 10;\n let length = 0;\n let px;\n let py;\n\n for (let i = 0; i <= steps; i += 1) {\n // console.log(this.startPoint.x);\n const t = i / steps;\n const cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\n const cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\n\n if (i > 0) {\n const xdiff = cx - (px);\n const ydiff = cy - (py);\n\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n }\n\n px = cx;\n py = cy;\n }\n\n return length;\n }", "title": "" }, { "docid": "e1a83c92674877bc26aa0f116e0dcba4", "score": "0.62390053", "text": "function getDistance(x1,y1,x2,y2){\n return Math.sqrt( (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));\n }", "title": "" }, { "docid": "2d2898bac61e2e36c2b1558c2050233d", "score": "0.6238114", "text": "function distanceBetweenPoints(x1, y1, x2, y2) \n{\n var dx = x2 - x1;\n var dy = y2 - y1;\n return Math.sqrt(dx * dx + dy * dy);\n}", "title": "" }, { "docid": "ef10c5083a83447e2a5d0f052a8ddbe0", "score": "0.6237223", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "e20e892a51ce1c173c65d5fa128d9baf", "score": "0.6236702", "text": "function distance(x1,y1,x2,y2) {\n return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\n}", "title": "" }, { "docid": "162ea49915cc98bf8009b988992c43d4", "score": "0.6235363", "text": "function distance(p1, p2) {\n return Math.floor(Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2)));\n}", "title": "" }, { "docid": "d70c255f05c9b4bd09ae86cbfba93c7d", "score": "0.6234733", "text": "function vecLen(a) {\n return Math.hypot(a.x, a.y);\n}", "title": "" }, { "docid": "6d36c3ebba78cdec0d1346792f8a9b34", "score": "0.62309223", "text": "function calcDistance(x1,y1,x2,y2){\r\n\treturn Math.sqrt((Math.pow((x2-x1),2)+Math.pow((y2-y1),2)));\r\n}", "title": "" }, { "docid": "838941a9a8b0fce67f3a574b33703209", "score": "0.62306285", "text": "function dist(x1, y1, x2, y2) {\n return Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));\n}", "title": "" }, { "docid": "696c003a2c7828cdf206bf2d8027ad8a", "score": "0.62245995", "text": "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n }", "title": "" }, { "docid": "c1075b3335b7fd08edb4baa5ebfa12d1", "score": "0.6222638", "text": "function distance(x1, x2, y1, y2){\n\treturn Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));\n}", "title": "" }, { "docid": "7311fe93b484fa98f9f80b65d8c18cbc", "score": "0.622041", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "7311fe93b484fa98f9f80b65d8c18cbc", "score": "0.622041", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "7311fe93b484fa98f9f80b65d8c18cbc", "score": "0.622041", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "7311fe93b484fa98f9f80b65d8c18cbc", "score": "0.622041", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "7311fe93b484fa98f9f80b65d8c18cbc", "score": "0.622041", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "7311fe93b484fa98f9f80b65d8c18cbc", "score": "0.622041", "text": "function getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "title": "" }, { "docid": "0079ffb620a90ffcd2f16f0122b8cd5a", "score": "0.621866", "text": "function getDistance (p1, p2) {\r\n\treturn Math.sqrt( Math.abs( ( (p1.x - p2.x) * (p1.x - p2.x) ) + ( (p1.y - p2.y) * (p1.y - p2.y) ) ) );\r\n}", "title": "" }, { "docid": "be0722814d3265c2e2469cddb1e1bb36", "score": "0.62163126", "text": "function distanceBetween(p1, p2) {\n var diffX = p1.x - p2.x;\n var diffY = p1.y - p2.y;\n var diffXSquared = diffX * diffX;\n var diffYSquared = diffY * diffY;\n var distanceSquared = diffXSquared + diffYSquared;\n var distance = Math.sqrt(distanceSquared);\n return distance;\n}", "title": "" }, { "docid": "674867edfd858a06bc2ec336b8d89d0d", "score": "0.6213783", "text": "function getDistance( point1, point2 ){\n var xs = 0;\n var ys = 0;\n \n xs = point2.x - point1.x;\n xs = xs * xs;\n \n ys = point2.y - point1.y;\n ys = ys * ys;\n \n return Math.sqrt( xs + ys );\n}", "title": "" }, { "docid": "81e5dfadf49df7bac1d461eba18fd2d8", "score": "0.62118834", "text": "function distance(x1,y1,x2,y2){\r\n\tvar dx = x2-x1;\r\n\tvar dy = y2-y1;\r\n\treturn Math.sqrt(dx*dx,dy*dy);\r\n}", "title": "" }, { "docid": "d05ef04212bc2998958705a3a42d4739", "score": "0.6210733", "text": "function distance (x1, y1, x2, y2) {\n let dist = Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))\n return dist\n}", "title": "" }, { "docid": "ab3a7824b3b305b9b46a8ed868962a15", "score": "0.6208813", "text": "function latlngDistance(ll1, ll2) {\n var rr1 = [ll1[0] / 180 * Math.PI, ll1[1] / 180 * Math.PI]\n var rr2 = [ll2[0] / 180 * Math.PI, ll2[1] / 180 * Math.PI]\n\n var dx = (rr1[1] - rr2[1]) * Math.cos(0.5 * (rr1[0] + rr2[0]))\n var dy = rr1[0] - rr2[0]\n\n var dist = Math.sqrt(dx * dx + dy * dy) * 6378137\n return dist\n }", "title": "" } ]
f26d0e4185d725e369cf4ff192a043d9
Define initialize map Function
[ { "docid": "43d57511f808a6b3e4a70c4bd43b1f60", "score": "0.0", "text": "function initialize_map() {\n map = new google.maps.Map(document.getElementById('map-container'), {\n center: { lat: 40.753050, lng: -74.011888 },\n zoom: 10,\n });\n\n\n // Try HTML 5 GeoLocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition((position) => {\n const pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n\n map.setCenter(pos);\n }, () => {\n handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n };\n\n //the following can't get the position because it's async\n // navigator.geolocation.getCurrentPosition(function(position) {\n // lat = position.coords.latitude;\n // lng = position.coords.longitude;\n // });\n \n\n // var loc = `lat: ${lat} lng: ${lng}`;\n // locationInput.val(loc);\n\n map.addListener('click', function(e) {\n // if the previousMarker exists, remove it\n if (previousMarker)\n previousMarker.setMap(null);\n\n latLng = e.latLng;\n\n lat = latLng.lat().toFixed(4);\n lng = latLng.lng().toFixed(4);\n console.log(lat);\n console.log(lng);\n\n const loc = `lat: ${lat} lng: ${lng}`;\n locationInput.val(loc);\n\n previousMarker = new google.maps.Marker({\n position: latLng,\n map: map\n });\n });\n\n}", "title": "" } ]
[ { "docid": "a814617bf0d8b84e099da670745395bb", "score": "0.8747728", "text": "function initMap() {}", "title": "" }, { "docid": "33b718b2edd43ef2f918f3ce91165543", "score": "0.83209974", "text": "function initMap() {\n}", "title": "" }, { "docid": "49312a0cb65dd234c5634e96f6e16f3a", "score": "0.8222613", "text": "function initMap() {\n\t\t \n\t\t}", "title": "" }, { "docid": "5192f21daa352281d274b7b636ed0a40", "score": "0.8220784", "text": "function initMap() {\n\t\n}", "title": "" }, { "docid": "afe0478e890ab154c809409925c4c1c3", "score": "0.7943342", "text": "function initMap() {\r createMapElements();\r }", "title": "" }, { "docid": "25abd4533128f8764b8b163d54279bde", "score": "0.78226537", "text": "function initialize() {\n initMap();\n}", "title": "" }, { "docid": "e205c16d9918e5dff6915f844445d231", "score": "0.7645708", "text": "function initialize(){\n createMap();\n}", "title": "" }, { "docid": "189997d0c0666f6614572a0a40a942fa", "score": "0.76284283", "text": "function initMap() {\n loadMap(\"\", 0.0, 0.0);\n}", "title": "" }, { "docid": "9aef7d77ce652d5c93217535a417f625", "score": "0.7579675", "text": "_init() {\n this._randomFillMap();\n this._permuteMap();\n }", "title": "" }, { "docid": "c63ea79967d6500be8f6d1e8520f1d8a", "score": "0.75038564", "text": "function initializeMap(){\n for (var i = 0; i < 4; i++) {\n map[i]=[0,0,0,0,0,0,0]\n }\n}", "title": "" }, { "docid": "1145ed258adafc7e1d1c74500c0af2ba", "score": "0.73633957", "text": "initMap(){\n console.warn('Warning in Map: you should redeclare your own initMap function')\n }", "title": "" }, { "docid": "4d1a0bca06d506fa96c387c6e6389184", "score": "0.7309346", "text": "loadMap(){}", "title": "" }, { "docid": "122a6cd5c7eab87a0dc503b6cf3aa786", "score": "0.7251151", "text": "function initMaps() {\n for (const map of mapInstances) {\n map();\n }\n}", "title": "" }, { "docid": "4470475a5457b646fe854963fab2d70a", "score": "0.72457033", "text": "function customBeforeMapInit() {\n}", "title": "" }, { "docid": "cb67023b992a6d82585929f36fb9816c", "score": "0.70836675", "text": "function init() {\n initMap();\n importData();\n}", "title": "" }, { "docid": "33ae6ffe0d26e7011d2e03e186ec0496", "score": "0.6998905", "text": "function initMap() {\n /*Only exists so that we can use the Google APIs script*/\n}", "title": "" }, { "docid": "ab053d348c32bd8a8336a2b743f1107e", "score": "0.69224095", "text": "function init() {\n initMap();\n buildAllDreams();\n}", "title": "" }, { "docid": "35a293c1d6405f18cc4767abc429af9b", "score": "0.69148576", "text": "function _createMap(m){\n map = m;\n}", "title": "" }, { "docid": "43e5dbd6003487db208f1dff28bbf76d", "score": "0.69064945", "text": "function init (options, features) {\n return map.init(options, features);\n }", "title": "" }, { "docid": "c5aa797dde43305393b38d567ae19374", "score": "0.69007885", "text": "function Game_Map(){this.initialize.apply(this,arguments);}", "title": "" }, { "docid": "05a24277e9ba1b1c565f548128e857d4", "score": "0.69003886", "text": "function Spriteset_Map() {\n this.initialize(...arguments);\n}", "title": "" }, { "docid": "d83e4c68dab08a6ba460887414f42477", "score": "0.68567455", "text": "function init_map() {\n var row_init = 0;\n var counter = row_init;\n for (var i = 0; i < MAP_HEIGHT; i++) {\n global_map[i] = [];\n counter = row_init;\n for (var j = 0; j < MAP_WIDTH; j++) {\n global_map[i][j] = counter % 2;\n counter++;\n }\n row_init = row_init+1 % 2;\n }\n }", "title": "" }, { "docid": "61f197f8cfa9dc7b6f2ae954def4a053", "score": "0.67763877", "text": "function initMap() { // eslint-disable-line no-unused-vars\n mapLoadState.resolve(new google.maps.Map(document.getElementById('map'), {\n center: { lat: 38.8993278, lng: -77.0846061 },\n scrollwheel: true,\n zoom: 13\n }));\n}", "title": "" }, { "docid": "c71fe059da804c6f93d96002fa57eb1e", "score": "0.6769346", "text": "function initMap() {\n var mapController = new MapController();\n}", "title": "" }, { "docid": "88b484feb71bacb7265fb8c171b167a1", "score": "0.67574304", "text": "constructor() {\n this.map = {};\n }", "title": "" }, { "docid": "88b484feb71bacb7265fb8c171b167a1", "score": "0.67574304", "text": "constructor() {\n this.map = {};\n }", "title": "" }, { "docid": "6fab19e3b1511dfdce60f5712a407111", "score": "0.6756342", "text": "function init(){\n\t//map = initMap(20,20);\n\t//gotoHouse(\"random\");\n\tnewOverworld();\n\trenderStatus();\n\trenderText();\n\n\t//save first world data\n\tmapDat = {};\n\tsaveWorldDat(mapNum);\n\tmapDat[mapNum].index = mapNum;\n\tmapNum++;\n}", "title": "" }, { "docid": "f0afb4c84b55a42407652825fa3ee0bf", "score": "0.67501414", "text": "function Spriteset_Map() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "4e0c73c39463cf5268e6efab754d9369", "score": "0.6745877", "text": "initializeMap_() {\n const paramHash = JSON.stringify(this.config_);\n if (this.templateCache_[paramHash]) {\n this.applyTemplate_(this.templateCache_[paramHash]);\n return;\n }\n let mapUrl = 'https://' + this.account_ + '.carto.com/api/v1/map';\n\n if (this.mapId_) {\n mapUrl += '/named/' + this.mapId_;\n }\n\n const client = new XMLHttpRequest();\n client.addEventListener(\n 'load',\n this.handleInitResponse_.bind(this, paramHash)\n );\n client.addEventListener('error', this.handleInitError_.bind(this));\n client.open('POST', mapUrl);\n client.setRequestHeader('Content-type', 'application/json');\n client.send(JSON.stringify(this.config_));\n }", "title": "" }, { "docid": "c76a67e33571021acc68d013ae590821", "score": "0.6700788", "text": "function initialize(){\n\n cities();\n createMap();\n\n}", "title": "" }, { "docid": "a23d0f6a20024de5f864dc4790f51bc9", "score": "0.66825587", "text": "function setup_map(){\n let map = {capitalist : 0, curious:0,geniesser : 0,perfectionist:0};\n\n for(const behavior of AGENT_BEHAVIORS){\n map[behavior] = {agent_cnt : 0 ,stress : 0 , fld : 100, rt : 0 , aot : 0 };\n }\n\n return map;\n\n}", "title": "" }, { "docid": "2f169492637214e85cf93c2116f2277a", "score": "0.66787606", "text": "function initializeMap() {\n overlay.indeterminate('Initializing map... Please Wait.');\n $('input').prop('disabled', true);\n CityBorder.objects.filter({'name': 'Chicago'}, function(data){\n var chicago = data[0];\n var sw = chicago.box.sw;\n var ne = chicago.box.ne;\n map.fitBounds(new google.maps.LatLngBounds(\n {lat:sw.lat, lng:sw.lon}, {lat:ne.lat, lng:ne.lon}));\n var center = JSON.parse(chicago.center).coordinates\n map.setCenter(new google.maps.LatLng(center[1], center[0]));\n map.data.addGeoJson(JSON.parse(chicago.geojson));\n map.data.setStyle({\n strokeWeight: 1\n });\n });\n }", "title": "" }, { "docid": "8024f42a446112d85dd0133a4433999b", "score": "0.66743594", "text": "function mapReady() {} // Must exist even if empty", "title": "" }, { "docid": "4165727e114beae068997de77aaf9219", "score": "0.6664794", "text": "function initDefaultMap()\n{\n initMap($('#mapinfo'),-122.392,37.6148)\n}", "title": "" }, { "docid": "0050c5e7cba718a22e4d287267957ab7", "score": "0.66595864", "text": "function InitMap()\n{\n\tvar devMap = AsciiArtToMap(TestMap());\n\tfor(var iy = 0; iy < MapSizeY; iy++)\n\t{\n\t\tvar mapColumnArray = [];\n\t\tfor(var ix = 0; ix < MapSizeX; ix++)\n\t\t{\n\t\t\tif (devMap[iy] && devMap[iy][ix])\n\t\t\t{\n\t\t\t\tmapColumnArray.push(devMap[iy][ix]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar tile = new Empty;\n\t\t\t\ttile.setPos(iy, ix);\n\t\t\t\tmapColumnArray.push(tile);\n\t\t\t}\n\t\t}\n\t\tMap.push(mapColumnArray)\n\t}\n}", "title": "" }, { "docid": "978097d050273aa685dae74bf44593f7", "score": "0.6654484", "text": "function initmap() {\n\t\tvar tileURL = 'http://{s}.tile.cloudmade.com/CLOUDMADE_API_KEY/997/256/{z}/{x}/{y}.png';\n\t\tvar attribString = 'Map data &copy; <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors, <a href=\"http://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"http://cloudmade.com\">CloudMade</a>';\n\t\tvar tileLayer = new L.tileLayer(tileURL, {\n\t\t\tattribution: attribString,\n\t\t\tminZoom: 8,\n\t\t\tmaxZoom: 18\n\t\t});\n\n\t\tmap.addLayer(tileLayer);\n\t\tmap.locate({setView: true, maxZoom: 16});\n\n\t\tmap.on('moveend', onMoveEnd);\n\n\t\tdoAuth();\n\t}", "title": "" }, { "docid": "2d043756e23cd6b9a357b0945fc6559a", "score": "0.66494465", "text": "function initialise() {\n\tzeroMap();\n\tgetGameState();\n}", "title": "" }, { "docid": "729d6e950b268788b3a6f29e2656bd31", "score": "0.6646017", "text": "function Map(data){\n this.elements = data;\n this.fetch_map(); //This is async -- it calls initialize when done\n }", "title": "" }, { "docid": "4be7f3f5b90880df50466d09346ca6fe", "score": "0.663868", "text": "function initMap() {//causes the getlocations to go before the initMap\n getLocations(continueInitMap); //get locations from database\n}", "title": "" }, { "docid": "78c16fe227008aa9ed64dc43e87bba4a", "score": "0.6600837", "text": "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "title": "" }, { "docid": "40e92b9f17abc9c908c5e6db2e0d88e9", "score": "0.66002774", "text": "constructor () {\n this.map = new Map();\n }", "title": "" }, { "docid": "f6302aebcc8bd531d7b74d8261c038b6", "score": "0.65959173", "text": "function createMap(){return new MapCtr();}", "title": "" }, { "docid": "02f291293e77d4dd0c5c174afdf9af20", "score": "0.6578795", "text": "function loadMap() {\n clubcard.map.init();\n}", "title": "" }, { "docid": "39b93c58c7e0c0cbb3d485f06dd09bf8", "score": "0.6570145", "text": "function initialize() {\n initMap();\n initAutocomplete();\n}", "title": "" }, { "docid": "d7c91d650985796643fcd231bf3e074a", "score": "0.6561065", "text": "constructor() {\n this.map = new Map();\n }", "title": "" }, { "docid": "332d430813e4d2d3b0de51672589acb7", "score": "0.65284187", "text": "function init() {\n\tgetUserLocation();\n\tcalculateMapWidth();\n}", "title": "" }, { "docid": "8c297f5ddf8653553c712324383ebfb8", "score": "0.6519998", "text": "function initMapEvent()\r\r\n{\r\r\n}", "title": "" }, { "docid": "c8a1766652e5ba09d225193cabfabdf8", "score": "0.65146244", "text": "function _initMap() {\n // Set the access token to get tiles from mapbox.\n L.mapbox.accessToken = 'pk.eyJ1IjoibW9hcy11b24iLCJhIjoiY2l5bGpnbHZnMDA0YjJ3anJ0NzMwdTFrbiJ9.oaFP-ohA9RqY10RmqCeGeA';\n\n // Create the map inside a div with an id of 'map'.\n return L.mapbox.map(mapContainer, 'mapbox.dark');\n }", "title": "" }, { "docid": "5c1b824af42d970918ef259ee186ce94", "score": "0.6508902", "text": "function Game_Map() {\n this.initialize.apply(this, arguments);\n}", "title": "" }, { "docid": "3ad3cc9f9fead7cfeb7d1bf1557aebee", "score": "0.65031236", "text": "initialize(context) {\n // actually set out map\n this.reset(context);\n }", "title": "" }, { "docid": "9c2bcf0f2cde8adbbc9d41e58623dabb", "score": "0.6484458", "text": "function initMap() {\n // Initialize the page\n // Load only Brazil fligths to speed the page loading\n createLayerAircrafts(\"/api/v1.0/aircrafts-data/Brazil\");\n createAirportsLayer(\"/api/v1.0/airports-data/Brazil\");\n loadDropdownAirport();\n\n // Load all fligths\n createLayerAircrafts(`/api/v1.0/aircrafts-data/ALL`);\n}", "title": "" }, { "docid": "70f445c3648529c1398c383c931f1540", "score": "0.64749444", "text": "function initializeMapArray(allMaps) {\n\n\tconsole.log('lqMap: Implement me');\n\n\n\t//needs to create map objects\n\tfor( var i = 0; i < lqMapSources.length; i++ ) {\n\t\tallMaps.push( createNewMap() );\n\t\tallMaps[ allMaps.length - 1 ].groundSetup( lqMapSources[i].get2dArray() );\n\t}\n\n\n\t//put into the map objects the correct values\n\n\n}", "title": "" }, { "docid": "f639f5b9eb8d4b20cffd0526b3bc5db5", "score": "0.6465132", "text": "function initMap() {\n\n\t\t// Set the default images dir\n\t\tL.Icon.Default.imagePath = '/assets/images/leaflet/';\n\n\t\tif (responseHub.isMobile()) {\n\t\t\t$('#map-canvas').css('height', '450px');\n\t\t}\n\n\t\tif (typeof mapConfig != \"undefined\") {\n\t\t\tmap = displayMap(mapConfig);\n\t\t}\n\n\t}", "title": "" }, { "docid": "aa1dd2bc3d598a085dc17adeb3790b2b", "score": "0.64602655", "text": "function onInitMap() {\n initLocs();\n renderLocations();\n}", "title": "" }, { "docid": "e8aeb01019ff12d3230abd749e381ce3", "score": "0.6448005", "text": "function initialiseMap(){\n\t// Setting the position of the map as well as the default interactivity\n\tvar defaultOptions = {\n\t\t// Map center position is a view of New Zealand\n\t\tcenter: {\n\t\t\tlat:-41.2165668,\n\t\t\tlng:172.6385759\n\t\t},\n\t\tzoom:5,\n\t\tdisableDefaultUI:true,\n\t\tscrollwheel:true,\n\t\tdraggable:true,\n\t\tfullScreenControl:true,\n\t\tkeybosrdShortcuts:false,\n\t\tmapTypeControlOptions: {\n\t\t\tposition:google.maps.ControlPosition.TOP_CENTER\n\t\t}\n\t};\n\n\t// Creating a new instance of map, locating the users position, run the map anf then show all the attractions.\n\tmap = new google.maps.Map(document.getElementById(\"map\"), defaultOptions);\n\tfindMe();\n\trunMap();\n\tinjectAttractions();\n\n\t// This event listener calls addMarker() once the map is clicked.\n google.maps.event.addListener(map, 'click', function(event) {\n addMarker(event.latLng, map);\n });\n}", "title": "" }, { "docid": "0253af5934944f44815501bf167948c9", "score": "0.6446264", "text": "function InitMap(){\n /* Affichage de la carte */\n map;\n /* Ajout du Layer OSM */\n L.tileLayer(\n 'https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png', {\n minzoom: 1,\n maxZoom: 20,\n attribution: copyright\n }).addTo(map);\n }", "title": "" }, { "docid": "f4bfee9a9543153b5ce5a7620a7043b1", "score": "0.6438177", "text": "bind(){\n this.initMap();\n }", "title": "" }, { "docid": "f9b1993fa11b94c3cbd9803d6d7e12ba", "score": "0.64312065", "text": "function ParamMap(){}", "title": "" }, { "docid": "7f52fa5bd2da20f036865d93ab725d14", "score": "0.6425112", "text": "constructor() {\n this._map = new Map();\n }", "title": "" }, { "docid": "4e95a360488ffeda80928629fe5e1e5f", "score": "0.6421312", "text": "function ParamMap() {}", "title": "" }, { "docid": "96d592e31a8a3e99a857ac93efe33ca2", "score": "0.6414905", "text": "function createMaps() {\n currentmap = [1,1];\n jumplev1 = 32;\n jumplev2 = 64;\n ceillev = 88;\n ceilmax = 104;\n castlev = -48;\n \n mapfuncs = new Array(9);\n for(var i=1; i<=9; ++i)\n mapfuncs[i] = [0,0,0,0,0];\n mapfuncs[1][1] = World11;\n}", "title": "" }, { "docid": "221f5442a4aa7f3ce59f89b1418f74bb", "score": "0.63965636", "text": "function ParamMap() { }", "title": "" }, { "docid": "221f5442a4aa7f3ce59f89b1418f74bb", "score": "0.63965636", "text": "function ParamMap() { }", "title": "" }, { "docid": "ec3f754d776d8a4cf609d408f5f4577c", "score": "0.63962835", "text": "function initMap(){\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 13,\n center: {lat: 42.3586626, lng: -71.1020217}\n });\n setAllMap();\n}", "title": "" }, { "docid": "e9eca1465e7e711ec1d76a449bb95f1d", "score": "0.6376999", "text": "function initialize() {\n rendermap();\n retrieveMarkerLocations();\n }", "title": "" }, { "docid": "c6b8d618f8a7ed853108b348e99def31", "score": "0.63696307", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 11,\n center: {lat: 40.7405971, lng: -73.8917814}\n });\n }", "title": "" }, { "docid": "84828455d8d93922788ded777ff046ea", "score": "0.6354242", "text": "function initMapState(){\n \n var lat = lcly.conversionModule.getMetaParam('lat'); \n var lng = lcly.conversionModule.getMetaParam('lng');\n var zoom = parseInt(lcly.conversionModule.getMetaParam('zoom'));\n \n if (lat && lng){\n \n lcly.mapModule.setCoords(lat, lng, 0);\n }\n \n if (zoom) {\n \n lcly.mapModule.setZoom(zoom);\n }\n }", "title": "" }, { "docid": "21d74737a3167dd78cd9f1fd73fcb590", "score": "0.63466007", "text": "function initMaps() {\n showMap();\n}", "title": "" }, { "docid": "f10ffafa7f37a79d3e9c1cd9b34a4d2c", "score": "0.6335206", "text": "function initialize()\n{\n\t// -------------------- Constructs and initializes sexy-assed map -------------------------\n\tvar mapProp =\n\t{\n\t\tcenter:new google.maps.LatLng(38.954413, -96.271539),\n\t\tzoom:4,\n\t\tmapTypeId:google.maps.MapTypeId.ROADMAP\n\t};\n\tmap = new google.maps.Map(document.getElementById(\"googleMap\"), mapProp);\n\tpopulatePins();\t\t\t\n}", "title": "" }, { "docid": "7e9dc70a4a6b184fdc5e13fe29b4c2ee", "score": "0.6332592", "text": "function HashMap(){}", "title": "" }, { "docid": "12fada9ab9c4ad0bb133ad528a66744d", "score": "0.63313717", "text": "function initializeMap(){\n\tmapController.isValidLicense = hasValidArcGisMapLicense();\n\tif (!mapController.isValidLicense) {\n\t\tdisableControl();\n\t\treturn;\n\t}\n\telse if (mapController.isValidLicense && !mapController.mapControlInit) {\t\n\t\tvar configObject = new Ab.view.ConfigObject();\n\t\tmapController.map = new Ab.arcgis.ArcGISMap('htmlMap', 'objMap', configObject);\t\n\t\tmapController.mapControlInit = true;\n\t\tif (!mapController.map.mapInited) {\n\t\t\tsetTimeout('configMap()', 500);\n\t\t\treturn;\n\t\t}\n\t\telse {\n\t\t\tconfigMap();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ea173eed0d611bbbb2f572a87f2eb7e2", "score": "0.63275844", "text": "function initMap() {\n var eqCFC = new equipCFC();\n eqCFC.setHTTPMethod('GET');\n var propertyInfo = queryToObject(eqCFC.getAllEquips());\n var propData = eqAtAddress(propertyInfo);\n\n map = new google.maps.Map(document.getElementById(\"map1\"), {\n zoom: 5,\n center: new google.maps.LatLng(51.508742, -0.120850),\n mapTypeId: 'satellite',\n });\n mapData(propData);\n\n}", "title": "" }, { "docid": "bfacbe60bd2de659dcb8f45045b3a4c5", "score": "0.63262594", "text": "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n // The location of the Map\n lat: 41.9027835,\n lng: 12.4963655\n },\n zoom: 8\n });\n\n calcRoute(map);\n}", "title": "" }, { "docid": "30ca441740535bc9b22ed8edd4df864c", "score": "0.6323237", "text": "function createMap() {\n for (var i = 0; i < NUM_OF_CELLS; i++)\n MAP[i] = {\n ant: [],\n food: void(0),\n pheromone: []\n };\n}", "title": "" }, { "docid": "d0a5d3e1a9200ac0cef0739d719b6071", "score": "0.63163173", "text": "function initMap() {\n\t\t//Instance new map object using Google Maps API; map is centered at myLatLng\n\t\tvar map = new google.maps.Map(document.getElementById('map'), {\n\t\t\tcenter: myLatLng,\n\t\t\tzoom: 16\n\t\t});\n\t\t//Call setMarkers() function with map as input\n\t\tsetMarkers(map);\n\n\t}", "title": "" }, { "docid": "90f9b4d2eb85d05d4b5af5591aafbac1", "score": "0.6313303", "text": "function HashMap() {}", "title": "" }, { "docid": "fd457d0d4a90cb24b0b75afb6da3964e", "score": "0.62979954", "text": "function initialiseMap() {\n // Centred on the UK\n map = L.map('map').setView([55.505, -4.2], 5);\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'\n }).addTo(map);\n markerGroup = L.layerGroup().addTo(map);\n}", "title": "" }, { "docid": "61da6ab75351bfbfd207b2fb2765b6d1", "score": "0.62941915", "text": "function createMap(map) {\n\tfor (let i = 0; i < 50; i++)\n\t\tmap[i] = new Array(30);\n}", "title": "" }, { "docid": "1d4b83cf96da84f5d8624b6a0a4578b2", "score": "0.6286675", "text": "function initMap() {\n\n\t// Create a map\n\taccidents.curr_map = new google.maps.Map(document.getElementById('map-canvas'), {\n\t\tzoom: info.map[accidents.curr_mapname].zoom,\n\t\tcenter: new google.maps.LatLng(\n\t\t\t(info.map[accidents.curr_mapname].fromlat+info.map[accidents.curr_mapname].tolat)/2, \n\t\t\t(info.map[accidents.curr_mapname].fromlong+info.map[accidents.curr_mapname].tolong)/2),\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t});\n \n // Add help button\n setHelp(accidents.curr_map);\n\n\t// Add the main frame \n\taccidents.frame = removeFrame(accidents.frame);\n\taccidents.frame = addFrame(accidents.frame, accidents.curr_map, \n\t\tinfo.map[accidents.curr_mapname].fromlat, info.map[accidents.curr_mapname].fromlong,\n\t\tinfo.map[accidents.curr_mapname].tolat, info.map[accidents.curr_mapname].tolong);\n\t\n\t// Now load a map\n\tloadMap();\n}", "title": "" }, { "docid": "843aa97d5f9ab0cad051647239135597", "score": "0.6281041", "text": "function initialize() {\r\n initializeGoogleMapsAPI();\r\n getPOIFromDatabase();\r\n}", "title": "" }, { "docid": "dd5f8825139cc2052bbc85ca25f111d7", "score": "0.6280006", "text": "initMap() {\n this.map = this.game.add.sprite(0, 0, \"atlas\", \"jeu3/map\");\n this.map.scale.set(this.game.SCALE);\n this.map.alignIn(this.game.world.bounds, Phaser.CENTER);\n }", "title": "" }, { "docid": "acdbce89f3e420cbb58a7a8b465464ff", "score": "0.6271904", "text": "function init(map) {\n\t\tconsole.log(\"TODO 1. change the Marker constructor so that is takes a parent instead of both map and group\");\n\t\tconsole.log(\" 2. then change the calling functions appropriately\");\n\t}", "title": "" }, { "docid": "53b4834f8d7fa2073be2696a1782339e", "score": "0.6268745", "text": "function LocalMapType() {\n}", "title": "" }, { "docid": "2e525f35167c37e8064636cd347a2b23", "score": "0.6268311", "text": "function initMap() {\n _GEOCODER = new google.maps.Geocoder();\n}", "title": "" }, { "docid": "d01a34f5bfa2622b60d54b731c3be44c", "score": "0.626318", "text": "function initMap() {\n // const location = { lat: {{ lat }}, lng: {{ lon }} };\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 8,\n center: location,\n });\n setMarkers(map, LOCATIONS);\n}", "title": "" }, { "docid": "d547e084c606610a56df02ab16a4d007", "score": "0.6258584", "text": "function initialization() {}", "title": "" }, { "docid": "3b2c1100962cea48fbb69fe114cab569", "score": "0.62527776", "text": "function runMap(){\n\tgoogle.maps.event.addDomListener(window, \"load\", initialiseMap);\n}", "title": "" }, { "docid": "aeec01528130f0e218d30e27879df414", "score": "0.6250333", "text": "function init() {\n Microsoft.Maps.loadModule(opts.theme, {\n callback: initMap\n });\n }", "title": "" }, { "docid": "aeec01528130f0e218d30e27879df414", "score": "0.6250333", "text": "function init() {\n Microsoft.Maps.loadModule(opts.theme, {\n callback: initMap\n });\n }", "title": "" }, { "docid": "67c8e61259a015f1715822fbd3b13bda", "score": "0.6249522", "text": "function initMap() {\n // initialize map\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: new google.maps.LatLng(60.1699, 24.9384), // center map to Helsinki\n zoom: 10 // zoom level: City\n });\n\n addCampusMarkersToMap(); // add all campus markers\n locateUser(); // locate users position\n}", "title": "" }, { "docid": "a8591a6f18e202a1e70eeb1f05730ddf", "score": "0.62457204", "text": "function initMap() {\n sensorMap = new ol.Map({\n layers: [\n new ol.layer.Tile({\n source: new ol.source.OSM()\n }),\n new ol.layer.Vector({\n source: markers,\n style: markerStyle\n })\n ],\n target: 'sensorMap',\n view: new ol.View({\n center: ol.proj.fromLonLat([-1.518183782428, 47.28282929920]),\n zoom: 15.9\n })\n });\n initSensorPopups();\n}", "title": "" }, { "docid": "35694ba9c3637876cbdcb80f2aa9b97f", "score": "0.62431973", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 82.8628, lng: 135.0000},\n zoom: 10\n });\n }", "title": "" }, { "docid": "23ed0c567ab08ac2a11cfe2f7d5b3d50", "score": "0.6238059", "text": "initializeMaps() {\n logger.logWarning(\"Loading maps into RAM...\");\n\n this.maps = {};\n let keys = Object.keys(filepaths.maps);\n\n for (let mapName of keys) {\n let node = filepaths.maps[mapName];\n let map = json.parse(json.read(node.base));\n\n // set infill locations\n for (let entry in node.entries) {\n map.SpawnAreas.push(json.parse(json.read(node.entries[entry])));\n }\n\n // set exfill locations\n for (let exit in node.exits) {\n map.exits.push(json.parse(json.read(node.exits[exit])));\n }\n\n // set scav locations\n for (let wave in node.waves) {\n map.waves.push(json.parse(json.read(node.waves[wave])));\n }\n\n // set boss locations\n for (let spawn in node.bosses) {\n map.BossLocationSpawn.push(json.parse(json.read(node.bosses[spawn])));\n }\n\n this.maps[mapName] = map;\n }\n }", "title": "" }, { "docid": "a0b3b56a5d7783927778d51604189ddc", "score": "0.6235106", "text": "function initMap() {\n map = L.map('locatorMaps').setView([initLat, initLon], 8); // LIGNE 18\n\n var osmLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { // LIGNE 20\n attribution: '© OpenStreetMap contributors',\n maxZoom: 19\n });\n \n map.addLayer(osmLayer);\n }", "title": "" }, { "docid": "a5eeffcd7ab5446522a8e44a9c07f473", "score": "0.62313676", "text": "constructor() {\n\n this.pdqToNCIt = {};\n this.ncitToPdq = {};\n\n try {\n this._loadMap();\n } catch(err) {\n console.log(err);\n }\n\n }", "title": "" }, { "docid": "c39a1d899ece5b0a4c5793a0d9f8a90c", "score": "0.62054175", "text": "function initMap(data) {\n\tmyMap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {lat:21.850565, lng:-72.039691},\n\t\tzoom: 10});\n\tmvm.initPoints();\n}", "title": "" }, { "docid": "9c7577352be8883ab4111ce328441027", "score": "0.62032837", "text": "function init(a) {\n var i;\n //init Set argument, like `[1,2,3,{}]`\n if (this.add) a.forEach(this.add, this);\n //init Map argument like `[[1,2], [{}, 4]]`\n else a.forEach(function (a) {\n this.set(a[0], a[1]);\n }, this);\n }", "title": "" }, { "docid": "2de3a4eaf4ca517df031e693aa82c72e", "score": "0.6202561", "text": "function initMap() {\n\t// The location of Uluru\n\tconst auburnhills = { lat: 42.6875, lng: -83.2341 };\n\t// The map, centered at Uluru\n\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\n\t\tzoom: 12,\n\t\tcenter: auburnhills,\n\t});\n\t// The marker, positioned at Uluru\n\tconst marker = new google.maps.Marker({\n\t\tposition: auburnhills,\n\t\tmap: map,\n\t});\n}", "title": "" }, { "docid": "9f74d7763562692d663ba9af255fd7f3", "score": "0.62014014", "text": "function initMap(){\n\tmap = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 48.874955, lng: 2.350517},\n zoom: 15\n });\n return map;\n}", "title": "" }, { "docid": "4a4172170ebc573362d47aa902c558d0", "score": "0.61960924", "text": "function initMap(initLat, initLong, range) {\n mymap = L.map('map-canvas').setView([initLat, initLong], 13);\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\n 'attribution': 'Kartendaten &copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> Mitwirkende',\n 'useCache': true\n }).addTo(mymap);\n\t\t \n\tmarker = L.marker([initLat, initLong]).addTo(mymap);\n\t\t \n\tcircle = L.circle([initLat, initLong], {\n\t\tcolor: 'red',\n\t\tfillColor: '#f03',\n\t\tfillOpacity: 0.5,\n\t\tradius: range\n\t}).addTo(mymap);\n }", "title": "" }, { "docid": "f67fbf64489f9ad60131e9f19800739a", "score": "0.61932546", "text": "function initMap() {\n\t// Constructor creates a new map.\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: {\n\t\t\tlat: 12.971594,\n\t\t\tlng: 77.594561\n\t\t},\n\t\tzoom: 8,\n\t\tmapTypeControl: false,\n\t\tzoomControl: true\n\t});\n\n\tvar bounds = new google.maps.LatLngBounds();\n\tcreateMarkers(map, bounds,false);\n\n\n\tmap.fitBounds(bounds);\n}", "title": "" } ]
d5f4253dc9662c71dae977854ce60ca3
Capture the next frame of the video.
[ { "docid": "2e57783c41cbfdbdea72e825306da2d1", "score": "0.6509456", "text": "function Frame() {\n width = video.clientWidth;\n height = video.clientHeight;\n canvas.width = width;\n canvas.height = height;\n if (frameTime < 50) {\n frameTime++;\n var imageData;\n ctx.drawImage(video,0,0,width,height);\n imageData = ctx.getImageData(0,0,width,height);\n images.push({duration:new Date().getTime() - startTime,datas:imageData});\n startTime = new Date().getTime();\n requestAnimationFrame(Frame);\n } else {\n requestAnimationFrame(function (){\n var capture = new Whammy.Video();\n encodeVideo(capture,0);\n\n });\n frameTime=0;\n }\n }", "title": "" } ]
[ { "docid": "0e0280359654127e1017ff4d85ee7a3c", "score": "0.70263344", "text": "function captureFrame() {\n var begin = Date.now();\n cap.read(frame); // Read a frame from camera\n cv.cvtColor(frame, frameBGR, cv.COLOR_RGBA2BGR);\n\n var faces = detectFaces(frameBGR);\n faces.forEach(function(rect) {\n cv.rectangle(frame, {x: rect.x, y: rect.y}, {x: rect.x + rect.width, y: rect.y + rect.height}, [0, 255, 0, 255]);\n\n var face = frameBGR.roi(rect);\n var name = recognize(face);\n cv.putText(frame, name, {x: rect.x, y: rect.y}, cv.FONT_HERSHEY_SIMPLEX, 1.0, [0, 255, 0, 255]);\n });\n\n cv.imshow(output, frame);\n\n // Loop this function.\n if (isRunning) {\n var delay = 1000 / FPS - (Date.now() - begin);\n setTimeout(captureFrame, delay);\n }\n }", "title": "" }, { "docid": "d0114abd101bb6ad08674b018d6ffccf", "score": "0.7005052", "text": "async captureFrame() {\n this.ctx.drawImage(this.player.current, 0, 0);\n\n let captureURL = await this.canvas.current.toDataURL('image/jpeg');\n this.setState({ captureURL: captureURL });\n\n this.frameCount++;\n }", "title": "" }, { "docid": "e838530b80759810cf24c44e45a0a470", "score": "0.6687653", "text": "async renderPreviewVideo() {\n const { canvas, capturer } = this.props;\n if (canvas && capturer) {\n async function* asyncAnimationFrame() {\n const h = {};\n h.promise = new Promise(r => (h.resolve = r));\n h.flipFrame = () => {\n h.resolve();\n h.promise = new Promise(r => (h.resolve = r));\n };\n try {\n while (true) {\n h.idAF = requestAnimationFrame(h.flipFrame);\n yield await h.promise;\n }\n } finally {\n h.resolve();\n cancelAnimationFrame(h.idAF);\n }\n }\n const flamer = asyncAnimationFrame();\n while (this.flag < 5 * 60) {\n await flamer.next();\n this.videoElement.currenTime = this.videoElement.currenTime + 0.016667;\n console.info(this.videoElement.currenTime);\n this.videoElement.pause();\n await canvas.renderAll();\n await capturer.addFrame(canvas);\n await this.videoElement.play();\n this.flag++;\n }\n capturer.render(\"example\");\n }\n }", "title": "" }, { "docid": "52819d653559e0eb659639f35defa676", "score": "0.66603655", "text": "nextFrame() {\r\n if ((this.loop) && (this.currentFrame === this.frameCount - 1))\r\n this.currentFrame = 0;\r\n else\r\n this.currentFrame += 1;\r\n this.emit(PlayerEvent.FrameNext);\r\n }", "title": "" }, { "docid": "56129e198ec9aeaf77bb40a59802a2e9", "score": "0.6651504", "text": "function webcam_stream() {\n webcam_ctx.drawImage(video, 0, 0, webcam_canvas.width, webcam_canvas.height)\n requestAnimationFrame(webcam_stream)\n}", "title": "" }, { "docid": "92d78b91da1c94701641078c54a7635c", "score": "0.66453826", "text": "function recordVideo() {\n // start video capture\n\tnavigator.device.capture.captureVideo(captureSuccess, captureError, {limit:1});\n}", "title": "" }, { "docid": "890709c5db25ce0d355956eaa10d8ba0", "score": "0.6576639", "text": "function getVideoCurrentFrame() {\r\n currentFrame = this.currentTime * fps;\r\n }", "title": "" }, { "docid": "7cb4a1db2dfd69ded57aa59b25feeae7", "score": "0.65640277", "text": "function nextFrame() {\n\t\t\t\tframeNumber++;\n\t\t\t\tif(frameNumber <= frameCount) {\n\t\t\t\t\tmove();\n\t\t\t\t} else {\n\t\t\t\t\tmove(1);\n\t\t\t\t\tframeNumber = 1;\n\t\t\t\t}\n\t\t\t\tcheckButtons();\n\t\t\t}", "title": "" }, { "docid": "8e89491c974af8e7160c5812fca89bf5", "score": "0.6548951", "text": "function drawNextFrame() {\n if (downloader) {\n downloader.setProgress(taskId, (t - tMin) / (tMax - tMin + 1));//Update progress bar\n }\n if (t < tMax) {\n switch (video.drawMethod) {\n case 'image data':\n try {\n video.drawFrameInImageData(pixels, protocol, t, drawMode);\n } catch (e) {\n showErrorAndRemove(e);\n }\n ctx.putImageData(imageData, 0, 0);//Draw the imageData\n break;\n case 'canvas':\n try {\n video.drawFrameInContext(ctx, protocol, t, drawMode);\n } catch (e) {\n showErrorAndRemove(e);\n }\n break;\n default:\n showErrorAndRemove('Error: Cannot render with draw method \"' + video.drawMethod + '\".');\n }\n\n gif.addFrame(ctx, {\n delay: timePerFrame,\n copy: true//Copy pixels from context because they will be redrawn in the next step\n });//Save frame in gif object\n\n t += stepsPerFrame;\n setTimeout(drawNextFrame, 0);//Starts itself using a timeout to prevent freezing GUI\n } else {\n //All frames are safed but not encoded yet\n gif.render();\n }\n }", "title": "" }, { "docid": "0d7e3b638b0eac10949a2fea94e5d3bf", "score": "0.6492188", "text": "function nextFrame() {\n\t // Frames 0, 1 is the first pause.\n\t // Frames 9, 10 is the last pause.\n\t if (frame >= 2 && frame <= 8) {\n\t draw(current, next, (frame - 2) / 6, secCtx);\n\t }\n\t\n\t frame++;\n\t\n\t // Each number change has 10 frames. Reset.\n\t if (frame == 10) {\n\t frame = 0;\n\t current = next;\n\t next++;\n\t\n\t // Reset to zarro.\n\t if (next == 10) {\n\t next = 0;\n\t // incrDecSec();\n\t decTimeOut = setTimeout(nextDecSecFrame, 100);\n\t }\n\t }\n\t\n\t\tif (stopWatch === 0) {\n\t \tsetTimeout(nextFrame, 100);\n\t\t}\n\t}", "title": "" }, { "docid": "e4706842eed4f26bfa46e131bc3a7e13", "score": "0.6447381", "text": "function captureToCanvas() {\r\n try {\r\n context.drawImage(video, 0, 0);\r\n qrcode.decode();\r\n setTimeout(captureToCanvas, 1000);\r\n } catch (e) {\r\n console.log(e)\r\n setTimeout(captureToCanvas, 1000);\r\n }\r\n}", "title": "" }, { "docid": "7e174d0f689d2d3e86e58c9d1d8379f1", "score": "0.64076114", "text": "gotoNextFrame() {\n // Loop back to beginning if gotoNextFrame goes past the last frame\n var nextFramePlayheadPosition = this.playheadPosition + 1;\n\n if (nextFramePlayheadPosition > this.length) {\n nextFramePlayheadPosition = 1;\n }\n\n this.gotoFrame(nextFramePlayheadPosition);\n }", "title": "" }, { "docid": "3253732633e25c851228e167ae47c727", "score": "0.63408166", "text": "nextFrame() {\n this.index++;\n if (this.index >= this.conf.speed) {\n this.index = 0;\n this.frameIndex++;\n }\n }", "title": "" }, { "docid": "e19c088917a5682f5dea8fbbbb6449a1", "score": "0.6281401", "text": "gotoNextFrame() {\n this.timeline.gotoNextFrame();\n this.applySingleFramePosition();\n }", "title": "" }, { "docid": "a809131478b58e87867d31e035fd2dd1", "score": "0.6259256", "text": "_loop() {\r\n setTimeout(this._loop.bind(this), Math.max(this.runtime.currentStepTime, faceApi .INTERVAL));\r\n\r\n // Add frame to detector\r\n const time = Date.now();\r\n if (this._lastUpdate === null) {\r\n this._lastUpdate = time;\r\n }\r\n const offset = time - this._lastUpdate;\r\n if (offset > faceApi .INTERVAL) {\r\n const frame = this.runtime.ioDevices.video.getFrame({\r\n format: Video.FORMAT_IMAGE_DATA,\r\n dimensions: faceApi .DIMENSIONS\r\n });\r\n if (frame) {\r\n this._lastUpdate = time;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "3ffa115b240def4ec00dae05c55a1b1e", "score": "0.6251876", "text": "async function next_frame()\n{\n\tawait remote_command('next_frame', [])\n}", "title": "" }, { "docid": "0d9c2206b0305bc91765ecab41dac845", "score": "0.61923254", "text": "function encodeVideo(capture,currentImage) {\n if(currentImage < images.length) {\n ctx.putImageData(images[currentImage].datas,0,0);\n capture.add(ctx,images[currentImage].duration);\n delete images[currentImage];\n //progress.value = currentImage;\n currentImage++;\n setTimeout(function() {\n encodeVideo(capture,currentImage);\n },5);\n } else {\n var output = capture.compile();\n //setMessage('Finished');\n images = [];\n //enableStartButton(true)\n sendMessage(output);\n }\n }", "title": "" }, { "docid": "9a3ecf1ea9e6d9cbec6ca08e1c8374ce", "score": "0.61904913", "text": "_requestVideoFrame() {}", "title": "" }, { "docid": "9ca4b749245bfca212882c24a7c1b29c", "score": "0.61307114", "text": "async function startCapture() {\n try {\n videoEl.srcObject = await navigator.mediaDevices.getDisplayMedia();\n dumpOptionsInfo();\n } catch (err) {\n // Catch errors\n console.error('Error: ' + err);\n }\n}", "title": "" }, { "docid": "c689c909820c23961d346807a3a85ab5", "score": "0.6125255", "text": "goToFrame(frame) {\n let p_list=[];\n let prime_fps = this._fps[this._longest_idx]\n let idx = 0;\n this.checkReady();\n for (let video of this._videos)\n {\n let this_frame = Math.round(frame * (this._fps[idx]/prime_fps));\n video.onPlay();\n p_list.push(video.gotoFrame(Math.min(this_frame,video._numFrames-1), true));\n idx++;\n }\n let coupled_promise = new Promise((resolve,_) => {\n Promise.all(p_list).then(() =>{\n this.handleAllNotReadyEvents();\n resolve();\n });\n });\n return coupled_promise;\n }", "title": "" }, { "docid": "aecd5a5bf5af6731a1033c44d9d5c3fd", "score": "0.61104995", "text": "function capture() {\n Webcam.snap(function(data_uri) {\n img.src = data_uri;\n });\n}", "title": "" }, { "docid": "c3388c7a72f4cccccc6aa1634f23974c", "score": "0.607404", "text": "async function captureFrame (label, frame){\n \n // prevents attempt on capturing images if webcam is not streaming\n if(!cam.stream.active){\n\t alert(\"Turn on cam to capture images\");\n\t return;\n }\n \n let captureFrames = async () => {\n classesCounter[label]++;\n frame.parentNode.childNodes[0].innerText = classes[label] + \": \" + classesCounter[label];\n \n let image = await tf.image.resizeBilinear(await cam.capture(), [112, 112], true);//preprocess();\n let resizedImage = image.toInt()\n addData(await modelInfer(), label);\n \n await tf.browser.toPixels(resizedImage, frame);\n image.dispose();\n resizedImage.dispose();\n };\n\n captureFrames();\n captureInterval = setInterval( captureFrames , 200);\n \n}", "title": "" }, { "docid": "7e0737a8d8844cd888042a12f67daacb", "score": "0.6055504", "text": "function draw () {\n try {\n context.drawImage(video, 0, 0, width, height)\n rgba = context.getImageData(0, 0, width, height).data\n update()\n emit()\n } catch (err) {\n console.error(err)\n }\n if (keepGoing) {\n window.requestAnimationFrame(draw)\n }\n }", "title": "" }, { "docid": "8b10cc007a56997e59ba9da9c5d58c57", "score": "0.6047907", "text": "function captureVideo() {\n // Launch device video recording application,\n // allowing user to capture up to 2 video clips\n alert('Entra en captureVideo');\n navigator.device.capture.captureVideo(captureSuccess, onFail, {limit: 2});\n}", "title": "" }, { "docid": "c94155f2aab225671b1b5d5b5546b84a", "score": "0.6041059", "text": "capture() {\n const constraints = {\n video: {\n facingMode: 'environment'\n }\n }\n\n navigator.mediaDevices.getUserMedia(constraints).then((stream) => {\n const video = document.createElement('video');\n video.srcObject = stream;\n video.play();\n\n video.addEventListener('playing', () => {\n setTimeout(() => {\n const canvas = document.createElement('canvas');\n canvas.setAttribute('width', video.videoWidth);\n canvas.setAttribute('height', video.videoHeight);\n const context = canvas.getContext('2d');\n\n context.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\n\n const image = canvas.toDataURL('image/png');\n\n this.setState({\n labels: [],\n image: image\n });\n stream.getTracks()[0].stop();\n this.postImage(image);\n }, 100);\n });\n }).catch((err) => {\n /* handle the error */\n });\n }", "title": "" }, { "docid": "1425d04cf9040a1907f6d99d88e3a806", "score": "0.6038183", "text": "function playVideo(){\n\t\t\tif (video.ended == false){\n\t\t\t\tctx.drawImage(video, 88, 50, 1224, 693);\n\t\t\t\trequestAnimationFrame(playVideo);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "58dec9b22d9399d35f27be9acccfee21", "score": "0.6032607", "text": "getMoveFrame(video) {\n if (!video) // No crashing at dumb times\n return;\n\n var realFrame = video.get();\n\n if (realFrame >= this.props.numFrames) {\n realFrame = this.props.numFrames - 1;\n } else if (realFrame < 0) {\n realFrame = 0;\n }\n return realFrame;\n }", "title": "" }, { "docid": "f4edf2f9cbf8aecf0628a5e066e1e1ac", "score": "0.6021576", "text": "function forwardVideo(){\n video.currentTime=video.currentTime+15;\n setProgresBar()\n}", "title": "" }, { "docid": "b547040691b0a98223dff1b6a62457c2", "score": "0.59581965", "text": "function captureCanvasFramesAndProcess(canvas){\n \n /*Wait until the start of a cycle to begin saving frames*/\n if (shapeInfo.cLastWaveV < 0.25){\n startCapture = true;\n console.log(\"Capture started at begining of cycle!\");\n }\n \n /*Fired at the start of a cycle*/\n if (startCapture){\n \n imageSequence.push(copyCanvasFrame(canvas)); //always png by default\n \n /*When you've done one cycle*/\n if (shapeInfo.cLastWaveV < 0.25 && imageSequence.length > 10){\n startCapture = false;\n doCaptureCanvas = false;\n console.log(\"Capture ended at end of movement cycle!\");\n var imagesFromCanvasBuffer = processImageSequence(imageSequence)\n sendDataToServer(imagesFromCanvasBuffer);\n \n // zipImageSequence(imagesFromCanvasBuffer);\n }\n }\n \n}", "title": "" }, { "docid": "2e2ac3c61565f01fa831188d7881f5d5", "score": "0.59502345", "text": "processFrame() {\n const gl = renderer.context;\n const currentFrame = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);\n\n // Read image data from gl\n gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, currentFrame);\n\n if (this.prevFrame !== null) {\n this.pose = motionEstimation(this.prevFrame, currentFrame, gl.drawingBufferWidth, gl.drawingBufferHeight);\n this.sceneCamera.rotation.x += pose.rotation.x;\n this.sceneCamera.rotation.y += pose.rotation.y;\n this.sceneCamera.rotation.z += pose.rotation.z;\n this.sceneCamera.translation.x += pose.translation.x;\n this.sceneCamera.translation.y += pose.translation.y;\n this.sceneCamera.translation.z += pose.translation.z;\n }\n\n this.prevFrame = currentFrame;\n }", "title": "" }, { "docid": "6e973128f483141d635d16b0c5378020", "score": "0.5934629", "text": "function draw(){\n //the captured iamge from the webcam will be rendered here so that it is continuously shown:\n background(0)\n image(video, 0, 0)\n fill(255);\n textSize(32);\n text(label, 10, height-20)\n }", "title": "" }, { "docid": "8922bd196ec7004543ae43d426ea5e51", "score": "0.59259677", "text": "function takePhotoSequence() {\n if (photoSequencePrepared) { \n id(\"btnSnap\" + scenarioId).disabled = true;\n\n // Clear the preview table\n clearPreviewTable();\n \n lowLagPhoto.startAsync().done(function () {\n framesCaptured = 0;\n\n // This listener will be called for each photo captured\n lowLagPhoto.addEventListener(\"photocaptured\", photoCaptured);\n\n });\n }\n\n }", "title": "" }, { "docid": "10b66e8cd36c5d39fed7bd95713c3bcb", "score": "0.5922376", "text": "function captureImage(e) {\n\tvar monCanvas = document.querySelector(\"#monCanvas\"),\n\t\tmaCam = document.querySelector(\"#maCam\"),\n\t\tinputs = document.querySelectorAll(\".form-group input\"),\n\t\tthisButton = e.currentTarget;\n\t\n\t$(maCam).addClass(\"hidden\");\n\t$(monCanvas).removeClass(\"hidden\");\n\t\n\tmonCanvas.width = maCam.videoWidth;\n monCanvas.height = maCam.videoHeight;\n monCanvas.getContext('2d').drawImage(maCam, 0, 0, monCanvas.width, monCanvas.height);\n\t\n\tmaCam.pause();\n\tlocalStream.stop();\n\tlocalStream = null;\n\t\n\tvar img = new Image();\n\timg.src = monCanvas.toDataURL();\n\tlienImg = img.src;\n\t\n\t$(inputs).on(\"change\", { cleImg : img }, changerCouleur);\n\t\n\tthisButton.innerHTML = glyphs[\"video\"];\n\t$(thisButton).tooltip(\"destroy\");\n\t$(thisButton).tooltip();\n\tthisButton.setAttribute(\"title\", \"Allumer camera\");\t\n\t$(thisButton).one(\"click\", afficherVideo);\n}", "title": "" }, { "docid": "a04d340ec97a07a2fdc1985473cdb574", "score": "0.5837105", "text": "requestFrame(next, resumed) {\n let now = Date.now();\n this.frame = {\n count: requestAnimationFrame(next),\n time: now,\n rate: resumed ? 0 : now - this.frame.time,\n scale: this.screen.scale * this.frame.rate * 0.01\n };\n }", "title": "" }, { "docid": "a04d340ec97a07a2fdc1985473cdb574", "score": "0.5837105", "text": "requestFrame(next, resumed) {\n let now = Date.now();\n this.frame = {\n count: requestAnimationFrame(next),\n time: now,\n rate: resumed ? 0 : now - this.frame.time,\n scale: this.screen.scale * this.frame.rate * 0.01\n };\n }", "title": "" }, { "docid": "e79db05f227e75f443f9b39c9c5f219d", "score": "0.5805664", "text": "function processFrame() {\r\n var x = 0, y = 0, w = copycanvas.width, h = copycanvas.height, aspectratio = w / h;\r\n var cutoff = video.videoWidth - (video.videoHeight * aspectratio);\r\n var draw = canvas.getContext('2d');\r\n var copy = copycanvas.getContext('2d');\r\n\r\n // we draw the frames manually using the private video element and the copy interim canvas\r\n copy.drawImage(video, cutoff / 2, 0, video.videoWidth - cutoff, video.videoHeight, 0, 0, copycanvas.width, copycanvas.height);\r\n\r\n // ensure that the canvas does not scale internally\r\n canvas.width = canvas.clientWidth;\r\n canvas.height = canvas.clientHeight;\r\n // white background\r\n draw.fillStyle = 'white';\r\n draw.fillRect(0, 0, canvas.width, canvas.height);\r\n // center image in canvas\r\n if (canvas.width / canvas.height > aspectratio) {\r\n // center horizontally\r\n y = 0;\r\n h = canvas.height;\r\n w = h * aspectratio;\r\n x = (canvas.width - w) / 2;\r\n radius = h / 2;\r\n }\r\n else {\r\n // center vertically\r\n x = 0;\r\n w = canvas.width;\r\n h = w / aspectratio;\r\n y = (canvas.height - h) / 2;\r\n radius = w / 2;\r\n }\r\n\r\n draw.drawImage(copycanvas, 0, 0, copycanvas.width, copycanvas.height, x, y, w, h);\r\n \r\n if (settings.display === 'circle') { \r\n // now we 'fade-out' the edges of the image so that the user concentrates on the center\r\n var gradient = draw.createRadialGradient(canvas.width / 2, canvas.height / 2, 0, canvas.width / 2, canvas.height / 2, w * 0.5);\r\n gradient.addColorStop(0, 'transparent');\r\n gradient.addColorStop(0.6, 'rgba(255, 255, 255, 0.3)');\r\n gradient.addColorStop(0.9, 'rgba(255, 255, 255, 0.7)');\r\n gradient.addColorStop(1, 'rgba(255, 255, 255, 1)');\r\n draw.fillStyle = gradient;\r\n draw.fillRect(0, 0, canvas.width, canvas.height);\r\n }\r\n \r\n if (capturing && uploaded < settings.recordings) {\r\n // we may need to switch on the tags again ??????\r\n //if (settings.challengeResponse && tag === 'any') { setTag(); }\r\n\r\n // first frame has trigger true\r\n motionResult = { trigger: true, motion: 0 };\r\n\r\n if (captured > settings.maxupload) {\r\n stop();\r\n doneCallback('The maximum number of uploads has been reached!');\r\n }\r\n\r\n // scale current image into the motion canvas\r\n var motionctx = motioncanvas.getContext('2d');\r\n motionctx.drawImage(copycanvas, copycanvas.width / 8, copycanvas.height / 8, copycanvas.width - copycanvas.width / 4, copycanvas.height - copycanvas.height / 4, 0, 0, motioncanvas.width, motioncanvas.height);\r\n var currentImageData = motionctx.getImageData(0, 0, motioncanvas.width, motioncanvas.height);\r\n \r\n if (templateImage) {\r\n // calculate motion ...\r\n motionResult = motionDetection(currentImageData);\r\n // draw motion bar\r\n drawMotionBar(motionResult.motion);\r\n }\r\n if (motionResult.trigger) {\r\n if (uploaded + uploading < settings.recordings) {\r\n // in case we are not already bussy with some uploads start upload procedure\r\n upload();\r\n // current image is the new reference frame - create template\r\n createTemplate(currentImageData);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "1a00f482719c323ae76f1e2680d74470", "score": "0.5795345", "text": "function drawWebcam() {\n // Drawing the video twice\n large_context.drawImage(video, 0, 0, numpixels, numpixels)\n tiny_context.drawImage(video, 0, 0, numpixels, numpixels)\n\n // blow up one canvas just to see what our enlarged pixels look like\n large_context.drawImage(large_canvas, 0, 0, numpixels, numpixels, 0, 0, width, height)\n\n // draw 60 times / second\n requestAnimationFrame(drawWebcam)\n}", "title": "" }, { "docid": "b3c271b65c552063eb53ae7a1d9e4f8e", "score": "0.5786972", "text": "function advanceFrame() {\n\n //Advance the frame if `frameCounter` is less than\n //the state's total frames.\n if (frameCounter < numberOfFrames) {\n\n //Advance the frame.\n sprite.gotoAndStop(sprite.currentFrame + 1);\n\n //Update the frame counter.\n frameCounter += 1;\n } else {\n\n //If we've reached the last frame and `loop`\n //is `true`, then start from the first frame again.\n if (sprite.loop) {\n sprite.gotoAndStop(startFrame);\n frameCounter = 1;\n }\n }\n }", "title": "" }, { "docid": "a2b20000010d77bab358fe6346d2bd4c", "score": "0.57866293", "text": "function nextPage() {\n\n\tif (viewportQueue.length) {\t\t\n\t\t\n\t\tvar vp = viewportQueue.pop();\t\t\t\t\n\n\t\tcapturePage(parseInt(vp[0]),parseInt(vp[1]));\n\n\t} else if (!options.interval) {\n\n\t\tphantom.exit();\n\n\t}\n\n}", "title": "" }, { "docid": "b54408542f50dff23931b23bb852fa0e", "score": "0.5764663", "text": "function playNext() {\n // Disable the skip button & change video channel button\n $(\".playlist-btn-container > button\").prop(\"disabled\", true);\n // Display the static.gif\n // $(\"#backgroundVideo\").removeAttr(\"autoplay\");\n // document.querySelector(\"#backgroundVideo\").load();\n // Increment currentVideoIndex\n currentVideoIndex++;\n if (currentVideoIndex >= videos_array.length) {\n currentVideoIndex = 0;\n };\n // Get the next videoId --> inorder to get the mp4 file format\n var video = videos_array[currentVideoIndex];\n var videoId = video.id;\n console.log(video)\n playVideo(videoId);\n }", "title": "" }, { "docid": "b118f97ac960c61c761ca4d4d0a13ec9", "score": "0.5750134", "text": "processFrame(e) {\n if (this.started === false)\n return;\n\n this.frame.data = e.inputBuffer.getChannelData(this._channel);\n this.propagateFrame();\n\n this.frame.time += this._blockDuration;\n }", "title": "" }, { "docid": "8525d4f02e3d999770407be7c35ab9ac", "score": "0.57226825", "text": "function start(){\r\n\r\n var video = document.getElementById('hiddenCamera');\r\n var canvas = document.getElementById('cameraCanvas');\r\n var windowURL = window.URL || window.webkitURL;\r\n\r\n //allow user for pesmission to use media inputs (opens camera, mic)\r\n navigator.getMedia = navigator.getUserMedia || navigator.webkitGetUserMedia; \r\n\r\n \r\n navigator.getMedia({video:true},function(stream){\r\n localstream = stream;\r\n video.src = windowURL.createObjectURL(stream);\r\n\r\n },function(error){\r\n alert('error');\r\n });\r\n \r\n video.addEventListener('play',function(){\r\n setInterval(function(){\r\n canvas.getContext('2d').drawImage(video,0,0,299.5,149.5);\r\n });\r\n },false);\r\n}", "title": "" }, { "docid": "d036a30b565439b98e0e89e65ffb9ecc", "score": "0.5710987", "text": "draw (video) {\n this.context.drawImage(video, 0, 0, this.canvas.width, this.canvas.height)\n }", "title": "" }, { "docid": "fcca636eceeed8815837cc0e483d98be", "score": "0.57061243", "text": "gotoNextFrame() {\n this.scriptOwner.parentClip.gotoNextFrame();\n }", "title": "" }, { "docid": "11465e21de6a2ac574e84fe71d31af6a", "score": "0.5684768", "text": "function capture() {\n let c = document.createElement(\"canvas\");\n c.width = video.videoWidth;\n c.height = video.videoHeight;\n let ctx = c.getContext(\"2d\");\n\n ctx.translate(c.width / 2, c.height / 2);\n ctx.scale(currzoom, currzoom);\n ctx.translate(-c.width / 2, -c.height / 2);\n\n ctx.drawImage(video, 0, 0);\n if (filter != \"\") {\n ctx.fillStyle = filter;\n ctx.fillRect(0, 0, c.width, c.height)\n }\n // let a = document.createElement(\"a\");\n // a.download = \"image.jpg\";\n // a.href = c.toDataURL();\n\n addMedia(\"img\", c.toDataURL())\n // In case of image, when we create a URL, the whole image can be fetched from that URL anywhere.\n\n // a.click();\n // a.remove();\n}", "title": "" }, { "docid": "093de715b7df3e42062d9b8d44d68c53", "score": "0.5673675", "text": "function sendSnapshot() {\n if (\n !localMediaStream ||\n (video.videoWidth == 0 && video.videoHeight == 0)\n ) {\n return;\n }\n // canvas.width = video.videoWidth;\n // canvas.height = video.videoHeight;\n\n // CHANGING CANVAS WIDTH TO 640\n canvas.width = 740;\n canvas.height = video.videoHeight / (video.videoWidth / 740);\n\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n\n // DRAWING THE LINE\n if (startpt[0] != -1 && endpt[0] != -1) {\n ctx.beginPath();\n ctx.moveTo(startpt[0], startpt[1]);\n ctx.lineTo(endpt[0], endpt[1]);\n ctx.lineWidth = \"5\";\n ctx.lineCap = \"round\";\n ctx.strokeStyle = \"blue\";\n ctx.stroke();\n }\n let type = \"image/jpeg\";\n let data = canvas.toDataURL(type);\n data = data.replace(\"data:\" + type + \";base64,\", \"\");\n socket.emit(\"newframe\", data);\n }", "title": "" }, { "docid": "a588758d8aeb4fe71a659df88fd35b55", "score": "0.56645876", "text": "setCurrentFrame(newFrameValue) {\r\n this.assertNoteLoaded();\r\n const newFrameIndex = Math.max(0, Math.min(Math.floor(newFrameValue), this.frameCount - 1));\r\n if (newFrameIndex === this.currentFrame && !this.showThumbnail)\r\n return;\r\n this._frame = newFrameIndex;\r\n this.drawFrame(newFrameIndex);\r\n this.showThumbnail = false;\r\n if (!this.isPlaying) {\r\n this.playbackTime = newFrameIndex * (1 / this.framerate);\r\n this.emit(PlayerEvent.SeekEnd);\r\n }\r\n this.emit(PlayerEvent.FrameUpdate, this.currentFrame);\r\n this.emit(PlayerEvent.Progress, this.progress);\r\n this.emit(PlayerEvent.TimeUpdate, this.currentFrame);\r\n }", "title": "" }, { "docid": "07da328f85f3a090c6fc91cae4d37129", "score": "0.56517035", "text": "function startCapture() {\n if (window.stream) {\n window.stream.getTracks().forEach(function(track) {\n track.stop();\n });\n }\n var videoSource = videoSelect.value;\n var constraints = {\n video: {deviceId: videoSource ? {exact: videoSource} : undefined,\n width: {exact: 320}, height: {exact: 240}}\n };\n\n var device_video = {deviceId: videoSource ? {exact: videoSource} : undefined};\n // Connect Media\n getUserMedia(constraints, gotStream, handleError);\n }", "title": "" }, { "docid": "64433ed365740d064e20e3d6c1e90e1d", "score": "0.5648949", "text": "function getNewWebcam() {\n\tsample = createCapture(VIDEO, videoReady);\n\tsample.hide();\n}", "title": "" }, { "docid": "2724e8840ff153080dfc639cf162270a", "score": "0.5647994", "text": "function getNewWebcam() {\n\tstatus.html('in getNewWebcam()');\n\t// Todo: disable buttons until we're ready to try again\n\tsample = createCapture(VIDEO, webcamReady);\n}", "title": "" }, { "docid": "da12be6dfb1a1d96d15e26d8ac790760", "score": "0.5645843", "text": "function sendFrame(video, context) {\n context.drawImage(video, 0, 5, 200, 200);\n emit(canvas.toDataURL('image/webp'));\n }", "title": "" }, { "docid": "1fe8ae64ba0d5193f6acb05d053c0334", "score": "0.56457955", "text": "function switchToImageOverVideo(path,xc,yc,lc,hc){\n\tsequenceStopped = false;\n\tcurrentSequence = 'image';\n\tcontainerVideo.src = URL.createObjectURL(mainStream);\n\tcreateSimpleOutputStream();\n\tcreateRecorder();\n\timage.src = \"/doublevideo/media/images/\"+path;\n\tx= xc;\n\ty=yc;\n\tl = lc;\n\th= hc;\n\tdraw = true;\n\tstartRecorder();\n}", "title": "" }, { "docid": "25d1e142758ef174820e7b3717f38459", "score": "0.56156987", "text": "function extractFramesFromVideo(video, canvas, config, file) {\n let resolve = null;\n let ctx = canvas.getContext('2d');\n let totalFrames = 0;\n let duration = 0;\n let totalSteps = 0;\n\n return new Promise((_resolve, _) => {\n resolve = _resolve;\n\n function onload() {\n duration = video.duration;\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n // console.log(video.duration);\n\n // video.addEventListener('seeked', function() {\n // ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n // }, false);\n\n video.currentTime=0.0000001;\n video.currentTime=0;\n\n totalSteps = duration / config.stepSize; // show one frame each 0.1 seconds\n\n video.playbackRate = config.playbackRate;\n\n resolve({\n width: video.videoWidth,\n height: video.videoHeight,\n totalFrames: () => { return Math.ceil(totalSteps); },\n getFrame: (frameNumber) => {\n return new Promise((resolve, _) => {resolve();});\n },\n seekVideoAndGetFrame: (frameNumber) => {\n video.currentTime = frameNumber * config.stepSize;\n return new Promise((resolve, _) => {resolve();});\n }\n });\n }\n\n video.src = URL.createObjectURL(file);\n video.addEventListener('loadeddata', onload, false);\n\n });\n}", "title": "" }, { "docid": "f72956142aac50bcdeea33f805783bf4", "score": "0.5613349", "text": "function displayFramegrab(framegrab) {\n\tvar elVideo = null;\n\t$(\"video\").each(function(index) {\n\t\tif (this.currentSrc === framegrab.videoSrc) { \n $(\"body\").animate({scrollTop: $(this).offset().top - 50}, 200);\n\t\t\telVideo = this;\n\t\t\tif (elVideo.readyState === 0) { // i.e. video not yet loaded\n\t\t\t\t$(elVideo).bind(\"loadedmetadata\", function() {\n\t\t\t\t\telVideo.currentTime = framegrab.timecode;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\telVideo.currentTime = framegrab.timecode;\n\t\t\t}\n\t\t\treturn true; // only returns from closure\n\t\t}\n\t});\n\tif (elVideo === null) {\n\t\tconsole.log(\"No video element found on the page with the src requested: \" + framegrab.videoSrc);\n\t}\n}", "title": "" }, { "docid": "681d9c85e63f8a57da28344688fe2a60", "score": "0.5611533", "text": "function nextPlay() {\n const newIndex = currentIndex +1;\n setCurrentIndex(newIndex);\n const newVideoList = videoList.filter(video=>(currentTime.isBefore(video.showing)))\n setNewVideo(newVideoList[newIndex])\n }", "title": "" }, { "docid": "d8cc30fd4f990cf3f28456c27862b1e5", "score": "0.5610855", "text": "goForward() {\n this.stopRecordEvents();\n this.preview.goForward();\n this.setState({ address: this.preview.src });\n }", "title": "" }, { "docid": "8707be0b1b63f9a277a760469508cce0", "score": "0.56103826", "text": "function computeFrame (video,canvas,emotion){\n\n canvas.getContext('2d').scale(-1,1);\n canvas.getContext('2d').drawImage(video, 0, 0,canvas.width*-1 , canvas.height);\n\n\n}", "title": "" }, { "docid": "b7ebf8632fb9aec6c98aff824c4acb2a", "score": "0.5609288", "text": "function storeFrame() {\n // send progress\n var evprog = {'type': 'load-progress', 'lengthComputable': true,\n 'loaded': frameIndex, 'total': numberOfFrames};\n if (typeof dataIndex !== \"undefined\") {\n evprog.index = dataIndex;\n }\n cbprogress(evprog);\n // draw image\n ctx.drawImage(video, 0, 0);\n // context to image buffer\n var imgBuffer = dwv.image.imageDataToBuffer(\n ctx.getImageData(0, 0, width, height) );\n if (frameIndex === 0) {\n // create view\n view = dwv.image.getDefaultView(\n width, height, 1, [imgBuffer], numberOfFrames, info);\n // call callback\n callback( {\"view\": view, \"info\": info } );\n } else {\n view.appendFrameBuffer(imgBuffer);\n }\n }", "title": "" }, { "docid": "790869a261fd6014a8ecff805ef32171", "score": "0.5602897", "text": "next_frame() {\n let ret = {};\n return ret;\n }", "title": "" }, { "docid": "fa6b2c0e2944792f01bb63e04f479b3f", "score": "0.56022334", "text": "function capture_fallback(e) {\n console.log(e);\n video.src = 'big-buck-bunny_trailer.webm';\n}", "title": "" }, { "docid": "d94f86dd1697238138242c1dfe96779b", "score": "0.56018466", "text": "function takePhoto() {\n context.drawImage(video, 0, 0, 600, 400);\n }", "title": "" }, { "docid": "856583be598dfc8dda1b25c90fca5a6d", "score": "0.55965734", "text": "function playNextVideo(){\n\t\tif (currentPlayingNum === totalCount){\n\t\t\tcurrentPlayingNum = 1;\n\t\t} else {\n\t\t\tcurrentPlayingNum++;\n\t\t}\n\t\tcurrentPlayingId = \"player\" + currentPlayingNum;\n\t\tplayVideo();\n\t}", "title": "" }, { "docid": "f7aaa06f6bfcffc51bafd09c33b5b6e6", "score": "0.5590664", "text": "function fireNextFrame() {\n // Trigger event for animator.\n // Notice, when animator handles the event, it also gives the callback event back.\n // Then, the flow automatically continues also here.\n firePause();\n changeToNextFrame();\n }", "title": "" }, { "docid": "025402b57d6c9e1a990136946db49d8a", "score": "0.55871123", "text": "function replayMedia() {\n\tresetPlayer();\n\tvideoScreen.play();\n\tvideoWebcam.play();\n}", "title": "" }, { "docid": "6e3707e2062366c9145bb37f8c56bbf1", "score": "0.5585072", "text": "function captureVideoFrame(video, format) {\n if (typeof video === 'string') {\n video = document.querySelector('#' + video);\n //console.log('[DEBUG] Capturing video from ', video);\n }\n\n format = format || 'jpeg';\n\n if (!video || (format !== 'png' && format !== 'jpeg')) {\n return false;\n }\n\n var canvas = document.createElement(\"canvas\");\n\n //console.log('[DEBUG] hiddenCanvas is ', canvas);\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').drawImage(video, 0, 0);\n\n var dataUri = canvas.toDataURL('image/' + format);\n var data = dataUri.split(',')[1];\n var mimeType = dataUri.split(';')[0].slice(5)\n\n var bytes = window.atob(data);\n var buf = new ArrayBuffer(bytes.length);\n var arr = new Uint8Array(buf);\n\n for (var i = 0; i < bytes.length; i++) {\n arr[i] = bytes.charCodeAt(i);\n }\n var blob = new Blob([arr], { type: mimeType });\n\n return { blob: blob, dataUri: dataUri, format: format, bytes: bytes, arr: arr };\n}", "title": "" }, { "docid": "cad09d3711d1582f083e07791be934b8", "score": "0.5570265", "text": "function processNextSegment(scope) {\n // Wait for the source buffer to be updated\n if (!scope.sourceBuffer.updating && scope.sourceBuffer.buffered.length > 0) {\n var bufferEndTime = getBufferEndTime(scope);\n var bufferRemaining = bufferEndTime - scope.video.currentTime;\n\n console.log('-----processNextSegment', bufferRemaining);\n\n // Only push a new fragment if we are not updating and we have\n // less than BUFFER_WIDTH seconds in the pipeline\n if (bufferRemaining < scope.config.BUFFER_WIDTH) {\n getChunk(scope, scope.chunkIndex);\n return;\n }\n // Start playing the video\n if (scope.video.paused) {\n scope.video.play();\n }\n }\n setTimeout(\n processNextSegment.bind(null, scope),\n scope.config.BUFFER_POLL_FREQ\n );\n}", "title": "" }, { "docid": "18c75bef28dd5f714c7c9e12298cc891", "score": "0.5569582", "text": "function updateWebCam()\n{\n\tif ($(\"#webcam-video\")[0].currentTime >= 43.5)\n\t{\n\t\tif ($(\"#response\").length === 0) {\n\t\t\t$(\"#webcam-video\")[0].currentTime = 36.5;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2ba70fd53b58489a15bac5e371c37d2a", "score": "0.5559533", "text": "function captureImage(video) {\r\n const canvas = document.createElement('canvas');\r\n canvas.width = video.videoWidth;\r\n canvas.height = video.videoHeight;\r\n const ctx = canvas.getContext('2d');\r\n ctx.drawImage(video, 0, 0);\r\n return ctx.getImageData(0, 0, canvas.width, canvas.height);\r\n }", "title": "" }, { "docid": "5da3b1ca1bcb11ba8f005b531529cda7", "score": "0.5542121", "text": "function scrollPlay(){ \n var frameNumber = window.pageYOffset/playbackConst;\n vid.currentTime = frameNumber;\n console.log(frameNumber);\n window.requestAnimationFrame(scrollPlay);\n}", "title": "" }, { "docid": "021a97d3e39b6b03a9ce0116fea9cef9", "score": "0.55365664", "text": "doPlay( evt ) {\n // One camera is enough\n if( !this.streaming ) {\n // Preserve aspect ratio\n let height = this.video.videoHeight / ( this.video.videoWidth / 480 );\n \n // Size video display\n this.video.setAttribute( 'width', 480 );\n this.video.setAttribute( 'height', height );\n\n // Track state\n this.streaming = true;\n \n // Position card\n // Make visible\n this.root.style.display = 'flex';\n this.root.style.left = Math.round( ( window.innerWidth - 480 ) / 2 );\n this.root.style.top = Math.round( ( window.innerHeight - this.root.clientHeight ) / 2 ); \n this.root.style.opacity = 1;\n }\n }", "title": "" }, { "docid": "a451768f9ce921abf0d70eb0dc5f1467", "score": "0.55303824", "text": "function capture_success(stream) {\n // Set the video source to the MediaStream object to render the video in the\n // browser\n video.src = window.URL.createObjectURL(stream);\n video.controls = true;\n localMediaStream = stream;\n \n still.width = video.clientWidth;\n still.height = video.clientHeight;\n \n // Blobed JPEG sent every second\n \n timer = setInterval( function () {\n context.drawImage(video, 0, 0, still.width, still.height);\n var data = still.toDataURL('image/jpeg', 1.0);\n newBlob = dataURItoBlob(data);\n ws_vdata.send(newBlob);\n }, 1000);\n \n\n // Connect the MediaStream to the MediaStreamTransceiver\n \n}", "title": "" }, { "docid": "e1360213eeb4ad7b2d17e55bb0058065", "score": "0.5528349", "text": "function capture(){\r\n\t\t\tvar overlay=document.createElement('div');\r\n\t\t\toverlay.id=\"overlay\";\r\n\t\t\tcounter=document.createElement('p');\r\n\t\t\tcounter.id=\"counter\";\t\t\r\n\t\t\tvar rect = video.getBoundingClientRect();\r\n\t\t\tcounter.style.left=rect.left;\r\n\t\t\toverlay.appendChild(counter)\r\n\t\t\tcontainer.appendChild(overlay)\r\n\t\t\tcounterF(1,counter);\t\t\t\t\t\t\t\t\t\r\n\t\t}", "title": "" }, { "docid": "27b00243673aa0ecce21fa340e3b1e41", "score": "0.55222493", "text": "connectCameraDev() {\n this.process = exec(`gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0`, (error, stdout, stderr) => {\n if (error) {\n console.log(`error: ${error.message}`);\n return;\n }\n if (stderr) {\n console.log(`stderr: ${stderr}`);\n return;\n }\n });\n }", "title": "" }, { "docid": "e146e651c71cda54e0a22c48c179a51e", "score": "0.5519777", "text": "_nextFrame() {\n // Process each player\n for (var playerID in this.players) {\n var player = this.players[playerID];\n this._progressPlayer(player);\n }\n return true;\n }", "title": "" }, { "docid": "788c8499cb37fc4a35d1e105fe79d4bf", "score": "0.5491027", "text": "function doneFrameCapturing() {\n return logAndReturn(gCapturingStatus);\n}", "title": "" }, { "docid": "252411035f1c4d6021c5e674029554a5", "score": "0.54903334", "text": "tick() {\n if (this.video.readyState === this.video.HAVE_ENOUGH_DATA) {\n this.videoCanvas.hidden = false\n this.videoCanvas.height = this.video.videoHeight\n this.videoCanvas.width = this.video.videoWidth\n this.videoCtx.drawImage(this.video, 0, 0, this.videoCanvas.width, this.videoCanvas.height)\n var imageData = this.videoCtx.getImageData(0, 0, this.videoCanvas.width, this.videoCanvas.height)\n\n // increase the chances to succeed on poor images\n var filtered = ImageFilters.GrayScale(imageData)\n filtered = ImageFilters.BrightnessContrastPhotoshop(filtered, 0, 40)\n this.videoCtx.putImageData(filtered, 0, 0) // put back the filtered image\n\n var code = jsQR(imageData.data, imageData.width, imageData.height, {\n inversionAttempts: \"dontInvert\",\n })\n if (code) {\n // draw line around the QR\n this.drawRect(this.videoCtx, imageData.height, code, \"#ff0000\")\n\n if (!this.outputFound) {\n this.outputFound = true\n toast(\"Found QR data\", helpers.getToast(helpers.toastType.SUCCESS_AUTO))\n this.setState({\n output: code.data,\n })\n }\n }\n }\n\n // only run video stream as long as reader is active\n if (this.state.selectedOption === \"1\" && !this.outputFound) {\n requestAnimationFrame(this.tick)\n }\n else {\n // stop video stream when QR found\n this.video.srcObject.getTracks()[0].stop()\n }\n }", "title": "" }, { "docid": "579b6367b0f51a914592b0ed94e7cafe", "score": "0.5486293", "text": "function showVideo(){\n var span = $('.canvas[ready=\"true\"]').next();\n var attr = $('.canvas[ready=\"true\"]');\n var id_cam = $(this).attr('url');\n var data = {\n id: id_cam\n }\n var id_canvas = $('.canvas[ready=\"true\"]').attr('id');\n $.get(domain + '/h4l/get_cam_uri', data, function(data){\n if(data.state == 'ok' ){\n $(span).attr('openScreen', true)\n var uri = data.response;\n var client = new WebSocket(uri);\n var canvas = document.getElementById(id_canvas);\n var player = new jsmpeg(client, {\n canvas: canvas\n });\n $('.canvas').css({\n 'border': '2px dashed #6b0c00',\n });\n $('.canvas').attr('ready', false);\n }else{\n throw (\"I can't to download by url\")\n }\n\n })\n }", "title": "" }, { "docid": "f8021618163eb4677915ab748a19a973", "score": "0.5484663", "text": "function paintToCanvas() {\n canvas.width = video.videoWidth\n canvas.height = video.videoHeight\n\n setInterval(() => {\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height)\n let pixels = ctx.getImageData(0, 0, canvas.width, canvas.height)\n // adjust pixels\n pixels = rgbSplit(pixels)\n // put adjusted pixels back into video\n ctx.putImageData(pixels, 0, 0)\n }, 16)\n}", "title": "" }, { "docid": "b72eef499e284b6ae386e6743e13b2f8", "score": "0.54719126", "text": "firstFrame() {\r\n this.currentFrame = 0;\r\n this.emit(PlayerEvent.FrameFirst);\r\n }", "title": "" }, { "docid": "d742d344fd91a2c281c109c78150dd63", "score": "0.54696417", "text": "frame() {\n if (this.keyframe < this.duration) {\n this.keyframe++;\n this.dispatchEvent({ type: 'animation-frame' });\n this.callback();\n } else {\n this.state = PLAYER_STATE.END;\n finishAnimation(this);\n }\n }", "title": "" }, { "docid": "048948dbcdadadf5ef2f948e4db8283f", "score": "0.54677236", "text": "nextPlay() {\n\n //Flips\n for (let i = 0; i < this.flipped[this.movieSlide - 1].length; i++) {\n this.flipped[this.movieSlide - 1][i].flip();\n }\n\n //Check end of movie\n if (this.movieSlide > this.movieMovements.length - 1) {\n this.playingMovie = false;\n this.scene.interface.playerBlock = false;\n this.updateWinner();\n console.log(\"Movie Ended\");\n return;\n }\n\n console.log(\"Play \" + (this.movieSlide + 1));\n\n //Next play\n this.movieMovements[this.movieSlide].piece.play(this.movieMovements[this.movieSlide].x, this.movieMovements[this.movieSlide].z);\n this.movieSlide++;\n\n }", "title": "" }, { "docid": "18585da85cefba1fe88083b91412a238", "score": "0.5465316", "text": "function switchToReplay(filename){\n\tsequenceStopped = false;\n\tcurrentSequence = 'video';\n\t//On change le source du container avec la nouvelle video\n\tvar jcontainerVideo = $('#containerVideoPlay');\n\tcontainerVideoPlay = jcontainerVideo[0];\n\tjcontainerVideo.attr(\"src\",\"/doublevideo/media/video/\"+filename);\n\t\n\t/*On demute la video pour generer des données audio*/\n\tmuteVideo(containerVideoPlay,false);\n\t/* creation du stream d'enregistrement canvas + audio du tag <video>*/\n\tcreateReplayOutputStream();\n\t/*on charge la video*/\n\tjcontainerVideo.load();\n\tcontainerVideoPlay.addEventListener('canplay',function(){\n\t\tcontainerVideoPlay.play();\n\t\tvideoPlay = true;\n\t});\n\t\n\tcontainerVideoPlay.addEventListener('ended',function(){\n\t\ttempLive(true);\n\t\tvideoPlay = true;\n\t});\n\t\n\tcreateRecorder();\n\tstartRecorder();\n}", "title": "" }, { "docid": "30b50cfde2e06ccf19ef0e50e75a73cc", "score": "0.54594594", "text": "function captureToCanvas() {\n const canvasEl = document.getElementById('captureCanvas');\n canvasEl.width = cameraEl.videoWidth;\n canvasEl.height = cameraEl.videoHeight;\n var c = canvasEl.getContext('2d');\n c.drawImage(cameraEl, 0, 0, cameraEl.videoWidth, cameraEl.videoHeight);\n}", "title": "" }, { "docid": "bd84af0a91bcd01d5da321478585ea77", "score": "0.54543346", "text": "async captureImage() {\n console.log('Captured!');\n this.player.current.pause();\n await this.offCamera();\n\n //run 1 more time\n if (this.ctx) {\n await this.captureFrame();\n await this.getCV();\n await this.genText();\n }\n\n if (this.state.recognitionResult != null) {\n let captures = store.get('captures');\n\n if (captures == null) {\n store.set('captures', [\n {\n date: Date.now(),\n recognitionResult: this.state.recognitionResult,\n cachedText: this.state.cachedText,\n renderImage: this.state.renderImage,\n originalImage: this.state.captureURL,\n originalDimension: {\n width: this.width,\n height: this.height,\n },\n },\n ]);\n } else {\n store.set(\n 'captures',\n captures.concat([\n {\n date: Date.now(),\n recognitionResult: this.state.recognitionResult,\n cachedText: this.state.cachedText,\n renderImage: this.state.renderImage,\n originalImage: this.state.captureURL,\n originalDimension: {\n width: this.width,\n height: this.height,\n },\n },\n ])\n );\n }\n\n console.log(this.state);\n console.log(store.get('captures'));\n }\n }", "title": "" }, { "docid": "f04d686dbf125afb8f0ff656ea974af4", "score": "0.5450441", "text": "function findFrameRate() {\n for (var i = 0; i < scope.video.previews.length; ++i) {\n if (scope.video.previews[i].uri === scope.player.adapter.getCurrentSource()) {\n scope.frameRate = scope.video.previews[i].frameRate;\n return;\n }\n }\n }", "title": "" }, { "docid": "fe0250d86abb35b33e603d3db9c77e34", "score": "0.54441655", "text": "async function startCamera() {\r\n\t let stream \r\n\t try {\r\n\t stream = await navigator.mediaDevices.getUserMedia({video: true})\r\n\t video.srcObject = stream\r\n\r\n\t } catch (error) {\r\n\t \t//if the camera does not working, a video will replace it\r\n\t console.log(error)\r\n\t var sources = video.getElementsByTagName('source');\r\n\t \t\t\tsources[0].src = 'video.mp4';\r\n\t \t\t\tvideo.load();\r\n\t }\r\n\t }", "title": "" }, { "docid": "71a0b0836ee3f35a49458d450276c3e7", "score": "0.5434188", "text": "_skipForward() {\n this._video.currentTime += this._settings.skipForward;\n }", "title": "" }, { "docid": "84bf385c19982c60c4250168f6ac66c3", "score": "0.54114074", "text": "function displayNextFrame() {\n if (frame >= numFrames) { // First, see if we're done\n clearInterval(intervalId); // If so, stop calling ourselves\n if (whendone) whendone(element); // Invoke whendone function\n return; // And we're finished\n }\n\n // Now loop through all properties defined in the animation object\n for(var cssprop in animation) {\n // For each property, call its animation function, passing the\n // frame number and the elapsed time. Use the return value of the\n // function as the new value of the corresponding style property\n // of the specified element. Use try/catch to ignore any\n // exceptions caused by bad return values.\n try {\n element.style[cssprop] = animation[cssprop](frame, time);\n } catch(e) {}\n }\n\n frame++; // Increment the frame number\n time += timePerFrame; // Increment the elapsed time\n }", "title": "" }, { "docid": "f649b8440c6ead621cefb39f9d595d80", "score": "0.54055256", "text": "function takeSnapshot() {\n const context = canvas.getContext(\"2d\");\n // copy video image into canvas\n context.drawImage(video, videoCutX, videoCutY, videoWidth - 2 * videoCutX, videoHeight - 2 * videoCutY, 0, 0, imageWidth, imageHeight);\n // generate data URL for local image display\n const srcDataUrl = canvas.toDataURL(\"image/png\");\n image.setAttribute(\"src\", srcDataUrl);\n // convert canvas image to jpeg blob\n canvas.toBlob((blob) => socket.send(blob), \"image/jpeg\");\n // hide video and show image\n video.classList.add(\"hide\");\n buttonDiv.classList.add(\"hide\");\n image.classList.remove(\"hide\");\n // make image flash when taking photo\n image.style.filter = \"brightness(2)\";\n setTimeout(() => image.style.filter = \"none\", 120);\n // start count down blocking interaction\n countDown = 10;\n doCountDown();\n }", "title": "" }, { "docid": "e11b6718a9dfb53e1174d2082fe39fc3", "score": "0.5405203", "text": "function startVideo() {\n navigator.getUserMedia(\n { video: {} },\n stream => video.srcObject = stream,\n err => console.error(err)\n )\n }", "title": "" }, { "docid": "36dca0c8b53cdb1bc330415ac8eaf925", "score": "0.54028434", "text": "function frame() {\n if (running) {\n // Draw one frame of the animation, and schedule the next frame.\n updateFrame();\n draw();\n requestAnimationFrame(frame);\n }\n }", "title": "" }, { "docid": "9ee4d4336cce0fe510da13d941ec94a1", "score": "0.5399269", "text": "function grabWebCamVideo() {\n var constraints = { video: true, audio: true };\n navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {\n localStream = stream;\n localVideo.srcObject = stream;\n }).catch(function (err) { console.log(err) });\n }", "title": "" }, { "docid": "20592103ba1af9dd1b4ae2f6a900926f", "score": "0.5398849", "text": "processFrameInput() {\n\n var frame = parseInt(this._currentFrameInput.value);\n if (isNaN(frame)) {\n console.log(\"Provided invalid frame input: \" + this._currentFrameInput.value);\n this._currentFrameInput.classList.add(\"has-border\");\n this._currentFrameInput.classList.add(\"is-invalid\");\n return;\n }\n\n const maxFrame = this._maxFrameNumber;\n if (frame > maxFrame - 1) // #TODO Fix in the future once video.js has been sorted out.\n {\n frame = maxFrame - 1;\n }\n else if (frame < 0)\n {\n frame = 0;\n }\n\n this._currentFrameInput.classList.remove(\"has-border\");\n this._currentFrameInput.classList.remove(\"is-invalid\");\n this.goToFrame(frame);\n this.checkAllReady();\n }", "title": "" }, { "docid": "e212be6a8eb2b66620c1a0b006dd49b5", "score": "0.53977126", "text": "start () {\n this.toggleDebugger(this.opts.debug)\n document.body.classList.add('handsfree-started')\n document.body.classList.remove('handsfree-stopped')\n\n window.navigator.mediaDevices.getUserMedia({\n video: {width: 640, height: 480, frameRate: 30}\n }).then(mediaStream => {\n this.debug.$webcam.srcObject = mediaStream\n this.debug.$webcam.play()\n this.onStartHooks()\n\n if (!this.brf.sdk) {\n this.startBRFv4()\n } else {\n this.isTracking = true\n this.trackFaces()\n }\n }).catch(() => this.throwError('There are no cameras available.'))\n }", "title": "" }, { "docid": "55c8a1fedbbd81528bdfb3ef0482510f", "score": "0.5382075", "text": "async capture() {\n return (await this.next()).value;\n }", "title": "" }, { "docid": "55c8a1fedbbd81528bdfb3ef0482510f", "score": "0.5382075", "text": "async capture() {\n return (await this.next()).value;\n }", "title": "" }, { "docid": "3452a8a52adb867a7f26b6ade2de4d1b", "score": "0.537576", "text": "async function obtenerVideo() {\n cambioAPrecaptura();\n\n let stream = await navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n width: { max: 360 },\n height: {max: 240 }\n }\n });\n\n video.srcObject = stream; \n video.play()\n}", "title": "" }, { "docid": "b861094dc4b45a308f56b26ed7c0ddda", "score": "0.53749496", "text": "function tick() {\n if (!videoLoop) {\n return;\n }\n requestAnimationFrame(tick);\n}", "title": "" }, { "docid": "a2dd53a95ff03ebec303f0a34d737ecd", "score": "0.53746164", "text": "function drawImage() {\n // clear old drawing\n context.clearRect(0, 0, canvas.width, canvas.height);\n\n // setting defaults\n setFonts();\n\n // audio's snapshot can't be taken\n if (isTakeSnapshot && !options.onlyAudio) {\n isTakeSnapshot = false;\n takingSnapshotIn = 6;\n\n context.drawImage(mediaElement, 0, 0, canvas.width, canvas.height);\n var snapshot = canvas.toDataURL('image/png');\n\n if (options.onTakeSnapshot) options.onTakeSnapshot(snapshot);\n else window.open(snapshot);\n\n return requestAnimationFrame(drawImage);\n }\n\n // if video is muted; don't draw video frames to canvas2d surface.\n // else draw frames to context.\n if (!videoMuted) {\n if (!options.onlyAudio) {\n // make sure that it is not HTMLAudioElement\n context.drawImage(mediaElement, 0, 0, canvas.width, canvas.height);\n } else {\n // if it is HTMLAudioElement then draw an image instead of video frames.\n var image = new Image(50, 50);\n image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAg0AAADhCAIAAADEYxETAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAZ+NJREFUeF7tnQfYFeWZ93dTNdnYsKBi7A0FFQVEUWPvLRaMiiJCFCyIoKCoKPYK6qrRmGzi5ks0xqwae+81KrFib2BPNO3bzW529/vh/8u9z055Zs55T5nznnsurvcaznlm5pl7zvz/z93/7r/n/J3/cwm4BFwCLgGXQJ4EnCRcAi4Bl4BLwCUQk4BLxyXgEnAJuARcAs4TbltzCbgEXAIugXol4CzqEnAJuARcAi4B1yfqZVH3a7kEXAIuAZeAs6hLwCXgEnAJuARcn3B9wiXgEnAJuATqlYCzqEvAJeAScAm4BFyfqJdF3S7pEnAJuARcAs6iDZDATTfddOONN95www3XX389+2y/Sm3+U3MJuARcAh0qgQagZIfeeclp/zLYrgu2az/ffv7zn1999dU/+9nPfvrTn/6fz7d/+qd/+tGPfvTjH//4n//5n/kvn/MtY9iuueYaDuEc0Am8Ap0wB/31fy4Bl4BLoLIScIRKSgC1QATA9otf/AKs/8lPfgLoA/0//OEPr7zyyis+39j5/ve//73vfe+SSy658MILL7jggvPOO++cc845/fTTzzzzzLPPPvv888/nc75lzOWXXz5r1qyLLrqI/7LPea666ipRCJcQ5bADJcEflf2t+MRcAi6B7pSA88T/SACMBqzBblgBHGdjB/0AVgDxIYApU6Ycdthho0ePHjly5DbbbLPVVlttttlmw4YNW3/99QcMGLDmmmuuttpq/fv3X3vttQcOHDho0KAhQ4bw7fDhwzfddNO99tpr33335dgjjzzy+OOP52xQy8UXXwzZ/OAHP4CEICQUDrSNf/mXf0HhgK6wXXXnj9Lv2iXgEqiUBLqXJ0Bh1u8oDazr0RhggksvvVRaAvsnnXTS+PHj4YNNNtlkww03BPdXWmmlJZZYYoEFFvi7nO3vP98SX+rDL3zhC/r8i1/84je+8Y2+ffuuvPLKMMo666yz4447wh8TJ05EC5Hy8Y//+I8oH+gc2K+YGOQBc7h5qlKvjU/GJdBVEug6nkBpYLXOsh2HARoDcIy6ADqfddZZxx133AEHHPCtb30LtaBPnz5Qwpe+9KU8Vsjjg69+9atf+cpXvvzlL0MJadrIOxtEsuiii6KRbLvttgcffPDkyZPhKrSNyy67DG2DeTJbGaa66tfpN+sScAlUQQJdxBMwBDiLHQmNAScBqgMKBHrD3nvvPXTo0PrwvSSL1DFshRVWQI/Zf//9p02bNnPmTJiMCcNqconDGVX49fgcXAIugW6QQFfwBPSAcQkzDjjL8vzcc8/FzYCDYdVVV1144YVRGlj4SwlgvyY9oA4CKHkI82FbcMEFF1tssdVXX3377bfHsYFtCqsU6gV3BFVgleK+uuFn6vfoEnAJtFECvZknWHeDqhhw0B5YjwOyxxxzzHbbbbfWWmt97WtfE16jRkAM7BhJYAIqby8qCfo9HwZh4NXAR7L77ruPHTt2+vTpRE+hGEF+UAXhUm38DfmlXQIugd4tgV7IEwpbwieMiYngJcw1mG523nlnQBa0NccyqoO4QU5m2IJNJFEFntA0Mmfy9a9/fY011thtt92Iv8KHwW0SLqVAW/wuvfv36nfnEnAJtF4CvYonWFYTXUowKwYZcJOEhjFjxhCcusgii4QresAXepC5yT43XI4AdM/VgvJnkJYTbnAYc4Yk7Cv2Bw8ePG7cOHI1YAtuHF4kPgqa9Pio1r9LfkWXQG+VQC/hCSJHla3Gyhp6IHJp1113JacBjUFQyw7mfnbCECb2MUClg5pCziiP7I0dyYTz1Bq++od/+Ad0I2lC7BCdddBBB02dOhX1QroFnOHGqN760vp9uQRaLIGO5wkYghW0cptxU2NiwkG93HLLpVEb2NVKnIDXhRZaCHgNlYnEeCU9WN5DYzmgzNlCvYHx8rRnZm/wlehw2WWX3WmnneBI4rhEFXBGi39PfjmXgEug90mgs3mCXDkV1SDPgNU0OWuEkwo0bTFuVqY0OqNJKBw2beQRT6Q/LwPxDRkj34lmCKXxN2E6kyuFv8wfrQhe0YClllqK4KgTTzwR1pSORXCUm6F636vrd+QSaJkEOpUnKGuBDqGCS6ygSU9jNW2wHtcDWJUDrIXOaukfjdUqOKECcG2GmSoCYyAGGxNmdOeRUCJMC7bYZZddTj75ZEQEiRIWRXZhy35VfiGXgEugN0mg83iCShuK7SHUlSy5rbfemjRmQ1utwcuv6KVtpI1ORjk6YflgWfGKxU3FveIhV0EM3IW4Ic1hhfqNLipi0+0wbQqNoFtQlBCtC3EhOv12Pa+7N73Dfi8ugWZLoJN4goBXK8+Hs/o73/kOFffMUy1wzIslDZkgNCiFiMypQvMOvuLFF188TTmKOzIyKOSkcErgOEYktBkupEuHLBXayhiWuDXZl/IuZ35vxfvaqYj1+uY3vzlq1CiVuUW3wJ3jukWz3ys/v0ugN0mgY3hCrR+I+CRp7tBDD6UwHwX1pEZIJ5BBvxC1Bc0cGKJwIgc7NPuYQ9sSLOwSAn3qMi299NIrrrgiWdOU9qNMLNX9UHFI11hmmWXIpmae4DubAq7CTWUB058nXBFMNcEZ6du08CfjSxvDsdwvnErZKBU2VxuM3vQ79ntxCbgEmieBqvMEnmrWv4plwnhCyQ0y5oBmgaCw2wBRppsyVBGO0Tod7UFsEZ6Qqh6MRHVgZ5VVVtl8881ZmJ9wwgloM7fccssdd9xx7733Pvroo7Nnz37ppZdef/31t95664MPPpg3b96bb745Z84cPn/88ccffPDB++67j/mTQc2xBx544BZbbAGpQCFmaDJwl++EG5G9Swwh9aXMfaW9KVJBdDictOeee5KjjlaBXwd5ugGqea+Wn9kl0GskUGmeEElQfgPDOuU3QFjKcQvNrd5GaDgq43MObTswRBp/lX/H8hy1gIrfoCqr72eeeeb3v//9f3++/fWvf/3jH/+o/fTGt2z/+Z//+V//9V/ht3xi//3Tn/4EqTz00EOEIVGBA+5Zb7310gwnPSn0ZieintLaCawgVUkqkTSVROFbCG/ChAmKnYUnvMtFr3mZ/UZcAk2SQKV5AtsImgSINmPGjC233JICR0JGg0tZY/grfDQOKIxn1SGCUYCYoFKOxRux0UYbHXXUUVi3Xn31Vcjg3//938F320LoDz9MUEIeheR9zuGffvrp888/z/0Su0VfI6V3mBktoTZlKhZKsAjNUwkPiglHgqJKLu2SFDvL/XofvSa9YH5al0AvkEBFeQJHq5pLY0w/5JBDWG4LHCNxRwJK0zMiVhpgNyQVqsZSXI+aetiIUBrghn/7t38z1eE//uM/QlWAz4F1NAb+hptxQN7nnIcz/+Uvf+Hkop9M2uDwjz76CM7ASEVRcYJ97cZLel9svLzZ4VHm3xbR4uOhMCJxUNT8QNqeY9EL3me/BZdAMyRQUZ4gkViNIkaMGGEZZHnQHy635aIwfcIW0UpmNl83n/fr12+PPfYgBOjll1+uVQNozXjYCIcHciATgsoc3D6gb05vsV2mf1tZGnGvhs6Dx4IUbgJnyVXEvuelPprxjvk5XQKdLoHK8QRQBXbTJYIO0liBCuN8EuRhYT+Gp1IywmEYdnDkvvLKK//6r/+at65vDRPEr/J/P9805rXXXqPjHg5w+RswmoWeFTEl9253LU943PUtTwwjaYiEm0SZ7dBSp/+mff4uAZdAYyVQLZ5QxwjUiGOPPZYuEYK5QrzTGKDTSCXUJwhV0n+JVaXlNSYdDDsCX0gCquihd6HZjMIk5RvHWsVs77nnHhqjkkAHK+DGkIhMbUqkgIQ1rBKcAc0YqSC99ddf/+ijj4ae2YgdcBtUY18zP5tLoKMlUCGewJtKeQns8iTQUXZC7mWRRDzOB5RkiZ0YA0RiVBE4UvTp1FNPJXQV3wAeAjC32eDe8/Pj2Q51HdwbOqdY7cUXX8QLTYqGfDYQBjebjt1K53UbW2iw+FUfwqNElMHTUIW7Kzr6rfbJuwQaK4FK8AQMgSZBmOasWbOIw1GEaGg4ittP+NYUCEu+Ew4SA3rBBRd8+OGHAlmW5IbgWqGzVVyfSDjSoTpzs8+dO5eEknXXXdfkY8WjCiO+EiKVx5ujcOlj4FLOimdXNPZl87O5BDpUAu3nCeL3wSOACRM55fws/N+ArKSLIhyGrQmz1cyZM8l6w1bzySefkLKQWOPLnlNZ/4RNjB10ILZwqsz8t7/9LR9yU+R24IhGGzAJpO1vaaINXeJSLKR8oF5QdpcesdC2l/fo0Lfap+0SaKwE2swTIJE0CUhi4403thw6mVOwPgngSJbOUykwuahek+WpUTyDHIjPPvtM2kNoZTLrjUhCmgR/K8gWTJUtYSJjngn1wmb+zjvvUBWRSiGFupcGKD8DuYXuH9mg0MmIICCTA7c2jwb/dmN/c342l4BLoLMk0E6eUF0/opswteNHFX6FagEr3LCkXR4Cqr6FAI4MaupkSHUAUjHRJMggXJgrV67nvoRWniHTUGZ3QRERvDuKJA4rk8fJI3RjGN0OHToU4iH8iSwWVyw666322boEGiuBtvEEJEEyMDCEJkGJutDHkAdqFr0TBurYYPpg33777YJss+C3EsHbey2oQvoT7EiPv29961sJt7ZSFBPmprSow5x2yJsOFjgqyHb08h6NffH8bC6BDpJA23gCkmChShM6HAlllAaRBH8FZFbWQgW6MZKQaoAT4r333msvXrfr6lIpzONCIUJkS6lBZIV6IWZlpzBp0eKgxCgy4uE98ryKDnqrfaougcZKoA08wfqUsEtCYAnYp2xqSXs6w1S91WxTMqwPGzbs/vvvT+gQcvB21WauF9OlcHRjhtpkk01EseqfKgGWqapr6siAAQOgCpJacFS4VtHY18/P5hLoCAm0micwiVCTg6LWp5xyCkGrobkpHspp6REq5qoDyYr43e9+p4pJcvlWOYSpBbylOrXQJKqVBPLGG2+A8kaxiVqBcZJWJUEkj3ucUoxELUMVnoLXES+2T9Il0EAJtJQnyJMAaFiZTps2DXMTmGVxSsqqi8AWAxSNIzVitdVWI1CKgFegEEzUatpKf1u5ixZAc0Uu8ec//9lUCnPSfPzxx9pH5nS1M/HGOyOF2oasfPzF/TNp0iQ4nifoZaAa+Ab6qVwC1ZdAS3kChwShlkTRKLrJIjLDGhJ5VBF6Zen5THI18IcaIUpgBW3pcmgYFcHuVk4DjrSop1CpgjxEn6Rw49yW2COqG3LGXZQYoP9i4qPPEpSDu6L6v2yfoUvAJdAoCbSIJzA34ZYgChZz06abbpoIxSlTtE5LYDCO5p3vv/++IPgPf/hDiMWyPsnw0kqMrua1FAFMmqEIlb+oXxMnTozUZg/NgOmKs7AFWsWJJ54I2XuwbKPeQD+PS6D6EmgRT2CpAFyoHbTNNtuAU7akxZRk5iarapenUjCAIhwCZYFgwtJisaHVBO5mzypMHuRa8GUYHyzuRGI0nLCaTmlRS8kLMyrkGVKqI+RBtvb5558P69NVyX0V1X/DfYYugZ5LoBU8wdoTYwXwtNVWWxniRFwRoJhwKsy5o2PPfLP4555qmZiqWc4vUV0DpGZFr0V9uzaV/TC7HE6Lm2++eZFFFrEIYz2LeLFFBpgWSMsKqALi9wJQPX8D/QwugepLoOk8gcUJcxMBTnQcWnLJJeUjTVc2NdoQNzBAQU3scAjFi8iylvZg9BA2nmsXBOddN6zW1/a5GUOY6DBAEUy8wQYbiCrgDNXWLaQKqRo8RyrL8kxJqqB1efV/5T5Dl4BLoCcSaC5PEODEqhNlgtBMFWuyjtYRfcK+EqkMGjTokUceEdiF3MAiPWF3ajsi2wRUM0p9I6pTHSTUKpjqU089RRqdzIARS5Qeh6jdMjCIaZ4wYcLFF19MHkxPfn9+rEvAJVB9CTSRJ9AkiKEkpY7KHEqVsFzfMqkSkAQb4bOvvvqqrO1h6wjlTFSHGPJmUoX6UUqq0Axt549//COfP/fcc9Rxkk8iouTJv23tQMQc5N8R/oSy6Nan6r/nPkOXQE8k0CyeoHIcrk48E/Qdwncte4XMGvHgfY1cdNFFASY6KwBn6A3yx1ph1yp3jGCqKulanTK06rRhPEGmBSK1T5599tnBgwdLz4toFVZZ1lJeYHECbUm+YylAta6e/Ar9WJeAS6DKEmgWTxAMA0ngu6aAK6EyQL9lbBVanGRuWnXVVak8ITgDfM2GAwpXWZMgVDekMRA5Ye1piw5kngl2wqBhSfLll1/GVxFX8sLWqnqCIpX999+fIDQMjDzxKv/QfW4uAZdA3RJoCk8AGQAHRUa/+93vEqcEmlggbNy4YehDBVnMTcqhkzKRMOCEtpS2IG/kooAvKeIQBiRRkaAsOUukk1mBE/at3gkGqHXWWSfix060UOWByldBSY+DDjqIBQE2RjdA1f0e+oEugSpLoCk8QXUHimrQEw0XtGkPwIoUhcL+dJAEBewEavJUW1wpnFH9mhxPP/00uIn3nh3RWxv97VJuQiVMKk7IcxrzxBNPLL/88nnaHtqGWaWUgmcmxA033JD0SaxPGBvdAFXlt93n5hKoTwJN4Qkg8tJLL91iiy0KTUwWS2PLVfSPu+66y4zpMoy00Rtsl9bqm80+0Q5/DXb5dsyYMdaGr1+/fpAlYxJ541VTgEQkdBGntgdzNl3BiCGhTKQf62677XbOOeewOGDzmrL1vYp+lEugshJoPE8QCEtCHGZrouwjPMH6lE0rUy1OCadB4eBYGUasoUIYpdN6hC3jjpaKA8hCjervbfGjrNDnW2OqtzHnhE0MXe2jjz4C5WV9MpeSgp3ijxIX1JQpU8ioIHjBm99V9m33ibkE6pNAg3kC3zW5Vzg2IxYMQxzSu9iXx4KlK9hKYQ8hKsvbMOm6vfWawrJ6MoVpbhhwzGUNOOJ4162pdZLglf1jjz22ejTx3/CE4oxDr7tSPWbOnMnklXmnp6P9+LbeeuudffbZP/jBD9z0VN+r6Ee5BCorgUbyBBZqYALnxJZbbmm1YCPgot4GDNDq+9BDDxWeAl6Ew2ofLDYfbLvQNrR6KaiUmcggJpBlHU0gr92pmWt0XzSsbqPdrFBoiSBj+AMiPPzww82TFG9qJFVDPqdddtnlkksuIUPbk7Qr+8L7xFwCdUigkTxBgBPdTI8//ngVaMKOVGjX1qIblMEXSt0h8/ea0am9lZESIMv0zIsuFYd5HnPMMSCpeFF/zW4j5thjjz0qdRdp5ghta3LD0D52hx12YPLcWmGImvXc5rnTgPaKK64g9qmO36If4hJwCVRTAo3kCUo4YHEixgnohyHiXa8ZIwBiB08G2V7gFwkThevfFg+IhCq9++67o0ePtnq3yh/EUq8d3R04i6uGMNkWT7vWyyV8FfDf7NmzV1xxRd1LvO5TyI5Yn3Boo1PecMMN1fzF+6xcAi6BWiXQMJ7AgclCEkyEHuIMoVW27BUYvjHOEEWqtblMTCzVlVhXK9g1Y3w6p4+JUUfvySefpBkDZJC23cORctHrTnfddddmTKyH51Teop3EEinCIC4qr6iceKF/gieuio0MPuCAA4h288CnWl9FH+8SqKwEGsMTBMmA9WeddRaFXbWOLkySsDH0HbKqebZ4VwSqUCxsotBDcKzjcE0J9LT5fPDBBxSvXWmllUyTUGhQYtEtawwb3ffquG6zD+G+QlXJiqPoujKv8ZdMyXiJQOmOulNpUUjmvPPOo+4TuZaV/d37xFwCLoHyEmgMT+C+JsyJaj+AhTGEnBPpLpsCFOVt4ZZ45ZVX5BBurxEfB7UgklV2CKAWamU7ZIfE7TBgZdgzbs8992wB1dn0rBEs94K9Cx87xXrJb9h7772PPPLICy+8kHw6MZ/u1/jPPgmjyz799FM1qTUVEKVB/nkr9KQHKrZgB/rcbrvtcFGgX5b/IfpIl4BLoLISaABPEAuL0YnoT2q7Ci8EKzJbW+i9OST4XGYKvr3nnnvAZTVwDjGr2avpzPODsAbo7Btv2Q7znDRpEjgYt8O0hSe4I6M6UQXuoo033pjHobgyi0AjfhfTEGVRLHZLPM1fay0ubUPnueWWW2R9YrO8kMUXX1yUwKM04jdTG44NSsmSSYNK4Wl3lX35fWIugZIS6ClPECzPihUjw2abbaZ8CNvCurBAleKazMXNMNa5htda1bbRJ5F3aTEH08PchGYQ3mDefrt4gnkSTyxwnzFjBtOzQCxZhMTZMAdwT5dyrGeSP/wHK1gsstEGdy3uIYdO9WLZEq0G7Snr+ZpMiI0m+A0t061PJV9FH+YSqKwEesoTpE8T3HLiiScutthiYRQsqGQIwo7ZuC0YH2sGiIZhxEzhbdEhEkSl/yYawDFDKjUpjqviPMHkQXyakmqeYUBBmF+tb6H2efPmWYBvpijEE+RpwyvGEAsvvDCHJ4xvWgFYEC0xbERIY5D0XIrKvvw+MZdASQn0lCfIrYMn1PiaTTYlrV7N0MEnogfDEewY87N2P7eSg0QCozYqE0YPmgNQy5Sk4gCj5FovscQSQklmXuiib4s+YW6Gd955R2YxS4lXjLIxnPQJKX/77bffZ599FlKjeSlMvdCZiX0y4jcHfkic1uxI2TMIAX8V0Q3whGdol3wbfZhLoJoS6BFPECOP0QkTh6zViow0NEk3nNAKlGGkKMuYI6oIc5vbpVVYX1W0B9MnUHfIBiDX2oqLiAPiWkVbeEL2MQoOYs2zxnMoeeFsZXqyT/Q4cC8hf6gxjCOQJ9+4RzoHQc924zoJZ7B8bKMifgM6M3JDpcBLAcdU89fvs3IJuATKSKBHPIH7msQ6tasTAZiD2j4Jl5yiEPocPPTQQwk+UK2kNjaqs1Q4y7imffRJJ53EhFEm+BumRJhfN5Mw2sITkid3QUMIE75Nz7zN4VcLLbQQ/6W67dy5c0USkI0KWIkY2EevsoeCQL75zW8azUir0PMNnRMKfBJtbL311lTywDjpaXdl3kYf4xKopgTq5wnsCUTUnHbaaVImMjeBhQwdGsAOtg7Zdiz7Gmhm6Vqd3DqmR9+eAw880G6KBbLwUVmEFdQntPwn5tXK9MrWhw1Kip1YPLwjeyKEP0EM6qokqgiVCVkFRZ84tHVUun6X1f0VbVgXI7JqWE+wVfMF8Fm5BFwChRKokyewJOCWQJnYa6+94qApbBWssLPGGmtYFGy7TEzhddU7WkZ5IFI7ROvSK4kJx/WGvBuvQ59I+GYi1Q9tJGOE3egQmjY38sADD4SBqvFHY45olv/EJoViMTUibJjKAPzeAwcOFN/E6wOa2kHqBr8TVIrC36IPcAm4BKopgTp5gp4KZFGRdrv66qvHi/2F3wJM9O0Jy3G3niqsvxusYBXCbRoALh6XPn36gIMRPamB+oSISnAfsoUluwHZeB3SvSJsmS/PhAbQ4ine9sNmbm4kUTjhTPQpsotGCtzKFmde67goUCxWW201fDzwkHuzqwkBPiuXQKEE6uQJwpxISya/F5gI8yTSqBH6J1iKUjsvtGm0nie4ojlsLaRHmAtKEuBrSQbcS7xkRaP0CakFxgSW6wdY2z5cAlugilkynURnRzEY2iPYCW+K1vvxKF7FRIXGoosvvljNi3ROnTB8QGKR559/njQ63Xvcpc8E5DYfN27cZZdd5gGyhW+jD3AJVFMCdfIEJMFG1Q3AQmXvIqBpy89TTz1Vy/kW1LGIMxCYKxBUUT923n77bSpbhCay+khC6MlmilRh3Y6w43cIzW+88QbmmnPPPZfoUhwPJjTLmrYDhezqrrrRRhsxB1S3uF1IqRWhx4LaXC+//LL82Np0RZsSPKFv6UfEJSw6Nu/RmwApIksHKpIxq/kO+KxcAi6BuARq5gmVYSB/avr06axJxRBxlUI2iv79+7/++uuysaSLsLZYsVDehhbI/CWNDniVxQb0tLIc8ftqiD6h+ri6ffPk/+Y3vzniiCNoFS7EB3AhHoomYboR0SrpQTwhG5GdhBRojhIBxOdv3zJYt4w6ZcHKnFPX0lX4nP/Ky42XYpVVVlGGdp4Q+Er+D3ZgLKxVRD14gKzjkUugEyVQM08Q4HjNNddgblYfG0XQx+0PwiMK/hgZtDGlLqyTKky8+eabKXFqiKYkA8Ff3PXSEJ4whjCSePTRRyVb1aBFepoGO6A5Jbu1xkeGYfFE2aNwcqAebbvttppbYWhWOIzzk29BvfQEZ8unnXBdwCgcG6lzpXgna3OEN5s2Vpgrb7rppk58T3zOLoFulkDNPIEHm4Uhlgel+4YG7kzcFOaiTBBpKgBqbx9TWVEw9IurcMWLxixyV1YjSlOoOkUdW612J2kSAmLqs37729/mokrXsDZ5qBSS5HLLLXf//ffbYl8itexx3d19993HMLujyC0ocVo8JDMRvoSw0JM0CUUt61pSMl588UXINaKvaOlgc6D4IPmYLC9cpehmuPF771AJ1MwTeCOxbODBNkdoHEmFPmPHjhUayo7RXruTITKpyzLi55nay0Bt+vZr5QkZjsBftIE777wTbtB187SZoUOHQifhqp8zCL4tTgk7TxmjWaIQLFREEvVLL72kwFzjBiQm65NlV7A/atSoQhK1W6BMCAxELJmXBexQpPBpd7MEauMJnBOkTaBPqKBTwkKtSnD63BAEIMb68dhjj9lSFESL2J2Uld2QLYGkwlA5e1kO47UuWdevEA3DAUYS5t5HP6COXjiZ9L4EAhYffPDBnC1ReTc8v6x8U6dO1fiEYmFkjIYhh7aYIKyhgi0rYo+CMqFPzQfFwsJ2rS2HvuIBPf7442ZyRPcKzyllQheF9vTf4cOH49Zic9NTNyOO33snSqA2nsA5QdrErFmzcGMaFhgcCDWMLYAG2dY32WQTookAl8z+PyFoMkDdT3u+2VrYomCtNi1sRz0JkUTEE1sTPdhgJGDIqA/32WefuD/G4lCZ4R577FHIXkA59TOs9kmY6yBFjVsG4rHw9O3bN3QdJUpv5d0gpXznzJkTWpn04BIO8zfffHOLLbbQSeyWw6dvvxDdEe1JSKRAGXXTUycihc+5myVQG09cd911+FEnTpwYFoGQ6SbR1EzwwWKWkaTjWsKwsYLFdGLTYI0f9lCLL73Lf4tHV9cFfz/++GMdSEM37DaanllFGssWIdBzCRSXSNqaYF0oDLjTJLXQXqTz77LLLlay0MoxWWK5xDthwoT62G7mzJmhnMOnExqjiI02lUUXYvJ2+zx6a2HEVzjJDzvsMKJjiYPo5lfO790l0HESqIEnMBdcffXVRK0oGkfag2JyQjCyFaVqjLPyJTNLoJPpwWYJbMvtxrKFxeAK2kBhNCFzRVAFzxCt7lSJOApzfkh0p512ipcqgSd04/AZ/aiRaryvKheVA4O1uQTLDdpJLC+Ez/E0kDBvLB5SY97MxZ00wiNLw+gt1IdC3xIqBWUEQ160BBT9QsJagXxCaC9zJuqJUu0d96r4hF0CXSuBGngCcwE1otEniF2xtImwE45Bjy0k+WTEiBGJ1ah1iBPGgWvoE1ZQyJK8erijIoNcSxj91ltvYfqHD6zSlBlkCkG51iV56H/mitTTTSRRp1UiVatltghZZVzjm4htwIABuju8BSgQkrN4gk+UjqfGdjalwkhfi8G9/fbbdbYEu4eqIVdRsXHL6eNwU86QsHjCLkoqH/ocrbOJmuvaV85v3CXQcRKogSeIdCKu8eSTTwakFOyUKJ5qnszQQK81r3kmtPIVkFnBauEmn1umcRpJe/IJaWvE72tZzUo8NNkncpKL8LnU92Fxda7I2jwRaRreiygEsSiUiJEsuiOXCW1lXIh6GDqblvymQsnBA3mw5FffctNCymgVjDn88MM1MZ02NJ0xT6Xd8RWFYBkcJlKYeENdU9PG9HTMMccQCuFRTx2HFL17wjdduTRttdLb3AcX6N03XvLuauAJEAEnNi2GBLhhCI1gyAzrFk6K0QOcAk0yLRjW54ABOE6BvPHjx2PUasiGoZ+nDj3suOOOSmwGVcMEOmZrEy50CZTih78N0oJa9jf2l156aRIa8njOGNR2wFDl/WVu4VQhbFboZLkb40qlMNOQKPmMM87gVMrr1jnjeZEMYNpojRQOCUlI+yIJ2+f58pQ1q8hpFQbGI6DAMF4NDJglf6C9e9h7Dy0wedxAwdOYkevPuf0bvft+K3t3zhPxR1MDT2BWptDQsGHDhDWmPdiOxbdodQlbEBJqS91Qq2Bf8als1BSaPHmyegE11gSk0hHh8lY8EX5SEjdr4gmTDxYk3RE1TiL6UGiXE7LDl3lX5BYS3hSMgeHJzZcgWxb/JQiYkiSWKmHBrBEekh2JsIX0tDlhWFcKzsABo1NFwgHMBkVhWkyX/Jbc9PT0DYukF7C3/rBvZcG0F0/MeaIxPIHdHGWCquCqJKG1eWjsFgRbjKyAwxytabiR+xo1gmKCWmkWms7rAOs2HqL8CXWDQGikUKiIHqKwikmhWCxlRCYjglOFvHKG60a0Yy4WCZz+gERzpV0goh/RBikRJgrlYEckYyrLlltumahlm8l2ZM/Z2bRoiJx/hRVWIP6NJneeRbHX7htm2jo+evQrvRiRq3lrzhON4QmMIWRIkd4lkhB+pZEdHcJ0AhawjzzySGQd/d5772GL1+pYZyu0h7QR92u9tHhCQV8IDaIFuEMncKJqd4InoFgz+iPSUNMSjhuaoyvgGUbOYYNrWZ/snKR5o7FZFZDIvTCGmevJYtR67bXXOFU8Du3BBx8kz86eXfwh0tWDptnYGOcrK3NqUGd72WAM35kkwYfoGb3sZqt/O84TjeEJnBOkYdMg00hCQbEJxGHBa86JIUOGJMpLhJwBShKkr8N7Ez0klu1GFSNHjrToWKuxkcirSFCF7DlStsIi4aE+IdExEnmm6zJJmVDDO/ItdGDcuKcLiSqIVmJ9wLEJBkpwP/eF9sNMpFPG8wSZAyFSqCCYnqoPH82bofNE82Rbx5mdJxrAE6Rhkx5FsBOLHVDAMidCnkh4KcALbB0RZQL/p9rdmMWpZHHTWtf17RovqBV6spFHMnfuXHP/aiedf2dUwbfkjUO6yvNIa28WmswNskh/5plnzMokHrIgJZmkgGYkjPYWhmOlhWNqis5Pph7HJlSf8LHKpy2HSrzjhV0LFwW/JZYddbzPvekQtztV52k6TzSAJzAR8FbT74wYGMFfuOn9D32Y2p+fdpu/0ck5NJ4ATyVRpl24X9N101KCMCgYLnmwzI9kaIsqpAoQCKBIoYQHXtahUOynnXaaTE+cWbBu4C6HB2FRELP0j4iojftlWkQpjBudlBOu6NiSZRP5FREQ4TyBfWnrrTZNWJ8ArOqgZ/fMxHmiATyB8QFz+SmnnJKoT5dgC1MItP4lGTjCExidLG5H42sC4soOTjOoTZUUM+OJkh046I2hZBQZi/RXnJow+lH1D5JQE4swJdseAVRx0EEHaTJlAJ2nyTAyHqwgfObTVC2pV155hZFh0Y7IA2IkARHzYxy62D+he/e42Ir8BpwnGsMTrP4wQaQDH2Va0SpVOwJKWl2G7TzTEEMsrEXvpENsK0sDhRMzIaRHksyh9T4LcP0tZAv61pFNIkMfJ5SgEumNEjikqywNZVBnYjp8z+EMLqxnxRi53xlJy9II3/MVPMFFCZjWUXERSU3ht0RYhIfGVgQlfRrOEw3gCexO5NCOGTMmDQFmgg+TEtg/8MAD4+BC6VBRi9bFOk8vMD2Z8yYtq5VXXpnShMYN1oA6U1DY/SEJBpMeIVhP6xACZb6VU0HF+0JfgggDw5FcFAQvoREWQnlIRdzO6NGj4/1C9K0lYMajEjRVAiIIsybbzqNjHaOrIAHniZ7yBG8yJEH5PwypkaUiQA+mWFwszgwZ4vPYguBIHWLn7DWmpzwpseRX0SRt2Igi+Gs+jHfffbdfv36FwoEtKBACMVhKtnZMt1A/8F133bVQJWKALoeZi9MSHRuG2GY+UHRHZVFIWYmHVDGGguS4KAiOIESiCjDhc+hyCThP9JQneJNZ0pIYZZnYEaCRpYLtpz/9aQhSaXDpQp5gIX/RRReZWNRPNI9HDd+x6hBTa9idJ3zAF/8wfoLQfR2enGvxFeW5pMYVWofEE4zE+w1XhYFY6TnDeSid0qX4G1dZmCq/JXiC9YfzRJcDdEVuv708kbj6xTNWqYhYbBrFiU4YkQl1P//889dee+3CpagAqE+fPg8//DBokqj0F+JLt/GETGqkDqAoqLieOZwjBjopZICpOScijwBlbn7dpGAz+euKcA+9telsWqidCOhlIyLo9u677w47DIaXEJ8xT1oW4qCWeybOQ3yLjsLKA1d2o3ji9ClrZKatHbTvBpFXjsznvGS3u3+yROTAt+9b8NpL+lGaac/dhtkZdtxu+AH7DL7qguVfvfPrf33h7wtf9cxLl8GITx7/CsjC1XfdaSOdhLipQ0cNYkp8Fb/uX577wuPXLTpr+qpM1aKt2OG/fFhy5oW3ljfgw0e+ysxPmrjWvnsOtdu3q7946zeYXuHJDz94vbTo+FAHIgHkEN4dz4grPnPjwpGHEueJ3z/1pXRkmuYQ/4Exnzfv+Vreb+xH5y2vOfcGnsD5CU+ceuqpZAAkYmzyMAsUmDdvXgT++Ko7eWLQoEEYf2zJH+FRSU88Qc0PigmWET5SzRS7FBcwHQfJGmusUcj35vmQVkHfDgXXprUKMRCfo3Nw5kIGkmLE7bDywJXdqEYUr9319by38bFfLJYHPVeevWIeu2RiCh8+8LPFDZ3zrsjncMYdP14yzhZ18ATxURPGrhu5Ll/N/tXCmfcLBF91wTfz8M7Oyd09fl2uxApBPG8AMD3qO4PjMxfhMck4W0R44heXLhu5BOQEamfOsFCfyBvA5R7+eZ+IWPJWMNwp9NOreIKyEFOmTGEdWogvGkBXUas7nccW3cYTQvllllnGCiDGedQoROYp+qHG7UXyddM7T6dNhzwprwKWoh9G/Dmy3lfyo6kFdE8ST6Spwtrb4aKga3phJJV4gkxvLGC4NBrYAzXvhbSVZuJlRpnIA83MN5+18NiR6xciXTgAYOKoPBCplSfiIGhnyyz78c79C+al9WVO44KTVi2jEpWhDdDw5En9a5IbLPvKHf+Qd/JMnkCdQhUrvApPHFGkz1zIE0gjT4CoFHmyiixfeJo2jd6gT2B3IiiWjpXlg5GIkIkbnbpQnxA+UrIJF4KgPK5MmM5B1Q3AnbiAuOlJAI2+QpQUJw89H1YmRDxR2AxVNalCLtl2223lV09QhVU2FC3x3EsGU8FATAOeaGCVp8g7+fwtC6Wh4eqLliuvTAAuhSvxzLNxVN4atiaeuOz0lQpBUAPSPFHf5M+ZtnoZGoiPgSRq4qfwHp/85aKZJ8/kiZLCYRjzScN6IU8wE1YPeVfJs1LmrV1233mjPz3zxV7FE1iQeZ+BgEKTgi0/p02blrmkDVfQ3aZPCOUREalzIol48oSt00m5YCS19qirWOgfpsgHTZmMhCAG4btYRzuErsVNWApGEE/omVK+ifNkUoWeqc5/wgknlOnkobsYNWoUdqdrr72252BkZwDaMt/kYw8bkLgKb2ke7qftVPXhrM0kbw1bniciRo/0SRI80ROk7mFyeE8uncd5PMce8gRnvu+niyd+D2V4InLpTO6JLFywSYYT6A36BFWGQBZCbgrt44ZiZ599tlLJIqaV7uQJ8JE4HwGrApDyRGRZitIG0EL69u1bZrWeCL1V2l3YoBuiiuRjQww4JGxNIMLo37+/eMKoIuGoUCncc889twxPaAwmMqo80SSxgTwR8Rm+dNv/agGUZ8NJuyVZe048ZJ3yy9XMkUBbeg1bkicicJN5hgRP4CzNU3TwtcgT8Menv5Spr8Bw83rQ0K2MISguWNbdZsS330nPeYJlfn08wa8ob8IJ6Of8ecpEmlR6A0/wJqNPYHko6ZwAYrRkthVxJhR2IU8gQLgWC57ZhQr92Oo1xEblXaz/hfGsCN/Sp63xnJUFlAudbDsCk/KeptUdscglVVWZPXu2qQ5aAaiIrK0GoJAbb7xRxsmI6qnVBvTD+4Y+QREwjmogVeRhUwgNKBMAUBmQZWKYFPKgATM6UPvn2fMNCPxln0/KmyZK8sS0CWvnnfOw0esRoWRY//2z5rvlQ56IBHSlHQCZhjhc/fU9nQikQj/wNOTEmZk8Lu4w/ClxsxYUVIYnkIAcQrDyC7cslGfy4unXxxMR9E+YkiLsnvZ+9Qae4E2mUSWu6ZI8wWpRS9p4/biu5Ql8wmaoKeQJw2Ky5FiAlzH9EZlmDgmZtvRfGIKN/XfeeYfEvVp5grBXncrqglgMlfiDa91yyy2q2RXhM+OJzTbbTA1QUVjrQ6LMo1j/5qGq+QlY+uWt+tPnRMPIHAwGffrklxPjI5aWtKZShiciGhKMmNZRGP/czf/jjMkzp2SiP2dL0yeYHlrSyz+pPBtgpsMmorSlJ5CnT6StZBGwrpsnIj+wcAJ57J7p9O4NPMGbXJiMHYIOoSwE6duSOc+u0p08AYBiwROqGoJnisjyEjSY/06aNKnQP8GDUGySjFqyDulU2meH0Nh4KkymSnHHHXdoGuYh12lNn2Dn3nvvVW+luN6jPPzhw4djgms4T/D+56kUSk3IRENBdtrdHQEavsoETZwZeUSVOKQMT+Q52zMNWen55KFV3uQzjVR19E2CWvKEkBdFCsXmKXmJQzJ5AjrJDDoiDipzJnXzBAdGTHni1IgulRml3Rt4gpLRpERRE0Jmk0KtgvDZJ598UgtYz7NLiAt8VM9ww+48Hg293HJjEPJUWA+Dy22//faMRxERoKcdRXg+6AARf45pqsD8KE0ikUNuPMGFeO6yaMV/J4q4pd8tJjJ+XQ0v8RRZ8WGHybMjpX3dEaNT5mCDnjzDdCIqpgxP5AF9PGbfZpKHvHlxnIQYpWeVtvwUahV5QMl8IuG2eaSYmEA8zy4xt7xFQ094IpJ2p2jXvKeWF6Ld8TyBTYAkO6pNDB48uIw9gTFLLbXUCy+8ICh0njA4FnTCE1jwjEEj8oEn7FthMQmP8XrgFpuEZ0gFxkVCiYACPt95550L+V5wL0xnw0akKeXxBBeikjxPv/DMnI3TbrDBBqTvUd+l4TzBi5qXQPe9M1bKsyMlHN3CkTy7TTwQKO+oG65YJoSnMjyRZ2OhHV4hWDMg7iUu+S2oV+Za4RhUkDJ3lzht3lEzp68ajmw7T0R+GKg1mVybp7Bm/szK5OTX+kR6OL6gboeKO1GIdN111y3JE6Rt06sutHhkLpm7ze4kcMR/S2kjayMa4Yk0y9LjOs4ToiKSovF+m5UpYRrSsxgxYkQhmmuAKRYqRps2JyqjQl+pZGHhmSUKflHnnXdek7qfRvy3mfiVB4X18URJlCyDpHms1kqeyFsFR6CnpAQSZ8jrBZuYQBV4IhIKkRdvHaHbjtcnSJelqCfv81prrVUmjoUxK6200vvvv58wXqepott4Ak0CcMTBAD6qyreMQnl2JwN6Q2E6AJbhidVWW82iYBPWLXVC5cz77bdfIZoneOKss87SVGUE0/TksTDF5eOPP15++eULzyxv/IABA6gtT6p/D1c6eYfnGZEz0TlTmXB9QrJqGU90kD4RsUmW9E6Fv9uO5wl1niAunpJNJXmCqqXghbAjkkLRtTwB41ICtpAnNMD8AeyQahdPiZc+sfrqqxNEm8B0/VdOC06lArQlN6kUp59+uk5iT5bzKG3CskBIBVfP8/gmnsCXDvc0jyciZTkSb3I6mt7e4bwU3E7xT9SXQ55Gulq5PM//3zv8E5IGjpY8bS8twMhvLL0c6Ty7E/dAkPsFF1ygCJl4HIve/3XWWQeeCHEqc8ncbTyB6KRS0K2I9b4CTPOUCTGEUu1MsUCfIN26CITnl5BC/ha9KpVFf4F1JbXQJqjwPDZAPHHiiSeaMsGOvBR2C7rce++9BwsWBu9qAPYxenqjrdaKQeXHl1Qp8oJ/uFDEJd658U4Jc395eZYfCYbWVDuLM/cw3ilP6WmGH9vkkKcApXkinq7Y8fqEeALbNFaCkjwBo3zwwQfOEwkgVjAof8FH9AkZbSI8wbeWgCK17KGHHqJ0RyG+L7fccvAQOB6G3oonlFDNDuXNC8+TsDvNmDEjzRN2C+KJkiVjxRNoqGeccUZTeaKMSlFYxaj35U+MHDGkPOLXPbLF+RNt4QmEE8mCNLaooH5Q62Mt7j9BcQXiUtASSvIE9nEyuZwnMnmCD+kcjn8iNOtnsoVMOvpKO7T0KBPvtMoqq0AS6A1W0yl9/n322adWnsBHZUYn2wlDqpjkG2+8gbZUmDSuAawnqO9ClEStP9maxueFWto7nFekz67SqHzsdF2HMn7sOBKF+dj0XcjMx85c15M6nhZjXhmreCuOvMfRqHzsdEpgFfzYdteFVVWQP+uVwh8tFk4l8190Skb6ZOHhzR5QiieIiwXdSvIE8U5WEjWyZO42u5NJb5NNNoEDbGmfp1KEVU/EE8Q7xfPsCKYCgnlSDLb8icxHULL7aRgXS66l6CE0ZIUnZ5Jz5sxBmymTPIE08OfTggL/RDPiYu21iYS6806WWehhQul5QaHMLNySPFGIRInzlKzvBKm8/9D/D65V0ZFMRkmUo6gJjzBwlQy9zRsWNmmwS1eKJ5hVvIxVmeyTBKeWOaSmB9HzwaV4gjw7ot1L8sSSSy757LPPhgth909o8a519A477CDvdMTJbw4AiU7QTAhpfKkOTyg/g8GmT6QTv/mE1zKuT6Tz7EiIE0+E007sU6qWp1/mzIzhF3XhhRdyU03lCd6QiEpRsshdR9eLjTROKAPit/6wb90o08p6se2yOyGciHkzk+fS8kw40jiqbpk36cBinqA55aWXXjp06FClXEVQQHbnhRde+IknnnCeSAtKC221EgrNSpk8ahBsQE/EURyC5f/A9yBHgjA9HaCMd0RWxLwtTRKceT6aBx6O8PmahsFzX2SRReKT1E+IS5CPzfoDnmhsfaf0e5JXQrymCndUzasvdoijMrtfMM+S+oTuqCf9JyiNV18TiDL6VhyY6r40wsmzd1VNn4jwBGuUMsCdeLidyhPU4SE7THm5hTyBDR2Pq/NEHk8ceOCBWu/H9QkjDyVbgPtjx46Ng7uezsSJEw24raug0iakmnz44YeRLIdMkoAn7rnnHvFEWI4lJCHOjAeF6l5leIKpUgmG3xX52M3mCV7UzCriZazG4UsO5EXKmmaCfqTRZq08kXcX6etmlmOiZCHOjDIKhI1pVEs7tIpjxg+s6dJY6n+T070VOVSNJ/KS/8ub7BJ2J2ijDLu0ckwpfQLb9EYbbQRYlOEJ6sWqDqAZTNzuJOiUPjFmzJiaeEJJc+gfFIaKQLCSnBlw0kknWWkN2MginaRbgPJEJS2xxBI1KRM8erI3xBNhR1udXGzBfmEmIBeV0sls8dPwu4InGltXPPPlSasU9ZmAseHgjo4UDzc0rGB/7PLNvWlkPef2/9Wuo+eQRM/tMizbw/7Y6Xk2NS6Wy5UsH1soQJQn/a7OPG71RnWcLbxo+QHFPEHTU9Z98nwWhrIIqgh2jDefAFa6zY+NC1pZcty49AP7m8mjgmDL3CbUmAS6+FJdVQJJjaRuh6xV1uzIoJxPbr31VlV1zdyg+fSCgOw5HOM8U4Xbhmnk4iTZuHBKGx3Gp8q3O+20Ez8tDmmBPlH+fSg5kq4PV12wPLVId93pf/pYsM8nfM63TX3VCW0i4n7yuIF2deCVS197ST++KryFyOQ5w9wHMtpHF56z5ABOziWY+Z67DQs59YB9Bl9x1oov3voN9dLooH95PJTZ4a6D7isx1eJHAuiz7ttzzz3L8ISIhMqmmdgXfthtPAH4KlqJ4DFjiHgKBcPM3U1pRfrZxfUJ/NhS5kyfsBobWu+zwRM4nNQlInOTdVGrfiYsnwdttyEJdJo0T+iZ8hUnp/6rNIYyqXaoR/BEC/zYnfty+swrLoFIKFp9wcSVvd9inuBNplYolR7i/gk1yBRAHHfccQZMeYTRbTxhC+3bbrsNSC3pnJBOwGDKeseLikvyFNeiXV0oc6urIcoB0KdOnVrYP1VnQwFSr+wdd9xRJKF8unRZKqmP9MdWDat491PGcGb87fDE/DCqjlo/+mxdAiaBvALymWHQHS23Yp4AoUjJHj9+PC7KiN0JFFM9VPCFNC6ZrSNo2IU8gWRIqCYZrTxJSKXg7+GHH16Yl8D5aU9rxaOMLcyLoCTwXXbZpdB+KJ4A7rU4oPeR2uHJvpTgCTktuNzo0aMVmxvXJ7gRguLGjRtH6bDG9sfu6FfRJ99ZEqi1GVFn3V3NdidKxmKpmDJlCs7PCL6AKeIJxhDyKJJwnkjYdkiWxtBfaG5KKGGoFESyioPjGz3vrB5UKHyzROEV79+/f/wk5hI3ZqIQkz1QO79NUpoKN0WLJJSJOJ9JryLNgl8UPIE3paPfH59810qg1mZEHS2oYn0CNyMuCrouk2gd4Ql9xV/gjKRcSsJlGigMXLpQn0A4SoKLVNRIKAH67yOPPEK0cdzuJKPf/DIYn2tyYfIEn1jHi8cff5yGg/HnmCAkVgC0SMqzH+pafIunnSJghZqKeIJfCOkg8MT111/f0e+PT747JRCpAJiXLtPRgirmCW4P9KG8D2vhMigArOAmfeqpp9JW7G72YwO+AD0GHLPSxLUKS1NgB06VVzmuB/Tp0+eZZ54RPUuZkHMirE1L6V9xed6p+Mq+Ve1CWtRRkCPBE9Iqwkf861//ukzTU/EEfhSKS7L+aEFQbEe/nz75akogr5RLHb3/qnmDNdudOIDgRUosUOi0DE8o+vOuu+7KW4Hq827TJ0Sf06ZNw4ikQrDxuuKqAcUwmklsttlmhRFEgC/Zcx999FF4WnAcQ5OczDobLgQ5HsrwBISBQ4XCjqaOhOpOwhtPuK0sThYulXcJhtGkhOAoeKITg2I74sX2STZPAo/9YrG8tMG8hlfNm0xrzlxKnyDkidBYgl6EArJfazMs0NqTDTRkAHYqw6ZMwqCfAYyCb9zMKZwhXg+1yDhf6e+lDdBHNpRGxH9DDoS4hERoiSUEd9MtxB96EGRiS+YWTaslP5QjpwiZ2AB0IeVIjsqi4MwTJkyIU7546Mwzz+QoZWbEL6EAKlYe6KnzBeLxTi6BzpFApD1RvBlRR//OS/EEwYtXXHHFvvvuG+EJAxfBhKpTRDaiM41mDOxKQlilCSF/cizMX3/9dYDbvMpxEUkDwFQFoZotSKv1hA1KJD2/1/TftrRdiG9Q8uLBzTb3cDUAoMfnKW1DwU6FGicDIDx+SxQNu+aaazr65fHJd6EEInXmC2vUd664SvEEbkxSKI4++mgBQaY+IYgRfoFZ9DX73e9+F+cJQyXRQ5l4ng5lCE1b4cKs7sMSSXkikun/zTffXHbZZZGq4a+CyvibsB2tsMIKFOQIzxaykc5GNFT4mDKFqWeBUigWZ8eqsGROlXtRCh4RWYWedq0zUI/QUa688kpXJjoXOLpz5pHiuz2vmVhlkZbiCYJSCI2lmzGOyjye0OfiCWEZruwIT+BQNTOFqCWenNXRDKHJn3POOeb4jQeDITdV7Jg+fbrlTocqBWcDlGUaEoUcfPDBCWlbOzyRE64L4pH0gCKArrOhwWiHYiEEMkVCElTQkOS+MhFZkgMBV5gl6X9V5RfD5+YScAmYBErxBEEpuLIvu+wyQu8j+oQwyOCMQyI8cfvttwuP7KjCuPuOpgru9O6777aCS5b7FhHRyy+/jDvBMN2cN5KwMtoUNcDfm2++WadKdEvlEykWPESGqe53YR6cFv78xUBkAVqZU9XJsSAx2PSeuPWJwDmCnZwnHIZcAp0igVI8QVAKebO4KEj3jfCE0AFck2EKK0cEBEmwIDhS4CIVpKNpoHDyOCdYmCfK/8WrJRIcZadVarT+K+YwabNPdxDCogTZ6dgkkRMKhx0Vn609Cx4N9saQe9IPVLVASK7WQxRvxU2IW2yxBWsOinY0u0NRp7yEPk+XQMUlUIonWIqSlY3jEayJ8ITwRetcIIYGA++//34eVYAvtEdeaKGF5JgVcvViPzaFTyxi1eghNA0lBEUdb6q0GqCb9QkhiyH0l/9CG0jSDrcCrvYJl3vppZdwYJQhY9mydF20GWVOxFM94L+BAweGvBXhIYbh8cY5Md/r3jlRLj5Vl0A3S6AUT+BvhCoodDp58uQ8npBPQkCvAFnSvsi9iqgUv/3tb4cMGWKY0ouDYrnHa6+9VnX0wuYQkbjYI444QmSgslrSIcJYZONU5Dx79uxENoa6RAjf+YsuGDJxhDBQCDizFALyNtJtU9MPlHboTFLedY6NsxE3QplIlAkPdupm3PF77ywJlOIJbgme4N2mYHi4yBWy57lGQTdyqQQrqu4gk4gi+pUfwKp5yy23FLWgWwgZG7LZxNgJo3fChXnc/FLft1pWG9TqJFjY0mWRQsA1xQLzEZ9j5St/9aOOOipc8qeDbvFgU3PFThh3HoTXhV3EZH/4wx+0o3liyBIP6cNZs2ZJ2updIT7TebR60D4D2Cdbk4AIIq09w66zkMJn280SKMsTmJKpxkNDY0zhBgGhCzqxihQYjRo1Ku0F5ZMwF4xQGepRL7744ozXmrQhmyYQ5hlYcx6itsQW5iKO9GMoj9c2UqLQ4pod0POwww6L8IR1/pE96vnnn2chn3dd2Z00c5KlKainWh0iYLEvG9ygT/jLU5N7o0xEmU2eJ4I6mDCR6YSJlG8qhOt+NTdTevRfoyV9Pnz48PPPP582dt381vm9uwQ6SwJleYK7wqBMYzsCYAQlZmGQlUmgbKAgSEL5eOuttxKe1YSFBIxjwKuvvorLFF4hU7ch2w477IC/dO+99yZrYeWVVxbsogAZc7BvuNnY1A07reinX79+jz76aIQn1OSHv1qtW5ZDHlXIV6yr4EC2ZT474gnAXQYu/n7yyScbbLCBnhe3rGcXUSl0cgbTmcqmpHOaAhQ+wbfffjtUVkJuth9GyKD77bcfvOU80Vkw4bPtcgnUwBNqREG9DZoHaO2v9x/QMdOTfWjl5Ei8EL7YUlQ71tEzNL9AGFa/uoc7dlrO8+STT8IWmpvpEAJEkUceItfxuakR8jBzBjQwZUtkZiHITMRf9cG+8847l1566fh1bZ3O+Sklm3CGYyPShaRS4FXSTHT7Nr28S4hLGD/ff/D5JheF1YXl5Dwm/ootCG/VqUyhFIHxX7XDC79CpUN35BB3TnQ57vT6288sFMiHiRsvOazt4qqBJwh5oiAPUU/kWmvJaRBgEf1Agy3YtZqmK47gBjgDa0LrOQAUrlIZAHmoH07PN+BSGCc4o28oYTYyPZHnJV+IsV0D46xCc7wusfPOO4smIzyhrGbkc8ABB3AIBqU8HBf34LvmLxny6nYXArr2ORsbPYvWX399RvIsjCDj/gnB/Zprrjlv3rxEmJMRkk4u8qDNtaZq57cfhsU1mExwTuDiIrGG31Lbf/o+AZdA8yRQkgBKDmvePEueuQaewPGI+xH9YLfddjMysBhN4Yt5MoVNinoiXwxAsQbLAk1ruwZEGgA1SZ8QkpKxQakiKUPazEBUpuBEHnAnPjfJmAFnr7324t7zeEIWJ4E7VTpozBC/kAmchIxnn33WONjoQdqJ2PGUU04xjOZmy/gndHVKCmrOpkzotEZI+pxIJ5w9kp6WBZluKg1gJiwaUEmvvvrqkr9OH+YS6FAJlCSAksPaLoQaeIK5EtyJ0QADuhbmYd0389kazBlinnHGGapoBLiEJbUV9QQ3qPeyMKiBmy20MenY+VnPSh9S52d2ysf/lKEKU00Eylxi9913l6EmU58Qg+qun3jiCSDVDGJ5l1N6ClZ+maqkPUiw7HCnullYpG/fvuFJImpKOIxaHQ899JD5xkOG0OXMP0FatYxgRrqZnh5Z9rg6cdVudGr7O+8TaIEEShJAyWEtmHD8ErXxBF0qiZUkq0sdaZR6LYgRPoZFwvU5OLL55puHSQMAjWxQRglWFy8TSetjDl0Cs4yd87PPPtNFKXGx6aabam6N9WCHaCs/P/LBo85F43YnBkCZNJuTIyGi3/AVK/fBgwfjoOacJljuNMx14L+YsBQ/ZrMqozaB6XvssYdYR+KC5CwSQazGVLk0lj1uTXRocU1qf5uw45FdwRjMfXS7IsPOnRNtf+19As2WQEkCKDms2bMtPH9tPMHpcFHQXoaQJOCgcOUrhAKtqOYE4qiAhC146yOAHh4lMCUxjVswHSgEUJDONKHCFnKZS35LRdS3BA5F6nOoQalUAUKEqQ4bnlMhsOaC1leQ9H333Sc5hE5sLfMVZYsbKU6BInjjJKka3C+em6effhpO1akS0uYTlBj5fqDbQuLhhCIJRE3RF0LaiHTyHnaFr6UP6HQJlCSAksPaLo2aeYLFIKYDsoUVGJOwR2fiJh9i75ZDIkzX6iHi1304K3GOBewOOeQQUYVVJVJdQqgCBCx5a+lbroknmIlCv4BgdtTkA7YAuNkygZgQpoT9R2cw3eKxxx5bd9114YBCnpMJS3YhATqNQ5CPUY6sTGxW4FYkwSfk9+U9bn0udU2y5eQ00oAnXJlo+zvvE2iBBEoSQMlhLZhwI+1OnIsaHpgOgCrqBfH+y84QxwvsJMR6vvjii4bskXoVdaN/yQNlQjFIxbONPYT56y+bhcmW1JZ6zhOajDQDuteRb2HnxA+kkhi2/McrbkVnzTrETUllUd86chR0BkF/IZpLmeDG2e69997EY1LDjEQSDLEJ4TwzLyGzpGZORjpGJ1YYv/zlL9v+o/cJuASaLYGSBFByWLNnW3j+mvUJzkgBDzbMCFoz2t9MsAAmFIRKywGtUiMZZyWxvofDLHVD/nOYb+2112aG5DYbHIsk6nNx16RPiDLNM8x88AAhMXmAoGGjK2B3q622Im+R8eoBBTdYBSfTMGgqBT3IbRAJcEqwoP6LiUzCkVMnnJvIzObJ02R8nEpDbQZPBvn8GC29RmzhO+kDeoEEShJAyWFtF0g9PIHpACwjdiURTpPJE+p4A/AttdRSc+fOFZzF64/2kAbih5tB30pcUI6QRDw829Ik1LVb91JfXkVNPKHZho5i0Jm4MnoKhbFPlG5F4OQ0SBkSgtst6HBoA/4YNmwY0+bYuNEpXaoEmrztttuk2ShFXI8pXWGQDD7idy1grEhjmR8ye+yxx+LWgsPa/ov3CbgEWiCBkgRQclgLJtxguxOnww9JAQ/iMlXCL76BVubGoLBPUzmg/MmV0GdrcHaA4BEjRqhWne6o0Lifd+M18YTxlilbmhVMgAkId/S5556LwKnQbpYlLe25hTC5QcyBlxi2E70V5pnL3GTxCPgb5APHriWeUA526CpXRRCsjiVJVFnZtETlRuZn5nshcZdAd0igJAGUHNb2F6cefYJJk3CHGQFkKWMBD9NxKXJXHs2bMRL4s+gjXOsys5i/hKoSICATVsJzfVtNPGGeEvzDwn25Hyyi15LYBdymT4SJirbqP+igg0J6iFOdnOSoBaz38XsT5iSBqyaHTE8Kx9LGf5nkc889R1vDQqeUxChVcsyYMVicvOFE2992n0DLJFCSAEoOa9m08y5UJ09wOniCHtfLLLOMNIY4pMoSwpjTTjstxOVmMEH8nEYJ4TIZA47KIoHOl19+uTy0AG592RU18YQgXqBMNKq52S0zMVR6LII2cY86isnj5ZYmlE57TDwgc12IV2bMmCGG0JktWteYgx0xE1mTOhUEEJEPQkBfYcASSyyBBxuecA922992n0DLJFCSAEoOa9m0G88TvPlYElgqCjVUuTrMXEuAiLiE3shUGBUeKR+bHVkzbCndevKwK2rhfP/996t8urpJh50V+G+hc7tWnmjU/ZLZgLtYC3nT8xJ5dpY7Hbpe8M3IMZ7Oc0QaSibX8/rwww+pF6InHhbfDUnIzIwM4HJQF2FOlOto+2/dJ9AlEnj1zq9fdcHyB+wzeOutNv3W59uuO2100sS1HvjZ4n957gtxIcx9YMErzlqRY3UgG/vXXtLvk8e/ogMvnrGKfRXuJE5bkgBKDmv7g6tfn8D0BFUcf/zxWn2HDZzFFpndHfiQQ0JKSETsNAo06ziPEgV0IK0XqEmu++Ivzu0wlSFOFW3hCUE52Q/MVlM1hgidLgmtgseE0emuu+6Cqq2LlBS+RCCs1K8pU6aIO8NaHWmSsGIelBynex2uLDL52/5b9wn0egk8ft1iUEImjutDmCNPCO89tMBho9eLHPv9s1aEZpwnauMMzAhQBR3rVDHUbB3sq9WBrVi1trVlJqYqqmFb3pY5Y5tR4qlWtmAOWFfEFlTlI8RIBhZBoTQkbiduZ2sXTyBScNwMSrL8MPlE1JayCO12RNtSJsLk8LDwu0gCzwRVFMUQ8nyk/R96yvasKQFCyAPRcb0eofwG2yuB3z/1pWPGD4ygvH2VOc+Hf97HlI/IScaOXP+USf1dn6iNKuhIgZeCBePyyy8vJBWAAkzpyH3ZwQW1LNUBNasUqyaatWJ6w8fLv81MVLVCBjHCjUh2477KeOwlhLbwBLPFdkTtP80TOVshQs0K+YcqkeJiaZyH6c98NqoRy6mUgC1pqN47++pbFz7ZtGlRmoS4BFI588wzMU5SRdzTJtoLo7376pDEvnsOLUMSjEmL4tYf9i15bGSY251yyQNjgjpSfPvb3xYYwRCCiXTmgSgEFAOt+Hv99dcb0GNYTwTpN5wDypxQiccaGfbGINiUdGLrzlaYp90WnrCUlEMPPRQ5E68VFgFUvp4eCtMTSTCGCrXcrCKsTMPTvkhCX7GD+iimDxMvzP5mOoTuXZ+TFYhngrSJ3g1SfnftlcBfX/j7iYesUx7oE7Od/auFyx/rPFGbJmGyBkOhiunTp6vBtTwTipo32ggrYQhQAKwNN9zQ0u5Y0qJSWDmKMpje8DFm/jJ7i4p1iznwbA8aNAj4s2pF4sXMrS08YeWz5syZQ76CJqbZguwG6KFVivor3Jrdb5j8aFXK9SGtO9Q8lc10CCuBlSYJni/WxWnTpsET7ploL4z2+qtffdFyNQF9KBA4Zq/dN6zp8LzBrk/EKISiF8TFX3bZZdtvv72Wq8IRmTjkQbUaUKZkCL9IVgDdtHJnxZpwnDacCeInJCtbAxIWMHNuUzDjO9/5DtMu7PbTFp5g5nLwIFKqydI5joDUBLLjrhBh4LSgMqMG6ygFninPjh011xNzY84iataeqYW0WX9T8YRpElK86OKHounKRK+H6fbe4EePfiXiV8Dz/P5DC2iGb9+3oNzU4YTv+PGSebi/43bDiY/68+wvMh739TM3LhxnFOeJAlWDNpZEPeIOpfADACGeMDDVjlUcsgU4sIL9mo4L4JElvoU5DS3mCaGkWeoFl/wVgGpi2Mfk2Y7nr7WFJyRDk+Trr7+OO0Gtto2ecbTA3/gk5qcy/G1Ta26165DTyOxOOhs9i6i5ogenEGFV1dVpM5UJvpo6dSqrB/dMtBdGe/3Vf3HpsnlA/+QvF03f/k1XLh1+mBmWygmhhE+f/HLicLwgEQOX80SxSYp6RBgxiJRXKQi5UgvX3YwhTcHaB2kNC2wZ2FmnCoPv1pNHCL6KhoIUMbKpo1/IGVKhQh++Ptl6661bNm3lbLPBeWgDEADNBw8++GDijvbZZx+4HOB+5513ysxHhEE5kyFDhhi7p3dEmTItSlmBOShYy+8Bm2Svxym/wfZKYOSIIZk8ccMVyxRO7LdPfDmPY1667RuZh6O+uN2pmA/yRM/6lDRmQoMoD2cWJ7OJ56EM+gRoO27cOBlADLyMFSzqpgyuNWmMAn7Ck2PQv/XWW3ECyyUjZLS/aYKknbg1KG3SJEPRyXaEDJXGKBWhfESZtZcQ3/B0CvWnMBIMUay44oqnn346YU6EwxW+qz7AJVC3BCJA/6dn5tuL4v/yPNjHHjYgcuDpU9bwuNg6qYKoR3CB9ePIkSOtInchT1gduvm9a/53be2QKpqNrfHzA7Lm4DX9hh0KVbHQZjUtXuRm0Z/CUFTz3mP/UbZzszclQJiPQcqZLhrWcrdCsHnz+fTTT6VF8UALo4HljTDnNvvUmJIyMT+krehd9QEugbolMPfBBTIhG2tSmXM+fcMimYeTSRc5HMuV80SdPIFYwXpyKXBdUgG7fMlVgSlZu0TpgE0s1YGnsKl1GKvabJzNPH/C5AXyakrsYDHDmMP8LREvzL+DBfkvrEkZ2hb4XcQQibpM3BHzDKmujAxl9yOrjrrxtG8yC1umXqgnaLl7hFrNmjWL3DoMXGXeVR/jEqhbAm/c8zXnibqlV9OB9RND4jK/+tWv6C5AY8sjjzwSg5IwRRpD3qbkNakdlCgHdtMp2TK1l0G3po4Jy2vbely+blLJjBfDxBFW1tI2ttlmm6bOTScXH4Q5EJkXVS3YCG/JRMbfLbbYQspEvD55mHXP4yYhHAukhznV9BL64Pok0CR9Im53mjl9Vdcnekob+HiBCWJkwZd4i2kZaoQySt0iUjPkiSqU8ZDFhr8KElVXBiZmDYKExbCj6uZaO+jQb0FdkxZQnTUvSliZNEMFlRF5XDKfcezYsVKS9GjidXMtYAHNCYUStbK+196PcgnUJIEe+idwVtfhx84Lw03MvGSBv5LDahJLMwb3lBgScyKdgmI+LLGJ34/bK2SikTJhWdwUjLM8BsPW9pb0AF4zGQvaAHbtq7vvvnvw4MHcSzpbmyTEFsRrhVQUKmEJiipUOCAVvNCmEUL2anMd0Qv5Fp1j2WWXpdgXsbDulmjGi+rnzJRAk+KdMuNiyaLwuNiGEQYpuCwq6XNpq9EIxJjvV6tX1q233HLLJ598olWwYo0sTLYF1pvMS4RhV4b48ISRhPLRMOhTqSKRS8hNERzVgpmHVCQPtj4JP5fFKa7cgPLS86yWX+Tx6StZ24455piLL74YZQILpIOaS6A1Euhh/gQmpvJ5dvESUq5P1EYh1GmAKtAMsEIAIlbAI4wLikAPZaspkgHA4dPW4tfqeVjta8FuWAa8BUBc8hIY6LFB6QZx6bPErogBLW/+FhaFnEl7VPySJVeHxV/5UFqgisaHxZ0o8EXTKpQJ74DdGnz0q0gC5fOxaUqRzse++ydLNKRoR7q8YEmDUslhbX/ctXFAyelSbxxPJlldKgqU8O7G16cA0MCBA1WfzrQKQS0L4RBzFd5TEr5bOYy+1iDmj370IzKZ5TEu6RVo5SR1LZnOECNpEy+++OLKK6+cxxNyUViNP1sBsIPB7cQTT8QvRWZ+yV+ID3MJNEoCXt+pUZKMnKcpPEHaHTlWOCqwRVgAvi0/zTKTRxgsWtdcc83Zs2eHVKH9ahJDiO9WVk+NSxVH23oCKHlF1dRCqkh7/fXXD31F0h7M+mSpIfb49AlVpI4++mg0SMpBtuD36pdwCSQk0MN6sRFvdk2qhtudauYS0u6o5AFwXHTRRVgkFFhpSQZx/7bQB5AiEh+LfwLvyrhhS0Jkk4aZlUyOAYCYVPP2uuLz7tRI94033lBxDlWWtfpUCRdFqBeyr8LAZFbijkJ54ok7hLkE2iKBHvafoElRSUrAj+1xsTXzQeQ3ceONN2J9Ii8XszXtl4kCshw0PBZhPlpaq7BOOxz4yiuvpGGumrAbzjORylDBCUMScBhkRrknaRLyJIUkkXg0YZoIX6mkII4ozE3UDG4LQPhFXQKSQA/72VE0sLCf3anHrOl9TxtJEnpyxL2o4R1xluuuu65sGvFIfOEUgCUjFeyC7VtaRRi3o0w37DntbVmRuU4ntcLa4Sm9vEmKS89PC0+89NJLCufVZoamNJFbOXEN4y+hz+ecc45rEo7U1ZFAT/pjUyB26hFr5ykWVmjW+2M3nir4AaFVsN48/PDD1RIu7sTm20QKN2YonOE4hD/66KME5kIVFeSJTPiu4DwpOfWb3/xGJIFmIGWCYLPQJxE+LBUSt3gnSGL8+PFEK7AO8ISJ6gClzwQJENp01QXLH7DPYFMRdt1po5MmrkU/CRSCuIjmPrDgtZf041gRBl0oOPC9vzWx6FrxNoUbQmmSeUeSNj5tysMJdwCjOFuYA0M5a1AF/beJxvnwww8rGziUoAcoDbeErE8tSLKrQ7d45pln1FVCxIxnQua+vLQJ6XlKz+bvmDFjoH9KOaEyYmPs2vfHb9wl0A0SaDpPIESogmqyVB2nH5y82foLDSR6VEQUDjKEVVbWiraG8aYJB0D1w6LqQPb4IaoAKD9/aJez9AhISwYxRt52222RPAkejTViUqM68boyYOAVniNuJwJh3S3RDRjh9+gSaAVPIGWqTFME6eSTT95uu+1UEyJM1MJpoeCZiPdCthHS1uSrsI4OYWsHo4eKp7Y1nCQKT2h1ZHGZUFUFlS6PJ0Lmtoa1PC+xBToHZQ1PO+003BLQNoFt/gq5BFwCvV4CLeIJTBMYKIiUBaQoDWu4w46s3hZnGTFJsZIFuXB1qAYUbljtAIKWtRC2wytEz943AN++8ubCAuMISvoWLb4POeQQ2Y7ykq7DThK2b636hg8fzhPE5+Rlw3s9NPgNugRMAi3iCYU/EWKPUfu4447beOONxQekVpiJI950WqZzrXZ32GEHzOvKEQud22Z16RQ3RgOJCmJAFOnwKqRk/SS23XZb6EE8Ec+TsJAzRqpKBzsEFPDseILkUXoRJwcRl0D3SKB1PIFMlaeNXZsiSJSISJRWjSdVmJ6hoyidRH09GZ2gB6s/0YWeCZFNgiFUSNzqnxNHQDMowb2gPy9PwoKaTODS9tZaa63JkycT4IS5yUmiewDC79QlgARayhNcDwMU1icKi1LsYcCAAQKjMgxh6dyMl90cPwc9kWjSidHJ/NgVzGhroNIQOZW5ZMSaGsk+udaHHnroYostZrivzh958a8hl+gQBlNGhe4g+CRgerc4OXC4BLpNAq3mCeSrkh5EQE2YMGG99daDAAotTgIsRUMljOabb775fOT6fLM0hQrmKzSbLUyfsB0YlMq7gwYNkguaDqaKHRAT5PFEWBFWYucMkDphCNSCdU2i2wDC79cl0AZ9woRO5birr7562rRpaBVl9AmZSmxRrK6iYg7qeE+dOpWFM1hM1oL5tJsNzZU6v7I0zI3/wQcfnHTSSXj+TWjaQdRi5Uh7CSsKyxjMg6gjxL+ST4fN0N8Zl4BLoAsl0AZ9QlImiReewN59yimnDB061AhAGkMiryL8Nm9/o402mh/O//mW6EvKJ+bZDl3cYGtlPd6ho0UpEWZKUitsYynL4zPTE9ahYcOGIai4ohYWCUfg1inEaBttj4q/pEmi/3kyXReig9+yS0ASaBtPcG14glUqigVmDUrRyUGN1yHUG1TdOsITCqjVANICSAFTmyNZ58NcaPl108QABFczZZpbIM4VZwN/02TAh6Y52bdPPvnk6NGjMTHJTFdGUWMYliiToRiaZwHTTJo06Xvf+x5qhJubHC9cAt0sgXbyBHJXBXJs32gVRG3KdK60O0E/O4WLYqBNpcu1UXMQz8f7779vlb1pwpOwEYUr9EqZj2wyasqkW+AvlIDTRVFMYWgTbMHdwSWvvfYavWbpBlGeISSukEu0TzIdhWBpPQSFo/ChnXTzG+L37hJwCbSZJ2SAIm+LhO0ZM2aQrS3wghvCRW6knofF50AVygzQhs3k/PPPp2h22B7VEFaVLaocHKXe4Kb9mMZgxWi5F9mmqKdL+zzcPKqLFRblDQVikjF6QMhhqXCRBC4NEiFPPfVU8iR4Luh8/pK4BFwCXS6B9vOEHgCohIkDZEerWHzxxYVllmARUSlQJkI7lfy04KMOWWGFFc4666x3333X1umsyrWBs9YlopqEwaxCKxnqhQJebbYURqQTlJrLsiXkEDc6KZMuLN8EwcA0GO4or6JkOi/L0eXo4LfvEmi/fyJ8BtQKJIFL5QL3339/CsTa+rewZYXsTkJJraYFkaaRELQzffp01t2JFqShqlE161NewqAUi9dff51wJljQpGRRTKG4Iq0DNSw061H4/YADDoB4MAOiSbjj2jHCJeASqBZPaDZYw7GJsxFmM3DgQIG+WZYSlpP0f6EK0yTMY2GfKFnsscceA2QT3UmrRhKh0iDtR+4KjE733nsvNb1FACJIVWoKpcF/GWCdySNy07FwDPnt3/3ud8mkY8MG6I5rBwiXgEvAJFAVu5NNiNhWxcviR6UMlEX954FdJILWYqWUXCYlg8zknXbaCSqCLTqorCyOlpkzZ+JeNv4LEyAQQphHHUYBFJIr5yGkmBKw2JroUzu/ePvnnO3/XAIuAZdAFfUJzYlATGL22XBXjBw5UjYoWzKHZncWwiFPaGlsdqdMiDSfx5JLLrnXXnth6SJSKOEGUGRRqGQwIJG1kKeCWBOIxACdAcNX6J22MXyIv0SOByu8wSG0B0cOe+6557LLLptQGsoQALIKXdnpcAAiiffZZx/KqMhrjfXPXwyXgEvAJZCQQEWXjZSIALnQLWg4gZnFXLWGdEqbsK4V0EOZXAEL9YEtzIdBpNAuu+xy6aWXPvDAAyosiJEnLJGU8HIr30K1u9NbOgBXg/W54qzkP9cn0IMyJHQV9lEdnn322UsuuYQOgCuuuKLmrNzD8lQRluVAOHa/1huKD4cMGXLEEUdAxlQJxNbkDglHB5eASyBTAhXlCeYKbKm+LAhOBA7GIitmh/FdiGmtFIw/0sb6xLobu03IKIa8WPNJPgA6jzrqKEJ1qQJCUh6YruV/SBXpvLw0c6jCecgZZDnk9fdmJI00nn/+ediRHAh6PKDr2LTL8194p8YTVrojVLPY33nnnfHti4z566+HS8Al4BLIk0B1eUIzxlcBimE0p9Hm+PHjcW4LDbVG1k5oeoIGwpy7QuOMKSU2UswBFW244YbkNuPXJTyUBT5l9YT7MAdqh/ijvkRuDFDz5s2jhQYaDG6YAw88EIVJbf5M42EnDFqV5a1kwUSRhMpypFUQKoTTrQgdgluTbP31cAm4BFwCEQlUnSekWFARFkcCoEYzNfpuhjXGwUF4ojB21iBYZSrgGMNcDmfRTa2LsJWbxlusLXb81VZbjQQ0jGAoN7NmzaLF9F133fXggw/++te/fuGFF9A/gH4SGvhLugb/nTNnDuzCt48++ujDDz+M55yQ0xNOOGHUqFHUuF1llVW4C86f8Bkk3DDAvSoexp0uIcFESGLppZfeddddyaGTMHFIeFyTo4NLwCVQKIEO4AnuATi77rrrKAbFEpiYHOpBKWo2VAJqclEYDSSW25zTLPihLqK1fHgJyAbFBbUDa1jfvn2XW245fAkkakAncACZDVSxxZAFwUBC2Mcs+Cqh4oTEwNUhrbAkX9ihmqurcFPeZrYm0yRMRHAS6hEmNdQIivrpb+GPwwe4BFwCLgEk0Bk8IargLwE5rIKJmmVFv99++4HIlkoGSoKqIKOwPoKnAC7eiMSYsFC5jg1TN8yMo5QONl1I6J8ukZR3dZ1T2ozVyUgkiIgtQgpkQGEB3UySEE+QG4ESg+EOnQauxQviP32XgEvAJVBeAh3DE3ZL2KAIzoEqqPNx3nnn4d9mLS9UVRpB3PGbGJAH8eb2ECuIGMq4lGUjMgoJ7V3lo5U4ivOUvKK5NBIWJzHZiBEjKJyFHkZ8LeYmL8VR/t3wkS4Bl4Ak0Hk8oXkTCiUXNwtk4nZ23HFH7DwGyokVOvyBAqEleVheMDTrR/SPdn1lzglZosQ90i3SmRDKzTa1Y6mlliLYlzZQmOmgB5jV+5X6O+8ScAnUJ4FO5Qn5t2ELcBBzCtkGkydP3mqrrWALuaPlIk4s4fVfWagyCaNdlJB3XZm50ncB7RkXcju4H8y3T9wUtRRhCGSixAhii4n0re/34Ue5BFwCLoEO5gl7eBjcMapAGJdffjnV8XbYYQfcyGEElHwPshqFK3EF15aPlWoLiyTineQSD81ZVh4cRzqZ24RUEVgFd9LYw61M/oa7BFwCPZdAb+AJpIANio2YKP6Swk3XI6wugwYNSkTQVpwSQh7KdGaI6rgLTEzoE9KZiKcisIoaJFQ55N7Jm0OHcENTz98NP4NLwCXQ2f6JzOeHdQUbi7rroFuQKEChbFKsaWgRuqDBWYwzBEqZbpE297dFdUjwRKbbPJwqbEG/2EMPPZTaG9ADfghlz3kHOn+9XQIugQZKoJfoE6FEMEOBlbAFKQKwxdlnn00bVNSLtddem3oYiQAnxTWVzHNuPXkkgm41AZwTq6++OndE9XVMTNAD0V/48zE0NfCX4adyCbgEXAK9UJ9IPFTMUARECUMpEoUxCsKgVjn5BNhqhLk1xaq2kifCBGwmiVuiT58+JFRTl2ncuHF0c8IDAR3yFzpEi/IftEvAJeASaJIEeqE+kZYUIaGoF8rlhjAA2UmTJgG4EEZNxaBayROm98AQ5HhTb2PKlCm0oKDZHE57yA/bmoe6Numt8NO6BFwCoQS6gie4YdK5QVWLjAJqFU1LdBCZaJRopcEDNTbSjoq8vDnVxsi0CyXoRGMs+S6PbOyEGoBlCdWHFrAUCmSeGJekPeCglsfeY5n8TXYJuARaI4Fu4YlQmoAsthqMUVil1MSNMCEqDE6dOpWWD9tvv/16661neRhxHSJMgbZKHnH+UAkQDVYZD/lIVGpw6623Hjt2LDMh1fzCCy8k5xyGwEdNVVeMS2xkjThDtObd8Ku4BFwCvd8/EXnGQC1BQRAGvl9FCskqBS7DGZRCotYF1Qapv82inogpehmRnUDclNmp8uo7pZWJsLg3JCFPQ79+/VQ0kPK3e++995FHHnnGGWcoMw7LGN5plAZsZaY9+O/VJeAScAm0SwLdqE8kZA1nwBbKOWDZDnkQX4uFSnVVwW7W9QRNUR2ElG96YBx88MGE22666aZYq4YNGwaLkKhB/Vr6OvTv33/NNdfkL7yCUjJ48GCqtMI0m2yyCRlwdBilHh9nIE6Js6HB4CmBorRBVFwReuDSmMjYvAtpu94Kv65LwCXQjf6Jmp46th3xBE5jyAOFQ3Yq0FyJ33zOPt4Cdi677DL6S1O/liQGcP+cc87BZIRGgk6AZgDTyBdChK72FcbKOZXnoYAliMpaQcBb3oK0puflg10CLoGmSsD1iVISEHajZ2CtgkKAdWWAg/WyDoH7aiAK6LOpn6h0FI3hKG3oK5yETUpDU5+un9wl4BJwCfRcAqVQsueX6X1ngDbYUALYYBHzLWtfn2sM5iM2dz73vt+A35FLoEsk4DzhEnAJuARcAi6BmARcOi4Bl4BLwCXgEnCe+Ly1kf9zCbgEXAIugTok4OjpEnAJuARcAi4B1ydcmXAJuARcAi6BeiXgLOoScAm4BFwCLgHXJ+pl0ToMeX6IS8Al4BLoZRJwFnUJuARcAi4Bl4DrE65PuARcAi4Bl0C9EnAWdQm4BFwCLgGXQEwC/w+KgigYR7V1PAAAAABJRU5ErkJggg==';\n context.drawImage(image, 0, 0, canvas.width, canvas.height);\n }\n } else {\n // draw image to indicate that video track is disabled.\n context.drawImage(mutedVideo, canvas.width / 2 - 50, canvas.height / 2 - 50, 150, 150);\n context.fillText('Camera Disabled.', canvas.width / 2 - 100, canvas.height / 2 - 70);\n }\n\n // if audio is muted.\n if (audioMuted) {\n // draw image to indicate that audio track is disabled.\n context.drawImage(mutedAudio, canvas.width / 2 - 130, 0, 25, 25);\n context.fillText('Microphone Disabled.', canvas.width / 2 - 100, 20);\n }\n\n // name/title of the user\n if (options.title) {\n var name = options.title;\n var nameLength = name.length * 10;\n context.fillText(name, 10, 50, nameLength);\n\n context.strokeRect(5, 30, nameLength + 10, 30);\n }\n\n // if audio/video recording started.\n if (recording) {\n // draw image to indicate that audio/video recording is on the go.\n context.drawImage(recordingImage, canvas.width / 2 - 100, canvas.height - 70, 25, 25);\n context.fillText('Recording...', canvas.width / 2 - 70, canvas.height - 50);\n }\n\n // 5 seconds interval before taking snapshot\n if (preparingSnapshot) {\n context.fillText('Taking snapshot in ' + takingSnapshotIn + ' seconds.', canvas.width / 4, canvas.height / 2 - 70);\n }\n\n // use request animation frame to use GPU for frames drawing on canvas2d surface.\n requestAnimationFrame(drawImage);\n }", "title": "" }, { "docid": "2773d3b39a1cb3e41a0141e6d6cbe00b", "score": "0.5374367", "text": "advance() {\n if (this._playing) {\n this.playheadPosition++;\n this._frameForced = false;\n this.makeTimelineInBounds();\n }\n }", "title": "" } ]
05b72302b55cedcbc9b713c44db47204
fungsi reset form seperti semula
[ { "docid": "b43ad01c91004ed1a554d1bea5f0cee4", "score": "0.75204855", "text": "function resetForm(linkTambah, judulForm) {\n console.log(\"test reset\");\n // trigger reset\n $(\"#formModal form\").trigger(\"reset\");\n // const formAction = $('#formModal form').attr('action');\n\n // ubah action dari form menjadi tambah\n // let tambahAction = window.location.href + \"&aksi=tambah\";\n\n $(\"#formModal form\").attr(\"action\", linkTambah);\n\n // ubah judul form\n $(\"#formModalLabel\").html(judulForm);\n\n // ubah tombol edit menjadi tambah\n $(\"#formModal form input[type=submit]\").val(\"Tambah\");\n\n // reset modal hapus\n const deleteHref = $(\"#deleteLink\").attr(\"href\").substr(0, 26);\n $(\"#deleteModal a\").attr(\"href\", deleteHref);\n}", "title": "" } ]
[ { "docid": "34982d4dba6cb709b4d9d2aba0d61ecb", "score": "0.8197325", "text": "function resetBiayaForm(){\n KodeField.setValue('');\n NamaField.setValue('');\n KeteranganField.setValue('');\n JumlahField.setValue('');\n IsSksField.setValue('');\n }", "title": "" }, { "docid": "3a4b1851314ca784698d8281f6abc36b", "score": "0.8153322", "text": "onReset(evt) {\n evt.preventDefault();\n // Reset our form values\n this.marcador.id = \"\";\n this.marcador.url = \"\";\n this.marcador.nombre = \"\";\n this.marcador.descripcion = \"\";\n }", "title": "" }, { "docid": "e25067eb1aaf168577ddd3f0d8bf2da1", "score": "0.80370766", "text": "function resetearFormulario() {\n formulario.reset();\n iniciarApp();\n}", "title": "" }, { "docid": "242e6e3d4331a4d027020bde1ca39a60", "score": "0.7917546", "text": "function resetPresidentForm(){\n tipoConsecuenciaField.setValue('');\n descripcionField.setValue('');\n }", "title": "" }, { "docid": "8eb5601d118219467c53746e9cfa34ec", "score": "0.79040545", "text": "function apagaForm() {\n document.getElementById('buscaCep').reset();\n}", "title": "" }, { "docid": "9b0661dc2db58d7937219f37d1817354", "score": "0.7871115", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "e6db02f114cc89528929c7a479421144", "score": "0.7811591", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "e6db02f114cc89528929c7a479421144", "score": "0.7811591", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "7c212ffadb4effb5602fc8284869132e", "score": "0.77863914", "text": "function resetPresidentForm(){\n equipoField.setValue('');\n descripcionField.setValue('');\n tagField.setValue('');\n }", "title": "" }, { "docid": "b06cc60be371dd0316eda195b0faadc0", "score": "0.7744197", "text": "resetForm() {\n this.form.name = '';\n\n this.assignDefaultAbilities();\n\n this.allAbilitiesAssigned = false;\n }", "title": "" }, { "docid": "afc968c4aa351c74f6c612fe7175039d", "score": "0.7663126", "text": "function resetForm() {\n //ocument.getElementById(\"eingabeForm\").reset();\n printToHTMLById(\"versuchsdauer\",\"\");\n printToHTMLById(\"treffer\",\"\");\n printToHTMLById(\"fehlversuche\",\"\");\n printToHTMLById(\"versuchszeitpunkt\",\"\");\n}", "title": "" }, { "docid": "3b2443002d433ee4b7a318d6efba8343", "score": "0.76606697", "text": "function resetFormulario( e ) {\n e .preventDefault(); // Previene la ejecución del 'action' del Formulario\n\n formulario .reset(); // Resetea los campos del formulario\n}", "title": "" }, { "docid": "878e8a315b764adb268da5f5e4cef5ec", "score": "0.76394844", "text": "function resetForm(){\n\n\t\t\t// Clears form fields\n\t\t\tform.find('input:text, input:password, input:file, select, textarea').val('');\n\n\t\t\t// Unchecks and unselects form fields\n\t\t\tform.find('input:radio, input:checkbox')\n\t\t\t\t.removeAttr('checked')\n\t\t\t\t.removeAttr('selected');\n\n\t\t}", "title": "" }, { "docid": "cfb8c9fd9aa2c3619165c273ab4d45ff", "score": "0.7584202", "text": "function resetCourseForm(){\r\n typeCombo.reset();\r\n ValidFromField.reset();\r\n PriceValueField.reset();\r\n // ValidToField.reset();\r\n\r\n }", "title": "" }, { "docid": "8b857dc7f9dcabe23d4b65112cdda7bd", "score": "0.7574711", "text": "function reset(){\n clearAddStudentForm();\n updateData();\n //todo needs adjustment\n}", "title": "" }, { "docid": "d0788f18e351834ad01e5b507ae96a74", "score": "0.7564085", "text": "resetFormulario() {\n document.getElementById('product-form').reset();\n }", "title": "" }, { "docid": "41f55ede795ca2c839d08ae001a93b67", "score": "0.755857", "text": "function reset() {\r\n registradores.setValue(0);\r\n sp.setValue(99);\r\n}", "title": "" }, { "docid": "675e2288c641e09f08998288d2fccd1b", "score": "0.75565416", "text": "function resetPriceForm() {\n setPaqueteBasico({\n opciones: {\n transporte: true,\n alojamiento: false,\n alimentacion: false,\n guia: false,\n extras: false,\n },\n lugarHospedaje: \"\",\n ubicacionHospedaje: \"\",\n descripcionAlimentacion: \"\",\n detalleTransporte: \"\",\n correoGuia: \"\",\n nombreGuia: \"\",\n precio: \"\",\n extras: \"\",\n });\n setPaquetePremium({\n opciones: {\n transporte: true,\n alojamiento: false,\n alimentacion: false,\n guia: false,\n extras: false,\n },\n lugarHospedaje: \"\",\n ubicacionHospedaje: \"\",\n descripcionAlimentacion: \"\",\n detalleTransporte: \"\",\n correoGuia: \"\",\n nombreGuia: \"\",\n precio: \"\",\n extras: \"\",\n });\n setPaqueteVIP({\n opciones: {\n transporte: true,\n alojamiento: false,\n alimentacion: false,\n guia: false,\n extras: false,\n },\n lugarHospedaje: \"\",\n ubicacionHospedaje: \"\",\n descripcionAlimentacion: \"\",\n detalleTransporte: \"\",\n correoGuia: \"\",\n nombreGuia: \"\",\n precio: \"\",\n extras: \"\",\n });\n }", "title": "" }, { "docid": "6f913554fdeff6fdd083fa6c13eb353b", "score": "0.75484335", "text": "function resetPresidentForm(){\n// designarInvestigadresCreateForm.getForm().findField('itemselector').reset()\n }", "title": "" }, { "docid": "1d94f05da8ac8eea68ba23d75c708c7b", "score": "0.75472856", "text": "function resetForm() {\n partNumber.value = '';\n partName.value = '';\n materialType.value = '';\n partSize.value = '';\n partLength.value = '';\n partInfo.value = '---';\n }", "title": "" }, { "docid": "b83f01e2e212d34c19cb0d8cb55a5ec9", "score": "0.75402695", "text": "function resetForm() {\n $scope.amount = '';\n $scope.description = '';\n $scope.selectedType = '-Select Expense type-';\n $scope.expenseDate = getCurrentDate2();\n $scope.hasErrorMessage = false;\n $scope.errorMessage = '';\n }", "title": "" }, { "docid": "cc587a0730e1f051047d5d9f4ac10a22", "score": "0.75391954", "text": "resetForm() {\n this.setState({ value: \"\", editing: undefined, selectedTodo: undefined }); //RESET AL STATE DEL COMPONENTE PARA VACIAR EL INPUT LA TARREA Y SI ESTABA EDITANDO.\n }", "title": "" }, { "docid": "106476adcfbab29cfe27aa7dfa8102b6", "score": "0.7537352", "text": "function resetCourseForm(){\r\n NameField.reset();\r\n AddressField.reset();\r\n PhoneField.reset();\r\n MobileField.reset();\r\n }", "title": "" }, { "docid": "f0065433e8e4ea915c7b2b4aecb0374d", "score": "0.75175995", "text": "function resetForm(form) {\n form.items.each(function(field){\n field.setValue('');\n });\n}", "title": "" }, { "docid": "b9182de14d36fc765e56844907909f24", "score": "0.74869615", "text": "resetForm() {\n this.currReasons = [];\n this.enquiryForm.reset();\n this.enquiryForm.get(\"insuranceProviderId\").setValue(\"\");\n this.enquiryForm.get(\"serviceStart\").setValue(\"\");\n this.enquiryForm.get(\"preference\").setValue(\"\");\n this.enquiryForm.get(\"providerGenderPreference\").setValue(\"null\");\n this.enquiryForm.get(\"counsellingMethod\").setValue(\"\");\n this.enquiryForm.get(\"county\").setValue(\"\");\n this.enquiryForm.get(\"source\").setValue(\"\");\n this.enquiryForm.get(\"countryCode\").setValue(\"+1\");\n this.enquiryForm.get(\"edUser\").setValue(\"false\");\n this.resetInsuranceFile(this.insuranceFileInput.nativeElement);\n }", "title": "" }, { "docid": "e0e6e670c8599eabf96dc6e6a9265427", "score": "0.7484331", "text": "function resetEditCourseForm(){\r\n ENameField.reset();\r\n EAddressField.reset();\r\n EPhoneField.reset();\r\n EMobileField.reset();\r\n }", "title": "" }, { "docid": "fcbb5091d3a0c76dc78a2962ab2d6396", "score": "0.74732053", "text": "function resetForm() {\n $formLogin.validate().resetForm();\n $formLost.validate().resetForm();\n $formRegister.validate().resetForm();\n }", "title": "" }, { "docid": "3ce880d71e30ec42ee68e2a8a2558d5a", "score": "0.746232", "text": "function resetData() {\r\n\t\t$(\"#quantite\").val(\"\");\r\n\t\t$(\"#remise\").val(\"\");\r\n\t\t$(\"#libelArticle\").val(\"\");\r\n\t\t$(\"#prix\").val(\"\");\r\n\t\t$(\"#tva\").val(\"\");\r\n\t}", "title": "" }, { "docid": "d43302cba7b6a4a6c11a4509c212db9b", "score": "0.7456857", "text": "function form_reset()\r\n\t\t{ \r\n\t\t\tformorder.reset();\r\n\t\t}", "title": "" }, { "docid": "e76e18b18d27b6dd13b8bde2cb73df45", "score": "0.7455441", "text": "function resetForm() {\n $('#numberStudentId').val('');\n $('#txtfirstname').val('');\n $('#txtlastname').val('');\n $('#txtemail').val('');\n $('#numberSupervisorId').val('');\n }", "title": "" }, { "docid": "ea70f02bd26e097aa6cc6166ed838f39", "score": "0.7450771", "text": "function resetForm() {\n createProjectForm[0].reset();\n syllabusSelectList.val('').trigger('change');\n facilitatorList.val('').trigger('change');\n statusList.val('').trigger('change');\n }", "title": "" }, { "docid": "fe53fdbf34d9bea2b499a187b663d195", "score": "0.744644", "text": "function ResetForm() {\n $scope.editData = {\n AMCId: 0,\n StartDate: \"\",\n EndDate: \"\",\n Remarks: \"\"\n };\n $scope.amcform.$setPristine();\n $scope.selection = [];\n $scope.isFirstFocus = false;\n $timeout(function () {\n $scope.isFirstFocus = true;\n });\n }", "title": "" }, { "docid": "645392e830010a63ba4facb817061b61", "score": "0.7440724", "text": "function limpiarDatos() {\n $('#formulario')[0].reset();\n}", "title": "" }, { "docid": "d8925cb4f9c98f39d67a0967512decb5", "score": "0.74406296", "text": "function resetForm(){\n document.getElementById(\"myForm\").reset();\n }", "title": "" }, { "docid": "286d1abbdb9fe313e3290feb692407c9", "score": "0.7438287", "text": "__onFormReset() {\n this.value = '';\n }", "title": "" }, { "docid": "e0ff45550f8fea4484b1a9e557abd6f3", "score": "0.7422831", "text": "function resetForm() {\n $leaveComment\n .attr('rows', '1')\n .val('');\n $cancelComment\n .closest('.create-comment')\n .removeClass('focused');\n }", "title": "" }, { "docid": "d62afdbb087d179a8d6c8fa60452d152", "score": "0.74210703", "text": "function resetForm(form){\n resetField();\n form.$setPristine();\n }", "title": "" }, { "docid": "b1844cd3be557942ccfd4182a8310fd8", "score": "0.7417581", "text": "function reset(){\n $reinit.on(\"click\", function () {\n // reset messages d'erreur\n $(\"div.invalid-feedback, div.valid-feedback, div.text-success, div.text-danger\").remove(\".valid-feedback, .invalid-feedback, .all-success, #erreur-validation\");\n // reset couleurs des champs\n $(\"#nom.is-invalid, #nom.is-valid, #prenom.is-invalid, #prenom.is-valid, #societe.is-invalid, #societe.is-valid, #email.is-invalid, #email.is-valid, #objet.is-invalid, #objet.is-valid, #message.is-invalid, #message.is-valid\").removeClass(\"is-valid is-invalid\");\n })\n }", "title": "" }, { "docid": "6a28cd6269699ecc98a2c6201d7481b3", "score": "0.7401626", "text": "function formularioReset(e){\n\te.preventDefault();\n\tformulario.reset();\n}", "title": "" }, { "docid": "839be0b3734086ccf521f728d0e12c6f", "score": "0.73806703", "text": "resetForm() {\n this.set({\n body : '',\n description: '',\n slug : null,\n tagList : [],\n title : ''\n });\n }", "title": "" }, { "docid": "fefac1ac35cb64d2a411736feeb45b75", "score": "0.7377927", "text": "function resetForm() {\r\n $(\"#salesman-selector\").val(\"\");\r\n $(\"#month-selector\").val(\"\");\r\n $(\"#amount-selector\").val(\"\");\r\n}", "title": "" }, { "docid": "347e8a00db6b296bd2ac1f76dd6a2a7e", "score": "0.7372413", "text": "function clearForm(){\n\n document.getElementById(\"frmtabungan\").reset();\n $(\"#opt_noreg\").val(\"\").trigger(\"change\");\n}", "title": "" }, { "docid": "05b39331d321480044574af634a63655", "score": "0.7345525", "text": "function defaultResetForm() {\r\n vm.title = '';\r\n vm.text = '';\r\n vm.noteForm.$setPristine();\r\n vm.noteForm.$setUntouched();\r\n }", "title": "" }, { "docid": "737159ac63f546554e932d1ca3a8c192", "score": "0.73267734", "text": "function resetECourseForm(){\r\n EtypeCombo.reset();\r\n EValidFromField.reset();\r\n // EValidToField.reset();\r\n\r\n }", "title": "" }, { "docid": "968ef21abb49c5bfc57b88af4e2f6c9c", "score": "0.73234165", "text": "function resetearModalAgregar(){\r\n sku.value = \"\";\r\n nombreProducto.value = \"\";\r\n pesoProducto.value = \"\";\r\n }", "title": "" }, { "docid": "de7f7aa696955d8dbb553978d192d385", "score": "0.73216945", "text": "function resetearpagina(){\ndeshabilitar(form1); \nform1.año[0].checked=false;\nform1.año[1].checked=false;\n}", "title": "" }, { "docid": "44b7b20159925d56dfd4b27252d08de8", "score": "0.7321515", "text": "function myFunction() {\ndocument.getElementById(\"form\").reset();\n console.log(\"reset \");\n}", "title": "" }, { "docid": "6c4460cadec3be7112f854823415c42b", "score": "0.73211193", "text": "function resetForm() {\n for (let i = 0; i < form.length; i++) {\n form[i].value = \"\";\n };\n}", "title": "" }, { "docid": "e30049a43734c2a54c5ab8d56e711daa", "score": "0.73207283", "text": "function resetCampos(contexto){\r\n\t\t$(\":input\", contexto).each(function(){\r\n\t\t\t$(this).val(\"\").removeClass(\"req\");\r\n\t\t});\t\t\r\n\t\t$(\"div\", contexto).each(function(){\r\n\t\t\t$(this).text(\"\");\r\n\t\t});\t\t\t\t\r\n\t}", "title": "" }, { "docid": "e4b882f1b3db7b36a5a84a6f6b3f17de", "score": "0.7301295", "text": "function formReset() {\r\n document.forms[0].reset(); // to clear the form for the next entries\r\n // document.querySelector('form').reset(); Also could be done in this way\r\n}", "title": "" }, { "docid": "581db16d008f4c25ed1cb7808a553e49", "score": "0.72952163", "text": "function resetForm(){\n \n partSelect.selectedIndex = 0;\n segments.value = '';\n}", "title": "" }, { "docid": "02f23095a16a1b0893bf1f559a8a5b4c", "score": "0.72829026", "text": "function reset(){\n\t$(\"#reg_num, #bus_code, #num_seats, #seat_config, #category\").attr(\"value\",\"\");\n\t$(\"#add_or_edit\").attr(\"value\",1);\n\t$(\"#add_bus\").attr(\"value\",\"Add Bus\");\n}", "title": "" }, { "docid": "a675323f1d3056dedd3bb6170277ee12", "score": "0.72803295", "text": "function kosongkan(){\n $('#idformTB').val('');\n $('#namaTB').val('');\n $('#keteranganTB').val('');\n }", "title": "" }, { "docid": "ab235d29552573532f4bea0f1fc9532a", "score": "0.7274051", "text": "function resetForm(formName){\n $(':input','form[name=' + formName + ']')\n .not(':button, :submit, :reset, :hidden').each(function(index,el){\n resetField(el);\n });\n $('input[type=hidden][name=numero_planilla]').each(function(index,el){\n resetField(el);\n });\n}", "title": "" }, { "docid": "61eebba411a2def4bf92e4d3250e258a", "score": "0.7273465", "text": "function reset_form(){\n\tdocument.getElementsByTagName('form')[0].reset();\n\tset_value();\n\tdocument.getElementById('order-button').disabled = true;\n}", "title": "" }, { "docid": "d2acca1c7dcc4d75026668a8c762b946", "score": "0.7271468", "text": "function kosongkan(){\n $('#idformTB').val('');\n $('#tanggal1TB').val('');\n $('#tanggal1TB').val('');\n $('#aktivitasTB').val('');\n $('#keteranganTB').val('');\n }", "title": "" }, { "docid": "d2acca1c7dcc4d75026668a8c762b946", "score": "0.7271468", "text": "function kosongkan(){\n $('#idformTB').val('');\n $('#tanggal1TB').val('');\n $('#tanggal1TB').val('');\n $('#aktivitasTB').val('');\n $('#keteranganTB').val('');\n }", "title": "" }, { "docid": "d2acca1c7dcc4d75026668a8c762b946", "score": "0.7271468", "text": "function kosongkan(){\n $('#idformTB').val('');\n $('#tanggal1TB').val('');\n $('#tanggal1TB').val('');\n $('#aktivitasTB').val('');\n $('#keteranganTB').val('');\n }", "title": "" }, { "docid": "bb7e4377faeda3287c6a3827519bc146", "score": "0.7270552", "text": "function resetmyforms(forminputs) {\n $(forminputs).val(\"\");\n }", "title": "" }, { "docid": "aec27acd321620d5686f50898b3c9fc6", "score": "0.7258882", "text": "function cleanupForm() {\n showSpinner(false);\n unmarkreset.firstpass.val('');\n unmarkreset.secondpass.val('');\n }", "title": "" }, { "docid": "6d3181e99fb6f0646bef1b65109e2245", "score": "0.72539", "text": "function limpiar (){\n $('#form-crear')[0].reset();\n $('#form-crear').validate().resetForm();\n $('#nombre_tipo').removeClass('valid');\n $('#nombre_tipo').removeClass('error');\n }", "title": "" }, { "docid": "07f1212c573f13d23e059eb43a3e0ab0", "score": "0.7247492", "text": "function resetForm1Adicionales (){\n //$('#' + id_ddl_obraAdicionales + ' option:selected').val(\"\");\n $('#' + id_ddl_adicionalAdicionales ).empty();\n $('#' + id_claveAdicionales ).val(\"\");\n $('#' + id_ddl_solicitudAdicionales ).empty();\n $('#' + id_convenioAdicionales ).val(\"\");\n $('#' + id_notasAdicionales ).val(\"\");\n $('#' + id_nombreAdicionales ).val(\"\");\n $('#' + id_tituloAdicionales ).val(\"\");\n $('#' + id_ddl_atencionAdicionales ).empty();\n $('#' + id_indirectosSuministrosAdicionales).val(0);\n $('#' + id_anticiposAdicionales ).val(100);\n $('#' + id_estimacionesAdicionales ).val(0);\n $('#' + id_tiempoEntregaAdicionales ).val(\"\");\n $('#' + id_cb_bancariosAdicionales ).prop('checked', false);\n $('#' + id_cb_fiscalesAdicionales ).prop('checked', false);\n $('#' + id_cb_ivaAdicionales ).prop('checked', false);\n $('#' + id_cb_indirectosAdicionales ).prop('checked', false);\n $('#' + id_observacionesAdicionales).val(\"\");\n flagCuantificacionAdicionales = false;\n flagDownloadAdicionales = false;\n json_modalSuministros={};\n json_modalCopeo={};\n json_modalCalculadora={};\n}", "title": "" }, { "docid": "3722b1b379b3d6d3bef27837c751d326", "score": "0.7243704", "text": "function resetItemForm(){\r\n CategoriesField.reset();\r\n // SuppliersField.reset();\r\n CostField.setValue(0);\r\n ItemsField.reset();\r\n ValidFromField.reset();\r\n ValidToField.reset();\r\n StockField.setValue(0);\r\n }", "title": "" }, { "docid": "23993167c8249006a8cc37a54f5314aa", "score": "0.7240701", "text": "function reset(cls)\n{\n let input_form = $(cls).find(\"input\"),\n f_input = $(cls).find('.f-input');\n for (let i = 0; i < input_form.length; i++)\n {\n input_form[i].value = \"\"; //menghapus input atau value\n f_input.eq(i).removeClass(\"aktif\"); //menghilangkan class aktif pada f-input, biar posisi placeholdernya berada di tengah\n }\n}", "title": "" }, { "docid": "3b32bce33fe785c94315b74a134e6158", "score": "0.7235174", "text": "function resetForm( form ) {\n\n switch( form.$name ) {\n case 'lookupAddressForm':\n $scope.lookupAddressObj = { results: [] };\n $scope.showButton = '';\n //$scope.autocomplete = '';\n break;\n case 'lookupOwnerForm':\n $scope.lookupOwnerObj = { results: [] };\n $scope.showButton = '';\n break;\n case 'lookupAPNForm':\n $scope.lookupAPNObj = { results: [] };\n $scope.showButton = '';\n break;\n }\n\n //resets form validation and interaction state\n form.$setPristine();\n form.$setUntouched();\n }", "title": "" }, { "docid": "0c71bae6a191c29b86c4706727bcb6ab", "score": "0.72351366", "text": "function formReset() {\n document.getElementById('form').reset();\n}", "title": "" }, { "docid": "3b184b0a3534ffaed28cc069d97f04cd", "score": "0.72319466", "text": "function resetFields(){\n \t$(\".form-control\").val(\"\");\n }", "title": "" }, { "docid": "109f1884b08a6a87ddbee6d395a56818", "score": "0.7230801", "text": "function limpia_formulario_modificacion(){\n\t$('#mod_pais').val(\"\");\n\t$('#mod_departamento').val(\"\");\n\t$('#mod_municipio').val(\"\");\n}", "title": "" }, { "docid": "4276f394c7546dddb07d1cb1ae032b47", "score": "0.7224811", "text": "function reset()\n{\n document.getElementById(\"search\").value=\"\";\n document.getElementById(\"product_id\").value=\"\";\n document.getElementById(\"consultant_id\").value=\"\";\n document.getElementById(\"customization\").value=\"\";\n}", "title": "" }, { "docid": "d7236913f14b55896c0e9aa612512c53", "score": "0.72135603", "text": "function ResetForm() {\n $scope.editData = {\n ProgrammeName: \"\", Venue: \"\", GuestName: \"\", ExpenseAmount: \"\", SocialWelExpDate: \"\", Time: \"\", Attachment: \"\"\n };\n\n $scope.editData.SocialWelExpDate = $filter('date')(new Date(), 'dd-MM-yyyy');\n $scope.socialWelExpDate = $scope.StringToDateString($scope.editData.SocialWelExpDate);\n $scope.fileName = \"\";\n // $scope.socialWelExpDate = \"\";\n $scope.SocialWelExpform.$setPristine();\n $scope.isFirstFocus = false;\n $timeout(function () {\n $scope.isFirstFocus = true;\n });\n }", "title": "" }, { "docid": "9fab5ceb186795393941d49c30746c1c", "score": "0.7205745", "text": "function resetForm() {\n totalRoomCostField.innerHTML = \" \";\n discountField.innerHTML = \" \";\n taxField.innerHTML = \" \";\n totalCostField.innerHTML = \" \";\n inclusiveDateField.innerHTML = \" \";\n errorMsgIdField.innerHTML = \" \";\n }", "title": "" }, { "docid": "e698bb4fd611581d0ee537d79c8d1fd2", "score": "0.7197495", "text": "function resetFields() {\n inputEmail.current.value = \"\";\n inputFirstName.current.value = \"\";\n inputLastName.current.value = \"\";\n inputPhone.current.value = \"\";\n inputQuestion.current.value = \"\";\n }", "title": "" }, { "docid": "69bf897a7254042c0b6ef1d067c0fa60", "score": "0.71869755", "text": "function kosongkan(){\n $('#idformTB').val('');\n $('#keteranganTB').val('');\n }", "title": "" }, { "docid": "3864a5aed5ff8bb42f6991e86ee52f5f", "score": "0.7183664", "text": "function onClickReset() {\r\n cleanInputs();\r\n resetFieldsUi();\r\n}", "title": "" }, { "docid": "b9b617c494e165c9bd653c7fed755969", "score": "0.7181793", "text": "function resetImportForm(){\n // Reset previously selected values for next import\n resetInputPaths({label: true, runs: true})\n resetImportValidation({analType: true, label: true, runs: true});\n\n $(\"#analType\").val('');\n $('input:radio[name=dataFormat]')[0].checked = true;\n $('input:radio[name=delimiterOption]')[0].checked = true;\n}", "title": "" }, { "docid": "a124ab314f541feccf2f2b2bb9ef4db1", "score": "0.718173", "text": "function resetForm() {\n\n $(\"#planetName\").val(\"\");\n\n $(\"#planetOrdinality\").val(\"\");\n\n $(\"#planetDistance\").val(\"\");\n\n $(\"#planetSize\").val(\"\");\n\n $(\"#planetDescription\").val(\"\");\n\n $(\"#id\").val(\"\");\n\n}", "title": "" }, { "docid": "5215281e8949d9604784ebe32054fe98", "score": "0.71813416", "text": "function reset_form() {\n form_obj.parsley().reset();\n form_obj[0].reset();\n $(\".item_detail_section\").html(\"\");\n}", "title": "" }, { "docid": "f930485661e8f1f0428fce5fdaace19a", "score": "0.71786386", "text": "function reset_productos(){\n$('.clase_productos').empty();\n$('#contador').val(1); \n}", "title": "" }, { "docid": "bb6ca9a4fa0e8f9d7ef8e2462fadc0ce", "score": "0.7176175", "text": "function resetEditItemForm(){\r\n ECategoriesField.reset();\r\n // SuppliersField.reset();\r\n ECostField.setValue(0);\r\n EItemsField.reset();\r\n EValidFromField.reset();\r\n EValidToField.reset();\r\n EStockField.setValue(0);\r\n }", "title": "" }, { "docid": "087d501fb67d710b1f118f0694cb83ac", "score": "0.7162399", "text": "resetForm() {\n //extract values from form and set them to default\n let nodes = this.refs.formBody.childNodes[0].childNodes;\n nodes[0].childNodes[1].value = \"\";\n nodes[1].childNodes[1].value = \"\";\n nodes[2].childNodes[1].value = \"driving\";\n //hide instructions div\n let instructdiv = document.getElementById(\"instructions-div\").classList;\n instructdiv.remove(\"instructions-visible\");\n instructdiv.add(\"instructions-hidden\");\n $(\"ul#dest-ul\").addClass(\"hide-sug-ul\");\n $(\"ul#source-ul\").addClass(\"hide-sug-ul\");\n if(this.state.markerA) {\n this.removeMapLayers();\n }\n }", "title": "" }, { "docid": "2eadfde4e920e2ead8a9f9e5fd5d9770", "score": "0.71619385", "text": "function MyFormReset(){\n document.getElementById('MyForm').reset();\n}", "title": "" }, { "docid": "6d9e0f800fc9f60922ee3754c9a1ff33", "score": "0.7160684", "text": "function resetForm() {\n document.getElementById(\"uname\").value = \"\";\n document.getElementById(\"pwd\").value = \"\";\n}", "title": "" }, { "docid": "8085d9c6d6bbae3443a5854ec298ed99", "score": "0.7152805", "text": "function formReset(){\n $(\"#user_form\")[0].reset();\n}", "title": "" }, { "docid": "0a59233d8f31c6fc5905c5ee1a8a8b09", "score": "0.71515524", "text": "function setResetAcomuladores(){\n\n frmInicial.btn0.text = \"0\";\n frmInicial.btn1.text = \"1\";\n frmInicial.btn2.text = \"2\";\n\n\n}", "title": "" }, { "docid": "480780371052a409293dc9a970859edf", "score": "0.71470493", "text": "function borraCampos($scope) {\n\tdocument.getElementById(\"createForm\").reset();\n}", "title": "" }, { "docid": "df9fea04cd95232df172d5383b62ce5a", "score": "0.714472", "text": "function resetChoiceForm() {\n choiceIdInput.val('');\n choiceLabelSelectList.val('');\n choiceContentEditor.tinymce().setContent('');\n choiceAnswerCheckbox.bootstrapSwitch('state', false);\n }", "title": "" }, { "docid": "a878d69a00a7b730369dd38d51d9a1e5", "score": "0.71388596", "text": "function resetForm() {\n document.getElementById(\"item\").value = \"\";\n document.getElementById(\"price\").value = \"\";\n document.getElementById(\"category\").value = \"\";\n document.getElementById(\"image\").value = \"\";\n document.getElementById(\"comment\").value = \"\";\n}", "title": "" }, { "docid": "9dfb3d4c3a8057f14109ba96a5acc66a", "score": "0.7138758", "text": "function reset() {\n\t\n \t//dropdown.options.selectedIndex = 0;\n\tdocument.getElementById(\"pace_hrs\").value = \"\";\n\tdocument.getElementById(\"pace_min\").value = \"\";\n\tdocument.getElementById(\"pace_sec\").value = \"\";\n\tform.elements[\"distance\"].value = \"\";\n\tform.elements[\"hrs\"].value = \"\";\n\tform.elements[\"min\"].value = \"\";\n\tform.elements[\"sec\"].value = \"\";\n}", "title": "" }, { "docid": "037c99bcc203393ae2600e22945cbbad", "score": "0.7134946", "text": "function resetForm(){\n\t\tdocument.getElementById(\"addGameForm\").reset();\n }", "title": "" }, { "docid": "66927976f0cbefa49319c9157f21a8e0", "score": "0.7128349", "text": "resetForm() {\n var contact_name = document.getElementById('contact_name')\n var contact_email = document.getElementById('contact_email')\n var contact_subject = document.getElementById('contact_subject')\n var contact_message = document.getElementById('contact_message')\n\n \n contact_name.setAttribute('value', '')\n contact_email.setAttribute('value', '')\n contact_subject.setAttribute('value', '')\n contact_message.setAttribute('value', '')\n\n const form = document.getElementById('contactFormId')\n form.reset()\n }", "title": "" }, { "docid": "8a83decfb8a00d8a4a54603314e8e207", "score": "0.7123147", "text": "static resetSaisie() {\n window.saisie.value = '';\n }", "title": "" }, { "docid": "7288e958f776e61255fe540a42874324", "score": "0.71194124", "text": "function resetForm(sl) {\n document.querySelector(sl).reset();\n}", "title": "" }, { "docid": "ba4274234a677d1802f9d50c10279393", "score": "0.7118588", "text": "function resetFields() {\n $('#oldPin').val('');\n $('#modalOldPin').val('');\n $('#modalNewPin').val('');\n }", "title": "" }, { "docid": "7407494e5a40e20aea917d38c3d5b762", "score": "0.711532", "text": "function resetFormFields() {\n $(\"#username\").val(\"\");\n $(\"#emailId\").val(\"\");\n $(\"#phoneno\").val(\"\");\n $(\"#website\").val(\"\");\n }", "title": "" }, { "docid": "02e1ea8812040eecfcce69f7fab899b5", "score": "0.7106705", "text": "function resetForm(form){\n\t\n\t//get id of the form\n\tvar id = form.attr('id');\n\t\n\t//reset the form\n\tdocument.getElementById(id).reset();\n}", "title": "" }, { "docid": "30bcd94dc8745665c90c52f9a207a161", "score": "0.7093082", "text": "function clearForm() {\n form.reset();\n }", "title": "" }, { "docid": "179c2d9c557fff1af0b9e0eff89fbbc9", "score": "0.70860475", "text": "function frmreset() {\r\n var div = document.getElementById('form');\r\n div.style.display = 'none';\r\n document.getElementById('type').value = '';\r\n\tdocument.getElementById('text').style.display = 'none';\r\n\tdocument.getElementById('password').style.display = 'none';\r\n\tdocument.getElementById('textarea').style.display = 'none';\r\n document.getElementById('dropdown').style.display = 'none';\r\n document.getElementById('radio').style.display = 'none';\r\n document.getElementById('checkbox').style.display = 'none';\r\n\tdocument.getElementById('fieldTextLabel').value = '';\r\n\tdocument.getElementById('fieldTextMaxLength').value = '';\r\n\tdocument.getElementById('fieldPasswordLabel').value = '';\r\n\tdocument.getElementById('fieldTextAreaLabel').value = '';\r\n\tdocument.getElementById('fieldTextAreaMaxLength').value = '';\r\n\tdocument.getElementById('fieldTextAreaCols').value = '';\r\n\tdocument.getElementById('fieldTextAreaRows').value = '';\r\n document.getElementById('fieldDropDownLabel').value = '';\r\n document.getElementById('fieldDropDownone').value='';\r\n document.getElementById('fieldDropDowntwo').value='';\r\n document.getElementById('fieldRadioLabel').value='';\r\n document.getElementById('fieldRadioone').value='';\r\n document.getElementById('fieldCheckLabel').value='';\r\n document.getElementById('fieldCheckone').value='';\r\n}", "title": "" }, { "docid": "9c42000d39de1c3eb1535857cd1151d4", "score": "0.70844394", "text": "function resetForm() {\n titleInput.value = \"\";\n authorInput.value = \"\";\n pagesInput.value = \"\";\n finishedInput.checked = false;\n popUpTitle.textContent = \"New Book\";\n editMode = false;\n}", "title": "" }, { "docid": "8faca6b2ff1d72d92c858e1526058918", "score": "0.70843416", "text": "reset(formName) {\n this.handleReset(formName);\n }", "title": "" }, { "docid": "a7872e098be5ab07adb4bf298b13888d", "score": "0.7084254", "text": "function resetReceptionistForm() {\n document.getElementById(\"first_name_receptionist\").value = \"\";\n document.getElementById(\"last_name_receptionist\").value = \"\";\n document.getElementById(\"male_radio_button2\").checked = true;\n document.getElementById(\"emp_email_receptionist\").value = \"\";\n document.getElementById(\"emp_phone_receptionist\").value = \"\";\n document.getElementById(\"emp_address_receptionist\").value = \"\";\n}", "title": "" } ]
9f6bfe83cfbca89ad49a158168d2cc3c
current switching index getter
[ { "docid": "a5b20025e2e54f9bf36d8d9f1844f78b", "score": "0.0", "text": "index (prm) {\n try { return this.member('index', 'number', prm, 0); } catch (e) {\n console.error(e.stack);\n throw e;\n }\n }", "title": "" } ]
[ { "docid": "8fc6fdd5ff5608720543d4f9fa16b3a9", "score": "0.76079756", "text": "get index() {\n return this._indexOf(this._current);\n }", "title": "" }, { "docid": "66e09a78c7d008f365791239c5b19e46", "score": "0.73355", "text": "getIndex() { return this.index_; }", "title": "" }, { "docid": "f087f83d6da7e458c6f4a83083765355", "score": "0.73261255", "text": "getActiveIndex() {\n return this.state.activeIdx;\n }", "title": "" }, { "docid": "69a924da4d64990b3e9407b215f648b4", "score": "0.7263827", "text": "getCurrentIndex() {\n return this.currentIndex;\n }", "title": "" }, { "docid": "b5db580147f216d8fd888fa8683f34fd", "score": "0.71778065", "text": "getIndex() {\n return this.state.index;\n }", "title": "" }, { "docid": "98625daae93320bb365a9d0a7f767a6c", "score": "0.7145968", "text": "function getIndex() {\n return internal.index;\n }", "title": "" }, { "docid": "0b5c718ea0c5359fd7b28c5ec391152f", "score": "0.7101307", "text": "function getIndex() {\n return index;\n }", "title": "" }, { "docid": "468179f6127e014818bcc1a4c8b911e8", "score": "0.697329", "text": "async getActiveIndex() {\n const swiper = await this.getSwiper();\n return swiper.activeIndex;\n }", "title": "" }, { "docid": "438abcd156630e96d6349d6477d4b987", "score": "0.69124955", "text": "function getCurrentIndex() {\n return Math.floor(freq(1, 1) * STATE.participants.length);\n}", "title": "" }, { "docid": "ec6e3f7b45e787afdd5d8443616d129b", "score": "0.6884795", "text": "index() {\n\t\treturn this.#index;\n\t}", "title": "" }, { "docid": "d12dfd63d5ba1cdf09ac7866f684c0ce", "score": "0.6849561", "text": "getIndex() {\n return this.index;\n }", "title": "" }, { "docid": "2e5a423e0bd86d0809fee9881634ac50", "score": "0.68245214", "text": "get index() {\r\n return this.i.index;\r\n }", "title": "" }, { "docid": "46683ac973a7cd937604273bfca5fd83", "score": "0.6810595", "text": "_getIndex() {}", "title": "" }, { "docid": "309ded04bce52ace5a08301304e86911", "score": "0.67999506", "text": "function getIntervalIndex(){\n return currentIntervalIndex;\n}", "title": "" }, { "docid": "732e7270fd3f41e8ded030bdc0b503fd", "score": "0.6761135", "text": "function returnIndex() {\n\t return index;\n\t }", "title": "" }, { "docid": "95828ba0d0547b33d0cae8fae056a4e9", "score": "0.6642292", "text": "get currentIndex() {\n return this._currentIndex;\n }", "title": "" }, { "docid": "5813be66ef0024c15a735ca77cc1755a", "score": "0.65665513", "text": "get current() {\n return Controller.list[Controller.index];\n }", "title": "" }, { "docid": "5813be66ef0024c15a735ca77cc1755a", "score": "0.65665513", "text": "get current() {\n return Controller.list[Controller.index];\n }", "title": "" }, { "docid": "b2242d7425735140113599e9dbbfe76e", "score": "0.65190136", "text": "get index() {\r\n return this._index;\r\n }", "title": "" }, { "docid": "6d2713fdaf4b3754807254d6dccfe068", "score": "0.64345205", "text": "get index() {\n return this._index;\n }", "title": "" }, { "docid": "9fc972f15ea19197a53c86a547b0f4ec", "score": "0.63747054", "text": "get currentIndex() {\n return this.__Internal__Dont__Modify__.currentAnimation;\n }", "title": "" }, { "docid": "cb394222305ad78e4f25da08edd23980", "score": "0.6358394", "text": "get STATE_IDX() { return 0; }", "title": "" }, { "docid": "d6affea444a3d74ce1a87f81bcb6ba54", "score": "0.6349374", "text": "getInitialIndex () {\n if (!this.isManual) {\n return this.defaultIndex || 0\n } else {\n return this.index || this.defaultIndex || 0\n }\n }", "title": "" }, { "docid": "3b76a59d63f847c6839663455140039f", "score": "0.6336855", "text": "get index() {\n return this._index\n }", "title": "" }, { "docid": "de241dda09cfa77e3f17530d69aeee89", "score": "0.6250839", "text": "trackByFn(index) {\n return index;\n }", "title": "" }, { "docid": "d7b6b1107afff5a33e48a4fd31dd4780", "score": "0.6247069", "text": "function getUpdatedIndex(current, max, action) {\n switch (action) {\n case MenuActions.First:\n return 0;\n case MenuActions.Last:\n return max;\n case MenuActions.Previous:\n return Math.max(0, current - 1);\n case MenuActions.Next:\n return Math.min(max, current + 1);\n default:\n return current;}\n\n}", "title": "" }, { "docid": "8cd6bd28f3589b32015b14ac12d0ada3", "score": "0.62166387", "text": "get defaultIndex() {\n return this._defaultIndex;\n }", "title": "" }, { "docid": "0e68689c84b55d92616d58ff55f3af18", "score": "0.6213667", "text": "index () {\n return this.next()\n }", "title": "" }, { "docid": "abf5661e9a02fa1c5006b8b1d236d2e9", "score": "0.6189216", "text": "function getOldIdx(i){\n\treturn i === 0 ? quest - 1 : i - 1\n}", "title": "" }, { "docid": "c0235b188a20282de0a4724cceb319bd", "score": "0.61870676", "text": "updateIndex() {\n return this.index;\n }", "title": "" }, { "docid": "59c1b31e1b4b7a4b53f8a59078a8c196", "score": "0.61830366", "text": "function stateToIdx(state) {\n let idx = 1; // default\n switch(state) {\n case states.WP1_MODE:\n idx = 1;\n break;\n case states.WP2_MODE:\n idx = 2;\n break; \n case states.RUIN_MODE:\n idx = 3;\n break; \n default:\n idx = 1; \n }\n return idx;\n}", "title": "" }, { "docid": "b2303f2c19de23cbd12e38778aa4cdb6", "score": "0.61385983", "text": "function getCurrentIndex() {\n var index = -1;\n for (var i=0, l=EthosJS.Config.windowSizeEvents.length; i<l; i++) {\n if (innerWidth > EthosJS.Config.windowSizeEvents[i]) {\n index = i;\n } else {\n break;\n }\n }\n if (index === EthosJS.Config.windowSizeEvents.length - 1) {\n range[0] = EthosJS.Config.windowSizeEvents[index];\n range[1] = Number.MAX_SAFE_INTEGER;\n } else if (index === -1) {\n range[0] = 0;\n range[1] = EthosJS.Config.windowSizeEvents[0];\n } else {\n range[0] = EthosJS.Config.windowSizeEvents[index];\n range[1] = EthosJS.Config.windowSizeEvents[index + 1];\n }\n }", "title": "" }, { "docid": "da42ffe845ea48e8e698cb27613344db", "score": "0.6136838", "text": "function returnIndex() {\n return index - options.infinite || 0;\n }", "title": "" }, { "docid": "49dc755feb9cd7cccc019540a9910b9e", "score": "0.6125198", "text": "function ratscrew_currentPlayerIndex() {\n return game.getCurrentState().globalStates.currentPlayer;\n}", "title": "" }, { "docid": "d3d57d80da09358123af8d1d643a0fcb", "score": "0.61200464", "text": "get defaultIndex()\r\n\t{\r\n\t\treturn this._defaultIndex;\r\n\t}", "title": "" }, { "docid": "c08d665dd4e29f664f84b79e85540cb9", "score": "0.607932", "text": "function _getIndex() {\n var children = self.parentNode.querySelectorAll('tab-nav-item');\n \n for(var i = children.length; i > 0; i--){\n if(children[i-1] === self){\n return i;\n }\n };\n \n return 0;\n }", "title": "" }, { "docid": "4896ec6cba1a01ebf7fb47fa124f5141", "score": "0.6066876", "text": "get index() {\n return this.caps[0];\n }", "title": "" }, { "docid": "961451eb889a8afdb5f113c5548fcb25", "score": "0.6046531", "text": "get(index) {\n }", "title": "" }, { "docid": "8216164447ebe5ead65240c47abf5c65", "score": "0.6042277", "text": "currentPos() {\n return this.n;\n }", "title": "" }, { "docid": "4c9f8cdf8400f47a535ddcdd0d7b8a80", "score": "0.60104406", "text": "handleCurrent(e, index) {\n this.setState({stepIndex: index});\n }", "title": "" }, { "docid": "8049f5ca97854896f4ecab12981bb817", "score": "0.60101944", "text": "function indexValue(item) {\n return item.index;\n }", "title": "" }, { "docid": "edd340643a7e9367cb9ad14220137ec7", "score": "0.6001333", "text": "get defaultIndex() {\n return this._defaultIndex;\n }", "title": "" }, { "docid": "61087fb37f85329732cc036d152afde1", "score": "0.59978485", "text": "previousIndex(currentIndex) {\n return this.adjustIndex(currentIndex - 1);\n }", "title": "" }, { "docid": "3193d5243ec7c510bf217d9b9677552c", "score": "0.59934086", "text": "getActiveSlideIndex() {\n return this.index;\n }", "title": "" }, { "docid": "6b3edafaaeb3be13649a63da957bcf41", "score": "0.59794384", "text": "getindex(mouse) {\r\n return 8 * this.getrow(mouse) + this.getcol(mouse);\r\n }", "title": "" }, { "docid": "8d91f216804e5aed9f1f1a83d13b092f", "score": "0.5962689", "text": "getCurrentState() {\n return getCurrentState(this.content.getSelectedIndexes());\n }", "title": "" }, { "docid": "e229931c33141c80979e760b1b3798de", "score": "0.59557825", "text": "function getIndex(increment) {\n var\n max = $related.length,\n newIndex = (index + increment) % max;\n \n return (newIndex < 0) ? max + newIndex : newIndex;\n }", "title": "" }, { "docid": "53b181e154c5654c10eb430d379697c6", "score": "0.59522355", "text": "getSubToAccIdx() { return 'accIdx'; }", "title": "" }, { "docid": "c402846b5972e20af170569126a9d68c", "score": "0.5943007", "text": "function getIndexMode() {\n return internal.indexMode;\n }", "title": "" }, { "docid": "316aee3e55117d4abb6fd975aff817a2", "score": "0.5936309", "text": "handleChangeCurrentIndex(kind, index) {\n if(kind === \"trip\") {\n this.setState({\n currentTripIndex: index,\n currentDateIndex: 0,\n });\n } else if(kind === \"date\") {\n this.setState({\n currentDateIndex: index\n });\n } else {\n console.error(\"Invalid JournalEditor index!\");\n this.setState({\n currentTripIndex: 0,\n currentDateIndex: 0,\n })\n }\n }", "title": "" }, { "docid": "4bb71c2f968903ba0e54bde4e0392bc4", "score": "0.59345907", "text": "getDataIndexValue(target){\n var spanIndex;\n var spanElement = this.getSpanElement(target);\n if(spanElement)\n {\n spanIndex = spanElement.getAttribute('data-index');\n spanIndex = spanIndex ? parseInt(spanIndex) : spanIndex;\n }\n return spanIndex;\n }", "title": "" }, { "docid": "0b47cfe0c3c1b92ce7e1dc98e20fbfeb", "score": "0.5927196", "text": "async getPreviousIndex() {\n const swiper = await this.getSwiper();\n return swiper.previousIndex;\n }", "title": "" }, { "docid": "93550bdb931c0fec0268d818a135f758", "score": "0.59225416", "text": "siftDown(index) { \n return index;\n //console.log(index);\n }", "title": "" }, { "docid": "38f81e857e86d58d9d327897ad9a9cd5", "score": "0.5912134", "text": "winningIndex(index) {\n return (index + 1) % 3;\n }", "title": "" }, { "docid": "38f81e857e86d58d9d327897ad9a9cd5", "score": "0.5912134", "text": "winningIndex(index) {\n return (index + 1) % 3;\n }", "title": "" }, { "docid": "0a4457c3fafca612f93982aa01f60e63", "score": "0.58843255", "text": "function getIndex(currentIndex, array){\n\t// what to move or jump index by\n\tlet jumpBy = array[currentIndex]\n\t\n\t// because of a number can be larger than the array length we mod by array length to\n\t// get the remainder to move current index to\n\tlet nextIndex = (currentIndex + jumpBy) % array.length\n\t\n\tif(nextIndex >= 0){\n\t\treturn nextIndex\n\t} else {\n // this is if the current index is a negative number\n // by ading the length of array to the negative number it makes a wrap backwards\n\t\treturn nextIndex + array.length\n\t}\n}", "title": "" }, { "docid": "c9a15bfb5b883da7abcb9e0df6d83a68", "score": "0.58828175", "text": "function F_index () {\n\treturn mission_Index;\n}", "title": "" }, { "docid": "dbb38d5ddd987dbe36deb7bcf15a5633", "score": "0.5872292", "text": "get selectedOutputIndex() { return String(this.props.output.outputIndex)}", "title": "" }, { "docid": "d2eb09974f2c42fb0ba5fe9d8ee80105", "score": "0.5869041", "text": "function findCurrentIndex(inputKey) {\n var tempIndex;\n (mainDiagram.model.nodeDataArray).forEach(function (obj, index) {\n if (obj.key === inputKey)\n tempIndex = index\n });\n return tempIndex;\n\n}", "title": "" }, { "docid": "510deaf39cc4468853df1fc828e386ad", "score": "0.5855764", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\t\t\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "510deaf39cc4468853df1fc828e386ad", "score": "0.5855764", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\t\t\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "646b0b74104c5e813ab14f8accbd3b99", "score": "0.5854538", "text": "previous_option_index()\n\t{\n\t\tconst { options, value } = this.props\n\n\t\tlet i = 0\n\t\twhile (i < options.length)\n\t\t{\n\t\t\tif (options[i].value === value)\n\t\t\t{\n\t\t\t\tif (i - 1 >= 0)\n\t\t\t\t{\n\t\t\t\t\treturn i - 1\n\t\t\t\t}\n\t\t\t}\n\t\t\ti++\n\t\t}\n\t}", "title": "" }, { "docid": "8a23bee6491b0253e3dea66a8d21f16c", "score": "0.58477396", "text": "get index() {\r\n return this.p;\r\n }", "title": "" }, { "docid": "8a23bee6491b0253e3dea66a8d21f16c", "score": "0.58477396", "text": "get index() {\r\n return this.p;\r\n }", "title": "" }, { "docid": "f7ec26eaaa7ecbcada7c92c62014a11c", "score": "0.584063", "text": "function getIndex(increment) {\r\n\t\tvar\r\n\t\tmax = $related.length,\r\n\t\tnewIndex = (index + increment) % max;\r\n\r\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\r\n\t}", "title": "" }, { "docid": "f7ec26eaaa7ecbcada7c92c62014a11c", "score": "0.584063", "text": "function getIndex(increment) {\r\n\t\tvar\r\n\t\tmax = $related.length,\r\n\t\tnewIndex = (index + increment) % max;\r\n\r\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\r\n\t}", "title": "" }, { "docid": "d7d906aee07a45b0b5fe5c3664e2da11", "score": "0.5828766", "text": "function getIndex(element, index) { return index; }", "title": "" }, { "docid": "1895b9927f70ac7a106ebf75eb2c4b81", "score": "0.5827621", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "1895b9927f70ac7a106ebf75eb2c4b81", "score": "0.5827621", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "1895b9927f70ac7a106ebf75eb2c4b81", "score": "0.5827621", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "1895b9927f70ac7a106ebf75eb2c4b81", "score": "0.5827621", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "1895b9927f70ac7a106ebf75eb2c4b81", "score": "0.5827621", "text": "function getIndex(increment) {\n\t\tvar\n\t\tmax = $related.length,\n\t\tnewIndex = (index + increment) % max;\n\n\t\treturn (newIndex < 0) ? max + newIndex : newIndex;\n\t}", "title": "" }, { "docid": "006833a1ee94e4ba53620acacd0a72ad", "score": "0.5825915", "text": "get() {\n return this.current;\n }", "title": "" }, { "docid": "06a9149516b572ca62ce360652daa64e", "score": "0.58209527", "text": "get current() {\n return this.getAttribute('current');\n }", "title": "" }, { "docid": "5897a9d87e67ef275a1ae968862777a8", "score": "0.5819613", "text": "getAdversary(){\n return this.players[((this.current + 2) % 2) + 1];\n }", "title": "" }, { "docid": "d4ef26bfe4c395b85d281d3865d5adf3", "score": "0.5809763", "text": "transition(switches) {\n\t\treturn StateKeys[this.key];\n\t}", "title": "" }, { "docid": "b9c27c78fa32673ffefede2b4f36542e", "score": "0.5802892", "text": "_prev(){const currentIndex=this._getCurrentIndex();const prev=this._getPrev(currentIndex);if(prev){this._flipTo(prev,currentIndex-1);}}", "title": "" }, { "docid": "d0889efd5a1ade10dc165fdf0303d2ab", "score": "0.58025694", "text": "get current() {\n return this._current;\n }", "title": "" }, { "docid": "d0889efd5a1ade10dc165fdf0303d2ab", "score": "0.58025694", "text": "get current() {\n return this._current;\n }", "title": "" }, { "docid": "1985dc7970a122b8ed890e99b6080bac", "score": "0.5795813", "text": "function findIndex(dataInd) {\n return $(dataInd).attr(\"data-index\");\n }", "title": "" }, { "docid": "c0a0b55af04e9aedb2278b36ec318fcc", "score": "0.5788307", "text": "getCurrent() {\n return this.history.slice(this.index.start, this.index.end);\n }", "title": "" }, { "docid": "3330a7caf7b5dbdeb046adbdd8b34d64", "score": "0.5759443", "text": "getCurrentValue(index) {\n if (index == null || index === '') {\n index = this.rawDefault;\n } else {\n index -= 1;\n }\n\n var choice = this.opt.choices.getChoice(index);\n return choice ? choice.value : null;\n }", "title": "" }, { "docid": "3330a7caf7b5dbdeb046adbdd8b34d64", "score": "0.5759443", "text": "getCurrentValue(index) {\n if (index == null || index === '') {\n index = this.rawDefault;\n } else {\n index -= 1;\n }\n\n var choice = this.opt.choices.getChoice(index);\n return choice ? choice.value : null;\n }", "title": "" }, { "docid": "50864d0f92f1ea7a85d6902068f8ed3d", "score": "0.5755583", "text": "current(){\n\t// use as a refrence point for next and prevoius\n }", "title": "" }, { "docid": "f307431500e753393f54b123c455d96d", "score": "0.5752703", "text": "function getIndex(element){\n let index = element.attributes['data-index'].value;\n return parseInt(index);\n }", "title": "" }, { "docid": "23536cf40f49dd746752d64b193b9857", "score": "0.5732843", "text": "get index() {\n return this.group.indexOf(this);\n }", "title": "" }, { "docid": "6aa26dd1fd648d9be423374489836fb5", "score": "0.57320136", "text": "whichBoat(i){\n let position=-1;\n for(let cpt=0;cpt<2;cpt++){\n if(this.state.tabBateau[cpt] === 1){\n position = cpt\n }\n }\n console.log(\"position = \" + position);\n return position;\n }", "title": "" }, { "docid": "bb41ee13569c1b42d20b28fa1c368158", "score": "0.57278585", "text": "get index() {\n return this.p;\n }", "title": "" }, { "docid": "86ba9409f492e4a8bbc86aa8e49100af", "score": "0.5726712", "text": "slideCurrentIndex (direction){\n if (direction === 'right'){\n this.currentSlide++;\n }\n\n if (direction === 'left'){\n this.currentSlide--;\n }\n }", "title": "" }, { "docid": "b944fc87d3e04f47d19bbd4a18d624a2", "score": "0.57181394", "text": "function getRequestCounterWaypoint(index) {\n return requestCounterWaypoints[index];\n }", "title": "" }, { "docid": "0254a0b425c87f515ae687b2eaf2cf85", "score": "0.5711849", "text": "static get current() {}", "title": "" }, { "docid": "742a547bd4db799d038176942bdec1ee", "score": "0.5705558", "text": "prevQuestion(){\r\n let newInd = this.state.prevIndex;\r\nthis.setState({index:newInd})\r\n}", "title": "" }, { "docid": "5570f4ddf95c337cc9abdad45edc588a", "score": "0.5688758", "text": "switchLyricIndex(state, index) {\n\t\t\t\t\tstate.songState.currentLyricIndex = index;\n\t\t\t\t}", "title": "" }, { "docid": "d759617da0c208b108adac88e52a6308", "score": "0.5686433", "text": "getApproachTransitionIndex() {\n const currentFlightPlan = this._flightPlans[this._currentFlightPlanIndex];\n return currentFlightPlan.procedureDetails.approachTransitionIndex;\n }", "title": "" }, { "docid": "4e60e599973bd479ead2e92e148fff95", "score": "0.5684676", "text": "parentOf(index) {\n return Math.floor((index - 1) / 2);\n }", "title": "" }, { "docid": "1a253c73473a0c9c1d63dc327fdd7520", "score": "0.56828094", "text": "function findCurrentIndex() {\n var current = $('h1')[0];\n var index = 0;\n for (var count = 0; count < slides.length; count++) {\n if (slides[count].title === current.innerHTML) {\n index = count;\n break;\n }\n }\n\n return index;\n }", "title": "" }, { "docid": "dac7adc2981ff8c550da2268f72f2a51", "score": "0.56797683", "text": "nextIndex(currentIndex) {\n return this.adjustIndex(currentIndex + 1);\n }", "title": "" }, { "docid": "fdf568d0aeaac1a5c54fdec573abd435", "score": "0.56681657", "text": "get current() {\n\t\treturn this._current\n\t}", "title": "" }, { "docid": "2b3b108c391d70b0c949c539c329ebf5", "score": "0.56631047", "text": "parent(index) {\n return Math.floor(index / 2);\n }", "title": "" }, { "docid": "2ae9dca3c7083496526dcc605b722d4f", "score": "0.5662892", "text": "getCurrent() {\n if (this.index < 0 || this.index >= this.graph.length) {\n return null;\n }\n //console.log(this.graph[this.index]);\n return this.graph[this.index];\n }", "title": "" }, { "docid": "05187f77192cbc691e5b8198a32fe44f", "score": "0.56593156", "text": "getTeammateIndex(playerIndex) {\n return (playerIndex + 2) % 4;\n }", "title": "" } ]
72a08b08af9a3338ea93850a398a8c40
For example, "undefined" or "of type array"
[ { "docid": "d536922cdd14c9f8f22503d96c51cf27", "score": "0.0", "text": "function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n\n default:\n return type;\n }\n } // Returns class name of the object, if any.", "title": "" } ]
[ { "docid": "c3e17a8557c70f0b006517d0d31152f8", "score": "0.6669657", "text": "function typeStr(obj) {\n return isArray(obj) ? 'array' : typeof obj === 'undefined' ? 'undefined' : _typeof(obj);\n }", "title": "" }, { "docid": "f4bd951dc0b4fc843df1e27e51071d8f", "score": "0.66660213", "text": "function s(e){return!(!Array.isArray(e)||!e.length)}", "title": "" }, { "docid": "a5757305b18f7c8d81b12fd44cc9abc8", "score": "0.65864795", "text": "function i(t){return Array.isArray(t)}", "title": "" }, { "docid": "a5757305b18f7c8d81b12fd44cc9abc8", "score": "0.65864795", "text": "function i(t){return Array.isArray(t)}", "title": "" }, { "docid": "36d00fb4c68f5a12c7b9409c315a07f7", "score": "0.6510059", "text": "function r(e){return\"\"!==e&&void 0!==e&&null!==e&&!(Array.isArray(e)&&0===e.length)}", "title": "" }, { "docid": "1394c5aaf6217211e237c895c52e497a", "score": "0.64705926", "text": "getType (val) {\r\n return Array.isArray(val) ? 'array' : typeof val\r\n }", "title": "" }, { "docid": "e830e7e3a2e7947a0cafdbc4614e71f8", "score": "0.6468092", "text": "function _undefinedCoerce() {\n return '';\n}", "title": "" }, { "docid": "b4fc94cf70e99fa35690ff6556acc43b", "score": "0.6437346", "text": "function n(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "title": "" }, { "docid": "b4fc94cf70e99fa35690ff6556acc43b", "score": "0.6437346", "text": "function n(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "title": "" }, { "docid": "1b4f9a16b65d160c052b2a4ebadd5162", "score": "0.6426778", "text": "function c(e){return null!=e&&\"object\"===typeof e&&!1===Array.isArray(e)}", "title": "" }, { "docid": "a488e04e71addb27b5694227b66ad07a", "score": "0.64197856", "text": "function typeOf(value) {\r\n\tvar s = typeof value;\r\n\tif (s === 'object') {\r\n\t\tif (value) {\r\n\t\t\tif (value instanceof Array) {\r\n\t\t\t\ts = 'array';\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\ts = 'null';\r\n\t\t}\r\n\t}\r\n\treturn s;\r\n}", "title": "" }, { "docid": "ed1db44d12ac7cb1b3e4f2273928a7a1", "score": "0.6416403", "text": "function n(e){return null!=e&&\"object\"==typeof e&&Array.isArray(e)===!1}", "title": "" }, { "docid": "c7a2beeded4a6eb0e5417b3aa0ee2f1d", "score": "0.638563", "text": "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "title": "" }, { "docid": "c7a2beeded4a6eb0e5417b3aa0ee2f1d", "score": "0.638563", "text": "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "title": "" }, { "docid": "c7a2beeded4a6eb0e5417b3aa0ee2f1d", "score": "0.638563", "text": "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "title": "" }, { "docid": "c7a2beeded4a6eb0e5417b3aa0ee2f1d", "score": "0.638563", "text": "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "title": "" }, { "docid": "5cc6c98347823af118b42ded707df6d6", "score": "0.63562226", "text": "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "title": "" }, { "docid": "5cc6c98347823af118b42ded707df6d6", "score": "0.63562226", "text": "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "title": "" }, { "docid": "5cc6c98347823af118b42ded707df6d6", "score": "0.63562226", "text": "function typeStr (obj) {\n\t return isArray(obj) ? 'array' : typeof obj;\n\t }", "title": "" }, { "docid": "aff465ab3edc13e2044a071c84f1f028", "score": "0.63430816", "text": "function n(t){return t&&\"object\"==typeof t&&!Array.isArray(t)}", "title": "" }, { "docid": "002ec600feeba96ade4f87325cd99bcd", "score": "0.63379467", "text": "function n(t){return t&&\"object\"===typeof t&&!Array.isArray(t)}", "title": "" }, { "docid": "3768f72aec51b080f88fc9f1683e50c9", "score": "0.6323889", "text": "function typeOf(value) {\r\n var s = typeof value;\r\n if(s === 'object') {\r\n if(value) {\r\n if(value instanceof Array) {\r\n s = 'array';\r\n }\r\n } else {\r\n s = 'null';\r\n }\r\n }\r\n return s;\r\n }", "title": "" }, { "docid": "6fbf9ce95c6e2e0ce4725dd7355ce8f0", "score": "0.6308285", "text": "function r(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}", "title": "" }, { "docid": "fb5e31fa056cf4822e84baef1f49de22", "score": "0.63037294", "text": "function u(n){return\"[object Array]\"===i.call(n)}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.6282108", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.6282108", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.6282108", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.6282108", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.6282108", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "6093613ff70ae798f9a49cbda2ae5c54", "score": "0.62712854", "text": "function r(e){return!(!Array.isArray(e)||!e.length)}", "title": "" }, { "docid": "9db6591fe6092ef3ccc85d8204163b0b", "score": "0.6269169", "text": "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "title": "" }, { "docid": "9db6591fe6092ef3ccc85d8204163b0b", "score": "0.6269169", "text": "function r(e){return e&&\"object\"==typeof e&&!Array.isArray(e)}", "title": "" }, { "docid": "51d734b11d5130e7f112aba4c3ff7485", "score": "0.62174416", "text": "function typeOf(value) {\n if (value === null) {\n return 'null';\n }\n var typeofString = typeof value === 'undefined' ? 'undefined' : _typeof(value);\n if (typeofString === 'object') {\n if (Array.isArray(value)) {\n return 'array';\n }\n }\n return typeofString;\n}", "title": "" }, { "docid": "f9585b3db70315a109737f142a5c285c", "score": "0.6212531", "text": "function typeCheck(value) {\r\n\t\tconst return_value = Object.prototype.toString.call(value);\r\n\t\t// we can also use regex to do this...\r\n\t\tconst type = return_value.substring(\r\n\t\t\t\t return_value.indexOf(\" \") + 1, \r\n\t\t\t\t return_value.indexOf(\"]\"));\r\n\t \r\n\t\treturn type.toLowerCase();\r\n\t}", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "d3a53da417b3259f48a8c85341bc422e", "score": "0.6193686", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "009c71d94d9bdf098a084f52e6615803", "score": "0.6177649", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "7ed47d51dc732cc0f9cc40b327a10bb5", "score": "0.614638", "text": "function b(a){return Array.isArray?Array.isArray(a):\"[object Array]\"===q(a)}", "title": "" }, { "docid": "7e2cae89b5597634e857af61e7490253", "score": "0.61309624", "text": "function typeStr(obj) {\n\t\treturn isArray(obj) ? 'array' : typeof obj;\n\t}", "title": "" }, { "docid": "fc967f17ef324844591a5abaecfe6146", "score": "0.61238813", "text": "function W(t) {\n return !!t && \"arrayValue\" in t;\n}", "title": "" }, { "docid": "6e841291434f1a8fa727b9ec20330f9a", "score": "0.6103079", "text": "function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }", "title": "" }, { "docid": "b8a94ee84f42c6be54a3ce63a2429be9", "score": "0.6091187", "text": "function typeOf(value) {\n var s = typeof value;\n \n if (s === 'object') {\n if (value) {\n if (typeof value.length === 'number' &&\n !(value.propertyIsEnumerable('length')) &&\n typeof value.splice === 'function') {\n s = 'array';\n }\n } else {\n s = 'null';\n }\n }\n \n return s;\n}", "title": "" }, { "docid": "202a6eb9fe450a8a42f8f69a111cbda4", "score": "0.60903704", "text": "function r(t){return Array.isArray(t)}", "title": "" }, { "docid": "a6817cfa3b4377177a053a7b1448aa4e", "score": "0.6089846", "text": "function n(a) { return !!a && \"undefined\" != typeof a.text }", "title": "" }, { "docid": "b3ff89e1e9872b0c7b3ab7195946785c", "score": "0.60867846", "text": "function fr(e){return!0===function(e){return null!=e&&\"object\"==typeof e&&!1===Array.isArray(e)}(e)&&\"[object Object]\"===Object.prototype.toString.call(e)}", "title": "" }, { "docid": "35499624f4b4df7d18c8598a4ad0decb", "score": "0.6079933", "text": "function undefinedField (field){\n\n\t\t\t\t\tvar value = String;\n\n\t\t\t \t\t\tif (field == undefined) {value =\"\";}\n\n\t\t\t \t\t\telse if (field.constructor == Array) {value = field.join(',');}\n\n\t\t\t \t\t\telse if (field.constructor == Object) {value = field;}\n\n\t\t\t \t\treturn value;\n\t\t\t \t}", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "36a11704e438954318d3060e446f8c93", "score": "0.60778797", "text": "function is(value) {\r\n var candidate = value;\r\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\r\n }", "title": "" }, { "docid": "a225bc65735ae0a7866989b49c80b024", "score": "0.6061408", "text": "_type() {\n if (Utils.isObject(val)) {\n return 'object';\n } else if (Utils.isArray(val)) {\n return 'array';\n } else {\n return 'other';\n }\n }", "title": "" }, { "docid": "dfcd49d8bb24646285d29fa54a9a0215", "score": "0.6044872", "text": "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\n }", "title": "" }, { "docid": "dfcd49d8bb24646285d29fa54a9a0215", "score": "0.6044872", "text": "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\n }", "title": "" }, { "docid": "dfcd49d8bb24646285d29fa54a9a0215", "score": "0.6044872", "text": "function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is) && (candidate.only === void 0 || Is.typedArray(candidate.only, Is.string));\n }", "title": "" }, { "docid": "ca362478592ffedbf9b8f5493caf5b7e", "score": "0.60206723", "text": "function se(t) {\n return !!t && \"arrayValue\" in t;\n}", "title": "" }, { "docid": "fe14cc74db874d3b7fdcc92af6306038", "score": "0.60007167", "text": "function type() {\n const entry = NaN;\n const whatDataType = typeof(entry);\n return console.log(\"This is a \" + whatDataType);\n}", "title": "" }, { "docid": "e611c282d000e75fc46f4a6944dcfb21", "score": "0.5999499", "text": "function z(t) {\n return !!t && \"arrayValue\" in t;\n}", "title": "" }, { "docid": "85f7e9d93e62056fbd2f3df035fb842b", "score": "0.5978937", "text": "function arrayOrNil(obj) { return (obj && typeof obj === OBJECT && typeof obj.length === NUMBER && !(obj.propertyIsEnumerable(LENGTH)) && obj) || null; }", "title": "" }, { "docid": "85f7e9d93e62056fbd2f3df035fb842b", "score": "0.5978937", "text": "function arrayOrNil(obj) { return (obj && typeof obj === OBJECT && typeof obj.length === NUMBER && !(obj.propertyIsEnumerable(LENGTH)) && obj) || null; }", "title": "" }, { "docid": "81c541e6990cd958f3b9e973f0acde0b", "score": "0.5966469", "text": "function returnUndefined() {}", "title": "" }, { "docid": "81c541e6990cd958f3b9e973f0acde0b", "score": "0.5966469", "text": "function returnUndefined() {}", "title": "" }, { "docid": "40fefa93334819acf07039f4b098cfb9", "score": "0.5958391", "text": "function arrayOrObject(collection) {\n if (!Array.isArray(collection)) {\n return 'object';\n }\n return 'array';\n}", "title": "" }, { "docid": "f0cbdd89cd7016dc4f2f7ef2957731b6", "score": "0.5956153", "text": "function y(e){var t=typeof e;return Array.isArray(e)?\"array\":e instanceof RegExp?\"object\":b(t,e)?\"symbol\":t}", "title": "" }, { "docid": "34ede7b225ec729b2582537e3964559e", "score": "0.59346354", "text": "function getType(value) {\n if (value === null) {\n return 'null';\n }\n if (Array.isArray(value)) {\n return 'array';\n }\n return typeof value;\n}", "title": "" }, { "docid": "295390e5af52172490eecb54e7950851", "score": "0.5932146", "text": "function A(t){return Array.isArray?Array.isArray(t):\"[object Array]\"===p(t)}", "title": "" }, { "docid": "ff80a72bbc7c8f1a19765876020f8fb8", "score": "0.5930223", "text": "function dataType(value) {\n if (!(value instanceof Date) && !Array.isArray(value) && !(typeof value === 'null')) {\n return typeof value\n } else if ((value instanceof Date) || (Array.isArray(value))) {\n if (value instanceof Date) {\n return 'date'\n } else if (Array.isArray(value)) {\n return 'array'\n }\n } else if (typeof value === 'null') {\n return null\n }\n}", "title": "" }, { "docid": "b7aeed59b43f0e9daada8ff821f3c4bd", "score": "0.5929032", "text": "typeCheck(untypedValue) {\n const {ifEmpty, type} = this.getProperties('ifEmpty', 'type');\n if (type === 'number') {\n return untypedValue ? Number(untypedValue) : undefined;\n }\n if (Ember.isEmpty(untypedValue) && ifEmpty) {\n switch(ifEmpty) {\n case 'null':\n return null;\n case 'undefined':\n return undefined;\n }\n }\n\n return untypedValue;\n }", "title": "" }, { "docid": "4a8cc3cf06f5245152a0d029adc667d8", "score": "0.5924298", "text": "function Tt(t) {\n return !!t && \"arrayValue\" in t;\n}", "title": "" }, { "docid": "be1e74c59fba8a0df7825df71dfe77d7", "score": "0.59192294", "text": "function checkArray(a) {\n if (Object.prototype.toString.call(a) != '[object Array]') {\n throw \"incorrect data type required: Array\";\n }\n\t}", "title": "" }, { "docid": "e281befea64d14c1b9863c4b99abc7cd", "score": "0.59004855", "text": "function arrayOrObject(collection) {\n// assert.equal(arrayOrObject({a:\"one\"}), \"object\");\n// assert.equal(arrayOrObject([1,2,{}]), \"array\");\n\n if (Array.isArray(collection)) {\n return 'array';\n }else if (collection === '{}' || typeof collection === 'object'){\n return 'object';\n \n}\n}", "title": "" }, { "docid": "13d6172a55de1638f4971d417c08e697", "score": "0.58983207", "text": "function notSettable(val, arrayOk) {\n return val===undefined || (Array.isArray(val) && !arrayOk);\n}", "title": "" }, { "docid": "6d4af915f51a7dc5448aab29055c13af", "score": "0.58897084", "text": "function lux_typeOf(value) \n{\n var s = typeof value;\n if (s === 'function' && value._lux_expression)\n return 'object'; // shade expression\n if (s === 'object') {\n if (value) {\n if (typeof value.length === 'number'\n && !(value.propertyIsEnumerable('length'))\n && typeof value.splice === 'function') { // typed array\n s = 'array';\n }\n } else {\n s = 'null';\n }\n }\n return s;\n}", "title": "" }, { "docid": "cb208c88f661188a5797f9c04fa639c3", "score": "0.58890355", "text": "function orStringArray(param){/**will if a string return Array[param] if Array return param if other return new Array() */\r\n\tif(isArray(param)){\t\treturn param;}\r\n\tif(isStr(param)){\t\treturn [param];\t}\r\n\tsaylog('ERROR: param : must be String or Array ! wrong parameter,'+param);\r\n\treturn new Array();\r\n}//-- USE toArray instead !! (that 'll require [] || ''", "title": "" }, { "docid": "12f0332debe27ab37bf1a3defc45bcb7", "score": "0.5886569", "text": "static getValueOrElementTypeValidationError(type) {\n if (Array.isArray(type)) {\n // If not every type in the list is valid, then return false, pass options through verbatim.\n for (let i = 0; i < type.length; i++) {\n const typeElement = type[i];\n const error = Validation.getValueTypeValidatorValidationError(typeElement);\n if (error) {\n return `Array value invalid: ${error}`;\n }\n }\n } else if (type) {\n const error = Validation.getValueTypeValidatorValidationError(type);\n if (error) {\n return `Value type invalid: ${error}`;\n }\n }\n return null;\n }", "title": "" }, { "docid": "c86fa7149f03231692ba373887d2d5aa", "score": "0.5885102", "text": "function Undefined$prototype$toString() {\n return 'undefined';\n }", "title": "" }, { "docid": "c86fa7149f03231692ba373887d2d5aa", "score": "0.5885102", "text": "function Undefined$prototype$toString() {\n return 'undefined';\n }", "title": "" }, { "docid": "d2b5831da3a64b7f16144a7b8ecb4a6c", "score": "0.5874307", "text": "function A(t){return Array.isArray(t)}", "title": "" }, { "docid": "c2e28bccaed5325c4608e9170c42f0b1", "score": "0.58673334", "text": "function checkIsArray(a) {\n\n return (Array.isArray(a) ? toString(a[0]) : toString(a))\n }", "title": "" }, { "docid": "6449e88f6af2da730f549cd03fc4bc3b", "score": "0.5863843", "text": "function Vh(t){return!(!Array.isArray(t)||!t.length)}", "title": "" }, { "docid": "24c9d9972b6e4381f3a0ef569189bfbf", "score": "0.5862779", "text": "function sjot_error(what, data, type /**/) {\n\n var a = typeof type !== \"string\" ? \"a\" : type.endsWith(\"]\") ? \"an array\" : type.endsWith(\"}\") ? \"a set\" : \"of type\";\n var b = /**/ \"\";\n\n if (typeof data === \"string\")\n throw /**/ \" \" + what + \" \\\"\" + data + \"\\\" is not \" + a + \" \" + type + b;\n else if (typeof data === \"number\" || typeof data === \"boolean\" || data === null)\n throw /**/ \" \" + what + \" \" + data + \" is not \" + a + \" \" + type + b;\n else\n throw /**/ \" \" + what + \" is not \" + a + \" \" + type + b;\n\n}", "title": "" }, { "docid": "1796879f20e82c08a6756da1ab3e5edf", "score": "0.58379847", "text": "function mt(t) {\n return !!t && \"arrayValue\" in t;\n}", "title": "" }, { "docid": "60269cf29b14f108517209733f60b766", "score": "0.5830612", "text": "function arrayOrObject(collection) {\n if (Array.isArray(collection) === true) { \n return 'array';\n }\n if (Array.isArray(collection) !== true && typeof(collection) === 'object' && collection !== null && collection instanceof Date !== true) {\n return 'object';\n }\n}", "title": "" }, { "docid": "6890e7959d2cbbe0ffdabccb6ca097c6", "score": "0.5825881", "text": "function dataType(value) {\n return typeof value\n}", "title": "" }, { "docid": "92f31d51aca41cc0a10c706b0f262bfc", "score": "0.58242315", "text": "function _1w(_u){return typeof(_u)=='undefined'}", "title": "" }, { "docid": "7852efa079b30a59bde1df0ece88e25f", "score": "0.58164907", "text": "function arrayOrObject(collection) {\n if(Array.isArray(collection)){\n return 'array';\n }else {\n return 'object';\n}\n}", "title": "" }, { "docid": "614cfef06a1820dd089001ec7f06a3fc", "score": "0.5814644", "text": "function arrayOrObject(collection) {\n if (Array.isArray(collection)){\n return \"array\";\n } return \"object\";\n}", "title": "" }, { "docid": "b06948a017ce7a94ea024e773c6a1ffc", "score": "0.5809942", "text": "function printArray(t) {\n var tmp = [];\n\n for (i = 0; i < t.length; i++) {\n var exists = t.hasOwnProperty(String(i));\n if (exists) {\n tmp.push(typeof t[i] + ':' + t[i]);\n } else {\n tmp.push('nonexistent');\n }\n }\n\n print(typeof t + ' ' + t.length + ' ' + tmp.join(','));\n}", "title": "" }, { "docid": "7289572601aebef4650b6921918291b6", "score": "0.5805129", "text": "function checkType(value,type){if(value==null){throw new TypeError(\"Unexpected null or undefined value.\");}if(type===Array&&!Array.isArray(value)||type===Object&&!typeUtils.isPlainObject(value)||type===Function&&!typeUtils.isFunction(value)||!type.prototype.isPrototypeOf(Object(value))&&type!==Array){throw new TypeError(\"Value does not have expected type: \"+type.name+\", got: \"+value+\".\");}}", "title": "" }, { "docid": "26951ead59f838697d3bbcd5d2ae7d57", "score": "0.5803619", "text": "function gS(i){var j=typeof i;var s;(j==='undefined')?s=\"undefined\":s=\"true\";return s;}", "title": "" }, { "docid": "e52d44801c07f78b004ddf4ff82f118a", "score": "0.58002466", "text": "function Undef (o) { return typeof(o) == 'undefined' || o === '' || o == null }", "title": "" }, { "docid": "ccc48ea5fac7dfa8179be0e3c583d806", "score": "0.57996905", "text": "function arrayOrObject(collection) {\n if (collection.constructor === Object){\n return 'object';\n } else if (collection.constructor === Array){\n return 'array';\n }\n}", "title": "" } ]
4528aed42b738516917716fb61b11a2e
0212 with flipped == 1 || 2010 with flipped == 1 / Some small helper functions / assume that x1 == 1 && x0 == 0
[ { "docid": "bf5bceabb3bf3984381e0feb38e0b83c", "score": "0.0", "text": "function interpolateX$1(y, y0, y1) {\n return (y - y0) / (y1 - y0);\n }", "title": "" } ]
[ { "docid": "499cd77286b2dafcd340f1920a9b8a9f", "score": "0.5722855", "text": "function twoFlipped(){\r\n flippedcount = 0; //(int), number of tiles flipped\r\n\r\n //Checks every tile to see if it is flipped and increments the flippedcount\r\n for (i=0; i < count; i++){\r\n if(tiles[i].ref.data(\"flipped\")==true){\r\n flippedcount = flippedcount + 1;\r\n }\r\n }\r\n\r\n //If two tiles or more are flipped, return true, else return false\r\n if (flippedcount >= 2){\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "07dd03507119f6d6fcab9ea29fcf4e3c", "score": "0.5447351", "text": "function x2v(X, Vs){\n var Varlist=Vs.sort();\n var Res=[and];\n var Y = X % Math.pow(2,Varlist.length);\n var maxbits = Varlist.length-1;\n for(var i=0; i<Varlist.length; ++i){\n Res.push( Y & Math.pow(2,maxbits-i) ? Varlist[i] : [not,Varlist[i]] );\n }\n return Res.length<3? Res.length<2? [] : Res[1] : Res;\n}", "title": "" }, { "docid": "178f1a707c4be55289fa31ea7b1ea5d2", "score": "0.5373643", "text": "function calculateTwoComplement(x) {\n var ar = x.split(\"\");\n var two = new Array(ar.length);\n\n for (var i = ar.length - 1; i >= 0; i--) {\n two[i] = ar[i];\n if (ar[i] == 1)\n break;\n\n }\n if (i == -1) {\n var twoc = '1' + two.join('');\n } else {\n for (var k = i - 1; k >= 0; k--) {\n if (ar[k] == 0) {\n two[k] = 1;\n\n } else {\n two[k] = 0;\n }\n }\n var twoc = two.join('');\n }\n return twoc;\n}", "title": "" }, { "docid": "4ddcd7c26ba89868cda3ace15a079076", "score": "0.5369805", "text": "function changexzaccordingtorot(orx,ory,rot){\n\t\tvar xz = [0,0]\n\t\tif (rot == 0) {\n\t\t\txz = [-(orx*SKALIERUNGSFAKTOR), (ory*SKALIERUNGSFAKTOR)];\n\t\t} else if (rot == 2) {\n\t\t\txz = [(orx*SKALIERUNGSFAKTOR), -(ory*SKALIERUNGSFAKTOR)];\n\t\t} else if (rot == 1){\n\t\t\txz = [(orx*SKALIERUNGSFAKTOR), (ory*SKALIERUNGSFAKTOR)];\n\t\t} else {\n\t\t\txz = [-(orx*SKALIERUNGSFAKTOR), -(ory*SKALIERUNGSFAKTOR)];\n\t\t}\n\t\treturn xz;\n\t}", "title": "" }, { "docid": "ab4f1534e6e36b97721729d06933db4e", "score": "0.53409", "text": "function firstMirror() {\n if (x < 0) {\n x -= x;\n inversions += 1;\n change = true;\n }\n}", "title": "" }, { "docid": "4a58bd7a2ab80aaed99d524fb5405bd0", "score": "0.5306616", "text": "function coinFlip() {\n\t // return (Math.floor(Math.random() * 2) == 0);\n\t return Math.random() < 0.66;\n\t}", "title": "" }, { "docid": "70947435a6bf543f090da49c22ed0307", "score": "0.52933174", "text": "function checkFlipedCards(currentVal, row, col) {\r\n if (preCard !== 0 && curCard === 0){\t\t\t\t\t\r\n\t\t\t\t if (!currentVal) {\r\n\t\t\t\t preCard = {row:row,col:col,value:data.value};\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar index2 = \"\"+preCard.row+\"-\"+preCard.col;\t\r\n\t\t\t\t\t\t$('#td' + index2).css(\"background-color\",\"white\");\t\t\t\t\t\t \r\n\t\t\t\t\t\t$('#td' + index2).css(\"color\",\"black\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (curCard !== 0 && preCard === 0){\r\n\t\t\t\t\t if (!currentVal) {\r\n\t\t\t\t\t\t curCard = {row:row,col:col,value:data.value};\t\t\t\t\r\n\t\t\t\t\t }\r\n\t\t\t\t\t var index1 = \"\"+curCard.row+\"-\"+curCard.col;\t\r\n\t\t\t\t\t\t$('#td' + index1).css(\"background-color\",\"white\");\t\t\t\t\t\t \r\n\t\t\t\t\t\t$('#td' + index1).css(\"color\",\"black\");\r\n\r\n\t\t\t\t\t} else if(preCard !== 0 && curCard !==0){\r\n\t\t\t\t\t\r\n\t\t\t\t\t// if it is the 3rd card other than preCard and curCard, check whether preCard and curCard are matched.\r\n\t\t\t\t\t// if matched, both cards are flipped forever, \r\n\t\t\t\t\t// if not matched, they are flipped back and could be flipped again.\r\n\r\n\r\n\t\t\t\t\t\tvar index1 = \"\"+curCard.row+\"-\"+curCard.col;\t\t\t\t\t\t \r\n\t\t\t\t\t\tvar index2 = \"\"+preCard.row+\"-\"+preCard.col;\t\t\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t\t\tif (preCard.value !== curCard.value) {\t\t\t\t\t\t \r\n\r\n\t\t\t\t\t\t\t// CASE 1: preCard and curCard are not matched\r\n\t\t\t\t\t // they are flipped back and could be flipped again.\r\n\r\n\t\t\t\t\t\t\t$('#td' + index1).empty();\r\n\t\t\t\t\t\t\t$('#td' + index2).empty();\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t $('#td' + index1).css(\"background-color\",\"blue\");\r\n\t\t\t\t\t\t $('#td' + index1).css(\"color\",\"white\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t $('#td' + index2).css(\"background-color\",\"blue\");\r\n\t\t\t\t\t\t $('#td' + index2).css(\"color\",\"white\");\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#td' + index1).text(\"\");\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$('#td' + index2).text(\"\");\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t // flip number for the 3rd card\r\n\t\t\t\t\t\t if (!((preCard.row == row && preCard.col == col) ||\r\n\t\t\t\t\t\t (curCard.row == row && curCard.col == col))) {\t\r\n\t\t\t\t\t\t\t var index3 = \"\"+row+\"-\"+col;\t \r\n\t\t\t\t\t\t $('#td' + index3).css(\"background-color\",\"white\");\r\n\t\t\t\t\t\t $('#td' + index3).css(\"color\",\"black\");\t\r\n if (currentVal) { \t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t $('#td' + index3).text(currentVal);\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t curCard = 0;\r\n\t\t\t\t\t\t\t preCard = {row:row,col:col,value:data.value};\t\t\t\t\t\t\r\n }\t\t\t\t\t\t\t \r\n\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t // CASE 2: preCard and curCard are matched\r\n\t\t\t\t\t // they are kept to be flipped forever\r\n\r\n\t\t\t\t\t\t var v1 = $('#td' + index1).text();\t\t\t\t\t\t \r\n\t\t\t\t\t\t $('#td' +index1).empty();\t\t\t\t\t\t \r\n\t\t\t\t\t\t $('#td' + index1).css(\"background-color\",\"white\");\t\t\t\t\t\t \r\n\t\t\t\t\t\t $('#td' + index1).css(\"color\",\"black\");\r\n\t\t\t\t\t\t $('#td' + index1).text(v1);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t var v2 = $('#td' + index2).text();\r\n\t\t\t\t\t\t $('#td' +index2).empty();\r\n\t\t\t\t\t\t $('#td' + index2).css(\"background-color\",\"white\");\r\n\t\t\t\t\t\t $('#td' + index2).css(\"color\",\"black\");\t\t\r\n\t\t\t\t\t\t $('#td' + index2).text(v2);\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t // if matches to one of the saved cards, just clean up\r\n\t\t\t\t\t\t var matchOne = false;\r\n\t\t\t\t\t\t if ((preCard.row == row && preCard.col == col) ||\r\n\t\t\t\t\t\t (curCard.row == row && curCard.col == col) ) {\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t matchOne = true;\r\n\t\t\t\t\t\t }\r\n\r\n\t\t\t\t\t\t curCard = 0;\r\n\t\t\t\t\t\t preCard = 0;\t\t\t\r\n // check game over\t\t\t\t\t\t \r\n \t\t\t if (checkGameOver() === true)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t alert(\"Game Over. Total number of attempts = \"+counter);\r\n\t\t\t\t\t\t }\t\t\t\t\r\n\t\t\t\t\t\t if (matchOne === false)\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t preCard = {row:row,col:col,value:data.value};\t\r\n\t\t\t\t\t\t }\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\t\t\t\t \r\n}", "title": "" }, { "docid": "f5d93b244e7de6dfcddbed48e467b92e", "score": "0.5291397", "text": "function flip_n_terms(x, num_terms_to_flip, condition)\n{\n // This is a simple brute-force way to do it, but as this function\n // is only used to build the look-up tables, that's ok.\n var terms_flipped = 0;\n for (var i = 0; i < num_terms_to_flip; ++i)\n {\n x.not(i);\n x.cphase(180, ~0, condition);\n x.not(i);\n }\n}", "title": "" }, { "docid": "cc74d79390bb9565bd56ace8dbc7b2cb", "score": "0.5270877", "text": "function flipRotationAlongXAxis(angle) {\n let flippedAngle;\n if(angle > 90 && angle <= 180) {\n flippedAngle = (-2)*Math.abs(angle - 90);\n }\n else if(angle <= 90 && angle >= 0){\n flippedAngle = (2)*Math.abs(angle - 90);\n }\n else if (angle <= -90 && angle > -180) {\n flippedAngle = (2)*Math.abs(90 - angle);\n \n }\n else {\n flippedAngle = (-2)*Math.abs(-90 - angle);\n }\n //console.log(\"Angle: \" + angle)\n //console.log(\"Flip: \" + flippedAngle);\n return flippedAngle;\n }", "title": "" }, { "docid": "5b252aa0ea93c858afefa18b8cec4b9c", "score": "0.52682227", "text": "function converterCheckIfStereoPair(firstName, secondName)\r\n{\r\n\tfirstName = firstName.toUpperCase();\r\n\tsecondName = secondName.toUpperCase();\r\n\r\n\tif (firstName.length > 5 && firstName.indexOf(\".LEFT\") == firstName.length - 5)\r\n\t{\r\n\t\tif ((secondName == firstName.slice(0, firstName.length - 5)) || (secondName == (firstName.slice(0, firstName.length - 5) + \".RIGHT\")))\r\n\t\t\treturn 1;\r\n\t}\r\n\telse if (firstName.length > 6 && firstName.indexOf(\".RIGHT\") == firstName.length - 6)\r\n\t{\r\n\t\tif ((secondName == firstName.slice(0, firstName.length - 6)) || (secondName == (firstName.slice(0, firstName.length - 6) + \".LEFT\")))\r\n\t\t\treturn 2;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (secondName == firstName + \".LEFT\")\r\n\t\t\treturn 2;\r\n\t\telse if (secondName == firstName + \".RIGHT\")\r\n\t\t\treturn 1;\r\n\t}\r\n\r\n\treturn false;\r\n}", "title": "" }, { "docid": "41a880539a95172991e9f0b0918c5378", "score": "0.5262486", "text": "function isswap() {\n if (!data.length) return;\n\n // ! TODO: dont not use double exprotate, decide beforehand if its required or not\n for (let i = 0; i < fullData.length; i++) {\n [fullDataCols[i].x, fullDataCols[i].y] = [fullDataCols[i].y, fullDataCols[i].x]\n fullData[i] = expRotate(fullData[i], fullDataCols[i].x, fullDataCols[i].y)\n }\n\n if (fullData.length>1 && !fullData.every(v => v.length == fullData[0].length)) { // reverse back\n for (let i = 0; i < fullData.length; i++) {\n [fullDataCols[i].x, fullDataCols[i].y] = [fullDataCols[i].y, fullDataCols[i].x]\n fullData[i] = expRotate(fullData[i], fullDataCols[i].x, fullDataCols[i].y)\n }\n alertElec(\"File(s) have different grid points along the Y axis.\", 0, \"Can't Plot along Y!!!\")\n }\n swapped = !swapped;\n\n data = fullData[currentEditable]\n col = fullDataCols[currentEditable]\n xName = swapped ? \"Y\" : \"X\"\n updateData();\n}", "title": "" }, { "docid": "e99c9e38352a510b517f22beab198f84", "score": "0.5257768", "text": "function twice3040(arra1) {\n\n let a = arra1[0],\n\n b = arra1[1]; // let in bitiminde ; var\n\n return ( a === 30 && b === 30 ) || ( a === 40 && b === 40);\n \n }", "title": "" }, { "docid": "aa54d6bfd5bda0b4099fa712dc2a9eb9", "score": "0.5222179", "text": "function flip(fn){return function(a,b){return fn(b,a);};}", "title": "" }, { "docid": "1cc3b14e4bda0c552ef84448c4b4a37f", "score": "0.5210892", "text": "function coinFlip() {\n return (Math.floor(Math.random() * 2) == 0);\n}", "title": "" }, { "docid": "8f260ffb14a24e8b077299059bb3ad7d", "score": "0.5209132", "text": "coinFlip() {\n return (Math.floor(Math.random() * 2) == 0);\n }", "title": "" }, { "docid": "2fe3c7eaa9439a377bca6e9ed1cf399a", "score": "0.5205387", "text": "function flip(bits) {\n switch (bits[0]) {\n case 0 : return [1, flip(bits[1])];\n case 1 : return [0, flip(bits[1])];\n default : return [];\n }\n}", "title": "" }, { "docid": "dc619dd8a92251cbb2f267be8439db7c", "score": "0.51842976", "text": "function flip_last(bits) {\n var init = bits.slice(0, -1);\n var last = bits[bits.length - 1];\n return init + (last === \"0\" ? \"1\" : \"0\");\n }", "title": "" }, { "docid": "3fe53ff5f7dd241a2ce0c0579a5c7a5d", "score": "0.5154991", "text": "function isXor(firstVal, secondVal) {\n return ((!!firstVal && !secondVal) || (!firstVal && !!secondVal))\n}", "title": "" }, { "docid": "9a69a6907cd5cd31ec89a2f178f2a619", "score": "0.5113377", "text": "function canSwap(x1, y1, x2, y2){\n var type1 = getJewel(x1, y1),\n type2 = getJewel(x2, y2),\n chain;\n\n if(!isAdjacent(x1, y1, x2, y2)){\n return false;\n }\n //intercambio temporal de Jewels\n jewels[x1][y1] = type2;\n jewels[x2][y2] = type1;\n\n chain = (checkChain(x2,y2) > 2 || checkChain(x1, y1) > 2);\n\n //revertir intercambio\n jewels[x1][y1] = type1;\n jewels[x2][y2] = type2;\n \n return chain;\n }", "title": "" }, { "docid": "7c1a40b7c0339b0ec6f89a0a021c0def", "score": "0.51014185", "text": "function flp2(x) {\n x = x | (x >> 1);\n x = x | (x >> 2);\n x = x | (x >> 4);\n x = x | (x >> 8);\n x = x | (x >> 16);\n return x - (x >> 1);\n}", "title": "" }, { "docid": "8046f72c48483ad9d7db5a8d3a8ed17e", "score": "0.5095888", "text": "function p(p0, p1) {\n return (1 << p0) |\n (1 << (p0 & 1 | p1 & 6)) |\n (1 << (p0 & 2 | p1 & 5)) |\n (1 << (p0 & 3 | p1 & 4)) |\n (1 << (p0 & 4 | p1 & 3)) |\n (1 << (p0 & 5 | p1 & 2)) |\n (1 << (p0 & 6 | p1 & 1)) |\n (1 << p1);\n}", "title": "" }, { "docid": "f4d83b7bbc468ce15ca40ca4ff43c478", "score": "0.5089619", "text": "function checkFlipRight(numCard, rightCard, base_array) {\n const card = base_array[numCard]\n if (rightCard === undefined\n || card.status === rightCard.status\n || !(rightCard.values[3] !== 0 && card.values[1] > rightCard.values[3])) {\n console.log(\"es mas falso que pimpon\");\n return false;\n } else {\n return true\n }\n}", "title": "" }, { "docid": "b6df73d50680e6151c7cbc5f7f2126a1", "score": "0.50854", "text": "function isXor(arg1, arg2) {\n if (arg1 && arg2 || !arg1 && !arg2) {\n return false;\n } else if (arg1 || arg2) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "3de59b78c194494346a0e4215132469b", "score": "0.508306", "text": "function coinFlip() {\n return Math.floor(Math.random()*2) === 0;\n}", "title": "" }, { "docid": "360bdb31bf76d9aa557bd56281eb511f", "score": "0.5080688", "text": "function XtoX1(b, x){\n\tvar x1;\n\tif(b){ x1= (x- ancho/2)/escala } else { x1= x*escala +ancho/2 }\n return x1;\n}", "title": "" }, { "docid": "294394479c172467dae6951e7e9c49f1", "score": "0.5072152", "text": "function xor(x, y) {\n return !x != !y\n}", "title": "" }, { "docid": "7ca5805018b814473b0d4018b8b396fb", "score": "0.50712734", "text": "function f() {\n var x = 0;\n var tmp = 0;\n -890607324;\n x ^= (tmp = -890607324, tmp) >> (-2876826295 >> x << ((tmp = 2351495148.117994, tmp) >> (tmp = 1368611893.274765, tmp))) * (tmp = 1531795251, tmp);\n -729075363;\n x += x + (tmp = 1052139285, tmp);\n 531550884933581760;\n x *= x;\n 1980836332;\n x ^= -746269795.2320724 - (2400458512 >> (1290672548 >>> ((1536843439.5629003 & 3185059975.158061) * (tmp = -1339249276.2667086, tmp) & x)));\n 941373096;\n x %= x + -451098412 ^ (tmp = 1725497732, tmp);\n -1766019323;\n x += (tmp = -2707392419, tmp);\n 2528947973;\n x >>>= x ^ -896237435.3809054;\n -263192576;\n x <<= -866361580;\n -2008;\n x >>= -2608071791;\n -88;\n x %= -1076807218.4792447 & (tmp = 601044863, tmp) >> (tmp = 1228976729, tmp) + (-2711426325 * x | x | x % -2700007330.3266068) & (tmp = 3147972836.778858, tmp);\n 1762886843;\n x ^= (tmp = 2532080403, tmp);\n 1762886843;\n x %= (((tmp = -2059247788, tmp) >> x) / x + (x << x) ^ x) >>> -1969283040.3683646;\n 4812334726.587896;\n x += (tmp = 3049447883.587897, tmp);\n 1;\n x /= x;\n 1;\n x *= x;\n -2150507334;\n x -= (tmp = 1578221999, tmp) + (tmp = 572285336, tmp);\n -4546475858941548500;\n x *= (tmp = -931533139.5546813, tmp) ^ (tmp = 3061503275, tmp);\n -269064192;\n x |= 207217276.91936445 << (tmp = -957353678.4997551, tmp);\n 1;\n x /= x;\n 1;\n x <<= 1463856021.8616743 % (x * (tmp = -2286419102, tmp)) / -2852887593;\n 2223868564.8383617;\n x *= (tmp = 2223868564.8383617, tmp);\n 918797189.9033995;\n x -= 1305071374.9349623 % (x + 2211992629);\n -2212004787.4668465;\n x -= (tmp = 3130801977.370246, tmp);\n 31783;\n x >>= 2951958960;\n 31783;\n x ^= ((tmp = -2441511566, tmp) & (tmp = 91427553.90168321, tmp) + (tmp = 3001737720.327718, tmp) % x) >>> -2263859841 >>> (2109161329 >> (tmp = -2816295136.7443414, tmp));\n 4068224;\n x <<= x % ((tmp = -682576250.4464607, tmp) * (x / (x - x >>> (x & (x << (x << x) >>> (2243036981.528562 / (-1839328916.9411087 >> -1907748022.162144 << x + x) + ((tmp = 2362574171, tmp) << (tmp = 1987834539, tmp)) | -444329240) | 399451601.1717081) >> x) & 968363335.6089249)));\n 0.0030991932898194294;\n x /= (tmp = 1067316540.5529796, tmp) ^ -2388640366;\n 0;\n x >>= x;\n 0;\n x >>>= (tmp = -393433349.1636851, tmp);\n 0;\n x *= (x ^ (1806955787.471396 << x ^ 517668047.55566347 >>> x % (x << (tmp = -276586733.4844558, tmp)))) % 1661242196.1472542 | x;\n 0;\n x |= x >> x;\n -155236210;\n x |= (tmp = -155236210.19366312, tmp);\n -606392;\n x >>= (tmp = -1533446042.97781, tmp) ^ x;\n -1;\n x >>= 936126810;\n 2325115611;\n x -= -2325115612;\n 0;\n x -= x;\n 0;\n x >>= (tmp = -354826623, tmp);\n -0;\n x *= -1232528947.7321298;\n 0;\n x |= x;\n 0;\n x <<= (tmp = 187758893.4254812, tmp) & x - (tmp = 648201576, tmp) & 385106597;\n 0;\n x >>= (tmp = 2554891961, tmp);\n -1311492611.2970417;\n x += -1311492611.2970417;\n -688179220.3221785;\n x += 623313390.9748632;\n 1416835528;\n x &= (tmp = 1953739224, tmp);\n -11.04719252755072;\n x /= -128252995;\n -6.287413042114223e-9;\n x /= (tmp = 1757033052.1558928, tmp);\n -4231171;\n x |= 2022730885.7773404 * (-2495777565.221855 | (tmp = 274627292, tmp)) << -3072596920.4902725 >>> -2215057529 + -1134713759.4247034 ^ (tmp = -1888181788, tmp) / 572025985.2748461;\n -4194305;\n x |= (tmp = 167328318.038759, tmp) >>> 153800904.34551537;\n -1316525687;\n x -= 1312331382;\n 1448723245.7863903;\n x += 2765248932.7863903;\n 1.7219707102205526;\n x /= (tmp = 841317008, tmp);\n 1872027792.5217001;\n x *= x | (tmp = 1087142645.6665378, tmp);\n 3504488055973669400;\n x *= x;\n -1075254784;\n x |= x;\n -5;\n x >>= 844461331.8957539 - ((x & x) << (tmp = 1443904777, tmp) + (tmp = 736164505.3670597, tmp)) - ((tmp = 1348422110, tmp) >> (tmp = -2878252514, tmp) / -1175443113 | -2138724317 % 2057081133);\n -3.038875804165675e-9;\n x /= 1645345292.8698258;\n 1.25204541454491e-18;\n x /= -2427129055.274914;\n -1.7151576137235622e-9;\n x *= -1369884505.6247284;\n 1590804618;\n x ^= 1590804618.4910607;\n 5061318665300252000;\n x *= x + x;\n 5061318665300252000;\n x %= (tmp = 1102144242, tmp) * x;\n -7;\n x >>= 2772167516.624264;\n 16383;\n x >>>= -2979259214.5855684;\n 47108415435;\n x *= 2944456517.839616 >>> 1041288554.5330646;\n 61;\n x >>>= x ^ (-1305163705 << 948566605 - x) - x;\n 0;\n x %= x;\n 0;\n x ^= (tmp = 1918861879.3521824, tmp) / (x % (tmp = 945292773.7188392, tmp) % (x | x)) >> x;\n -0;\n x *= (((x | (2810775287 | (tmp = 1265530406, tmp))) ^ (tmp = 3198912504.175658, tmp) - ((tmp = 1422607729.281712, tmp) << (tmp = 2969836271.8682737, tmp) & x)) << (tmp = 844656612, tmp) * (((tmp = -828311659, tmp) % (-2083870654 >>> (x ^ (933133782 - (tmp = 1033670745, tmp) - 629026895.4391923) % (-605095673.8097742 * (-227510375.38460112 * x + x & (((tmp = 472873752.68609154, tmp) ^ (tmp = 2815407038.712165, tmp)) + ((x >>> ((tmp = -1331030665.3510115, tmp) >>> 2281234581)) - (x >>> x)) & (tmp = -2160840573.325921, tmp) & x))) << (tmp = 1411888595, tmp)) | (tmp = -915703839.0444739, tmp) / ((x + 418836101.8158506) % -1112605325.4404268) & -3098311830.6721926 - x) - 49446671.477988124 * -2522433127 + ((tmp = 443068797, tmp) >> (tmp = 418030554.97275746, tmp))) * ((tmp = 38931296.738208175, tmp) + 1842742215.3282685))) - ((tmp = 1325672181.205841, tmp) ^ (tmp = 669284428, tmp));\n -0;\n x *= (tmp = 93843030, tmp);\n 0;\n x ^= x;\n 0;\n x ^= x;\n 0;\n x <<= x;\n 0;\n x >>>= x % ((((tmp = -107458601, tmp) >> x * ((x | (tmp = 2117286494, tmp) >> ((x ^ (tmp = 114214295.42048478, tmp)) >>> (tmp = 1032826615, tmp))) & (x * x & -225386977.67686415)) ^ -780566702.5911419 + -1113319771 | (x ^ x) << 1288064444 >> -2292704291.619477) >> 365125945) - (tmp = -1986270727.235776, tmp) / x);\n -0;\n x *= (-18925517.67125845 | -1975220517 + (tmp = -1250070128.296064, tmp) + 1085931410.5895243 << ((x | (x * (tmp = 160207581.50536323, tmp) | (tmp = 1798744469.7958293, tmp)) - x) >>> (x + (x % x & (((x ^ x) << ((tmp = 2538012074.623554, tmp) ^ x)) * x & x))) / (x + (tmp = -2563837407, tmp)) / (tmp = 2189564730, tmp)) / (-1703793330.5770798 << (176432492 | x) << 1347017755.345185)) << ((tmp = -577100582.7258489, tmp) & x) / -31246973;\n 0;\n x >>>= x;\n NaN;\n x %= x * (tmp = 1167625971, tmp) & ((tmp = -770445060, tmp) >> (339248786 ^ 2058689781.2387645 - -2381162024 * 660448066) & x);\n NaN;\n x += 3088519732.515986 - -267270786.06493092;\n 0;\n x &= (tmp = 2748768426.3393354, tmp);\n -1109969306;\n x ^= -1109969306 >>> x;\n -1109969306;\n x %= (tmp = 1150376563.581773, tmp);\n -2058145178;\n x &= -2057586057;\n -850185626;\n x |= (x ^ (tmp = 1223093422, tmp)) & -589909669 << 2299786170;\n 1489215443;\n x += 2339401069;\n -23592960;\n x <<= x;\n 2063937322;\n x ^= -2053296342.2317986;\n 12922122;\n x %= x ^ -2259987830 >> x * (((tmp = -799867804.7716949, tmp) & (tmp = -1068744142, tmp)) * (1091932754.8596292 - ((tmp = -1778727010, tmp) >> (tmp = 1207737073.2689717, tmp) - (x - (tmp = -1191958946, tmp)) + -631801383.7488799) - -618332177 >>> -156558558 >>> 3032101547.6262517));\n 12922122;\n x &= x;\n Infinity;\n x /= x % x;\n 0;\n x &= x * -227800722.62070823;\n -865648691;\n x ^= -865648691;\n 1;\n x /= x % (tmp = 1524739353.8907173, tmp);\n 16;\n x <<= x << 2335214658.789205;\n 0;\n x &= (tmp = 570332368.1239192, tmp) ^ -2278439501;\n 1881145344;\n x -= -569715735.8853142 + 2093355159 << (tmp = 2788920949, tmp);\n 0;\n x ^= x;\n NaN;\n x -= (tmp = -1427789954, tmp) % (((411038329.49866784 - x - (x << -1330832247 + x)) / x ^ x * 845763550.2134092 >> (tmp = 1427987604.5938706, tmp)) >>> 1857667535);\n NaN;\n x /= -313793473;\n 0;\n x >>>= x / x;\n 1869358566;\n x -= -1869358566;\n -1901664519209545200;\n x += (tmp = 944729941.3936644, tmp) * -2012918653;\n -1901664519209545200;\n x += (tmp = 1348246793, tmp) / (x & x);\n -1576791552;\n x &= (tmp = 2719250966.739456, tmp);\n -305087899;\n x ^= -2955630491.030272;\n 0;\n x ^= x % 1575252839.559443;\n 4184604407;\n x += (((tmp = -244720076.17657042, tmp) | 2819320515) ^ (tmp = 1222623743.9184055, tmp) * -95662379.577173 / (x / (x + ((x - (tmp = -3024718107.6310973, tmp) ^ -1494390781) & (tmp = 2284054218.8323536, tmp)))) >>> (tmp = 2090069761, tmp)) >>> x % x;\n 3148907440;\n x -= (tmp = -332379100.7695112, tmp) - -1145399547 ^ ((tmp = 3133792677.785844, tmp) + x << 2306999139.5799255 >> (tmp = -2051266106, tmp) * ((x + (-728654312.8954825 >> (x >>> (x % x & -1587152364 | (-2114138294 & x & 1547554688 ^ x) - -1856094268))) * ((-1135018784 & (x + (tmp = -1444020289, tmp) | x)) + x) >> x & x) / 2449005489 << 131073798.64314616 % (x >>> (-2592101383.2205048 ^ (tmp = -757096673.0381112, tmp)))) ^ 2766467316.8307915) - -2465892914.515834 - (((tmp = 234064056, tmp) ^ (x >>> 1622627548.7944543) + -1750474146 | -1959662039.4687617) ^ -1222880974 & -2794536175.906498);\n -1157627488;\n x &= -1156639323;\n -1342170624;\n x <<= x / (1829945345.0613894 / (x * ((tmp = 1278865203.0854595, tmp) / ((tmp = -2298274086.519347, tmp) + (tmp = -545203761, tmp) - (tmp = 2712195820, tmp)))) >>> (tmp = 240870798.9384452, tmp) - (tmp = -3188865300.4768195, tmp) >>> x % (648799266 >>> (tmp = 24460403.864815235, tmp))) | ((tmp = 232533924, tmp) | x);\n -2684341248;\n x += x;\n 1073755136;\n x &= (-662718514.9245079 >> (tmp = -1915462105, tmp)) + (tmp = 1478850441.8689613, tmp);\n -1073755136;\n x /= x | ((tmp = -1767915185, tmp) | (325827419.1430224 | (-1343423676 | (tmp = -1929549501, tmp) | -866933068.9585254)));\n -1073755136;\n x %= (tmp = 547342356, tmp) - ((tmp = 2213249646.7047653, tmp) - ((-2463314705 ^ (tmp = -993331620, tmp) ^ (x % x >> (tmp = 1798026491.3658786, tmp)) - 1024072781 / (tmp = -2407354455, tmp) % 1973295010) << -1966787233 ^ x | -1787730004));\n -1073754452;\n x |= (tmp = 3099823788.077907, tmp);\n -1540683096;\n x &= -1540674632.7013893;\n -1540683052;\n x ^= (tmp = -126183090, tmp) >>> (-622437575.5788481 | (tmp = -2947914022, tmp) % ((tmp = 2512586745, tmp) >> x >>> 27238232.23677671 / (tmp = 3203958551, tmp)) / (tmp = 2906005721.402535, tmp) ^ ((tmp = 1763897860.737334, tmp) ^ 1445562340.2485332) / x + -2393501217.716533);\n -1258599433;\n x |= (tmp = 351291767.59661686, tmp);\n -1241560065;\n x |= 626346046.5083935;\n -1241560065;\n x ^= 2263372092 / ((tmp = -2868907862, tmp) >>> x);\n -893685228;\n x -= (tmp = -347874837, tmp);\n 3401282068;\n x >>>= x * x;\n 0;\n x %= x;\n 0;\n x >>>= x;\n -2079237393;\n x ^= (tmp = 2215729903, tmp);\n NaN;\n x %= (tmp = 3203450436, tmp) / 2867575150.6528325 & 1864945829 & (x & ((tmp = -1927086741.3438427, tmp) | x | -1783290909.3240588) * (-1074778499.0697656 * (x - ((tmp = -848983542.8456669, tmp) ^ (tmp = -1324673961, tmp))))) >> (tmp = -2144580304.245896, tmp);\n -43334009;\n x |= x ^ -43334009.72683525;\n -43334009;\n x &= x;\n -43334009;\n x %= (tmp = 1252450645.060542, tmp);\n -43334009;\n x |= (((tmp = 968062202, tmp) / (x | (tmp = 2766801984, tmp)) * (2173353793.938968 >> ((tmp = -2459317247, tmp) << (tmp = -2333601397, tmp) >>> (tmp = -578254251.8969193, tmp) * (tmp = 839964110.7893236, tmp))) & (1675305119 & (tmp = -929153707, tmp)) * (x * x * x)) / x | x / (tmp = 384740559.43867135, tmp)) % 1657362591;\n 0;\n x -= x;\n 0;\n x %= -1334758781.1087842;\n 0;\n x -= x;\n -54;\n x += (tmp = -1787151355.470972, tmp) >> ((tmp = 237028977, tmp) >> (2829473542 << (x >>> ((((x - -1950724753) * (x >>> 2807353513.6283565 << (-583810779.1155353 >> x * x) >> -1068513265) ^ (x ^ -696263908.5131407)) % ((tmp = -1325619399, tmp) << (tmp = -1030194450, tmp) - x ^ x) + (-2852768585.3718724 >> (tmp = -3160022361, tmp))) % (x & x) >> (tmp = 2667222702.5454206, tmp)))) + (804998368.8915854 << x));\n -54;\n x %= -1601267268.4306633;\n 1;\n x >>>= (tmp = -543199585.579128, tmp);\n 4.732914708226396e-10;\n x /= (tmp = 2112862922, tmp);\n -4266932650;\n x -= ((x ^ ((tmp = 2784618443, tmp) ^ (tmp = -2271260297.9010153, tmp) | ((tmp = -599752639.7516592, tmp) * 2751967680.3680997 ^ (tmp = -1478450055.578217, tmp)) * x) - x) & (tmp = -520061982, tmp) - ((tmp = 1400176711.9637299, tmp) ^ (2100417541 | x + (tmp = -674592897.0420957, tmp)) >> x) ^ (tmp = -365650686.7947228, tmp)) >>> (-2943521813 & ((tmp = -1888789582, tmp) >> (tmp = 700459655.488978, tmp)) + (tmp = -1725725703.655931, tmp));\n 224277168;\n x <<= (tmp = 2885115011.8229475, tmp);\n 224277168;\n x %= (tmp = -2655345206.442777, tmp);\n 850395136;\n x <<= x - ((-769868538.1729524 / ((tmp = -298603579, tmp) % (x ^ x)) + (2691475692 | x >>> 628995710.4745524 ^ x << ((tmp = -1046054749, tmp) | 919868171) - x ^ -1377678789.8170452 & 3065147797 % (tmp = 2638804433, tmp)) ^ (tmp = -2036295169, tmp)) & ((tmp = -157844758.08476114, tmp) * (tmp = -2819601496, tmp) & ((tmp = 78921441, tmp) << 653551762.5197772) / 1801316098 * -1479268961.8276927));\n 1645565728;\n x ^= (tmp = 1353013024, tmp);\n 1645565728;\n x >>>= x;\n 3020513544;\n x += 1374947816;\n 0;\n x %= x;\n 0;\n x %= ((tmp = -304228072.4115715, tmp) >>> -90523260.45975709 - (tmp = -3013349171.084838, tmp)) % (-1640997281 * ((tmp = -1600634553, tmp) % ((tmp = 557387864, tmp) << (888796080.766409 | x ^ (x % ((((tmp = 1164377954.1041703, tmp) * x | 2742407432.192806) & (tmp = 1707928950, tmp) << 1279554132.4481683) + (tmp = -2108725405.7752397, tmp)) % (tmp = -465060827, tmp) ^ (tmp = 2422773793, tmp) + x ^ ((((tmp = -1755376249, tmp) ^ (-267446806 ^ x)) / ((tmp = -1808578662.4939392, tmp) + ((tmp = -1997100217, tmp) + x) + ((tmp = -2469853122.411479, tmp) / x >> (tmp = 660624616.7956645, tmp))) % (x << (((tmp = -1701946558, tmp) - (tmp = 133302235, tmp) >>> x) / 738231394 << -1060468151.4959564 & (-1877380837.4678264 | (tmp = 2366186363, tmp)) % x >>> -2382914822.1745577 >> (-1874291848.9775913 << (tmp = 2522973186, tmp))) << -2672141993) | (tmp = 732379966, tmp)) % x ^ x ^ x)))))) % (tmp = 2385998902.7287374, tmp) * x + (tmp = -2195749866.017106, tmp);\n 401488;\n x ^= -320896627 >>> (tmp = 2812780333.9572906, tmp) & (tmp = -2088849328, tmp);\n -1661116571.0046256;\n x += (tmp = -1661518059.0046256, tmp);\n -1616122720;\n x <<= x;\n -1616122720;\n x >>= x;\n -390439413;\n x %= (tmp = -1225683307, tmp);\n -84189205;\n x |= (x | 2054757858) ^ (x << ((x | x | (x >>> (-2938303938.1397676 << (2993545056 ^ (tmp = -643895708.5427527, tmp) / (1371449825.5345795 - 1896270238.695752)))) - (tmp = 1061837650, tmp) + (x + (tmp = 3072396681, tmp))) >> x - (((tmp = -1877865355.1550744, tmp) & x) % -2766344937 >>> 2055121782))) - (x << x | (tmp = -2742351880.1974454, tmp)) << (-2600270279.219802 >> -1625612979);\n -168378410;\n x += x;\n -168378410;\n x &= x;\n -1534983792;\n x &= -1501412943;\n -1821543761;\n x ^= 938439487;\n -1821543761;\n x &= x ^ ((tmp = -4237854, tmp) >> x) / x;\n 2358;\n x >>>= 2954252724.620632;\n 4716;\n x <<= -75522382.8757689 / ((tmp = 1074334479, tmp) | (tmp = -720387522, tmp) >> (x >>> -3085295162.6877327));\n -1313079316;\n x |= 2981887904.020387;\n -1957790646;\n x -= 644711330;\n 17831;\n x >>>= (tmp = -2550108342, tmp) - ((tmp = 454671414.0146706, tmp) + -661129693.9333956 >> (x >>> (tmp = 1752959432.3473055, tmp) * -2619510342.1812334 % (tmp = -456773274.2411971, tmp)));\n 689287937.6879716;\n x -= (tmp = -397126863.6879716, tmp) - (x >> x ^ x / -1387467129.6278908 | x >> ((tmp = -2361114214.8413954, tmp) << (tmp = -805670024.4717407, tmp)) << -2724018098);\n 1378575875.3759432;\n x += x;\n 84112428460187.8;\n x *= ((2681425112.3513584 % (tmp = -1757945333, tmp) | x) >> -1793353713.0003397) % x;\n -3221;\n x >>= -1976874128;\n -3221;\n x %= (tmp = 2318583056.834932, tmp) | (tmp = -1016115125, tmp) + (-472566636.32567954 + x) | (tmp = 3135899138.065598, tmp);\n -6596608;\n x <<= x;\n -1249902592;\n x <<= (tmp = -2025951709.5051148, tmp) / (-465639441 << -2273423897.9682302) * ((tmp = -2408892408.0294642, tmp) - (tmp = 1017739741, tmp));\n 73802092170444800;\n x *= (tmp = -59046275, tmp);\n -1619001344;\n x <<= x;\n 0;\n x <<= (tmp = 1610670303, tmp);\n -0;\n x *= (x + (tmp = 2039867675, tmp) | (tmp = 399355061, tmp)) << 1552355369.313559 ^ x;\n 0;\n x *= x;\n 0;\n x >>>= (2875576018.0610805 >> x) % (tmp = -2600467554, tmp);\n 2290405226.139538;\n x -= -2290405226.139538;\n 0;\n x %= x;\n 0;\n x ^= ((tmp = 2542309844.485515, tmp) - x) % (-2950029429.0027323 / (tmp = 2943628481, tmp));\n 0;\n x += x;\n 0;\n x -= x;\n 0;\n x >>>= (tmp = 2337330038, tmp);\n 0;\n x += x / (292272669.0808271 & (tmp = 2923699026.224247, tmp) ^ (tmp = 367745855, tmp));\n 0;\n x &= x;\n 0;\n x %= (tmp = 1565155613.3644123, tmp) << -308403859.5844681;\n -1845345399.3731332;\n x += (tmp = -1845345399.3731332, tmp);\n 5158590659731951000;\n x *= -2795460763.8680177;\n -364664;\n x >>= 1837745292.5701954;\n 1;\n x /= x;\n -860616114.8182092;\n x += (tmp = 2076961323.1817908, tmp) + -2937577439;\n -860616115;\n x ^= x * (tmp = 2841422442.583121, tmp) >>> ((tmp = 1929082917.9039137, tmp) >> -2602087246.7521305);\n -38387843;\n x |= 3114677624;\n 2927507837;\n x += (tmp = 2965895680, tmp);\n 1;\n x /= x;\n -1792887531;\n x *= -1792887531;\n -0;\n x %= (x ^ x) + x;\n -0;\n x %= (tmp = 2800752702.562547, tmp);\n 1384510548;\n x ^= (tmp = 1384510548, tmp);\n 42251;\n x >>= 1645421551.363844;\n 0;\n x >>>= 17537561;\n -2076742862;\n x ^= (tmp = 2218224434, tmp);\n -2.790313825067623;\n x /= 744268563.3934636;\n 5313538;\n x &= ((tmp = -2406579239.0691676, tmp) + (-1470174628 + ((tmp = -783981599, tmp) << (tmp = -1789801141.272646, tmp) ^ (((tmp = -844643189.5616491, tmp) & (tmp = -252337862, tmp) & (x | x)) % (-3159642145.7728815 + (tmp = 2149920003.9525595, tmp)) & x >> 1737589807.9431858) - (((1610161800 << 497024994 >> x << x) / x >>> x & x) - 757420763.2141517) - (tmp = -3061016994.9596977, tmp)))) / (tmp = 1810041920.4089384, tmp) & (tmp = 5887654.786785364, tmp) & (tmp = 1626414403.2432103, tmp) + x % x;\n -2147483648;\n x <<= (tmp = 1304102366.8011155, tmp);\n -208418816;\n x %= -2850404799 * (x + 3158771063.226051) * -2017465205 / (x >> x) >> x % (tmp = 2760203322, tmp);\n -2189223477;\n x -= 1980804661;\n -859239912;\n x ^= (tmp = 2974421971.3544703, tmp);\n -1599850415;\n x ^= (tmp = -2475871671.140151, tmp);\n -1600636847;\n x += ((tmp = -1311002944, tmp) << ((tmp = -1137871342, tmp) << (tmp = 115719116, tmp))) / 413107255.6242596 << (x >> ((-1908022173 & (-1519897333 ^ (x >> x * (tmp = -2886087774.426503, tmp)) * (tmp = 530910975, tmp)) + -2579617265.889692) + (2518127437.127563 >>> ((tmp = 481642471.56441486, tmp) >>> 792447239)) ^ x << 248857393.6819017));\n -191;\n x >>= -1591265193;\n -192.27421813247196;\n x += (tmp = 2627329028.207775, tmp) / (tmp = -2061914644.9523563, tmp);\n 1230613220;\n x ^= (tmp = 3064354212.307105, tmp);\n 1230613220;\n x &= x;\n 1230613220;\n x %= 1833479205.1064768;\n 1230613220;\n x >>>= (1559450742.1425748 | 2151905260.956583 * 1213275165) % 514723483.12764716 >>> x;\n 1230613493;\n x |= 3004939197.578903 * (tmp = -576274956, tmp) + ((tmp = 1037832416.2243971, tmp) ^ x) >>> (tmp = 2273969109.7735467, tmp);\n 2461226986;\n x += x;\n -27981;\n x >>= 692831755.8048055 ^ (tmp = -1593598757, tmp) % (x - ((-1470536513.882593 | ((tmp = -2716394020.466401, tmp) | (tmp = 2399097686, tmp))) & x) % x);\n -1.4660454948034359e+23;\n x *= (x >>> ((((tmp = -3056016696, tmp) << -2882888332) * 2041143608.321916 & ((tmp = -634710040, tmp) | (tmp = -2559412457, tmp)) >> 1916553549.7552106) % (-2150969350.3643866 * x) << (x * (tmp = 2657960438.247278, tmp) | x))) % ((tmp = 526041379, tmp) * (tmp = 2514771352.4509397, tmp)) * 1219908294.8107886;\n -1.4660454948034359e+23;\n x -= 1709004428 >> ((x | -422745730.626189) % x >> x);\n -2247766068;\n x %= -3105435508;\n -386845856.0649812;\n x -= -1860920211.9350188;\n -386846803.0649812;\n x -= (-3214465921 | (tmp = -1326329034, tmp) + ((tmp = -1203188938.9833462, tmp) % ((-1318276502 + (x + x) ^ (x << x) % (x >>> x)) + (tmp = -439689881, tmp) + (-1455448168.695214 ^ x - (-388589993 >> (940252202 ^ -2218777278 | x) / (tmp = -1007511556, tmp))) & -140407706.28176737) - x / (888903270.7746506 - ((tmp = -2885938478.632409, tmp) << ((tmp = -1750518830.270917, tmp) >> (((tmp = 868557365.7908674, tmp) / (tmp = -2805687195.5172157, tmp) * x | ((-1342484550 - ((tmp = 1089284576, tmp) ^ (tmp = 120651272, tmp)) << (tmp = 2230578669.4642825, tmp)) - x * x) % (x ^ ((tmp = -3177941534, tmp) + (x >> -1595660968)) / -1738933247) >>> (tmp = 2860175623, tmp)) - (2392690115.8475947 >>> (tmp = -1754609670.2068992, tmp) >>> (tmp = 2615573062, tmp)) - (tmp = 2590387730, tmp) ^ (x + ((x - (tmp = -2823664112.4548965, tmp)) * 200070977 >>> ((x | ((tmp = 1361398, tmp) >> (tmp = 1649209268, tmp) % x) + x + (x >>> (tmp = -2379989262.1245675, tmp)) | x ^ (tmp = -647953298.7526417, tmp) - x) & (tmp = -1881232501.1945808, tmp)) >>> x)) % (x ^ (tmp = -1737853471.005935, tmp))) >>> 427363558 >>> ((tmp = -3076726422.0846386, tmp) ^ -1518782569.1853383)) / x))) | x) >>> 1854299126;\n -386846803.0649812;\n x -= x % x;\n 238532;\n x >>>= -448890706.10774803;\n 232;\n x >>>= -791593878;\n 232;\n x <<= (x ^ x - x & (tmp = 1219114201, tmp)) / (tmp = -427332955, tmp) % (tmp = 1076283154, tmp);\n 210;\n x ^= x >>> (2975097430 >>> x);\n 1;\n x /= x;\n 2317899531;\n x *= 2317899531;\n 1131786;\n x >>>= x;\n 2301667519.6379366;\n x += (tmp = 193109669.63793683, tmp) + (tmp = 2107426064, tmp);\n 3842614963.6379366;\n x += -1676516834 >>> (tmp = -1817478916.5658965, tmp) ^ ((tmp = 1122659711, tmp) >>> (tmp = -2190796437, tmp) | (tmp = -2754023244, tmp));\n -452352333;\n x &= x;\n -863;\n x >>= x;\n -3.777863669459606e-7;\n x /= 2284359827.424491;\n -3.777863669459606e-7;\n x %= (tmp = -2509759238, tmp) >>> x;\n 0;\n x <<= -814314066.6614306;\n 0;\n x %= (tmp = 190720260, tmp);\n 2301702913;\n x += 2301702913;\n -249158048;\n x >>= (tmp = -2392013853.302008, tmp);\n -249158048;\n x >>= x;\n -498316096;\n x += x;\n -498316096;\n x %= (tmp = 2981330372.914731, tmp);\n 106616.2199211318;\n x *= (((tmp = 1020104482.2766557, tmp) ^ (tmp = -416114189.96786, tmp) >>> 1844055704 | (tmp = 1665418123, tmp)) >> 1826111980.6564898) / -2446724367;\n 106616;\n x |= x;\n 1094927345;\n x -= (-1229759420 | 741260479.7854375) - x;\n 8353;\n x >>= x;\n 0;\n x >>>= (tmp = -327942828, tmp);\n -953397616.8888416;\n x += (tmp = -953397616.8888416, tmp);\n -1906641240.7776833;\n x += x + (-3033450184.9106326 >>> (tmp = 2090901325.5617187, tmp));\n -1906641240.7776833;\n x %= (tmp = 2584965124.3953505, tmp);\n -1098907671;\n x |= (tmp = -1272590495, tmp);\n -1.8305258600334393;\n x /= 600323489;\n -1;\n x &= x;\n -1;\n x |= x + x - x;\n 1;\n x *= x;\n 867473898;\n x ^= (tmp = 867473899.0274491, tmp);\n 6;\n x >>>= (tmp = 1174763611.341228, tmp);\n 0;\n x >>= 689882795 ^ 2250084531;\n 0;\n x /= (tmp = 2545625607, tmp);\n 0;\n x >>= x;\n 0;\n x += x;\n 0;\n x -= x * -1098372339.5157008;\n NaN;\n x %= x;\n NaN;\n x -= (tmp = -1797344676.375759, tmp);\n 1121476698;\n x |= (tmp = 1121476698, tmp);\n 1;\n x /= x;\n 1;\n x &= -191233693;\n 330137888.92595553;\n x += 330137887.92595553;\n -1792236714;\n x ^= (tmp = 2256609910, tmp);\n 269000724;\n x &= 316405813.62093115;\n 256;\n x >>= x;\n 256;\n x %= 2556320341.54669 | 1066176021.2344948;\n 256;\n x |= x;\n 131072;\n x <<= -1650561175.8467631 | x;\n -286761951;\n x -= (tmp = 287024095, tmp) - (-2293511421 & (x | x));\n -1561852927;\n x &= 3002663949.0989227;\n -460778761;\n x %= (tmp = -550537083, tmp);\n -3023749308.0492287;\n x += (tmp = -2562970547.0492287, tmp);\n -481313332.04922867;\n x %= (x | (tmp = -855929299, tmp) % (2181641323 % (x | 220607471.33018696))) & x;\n 17510668;\n x &= (tmp = 363557663, tmp);\n 12552;\n x &= 3020225307;\n 1814655896;\n x |= (x << -1475967464 * -3122830185 * x) + (x ^ -2480340864.2661023);\n -3209124403525266400;\n x -= 1146847590 * (tmp = 2798213497, tmp);\n -6418248807050533000;\n x += x;\n 1.1856589432073933e+28;\n x *= -1847324681.313275;\n -1238853292;\n x ^= -1238853292;\n -77428331;\n x >>= x & (2043976651.8514216 >>> x ^ x >>> ((tmp = -1785122464.9720652, tmp) % x << 1570073474.271266)) * x;\n 2011;\n x >>>= x;\n 2011;\n x &= x;\n 0;\n x >>= -2682377538;\n -1.1367252770299785;\n x -= (tmp = 2704334195.566802, tmp) / 2379056972 % ((-1764065164 * ((468315142.8822602 >> (x % ((tmp = 2537190513.506641, tmp) + (x & (x | (tmp = -947458639, tmp) ^ 2653736677.417406)) * (x << (1243371170.1759553 >>> ((tmp = 1572208816, tmp) << ((tmp = 963855806.1090456, tmp) >>> x)) % (-3078281718.7743487 * x)) ^ -1154518374) ^ -2839738226.6314087) ^ -2865141241.190915 * -2400659423.8207664) >> (tmp = 32940590, tmp) / (tmp = 2917024064.570817, tmp)) + (27601850 / (tmp = 3168834986, tmp) >> x)) + (tmp = 2528181032.600125, tmp)) / 3162473952);\n -1697395408.7948515;\n x -= 1697395407.6581264;\n 1536992607912062500;\n x *= (tmp = -905500627.5781817, tmp);\n 102759872;\n x >>= (tmp = -707887133.4484048, tmp);\n 102759872;\n x %= (tmp = -1764067619.7913327, tmp);\n 12543;\n x >>>= -144142995.1469829;\n -2059555229.2592103;\n x += -2059555229.2592103 - x;\n -537022593;\n x |= (tmp = -2770761410.407701, tmp);\n 23777505;\n x ^= -560496738.6854918;\n -64329014115772310;\n x *= (tmp = -2729234369.198843, tmp) + x;\n 189083830;\n x ^= (tmp = 933619934, tmp);\n 189083830;\n x %= (tmp = -2918083254, tmp) - (x | x ^ -2481479224.0329475);\n 378167660;\n x += x;\n -0.45833387791900504;\n x /= (tmp = 2727991875.241294, tmp) << (tmp = 2570034571.9084663, tmp);\n 0;\n x <<= x;\n -0;\n x /= (tmp = -67528553.30662966, tmp);\n 0;\n x <<= 938440044.3983492;\n -945479171;\n x ^= (tmp = -945479171, tmp);\n -225632619284361200;\n x *= 238643670.00884593;\n -0;\n x %= x;\n -585826304;\n x ^= -1256265560 << (tmp = 1144713549, tmp);\n -671583855;\n x ^= 183333265.1468178;\n -484311040;\n x <<= x;\n -3969762.62295082;\n x /= ((tmp = -1164308668.931008, tmp) - x) % x >>> (397816647 >> -1605343671.4070785 << x);\n 758097879;\n x ^= (tmp = -2871307491, tmp) ^ -2043176492.646442;\n 0;\n x *= x >> (tmp = 1983292927, tmp) & (tmp = -860505131.4484091, tmp);\n 0;\n x <<= x;\n 0;\n x &= x;\n 0;\n x %= 3132981707 - -2832016477;\n 0;\n x >>= x << (1830195133.0342631 >>> (tmp = -1003969250, tmp));\n NaN;\n x %= x;\n NaN;\n x += (tmp = 273271019.87603223, tmp);\n NaN;\n x += 625749326.1155348;\n 0;\n x >>= (tmp = -531039433.3702333, tmp);\n 0;\n x -= ((tmp = 2029464099, tmp) - (x - (tmp = -329058111.411458, tmp))) * (x << x);\n -0;\n x *= -1112957170.5613296 | (tmp = 847344494, tmp) >>> (tmp = 2735119927, tmp);\n -0;\n x /= (tmp = 544636506, tmp);\n 0;\n x >>>= x ^ 545093699;\n 0;\n x %= (tmp = -2208409647.5052004, tmp) + 3083455385.374988 + (-482178732.7077277 * x >>> 2661060565 * -2125201239);\n 0;\n x >>>= -212334007.34016395;\n 0.7004300865203454;\n x -= 2032883941 / -2902336693.0154715;\n 0;\n x <<= x << (265868133.50175047 >>> 1162631094);\n 604920272.4394834;\n x -= -604920272.4394834;\n 604920272;\n x &= x;\n 0;\n x <<= -1961880051.1127694 % (tmp = 1715021796, tmp) | ((tmp = 2474759639.4587016, tmp) | 243416152.55635);\n -46419074;\n x |= (tmp = -518945938.5238774, tmp) % (x + (tmp = 242636408, tmp) + -1974062910) | 1546269242.0259726;\n -46419074;\n x += -629802130 * ((tmp = -658144149, tmp) % (-905005358.5370393 >>> x));\n -46419074;\n x |= x % -1103652494;\n 7892881050983985;\n x *= -170035297.36469936;\n 1105701997.4273424;\n x %= (-490612260.0023911 >>> (tmp = 1803426906, tmp) ^ x % 2725270344.2568116) - 1010563167.8934317;\n 1088619532;\n x &= -2232199650;\n 1073807364;\n x &= -888024506.5008001;\n 1153062254980628500;\n x *= x;\n 1153062255703627000;\n x -= (tmp = -722998613.897227, tmp);\n -1141418584;\n x |= 3017232552.4814596;\n -373464140;\n x ^= -2914372068;\n 994050048;\n x <<= x;\n 0;\n x ^= x;\n 0;\n x &= (tmp = -3166402389, tmp);\n 0;\n x &= -1760842506.337213 | (tmp = 2538748127.795164, tmp);\n -0;\n x /= -2635127769.808626;\n 0;\n x &= ((tmp = 1414701581, tmp) ^ (2425608769 / (x << x ^ x - x) ^ ((tmp = -2641946468.737288, tmp) | (tmp = -313564549.1754241, tmp)))) * (tmp = -2126027460, tmp) | -2255015479;\n 225482894;\n x ^= 225482894.8767246;\n 0;\n x ^= x;\n 306216231;\n x += (tmp = 306216231, tmp);\n 306216231;\n x -= -465875275.19848967 & -806775661.4260025 / ((-184966089.49763203 >>> (x >> x) + ((tmp = -1951107532, tmp) | x)) % x * (2704859526.4047284 % (x * x >> x)));\n 30754;\n x &= 1706162402.033193;\n 30454.010307602264;\n x -= (590456519 >>> (tmp = 2713582726.8181214, tmp)) / x;\n 8419062;\n x |= 2848886788 << (tmp = 2993383029.402275, tmp);\n 16;\n x >>= (tmp = -1651287021, tmp);\n 1;\n x /= x;\n -1407643485;\n x ^= -1407643486;\n 2;\n x >>>= -1126004674;\n 470812081;\n x ^= -2411718964 >>> x;\n 550443688.6407901;\n x += (tmp = 79631607.6407901, tmp);\n 3669092443.64079;\n x -= -3118648755;\n -625874853;\n x <<= (tmp = -1640437346, tmp) / (x * x >>> x << x) / x;\n -1431439050363516700;\n x *= 2287101077;\n -1921660672;\n x |= ((-1912249689.9978154 & -1676922742.5343294) * 2625527768 << (820676465 ^ (x + (tmp = -852743692, tmp) & x - (1361714551 / 311531668 >>> (tmp = -1330495518.8175917, tmp) << ((tmp = 1369938417.8760853, tmp) * -1217947853.8942266 << -2048029668)) - -513455284) >>> (tmp = 1980267333.6201067, tmp)) << (1503464217.2901971 >> (tmp = 2258265389, tmp) >>> 1868451148) & x - (x ^ (tmp = -1565209787, tmp))) * x << (tmp = -2426550685, tmp);\n -1921660672;\n x %= (tmp = 523950472.3315773, tmp) + ((2971865706 ^ x) - x) & -1773969177;\n 420176973.1169958;\n x += 2341837645.116996;\n 420176973;\n x >>>= (tmp = -2485489141, tmp) << (tmp = -2520928568.360244, tmp) + x & 543950045.0932506;\n 50;\n x ^= x | (tmp = 2001660699.5898843, tmp) >>> (tmp = 1209151128, tmp);\n 138212770720.96973;\n x *= 2764255414.4193945;\n -28683;\n x |= (-535647551 | x) >> (2065261509 >> -354214733) * x + -3218217378.2592907;\n 1627048838;\n x ^= (tmp = -1627044749, tmp);\n -839408795;\n x ^= 2903337187.480303;\n -1000652427;\n x += (tmp = -161243632, tmp);\n 740237908.4196916;\n x += (tmp = 1587000348, tmp) + (tmp = 153889987.41969144, tmp);\n Infinity;\n x /= (-615607376.1012697 & 57343184.023578644) + (-1967741575 | -3082318496) << ((tmp = -958212971.99792, tmp) >> (tmp = 2962656321.3519197, tmp)) - (x | x * 969365195) << (tmp = -1739470562.344624, tmp);\n -Infinity;\n x /= (tmp = -1736849852, tmp) % x;\n 0;\n x <<= x;\n 0;\n x %= (tmp = -226505646, tmp);\n 1982856549;\n x -= (x + -1982856549) % -2274946222 >> x % ((tmp = -1289577208.9097936, tmp) >> x ^ 778147661);\n 1648018703;\n x ^= 3085618856 + ((tmp = 1546283467, tmp) & ((x | -2376306530 * (((tmp = -2807616416, tmp) % ((((tmp = 347097983.1491085, tmp) << x | (1135380667 / (x >>> (tmp = 1679395106, tmp)) ^ 1277761947 << ((tmp = -1614841203.5244312, tmp) >> x)) % ((tmp = 1552249234.2065845, tmp) >>> x) >>> (tmp = -1677859287, tmp)) >>> 2605907565) / (tmp = 2291657422.221277, tmp)) % (((tmp = 425501732.6666014, tmp) >>> 1327403879.455553) + x) >> ((tmp = -3075752653.2474413, tmp) & x - (tmp = -71834630, tmp)) | 2532199449.6500597 * -842197612.4577162 % x >> x) * (1220047194.5100307 << ((tmp = 1642962251, tmp) << (-662340 >>> ((tmp = -1672316631.3251066, tmp) << (tmp = 1762690952.542441, tmp) - x / 1904755683.3277364))) >> x) | ((tmp = 1625817700.7052522, tmp) % (tmp = -2990984460, tmp) | 2395645662) - (2619930607.550086 >> x) ^ (tmp = 130618712, tmp))) & -3142462204.4628367 / 1078126534.8819227) % ((tmp = -256343715.2267704, tmp) + x ^ (tmp = 2009243755, tmp)));\n 1937698223;\n x |= ((tmp = 866354374.7435778, tmp) + (tmp = 2751925259.3264275, tmp)) % -2252220455;\n 0;\n x -= x;\n -823946290.6515498;\n x -= (tmp = 823946290.6515498, tmp);\n 706970324;\n x ^= -457174758;\n 32916;\n x &= 25740724;\n 0;\n x >>>= -1658933418.6445677 | (tmp = -846929510.4794133, tmp);\n 0;\n x ^= -834208600 / (-1256752740 & (tmp = 1973248337.8973258, tmp));\n -1639195806;\n x += -1639195806;\n -1559416478;\n x ^= (tmp = 1349893449.0193534, tmp) * (tmp = 2044785568.1713037, tmp);\n 0;\n x &= (x >> (tmp = 1720833612, tmp)) / (x + -1305879952.5854573 ^ x);\n -0;\n x *= (tmp = -1713182743, tmp);\n 0;\n x >>= x;\n NaN;\n x /= (x % (x >>> ((-1515761763.5499895 ^ -3076528507.626539) << (tmp = 1293944457.8983147, tmp)) << (tmp = 276867491.8483894, tmp)) >> (tmp = -2831726496.6887417, tmp)) % (((tmp = 1780632637.3666987, tmp) ^ x) % (208921173.18897665 >> (tmp = 633138136, tmp)) + x);\n 0;\n x >>= (tmp = -2755513767.0561147, tmp);\n 0;\n x |= x;\n 840992300.0324914;\n x -= -840992300.0324914 + x;\n 840992300;\n x &= x;\n -1094140277;\n x ^= 2364029095;\n -Infinity;\n x /= (1257084956 << 2009241695 >> x + x) * x >>> x >>> 205318919.85870552;\n -Infinity;\n x -= (x >>> (tmp = 3037168809.20163, tmp) & x) * (x & 806151109 * x - (tmp = -1741679480.58333, tmp));\n 400659949;\n x ^= (tmp = 400659949, tmp);\n 5;\n x >>= (tmp = 1175519290, tmp);\n 5;\n x |= x;\n 0;\n x >>= x;\n 0;\n x >>= 1317772443 & x << x;\n -1123981819;\n x ^= (tmp = 3170985477, tmp);\n 1123864651;\n x ^= x % ((x & x & -2606227299.7590737) << (tmp = -2018123078.1859496, tmp) * x) | x + ((1935939774.8139446 / (-1303958190 / 2802816697.32639) << 2880056582 * x) + x + x);\n 1543368927;\n x |= -2795691884;\n NaN;\n x /= x % ((tmp = -1129915114, tmp) << x);\n NaN;\n x += (tmp = -3045743135, tmp);\n NaN;\n x -= (tmp = -2849555731.8207827, tmp);\n NaN;\n x /= (2127485827 >>> (((tmp = 363239924, tmp) >> x | ((tmp = -1419142286.0523334, tmp) - (x << x) ^ (tmp = -1990365089.8283136, tmp)) * ((tmp = 2780242444.0739098, tmp) >>> (-2336511023.342298 & x) / (tmp = 2296926221.402897, tmp))) >> ((tmp = 1378982475.6839466, tmp) >> (tmp = -816522530, tmp))) & (x ^ (tmp = -1668642255.0586753, tmp))) % (((tmp = 921249300.1500335, tmp) ^ x) * (tmp = -2228816905, tmp)) >> x;\n -1460685191;\n x |= (tmp = 2834282105, tmp);\n -1463439264;\n x &= (tmp = 2881860064.146755, tmp);\n 20.98100714963762;\n x /= 3017150580.7875347 ^ 250499372.5339837 << (tmp = -42767556.30788112, tmp) | x % -2829281526;\n 1;\n x /= x;\n 2;\n x += x;\n 8;\n x <<= x;\n 0;\n x >>>= 730174750 >>> x;\n 0;\n x ^= x;\n -1459637373;\n x ^= 2835329923.456409;\n -1233115861;\n x ^= 511678120;\n 95682857;\n x >>>= (tmp = 1534570885, tmp) | (tmp = -414425499.3786578, tmp);\n 70254633;\n x &= -1502067585;\n 51384749748909710;\n x *= (tmp = 731407276, tmp);\n 9390482.873469353;\n x %= (tmp = -592576964.7982686, tmp);\n 4695241;\n x >>>= (tmp = -1879898431.5395758, tmp);\n -3129811912538149000;\n x += (-727481809 ^ 3106908604 % x) * (((tmp = -1218123690, tmp) ^ x >> (-942923806 ^ x)) / (x + x) >>> -1508881888.969373);\n 1596870236;\n x ^= -1135673764.9721224;\n 0;\n x ^= x;\n 2133782410;\n x |= (-2202469371 >> (tmp = 1327588406.183342, tmp) / (tmp = 253581265.7246865, tmp)) - ((tmp = 2226575446.838795, tmp) ^ x);\n -81895217.83608055;\n x -= (tmp = 2215677627.8360806, tmp);\n 812089344;\n x <<= (tmp = 882824005, tmp) / (x >> ((((tmp = 1211145185, tmp) / (-137817273 - ((tmp = 2165480503.1144185, tmp) - -1840859887.1288517) * (155886014.8393339 >> (-1984526598 << (tmp = 1331249058.3246582, tmp)))) >> x * x) % 2830324652 % 933701061 | 1346496215) ^ (tmp = -988800810, tmp)) + x >>> x << -2372088384);\n 812089344;\n x <<= x;\n 8472;\n x %= ((x | x % (tmp = 2772099481.664402, tmp) + 2894690616 - x) & (x & (-715790638.6454093 >> (tmp = -1447931029, tmp)) - (tmp = 1761027889, tmp)) ^ x) % ((tmp = 830969811, tmp) | x | -1102267929 - 3193018687);\n -0.0000028559857417864914;\n x /= -2966401364;\n 0;\n x >>= x;\n -701800392;\n x += (tmp = -701800392, tmp);\n 2034756873;\n x -= (tmp = -2736557265, tmp);\n -0.9475075048394501;\n x /= 82879340.27231383 + (tmp = -2876678920.653639, tmp) * -2801097850 << x >>> (x << (((x | x) & (tmp = -1572694766, tmp)) >> x + x / (x - (((tmp = 1435301275, tmp) | (tmp = 983577854.212041, tmp)) >> (tmp = 632633852.1644179, tmp)) + x) >>> x | -850932021) >> x) << -821983991;\n 0;\n x >>= x >> 2424003553.0883207;\n 2599386349;\n x -= -2599386349;\n -68157441;\n x |= ((tmp = -1170343454.9327996, tmp) + (((tmp = 448468098, tmp) | x >> (x >> (x >> (x / (x & x << x) << 2436876051.2588806 ^ 3010167261)) % ((tmp = 2577616315.7538686, tmp) >>> -2953152591.015912) % ((tmp = -1304628613, tmp) / (x & (x | -2000952119 % (691146914 / ((tmp = 1480966978.7766845, tmp) << ((tmp = 2644449477.392441, tmp) | -2143869305.871568)))) + (tmp = -315254308, tmp))))) & -2060205555 | -604140518.8186448 ^ x * x)) % (x * ((tmp = 1383244000.2807684, tmp) / 3195793656));\n -68157441;\n x |= x;\n -1;\n x >>= x;\n -2147483648;\n x <<= x;\n -1.5257198286933313;\n x /= (tmp = 1407521622, tmp);\n 1149084989.47428;\n x += (tmp = 1149084991.9004865, tmp) & x ^ 2797053000 / (x ^ x) * -2829253694 >>> ((tmp = -610924351, tmp) >> x) >>> (tmp = -675681012, tmp) << 2812852729;\n 0;\n x %= x;\n 0;\n x <<= (tmp = -584069073, tmp) * -2953140326;\n 0;\n x <<= (tmp = -481515023.6404002, tmp);\n -1441535370;\n x ^= 2853431926;\n 2853431926;\n x >>>= ((tmp = 2215663525.9620194, tmp) % (-1102832735.9274108 / x) >> x & 3220898702.76322 & 2077584946 * (x >> x << (tmp = 1845701049, tmp) - x) / (tmp = 1947184202.5737212, tmp) | ((tmp = 2976351488, tmp) ^ -42517339) % (2648230244.410125 ^ 1520051731.31089)) / 1761635964;\n 43539;\n x >>>= (tmp = 1361671184.7432632, tmp);\n 21769;\n x >>= (tmp = -804932298.9572575, tmp) >> ((tmp = 1749006993.253409, tmp) + 276536978 ^ x | 2698166994);\n 1103025563;\n x |= (tmp = 1103007891, tmp);\n 1327594607;\n x += (tmp = 224569044, tmp);\n 1327594607;\n x |= x;\n -478674944;\n x <<= 672378508 & x ^ (-2070209708.6470091 | x | x >>> x);\n -478674943;\n x ^= -1832457698.6345716 >>> (tmp = -3077714019, tmp) / 1809383028;\n 229129701056053250;\n x *= x;\n 1;\n x /= x;\n 2;\n x <<= -1522529727;\n 2;\n x &= x;\n -2016989182;\n x |= (tmp = -1267845511, tmp) * 1225350332 + ((tmp = -1397690831.5717893, tmp) >>> (tmp = -2575382994, tmp)) + x;\n -241;\n x >>= (tmp = 931869591, tmp);\n -1048087547;\n x &= (tmp = -1048087403.1163051, tmp);\n -4004486369.844599;\n x += (tmp = -2956398822.844599, tmp);\n -4004486368.844599;\n x -= 2701878498 >> x | (x | -1079354967);\n 1;\n x >>= (tmp = -1583689092, tmp);\n 1;\n x *= x >> x % x;\n 0;\n x %= x;\n -0;\n x *= -120818969;\n 0;\n x >>= (tmp = 1794099660, tmp) / (x & ((-321906091 ^ (tmp = -3009885933.8449526, tmp)) & ((tmp = -140917780, tmp) | 2037803173.4075825)) & x & (tmp = -745357154, tmp));\n 0;\n x <<= 563984257.3493614;\n NaN;\n x %= (x >> (tmp = -2190891392.320677, tmp)) - x << 462714956 << ((tmp = -84413570, tmp) | (x | -2787022855) - ((tmp = 2028532622, tmp) | (tmp = 1103757073.9178817, tmp)));\n NaN;\n x *= 2137674085.3142445 | (tmp = -1054749859.2353804, tmp) % x;\n NaN;\n x /= x >>> ((((tmp = 597103360.9069608, tmp) >>> -2850217714.1866236) - (tmp = 1125150527, tmp) * x) % (tmp = -982662312, tmp) | x / (968656808.6069037 * (128484784.15362918 >> x ^ x) & (x / ((tmp = 748775979, tmp) * ((x - (tmp = 709571811.9883962, tmp) % -2083567026 % (x / (tmp = -680467505, tmp))) / ((tmp = -167543858, tmp) / (tmp = -3113588783, tmp))) / x << -2605415230) >>> (tmp = 3133054172, tmp)) % (tmp = -1904650393, tmp) * ((x | -1193709562) * (tmp = -1731312795.718104, tmp))) / ((tmp = -672386301, tmp) / (tmp = 808898833.4163612, tmp)));\n -9;\n x |= ((tmp = 150377964.57195818, tmp) / (tmp = 2161910879.0514045, tmp) - -2381625849 >> -2715928517) / ((452113643 ^ -2502232011) / (-3076471740 ^ (tmp = 1664851172, tmp) * (-1460011714 >>> x << -2870606437 % x) * ((tmp = -2836565755.609597, tmp) - (x / (tmp = -871461415, tmp) - 2278867564))));\n -1;\n x >>= x;\n -1;\n x |= -1319927272 >>> -2866709980;\n -1;\n x >>= 2345179803.155703 & -978025218.2243443;\n 1;\n x /= x;\n -260730973;\n x |= (tmp = -260730973, tmp);\n 1174405120;\n x <<= 2681054073;\n 1174405120;\n x &= x;\n 1073741824;\n x &= (tmp = 2017166572.7622075, tmp);\n 1073741824;\n x |= x;\n 168806102;\n x %= ((tmp = -2939969193.950067, tmp) | -2325174027.614815 / -2329212715) * (x / (-2927776738 / (x | x) + x % (tmp = -3007347037.698492, tmp) << -1898633380 >> (tmp = 204338085.45241892, tmp))) ^ x;\n 168806102;\n x %= -832849739.5197744 & (tmp = -141908598, tmp);\n -401033205.05225074;\n x -= (tmp = 569839307.0522507, tmp);\n -401033205;\n x &= x;\n -401130402;\n x ^= x * (tmp = 311418759.22436893, tmp) >> x;\n 793533469;\n x ^= -950312893.5201888;\n 756;\n x >>>= -1096189516;\n 711;\n x += (tmp = -753105189, tmp) >> 599823192.5381484;\n 0;\n x >>>= (tmp = -2859668634.4641137, tmp) + -1160392986.1521513;\n 2427599726.176195;\n x -= -2427599726.176195;\n 1942312465.2523103;\n x -= 485287260.92388475;\n 0;\n x >>>= (tmp = -1740656456, tmp) / (tmp = 1339746799.9335847, tmp);\n 0;\n x <<= -7017077.38786912 * (-699490904.4551768 ^ x);\n 0;\n x <<= (tmp = 715662384, tmp);\n 0;\n x *= x >>> 2149735450.0758677;\n NaN;\n x /= x;\n 0;\n x >>= 397078885 * (851639692.8982519 - x);\n 0;\n x &= -2526654445;\n 0;\n x %= -1204924598;\n 251639720;\n x ^= x | (tmp = 251639720, tmp);\n 695433573;\n x ^= 663539405;\n -1038050104;\n x -= 1733483677;\n 0;\n x ^= x;\n NaN;\n x %= x;\n 0;\n x &= 392107269;\n 0;\n x %= -3084908458.241551;\n 0;\n x ^= x;\n -2121660509;\n x ^= (tmp = -2121660509.7861986, tmp);\n 2285041855588855800;\n x *= x | 3209046634;\n 54915072;\n x >>>= x % (((x % ((((tmp = -1429433339.5078833, tmp) | (tmp = 2906845137, tmp)) ^ 3207260333) & -848438650) - -2721099735 & 141851917.19978714) + x) / x);\n 54915072;\n x &= x;\n 54915072;\n x %= x + 1855489160;\n 70078753;\n x ^= (-1648661736 + x % (-1421237596 + (tmp = 2053180992.3857927, tmp)) + (tmp = 38606889, tmp) << -241334284 % ((x >> 215316122) * (tmp = 396488307, tmp))) + ((tmp = -2900704565, tmp) ^ x) ^ (1103481003.1111188 ^ x) - (tmp = 1304113534, tmp);\n 1149501440;\n x <<= (x >> (tmp = 3203172843, tmp)) * (tmp = -192535531, tmp);\n 0;\n x ^= x;\n 0;\n x >>= (tmp = 2751499787, tmp) & (tmp = 2217654798, tmp) * (tmp = -2798728014, tmp);\n NaN;\n x /= (-2019592425 >>> ((-1571930240.741224 >>> -183952981 / ((1990518443.672842 >> (2051371284 % 685322833.6793983 >>> 2662885938 << -1212029669.6675105 | -2790877875 << 1546643473) << x) - (tmp = 804296674.4579233, tmp))) - (tmp = -417759051.68770766, tmp)) / (-621859758 >>> x) & x) << (tmp = -48558935.55320549, tmp);\n 0;\n x <<= x & x;\n 0;\n x *= x % (tmp = 301196068, tmp);\n 398290944;\n x |= ((tmp = 1904146839, tmp) + 1521017178) * -3174245888.562067;\n 1256401076;\n x ^= 1566464180;\n 149620758;\n x %= (tmp = 532626355, tmp) ^ (tmp = -382971203, tmp);\n 149620791;\n x |= x >> x;\n -0.07034576194938641;\n x /= (tmp = -1977313182.7573922, tmp) - x;\n 0;\n x <<= x;\n 0;\n x &= x;\n 0;\n x /= 2182424851.139966 % (-2768516150 + x >>> x);\n 0;\n x %= -504299638.53962016;\n -0;\n x *= -2915134629.6909094;\n 0;\n x <<= (tmp = 952692723.402582, tmp) % 2146335996.785011;\n 230457472;\n x |= (tmp = -574776101.8681948, tmp) * 683185125;\n 933795934;\n x ^= (tmp = 974395614, tmp);\n 933801974;\n x ^= x >>> -148683729 * (((tmp = 2912596991.415531, tmp) ^ -2883672328) / x);\n 222;\n x >>= -3060224682;\n 27;\n x >>>= 1429156099.1338701;\n 754519106;\n x ^= (tmp = 754519129.7281355, tmp);\n 188629776;\n x >>>= (x >>> (1247267193 << (tmp = -936228622, tmp))) % ((tmp = 978604324.8236886, tmp) * ((tmp = -3018953108, tmp) ^ ((tmp = 259650195, tmp) >>> (tmp = 2762928902.7901163, tmp)) * (x >> (tmp = 787444263.5542864, tmp) / (x >>> (-2039193776 << (tmp = -1408159169, tmp)) - 1238893783))));\n 188629775.33987066;\n x += (tmp = 1040520414, tmp) / (-1576237184 | (tmp = -970083705, tmp) & ((tmp = -312062761.12228274, tmp) | 1171754278.2968853) << -2069846597.7723892);\n 1473670;\n x >>>= (tmp = 202409672, tmp) ^ x;\n 2171703268900;\n x *= x >> ((tmp = 840468550, tmp) & -3208057101.2136793) / x;\n 0;\n x ^= x;\n 0;\n x ^= x & ((tmp = 2569871408.2405066, tmp) | (tmp = -3149374622, tmp) << x - (x | (tmp = -821239139.1626894, tmp) >>> x));\n NaN;\n x /= x;\n NaN;\n x %= (tmp = 1926106354, tmp);\n 0;\n x >>= x / -2848416 / (tmp = 2484293767, tmp);\n 0;\n x <<= (tmp = -2484137114, tmp) >>> (tmp = -887083772.8318355, tmp);\n 0;\n x >>= (tmp = -2651389432, tmp);\n 0;\n x ^= x;\n 1041871201;\n x += (tmp = 1041871201.9272791, tmp) | x << -1136959830;\n 651390879501530900;\n x *= (tmp = 1250424964.0346212, tmp) >> x;\n 1965815296.245636;\n x %= 2650603245.655831 + (-1610821947.8640454 >>> (878987151.6917406 * ((784630543 % ((1448720244 >> (tmp = 3036767847, tmp) + ((tmp = 1012548422, tmp) << 1957000200) - x) / (x >> x)) << (tmp = 914710268, tmp) * ((x ^ 1559603121) << (tmp = 3181816736, tmp) | -1964115655 + x)) - -1055603890) & 946797797.0616649));\n 1965815296.245636;\n x %= (tmp = -2601038357.593118, tmp);\n -769384440.872302;\n x += -2735199737.117938;\n -769384440.872302;\n x %= 2193123162;\n 1;\n x /= x;\n 1;\n x -= (x >>> -1968465925) * ((tmp = 563037904, tmp) >> ((tmp = 3009534415.769578, tmp) >> (-2567240601.7038674 << (tmp = -1258402723.4150183, tmp)))) % 3112239470.276867;\n 1;\n x |= x;\n 1505461527;\n x ^= (tmp = 1505461526.5858076, tmp);\n 406553877;\n x &= (tmp = 2558242293, tmp);\n 406553877;\n x |= x;\n -574902339;\n x |= -709809495 % (tmp = -2880884811.410611, tmp);\n -20281777.349363208;\n x %= 22184822.46602547;\n 1;\n x /= x;\n -4360732;\n x ^= (x | (tmp = 3178620274, tmp)) >> (2686286888 & -1107223053.8716578 / (-2955575332.3675404 + -2770518721 | -2705016953.640522) - x ^ 1473641110.4633303 * (((-1466496401 << x) + x) % 1805868749.082736));\n -1158545408;\n x <<= x / (-2710098221.691819 - -2421462965.788145) / ((((x >>> (tmp = 1994541591.1032422, tmp)) + (tmp = -1276676679.9747126, tmp) & (tmp = 1764029634.2493339, tmp) + ((x | (tmp = -3050446156, tmp)) - (tmp = -9441859, tmp) / ((-2072420232 & x) * -1003199889))) + (tmp = -2443230628, tmp)) * x) * ((x & ((x | 747566933) * (2039741506 >>> ((tmp = -2456000554, tmp) >>> -1566360933.7788877) ^ (tmp = 960600745, tmp) / x) & (x ^ (-2649310348.777452 ^ 2224282875 - (tmp = -2129141087.3182096, tmp)) << (x << x) + (-1307892509.3874407 - (x | (tmp = -2831643528.9720087, tmp))))) / (((tmp = -35502946, tmp) << ((tmp = 1091279222, tmp) >> -2686069468.8930416 - x + (tmp = 367442353.2904701, tmp))) % 1218262628)) / x) ^ -919079153.7857773;\n 747;\n x >>>= 1229157974;\n 747;\n x |= x;\n NaN;\n x %= 3086718766.4715977 * (7912648.497568846 * (-2713828337.1659327 * -176492425.4011252)) << (tmp = -1074475173, tmp);\n 0;\n x >>>= (444923201 << x >>> -883391420.2142565) * ((617245412 << x >>> x) * -913086143.2793813);\n 1941802406;\n x ^= (tmp = -2353164890, tmp);\n 14;\n x >>>= -1600311077.4571416;\n -18229482703.7246;\n x += (x + -993157139.7880647) % x * 1862419512.1781366;\n -14.531388114858734;\n x /= (tmp = -1649072797.951641, tmp) << x;\n 0;\n x ^= x;\n 0;\n x >>= x / x ^ x;\n 2;\n x ^= -1597416259 / -738770020;\n 0;\n x >>= (tmp = -387850072.74833393, tmp);\n 0;\n x >>>= 2491085477.186817 >> x * ((tmp = -1592498533, tmp) + (tmp = 2086841852, tmp) & -3174019330.8288536);\n 0;\n x >>= x;\n 0;\n x >>>= (tmp = -3045348659.45243, tmp);\n -1208573479;\n x |= 3086393817 - x;\n 1460649854142163500;\n x *= x;\n 1588199424;\n x <<= -1902076952;\n 1586102272;\n x &= (tmp = 2139876091.9142454, tmp);\n -460908552.5528109;\n x -= (tmp = 2047010824.552811, tmp);\n -460908552.5528109;\n x %= (tmp = 507904117.09368753, tmp);\n -460908552.5528109;\n x %= 2749577642.527038;\n 234012;\n x >>>= -340465746.91275;\n 0;\n x >>>= x;\n 0;\n x %= (tmp = -2601875531, tmp);\n 0;\n x %= x | (tmp = 650979981.1158671, tmp);\n 0;\n x %= (tmp = -2286020987, tmp);\n 0;\n x |= x;\n 0;\n x &= x | (tmp = 2568101411, tmp) - -1438002403;\n 0;\n x >>>= 1399248574;\n 0;\n x %= -1906670287.2043698;\n 0;\n x >>= 1019286379.6962404;\n 0;\n x |= x / (tmp = -82583591.62643051, tmp);\n NaN;\n x %= x;\n NaN;\n x *= x ^ 1874776436;\n NaN;\n x -= -1238826797 - -2971588236.7228813;\n 0;\n x <<= 2064632559;\n -0.5967273958864694;\n x += ((tmp = 1502995019, tmp) >> x) / -2518729707;\n 0;\n x >>>= x;\n -0;\n x /= -1923030890;\n NaN;\n x %= x;\n 0;\n x >>= (tmp = 1081732779.9449487, tmp);\n -820183066;\n x |= (tmp = -3169007292.4721155, tmp) | -1912588318;\n 0;\n x -= x;\n NaN;\n x %= x;\n NaN;\n x /= (tmp = 287181840, tmp);\n 0;\n x &= x / ((tmp = -1139766051, tmp) << (x & (tmp = 2779004578, tmp)));\n 0;\n x >>= ((tmp = -1816938028, tmp) + -224851993.3139863) * -2933829524;\n 0;\n x |= (((tmp = 305077929.1808746, tmp) & (x - (((tmp = 2122810346.7475111, tmp) << 717271979) * (tmp = 256854043.72633624, tmp) % ((x + (tmp = -318657223.9992106, tmp)) * (1993144830 << 2594890698.603228)) ^ ((tmp = 257370667, tmp) >>> ((x ^ 3160746820) >>> 2049640466.8116226 >>> 2543930504.7117066 ^ x - x) ^ x % 964838975 ^ x))) % (x * x)) >>> x) * (tmp = -46861540, tmp);\n 747575633;\n x ^= -2406502427 - -3154078060.3794584;\n 0;\n x *= x % x;\n 0;\n x <<= 1313773705.3087234;\n 0;\n x >>>= x + x >>> 3068164056;\n -0;\n x *= (tmp = -1771797797, tmp);\n 1784146970;\n x ^= (tmp = 1784146970, tmp);\n 1784146970;\n x >>>= (tmp = -2219972320.7195597, tmp);\n 1744830464;\n x <<= (-2769476584 - (1798431604 >> (tmp = 1337687914.799577, tmp) >>> (-2802941943.15014 >> x)) >>> (tmp = 646033678, tmp)) - x;\n 3044433348102455300;\n x *= x;\n 0;\n x >>= (tmp = 1592076570.1900845, tmp) - (645774223.6317859 >> x);\n 0;\n x >>= x >>> -3045822290.1536255;\n -0;\n x *= (tmp = -2450298800.986624, tmp);\n 0;\n x >>= (tmp = 1379605393, tmp);\n 0;\n x &= (x - ((tmp = 837939461.6683749, tmp) + ((-813261853.3247359 | x & (-2565113940 * (tmp = -2725085381.240134, tmp) | x)) % -1457259320 - (x + (tmp = -273947066, tmp) % (1164825698.879649 >> 1653138880.3434052))) >>> 2823967606.411492 >>> (((1189235604.9646997 / (tmp = -2875620103.4002438, tmp) - (tmp = -801261493, tmp) << (1832556579.5095325 << x | (tmp = -2740330665, tmp) >> (tmp = -2352814025, tmp))) - (tmp = -1445043552.99499, tmp) & x << ((445325471 * 1293047043.1808558 >>> (1901837408.5910044 - (tmp = -2349093446.5313253, tmp) >>> (tmp = 1000847053.1861948, tmp))) * (x >>> 1771853406.6567078) >> x)) >>> x >>> (x ^ (tmp = 2813422715, tmp) - (x + -342599947)))) & x >>> x) * x;\n NaN;\n x %= (tmp = -3027713526, tmp) - (x % ((x / (2711155710 ^ ((x >>> x) % (1098599291.155015 ^ (tmp = 1855724377.8987885, tmp) / (x | x) * (-1963179786 * (x - -1634717702 % x << x)) >> 2008859507 >> ((tmp = 2635024299.7983694, tmp) ^ (tmp = -602049246, tmp))) * (x >> x) & (tmp = -1925103609, tmp)) * ((tmp = 2106913531.2828505, tmp) % ((tmp = -200970069, tmp) * -2809001910.951446))) % x * (1990098169 >> (x << 2303347904.2601404) % x) | 2767962065.9846206) + 201589933.301661) >> ((tmp = 1921071149.5140274, tmp) >> 1054558799.1731887 | x)) * (x / ((-2833879637.345674 >>> (tmp = 2849099601, tmp)) % x + x % (x % (((tmp = 1983018049, tmp) ^ (tmp = -2659637454, tmp)) >> -1335497229.6945198 - (x + ((tmp = 1136612609.848967, tmp) % 2471741030.01762 << (x | (tmp = 1644081190.1972675, tmp) & -1422527338 ^ 2379264356.265957)) / (tmp = 2979299484.1884174, tmp) / x))))) * ((tmp = 1858298882, tmp) ^ (tmp = -547417134.9651439, tmp) * x);\n -7664;\n x |= 2286000258.825538 >> 1716389170;\n -1;\n x >>= x;\n -1231640486.3023372;\n x += (tmp = 1231640485.3023372, tmp) * x;\n -2463280972.6046743;\n x += x;\n 1746;\n x >>>= x;\n 1746;\n x >>>= (tmp = -562546488.0669937, tmp) * (-2475357745.8508205 & x % 821425388.8633704 % ((-2315481592.687686 & (tmp = 3130530521.7453523, tmp) + x - x ^ -973033390.1773088) / x)) << x;\n 1746;\n x %= -1544973951.076033;\n 27936;\n x <<= -525441532.33816123;\n 27936;\n x %= x * ((tmp = 344991423.5336287, tmp) + -2267207281);\n 27;\n x >>>= (tmp = 1249792906, tmp);\n 0;\n x >>>= (tmp = -1068989615, tmp);\n 0;\n x >>>= (tmp = 347969658.92579734, tmp);\n -2656611892;\n x -= 2656611892;\n 1944539596;\n x |= (tmp = 3000889963, tmp) - x << ((tmp = 2917390580.5323124, tmp) ^ -996041439);\n 1944539596;\n x |= x;\n -739740167.0752468;\n x -= 1712009965.0752468 + (x >> ((tmp = -740611560.99014, tmp) >>> ((tmp = -1033267419.6253037, tmp) & 862184116.3583733)));\n -1479480334.1504936;\n x += x;\n -4294967296.150494;\n x -= x >>> (1219235492.3661718 & 3138970355.0665245);\n 0;\n x >>= x * x;\n -0;\n x *= -2202530054.6558375 - -676578695;\n -0;\n x %= 1336025846;\n 0;\n x &= x;\n 0;\n x /= 1759366510;\n 630007622;\n x |= 630007622;\n -0.22460286863455903;\n x /= (tmp = -2804984753, tmp);\n 1102410276.775397;\n x -= -1102410277;\n 1102410276.775397;\n x %= (-2569525203 & x) * (x | -1932675298) / (-2376634450 >>> (x >>> (tmp = 936937604.9491489, tmp)));\n 33642;\n x >>= 3028252527;\n 2181106522.688034;\n x -= -2181072880.688034;\n -2113861630;\n x &= 2523921542;\n -2147483646;\n x &= -1996601566.9370148;\n -2147483648;\n x &= (tmp = -665669175.1968856, tmp);\n -2858673260.1367273;\n x -= (tmp = 711189612.1367272, tmp);\n 350657;\n x >>= (tmp = -170243892.25474262, tmp);\n -0.0001405571562140975;\n x /= -2494764474.7868776;\n 0;\n x ^= x;\n NaN;\n x /= (x & -2041236879) * ((tmp = -2182530229, tmp) ^ 1274197078 * x);\n 0;\n x |= x & x - 1794950303;\n 1222105379;\n x |= (tmp = 1222105379, tmp);\n 729884484;\n x ^= (tmp = 1666645607.6907792, tmp);\n 729884484;\n x %= (tmp = -2896922082, tmp);\n 8768;\n x &= (tmp = 358940932, tmp) >>> 3159687631.3308897;\n 1892384495;\n x |= -2402591569;\n 1892470533;\n x += (x ^ -2266612043) >>> (tmp = -531009952, tmp) << (x >>> (-1365315963.5698428 >>> x + (-3168207800.184341 - (tmp = 1776222157.609917, tmp)) + -1588857469.3596382)) >>> x;\n 143587205;\n x += (tmp = -1748883328, tmp);\n 0;\n x ^= x;\n 0;\n x >>= (tmp = 2334880462.3195543, tmp);\n 0;\n x &= (tmp = 1819359625.4396145, tmp) | (tmp = -1323513565, tmp);\n -1102259874;\n x ^= 3192707422;\n 2567457772588852700;\n x *= -2329267202;\n -16783687;\n x |= -2212476227.060922 ^ 378973700.78452563;\n 4278183609;\n x >>>= (((tmp = 1766363150.197206, tmp) * -2774552871 % x >>> (3071429820 & (((tmp = 351068445.27642524, tmp) << (tmp = 2646575765, tmp) ^ 806452682) << (x >>> -2217968415.505327 << 1564726716) | x) - (tmp = -3110814468.9023848, tmp))) + x ^ x) >>> (tmp = -617705282.0788529, tmp) >>> x;\n 4314933530;\n x -= 1032195469.789219 | (tmp = -448053861.9531791, tmp);\n 9709850;\n x %= (tmp = -3056286252.5853324, tmp) * x & x;\n 9709850;\n x %= (tmp = -2596800940, tmp);\n 2655489828.9461126;\n x -= (tmp = -2645779978.9461126, tmp);\n 369266212;\n x &= (335712316.24874604 | (tmp = 33648215, tmp)) - (x / 2639848695 << (-499681175 << -2490554556));\n -2147483648;\n x <<= -834465507;\n 1073741824;\n x >>>= (tmp = 3018385473.1824775, tmp) >> x * -2574502558.216812 | (tmp = -1742844828, tmp) * 1698724455 & x;\n -270818218;\n x += -1344560042;\n 360710144;\n x <<= x;\n 0;\n x <<= (tmp = 612718075, tmp);\n 0;\n x <<= x;\n -0;\n x /= (tmp = -1922423684, tmp);\n -0;\n x *= (tmp = 741806213.3264687, tmp) % -711184803.2022421 + ((tmp = -3209040938, tmp) & 525355849.044886) & x << (tmp = -698610297, tmp);\n 0;\n x <<= -482471790;\n 0;\n x &= -921538707 / (tmp = -482498765.988616, tmp);\n 0;\n x ^= x ^ x;\n -351721702;\n x ^= -351721702.8850286;\n 726242219625599900;\n x -= 2064820612 * x;\n 1452484439251199700;\n x += x;\n 2.52318299412847e-15;\n x %= (x << 2508143285 + x >> -2493225905.011774) % 1867009511.0792103 / ((x << 2542171236 >> ((x | x) & (tmp = -384528563, tmp))) + -1168755343 * 1731980691.6745195 + (tmp = -1608066022.71164, tmp));\n 79905008;\n x += (-2702081714.590131 & x + (tmp = -1254725471.2121565, tmp)) * 3088309981 % (((tmp = 1476844981.1453142, tmp) | ((tmp = -1243556934.7291331, tmp) % x ^ -1302096154) + 660489180 / (tmp = -681535480.8642154, tmp)) ^ (tmp = -8410710, tmp));\n 1215822204;\n x ^= -3008054900 >>> (tmp = -1990206464.460693, tmp);\n -394790532;\n x |= (-1334779133.2038574 + (tmp = -1407958866.832946, tmp) << 1699208315) - ((x ^ x % x) << 3216443 >> x + (2576716374.3081336 | (tmp = 2316167191.348064, tmp) & (51086351.20208645 & ((x | (tmp = -357261999, tmp)) ^ x / x))) * -45901631.10155654 * ((-439588079 >>> (-2358959768.7634916 | 1613636894.9373643)) + (-908627176 << x) % (x % (-1669567978 >>> (x >> 1289400876) + (tmp = 2726174270, tmp)))));\n -0.17717467607696327;\n x /= 2228255982.974148;\n -1905616474;\n x ^= (tmp = 2389350822.851587, tmp);\n -0;\n x %= x;\n 2818124981.508915;\n x -= -2818124981.508915;\n -1476842315;\n x |= x;\n 73408564;\n x &= -3147390604.3453345;\n 70;\n x >>>= x;\n 1;\n x >>= x;\n 3086527319.899181;\n x *= 3086527319.899181;\n -145;\n x >>= x;\n -145;\n x %= (tmp = -2500421077.3982406, tmp);\n -1;\n x >>= (tmp = -2970678326.712191, tmp);\n -1;\n x %= (tmp = -535932632.4668834, tmp) + (-1226598339.347982 << (tmp = 616949449, tmp) / (tmp = 2779464046, tmp)) / 214578501.67984307;\n 1;\n x *= x;\n 1;\n x >>= (tmp = 11080208, tmp) << 460763913;\n -1.8406600706723492e-19;\n x /= (tmp = -2334126306.1720915, tmp) * (tmp = 2327566272.5901165, tmp);\n 856681434186007200;\n x -= (tmp = -2286974992.8133907, tmp) * 374591518;\n 3126084224;\n x >>>= x;\n -1160460669;\n x |= (tmp = 181716099, tmp);\n 873988096;\n x <<= (tmp = 406702419, tmp);\n 0;\n x <<= (tmp = 802107965.4672925, tmp) - ((tmp = 1644174603, tmp) >> (tmp = 604679952, tmp) + (tmp = -515450096.51425123, tmp));\n NaN;\n x %= (x >> (tmp = 2245570378, tmp)) * (tmp = 1547616585, tmp);\n NaN;\n x /= (tmp = -776657947.0382309, tmp) & (tmp = 163929332.28270507, tmp);\n NaN;\n x *= (tmp = 243725679.78916526, tmp);\n NaN;\n x /= x >> x;\n 0;\n x <<= (tmp = -1293291295.5735884, tmp) % ((63309078 >>> x & (x & -2835108260.025297)) + x >>> -1317213424);\n 0;\n x *= ((tmp = -1140319441.0068483, tmp) * (tmp = 2102496185, tmp) & -2326380427) << (tmp = -2765904696, tmp);\n 0;\n x /= (tmp = 2709618593, tmp);\n 0;\n x >>= -1753085095.7670164;\n 1766381484;\n x |= -2528585812;\n 1766381484;\n x %= 2735943476.6363373;\n 1766381484;\n x %= x * (tmp = 2701354268, tmp);\n -2147483648;\n x <<= -323840707.4949653;\n 4611686018427388000;\n x *= x << x;\n 0;\n x <<= 3066735113;\n 0;\n x ^= (x * x ^ (tmp = -2182795086.39927, tmp)) << (x ^ (tmp = 1661144992.4371827, tmp)) << ((-2885512572.176741 * (tmp = 609919485, tmp) | (tmp = 929399391.0790694, tmp)) >>> (((399048996 >> (-107976581.61751771 >>> x) | -1502100015 << (tmp = -1108852531.9494338, tmp) & x / (tmp = -3198795871.7239237, tmp)) + (-2627653357 >> x) >>> x) * 1066736757.2718519 % (tmp = 1326732482.201604, tmp) / (tmp = 2513496019.814191, tmp) >>> (1694891519 >>> -2860217254.378931) << (tmp = 31345503, tmp)));\n 0;\n x ^= x / (-2556481161 >>> x / (x % (x & 1302923615.7148068)));\n NaN;\n x /= x;\n NaN;\n x += (tmp = 846522031, tmp);\n 0;\n x >>= x + -1420249556.419045;\n 0;\n x ^= (x % -1807673170 & x) - x;\n -3484.311990686845;\n x -= (-510347602.0068991 >>> x << ((tmp = 1647999950, tmp) & 305407727 >> (1781066601.791009 & x) << (tmp = -998795238, tmp) % (x / x + x << (2586995491.434947 << x) - ((tmp = 545715607.9395425, tmp) * x >>> x >>> (((2332534960.4595165 ^ -3159493972.3695474) << (tmp = 867030294, tmp) | 2950723135.753855) ^ 3150916666 << x >> ((tmp = 414988690, tmp) | (tmp = -1879594606, tmp) / (tmp = 1485647336.933429, tmp)))))) >> (tmp = -2676293177, tmp)) % 617312699.1995015 / ((((tmp = -1742121185, tmp) ^ ((x & x) << (tmp = 698266916, tmp)) / -1860886248 + -213304430 % (((-2508973021.1333447 + (tmp = 2678876318.4903, tmp) & (tmp = -43584540, tmp)) - x ^ -2251323850.4611115) - x)) >>> (tmp = 2555971284, tmp)) % (((tmp = 16925106, tmp) ^ x) & x | x / ((x | (tmp = -2787677257.125139, tmp)) << -853699567) + (tmp = -1721553520, tmp)));\n -447873933.26863855;\n x += -447870448.9566479;\n 200591060101520900;\n x *= x;\n 200591062202483420;\n x -= -2100962536;\n -5.261023346568228e+24;\n x *= (tmp = -419641692.6377077, tmp) >> (tmp = -224703100, tmp);\n 1269498660;\n x |= 195756836;\n 1269498660;\n x |= x;\n 1269498660;\n x |= x;\n -37.75978948486164;\n x /= (tmp = -595793780, tmp) + ((tmp = 2384365752, tmp) >>> 1597707155) | 968887032 ^ (tmp = 2417905313.4337964, tmp);\n -37.75978948486164;\n x %= (tmp = -1846958365.291661, tmp);\n 1102319266.6421175;\n x += 1102319304.401907;\n -1664202255175155200;\n x -= (x ^ (tmp = 407408729, tmp)) * x;\n -752874653;\n x ^= (tmp = 314673507, tmp);\n -72474761;\n x |= (tmp = -2538726025.8884344, tmp);\n -72474761;\n x |= x;\n -122849418;\n x += (tmp = -2332080457, tmp) | ((30496388.145492196 * ((-1654329438.451212 | -2205923896) & x >> (tmp = -1179784444.957002, tmp)) & (tmp = 319312118, tmp)) * 651650825 | (-2305190283 | x) >>> -428229803);\n 994;\n x >>>= x;\n 614292;\n x *= ((2565736877 / ((tmp = 649009094, tmp) >>> (x >>> 2208471260 >> (x >>> x)) % x) & (tmp = 357846438, tmp)) << (tmp = -2175355851, tmp)) % x;\n 1792008118;\n x |= (tmp = 1791924774.5121183, tmp);\n 1246238208;\n x &= (tmp = 1264064009.9569638, tmp);\n -88877082;\n x ^= 2969289190.285704;\n 0.044923746573582474;\n x /= (tmp = -3057438043, tmp) ^ -1009304907;\n 0;\n x <<= -828383918 - ((x >> 734512101) * (tmp = -3108890379, tmp) - (x | (tmp = 3081370585.3127823, tmp) ^ -271087194 - x / (tmp = -2777995324.4073873, tmp))) % x;\n 1604111507.3365753;\n x -= -1604111507.3365753;\n -1721314970;\n x ^= (tmp = -956686859, tmp);\n -102247425;\n x |= (tmp = -2535095555, tmp);\n -102247425;\n x %= -955423877;\n 1053144489850425;\n x *= (tmp = 1583243590.9550207, tmp) & 1356978114.8592746 | (tmp = -10299961.622774363, tmp);\n -0.0043728190668037336;\n x /= -1196259252.435701 * ((-689529982 | (tmp = -1698518652.4373918, tmp)) << x);\n -2;\n x ^= x + (tmp = 2961627388, tmp) >> (tmp = 231666110.84104693, tmp) | x;\n -1;\n x >>= (tmp = -83214419.92958307, tmp);\n -1;\n x %= -1303878209.6288595;\n 2944850457.5213213;\n x -= (tmp = -2944850458.5213213, tmp);\n -1.6607884436053055;\n x /= -1773164107;\n -0.6607884436053055;\n x %= (x >> 1240245489.8629928) % (tmp = -3044136221, tmp);\n -0;\n x *= x * x >>> 1069542313.7656753 + x;\n 0;\n x >>>= (tmp = -202931587.00212693, tmp);\n -0;\n x *= -375274420;\n 0;\n x |= x / ((tmp = -876417141, tmp) * (x >>> x) & -2406962078) << x;\n 0;\n x &= (tmp = -650283599.0780096, tmp) * (tmp = 513255913.34108484, tmp);\n 3027255453.458466;\n x += 3027255453.458466;\n -12568623413253943000;\n x *= (x - 198689694.92141533 | x) - x;\n -12568623410285185000;\n x -= (tmp = -2968758030.3694654, tmp);\n -2008903680;\n x &= 3111621747.7679076;\n -110045263.26583672;\n x += (tmp = 1898858416.7341633, tmp);\n 15964;\n x >>>= 1141042034;\n 31928;\n x += x;\n 0;\n x ^= x;\n -1159866377;\n x |= -1159866377;\n 0;\n x ^= x;\n 3072699529.4306993;\n x -= (tmp = -3072699529.4306993, tmp);\n 1;\n x /= x;\n -1471195029;\n x |= 2823772267.429641;\n -4152937108;\n x += -2681742079;\n 142030188;\n x |= x;\n 270;\n x >>= (tmp = 1013826483, tmp);\n 0;\n x >>>= 529670686;\n -2912300367;\n x -= 2912300367;\n 2213791134963007500;\n x *= x << ((-3214746140 >> (tmp = -588929463, tmp)) + ((tmp = -3084290306, tmp) >> x) >> x);\n 2213791133466809900;\n x -= (tmp = 1496197641, tmp);\n 69834416;\n x >>>= x | (2755815509.6323137 ^ x % (x * (((tmp = 375453453, tmp) << x * x >> (tmp = -973199642, tmp)) * x) >> ((tmp = -356288629, tmp) >> (tmp = 2879464644, tmp)) << (1353647167.9291127 >>> x / x << 2919449101 / 2954998123.5529594 ^ x))) & -2317273650 >>> (tmp = 34560010.71060455, tmp);\n 69834416;\n x >>>= x ^ -2117657680.8646245;\n 2217318064;\n x -= (tmp = 2035883891, tmp) << (tmp = -1884739265, tmp);\n -1272875686;\n x ^= (tmp = 805889002.7165648, tmp);\n -1272875686;\n x >>= x & 1750455903 * x >> 722098015 % ((tmp = 1605335626, tmp) >> (tmp = -565369634, tmp));\n -1274351316;\n x -= x >>> (tmp = 2382002632, tmp) - ((tmp = -2355012843, tmp) + 1465018311.6735773);\n -2982908522.4418216;\n x -= (tmp = 1635549038.4418216, tmp) + (1952167017.720186 & (tmp = -2284822073.1002254, tmp) >> -1403893917) % (tmp = 655347757, tmp);\n 312;\n x >>>= x;\n 1248;\n x <<= 2376583906;\n 0;\n x ^= x;\n 0;\n x *= ((tmp = 1914053541.881434, tmp) >>> (tmp = 1583032186, tmp) >>> -2511688231) % (tmp = -2647173031, tmp);\n 0;\n x >>>= (tmp = -2320612994.2421227, tmp);\n 0;\n x %= x + (tmp = -720216298.5403998, tmp) << 414712685 >> (tmp = 480416588, tmp);\n 0;\n x >>= (3039442014.271272 << x) % -2402430612.9724464 & -2141451461.3664773 % ((x >> 1361764256) / ((tmp = -1723952801.9320493, tmp) % 477351810.2485285));\n -0;\n x /= (tmp = -1627035877, tmp);\n 0;\n x >>>= (tmp = 1745193212, tmp);\n 0;\n x >>>= 2309131575;\n NaN;\n x %= x * (tmp = -1730907131.6124666, tmp) % ((1481750041 | x >> ((x >>> (tmp = 3128156522.5936565, tmp)) / (tmp = -1277222645.9880452, tmp) ^ (tmp = -2327254789, tmp)) + x) >>> -1161176960 >>> (tmp = 3135906272.5466847, tmp)) * ((-2230902834.464362 ^ 1822893689.8183987) + (tmp = 1597326356, tmp) / (x & (tmp = -3044163063.587389, tmp) >> (tmp = 2844997555, tmp)) % (x ^ x) >> (x | x) / x ^ 2634614167.2529745);\n 0;\n x &= 3081901595;\n 0;\n x &= -2453019214.8914948;\n 0;\n x &= x;\n 0;\n x >>>= -596810618.3666217;\n 0;\n x >>= (908276623 | x) / x;\n 0;\n x ^= x;\n 958890056;\n x |= (tmp = 958890056.474458, tmp);\n 1325436928;\n x <<= (tmp = -2474326583, tmp);\n 711588532333838300;\n x *= -148161646.68183947 << (tmp = -1149179108.8049204, tmp);\n 0;\n x ^= 2862565506 % x / (tmp = -2865813112, tmp);\n -2064806628;\n x += (tmp = -2677361175.7317276, tmp) / (817159440 >>> (tmp = 1895467706, tmp)) ^ (x | (tmp = -2309094859, tmp));\n -69806982479424;\n x *= x & (tmp = 2857559765.1909904, tmp) & -3166908966.754988;\n -430255744;\n x %= (-2968574724.119535 << x << (tmp = 1603913671, tmp) % (-1495838556.661653 ^ (tmp = 1778219751, tmp))) * -400364265 << ((1607866371.235576 - 1961740136 | 1259754297) & (tmp = -1018024797.1352971, tmp)) ^ x;\n 6.828637393208647e-7;\n x /= x * (tmp = 1464421, tmp);\n 0;\n x &= x;\n -0;\n x *= (tmp = -2510016276, tmp) - 2088209546 << (tmp = -1609442851.3789036, tmp) + (tmp = 1919930212, tmp);\n -0;\n x %= (tmp = 1965117998, tmp);\n -290294792.53186846;\n x += (tmp = -2361555894.5318685, tmp) % 2071261102;\n -70873;\n x >>= (tmp = 2206814124, tmp);\n -141746;\n x += x;\n -141733.9831459089;\n x -= ((tmp = -806523527, tmp) >>> (tmp = 1897214891, tmp)) / x;\n -141733.9831459089;\n x %= (tmp = 1996295696, tmp) << (tmp = 3124244672, tmp);\n 141733.9831459089;\n x /= x >> 2688555704.561076;\n 3196954517.3075542;\n x -= (tmp = -3196812783.3244085, tmp);\n -19929155;\n x |= (x | x) + x ^ (tmp = 391754876, tmp) - ((((tmp = -3051902902.5100636, tmp) * (x / 1546924993) | (tmp = 1494375949, tmp)) / ((-795378522 / (tmp = 509984856, tmp) >>> (tmp = -106173186, tmp)) + x) | x | 1916921307) >>> x);\n 1279271449;\n x &= (tmp = 1289446971, tmp) & (tmp = 1836102619, tmp);\n 17876992;\n x <<= -207633461;\n 0;\n x >>= (tmp = -903885218.9406946, tmp);\n 0;\n x >>>= x;\n -2999;\n x -= 754533336.2183633 % (tmp = 557970276.0537136, tmp) >> (tmp = -1171045520, tmp);\n -0.000003020470363504361;\n x /= (tmp = 992891715.2229724, tmp);\n 1;\n x /= x;\n 0.45768595820301217;\n x %= (tmp = 673779031, tmp) / (tmp = -1242414872.3263657, tmp);\n -980843052.1872087;\n x += (tmp = -980843052.6448946, tmp);\n -Infinity;\n x /= ((tmp = 317747175.8024508, tmp) & (x & ((tmp = 1632953053, tmp) >> x) / x)) % x / 3145184986;\n 0;\n x &= x << x;\n 0;\n x ^= x - 2969023660.5619783 / x;\n 0;\n x *= x;\n NaN;\n x %= x / ((x - x) / ((tmp = -1622970458.3812745, tmp) - 1626134522) & (((tmp = 1384729039.4149384, tmp) ^ x % (tmp = -2736365959, tmp)) + -1465172172 % x >> (tmp = -1839184810.2603343, tmp) ^ (tmp = 1756918419, tmp) >>> x + x % (tmp = -2011122996.9794662, tmp) << -3026600748.902623) * ((tmp = -2040286580, tmp) >> -2899217430.655154));\n 0;\n x >>>= (tmp = 2100066003.3046467, tmp);\n 1362012169;\n x ^= (tmp = 1362012169, tmp);\n 1476312683;\n x |= 457898409 >>> -3079768830.723079;\n 1441711;\n x >>>= 905040778.7770994;\n 2078530607521;\n x *= x;\n -208193103;\n x |= (tmp = -241750000, tmp) ^ x;\n 745036378;\n x ^= (tmp = -1737151062.4726632, tmp) << x | (tmp = -1900321813, tmp);\n 1744830464;\n x <<= x;\n 212992;\n x >>>= 1210741037 - (x - (x >>> (x ^ -1273817997.0036907) + 2401915056.5471 % (x << (tmp = 1696738364.277438, tmp))));\n 0.0001604311565639742;\n x /= 1327622418;\n 0;\n x <<= (tmp = 166631979.34529006, tmp);\n 0;\n x *= (tmp = 657814984, tmp) / (-831055031 >>> 1531978379.1768064 | (tmp = 2470027754.302619, tmp) ^ -223467597) / (tmp = 1678697269.468965, tmp) & (tmp = -1756260071.4360774, tmp);\n -2049375053;\n x ^= (tmp = -2049375053, tmp);\n -1879109889;\n x |= (tmp = -1963586818.0436726, tmp);\n 718239919;\n x ^= (tmp = -1523550640.1925273, tmp);\n -1361085185;\n x |= -1939964707;\n 2;\n x >>>= 1864136030.7395325;\n 0.794648722849246;\n x %= -668830999 * (-2227700170.7193384 % (x ^ x >>> x) / (tmp = 399149892, tmp));\n 0;\n x >>= x;\n 0;\n x *= x;\n 0;\n x &= (tmp = -2389008496.5948563, tmp) | (tmp = -2635919193.905919, tmp) * (-64464127 << 2136112830.1317358) >> 184057979 * -1204959085.8362718 >>> -442946870.3341484;\n -243793920;\n x -= (tmp = 3002998032, tmp) << (537875759 << x);\n 0;\n x -= x;\n 0;\n x *= 66852616.82442963 / (((x ^ x) & 2975318321.223734) + ((tmp = -1388210811.1249495, tmp) ^ (-680567297.7620237 % (x - (tmp = -672906716.4672911, tmp)) - x) * (tmp = -1452125821.0132627, tmp)) * (2770387154.5427895 % x % x) - x) << (-1481832432.924325 >> (tmp = 3109693867, tmp)) >>> x / ((((tmp = 928294418, tmp) ^ -1018314535 / (tmp = -3167523001, tmp) % (((tmp = -1639338126, tmp) - (tmp = -2613558829, tmp) & x) / x % (tmp = 513624872, tmp) / (-520660667 & x))) * 2620452414 ^ (tmp = 2337189239.5949326, tmp) * 3200887846.7954993) >>> ((tmp = 1173330667, tmp) ^ x) << x >> ((tmp = -2475534594.982338, tmp) * x | x));\n 0;\n x /= 2520915286;\n 0;\n x &= x;\n 0;\n x >>= -1908119327;\n 0;\n x >>>= (tmp = 549007635, tmp);\n 0;\n x >>= -994747873.8117285;\n 0;\n x <<= ((x >>> -3084793026.846681 % (1107295502 & (tmp = -296613957.8133817, tmp)) & 19637717.166736007 / (x + x)) + x) / -2479724242;\n -695401420;\n x += -695401420;\n -695401394;\n x += x >>> (tmp = 2340097307.6556053, tmp);\n -555745552;\n x -= x | -483851950.68644;\n -17825792;\n x <<= x;\n -17825792;\n x >>= x;\n -17;\n x %= (tmp = 1799361095, tmp) | (x >> (-1201252592 << ((543273288 + -2859945716.606924) * x << (-3030193601 << 3081129914.9217644)) | 1471431587.981769 >> -246180750) | (tmp = -2689251055.1605787, tmp) >> x & (2131333169 ^ x) - (tmp = -951555489, tmp) / x);\n -8912896;\n x <<= 1146444211;\n 2854567584;\n x += (tmp = 2863480480, tmp);\n 426232502.24151134;\n x %= 1214167540.8792443;\n 1806802048;\n x ^= -2368317898;\n 432537600;\n x <<= (tmp = 2831272652.589364, tmp);\n 432537600;\n x %= 1713810619.3880467 - x & (-2853023009.553296 & (tmp = -3158798098.3355417, tmp));\n -509804066;\n x += (tmp = -942341666, tmp);\n -509804066;\n x %= -732349220;\n 259900185710132350;\n x *= x;\n 711598501.7021885;\n x %= (tmp = 2020395586.2280731, tmp) - (tmp = 3031459563.1386633, tmp);\n 711598503.0618857;\n x += (tmp = 967558548.4141241, tmp) / x;\n 711598503;\n x &= x;\n 711598503;\n x ^= ((1609355669.1963444 + ((tmp = -2660082403.258437, tmp) + (tmp = -235367868, tmp) & x / x) * (-2595932186.69466 | (tmp = -3039202860, tmp) << x) >>> -951354869) - (tmp = -691482949.6335375, tmp) / (tmp = -1735502400, tmp)) / (tmp = 798440377, tmp);\n 558262613882868500;\n x *= 784519095.4299527;\n 558262611968479000;\n x -= (tmp = 1039039153.4026555, tmp) / -3138845051.6240187 * (tmp = 633557994, tmp) & 1981507217;\n 1170427648;\n x |= (x >> (-1086327124 % ((tmp = -1818798806.368613, tmp) ^ (tmp = 2183576654.9959817, tmp)) >> x & (((tmp = 1315985464.0330539, tmp) & 2774283689.333836) % x * (2722693772.8994813 & (tmp = -2720671984.945404, tmp)) ^ (tmp = -76808019, tmp)) << ((tmp = 685037799.2336662, tmp) ^ (tmp = 1057250849, tmp) & (tmp = 1469205111.2989025, tmp)))) + x * ((tmp = 448288818.47173154, tmp) - -2527606231 - (8387088.402292728 >> x));\n 558;\n x >>>= (tmp = 2732701109, tmp);\n 558;\n x &= x;\n -0.00015855057024653912;\n x /= (x + ((tmp = -1963815633, tmp) - (x >> x) - ((x | x) >> x))) / x;\n 1.3458861596445712e-13;\n x /= -1178038492.4116466;\n 0;\n x <<= -104550232;\n 0;\n x >>>= x >> (tmp = -255275244.12613606, tmp);\n 0;\n x >>= x;\n 375;\n x |= 1576819294.6991196 >>> -2570246122;\n 96000;\n x <<= 2252913843.0150948 >>> -49239716;\n 6144000;\n x <<= ((tmp = -2478967279, tmp) & x % ((tmp = -1705332610.8018858, tmp) + (x + (tmp = 590766349, tmp))) << (tmp = 1759375933, tmp)) + -2024465658.849834 & 1564539207.3650014;\n -1149239296;\n x <<= 1862803657.7241006;\n -9;\n x >>= (tmp = 463306384.05696774, tmp) ^ x | (x >> (-2098070856.799663 << (-2054870274.9012866 << (-2582579691 / 829257170.0266814 << (((tmp = -1753535573.7074275, tmp) << (x >> -197886116) % (2487188445 % (tmp = 2465391564.873364, tmp)) & ((tmp = -500069832, tmp) & (tmp = 3016637032, tmp) & ((tmp = 2525942628, tmp) | ((-920996215 | x) ^ (((tmp = -687548533.419106, tmp) & 1423222636.058937) << ((tmp = -1096532228, tmp) >> (((tmp = -3124481449.2740726, tmp) ^ (tmp = 2724328271.808975, tmp)) >> x) * x)) + -1661789589.5808442) + (x * (tmp = -1224371664.9549093, tmp) ^ ((tmp = 3202970043, tmp) ^ x)) / (tmp = 131494054.58501709, tmp))) | (tmp = -1654136720, tmp) << x >> 1652979932.362416 - (tmp = -863732721, tmp)) ^ -113307998))) ^ -90820449.91417909) * ((tmp = 641519890, tmp) - ((x << (tmp = 2349936514.071881, tmp)) * 2324420443.587892 ^ x) % (x << (tmp = -1838473742, tmp) / (-3154172718.4274178 - x + x))) | x >>> ((tmp = 2096024376.4308293, tmp) << x));\n 81;\n x *= x;\n 81;\n x &= x;\n 81;\n x %= (tmp = 2223962994, tmp);\n 81;\n x ^= x / ((-1606183420.099584 | -1242175583) & ((x | (tmp = 828718431.3311573, tmp) / (x >> x)) + (-2207542725.4531174 ^ x * x) * (tmp = 551575809.955105, tmp)) / x) & (x >> x & x);\n 81;\n x %= (tmp = 279598358.6976975, tmp);\n 101.72338484518858;\n x -= (tmp = 2452584495.44003, tmp) % (-1181192721 + (x >> (x & x ^ x) + (x >>> (x + -2472793823.57181) / (2854104951 >> -1208718359.6554642 >>> 1089411895.694705)) / (x | -2821482890.1780205) ^ -1786654551) / -29404242.70557475) / ((-4352531 << (-1227287545 << x)) % -2558589438);\n 101.72338484518858;\n x %= -943645643;\n 0;\n x -= x;\n 0;\n x >>>= -2440404084;\n 0;\n x >>= (tmp = 1029680958.405923, tmp);\n 0;\n x >>>= 1213820208.7204895;\n -0;\n x /= (tmp = -103093683, tmp);\n 0;\n x >>>= -2098144813;\n -0;\n x /= -3087283334 + ((tmp = -3129028112.6859293, tmp) % (tmp = 2413829931.1605015, tmp) - 2578195237.8071446) | x;\n -15;\n x |= (-178926550.92823577 >>> -965071271 ^ (tmp = -484633724.7237625, tmp) - (tmp = 473098919.1486404, tmp)) >> -2264998310.203265 % (tmp = -499034672, tmp);\n 0;\n x ^= x;\n 0;\n x >>= -3207915976.698118 << (tmp = 2347058630, tmp) | (tmp = -2396250098.559627, tmp);\n NaN;\n x %= x;\n NaN;\n x *= 621843222;\n 0;\n x >>= -2409032228.7238913 * x - (tmp = -887793239, tmp);\n NaN;\n x /= x;\n 1193017666;\n x ^= (tmp = 1193017666, tmp);\n 3.5844761899682753;\n x /= (tmp = 332829011.206393, tmp);\n -888572929;\n x |= (tmp = 1032409228, tmp) + (tmp = -1920982163.7853453, tmp) + x;\n -1817051951333455600;\n x *= (-1506265102 ^ (tmp = -775881816, tmp)) - (tmp = -32116372.59181881, tmp);\n -1638479616;\n x |= x;\n -114489;\n x %= ((tmp = -247137297.37866855, tmp) >>> ((-322805409 - x ^ x) >> ((((x >>> (tmp = -900610424.7148039, tmp)) / -1155208489.6240904 | (-2874045803 | (tmp = 3050499811, tmp))) + x / ((tmp = -613902712, tmp) ^ -982142626.2892077 * (((tmp = -3201753245.6026397, tmp) | 1739238762.0423079 ^ x) / 243217629.47237313 ^ (tmp = -11944405.987132788, tmp) / (tmp = 2054031985.633406, tmp)))) * (tmp = 2696108952.450961, tmp) * x >>> (tmp = 3058430643.0660386, tmp) >> (x << x)) >> -984468302.7450335) % ((tmp = 1302320585.246251, tmp) >>> x)) % (tmp = -2436842285.8208156, tmp);\n 2047;\n x >>>= 2380161237;\n 0;\n x >>= x;\n 0;\n x &= (tmp = 980821012.975836, tmp);\n -1090535537;\n x -= -3064511503.1214876 & (tmp = -2598316939.163751, tmp) << (tmp = -969452391.8925576, tmp) * x;\n -2181071074;\n x += x;\n 1;\n x >>>= 2902525386.449062 >> x;\n 1;\n x += x & (tmp = -2643758684.6636515, tmp);\n 1;\n x %= (tmp = -2646526891.7004848, tmp) / x;\n 448735695.7888887;\n x -= (tmp = -448735694.7888887, tmp);\n 1;\n x /= x;\n 1;\n x >>= -480385726 << 2641021142;\n 1;\n x %= 375099107.9200462;\n 1;\n x >>= (x & (tmp = -2402469116.9903326, tmp) % (tmp = -2862459555.860298, tmp)) * (tmp = -2834162871.0586414, tmp) % ((x >>> (tmp = 721589907.5073895, tmp)) * (x ^ x) % ((tmp = 2844611489.231776, tmp) ^ 983556913 & 906035409.6693488 ^ x >>> 1239322375));\n 268435456;\n x <<= (tmp = 178807644.80966163, tmp);\n 44;\n x %= (tmp = 2527026779.081539, tmp) >>> 2736129559;\n 88;\n x += x;\n 0;\n x >>>= x;\n 0;\n x -= x;\n -1523121602;\n x |= 2771845694;\n -2;\n x >>= x;\n -4;\n x += x;\n -256;\n x <<= (2522793132.8616533 >> (tmp = 77232772.94058788, tmp)) + 3118669244.49152;\n 4294967040;\n x >>>= x;\n -256;\n x &= x;\n 1278370155.835435;\n x -= -1278370411.835435;\n -3.488228054921667;\n x /= (tmp = -366481243.6881058, tmp);\n 1.162742684973889;\n x /= x | (2404819175.562809 * (tmp = -2524589506, tmp) & (tmp = -675727145, tmp)) >>> x * x & -413250006 << (tmp = 2408322715, tmp) | 2940367603 >>> x;\n 0;\n x >>>= 2513665793 - (tmp = 1249857454.3367786, tmp);\n 0;\n x ^= x;\n 0;\n x ^= x;\n 1989998348.6336238;\n x -= -1989998348.6336238;\n 903237918.986834;\n x %= 1086760429.6467898;\n -4.4185765232981975;\n x /= -204418304;\n 1471621914;\n x ^= (tmp = -1471621914.1771696, tmp);\n 1471621914;\n x |= ((x << (tmp = -2676407394.536844, tmp)) % (343324258 + x / (x >> (-221193011 >>> x | x)) >> ((-2737713893 ^ (tmp = -49214797.00735545, tmp) + -2818106123.172874 / (tmp = -2361786565.3028684, tmp)) << 1859353297.6355076)) * (tmp = -751970685, tmp) | (tmp = 2502717391.425871, tmp) / (tmp = -2647169430, tmp)) * ((tmp = -1647567294, tmp) & (tmp = 1819557651, tmp) / x >> (-3073469753 / x - ((tmp = -1973810496.6407511, tmp) & x - (x + (tmp = -2986851659, tmp)) >>> (tmp = -2226975699, tmp) | 418770782.142766) << x)) * (((tmp = 125466732, tmp) / ((1453655756.398259 | 874792086.7064595 - 194880772.91499102 >>> x) % (x << (tmp = -1445557137, tmp)) << x) >>> (tmp = -1953751906, tmp)) / ((tmp = -2140573172.2979035, tmp) * (-108581964 ^ x)) | -481484013.0393069);\n 1454179065;\n x += (tmp = 947147038.2829313, tmp) | (tmp = -154822975.3629098, tmp);\n 1;\n x /= x;\n 1;\n x %= (((tmp = -2262250297.991866, tmp) - (tmp = 481953960, tmp)) / 1629215187.6020458 | 2515244216) >>> (tmp = -3040594752.2184515, tmp) - (tmp = -1116041279, tmp) ^ -182133502 - 1065160192.6609197 + ((-1850040207 ^ (tmp = -1570328610, tmp) ^ (tmp = 20542725.09256518, tmp)) * x | 2386866629);\n 1;\n x &= 2889186303;\n 0;\n x >>= (-1323093107.050538 >> x % x) - (((-1736522840 + (tmp = -2623890690.8318863, tmp)) * 959395040.5565329 * 233734920 << x + x % ((tmp = -2370717284.4370327, tmp) % (tmp = 2109311949, tmp)) - (tmp = -1005532894, tmp) | 861703605) >>> 2399820772 / x);\n 0;\n x >>= x;\n 57233408;\n x |= (tmp = 2655923764.4179816, tmp) * -1353634624.3025436;\n 997939728;\n x |= 980552208.9005274;\n 1859642592476610800;\n x *= 1863481872;\n -977190656;\n x <<= x;\n 4.378357529141239e+26;\n x *= (x / ((tmp = 2429520991, tmp) / (x / (tmp = 784592802, tmp)) - (tmp = -2704781982, tmp)) * (tmp = -2161015768.2322354, tmp) & (-3164868762 >> (tmp = 2390893153.32907, tmp) ^ x) >> -2422626718.322538) * (tmp = 278291869, tmp);\n 4.378357529141239e+26;\n x -= 1710777896.992369;\n 0;\n x &= ((tmp = -2532956158.400033, tmp) | (2195255831.279001 | 1051047432) | -1628591858 | (tmp = -2042607521.947963, tmp)) >> -1471225208 / ((-133621318 >> 1980416325.7358408) * (1741069593.1036062 - (x | 2133911581.991011)));\n -0;\n x /= -656083507;\n NaN;\n x += (tmp = -1071410982.2789869, tmp) % x;\n NaN;\n x *= (tmp = -1513535145.3146675, tmp);\n 0;\n x >>= 2831245247.5267224 >> (x << (x + (3068824580.7922907 | 1708295544.275714) * ((tmp = -1662930228.1170444, tmp) - ((tmp = 1979994889, tmp) << (tmp = -1826911988, tmp) & x / (x << 1909384611.043981) + 1958052414.7139997)) << (tmp = 2481909816.56558, tmp)));\n 0;\n x *= ((tmp = -2979739958.1614842, tmp) & x) + x;\n -0;\n x *= -332769864.50313234 ^ x;\n 0;\n x >>= (689018886.1436445 + (tmp = -2819546038.620694, tmp) | ((tmp = -1459669934.9066005, tmp) | x) / x) << (tmp = 2640360389, tmp) / (x % (-1947492547.9056122 % (1487212416.2083092 - -1751984129)) ^ x) % (tmp = 2666842881, tmp);\n -1801321460;\n x |= (tmp = 2493645836, tmp);\n -1801321460;\n x %= 2400405136;\n -2905399858195810300;\n x *= (tmp = 1612926911, tmp);\n -2905399858195810300;\n x -= x >> (tmp = 1603910263.9593458, tmp);\n -238798848;\n x &= (tmp = -2638646212.767516, tmp) / (((tmp = 1755616291.436998, tmp) >>> (tmp = 1083349775, tmp)) - x % (((tmp = 1728859105.53634, tmp) ^ 1931522619.0403612) / (tmp = 712460587.0025489, tmp)));\n -2363873607.2302856;\n x += -2125074759.230286;\n 1712665;\n x &= (117229515 >>> (1707090894.1915488 >>> (-1696008695 >> (-1045367326.7522249 << (tmp = -209334716, tmp)) - x) | -1707909786.080653)) % 1260761349.172689;\n 1073741824;\n x <<= (tmp = -289437762.34742975, tmp);\n 1073741824;\n x &= (tmp = 2079141140, tmp);\n 0;\n x <<= (x ^ -3139646716.1615124) - (-362323071.74237394 | (tmp = 2989896849, tmp)) * (tmp = -218217991, tmp);\n 0;\n x &= (tmp = -1476835288.425903, tmp);\n 0;\n x >>>= (tmp = 61945262.70868635, tmp);\n 0;\n x ^= x;\n -2735263498.7189775;\n x -= 2735263498.7189775;\n -1182289920;\n x <<= x + x;\n -1182289580;\n x ^= 2858446263.2258 >>> 2387398039.6273785;\n 696693056;\n x &= 2178665823 * -51848583;\n 1652555776;\n x <<= (tmp = 2943916975, tmp) - (-1544273901 >> -1671503106.2896929) | x;\n 6455296;\n x >>>= (tmp = 1492638248.675439, tmp);\n 2097152;\n x &= (x | x) * 2873891571.7000637 ^ 2165264807 + (tmp = 451721563, tmp);\n 2097152;\n x %= (tmp = 1089484582.1455994, tmp);\n 2097152;\n x <<= x;\n 2097152;\n x &= (tmp = 119096343.4032247, tmp) ^ -1947874541 * x;\n 0;\n x &= (tmp = 2363070677, tmp);\n 0;\n x &= (tmp = -1897325383, tmp) >>> (2368480527 >>> (tmp = 1837528979, tmp) * -1838904077);\n -1898659416;\n x ^= -1898659416.1125412;\n -725506048;\n x <<= x;\n 1392943104;\n x <<= 295287938.9104482;\n -63620329;\n x ^= (tmp = -3175925826.5573816, tmp) - (tmp = 2474613927, tmp);\n -1135111726;\n x -= (tmp = -1133259081, tmp) ^ ((tmp = -742228219, tmp) >> -7801909.587711811 % ((tmp = -642758873, tmp) + (tmp = 2893927824.6036444, tmp)) ^ (tmp = -2145465178.9142997, tmp) + x);\n 0;\n x ^= x;\n 660714589;\n x |= 660714589;\n 660714676;\n x ^= -376720042.8047826 >>> 2196220344;\n 660714676;\n x |= (((x << -1140465568) - (tmp = -1648489774.1573918, tmp)) % ((tmp = -2955505390.573639, tmp) * x << ((tmp = -1769375963, tmp) * (tmp = -440619797, tmp) & (tmp = 1904284066, tmp) % -2420852665.0629807) + -324601009.2063596) >> (tmp = 2317210783.9757776, tmp) ^ ((tmp = 750057067.4541628, tmp) ^ (tmp = -1391814244.7286487, tmp))) >> 344544658.6054913 % ((tmp = -1508630423.218488, tmp) & (tmp = 1918909238.2974637, tmp)) >> (-647746783.685822 & (tmp = 2444858958.3595476, tmp)) & x;\n -962337195;\n x ^= (tmp = -507358495.30825853, tmp);\n -182008925.58535767;\n x %= (tmp = -195082067.35366058, tmp);\n 502070;\n x >>>= (tmp = 1459732237.1447744, tmp);\n -2391009930.7235765;\n x -= (tmp = 2391512000.7235765, tmp);\n 1568669696;\n x <<= x;\n 0;\n x <<= (tmp = -571056688.2717848, tmp);\n 1770376226;\n x ^= (tmp = 1770376226.0584736, tmp);\n 0;\n x ^= x;\n 0;\n x &= x << x >>> x | x | ((tmp = -2141573723, tmp) ^ x | 64299956);\n 0;\n x ^= x;\n 0;\n x &= x;\n 0;\n x <<= 1106060336.7362857;\n -0;\n x /= x | (tmp = 2760823963, tmp);\n 0;\n x <<= -2436225757 | -1800598694.4062433;\n 0;\n x >>>= -728332508.9870625 << x;\n -173377680;\n x ^= (tmp = -173377680, tmp) % (tmp = -2843994892, tmp);\n -173377680;\n x |= -819217898 & (tmp = -1321650255, tmp) & x + ((x ^ x) << (1700753064 >> ((-1038799327 >> (782275464 ^ x)) - (tmp = -2113814317.8539028, tmp) >> 2143804838 & x) - 2970418921 / -3073015285.6587048)) & -1759593079.4077306 % (1699128805 - ((tmp = -467193967, tmp) & 2225788267.3466334 * (2687946762.5504274 + x >>> x) << -1853556066.880512));\n -0.5520657226957338;\n x /= (tmp = -755493878, tmp) & (tmp = 918108389, tmp);\n 0.30477656217556287;\n x *= x;\n 0;\n x &= (tmp = -2746007517, tmp) << 2749629340;\n 0;\n x ^= x % (tmp = 1683077876, tmp) % -162706778;\n 0;\n x *= (tmp = 10203423, tmp);\n 119043212.1461842;\n x += (tmp = 119043212.1461842, tmp);\n 587202560;\n x <<= (tmp = 658697910.7051642, tmp);\n -138689730;\n x |= x - (tmp = 1296317634.5661907, tmp);\n -138663011;\n x -= -1751010109.5506423 >> 152829872;\n -138663011;\n x %= -1266200468;\n -138663011;\n x &= x | (tmp = -571277275.622529, tmp) << x;\n -138663011;\n x >>= 971259905.1265712 * (tmp = 2203764981, tmp);\n -138663011;\n x %= -904715829;\n -138663011;\n x |= (tmp = -2823047885.283391, tmp) >>> ((tmp = 533217000, tmp) | 650754598.7836078 | -1475565890);\n -1610612736;\n x <<= x;\n -1610612736;\n x &= x;\n 163840;\n x >>>= -188885010;\n -1224224814;\n x |= (tmp = 3070742482, tmp);\n 1498726395213334500;\n x *= x;\n 1723591210;\n x |= (tmp = 615164458, tmp) | x;\n 1721910480;\n x ^= x >>> x;\n 4505284605.764313;\n x -= (tmp = -2783374125.7643127, tmp);\n -9504912393868483000;\n x *= (tmp = 2896651872, tmp) << -2896385692.9017262 & ((((tmp = -2081179810.20238, tmp) | (tmp = -2484863999, tmp)) >> (tmp = 1560885110.2665749, tmp) / (((tmp = 934324123.4289343, tmp) << (tmp = -1591614157.0496385, tmp) + x) / (x % ((tmp = 1672629986.8055913, tmp) % x >> (tmp = 2116315086.2559657, tmp)) / ((-2687682697.5806303 >> x) / -2034391222.5029132) % (x - (((tmp = 2598594967, tmp) / ((((2950032233 % x / x ^ (tmp = -2126753451.3732262, tmp)) << (tmp = -3019113473, tmp)) + (tmp = -2021220129.2320697, tmp)) % (-587645875.4666483 >> (x + x + x & (tmp = 533801785, tmp) | x) - (tmp = -2224808495.678903, tmp) / 1501942300 >>> -2558947646 >> (2798508249.020792 >>> x))) >>> 1060584557 / (((((x & x | 1426725365) >>> (tmp = 1500508838, tmp) >> -1328705938) * ((tmp = -2288009425.598777, tmp) >>> 2586897285.9759064 % (-1605651559.2122297 >>> (tmp = 1936736684.4887302, tmp)) + ((tmp = 2316261040, tmp) ^ 570340750.353874)) & (x ^ (tmp = -2266524143, tmp) - (tmp = 2358520476, tmp))) + (tmp = 1449254900.9222453, tmp)) % (-100598196 % ((tmp = -2985318242.153491, tmp) >> (620722274.4565848 >> 871118975)))) << x) * (tmp = -1287065606.4143271, tmp) >>> 1038059916.2438471))))) + (x / -276990308.1264961 & (tmp = 2471016351.2195315, tmp)) | (((tmp = -1288792769.3210807, tmp) + (tmp = -641817194, tmp) * (x << (-1933817364 >> (((tmp = 2084673536, tmp) | x) & x) & (tmp = -2752464480, tmp)))) % (796026752 * x) + (((tmp = -3083359669, tmp) | x) - (715303522 | (tmp = 181297266, tmp)))) * -1691520182.3207517);\n 0;\n x <<= -2322389800;\n 0;\n x *= (tmp = 3188682235, tmp);\n 0;\n x |= x >>> ((tmp = -2729325231.8288336, tmp) ^ -393497076.96012783 * (x / (tmp = -2198942459.9466457, tmp)));\n 0;\n x ^= x;\n 0;\n x %= 2835024997.4447937;\n 0;\n x <<= x;\n 0;\n x >>= (tmp = 1109824126, tmp);\n 0;\n x <<= 3013043386;\n 206825782.74659085;\n x -= -206825782.74659085;\n -645346761227699500;\n x *= -3120243292;\n 6825462;\n x >>= (tmp = 1457908135, tmp) << x;\n -612366097.9189918;\n x -= 619191559.9189918;\n -612306090.9189918;\n x -= 2328676543.893506 >> x;\n 0;\n x ^= x >> (x >>> 1856200611.2269292 & (tmp = 2003217473, tmp)) % ((-107135673 + (3062079356.170611 << (tmp = -676928983, tmp) >> ((tmp = -1487074941.2638814, tmp) | -1601614031 / 1317006144.5025365)) + x) * ((1163301641 >>> 448796567) / (x % ((tmp = 72293197.34410787, tmp) + -2304112723) / (455610361 % -2799431520))) >>> -217305041.09432888 << x - (tmp = -2168353649, tmp));\n 0;\n x >>= x;\n -Infinity;\n x -= (-1651597599.8950624 + 1780404320) / x;\n 0;\n x <<= (tmp = 2246420272.4321294, tmp);\n 0;\n x *= 2793605382 - (tmp = -272299011, tmp);\n 0;\n x *= x;\n 0;\n x <<= x;\n 0;\n x >>= (tmp = 2556413090, tmp);\n 0;\n x >>= (tmp = -1784710085, tmp) % x;\n 0;\n x %= (tmp = -1929880813, tmp);\n 0;\n x *= 2586983368;\n 0;\n x &= x;\n 0;\n x <<= -2144588807;\n 0;\n x ^= (x << ((-596537598 + (x - (((tmp = -3179604796, tmp) / ((tmp = 1156725365.3543215, tmp) >>> (tmp = -2762144319, tmp)) % (x << x) & ((tmp = 1750241928.1271567, tmp) & x / ((tmp = 1781306819, tmp) | x))) + (2893068644 / ((tmp = -576164593.9720252, tmp) << (2724671.48995471 & (tmp = -573132475, tmp))) % (tmp = -1355625108, tmp) & (tmp = -302869512.5880568, tmp)) + x << x) >> (tmp = -2569172808, tmp) / x) ^ x) - (tmp = -1174006275.2213159, tmp) & x & ((-2303274799 >> (tmp = -814839320, tmp)) / (tmp = 183887306.09810615, tmp) >> (((tmp = 1054106394.3704875, tmp) | x) >>> x)) - (x - (tmp = 1313696830, tmp)) - ((tmp = 2373274399.0742035, tmp) | ((tmp = -3163779539.4902935, tmp) * (tmp = -3056125181.726942, tmp) & ((x ^ (x ^ x / ((tmp = -576441696.6015451, tmp) << (tmp = -26223719.920306206, tmp)))) >> (tmp = -2332835940, tmp) | -146303509.41093707 & (tmp = -2676964025, tmp))) / ((x * (tmp = 1059918020, tmp) | ((2341797349 | (tmp = -744763805.1381104, tmp)) << x) + (2991320875.552578 ^ 2920702604.701831)) ^ -1721756138 ^ (tmp = -2794367554, tmp) >> (-2671235923.2097874 << (x & (((tmp = -621472314.0859051, tmp) - (x * x + x >>> (tmp = 1834038956, tmp) + x)) * x ^ (tmp = -2090567586.321468, tmp)))) << 321395210)) >>> (tmp = -1207661719, tmp)) + -2877264053.3805156) / (x % (tmp = -2226991657.709366, tmp));\n 0;\n x *= (tmp = 986904991.061398, tmp);\n 0;\n x -= x % 650819306.6671969;\n 0;\n x >>>= 905893666.2871252;\n 0;\n x += ((tmp = 2501942710.4804144, tmp) & x) / ((tmp = -851080399.1751502, tmp) - -1168623992);\n -0;\n x *= (tmp = -2014577821.4554045, tmp);\n 0;\n x &= (tmp = 1995246018, tmp);\n 0;\n x %= 1724355237.7031958;\n -954696411;\n x += -2825222201 + (1662353496.1795506 >>> x - x | (tmp = 225015046, tmp)) ^ x & x;\n -2158427339993389800;\n x *= 2260852052.1539803;\n 19559;\n x >>>= -862409169.4978967;\n -0.000012241163878671237;\n x /= x ^ (tmp = 2697144215.160239, tmp);\n 0;\n x -= x;\n 1448177644;\n x |= (tmp = 1448177644.624848, tmp);\n 1448177644;\n x %= -1497553637.4976408 + 402228446 << x;\n 2304640553;\n x -= -856462909;\n 152436736;\n x &= 766686903 * (((tmp = 660964683.1744609, tmp) | ((tmp = 297369746, tmp) - (x + (tmp = -2677127146, tmp) / x) >> (((x % (x << x) - (((529254728 | (x | -1407086127.6088922) & (tmp = -1968465008.5000398, tmp)) / (x % x) & (-2761805265.92574 - x) * (x ^ (tmp = 110730179, tmp)) % (177220657.06030762 * (2532585190.671373 / x + -1465143151))) << ((tmp = -3008848338, tmp) << -2475597073)) | (-192996756.38619018 | (1445996780 | x >>> ((tmp = -2482370545.791443, tmp) * (tmp = -270543594, tmp) ^ x) * (1346780586 / (tmp = -625613363.885356, tmp))) - (x << x / -562307527) & -125701272)) * ((x & x) % (tmp = 752963070, tmp)) >>> (tmp = 17419750.79086232, tmp)) * x ^ (x ^ -157821212.04674292 - (tmp = 503849221.598824, tmp)))) - (tmp = 1479418449, tmp)) >>> (-78138548.2193842 << (2319032860.806689 - (tmp = -1564963892.5137577, tmp) >>> -73673322.28957987) << 1797573493.3467085 * x >> (tmp = 759994997, tmp) >>> -1066441220 & (((tmp = 1972048857, tmp) * ((x & -1347017320.0747669 >>> x) * -2332716925.705054 % -376976019.24362826) >>> (tmp = -466479974, tmp) + x & -2282789473.3675604 | (((269205423.7510414 - (tmp = 21919626.105656862, tmp)) * (x - (tmp = -378670528, tmp) >> (tmp = -1045706598, tmp)) >> (tmp = -3062647341.234485, tmp) >>> x | (tmp = -285399599.9386575, tmp)) % (tmp = 2731214562, tmp) | ((tmp = 837093165.3438574, tmp) | (tmp = -2956931321, tmp)) + (1871874558.3292787 << (x | (tmp = -3169147427, tmp) % ((x ^ x) % 1479885041 % (1769991217 % (tmp = -1899472458, tmp)))) * (tmp = -837098563.71806, tmp)) >> (tmp = -1866722748, tmp)) - 2037734340.8345597) >> (tmp = -1262019180.5332131, tmp) + x * 1274173993.9800131) * (tmp = 2336989321.855402, tmp)));\n 4;\n x >>= (tmp = -2577728327, tmp);\n 16;\n x *= x << 2622323372.580596 * (tmp = -1947643367, tmp);\n 33554432;\n x <<= (tmp = -2938370507, tmp);\n -2399497018.987414;\n x -= (tmp = 2433051450.987414, tmp);\n 1;\n x /= x;\n 2;\n x <<= x;\n 0;\n x >>= x & x;\n 0;\n x <<= x;\n}", "title": "" }, { "docid": "f88354de9c00a198d49be00911264aa9", "score": "0.50663877", "text": "function xor() {\n var values = [], len = arguments.length;\n while ( len-- ) values[ len ] = arguments[ len ];\n\n return !!( reduce( flatten(values), function (a,b) {\n if (b) {\n return a+1\n }\n return a\n }, 0) & 1)\n }", "title": "" }, { "docid": "634c36d11c35486cbdfc212b957bf419", "score": "0.5064242", "text": "function all8(x,y,x1,y1){\n return (xy(x+x1,y-y1)) ||\n (xy(x-x1,y-y1)) ||\n (xy(x-y1,y+x1)) ||\n (xy(x-y1,y-x1)) || \n main4(x,y,x1,y1);\n}", "title": "" }, { "docid": "634c36d11c35486cbdfc212b957bf419", "score": "0.5064242", "text": "function all8(x,y,x1,y1){\n return (xy(x+x1,y-y1)) ||\n (xy(x-x1,y-y1)) ||\n (xy(x-y1,y+x1)) ||\n (xy(x-y1,y-x1)) || \n main4(x,y,x1,y1);\n}", "title": "" }, { "docid": "5a54afa934c3f7ad717390b5d46292b3", "score": "0.5054065", "text": "checkValid(x, y, color) {\n if (this.layout[x][y] != \"x\") {\n return -1;\n }\n // now check if can flip pieces\n let adjList = this.getAdjacents(x, y, color);\n let flip = false;\n for (let i = 0; i < adjList.length; i++) {\n let x2 = adjList[i].x;\n let y2 = adjList[i].y;\n if (this.checkDirection(x, y, x2, y2, color)) {\n // time to flip pieces\n flip = true;\n this.flipDirection(x, y, x2, y2, color);\n\n }\n }\n if (flip) {\n return 1;\n }\n return -1;\n }", "title": "" }, { "docid": "cb9dbb67fb2f4c410a777025f212ffb3", "score": "0.5051036", "text": "static yn2(v, o) { const x = v[0], y = v[1], z = v[2]; o[0] = -x; o[1] = y; o[2] = -z; return o; }", "title": "" }, { "docid": "8d571dd2643d235aeb9bdd1a59ca661c", "score": "0.50464386", "text": "function secondMirror() {\n let d = n2x * x + n2y * y;\n if (d < 0) {\n d += d;\n x -= d * n2x;\n y -= d * n2y;\n inversions += 1;\n change = true;\n }\n}", "title": "" }, { "docid": "77f5ad3aa75b5b8d04d7c4f7749b452b", "score": "0.5035468", "text": "function rightTeamFlipped($thisCard){\n\t\tif(($('#code').hasClass('redTurn') && $($thisCard).hasClass('R'))||($('#code').hasClass('blueTurn') && $($thisCard).hasClass('B'))){\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "e0453fae539d719d302158400ebaeb80", "score": "0.49922952", "text": "function dihedral2() {\n if (x < 0) {\n x = -x;\n inversions += 1;\n change = true;\n }\n if (y < 0) {\n y = -y;\n inversions += 1;\n change = true;\n }\n}", "title": "" }, { "docid": "721b29c4570f712960c8e169d4cec156", "score": "0.4990648", "text": "function main4(x,y,x1,y1){\n return (xy(x+x1,y+y1)) ||\n (xy(x-x1,y+y1)) ||\n (xy(x+y1,y+x1)) ||\n (xy(x+y1,y-x1));\n}", "title": "" }, { "docid": "721b29c4570f712960c8e169d4cec156", "score": "0.4990648", "text": "function main4(x,y,x1,y1){\n return (xy(x+x1,y+y1)) ||\n (xy(x-x1,y+y1)) ||\n (xy(x+y1,y+x1)) ||\n (xy(x+y1,y-x1));\n}", "title": "" }, { "docid": "76e92f89ac809f6c9c1019982287d6ce", "score": "0.4967557", "text": "static xp_yn(v, o) { const x = v[0], y = v[1], z = v[2]; o[0] = -y; o[1] = -z; o[2] = x; return o; }", "title": "" }, { "docid": "9f35cabc871d9b5f535fc23971fe7e9a", "score": "0.4962142", "text": "function excludeOppositeDirection(who,dirs){\r\n\r\n\tif (ghostDir[who]==1){ return dirs & ~2;}\r\n\tif (ghostDir[who]==2){ return dirs & ~1;}\r\n\tif (ghostDir[who]==4){ return dirs & ~8;}\r\n\tif (ghostDir[who]==8){ return dirs & ~4;}\r\n\r\n\t/*\r\n\tdirs=(dirs >>> 0).toString(2); // binary conversion\r\n\r\n\tif (ghostDir[who]==1){\r\n\t\txreturn = dirs.substr(0, 2) + \"0\" + dirs.substr(3,4);\r\n\t}\t\r\n\tif (ghostDir[who]==2){\r\n\t\txreturn = dirs.substr(0, 3) + \"0\";\r\n\t}\r\n\tif (ghostDir[who]==4){\r\n\t\txreturn = \"0\" + dirs.substr(1,4);\r\n\t}\r\n\tif (ghostDir[who]==8){\r\n\t\txreturn = dirs.substr(0, 1) + \"0\" + dirs.substr(2,4);\r\n\t}\r\n\treturn parseInt(xreturn,2);\r\n*/\r\n}", "title": "" }, { "docid": "e7dcb1d091ee6186e63e96ef823edcb7", "score": "0.49605364", "text": "function flip(fn) {\n return function(a, b) {\n return fn(b, a);\n }\n }", "title": "" }, { "docid": "f141121aac008e43b4a5e02a7f4af42f", "score": "0.49545798", "text": "_f(t, b, c, d) {\n if (t <= 19) {\n return (b & c) | (~b & d);\n } else if (t <= 39) {\n return b ^ c ^ d;\n } else if (t <= 59) {\n return (b & c) | (b & d) | (c & d);\n } else if (t <= 79) {\n return b ^ c ^ d;\n }\n }", "title": "" }, { "docid": "53a0d46ff2c15dce7ed882205d64de36", "score": "0.494961", "text": "function\t\tOpposite(n) { return (((n)+4)&7) }", "title": "" }, { "docid": "9d04f4a4765997bc2a74362f432ee782", "score": "0.4947234", "text": "function flip(fn) {\n return function (a, b) {\n return fn(b, a);\n };\n }", "title": "" }, { "docid": "012f39fd022a9929afb772da40c51d29", "score": "0.49422133", "text": "function msfix1(gfc) {\n for (var sb = 0; sb < Encoder.SBMAX_l; sb++) {\n /* use this fix if L & R masking differs by 2db or less */\n /* if db = 10*log10(x2/x1) < 2 */\n /* if (x2 < 1.58*x1) { */\n if (gfc.thm[0].l[sb] > 1.58 * gfc.thm[1].l[sb]\n || gfc.thm[1].l[sb] > 1.58 * gfc.thm[0].l[sb])\n continue;\n var mld = gfc.mld_l[sb] * gfc.en[3].l[sb];\n var rmid = Math.max(gfc.thm[2].l[sb],\n Math.min(gfc.thm[3].l[sb], mld));\n\n mld = gfc.mld_l[sb] * gfc.en[2].l[sb];\n var rside = Math.max(gfc.thm[3].l[sb],\n Math.min(gfc.thm[2].l[sb], mld));\n gfc.thm[2].l[sb] = rmid;\n gfc.thm[3].l[sb] = rside;\n }\n\n for (var sb = 0; sb < Encoder.SBMAX_s; sb++) {\n for (var sblock = 0; sblock < 3; sblock++) {\n if (gfc.thm[0].s[sb][sblock] > 1.58 * gfc.thm[1].s[sb][sblock]\n || gfc.thm[1].s[sb][sblock] > 1.58 * gfc.thm[0].s[sb][sblock])\n continue;\n var mld = gfc.mld_s[sb] * gfc.en[3].s[sb][sblock];\n var rmid = Math.max(gfc.thm[2].s[sb][sblock],\n Math.min(gfc.thm[3].s[sb][sblock], mld));\n\n mld = gfc.mld_s[sb] * gfc.en[2].s[sb][sblock];\n var rside = Math.max(gfc.thm[3].s[sb][sblock],\n Math.min(gfc.thm[2].s[sb][sblock], mld));\n\n gfc.thm[2].s[sb][sblock] = rmid;\n gfc.thm[3].s[sb][sblock] = rside;\n }\n }\n }", "title": "" }, { "docid": "16072f0d2df33a65e63706254b4f0caf", "score": "0.49385238", "text": "function xor(a, b) \n{\n\n if(a == false & b == false || a == true & b == true)\n {\n return false\n }\n else\n {\n return true\n }\n \n}", "title": "" }, { "docid": "89455c0ee2b91a8bf778f65b3c21af52", "score": "0.49365208", "text": "function orig(moons, original, axis) {\n let now = moons.map(m => m[axis]);\n\n for (let i = 0; i < 4; i++) {\n if (moons[i][`vel${axis.toUpperCase()}`] !== 0) return false;\n if (now[i] !== original[i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "97e2b0fddb263a9373e83748bf5e5435", "score": "0.4919102", "text": "fixUp() {\n let t = this;\n return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \n t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\n }", "title": "" }, { "docid": "97e2b0fddb263a9373e83748bf5e5435", "score": "0.4919102", "text": "fixUp() {\n let t = this;\n return t.right.isRed() && !t.left.isRed() && (t = t.rotateLeft()), t.left.isRed() && t.left.left.isRed() && (t = t.rotateRight()), \n t.left.isRed() && t.right.isRed() && (t = t.colorFlip()), t;\n }", "title": "" }, { "docid": "54e2a0ee53143bc6b02531eeeae705ae", "score": "0.49187395", "text": "flip(input){\n return null;\n }", "title": "" }, { "docid": "49129f561e0bac4efea49fd48f527456", "score": "0.4911178", "text": "function isXor(first, second) {\n let first_truthy = !!first === true;\n let first_falsy = !!first === false;\n let second_truthy = !!second === true;\n let second_falsy = !!second === false;\n\n return ((first_truthy && second_falsy) || (first_falsy && second_truthy));\n}", "title": "" }, { "docid": "a7ed235117e182ff446379da5ed7c533", "score": "0.490774", "text": "function flip() {\n return Math.random() >= 0.5;\n}", "title": "" }, { "docid": "a6fe638925f2940f0200a8001cceac28", "score": "0.49038842", "text": "function flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}", "title": "" }, { "docid": "a6fe638925f2940f0200a8001cceac28", "score": "0.49038842", "text": "function flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}", "title": "" }, { "docid": "a6fe638925f2940f0200a8001cceac28", "score": "0.49038842", "text": "function flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}", "title": "" }, { "docid": "a6fe638925f2940f0200a8001cceac28", "score": "0.49038842", "text": "function flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}", "title": "" }, { "docid": "a6fe638925f2940f0200a8001cceac28", "score": "0.49038842", "text": "function flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}", "title": "" }, { "docid": "a6fe638925f2940f0200a8001cceac28", "score": "0.49038842", "text": "function flip(fn){\n return function(a, b){\n return fn(b,a);\n }\n}", "title": "" }, { "docid": "8bdad9ff4e8994794d34a5011c9654b8", "score": "0.4901964", "text": "function swapTurn() {\n xTurn = !xTurn;\n}", "title": "" }, { "docid": "d7cfcc5ff09a1ad968a823014c4130ee", "score": "0.48956695", "text": "function flipOrVanish() {\n if (divArray.length == 2) {\n if (checkArray[0] == checkArray[1]) {\n divArray[0].addClass(\"hidden\");\n divArray[1].addClass(\"hidden\");\n setTimeout(checkForWin, 250);\n checkArray = [];\n divArray = [];\n } else {\n if (checkArray[0] != checkArray[1]) {\n divArray[0].css(\"background\", \"darkblue\");\n divArray[1].css(\"background\", \"darkblue\");\n checkArray = [];\n divArray = [];\n }\n }\n }\n }", "title": "" }, { "docid": "fc80f1ec32842deea101a484c75846d3", "score": "0.48913434", "text": "function flip(before) {\n if (before.length == 4) {\n return [\n before[1], before[0],\n before[3], before[2]\n ].join(\"\");\n }\n if (before.length == 9) {\n return [\n before[2], before[1], before[0],\n before[5], before[4], before[3],\n before[8], before[7], before[6]\n ].join(\"\");\n }\n throw \"unhandled input length: \" + before;\n}", "title": "" }, { "docid": "377e8647558efd2bde95f21038a4b398", "score": "0.4887264", "text": "flipX () {\n Matrix.flipX(this.matrix);\n this.orientationX *= -1;\n }", "title": "" }, { "docid": "972ae3a01e0a0c7bef11485f75a2b255", "score": "0.48791143", "text": "_f(t, b, c, d) {\n\t\t\tif (t <= 19) {\n\t\t\t\treturn (b & c) | (~b & d);\n\t\t\t} else if (t <= 39) {\n\t\t\t\treturn b ^ c ^ d;\n\t\t\t} else if (t <= 59) {\n\t\t\t\treturn (b & c) | (b & d) | (c & d);\n\t\t\t} else if (t <= 79) {\n\t\t\t\treturn b ^ c ^ d;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c79c4768be7262a3beaa7d1beb8f3af1", "score": "0.4878601", "text": "function negative(x) {\n\t\treturn ((x[x.length-1]>>(bpe-1))&1);\n\t}", "title": "" }, { "docid": "d3b2eebc6ebbc865dcef64ff126998a8", "score": "0.48768952", "text": "function rotvsop2J2000(x){\r\n\t/* From VSOP87.doc\r\n\t X +1.000000000000 +0.000000440360 -0.000000190919 X\r\n\t Y = -0.000000479966 +0.917482137087 -0.397776982902 Y\r\n\t Z FK5 0.000000000000 +0.397776982902 +0.917482137087 Z VSOP87A\r\n\t*/\r\n\tlet t = new Array();\r\n\tt[0] = x[0] + x[1] * 0.000000440360 + x[2] * -0.000000190919;\r\n\tt[1] = x[0] * -0.000000479966 + x[1] * 0.917482137087 + x[2] * -0.397776982902;\r\n\tt[2] = x[1] * 0.397776982902 + x[2] * 0.917482137087;\r\n\r\n\treturn t;\r\n}", "title": "" }, { "docid": "f57174a06038564fd63899ac8d23cc77", "score": "0.48687813", "text": "static FlipAll(src) {\n\n\t\tvar srcz = src.length;\n\t\tvar srcy = src[0].length;\n\t\tvar srcx = src[0][0].length;\n\n\t\tvar result = this.Create(srcz, srcy, srcx);\n\t\tvar tmp = this.Clone(src);\n\n\t\tfor (var FlipDim = 0; FlipDim < 3; FlipDim++) {\n\n\t\t\tresult = this.Flip(tmp, FlipDim);\n\n\t\t\ttmp = this.Clone(result);\n\t\t}\n\n\t\treturn result;\n\t}", "title": "" }, { "docid": "66f7083c24ee14f7528331649e6ebb8c", "score": "0.48639032", "text": "function flip() {\n const temp = currOne.value;\n currOne.value = currTwo.value;\n currTwo.value = temp;\n\n calculate();\n}", "title": "" }, { "docid": "5c73a9c23e31f1b0e82406757e2aa45d", "score": "0.48621014", "text": "function XOR(input1, input2){\n for(var i=0; i<input1.length; i++){\n if((input1[i] == 0 && input2[i] == 1) || (input1[i] == 1 && input2[i] == 0)){\n input1[i] = 1;\n }else{\n input1[i] = 0;\n }\n }\n return input1;\n}", "title": "" }, { "docid": "fc8a2ec226a080fb3e0a1754ddc673a9", "score": "0.4861294", "text": "function f(s, x, y, z) {\n switch (s) {\n case 0: return (x & y) ^ (~x & z);\n case 1: return x ^ y ^ z;\n case 2: return (x & y) ^ (x & z) ^ (y & z);\n case 3: return x ^ y ^ z;\n }\n}", "title": "" }, { "docid": "fc8a2ec226a080fb3e0a1754ddc673a9", "score": "0.4861294", "text": "function f(s, x, y, z) {\n switch (s) {\n case 0: return (x & y) ^ (~x & z);\n case 1: return x ^ y ^ z;\n case 2: return (x & y) ^ (x & z) ^ (y & z);\n case 3: return x ^ y ^ z;\n }\n}", "title": "" }, { "docid": "fc8a2ec226a080fb3e0a1754ddc673a9", "score": "0.4861294", "text": "function f(s, x, y, z) {\n switch (s) {\n case 0: return (x & y) ^ (~x & z);\n case 1: return x ^ y ^ z;\n case 2: return (x & y) ^ (x & z) ^ (y & z);\n case 3: return x ^ y ^ z;\n }\n}", "title": "" }, { "docid": "bc13a1d1641a41533ee00d1b1df56d2e", "score": "0.48547858", "text": "static xp_yp(v, o) { const x = v[0], y = v[1], z = v[2]; o[0] = y; o[1] = -z; o[2] = -x; return o; }", "title": "" }, { "docid": "0750bf37ff95c017beca9a58316e4368", "score": "0.48535496", "text": "function opposite(pit){\r\n\tif (pit == 0)\r\n\t\tpitOpposite = 12;\r\n\telse if (pit == 1)\r\n\t\tpitOpposite = 11;\r\n\telse if (pit == 2)\r\n\t\tpitOpposite = 10;\r\n\telse if (pit == 3)\r\n\t\tpitOpposite = 9;\r\n\telse if (pit == 4)\r\n\t\tpitOpposite = 8;\r\n\telse if (pit == 5)\r\n\t\tpitOpposite = 7;\r\n\telse if (pit == 7)\r\n\t\tpitOpposite = 5;\r\n\telse if (pit == 8)\r\n\t\tpitOpposite = 4;\r\n\telse if (pit == 9)\r\n\t\tpitOpposite = 3;\r\n\telse if (pit == 10)\r\n\t\tpitOpposite = 2;\r\n\telse if (pit == 11)\r\n\t\tpitOpposite = 1;\r\n\telse if (pit == 12)\r\n\t\tpitOpposite = 0;\r\n}", "title": "" }, { "docid": "90b878869eee96dc7da47906ecdf127b", "score": "0.4848958", "text": "function negative(x) {\n return ((x[x.length-1]>>(bpe-1))&1);\n}", "title": "" }, { "docid": "90b878869eee96dc7da47906ecdf127b", "score": "0.4848958", "text": "function negative(x) {\n return ((x[x.length-1]>>(bpe-1))&1);\n}", "title": "" }, { "docid": "6399a6a3448f842ecf46ebe3118ba44e", "score": "0.4844699", "text": "function\nats2jspre_neg_int0(x) { return ( -x ); }", "title": "" }, { "docid": "82b71d07cd6951651853f930d9c88b8e", "score": "0.4844328", "text": "function flagger(v,i){\n\tvar torf=parseInt(v&(1<<i))>0;\n\treturn Number(torf);\n}", "title": "" }, { "docid": "7896220395d85153968f75b6c5728e30", "score": "0.4835934", "text": "function toggleInverseTest()\n{\n inverse_test = !inverse_test;\n \n}", "title": "" }, { "docid": "e5fbeafdfa01854a370f0318af3f2fde", "score": "0.483264", "text": "function getPossibleFlips(temporaryFlipped, permanentlyFlipped) {\n\treturn permanentlyFlipped.map((item, index) => {\n\t\t// Check that card is not permanently flipped\n\t\tif (!item) {\n\t\t\t// Check that card is not temporary flipped\n\t\t\tif ((!temporaryFlipped.length) || (index !== temporaryFlipped[0])) {\n\t\t\t\treturn index;\n\t\t\t}\n\t\t} // Filter out the undefind items from map\n\t}).filter((item) => {\n\t\treturn item !== undefined\n\t});\n}", "title": "" }, { "docid": "d201137a1441e509287a3042830a3525", "score": "0.48150748", "text": "function f(s, x, y, z) {\n switch(s){\n case 0:\n return x & y ^ ~x & z;\n case 1:\n return x ^ y ^ z;\n case 2:\n return x & y ^ x & z ^ y & z;\n case 3:\n return x ^ y ^ z;\n }\n}", "title": "" }, { "docid": "52752441d57236531c228abe1ff99e52", "score": "0.48120788", "text": "function compras (trabalho1, trabalho2){\n const comprarSorvete = trabalho1 || trabalho2 // se um ou o outro for verdadeiro vamos comprar sorvete \n const comprarTv50 = trabalho1 && trabalho2 // somente se os dois forem verdade iremos comprar a Tv50 \n // const comprarTv32 = !!(trabalho1 ^ trabalho2) - operador bitwise xor \n const comprarTv32 = trabalho1 != trabalho2\n const manterSaudavel = !comprarSorvete // operador unário \n\n return { comprarSorvete, comprarTv50, comprarTv32, manterSaudavel } // cria um objeto \n}", "title": "" }, { "docid": "2793c2b0ba61fdada3d36f1aaef08cbe", "score": "0.48097634", "text": "function bytcyc(op) {\n//\n// (A contains op)\n// TAY (backup)\n\t\n// x1 IS NOT SIMPLE!\n// xx1 IS NOT SIMPLE!\n//\n// xxx xx0 x0 maybe SIMPLE!\n if (op & 0x05) return modebc(op);\n\n // maybe SIMPLE\n // after weeding out:\n // 000 000 00 00 brk \n if (!op) // BRK\n return [1, 7]\n\n // 001 000 00 20 jsr abs\n // if ((001 000 00 == 0x20 JSR-MODE (jsr ABS)\n if (op == 0x20) // JSR\n return [3, 6];\n\n // 010 000 00 40 rti \n // 011 000 00 60 rts \n if (op == 0x40 || op == 0x60) // RTI RTS\n return [1,6];\n\n // xxx 100 10 12 *** zpi\n if ((op & 0x1f) == 0x12)\n return modebc(op);\n\n // (100 000 00 80 bra imm)\n // 101 000 00 A0 ldy imm\n // 110 000 00 C0 cpy imm\n // 111 000 00 E0 cpx imm\n // 101 000 10 A2 ldx imm\n if ((op & 0x9f) == 0x80) // ???\n return [2, 3];\n\n // 000 010 00 08 php \n // 001 010 00 28 plp \n // 010 010 00 48 pha \n // 011 010 00 68 pla \n if ((op & 0x1f) == 0x08)\n return [1, 3 + ((op & 0x20) ? 1 : 0)];\n\n // 001 010 10 2A rol_a 1 2\n // 010 010 10 4A lsr_a \n // 011 010 10 6A ror_a \n \n // 100 010 00 88 dey \n // 101 010 00 A8 tay \n // 110 010 00 C8 iny \n // 111 010 00 E8 inx \n \n // 1xx 010 10 8A txa 1 2\n \n // xxx 100 00 10 Bxx 2 2 (3)\n // xxx 110 x0 18 ***\n if ((op & 0x1f) == 0x10)\n return [2, 3 + ((op & 0x20) ? 1 : 0)];\n \n // in principle we have all instructions\n return [1, 2];\n}", "title": "" }, { "docid": "cafa0321498b2de9ebef81c6cdd47c1c", "score": "0.48050418", "text": "function test_div_deopt_minus_zero_v() {\n for (var i = 0; i < 2; ++i) {\n assertTrue(IsNegativeZero(\n Math.floor((zero_in_array[0] | 0) / neg_one_in_array[0])));\n }\n}", "title": "" }, { "docid": "ccf833e46fcf2d0ca5edc62231e2c9a4", "score": "0.48044622", "text": "function ex_11_F(array)\n{\n array.sort(\n function(a,b)\n {\n if(a%2==1 & b%2==0)\n return -1;\n if(a%2==1 & b%2==1)\n return 0;\n if(a%2==0 & b%2==1)\n return 1;\n }\n );\n return array;\n}", "title": "" }, { "docid": "5915b8734ac395e761c0e41a4f9d6723", "score": "0.480223", "text": "static xp_yp_yp(v, o) { const x = v[0], y = v[1], z = v[2]; o[0] = -x; o[1] = -z; o[2] = -y; return o; }", "title": "" }, { "docid": "eb6df34134a4cfe43500b4d732009c22", "score": "0.4801029", "text": "function coinFlip() {\n return Math.random() > 0.5 ? 1 : -1;\n }", "title": "" }, { "docid": "ae05f75ec91e5c6310ecfac7c007f58f", "score": "0.47897986", "text": "function Negativa(x) {\n for (i = 0; i < x.length; i++) {\n x[i] = x[i] * -1;\n if (x[i] > 0) {\n x[i] = x[i] * -1;\n }\n }\n return (x);\n}", "title": "" }, { "docid": "4a8db4d2fa22104b0b3c09de7a2f083f", "score": "0.4788409", "text": "function DMUX4WAY(input,sel)\r\n{\r\n var a_=AND(NOT(sel[1]),NOT(sel[2]));\r\n var b_=AND(NOT(sel[0]),sel[1]);\r\n var c_=AND(sel[0],NOT(sel[1]));\r\n var d_=AND(sel[0],sel[1]);\r\n return [\r\n AND(input,a_)-0,\r\n AND(input,b_)-0,\r\n AND(input,c_)-0,\r\n AND(input,d_)-0\r\n ];\r\n}", "title": "" }, { "docid": "2ce27f70f986d2413ab3a50b44703fac", "score": "0.47850335", "text": "function addToFlipped() {\n\t\tif (flipped.length === 0 || flipped.length === 1) {\n\t\t\tflipped.push(evt.target.firstElementChild);\n\t\t}\n\t\t// look at both flipped cards\n\t\tcompareTwo();\n\t}", "title": "" }, { "docid": "4f18eb5fdfe00832ecc9ffefcd7ba360", "score": "0.47771806", "text": "function xor(value1, value2) {\n if ((value1 && !value2) || (value2 && !value1)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "6dc2f1c009a8737db98bd4371372857a", "score": "0.4776871", "text": "function isTileFlipped(){\r\n\r\n //Loop through every tile. If any tile is flipped, return true, else return false.\r\n for (i=0; i < count; i++){\r\n if(tiles[i].ref.data(\"flipped\")==true){\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "title": "" }, { "docid": "08896e195c946b66aa3f0706c8c60d6e", "score": "0.4772607", "text": "function swap(number) {\n if(number === true) {\n return false\n }\n return true;\n }", "title": "" }, { "docid": "3546802e2a96f88aee159ac39039becd", "score": "0.47675225", "text": "function flipValue(val) { return 100 - val; }", "title": "" }, { "docid": "ad49c048f2f7c394058538fe5728f901", "score": "0.4766683", "text": "isTranslation() {\n return this.type === Matrix3Type.TRANSLATION_2D || this.m00() === 1 && this.m11() === 1 && this.m22() === 1 && this.m01() === 0 && this.m10() === 0 && this.m20() === 0 && this.m21() === 0;\n }", "title": "" }, { "docid": "bf965575530783e48a0b8385efaaff57", "score": "0.47629797", "text": "function rewriteBitComparison(left, right) {\n if (isBooleanExpression(left) && isBitConstantExpression(right)) {\n return (right.value === true) ? left : new UnaryExpression(left, ExpressionType.Not);\n }\n else if (isBooleanExpression(right) && isBitConstantExpression(left)) {\n return (left.value === true) ? right : new UnaryExpression(right, ExpressionType.Not);\n }\n\n // no conversion necessary\n return null;\n }", "title": "" }, { "docid": "d6fbd7079fd87f0ea30f696529f8bdc3", "score": "0.47626132", "text": "function Z() { !function (t) { Y[J++] ^= 255 & t, Y[J++] ^= t >> 8 & 255, Y[J++] ^= t >> 16 & 255, Y[J++] ^= t >> 24 & 255, J >= X && (J -= X) }((new Date).getTime()) }", "title": "" }, { "docid": "85afc70f19fb5b9c98b78dd22c9b49d2", "score": "0.47615212", "text": "function flip() {\n $('#1_container').toggleClass('flipped');\n }", "title": "" }, { "docid": "593c9145bab20b5f6511ab84004f3e92", "score": "0.47602865", "text": "function toO3D(n) {\n\t return n !== true ? n : false;\n\t}", "title": "" }, { "docid": "a72086cb612f7ddb5b3a5bf254369e7d", "score": "0.47590566", "text": "function bitpos() {\n}", "title": "" }, { "docid": "dbaa07cb0091e093c3bad0e66fa2582c", "score": "0.47574195", "text": "function containFlipped(card){\n\treturn card.classList.contains(\"flipped\");\n}", "title": "" }, { "docid": "2ac63f5386e6d7819871813ad52bea30", "score": "0.47550023", "text": "function P2a(a,b){if(w(a,b))return!0;if(!a||!b||cp(a)!=cp(b))return!1;a=a.a.gg();for(var c=0;c<a.length;c++)if(!b.U(a[c]))return!1;return!0}", "title": "" }, { "docid": "97b3ccb1ab5be1a467fdf3d4ccc60f97", "score": "0.47530836", "text": "function ge_neg(pub) {\n pub[31] ^= 0x80;\n}", "title": "" } ]
23648b0645cce857c7071e75dbca0d09
Get articles of a category
[ { "docid": "09f00389710907d27946bf46e5d0fa65", "score": "0.75935924", "text": "function getArticles(cat) {\n\tfetch('https://api.nytimes.com/svc/archive/v1/2019/2.json?api-key=8793dBix9MPRBW5QM1noEAMn1cZRxQ8R')\n\t\t.then(res => res.json())\n\t\t.then(data => {\n\t\t\tconsole.log(data.response.docs.filter(art => art.section_name === cat));\n\t\t})\n}", "title": "" } ]
[ { "docid": "963e7a903381720bdb1a2a0207f3d115", "score": "0.7237355", "text": "function getPostsByCategory() {\n\tvar snippet = {\n\t\tquery: {category: \"testodd\"}\n\t}\n\trimer.post.findByCategory(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "2d8f19be32c81a9d423067f4948ab71c", "score": "0.6851337", "text": "function findArticles() {}", "title": "" }, { "docid": "b845109bb090773ce59fc19c77288ee7", "score": "0.6720286", "text": "async categories() {\n return await this.fetch(\"/categories/list\");\n }", "title": "" }, { "docid": "75ef80e4b1fbabb6a987480b22a2c00c", "score": "0.6679098", "text": "async readCategories() {\n let response = await fetch(url + 'get/categories');\n let data = await response.json();\n return data\n }", "title": "" }, { "docid": "bef827d53d52afacc4091821648d15e8", "score": "0.6663666", "text": "function routeCategory(req, res) {\n var category = req.params[0],\n page = req.query.page ? parseInt(req.query.page) : 1;\n\n async.waterfall([\n function(cb) {\n getCategories(cb);\n },\n function(categories, cb) {\n if (!(category in categories)) {res.send(404); return;}\n blogCollection.find(\n {'category': category},\n {'_id': 0, 'content': 0},\n {limit: PER_PAGE, skip: (page-1)*PER_PAGE, sort: {'mtime': -1}}).toArray(cb);\n },\n function(articles, cb) {\n if (articles.length === 0) {res.send(404); return;}\n res.set('Last-Modified', (new Date(articles[0].mtime)).toGMTString());\n res.json({articles: articles});\n }\n ], function(err) {\n if (err) {req.next(err); return;}\n });\n }", "title": "" }, { "docid": "30c8b91139287522b323c5ecdc8c7d39", "score": "0.6636934", "text": "function getNews(category) {\r\n let cat = 'category=' + category + '&';\r\n let url = 'http://newsapi.org/v2/top-headlines?' +\r\n 'country=us&' + cat + apiKey;\r\n \r\n let req = new Request(url);\r\n fetch(req)\r\n .then(response => response.json())\r\n .then(data => parseResults(data));\r\n}", "title": "" }, { "docid": "c387c9d836d255b8493af277ab7c17ad", "score": "0.65844524", "text": "async function getMyArticles() {\n return new Promise((resolve, reject) => {\n unirest.get(`https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@kailashwall`)\n .end(response => {\n if (!response.ok) {\n reject(response.body);\n } else {\n resolve(response.body.items.filter(el => el.categories.length > 0));\n }\n });\n });\n}", "title": "" }, { "docid": "8b749b4f1f7df744302ebcd84830be5b", "score": "0.6554914", "text": "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n }", "title": "" }, { "docid": "07cab7979dd2b1460c454e22d0caff20", "score": "0.6465922", "text": "function getCategories() {\n\trimer.category.find(function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "title": "" }, { "docid": "6a5f1e9ef3ef65ae6ec6d7a49d7edbaf", "score": "0.6408702", "text": "static async getCardsByCategory(category) {\n const cards = await db.query(`SELECT * FROM cards WHERE category= $1`, [\n category\n ]);\n return cards.rows;\n }", "title": "" }, { "docid": "4ccf81a1dfdfc720d2568078e1f217dc", "score": "0.6362489", "text": "function getPosts(category) {\n var categoryString = category || \"\";\n if (categoryString) {\n categoryString = \"/category/\" + categoryString;\n }\n $.get(\"/api/posts\" + categoryString, function (data) {\n post = data;\n if (!post || !post.length) {\n displayEmpty();\n }\n else {\n initializeRows();\n }\n });\n }", "title": "" }, { "docid": "fb1beba2cb4f12806e7310e65a61bbfb", "score": "0.63444704", "text": "async function getArticles() {\n\n try {\n const response = await HTTP.get('/services/articles');\n return response.data.articles;\n\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "5668d8be99a2fadd35c3f7d287f6defb", "score": "0.6331049", "text": "async getCategories (offset) {\n const response = await fetch(`http://jservice.io/api/categories?count=100&offset=${offset}`)\n const json = response.json()\n return json\n }", "title": "" }, { "docid": "da73cdcc634a4b2061d4aeaa68848b05", "score": "0.628564", "text": "function getCategories() {\n $.get(\"/api/categories\", renderCategoryList);\n }", "title": "" }, { "docid": "12d934d6876987a8bcab9cadebb1824e", "score": "0.6241779", "text": "function fetchCategories(){\n return fetch(catURL)\n .then(resp => resp.json())\n .then(categories=>{\n categoryData = categories\n displayCategories(categories)\n })\n}", "title": "" }, { "docid": "3a721f1775a5a91b96b867e05a7da5df", "score": "0.6226295", "text": "function getCategories() {\n fetch(apiCategorias)\n .then((res) => res.json())\n .then((dataJson) => {\n printCategories(dataJson.trivia_categories);\n })\n .catch((err) => {\n console.error(err);\n });\n}", "title": "" }, { "docid": "142c190bf00a5f255cc52aa1c12296ff", "score": "0.6224455", "text": "async fetchCategorias (filterParams = \"\") {\n try { \n let res = await HTTPService.getConnection().get('/api/obterCategorias') \n return res;\n } catch (err) { \n return err.response\n }\n }", "title": "" }, { "docid": "a97a01a9507b63c7faf9adae0df543a7", "score": "0.6199512", "text": "function getCategory(){\n var deferred = $q.defer();\n\n $http({\n url: API_ENDPOINT + APIPATH.category,\n method: 'GET'\n })\n .then(function (data) {\n deferred.resolve(data);\n },function(data){\n deferred.resolve(data);\n $mdToast.show(\n $mdToast.simple()\n .textContent('Sorry! Unable to show categories')\n .position('top')\n .hideDelay(5000)\n );\n })\n\n return deferred.promise;\n }", "title": "" }, { "docid": "4568f8dee8f291bed562cc65b9a2591e", "score": "0.6190314", "text": "function getArticles() {\n return $http.get('/api/core/articles');\n }", "title": "" }, { "docid": "36eb2b1a28dc7518e4c4d2fc82615baa", "score": "0.61504316", "text": "getCategories(category) {\n return this._categories;\n }", "title": "" }, { "docid": "d9774180a91c7ba5c44c820d93a7a032", "score": "0.61316955", "text": "function getPostsByCategory(categoryId,limit){\n\tvar info = {\n\t\t\"type\":\"viewPostByCategory\",\n\t\t\"categoryId\": categoryId,\n\t\t\"requestLimit\":limit\n\t};\n\tif(categoryId != 0){\n\t\t$.get(BASE_URL+\"php/view.php\",info,function(data){\n\t\t\tviewPosts(data,true,limit);\n\t\t\t/*console.log(data);*/\n\t\t}).fail(function(jqXHR){\n\t\t\tconsole.log(jqXHR.statusText);\n\t\t});\n\t}else{\n\t\tgetAllPosts(limit);\n\t}\n}", "title": "" }, { "docid": "1c41b00ea455573f1d0437f643869e4a", "score": "0.61290246", "text": "async function getCategory() {\r\n let request = {\r\n method: 'GET',\r\n redirect: 'follow'\r\n }\r\n\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n\r\n const serverReturn = await fetch(ENDPOINT_URL + '/categories', request);\r\n\r\n if (!serverReturn.ok) {\r\n addAgentMessage(\"There was a problem accessing the list of categories. Please try again!\");\r\n return;\r\n }\r\n\r\n const serverResponse = await serverReturn.json()\r\n\r\n let categories = serverResponse.categories;\r\n\r\n // comma separated; using 'and' to give the assistant a more of human personality \r\n let message = \"We offer products for \" + categories.length + \" total categories: \\n\"\r\n message += categories.splice(0, categories.length - 1).join(', ') + \", and \" + categories[0] + \".\"\r\n addAgentMessage(message);\r\n\r\n\r\n }", "title": "" }, { "docid": "5c0607009d602a6b489d25e20be1b39c", "score": "0.6121568", "text": "getAllCategories() {\n return this.http.get(this.allCategoryUrl);\n }", "title": "" }, { "docid": "167f8c2cacbdd53a2a01b70ea3da9519", "score": "0.6083039", "text": "retrieveCategories() {\n return call(`${this.__url__}/categories`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n timeout: this.__timeout__\n })\n }", "title": "" }, { "docid": "fb2329757151400a6280d23dc0d2719e", "score": "0.6072942", "text": "function getProductsByCategory(category = 1) {\n $.ajax({\n type: \"GET\",\n url: \"getProductsByCategoryId\",\n data: {\n categoryId: category\n },\n success: (data) => makeProductsHTML(data)\n })\n}", "title": "" }, { "docid": "22a954f41782906d348cb0b35adcae8c", "score": "0.6070147", "text": "async getCategories() {\n // Consultar las categorias a la REST API de event brite\n const responseCategories = await fetch\n (`https://www.eventbriteapi.com/v3/categories/?token=${this.token_auth}`);\n\n // Esperar la respuesta de las categorias y devolver un JSON\n const categories = await responseCategories.json();\n // Devolvemos el resultado\n return {\n categories\n }\n }", "title": "" }, { "docid": "44f1d56e6085e40d44a453f0ba2c0418", "score": "0.6066785", "text": "function getCategories() {\n $.ajax({\n type: \"GET\",\n url: \"getCategories\",\n success: (data) => makeCategoriesHTML(data)\n })\n}", "title": "" }, { "docid": "1b5583b3a351d53cbf7f30d60e0d2c6c", "score": "0.6035902", "text": "static getCategories(req, res, next){\n CategorySchema.find({}, function(err, categories){\n res.send(categories)\n })\n }", "title": "" }, { "docid": "091e828949e8ffea551d1cae49023444", "score": "0.60309184", "text": "function getNewsItems(category, mode, max) {\n\t// We make the input category lowercase in case the Homey speech engine provides us with capitals\n\tcategory = category.toLowerCase();\n\t\n\t// Check if the given category is in the array of known categories\n\tvar n_category = categories.find(function (item) {\n\t\treturn item == category.toLowerCase();\n\t});\n\t\n\t// If no known category was matched, we inform the user and abort processing\n\tif (!n_category) {\n\t\tHomey.log('Unknown category: '+category);\n\t\tspeechEngine.say(__('unknownCategory', {'category': category}));\n\t\treturn;\n\t}\n\t\n\t// The category 'laatste' should be casted to an empty string for its RSS URL to be correct\n\tif (category == 'laatste') {\n\t\tcategory = '';\n\t}\n\t\n\t// Import necessary classes\n\tvar http = require('http');\n\tvar FeedMe = require('feedme');\n\t\n\t// Get the rss news feed from the internet\n\tHomey.log('Getting news items for category: '+category);\n\thttp.get('http://www.nu.nl/rss/'+category, function(res) {\n\t\tvar parser = new FeedMe();\n\t\tvar items = [];\n\t\t\n\t\t// Whenever we find an item in the parsed xml, add it to the items array\n\t\tparser.on('item', function(item) {\n\t\t\t// We only add the item to the array if the max number of items has not been reached, or no max (=0) was set\n\t\t\tif (items.length < max || max == 0) items.push(item);\n\t\t});\n\t\t\n\t\t// When the entire feed was parsed, we continue to process the items array\n\t\tparser.on('end', function() {\n\t\t\tHomey.log('Number of news items found: '+items.length);\n\t\t\t// Make sure at least one news item was found\n\t\t\tif (items.length > 0) {\n\t\t\t\t// First, we tell the total number of news items we have found\n\t\t\t\tspeechEngine.say(__('foundNews', {'count': items.length}));\n\t\t\t\t\n\t\t\t\t// Then we initiate to read the first news item in the array\n\t\t\t\treadNewsItem(items, 0, mode);\n\t\t\t} else {\n\t\t\t\t// If no news items at all have been found, we notify the user\n\t\t\t\tspeechEngine.say(__('noNews'));\n\t\t\t}\n\t\t});\n\t\t\n\t\t// Notify the user if any error occurs while parsing the xml rss feed\n\t\tparser.on('error', function(error) {\n\t\t\tspeechEngine.say(__('errorParsing'));\n\t\t\tconsole.error(error);\n\t\t});\n\t\t\n\t\t// Give the result to the parser\n\t\tres.pipe(parser);\n\t}).on('error', function(error) {\n\t\t// If we can't download the rss feed, we notify the user\n\t\tspeechEngine.say(__('errorDownloading'));\n\t\tconsole.error(error);\n\t});\n}", "title": "" }, { "docid": "fa14e823ccdf026fe940a7c302a80f56", "score": "0.5987608", "text": "async function getCategoryHeadlines(language, country, categories) {\n\t//Get headlines\n\tconst articles = (await newsapi.v2.topHeadlines({language, country})).articles;\n\t\n\t// reduce to a set of articles to a subset that contains articles\n\tconst categorizedArticles = articles.reduce((safe, article) => {\n\t\tif (articleContainsCategory(article, categories)) {\n\t\t\tsafe.push(article);\n\t\t}\n\t\treturn safe;\n\t}, []);\n\t\n\treturn categorizedArticles;\n}", "title": "" }, { "docid": "c228d148bffd2e0337125589adc80438", "score": "0.5982024", "text": "async function getCategories(request, content) {\n\tif (request.parameters.id) {\n\t\tvar sqloneCategory = 'SELECT id, name, position FROM category WHERE id = ?';\n\t\tconst sql = await mysql.format(sqloneCategory, request.parameters.id);\n\t\tconst row = await pool.query(sql);\n\t\treturn row;\n\t\t\n\t} else {\n\t\tvar sqlAllItemsFromList = 'SELECT id, name, position FROM category order by position';\n\t\t//console.log(req);\n\t\tconst sql = await mysql.format(sqlAllItemsFromList);\n\t\tconst row = await pool.query(sql);\n\t\treturn row;\n\t};\n}", "title": "" }, { "docid": "5974f422fd3cbe34a61f9d9191a1925c", "score": "0.5979897", "text": "function getCategories() {\n \n // API call to get categories\n fetch(\"https://my-store2.p.rapidapi.com/catalog/categories\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ef872c9123msh3fdcc085935d35dp17730cjsncc96703109e1\",\n \"x-rapidapi-host\": \"my-store2.p.rapidapi.com\"\n }\n })\n .then(response => {\n return response.json();\n })\n .then(response => {\n\n // call display catgories to display it on screen\n displayCategories(response);\n })\n .catch(err => {\n console.error(err);\n });\n }", "title": "" }, { "docid": "1b0aad7041656b7b6d524e6dd5871801", "score": "0.59772515", "text": "async getCategories(_, __, context) {\n try {\n let categories = await Category.find().sort({ createdAt: -1 });\n return categories;\n\n // newArr = [];\n\n // for (let cat of categories) {\n // newArr.push({ category: cat });\n // }\n // return newArr;\n\n // return [ {category} ];\n } catch (err) {\n throw new Error(err);\n }\n }", "title": "" }, { "docid": "84caacfcaed609d04daa75b28d84a9bd", "score": "0.5975213", "text": "getAllcategory() {\n this.albumcategoryServices.getAll('', '1', '100').subscribe(res => {\n this.categoryList = res.result;\n });\n }", "title": "" }, { "docid": "84caacfcaed609d04daa75b28d84a9bd", "score": "0.5975213", "text": "getAllcategory() {\n this.albumcategoryServices.getAll('', '1', '100').subscribe(res => {\n this.categoryList = res.result;\n });\n }", "title": "" }, { "docid": "c15e8989cbc38614512362d5ff664aca", "score": "0.59707135", "text": "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "title": "" }, { "docid": "52d735005f05478294cb1b99245ec74a", "score": "0.5961966", "text": "function getCategories() {\n const apicall = 'http://localhost:3010/api/events/categories';\n fetch(apicall, {\n method: 'GET',\n }).then((response) => {\n if (!response.ok) {\n if (response.status === 401) {\n throw response;\n }\n }\n return response.json();\n }).then((json) => {\n setCategoryList(json);\n json.map((category1) =>\n // attach to category state\n setCategories({...categories, [category1.category]: false}),\n );\n })\n .catch((error) => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "ea4526bf30b0975c63e0889b62ee752a", "score": "0.5956367", "text": "function adminCategoryFetchCall() {\n return request('get', urls.ADMIN_CATEGORY_URL, {}, { header: 0 });\n}", "title": "" }, { "docid": "98d5d94050ec4bbbbc9d87f6e40acf2e", "score": "0.5944224", "text": "function getAllChemicalCategory() {\r\n return get('/chemicalcategory/getall').then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "title": "" }, { "docid": "2f240b77e2544b70359c8aa55b4422b6", "score": "0.5930579", "text": "fetchCategory(category) {\n\t\t\t\tthis.reset();\n\n\t\t\t\tfor (let i = 1; i <= 10; i++) {\n\t\t\t\t\tthis.add({\n\t\t\t\t\t\tnumber: i,\n\t\t\t\t\t\tcategory: category ? category : 'sports',\n\t\t\t\t\t\tisHidden: i !== 1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "d8283cb3083813a7de9ddbc7a04be3d6", "score": "0.5914061", "text": "function getCats(fn){\r\n\tMongoClient.connect(uri, function(err, db) {\r\n\t\r\n\t\tif(err) throw err;\r\n\t\t\r\n\t\tvar collection = db.collection('feed');\r\n\t\t//gets all different categories and sends them to user\r\n\t\tcollection.distinct('categoria', function(err, docs){\r\n\t\t\tfn(docs);\r\n\t\t\tdb.close();\r\n\t\t});\r\n\t\t\r\n\t});\r\n}", "title": "" }, { "docid": "54b00851893db9b47bf15e63edd0678d", "score": "0.59053737", "text": "function getCategoryImages() {\n apiService\n .get(\n `/images/search?category_ids=${\n Object.keys(activeCategory).length === 0 ? \"\" : activeCategory.id\n }&limit=${categoryReducer.limit}`\n )\n .then((response) => {\n dispatch(setCatgoryImages(response.data));\n })\n .catch((error) => {});\n }", "title": "" }, { "docid": "e802c462fd904f9a3ecf129f54a59ab4", "score": "0.5895993", "text": "getItemsByCategoryId(categoryId){\n return http.get(`/items/${categoryId}`)\n \n }", "title": "" }, { "docid": "3d1e1ada6176da9d73c0cc5ce894198d", "score": "0.5893389", "text": "async function getArticles() {\n\tconst response = await fetch(url);\n\tconst json = await response.json();\n\tconst { articles } = json;\n\tdocument.getElementById('title').innerHTML = `CoderNews`;\n\tconst articlesHTML = articles.map(renderArticle);\n\tdocument.getElementById('newsList').innerHTML = articlesHTML.join('');\n}", "title": "" }, { "docid": "454b9d032d9e55e58f0902e5994932cb", "score": "0.58528894", "text": "getSelectedCategory(category) {\n axios\n .get(`${apiBaseUrl}/entries?category=${encodeURIComponent(category)}`)\n .then(res => {\n\n this.selectedCategory = res.data.entries;\n this.show = true;\n })\n .catch(error =>\n console.error(\"Can't get the Categories\", error)\n );\n }", "title": "" }, { "docid": "609ae6c1d4baa9690968dec9ba5430fb", "score": "0.58404386", "text": "getCategories(req, res) {\n db.items.getAllCategories()\n .then(result => res.status(200).send(result));\n }", "title": "" }, { "docid": "af7c953b137dca879e8061003a444de2", "score": "0.5837799", "text": "async function getProductsByCategory(req, res){\n\ttry {\n\t\tconst productos = await Product.findAll({where: {nombreCategoria: req.params.nombreCategoria}})\n\t\tres.send(productos)\n\t} catch (error) {\n\t\tres.send(error)\n\t}\n}", "title": "" }, { "docid": "dce3e80fe19601395e87779a48d1fd67", "score": "0.58354425", "text": "function getAllCategories() {\n $.get(\"FAQ/GetEveryCategories\", function (output) {\n allCategories = output; \n printAllCategories(output);\n });\n}", "title": "" }, { "docid": "bcb783a250056f502f3a193d0e1ec10a", "score": "0.5831083", "text": "function getCats() {\n\t return fetch(urlcat).then(res => res.json())\n\t}", "title": "" }, { "docid": "4a99379cce53e4da2e0be90930a8f790", "score": "0.583015", "text": "function fetchArticles() {\n return fetch(\"https://wisam-blog.herokuapp.com/api/articles\")\n .then((response) => response.json())\n .then((json) => render(json));\n}", "title": "" }, { "docid": "5e5195f7adcc0e9e4a341b531a4dafca", "score": "0.5829321", "text": "function getContentByCategoryId(categoryId, categoryName) {\n\n\n // Display category name to CustomContent view\n vm.categoryName = categoryName;\n vm.categoryId = categoryId;\n\n // Get all content associated with the specific category Id\n DashboardFactory.getContentByCategoryId(categoryId).then(\n\n function(response) {\n\n vm.content = response;\n $state.go('main.customcontent');\n\n },\n\n function(error) {\n\n // Clear content from custom content view if no content is found for a specific category\n vm.content = '';\n $state.go('main.customcontent');\n\n });\n \n }", "title": "" }, { "docid": "c514e90ef643caf0c204386e0e82b7fb", "score": "0.581894", "text": "function fetchCat() {\n return axios({\n method: \"get\",\n url: \"/cat/random\"\n });\n}", "title": "" }, { "docid": "3dbe9e4c33744b6a2720135427ac0e7b", "score": "0.5816504", "text": "function GetCategory(categoryId) {\n const [category, setCategory] = useState('');\n const url = \"/api/categories/\"+categoryId;\n useEffect(() => {\n const requestCategory = async () => {\n const response = await fetch(url);\n const { data } = await response.json();\n const att = await data.attributes;\n const cat = await att.category;\n setCategory(cat);\n };\n requestCategory();\n }, []);\n\n return category;\n}", "title": "" }, { "docid": "83b15705655f5f4590eef49809cf6459", "score": "0.58081275", "text": "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "title": "" }, { "docid": "b9bbeb41f594c12051ce8e25c9eceacb", "score": "0.5797604", "text": "async getCategoriesAPI() {\r\n const categoresResponse = await fetch(\r\n `https://www.eventbriteapi.com/v3/categories/?token=${this.token_auth}`\r\n );\r\n // return the data as json\r\n\r\n const categories = await categoresResponse.json();\r\n return {\r\n categories\r\n };\r\n }", "title": "" }, { "docid": "cfe549f402237b2f1fadef565fca3789", "score": "0.5791712", "text": "getCategoryDrinks(category) {\n return apiClient.get(`/drinks/${category.name}`);\n }", "title": "" }, { "docid": "ab03de22fdcc73b6be0bb24870fb9b04", "score": "0.5790552", "text": "searchCaseByCat(description: string): Promise<Case[]>{\n return axios.get(url+'/searchCaseCategory/'+description);\n }", "title": "" }, { "docid": "ddaeb4f30bc254ec08c8d74172c02426", "score": "0.57866037", "text": "async function fetchRecipesByCategory(categoryname){\r\n const result = await axios(\r\n `https://www.themealdb.com/api/json/v1/1/filter.php?c=${categoryname}`,\r\n );\r\n await setRecipeList(result);\r\n }", "title": "" }, { "docid": "ed55cf8452d4439360e43aa533eeb595", "score": "0.57864165", "text": "function getCategorias(req, res){\n\tCategoria.find({}, (err, Categorias) => {\n \tif (err) return res.status(500).send({message: `Error al realizar la petición: ${err}`})\n \tif (!Categorias) return res.status(404).send({message: 'No existen Categorias'})\n\n \tres.send(200, { Categorias })\n\t}) \n}", "title": "" }, { "docid": "4dbb6fa1c3a18d0b78477c8c26f090c7", "score": "0.5779476", "text": "async getCategoriesAPI() {\n // Make a GET request and wait for the request to finish\n const categoriesResponse = await fetch(`https://www.eventbriteapi.com/v3/categories/?token=${this.token_auth}`);\n \n // get the JSON version of the response\n const categories = await categoriesResponse.json();\n\n // return the object\n return { categories }\n }", "title": "" }, { "docid": "84453cf5d44ad0de78375dc5ba593c06", "score": "0.57775307", "text": "function getCategories(searchTerm) {\n searchTerm = encodeURIComponent(searchTerm);\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n return fetch(`${TRIPPLANNERAPI}/search/categories/${searchTerm}`, requestOptions)\n .then(handleResponse)\n}", "title": "" }, { "docid": "f6e9f25209d1adcefaa91aba14cc5ed8", "score": "0.5771999", "text": "static async getAllCategoriesAndQuestions() {\n categories = [];\n let categoryIds = await Category.getCategoryIds();\n for ( let categoryId of categoryIds ) {\n let fullCategory = await Category.getCategory(categoryId);\n categories.push(fullCategory);\n }\n return categories;\n }", "title": "" }, { "docid": "ae3398b0b4e62e689c02e03515890259", "score": "0.57704633", "text": "static getByCategory(request, response) {\r\n\r\n console.log(request.params.category);\r\n\r\n itemsModel.getByCategory(request.params.category)\r\n .then( data => {\r\n if (data.length > 0) {\r\n response.json(data); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Items not found. Category: ', request.params.category);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error getting items by category: ', request.params.category, err);\r\n });\r\n }", "title": "" }, { "docid": "ab91cd74e1693a917764f5aa68ff00ca", "score": "0.5767605", "text": "function loadCategory() {\n $.ajax({\n url: 'allCategory',\n type: 'GET',\n success: function(data) {\n $('#dataTableExample1').html(data);\n }\n });\n }", "title": "" }, { "docid": "02401a6ed621c5988da4ce613ed77c00", "score": "0.57519436", "text": "async getCategorybyId (id) {\n const response = await fetch(`http://jservice.io/api/category?id=${id}`)\n const json = await response.json()\n return json\n }", "title": "" }, { "docid": "987c36477161e7a34b915a8fd34e442d", "score": "0.5749819", "text": "async function getCategory(categoryText) {\n\n /* currently, this doesn't guarantee that it returns the \"first\" category if \n * a block has more than one category */\n const pageDataQuery = \n `SELECT C.CATEGORYTEXT, \n C.CATEGORYID, \n C.PARENT, \n\t B.TITLE, \n\t B.BLOCKID, \n\t R.CREATED, \n\t U.USERNAME, \n\t R.TEXT, \n\t R.REVISIONID\n FROM USERS U \n INNER JOIN REVISIONS R ON U.USERID = R.USERID \n INNER JOIN BLOCKS B ON R.BLOCKID = B.BLOCKID \n INNER JOIN BLOCKS_CATEGORIES X ON X.BLOCKID = B.BLOCKID \n INNER JOIN CATEGORIES C ON C.CATEGORYID = X.CATEGORYID \n WHERE C.CATEGORYTEXT = ?\n AND R.STATUS = ?\n ORDER BY R.REVISIONID ASC\n LIMIT 1`; // order / limit because BUG TBD\n\n results = await connection.query(pageDataQuery, [categoryText, conf.CURRENT]);\n\n results = results.shift(); \n\n return results;\n}", "title": "" }, { "docid": "9c172f7f70b717daa1de240ab1104be0", "score": "0.5747941", "text": "function loadThisCategoryPosts(theCategory) {\n\n var thisCategoryPosts = [];\n $.get(\"posts/posts.xml\", function(posts) {\n $(posts).find('post').each(function() {\n var this_post = $(this);\n // if post category is category being loaded\n if (this_post.attr('category') == theCategory) {\n thisCategoryPosts.push( buildPostObj(this_post) );\n }\n });// end each post\n }).complete(function() {\n $('#main').empty();\n thisCategoryPosts.sort(date_sort_desc);\n buildPosts(thisCategoryPosts, 0, thisCategoryPosts.length);\n\n var catInfo = 'Category: ' + theCategory.replace(/_/g, ' ').capAllWords() + ' <span>' + thisCategoryPosts.length + ' ';\n catInfo+= (thisCategoryPosts.length > 1) ? 'Posts' : 'Post';\n var catTitle = $('<h4>').html(catInfo+'</span>');\n $(catTitle).insertBefore('.post:first-of-type');\n });\n}", "title": "" }, { "docid": "ded0be2d4a447393021699fd1bb220d1", "score": "0.57462835", "text": "function getCategories(req, res) {\n console.log(\"getCategories endpoint\");\n\n client\n .query(`SELECT distinct category from expenses where category in('Maintenance_Repair', 'Gas', 'Propane', 'Parking_Toll', 'InitialCosts', 'RigUpgrades', 'InternationalCashExchange', 'Entertainment', 'Food', 'Internet', 'Rent');`)\n .then(data => {\n res.status(200).send(data.rows);\n console.log(`queried for distinct categories and sent to client`);\n })\n .catch(err => {\n res.status(404).send(err);\n })\n}", "title": "" }, { "docid": "cc96829a1e84528ca7e394ab54a881da", "score": "0.5736183", "text": "async function pageCategories(pag) {\n var cats = await pag.categories(), z = [];\n for(var cat of cats) {\n var c = cat.replace('Category:', '');\n if(!CATEGORY_EXC.test(c)) z.push(c);\n }\n return z;\n}", "title": "" }, { "docid": "a367041e1f1b1ddc1be7fd00dd76d1df", "score": "0.5734412", "text": "async getProducts(categoryId) {\n const URI = '../db/products.json';\n const response = await fetch(URI);\n\n const data = await response.json();\n\n //If category Id is empty return all products\n if (!categoryId) {\n return data.products;\n }else{\n //Return products filters by category Id\n return data.products.filter(product => product.category === categoryId)\n }\n }", "title": "" }, { "docid": "7b36e1c673a1400a77b04034bde3408d", "score": "0.57290363", "text": "function getCategories(){\n return _categoryProducts;\n}", "title": "" }, { "docid": "122ec03a7fdae73c2fc8f2992879ce36", "score": "0.57216686", "text": "function findCategory(){\n return _.find(categories, function(c){\n return c.name == categoryName;\n });\n }", "title": "" }, { "docid": "67ce1db924a55df13286449b3fe9e977", "score": "0.5708005", "text": "function getCategories(success, fail) {\n var key = 'ow-news-lists',\n target = 'categories',\n cache = cacheFactory.check({key:key,target:target,lifetime:lifetime});\n\n if(!cache) {\n newsFactory.categories().then(function (data) {\n if(cacheFactory.set({key:key,target:target,value:data,method:'override'})) {\n success(data); \n } \n }, fail);\n } else {\n success(cacheFactory.get({key:key,target:target}));\n }\n }", "title": "" }, { "docid": "da9f63434adae154d7bedb33da0ae8dd", "score": "0.5701373", "text": "async function getCatsList() {\n const res = await axios.get(`${MD_BASE_URL}/list.php?c=list`);\n const catsList = res.data.meals.map(i => i.strCategory);\n return catsList;\n }", "title": "" }, { "docid": "a7ba401aea49f2e3b5a75778b7da1b96", "score": "0.56834215", "text": "async function fetchCategories() {\n checkBreweryAPIConfiguration();\n\n const apiUrl = `${BREWERY_DB.API_ENDPOINT}/categories?key=${BREWERY_DB.API_KEY}`;\n\n return rp({ uri: apiUrl, json: true });\n}", "title": "" }, { "docid": "7331b78e3885e5b2413f31b4dbed9a1a", "score": "0.56689453", "text": "function loadCategories() {\n\t\tlet categories = new wp.api.collections.Categories()\n\n\t\tcategories.fetch().done( () => {\n\t\t\tconsole.log(categories);\n\t\t\t\t//clearCategories();\n\t\t\t\tcategories.each( category => loadCategory( category.attributes ) );\n\t\t});\n\t}", "title": "" }, { "docid": "d141a9bc69b26412e1213153ffacd200", "score": "0.56680584", "text": "getCategories() {\n return this.categories;\n }", "title": "" }, { "docid": "8988a5dc9f090b2034388afe206ff6bf", "score": "0.5667428", "text": "async list(req, res) {\n try {\n const posts = await Post.findAll({\n order: [['createdAt', 'DESC']],\n include: {\n model: Category,\n attributes: ['name']\n }\n })\n res.status(201).send(posts)\n } catch (e) {\n console.log(e)\n res.status(500).send(e)\n }\n }", "title": "" }, { "docid": "3a5cb4a44f00ebcbf68a18a97716ce22", "score": "0.56629896", "text": "function getBooksInCategory(category) {\n// var db = ScriptDb.getMyDb();\n// var db_categories = ParseDb.getMyDb(applicationId, restApiKey, \"list_categories\");\n var db_gen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n \n var books = [];\n \n var query = db_gen.query({});\n while (query.hasNext()) {\n var book = query.next();\n if (category == \"\" || category == null || book.category == category) {\n books.push(book); \n }\n }\n \n return books;\n}", "title": "" }, { "docid": "f0f887b54d76a94e020a31b42a833e11", "score": "0.5658706", "text": "getCaseByCat(category_id : number): Promise <Case[]>{\n return axios.get(url+'/getOnCategory/'+category_id);\n }", "title": "" }, { "docid": "88c98a7ac3d90331be999c321ee9ff45", "score": "0.5657561", "text": "function GetAllCategoriesForLessons() {\n return $resource(_URLS.BASE_API + 'getCategoryForLessons' + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "title": "" }, { "docid": "8010df7f0e1977230a039087bb948ffa", "score": "0.5647329", "text": "function scrapeArticles() {\n $.ajax({\n method: \"GET\",\n url: \"/scrape/\"\n })\n .then(getArticles);\n }", "title": "" }, { "docid": "d0915db4f499f62d5000bccdea8773ef", "score": "0.56431895", "text": "function fetchCategories(success) {\n\tconsole.log('Fetching categories...');\n\tprocess.nextTick(function() {\n\t\tvar categoryRepo = require('./category.js');\n\t\tsuccess(categoryRepo.categories);\n\t});\n}", "title": "" }, { "docid": "46aeb3d504637fb8e02cb20cdcf71fda", "score": "0.56417024", "text": "async function getNews(category){\n try{\n //Api Call\n var data = await fetch('https://api.nytimes.com/svc/topstories/v2/'+category+'.json?api-key='+api_key);\n if(data.status == 200 && data.statusText == 'OK')\n {\n var jsonData = await data.json();\n createCard(category, jsonData)\n } else{\n generateErrorSection(category, data);\n }\n }\n catch(err){\n console.log(err);\n }\n }", "title": "" }, { "docid": "fc1a4d7f5deb9c9a4a877adcc1cc09be", "score": "0.5641386", "text": "function _dex_getCategories(){ // Step 1 of 2 – Gets top-level categories\n var t=new Date().getTime(),out={},ar=LibraryjsUtil.getHtmlData(\"http://www.dexknows.com/browse-directory\",/\\\"http:\\/\\/www\\.dexknows\\.com\\/local\\/(\\w+\\/\\\">.+)<\\/a>/gm)//return ar;\n ,i=ar.length;while(i--){ar[i]=ar[i].split('/\">');ar[i][1]=ar[i][1].replace(/&amp;/g,\"&\");out[ar[i][0]]={\"displayName\":ar[i][1]}}\n LibraryjsUtil.write2fb(\"torrid-heat-2303\",\"dex/categories/\",\"put\",out)}//function test(){/*print2doc*/Logger.log(_dex_getCategories())}", "title": "" }, { "docid": "67ecd9cc5e6d1ac67c8faefafaf92b7a", "score": "0.56377447", "text": "function getTaggedInstancesArticles() {\n return $http.get('/api/core/taggedInstances/articles');\n }", "title": "" }, { "docid": "3ac04258a26e5d3b2a06f19b10b61951", "score": "0.56315994", "text": "async getCategoriesAPI() {\n // quary the api\n const categoriesResponse = await fetch(`https://www.eventbriteapi.com/v3/categories/?token=${this.auth_token}`);\n\n // hold for the response and return result in json format\n\n const categories = await categoriesResponse.json();\n return {\n categories\n }\n }", "title": "" }, { "docid": "579bfa150cebe347df1ba6f531c9c530", "score": "0.563087", "text": "function listArticles() {\n return _.map(fs.readdirSync('articles/'), readArticleData)\n}", "title": "" }, { "docid": "9694da666bcc5ca87de3ea16dad6b333", "score": "0.5623491", "text": "async function getCategories(url){\n let response = await getMovies(url)\n let categories = [];\n \n for (let i = 0; i < response.results.length; i++)\n categories.push(response.results[i].name);\n\n let categoriesDeep = [];\n if (response.next != null)\n categoriesDeep = await getCategories(response.next);\n\n categories = categories.concat(categoriesDeep);\n return categories;\n}", "title": "" }, { "docid": "cdd413bf8eeb8b6249a5f3a7c82da5d5", "score": "0.56190556", "text": "async getBlogsByPage(page) {\n return this.http.get(`/posts?_embed&categories=518&page=${page}`);\n }", "title": "" }, { "docid": "2c1078f99ff9b4784c5fa4b9daa3847b", "score": "0.56182873", "text": "getCategories(req, res) {\n return db.Category.findAll({\n include: [{\n model: db.Category,\n as: 'ParentCategory',\n }],\n })\n .then(foundCategories => res.status(200).json(foundCategories))\n .catch(err => errorHandler(req, res, err));\n }", "title": "" }, { "docid": "636b27943998f46f619f631760318411", "score": "0.56141156", "text": "getCategories(page) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tdbInstance('categories')\n\t\t\t.orderBy('category_id', 'asc')\n\t\t\t.paginate({\n\t\t\t\tperPage: 25,\n\t\t\t\tcurrentPage: page,\n\t\t\t\tisLengthAware: true\n\t\t\t})\n\t\t\t.debug(true)\n\t\t\t.then(resolve)\n\t\t\t.catch(reject);\n\t\t});\n\t}", "title": "" }, { "docid": "e41f47906f2622c83380b8303a94e0de", "score": "0.561074", "text": "function queryCat () {\n var catUrl = \"http://trumpy-cat-api.herokuapp.com/cats\";\n return $.getJSON(catUrl).then(function(catResponseAll){\n var catResponse = catResponseAll[Math.floor(Math.random()*catResponseAll.length)];\n return catResponse;\n });\n}", "title": "" }, { "docid": "c4e4b3a26e6a638cf6518c69f7470543", "score": "0.5605909", "text": "function findAllItemByCategory(category, collectionName, callback)\r\n{\r\n let query;\r\n if (category)\r\n query = {\"category\" : category}; \r\n else\r\n query = {}; \r\n return findAll(query, collectionName, callback);\r\n}", "title": "" }, { "docid": "dae0b9e09642dc9b1a0e1aa998c8d3e6", "score": "0.55959666", "text": "function loadItems(category){\n const url = `${BASE_URL}api/v1/items?category=${category}`;\n $.get(url, function(data){\n populateTable(data);\n });\n}", "title": "" }, { "docid": "0fa6701db02dc1a4d5d42234a0f5e48e", "score": "0.55923146", "text": "function categoryData() {\n fetch(`https://www.themealdb.com/api/json/v1/1/categories.php`)\n .then(res => res.json())\n .then(data => {\n console.log(data.categories[0]);\n // Update result Heading\n resultHeading.innerHTML = `<h1>Categories</h1>`\n // Check if data return from API\n if (data.categories === null){\n resultHeading.innerHTML = `<h1>No result found</h1>`\n } else {\n meals.innerHTML = data.categories.map(meal =>\n `<div class='meal'>\n\n <img src=\"${meal.strCategoryThumb}\" alt=\"${meal.strCategory}\"/>\n\n <div class='meal_info' data_mealId='${meal.idCategory}'>\n <h3>${meal.strCategory}</h3>\n </div>\n </div>`\n ).join('')\n }\n })\n}", "title": "" }, { "docid": "56275d9340286cdce31072c21ce628b6", "score": "0.559004", "text": "function fetchArticles(source) {\n if (source === 'mashable') {\n return fetchMashableArticles()\n } else if (source === 'reddit') {\n return fetchRedditArticles()\n } else if (source === 'digg') {\n return fetchDiggArticles()\n }\n}", "title": "" }, { "docid": "20892d1400f3bc22b72a3cbb257f21d0", "score": "0.55897075", "text": "handleCategory(event) {\n let category = event.target.innerHTML\n dispatch(fetchCategory(category))\n }", "title": "" }, { "docid": "86c8a0165550fef6c960054c0bcdf1da", "score": "0.55895597", "text": "async get() {\n const category = await CategoryModel.findById(this.id);\n if (category) {\n return category;\n } else {\n const err = createError(404, {\n status: \"error\",\n message: \"Not found\",\n });\n throw err;\n }\n }", "title": "" }, { "docid": "1e3859a4d461fc16c1a467b5a41f0c85", "score": "0.55763185", "text": "function getProducts(categoryId, cb){\n\tconsole.log('get products in category', categoryId);\n\tdb.connect(function(conn){\n\t\tconn.query('select * from products where category_id = $1', [categoryId], function(err, result){\n\t\t\tif(err) throw err;\n\t\t\tcb(result.rows);\n\t\t});\n\t})\n}", "title": "" } ]
032a20e4710fe889c2bb1b0394364bb7
do here whatever is necessary for creating an instance of DatabaseConnection
[ { "docid": "ec528ef3f60c06fae4cc4bbe36d8f3c4", "score": "0.0", "text": "function start() {\n\n console.log('[Database] Starting database...');\n console.log('[Database] Connecting to MySql...');\n console.log('[Database] Running migrations...');\n console.log('[Database] Starting done!');\n }", "title": "" } ]
[ { "docid": "e02e9601207a8b7c910e31836d7d7fe2", "score": "0.7049246", "text": "function constructConnection () {\n return mysql.createConnection(connectionConfig);\n}", "title": "" }, { "docid": "12f9cb033febeb180111825c52c91703", "score": "0.7048139", "text": "prepareInitDB() {\n this.mStorageDb = CalStorageDatabase.connect(this.uri, this.id);\n upgradeDB(this);\n }", "title": "" }, { "docid": "95dc71ad2afd0891e60e00e09f180b98", "score": "0.7026032", "text": "function DBConnection() {\n\tthis.g_oDB = null;//Database Object\n\tthis._init();//Constructor\n}", "title": "" }, { "docid": "5f5d933f925cad17c0b28cd3e3acc7ee", "score": "0.70186704", "text": "function DatabaseFactory() {}", "title": "" }, { "docid": "602c7a69bba9128eccd4d7ce1dcf1984", "score": "0.69498134", "text": "constructor(){\n this.database = new Database();\n this.database.initialize();\n }", "title": "" }, { "docid": "168e6032d177aa0c4fb254ac91184035", "score": "0.6941546", "text": "constructor() {\n // initialize database connection & database models\n this.initConnection();\n this.initModels();\n }", "title": "" }, { "docid": "4daae3c1dca671f8faa0910f2bd5c11c", "score": "0.6910245", "text": "async function databaseConnect () {\n let connection = await Database.connect()\n let model = await Database.defineModel(connection, userSchema)\n database = new Database(connection, model)\n}", "title": "" }, { "docid": "2114d83a88c793a6d9850a15f2558f14", "score": "0.6877901", "text": "function Database(){}", "title": "" }, { "docid": "69e543f0bc94b8d0314ed89c83dc7998", "score": "0.68329376", "text": "constructor(){\n this.mysql = require('mysql');\n Database.conn = this.mysql.createConnection({\n host:\"localhost\",\n user: \"root\",\n password: \"penpal1!\",\n multipleStatements: true\n });\n Database.conn.connect(function(err) {\n if (err) throw err;\n console.debug(\"Connected!\");\n });\n this.create_snazzy_database();\n }", "title": "" }, { "docid": "601d181e879309770a99e591007b22b8", "score": "0.6829488", "text": "function createInstance() {\n var postgresDatabase = new Object(\"Database instance initialized!\");\n return postgresDatabase;\n }", "title": "" }, { "docid": "13582dca88acbac92865b1662f58f697", "score": "0.68216324", "text": "function createInstance() {\n var postgresDatabase = new Object(\"Database instance initialized!\");\n return postgresDatabase;\n }", "title": "" }, { "docid": "668ce46ceafb6d39584718e54b20043d", "score": "0.6772635", "text": "constructor(host,port,database){\n console.info(\"New DatabaseConnection\");\n if(host!==null){\n this.host = host;\n if(port!==null) {\n this.port = port;\n if (database !== null)\n this.database = database;\n else throw \"Database null Error\";\n }\n else throw \"Port null Error\";\n }\n else throw \"Host null Error\";\n }", "title": "" }, { "docid": "9eff67c43ee5bcce7b5c7e30520c6b5e", "score": "0.6714", "text": "constructor() {\n // TODO: Add fields. Init fields.\n this.database = null;\n }", "title": "" }, { "docid": "5eb527b07a324461e8ac1675a2c1e8ec", "score": "0.67138207", "text": "init() {\n this.db = db;\n }", "title": "" }, { "docid": "f2b343259d848e6647f70ffe7a2238a0", "score": "0.6694831", "text": "function buildDatabase() {\n pool = mysql.createPool(connectionConfig);\n fetchMore(1,0);\n}", "title": "" }, { "docid": "a29c4275d0d13ea1e51e501fa771901a", "score": "0.66832703", "text": "connect() {\n\t\tthis.database = new Database(this.dialect, this.connectionParams);\n\t\treturn this.database.createPool();\n\t}", "title": "" }, { "docid": "e83de3ded2fac6dcae23fa6d9c0e4c7d", "score": "0.6673953", "text": "_initDb(){\n if(!this.db){\n if(!this.getConfigFilePath()){\n this.exitByError(`> the file g-config.json is not exists`)\n }\n const dbConfig = this.getGConfig().db;\n this.db = new Database(dbConfig)\n }\n }", "title": "" }, { "docid": "3c05e48bffd1753ecf0560b8e8869f2c", "score": "0.6673782", "text": "constructor(host, user, password, database) {\n this.conn = this.createConnection(host, user, password, database);\n }", "title": "" }, { "docid": "8e2033a00a634f457caa7c0ee2997a1f", "score": "0.66716427", "text": "function constructor(options, dbname) {\n var mysql = require('mysql');\n dbObject = mysql.createConnection(options);\n dbObject.connect(function(err) {\n if (!!err) {\n log.error(\"Could not connect to mysql:\" + JSON.stringify(err));\n process.exit(1);\n return null;\n }\n\n });\n }", "title": "" }, { "docid": "eacd3506811fc3e92778966319ce2dd1", "score": "0.6648465", "text": "function initDatabaseConnection() {\n let uri = `${process.env.MONGODB_ADDON_URI}`;\n\n if (appHelper.isProd()) {\n options.user = process.env.MONGODB_ADDON_USER;\n options.pass = process.env.MONGODB_ADDON_PASSWORD;\n }\n\n if (appHelper.isDev()) {\n uri = `${uri}/${process.env.MONGODB_ADDON_DB}`;\n }\n\n\n mongoose.connect(uri, options);\n\n // Use native promises\n mongoose.Promise = global.Promise;\n\n db = mongoose.connection;\n db.on('error', (err) => {\n log.error('Database connection error', err);\n });\n\n db.once('open', () => {\n log.info('Connection with database succeeded.');\n });\n}", "title": "" }, { "docid": "340a4b620ff4c1d467fb1be03e83d7f4", "score": "0.6641142", "text": "function createDBConnectionObject(database) {\n let conn = mongoose.createConnection(database.url, { connectTimeoutMS: connectionTimeout, useNewUrlParser: true });\n\n conn.on('error', () => {\n console.log(\"\\nFailed to connect to the\", database.type, database.location, \"DB at\", databaseMelb.url);\n connectFailure();\n });\n\n conn.on('open', () => {\n console.log(\"Connected to the\", database.type, database.location, \"DB at\", databaseMelb.url)\n });\n\n return conn;\n}", "title": "" }, { "docid": "86542e7ab0a0608fe7d2feca6375fc77", "score": "0.6637417", "text": "function ConnectionManager(){}", "title": "" }, { "docid": "4a36bf6aba20d901874ef5685ade7de9", "score": "0.6621279", "text": "constructor(host, port, user, password, database ) {\n this.con = mysql.createConnection({\n host: host,\n user: user,\n password: password,\n database: database,\n port: port,\n multipleStatements: true\n });\n console.log(\"SQL Connector created !\");\n }", "title": "" }, { "docid": "32b73bc4ab06bc59c1654f435b01fb6c", "score": "0.6610584", "text": "createConnections (options) {\n // assign this to that\n const opts = options || {}\n\n // create empty schema if can't find it in context\n const schemas = opts.schemas || this.Schemas\n\n // get database connection string name with options\n const dbName = this.getDatabaseName(opts)\n\n // create new instance of db connections\n const conns = new DbConnections(schemas)\n\n // append proxies for custom proxies\n this.appendProxies()\n\n // register all connection if there is no database name\n if (!dbName) {\n // empty it will register all connections in config\n for (const [name, cs] of this._csMap) {\n // register to connections with name and connection string\n this.registerConnection(conns, name, cs)\n }\n } else if (dbName && this._csMap.has(dbName)) {\n // get connection string by database name\n const cs = this._csMap.get(dbName)\n\n // if the name of connection exists and has connection string\n // only register named connection string\n this.registerConnection(conns, dbName, cs)\n } else {\n // get instance of logger\n const logger = this.getLogger()\n\n if (logger) {\n logger.warning(`can't find connection string by name:${dbName}`)\n }\n }\n\n // return connections\n return conns\n }", "title": "" }, { "docid": "5d99c7d5acb5244e2cee7f8ccd6d0202", "score": "0.6607291", "text": "constructor(config) {\r\n this.connection = mysql.createConnection(config);\r\n }", "title": "" }, { "docid": "92710215516eb2ee9a5798dd16537e92", "score": "0.66062605", "text": "async createDBConnection() {\n const connection = await typeorm_1.createConnection();\n return connection;\n }", "title": "" }, { "docid": "661c370e71d6990c227410186d3a3656", "score": "0.6589558", "text": "function dbInit() {\n\n\tvar dbURI = config.database.url;\n\tvar options = config.database.options;\n\tmongoose.connect(dbURI, options);\n\n\n\tmongoose.connection.on('connected', function () { \n\t\tconsole.log('Mongoose connection open to ' + dbURI);\n\t});\n\n\tmongoose.connection.on('error',function (err) { \n\t\tconsole.error('Mongoose connection error: ' + err);\n\t});\n\t\n\tmongoose.connection.on('disconnected', function () { \n\t\tconsole.log('Mongoose connection disconnected'); \n\t});\n\t\n\tprocess.on('SIGINT', function() { \n\t\tmongoose.connection.close(function () { \n\t\t\tconsole.log('Mongoose connection disconnected through app termination'); \n\t\t\tprocess.exit(0); \n\t\t}); \n\t});\n\n\tthis.conn = mongoose.connection; \n\tconn.once('open', function(){\n\t\tthis.conn = conn;\n\t});\n}", "title": "" }, { "docid": "a3d20a4f4a06ce3f2b00546f82ccb9ed", "score": "0.6574077", "text": "async initializeDatabase() {\n // Attachs connect event listener and emits on successful connection\n this.databaseConnection.on('connect', () => this.emit('connect', this));\n // Attachs error event listener and emits on failed connection\n this.databaseConnection.on('error', (error) => this.emit('error', error));\n await this.databaseConnection.connect();\n this.databaseConnection.emit('connect');\n if (this.autoRemove) {\n setInterval(() => this.destroyExpired(this.autoRemoveCallback), this.autoRemoveInterval);\n }\n }", "title": "" }, { "docid": "eb16ec811d1e10310c0a4a96c936ae43", "score": "0.6556215", "text": "function startDBconneection(dbname) {\n //opens connection, if database exists open, if not create then open\n let sb = new sqlite3.Database('Code/db/scoozi.db', (err) => {\n //lets us know the status of what happened\n if (err) {\n console.error(err.message);\n } else {\n //if succeeded\n console.log('Connected to the '+ dbname +' database.');\n }\n\n });\n //returns obejct database\n db = sb;\n return sb;\n}", "title": "" }, { "docid": "af24f76e5f0872516ccceb63a978bbf2", "score": "0.6541416", "text": "function initDb() {\n initDoctorsTable();\n initLocationsTable();\n initServicesTable();\n initServicesLocationsTable();\n initWhoWeAreTable();\n\n return true;\n}", "title": "" }, { "docid": "46d4c8f26d2a9ea16e7d619c911b1f46", "score": "0.6538907", "text": "async init() {\n await this.wrappedDB.init();\n }", "title": "" }, { "docid": "24594de5bef10bd2679c634559c9a59a", "score": "0.6537075", "text": "createDbConnection() {\n\t\treturn new sqlite.Database('users.db3');\n\t}", "title": "" }, { "docid": "5a51156516bb0d625466d2569aa4a35f", "score": "0.6536343", "text": "function databaseInitialize() {\n // on the first load of (non-existent database), we will have no collections so we can \n // detect the absence of our collections and add (and configure) them now.\n var userData = db.getCollection(\"userData\");\n if (userData === null) {\n console.log(\"adding a new userData database\");\n userData = db.addCollection(\"userData\");\n }\n\n var sentenceData = db.getCollection(\"learningSeq\");\n if (sentenceData === null) {\n console.log(\"adding a new learningSeq database\");\n sentenceData = db.addCollection(\"learningSeq\");\n }\n\n // kick off any program logic or start listening to external events\n runProgramLogic();\n}", "title": "" }, { "docid": "5d773d7e3b50207d759e3b3466ee80e6", "score": "0.65245044", "text": "function initDatabase(){\n return new Promise( (resolve, reject) => {\n // dbService.connect(() => { resolve() });\n dbService = dbServiceAutoConnect;\n resolve();\n });\n }", "title": "" }, { "docid": "5e29c3b8e253d367571b5e144c838e14", "score": "0.64920837", "text": "function openConnection() {\n\tdb = mysql.createConnection(\n\t{\n\t host: credentials.host,\n\t user: credentials.user,\n\t password: credentials.password,\n\t database: credentials.database\n\t});\n\tdb.connect(function(err){\n\t if(err){\n\t } else {\n\t }\n\t});\n}", "title": "" }, { "docid": "f5fae1beb1e68e72157a19d3576f1a15", "score": "0.64695626", "text": "function initializeDb(db) {\n if (db.isNew()) {\n db.createTable(\"settings\", [\"name\", \"value\"]);\n db.createTable(\"leaderboard\", [\"date\", \"score\"]);\n for (var key in properties) {\n if (properties.hasOwnProperty(key)) {\n db.insert(\"settings\", {\n name: key,\n value: properties[key]\n });\n }\n }\n db.commit();\n }\n }", "title": "" }, { "docid": "c5f897dd25007d3baaf565568ddb8c66", "score": "0.6457897", "text": "function init()\n{\n\tlet tweetMelb = createDBConnectionObject(databaseMelb).model('tweets');\n\tlet tweetChicago = createDBConnectionObject(databaseChicago).model('tweets');\n\tlet chicagoCrime = createDBConnectionObject(databaseChicagoCrime).model('crime');\n\tlet chicagoCrimeTrajectory = createDBConnectionObject(databaseChicagoCrime).model('crime');\n\n module.exports.tweetMelb = tweetMelb;\n module.exports.tweetChicago = tweetChicago;\n module.exports.chicagoCrime = chicagoCrime;\n module.exports.chicagoCrimeTrajectory = chicagoCrimeTrajectory; //trajectory calculation queries get their own connection obj\n}", "title": "" }, { "docid": "bfe3d89a64cebae9f64e0371cae36bee", "score": "0.64533097", "text": "function initDb (callback) {\r\n // undfined check for checking if DB connection exists\r\n if (_db) {\r\n console.warn('Trying to initialize Db connection again!')\r\n return callback(null, _db)\r\n }\r\n\r\n if (!db_config?.host) { throw Error('Invalid DB host. Did you set up your .env file?') }\r\n\r\n _db = mysql.createPool(db_config)\r\n\r\n // Establish connection with callback checking if there were errors\r\n _db.getConnection((err) => {\r\n if (err) {\r\n console.log(`Error connecting to db\\n${err.stack}`)\r\n _db = undefined // Make undefined\r\n }\r\n })\r\n\r\n return callback(null, _db)\r\n}", "title": "" }, { "docid": "ea00305ffb48ff2e7f072611c9116cb2", "score": "0.64525497", "text": "static init(host, user, password, database) {\n return new Promise((resolve, reject) => {\n // An internal flag used to specify whether the database connection has been initialized or not.\n this.initialized = false;\n \n // This check ensures that only 1 instance of the connection can be present at a time.\n // If trying to connect more that one time, then the value of connection will not be null and\n // a new connection will not be set up.\n if(this.connection == null) {\n // Creating a connection object\n this.connection = mysql.createConnection({\n host: host,\n user: user,\n password: password,\n database: database\n });\n \n // Connecting to the MySQL database\n this.connection.connect(error => {\n if(error) reject(error);\n else {\n this.initialized = true;\n resolve(\"MySQL Connected...\");\n }\n });\n }\n\n else reject(\"Database already connected\");\n });\n }", "title": "" }, { "docid": "c5f3f244ecbb58f1f9530dfa6fe59b0b", "score": "0.6442415", "text": "constructor(){\n this.db = new sqlite3.Database(CONSTANT.DATABASE);\n }", "title": "" }, { "docid": "cd50f43e23bd346f5fa2b54c0ec6126c", "score": "0.64343244", "text": "connect() {\n const dbConfig = this.config.database;\n const { secrets } = this.config;\n const initOptions = {};\n if (this.config.debug) {\n initOptions.query = (ev) => {\n this.logger.log(`QUERY:\n ${ev.query}`);\n };\n initOptions.receive = (data) => {\n this.logger.log(`Recieved ${data.length} rows`);\n };\n }\n this.logger.log('Initializing Database connection...');\n this.pgp = PgPromise(initOptions);\n const connection = {\n host: dbConfig.host,\n port: dbConfig.port,\n database: dbConfig.name,\n user: secrets.postgresUser,\n password: secrets.postgresPassword,\n };\n this.logger.log(`Host: ${connection.host}`);\n this.logger.log(`Port: ${connection.port}`);\n this.logger.log(`Database: ${connection.database}`);\n this.db = this.pgp(connection);\n }", "title": "" }, { "docid": "229adade9b7c1cea32861aa1929ba962", "score": "0.64214426", "text": "constructor(){\n //Singleton pattern\n this.DB = this.getDatabase();\n return this.DB;\n }", "title": "" }, { "docid": "696f30a932dac8cd08fe5c4e16422e77", "score": "0.64169514", "text": "_connectDb() {\n\t\tdb.connect({\n\t\t\t'dialect': 'sqlite',\n\t\t\t'storage': join(process.cwd(), this.settings.dbPath)\n\t\t});\n\n\t\tdb.loadModels('models');\n\t}", "title": "" }, { "docid": "33c19a06edfc6df3d56fec22e71e68ca", "score": "0.641199", "text": "constructor() {\n this.database = new Sequelize(\"tentadb\", \"postgres\", \"admin\", {\n host: \"localhost\",\n port: \"5432\",\n dialect: \"postgres\",\n });\n this.initialize();\n this.validator = new ValidatorUtil();\n }", "title": "" }, { "docid": "dd45de92fe02b627eba4357f3470a827", "score": "0.6405637", "text": "function connectToDatabase() {\n\t\tconnection.connect(function(err) {\n\t\t\tif (err) throw err;\n\t\t});\n\t\tfunction beginSpr() {\n\t\t\tstartBamSpr();\n\t\t}\n\t\treturn beginSpr;\n\t}", "title": "" }, { "docid": "9ce0f531c1a51020af9f2554e84fdcf2", "score": "0.63809764", "text": "start()\n {\n this.db = new DB(\"usersDB\", true, true);\n }", "title": "" }, { "docid": "1f688ba309bed2c392ce514f4a82a07c", "score": "0.6369626", "text": "async started() {\n\t\tthis.connection = mysql.createConnection({\n\t\t\thost: process.env.WordpressSqlHost,\n\t\t\tuser: process.env.WordpressSqlUser,\n\t\t\tpassword: process.env.WordpressSqlPassword,\n\t\t\tdatabase: process.env.WordpressSqlDatabase\n\t\t});\n\t}", "title": "" }, { "docid": "fd1f145b2ffb297aff3d1d337f026e2c", "score": "0.6361827", "text": "function initDataBase(callBack) {\r\n var dbEnv = nodeStarterConfig.getEnv();\r\n var conString = dbEnv.url;\r\n // Connect to the database before starting the application server.\r\n var db = postgresPromise(conString);\r\n db.connect()\r\n .then(function (obj) {\r\n objDbConnection = obj; // save the connection object;\r\n callBack(null, true);\r\n }, function (reason) {\r\n // send the error in callBack\r\n callBack(reason, null);\r\n })\r\n .catch(function (err) {\r\n // send the error in callBack\r\n callBack(err, null);\r\n });\r\n}", "title": "" }, { "docid": "0927eb36b7b2ba0cc51665393a2b1dda", "score": "0.634474", "text": "constructor() {\n this._dbContext = dbConfig;\n }", "title": "" }, { "docid": "89a7b1ab49194ee161599206bb799f52", "score": "0.6339997", "text": "function DBConfig() {}", "title": "" }, { "docid": "2bae7885321dc6f4253429a784e790ec", "score": "0.63336486", "text": "function createDB() {\n webSQLFlag = 1;\n baseObjectId = kony.db.openDatabase(\"webSqlDB\", \"1.0\", \"Sample SQL Database\", 5 * 1024 * 1024); // 5MB database\n kony.db.transaction(baseObjectId, createTable, commonErrorCallback, commonVoidcallback);\n}", "title": "" }, { "docid": "5e8d1036c96afef38455a35ac34f9df3", "score": "0.63254637", "text": "function initDatabase() {\n //console.debug('called initDatabase()');\n\n try {\n if (!window.openDatabase) {\n alert('not supported');\n } else {\n var shortName = 'GolfDB';\n var version = '1.0';\n var displayName = 'Golf DB App';\n var maxSizeInBytes = 5000000;\n db = openDatabase(shortName, version, displayName, maxSizeInBytes);\n\n createTableIfNotExists();\n }\n } catch(e) {\n if (e == 2) {\n alert('Invalid database version');\n } else {\n alert('Unknown error ' + e);\n }\n return;\n }\n}", "title": "" }, { "docid": "0d1c98b208f3b30cd80bd149eaec742d", "score": "0.6318628", "text": "initializeDB(){\n let connStr = 'mongodb://localhost:27017/restipsum';\n var self = this; \n \n mongoose.connection.on('connected', function(){\n self.logger.info(\"Database connection is successful for\", connStr);\n });\n \n mongoose.connection.on('disconnected', function(){\n self.logger.warn(\"Database is disconnected for\", connStr);\n let intervalInSec = Math.floor(5 + (Math.random() * 25));\n self.connectToDB(connStr,intervalInSec);\n });\n\n mongoose.connection.on('error', function(err){\n self.logger.error(\"Database connection is failed for\", connStr, \"Related error is\", err); \n }); \n \n this.connectToDB(connStr,0);\n }", "title": "" }, { "docid": "df0f7c68b3454f03c55706d7397e47d3", "score": "0.631593", "text": "function setUpConnection () {\n mongoose.connect('mongodb://'+config.db.host+':'+config.db.port+'/'+config.db.name);\n}", "title": "" }, { "docid": "072209687cc48d4e360716de79622e7d", "score": "0.6315192", "text": "async function init() {\n let connection;\n try {\n // get sql statements\n const sql = await getStatement(path.join(__dirname, SCHEMA_FILE));\n const statements = sql.split(';')\n .map(s => s.trim().replace(/[\\n\\s]+/g, ' '))\n .filter(s => !!s);\n\n // get connection\n\n console.log('-- CONNECT... --');\n connection = await createConnection();\n console.log('-- CONNECTED --');\n\n // process statements\n console.log('-- BEGIN TRANSACTIONS... --');\n for (let i=0; i<statements.length; i++) {\n await runStatement(connection, statements[i], i);\n }\n console.log('-- END TRANSACTIONS --');\n\n // close\n console.log('-- DISCONNECT... --');\n await connection.close();\n console.log('-- DISCONNECTED --');\n } catch (e) {\n // handle error\n console.error(e);\n if (connection) {\n await connection.close();\n }\n process.exit(1);\n }\n}", "title": "" }, { "docid": "1516dbadaeb9c5583853741fc6588eb0", "score": "0.6313159", "text": "function createDB() {\n const query = \"DROP SCHEMA IF EXISTS private_school;\";\n const query2 = \"CREATE SCHEMA private_school;\";\n const query3 = \"USE private_school;\";\n //drops same name schema\n let dropQuery = () => {\n connection.query(query, (err) => {\n if (err) {\n console.log(err);\n } else {\n console.log(`Schema Dropped`);\n }\n\n });\n\n };\n //creates our schema schema\n let createQuery = () => {\n connection.query(query2, (err) => {\n if (err) {\n console.log(err);\n } else {\n console.log(`Schema created!`);\n }\n });\n };\n // specifing the database to use\n let useQuery = () => {\n connection.query(query3, (err) => {\n if (err) {\n console.log(err);\n } else {\n console.log(`Using Schema!`);\n }\n connection.end();\n });\n };\n // calling in the correct sequence to avoid errors\n dropQuery();\n createQuery();\n useQuery();\n\n}", "title": "" }, { "docid": "f1ac37a0975ae3331921a7ca99a8af72", "score": "0.63119304", "text": "_openConnection (cb) {\n Mongodb.connect(env.mongoDb.endpoint, (err, db) => {\n if (err) {\n // console.log(err)\n }\n this.db = db\n cb()\n })\n }", "title": "" }, { "docid": "ea27c3d0d04677ef52bbe3acd7b094cf", "score": "0.6311415", "text": "async init() {\n this.client = await mongo.connect(this.url, MONGO_OPTIONS);\n this.db = this.client.db(this.dbName);\n this.wordsIndexTable = this.db.collection(WORDS_INDEX_TABLE);\n this.noiseWordsTable = this.db.collection(NOISE_WORDS_TABLE);\n this.contentsTable = this.db.collection(CONTENT_TABLE);\n }", "title": "" }, { "docid": "380d03e77a9ab7d7f07a16e7b1161340", "score": "0.6310539", "text": "function setDB() {\n // Database name.\n dbName = 'tuduDBv0.2';\n\n // Start the database.\n tuduDb = new DB();\n\n // Database initial values.\n var dbData = {\n tasks: [],\n lists: []\n };\n\n tuduDb.connect(dbName, dbData);\n}", "title": "" }, { "docid": "dd2e8f0e4b57111d6f479cd325615067", "score": "0.63048726", "text": "async startDB() {\n const mongoUri = await this.server.getConnectionString();\n this.connection = await mongoose.connect(mongoUri, {\n useNewUrlParser: true,\n useFindAndModify: false\n });\n }", "title": "" }, { "docid": "2241d93cf5270bd12fc5598f8df2e58b", "score": "0.63033974", "text": "connect()\n{\n // create if needed\n if (null !== this._connection)\n {\n return;\n }\n this._createConnection();\n}", "title": "" }, { "docid": "2241d93cf5270bd12fc5598f8df2e58b", "score": "0.63033974", "text": "connect()\n{\n // create if needed\n if (null !== this._connection)\n {\n return;\n }\n this._createConnection();\n}", "title": "" }, { "docid": "2241d93cf5270bd12fc5598f8df2e58b", "score": "0.63033974", "text": "connect()\n{\n // create if needed\n if (null !== this._connection)\n {\n return;\n }\n this._createConnection();\n}", "title": "" }, { "docid": "6c694b94d92bce4ff377962002e5df76", "score": "0.63029766", "text": "function createDBConnection() {\n db = new sqlite3.Database('./task.db', (err) => {\n if (err) {\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "357b87225fc700be8747f05aa9fab925", "score": "0.629043", "text": "async initialize() {\n const host = this._config.get(CONFIG_KEY.MYSQL_HOST);\n const user = this._config.get(CONFIG_KEY.MYSQL_USER);\n const password = this._config.get(CONFIG_KEY.MYSQL_PASSWORD);\n const port = this._config.get(CONFIG_KEY.MYSQL_PORT);\n const database = this._config.get(CONFIG_KEY.MYSQL_DATABASE);\n const connectionLimit = this._config.get(CONFIG_KEY.MYSQL_CONNECTION_LIMIT);\n Assert.notEmpty(host, 'mysqlHostname');\n Assert.notEmpty(user, 'mysqlUsername');\n Assert.notEmpty(database, 'mysqlDatabase');\n\n this._pool = mysql.createPool({\n connectionLimit,\n host,\n user,\n password,\n database,\n port\n });\n\n this._logger.info(`Trying to establish connection to MYSQL with host\n ${host} and user ${user}`);\n // Test connection\n if (!this._pool) {\n this._logger.error('Can not connect to mysql database');\n throw new Error('Could not connect to Mysql database');\n }\n\n try {\n this._pool.getConnection = util.promisify(this._pool.getConnection);\n const connection = await this._pool.getConnection();\n if (connection) {\n this._pool.query = util.promisify(this._pool.query);\n this._logger.info('Database connection successful');\n connection.release();\n this._initialize = true;\n }\n } catch (err) {\n this._logger.error('Can not connect to mysql database', {\n host,\n database,\n user,\n err\n });\n throw new Error(`Couldn't connect to Mysql database: ${err}`);\n }\n }", "title": "" }, { "docid": "2f5cc5a1368a976bf7412899b26e2a04", "score": "0.6274879", "text": "function setupDB() {\n\tconsole.log(\"Setting up the database\");\n\tsysClient.execute(keyspaceDef).then(function() { \n\t\tclient = new cassandra.Client({ contactPoints: ['localhost'], keyspace: 'docservice' });\n\t\tclient.execute(docTableDef);\n\t\tclient.execute(linksTableDef);\n\t\tclient.execute(refTableDef);\n\t\tsysClient.shutdown().then(() => console.log(\"Closed connection to system keyspace\"));\n\t});\n}", "title": "" }, { "docid": "94cf7c6d5c8f7af8a0b542c6cf8cb5c2", "score": "0.6263121", "text": "static async injectDB(conn){\n //if reference to properties is already filled, we will just return\n if(properties){\n return\n }\n //but if it is not filled, we will fill it with a reference to that specific DB\n try {\n properties = await conn.db(process.env.PROPREVIEWS_NS).collection(\"properties\")\n } catch (e) {\n console.error(\n `Unable to establish a collection handle in propertiesDAO: ${e}`,\n )\n }\n }", "title": "" }, { "docid": "c650821a4dc5fc73ca7e32c188636e9b", "score": "0.6261869", "text": "function databaseInitialize() {\n entries = db.getCollection(\"entries\");\n if (entries === null) {\n entries = db.addCollection(\"entries\");\n }\n callback();\n }", "title": "" }, { "docid": "f6b5c98dd6f61e50044976d8cbc7c6e5", "score": "0.62613416", "text": "init(){\n //Connect to mysql\n connection.connect()\n // define which database to use\n connection.query('USE hyf_todo', (error, results, fields) =>{\n if (error) throw error\n })\n\n // check for tables and create if it is not there.\n connection.query(\"SHOW TABLES LIKE 'task'\", (error, results, fields)=>{\n if (error) throw error\n\n if(results.length === 0){\n console.log(\"Creating TABLE 'task'\")\n connection.query('CREATE TABLE task (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, description VARCHAR(50), done BOOL, date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, date_last_modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);', (error, results, fields) => {\n if (error) throw error\n console.log('Table created: ', results)\n })\n }\n else{\n console.log(\"TABLE already exist, using: \", results)\n }\n })\n }", "title": "" }, { "docid": "bb6bcf0362bd9d647494b377774b9578", "score": "0.62608993", "text": "function dbCreate() {\n try {\n /*** Creates a 2mb database ***/\n //db = window.openDatabase(\"Database\", \"1.0\", \"In-flight\", 5 * 1024 * 1024);\n //db.transaction(createDB, dbErrorHandler, successDB)\n\n var createDB = function () { };\n var successDB = function () { };\n }\n catch (err) {\n ex.log(err, this.Name + \".dbCreate()\");\n }\n }", "title": "" }, { "docid": "354730479ead0634581d64a77281289a", "score": "0.62589306", "text": "function initSqlDB() {\n // if I'm testing the application\n if (process.env.TEST) {\n console.log(\"test mode\");\n sqlDb = sqlDbFactory({\n debug: true,\n client: \"sqlite3\",\n connection: {\n filename: \"./other/clinicdb.sqlite\"\n }\n });\n // actual version of the db \n } else {\n console.log(\"non-test mode\");\n sqlDb = sqlDbFactory({\n debug: true,\n client: \"pg\",\n connection: process.env.DATABASE_URL,\n ssl: true\n });\n }\n}", "title": "" }, { "docid": "5d08e46b289438d34b5926dd84ca530f", "score": "0.6256429", "text": "function initialize()\n {\n Loading.show('spiral');\n Database.setConnectionOptions({\n dbName: 'mrc.tasklist',\n showLogs: false,\n dbSize: (10 * 1024 * 1024)\n });\n Database.initialize({\n tableName: 'task',\n columns: Task.populateFields({}, 0)\n }).then(function(instance){\n db = instance;\n migrateLocalStorage();\n }, function(e){\n messageBox.alert('Error','No was possible start the app',$rootScope);\n }).finally(function(){\n Loading.hide();\n });\n }", "title": "" }, { "docid": "94e55f2919f9e6b5800d76a04e11b7a4", "score": "0.6251341", "text": "constructor () {\n this.database = null\n }", "title": "" }, { "docid": "6b950f56619d7e4b9be080b87e71f2a9", "score": "0.6249478", "text": "function initDB() {\n\ttry {\n\t\tAlloy.createCollection(\"Settings\");\n\t\tAlloy.createCollection(\"CoginitionTestResult\");\n\t\tAlloy.createCollection(\"Survey\");\n\t\tAlloy.createCollection(\"SurveyListings\");\n\t\tAlloy.createCollection(\"SurveyResult\");\n\t\tAlloy.createCollection(\"SurveyResultListing\");\n\t\tAlloy.createCollection(\"Alerts\");\n\t\tAlloy.createCollection(\"location\");\n\t\tAlloy.createCollection(\"Articles\");\n\t\tAlloy.createCollection(\"surveyOptionList\");\n\t\tAlloy.createCollection(\"JewelCollection\");\n\t\tAlloy.createCollection(\"AdminShedule\");\n\t\tAlloy.createCollection(\"LocalSchedule\");\n\t\tif (OS_IOS) {\n\t\t\tvar db = Ti.Database.open(Alloy.Globals.DATABASE);\n\t\t\tdb.remoteBackup = false;\n\t\t\tdb.close();\n\t\t}\n\t\t \n\t} catch(ex) {\n\t\tcommonFunctions.handleException(\"Index\", \"initDb\", ex);\n\t}\n}", "title": "" }, { "docid": "1f6d98c902a55483ce7fc0ce6f8241b8", "score": "0.62476236", "text": "function Db() {\n}", "title": "" }, { "docid": "223a2e710932140d0c91dce37cb69c90", "score": "0.6246692", "text": "connectToDatabase () {\n this.con = mysql.createConnection({\n host: process.env.HOST,\n user: process.env.USER,\n password: process.env.PASSWORD,\n database: process.env.DB\n })\n\n this.con.connect(function(err) {\n if (err) throw err\n })\n }", "title": "" }, { "docid": "63287281e56139d8dd8e24321ab9b179", "score": "0.62435645", "text": "createInstance() {\n this.DB = new pool({\n user: process.env.PGUSER,\n password: process.env.PGPASSWORD,\n database: process.env.PGDATABASE,\n port: 5432,\n host: process.env.PGHOST,\n ssl: true\n });\n this.DB.connect();\n return this.DB;\n }", "title": "" }, { "docid": "7caa1838ccad9e098a5358a9318692a0", "score": "0.62400496", "text": "function initDBConnection(callback) {\n\n if (process.env.CLOUDANT_URL) {\n dbCredentials.url = process.env.CLOUDANT_URL;\n } else {\n dbCredentials.url = \"https://c277b75e-c194-4e2d-b250-53f2c5110295-bluemix:305b6bb6652cdbc9fcd8891efe42ac002e051acc330d21ea14364003844b2b4f@c277b75e-c194-4e2d-b250-53f2c5110295-bluemix.cloudant.com\";\n }\n\n var cloudant = require('@cloudant/cloudant')(dbCredentials.url);\n\n // check if DB exists if not create\n cloudant.db.create(dbCredentials.dbName, function(err, res) {\n if (err && err.error != 'file_exists') {\n log.error('could not create db ', err);\n callback(err);\n return;\n } else if (!err || err.error == 'file_exists') {\n log.info(\"db will either be created or it already exists.\");\n db = cloudant.use(dbCredentials.dbName);\n\n cloudant.db.create(dbCredentials.containerDBName, function(err, res) {\n if (err && err.error != 'file_exists') {\n log.error('could not create container details db ', err);\n callback(err);\n return;\n } else if (!err || err.error == 'file_exists') {\n log.info(\"container details db will either be created or it already exists.\");\n\n containerDetailsdb = cloudant.use(dbCredentials.containerDBName);\n callback();\n return;\n }\n });\n }\n });\n\n}", "title": "" }, { "docid": "d926d6980de80aeefee5bfcf06b26409", "score": "0.6230733", "text": "function initDB() {\n dbPromise = idb.openDb(DB_NAME, 1, function (upgradeDB) {\n if (!upgradeDB.objectStoreNames.contains(DB_NAME)) {\n initBlogDB(upgradeDB);\n initImageDB(upgradeDB);\n initEventDB(upgradeDB);\n initBlogDraftDB(upgradeDB);\n initImageDraftDB(upgradeDB)\n }\n })\n}", "title": "" }, { "docid": "69534f11b00e1ea9a65a218e3c5b6441", "score": "0.6223382", "text": "getConnection(callback) {\n if (!this.database) {\n MongoClient.connect(this.config.levelControllerConfig.connectionUrl, this.config.levelControllerConfig.connectionOptions, (error, mongoClient) => {\n if (error) {\n return callback(Errors.generalError('MongoDb connection error', error), null);\n } else {\n if (!this.database && !this.client) {\n this.client = mongoClient;\n this.database = mongoClient.db(mongoClient.s.options.dbName);\n }\n return callback(null, this.database);\n }\n });\n } else {\n return callback(null, this.database);\n }\n }", "title": "" }, { "docid": "3a24383fe301ec02a912acd02f386ed9", "score": "0.6194312", "text": "function Armes_spec(){\n _DB = new DB();\n }", "title": "" }, { "docid": "292f7f65371e490e992fabcf024be681", "score": "0.6187733", "text": "createDb() {\n // tslint:disable-next-line:class-name\n const db = {\n // auth module\n users: _fake_db_users_table__WEBPACK_IMPORTED_MODULE_1__[\"UsersTable\"].users,\n // data-table\n cars: _fake_db_cars_table__WEBPACK_IMPORTED_MODULE_2__[\"CarsTable\"].cars,\n customers: _modules_e_commerce_fake_fake_server_e_commerce_data_context__WEBPACK_IMPORTED_MODULE_3__[\"ECommerceDataContext\"].customers,\n // products\n products: _modules_e_commerce_fake_fake_server_e_commerce_data_context__WEBPACK_IMPORTED_MODULE_3__[\"ECommerceDataContext\"].cars,\n productRemarks: _modules_e_commerce_fake_fake_server_e_commerce_data_context__WEBPACK_IMPORTED_MODULE_3__[\"ECommerceDataContext\"].remarks,\n productSpecs: _modules_e_commerce_fake_fake_server_e_commerce_data_context__WEBPACK_IMPORTED_MODULE_3__[\"ECommerceDataContext\"].carSpecs,\n deals: _modules_asset_fake_fake_server_deals_data_context__WEBPACK_IMPORTED_MODULE_4__[\"DealsDataContext\"].deals,\n };\n return db;\n }", "title": "" }, { "docid": "897ae88e5c033c02539e20b37043778f", "score": "0.61799246", "text": "function setupDb() {\n const db = knex(knexfile.development); // passes the instance of our database to knex\n Model.knex(db); //and uses ObjectionJS Model class to call upon that database \n}", "title": "" }, { "docid": "633e175f2a0c3f27c78d894faa012b8e", "score": "0.61756396", "text": "function CreateConnection (backend, credentials) {\n\n\n backend.Debug (4, \"MySQL creating connection [%s]\", backend.uid);\n backend.base = mysql.createConnection(credentials);\n\n // register event for asynchronous server errors\n backend.base.on('error', function(err) {\n backend.Debug (1, \"MySQL server error=[%s]\", err);\n\n // Sever was restarted or network connection was lost let restart connection\n if(err.code === 'PROTOCOL_CONNECTION_LOST') {\n console.log (\"retry\" + backend.uid)\n backend.Debug.call (backend,3, \"MySQL connection lost [%s/%d] automatic connect retry in 10s]\", backend.uid);\n setTimeout(function () {CreateConnection (backend, credentials);}, MYSQL_RECONNECT_TIMER);\n } else {\n throw err; // server variable configures this)\n }\n });\n\n // force an initial connectiion at object construction time\n backend.base.connect (function(err) {\n if (err) {\n backend.Debug.call (backend,1, \"MySQL connection fail [%s] automatic connect retry in 10s]\", err);\n setTimeout(function () {CreateConnection (backend, credentials);}, MYSQL_RECONNECT_TIMER);\n\n } else {\n backend.Debug.call (backend,5,\"MySQL Connect Done [%s]\", backend.uid);\n }\n });\n}", "title": "" }, { "docid": "3b4c02effe15579a8b8c60988785ae2b", "score": "0.61702675", "text": "function init() {\n pool = MySQL.createPool(ConfigMySQL);\n Logger.warn(\"Pool Created\");\n pool.on('acquire', function (connection) {\n // console.log('Connection %d acquired', connection.threadId);\n });\n pool.on('connection', function (connection) {\n // console.log('Connection %d connected', connection.threadId);\n });\n pool.on('enqueue', function () {\n // console.log('Waiting for available connection slot');\n });\n pool.on('release', function (connection) {\n // console.log('Connection %d released', connection.threadId);\n });\n}", "title": "" }, { "docid": "3af61b4410093afc3148a0f7f62c16c6", "score": "0.6168846", "text": "static get databaseConnection() {\n if(this.connection != null)\n return this.connection;\n else return null;\n }", "title": "" }, { "docid": "76c37257613d5a858f3a87ddfad847ab", "score": "0.61664945", "text": "function createConnection() {\n return mysql.createConnection({\n host: '127.0.0.1',\n user: 'root',\n password: 'burganday1.',\n database: 'Persons'\n })\n}", "title": "" }, { "docid": "2091dcd626f94444be173b630127f749", "score": "0.6157964", "text": "function databaseInitialize() {\n var bookings = db.getCollection(\"bookings\");\n if (bookings === null) {\n bookings = db.addCollection(\"bookings\");\n }\n}", "title": "" }, { "docid": "e706abd03b0ccbc2a16d7456922d44d5", "score": "0.6143926", "text": "function initDBConnection() {\n\tif (process.env.CLOUDANT_R) {\n\t\t//console.log(\"Using env CLOUDANT_R\");\n\t\tvar cloudantR = JSON.parse(process.env.CLOUDANT_R);\n\t\tif(cloudantR) {\n\t\t\tdbCredentialsConfig.host = cloudantR.cloudant.host;\n\t\t\tdbCredentialsConfig.user = cloudantR.cloudant.username;\n\t\t\tdbCredentialsConfig.password = cloudantR.cloudant.password;\n\t\t\tdbCredentialsConfig.dbName = cloudantR.cloudant.db;\n\t\t\tdbCredentialsConfig.url = \"https://\" + dbCredentialsConfig.user + \":\" + dbCredentialsConfig.password + \"@\" + dbCredentialsConfig.host;\n\t\t\tdbCredentialsConfig.propFile = cloudantR.cloudant.prop_file;\n//\t\t\tconsole.log(dbCredentialsConfig.url);\n\t\t}\n\t} else {\n\t\tconsole.error(\"CLOUDANT_R environment var is not set. It needs to have credentials to the configuration DB.\");\n\t\tconsole.error(\"export CLOUDANT_R=\\\"{\\\"cloudant\\\":{\\\"db\\\":\\\"databasename\\\",\\\"username\\\":\\\"username\\\",\\\"password\\\":\\\"password\\\",\\\"host\\\":\\\"hostname\\\",\\\"prop_file\\\":\\\"docid\\\"}}\\\"\");\n\t}\n\t\n\tcloudantConfig = require('cloudant')(dbCredentialsConfig.url);\n\t\n\tdbConfig = cloudantConfig.use(dbCredentialsConfig.dbName);\n\t\n\tdbConfig.get(\"module_09_managementux\", function(err, result) {\n\t\tif (err) return console.log(\"Failed to get UX configuration\");\n\t\t\n\t\tdbCredentials.host = result.cloudant.logstest_db_readwrite.host;\n\t\tdbCredentials.user = result.cloudant.logstest_db_readwrite.username;\n\t\tdbCredentials.password = result.cloudant.logstest_db_readwrite.password;\n\t\tdbCredentials.dbName = result.cloudant.logstest_db_readwrite.db;\n\t\t/**For Orchestrator logging **/\n\t\torcDbCredentials.host = result.cloudant.orc_logs_test.host;\n\t\torcDbCredentials.user = result.cloudant.orc_logs_test.username;\n\t\torcDbCredentials.password = result.cloudant.orc_logs_test.password;\n\t\torcDbCredentials.dbName = result.cloudant.orc_logs_test.db;\n\t\t\n\t\tif (env.mode == \"PROD\") {\n\t\t\tdbCredentials.host = result.cloudant.logs_db_readwrite.host;\n\t\t\tdbCredentials.user = result.cloudant.logs_db_readwrite.username;\n\t\t\tdbCredentials.password = result.cloudant.logs_db_readwrite.password;\n\t\t\tdbCredentials.dbName = result.cloudant.logs_db_readwrite.db;\n\t\t\t/**For Orchestrator logging **/\n\t\t\torcDbCredentials.host = result.cloudant.orc_logs.host;\n\t\t\torcDbCredentials.user = result.cloudant.orc_logs.username;\n\t\t\torcDbCredentials.password = result.cloudant.orc_logs.password;\n\t\t\torcDbCredentials.dbName = result.cloudant.orc_logs.db;\n\t\t}\n\t\tdbCredentials.url = \"https://\" + dbCredentials.user + \":\" + dbCredentials.password + \"@\" + dbCredentials.host;\n\t\torcDbCredentials.url = \"https://\" + orcDbCredentials.user + \":\" + orcDbCredentials.password + \"@\" + orcDbCredentials.host;\n\t\t\n\t\tcloudant = require('cloudant')(dbCredentials.url);\n\t\torcCloudant = require('cloudant')(orcDbCredentials.url);\n\t\t\n\t\tdb = cloudant.use(dbCredentials.dbName);\n\t\torcDb = orcCloudant.use(orcDbCredentials.dbName);\n\t});\n}", "title": "" }, { "docid": "4d241731e6e0ee747796393e8922540c", "score": "0.61410564", "text": "function init() {\n\n // Services table\n db.run(`CREATE TABLE IF NOT EXISTS services (name TEXT PRIMARY KEY, ip TEXT, port TEXT, status TEXT, lastChecked TEXT, endpoint TEXT);`, function(err) {\n if (err) console.log(err);\n });\n\n // Machines table\n db.run(`CREATE TABLE IF NOT EXISTS machines (name TEXT PRIMARY KEY, ip TEXT);`, function(err) {\n if (err) console.log(err);\n });\n}", "title": "" }, { "docid": "c21c89427e10a4b0b8863ba0a4976344", "score": "0.613766", "text": "function databaseInitialize() {\n if (media === null) {\n media = db.addCollection(\"media\");\n }\n\n // kick off any program logic or start listening to external events\n runProgramLogic();\n}", "title": "" }, { "docid": "5f936ceaa46b130d7274162a880a26bc", "score": "0.61373764", "text": "async function initConnPool() {\n if(_pool) {\n console.log(\"Trying to init DB again!\");\n return\n }\n console.log('Initializing DBService Connection Pool')\n _pool = await new sql.ConnectionPool(config).connect()\n _pool.on('error', err => {\n console.error(err)\n throw err\n })\n initialized = true\n console.log(\"DBService Connection Pool Initialized\")\n}", "title": "" }, { "docid": "61078dd9d20191921b7a38cfd1df7d26", "score": "0.6134794", "text": "function createdb(dbname){\n\n // if dbname not defined use the one in config\n dbname = dbname || config.db.databse;\n\n var srvrconnect = mysql.createConnection({\n host: config.db.host,\n user: config.db.user,\n password: config.db.password\n });\n console.log(\"bere\");\n console.log(config.db.databse);\n srvrconnect.query(\"CREATE DATABASE \"+ [dbname], function(err, result){\n if (err){\n console.log(\"Error creating db\");\n throw err;\n }\n console.log(\"Database created yayy!! \");\n });\n}", "title": "" }, { "docid": "7a66fc2ba62c6f45f8f4112d97a7712a", "score": "0.613409", "text": "static async injectDB(connection) {\n if (restaurants) {\n return;\n }\n try {\n restaurants = await connection\n .db(process.env.REST_REVIEWS_NS)\n .collection(\"restaurants\");\n } catch (e) {\n console.error(\n `Unable to establish a collection handle in restaurantDAO: ${e}`\n );\n }\n }", "title": "" }, { "docid": "7775c461b57a803d78890c7af0303041", "score": "0.6133849", "text": "function initialize(domain, port) {\n _db_domain = domain;\n _db_port = port;\n // Fetching the databases or creating them for the first time:\n createDB(\"staff\"); // This call creates the database for the firt time, reads staff list and loads the data into the database\n // If it is not the first time, the database is just fetched\n createDB(\"rooms\"); // This call creates the database for the firt time, reads rooms list and loads the data into the database\n // If it is not the first time, the database is just fetched\n createDB(\"beacons\"); // This call creates the database for the firt time, reads beacons JSON document and loads the data into the database\n // If it is not the first time, the database is just fetched\n createDB(\"changes\"); // This call creates the database for the first time. It does not read anything becasue at the begining of time there\n // are not changes recorded. As soon as people start chaning or editing content, JSON documents will be added.\n // DBinfo(_dbstaff);\n // DBinfo(_dbrooms);\n // DBinfo(_dbbeacons);\n // deleteDB(\"staffdb\");\n // deleteDB(\"roomsdb\");\n // deleteDB(\"beaconsdb\");\n}", "title": "" }, { "docid": "a7f7b5704e03cc8367206b316154cc48", "score": "0.6133533", "text": "db_connect() {\n connection = mysql.createConnection(DBCONFIG);\n connection.connect(function (error) {\n if (error) { console.log(error.message); }\n //console.log(`[Database] Connected!`);\n });\n }", "title": "" }, { "docid": "b5848a905b348337fd027c3da97abb02", "score": "0.6126851", "text": "connect() {\n return new Promise((resolve, reject) => {\n switch (this.config.type) {\n case MYSQL:\n connection = this.db.createConnection({\n host: this.config.host ? this.config.host : 'localhost',\n user: this.config.user,\n password: this.config.password,\n database: this.config.database\n });\n\n this.connection.connect((err) => {\n if (err) {\n reject(err);\n }\n\n resolve();\n });\n break;\n case POSTGRES:\n this.connection = new this.db({\n host: this.config.host,\n user: this.config.user,\n password: this.config.password ? this.config.password : null,\n database: this.config.database\n });\n\n this.connection.connect((err) => {\n if (err) {\n reject(err);\n }\n\n resolve();\n });\n break;\n default:\n reject({ message: 'Failed to resolve DB configuration type.' });\n break;\n }\n });\n }", "title": "" }, { "docid": "04df314812c9789f9f9720a4d6440c97", "score": "0.6121659", "text": "init(model)\n {\n this.options.pk = model.pk;\n\n if(this.options.namespace)\n {\n var nsName = this.options.namespace.name;\n var nsOpts = _.omit(this.options.namespace, 'name');\n\n if(_.isString(this.options.namespace))\n {\n nsName = this.options.namespace;\n nsOpts = undefined;\n } // end if\n\n var namespace = trivialdb.ns(nsName, nsOpts);\n this.db = namespace.db(this.options.name, _.omit(this.options, ['namespace', 'name']));\n }\n else\n {\n this.db = trivialdb.db(this.options.name, _.omit(this.options, ['name']));\n } // end if\n }", "title": "" }, { "docid": "fe417c2314fa1c715fd84cd307d7307d", "score": "0.6116495", "text": "function connectToDatabase() {\n\tvar connection;\n\tLogger.log(0, 'Creating connection to the databsase');\n\tconnection = mysql.createConnection({\n\t\thost : connectionDetails['host'],\n\t\tuser : connectionDetails['user'],\n\t\tpassword : connectionDetails['password'],\n\t\tdatabase : connectionDetails['database']\n\t});\n\tconnection.connect(function (err){\n\t\tconnection.on('err', function() {\n\t\t\tLogger.log(-1,'Cannot connect to the database');\n\t\t});\n\t\tconnectionMade = true;\n\t\tconnection.setMaxListeners(200);\n\t});\n\treturn connection;\n}", "title": "" }, { "docid": "bd6d41b7445c34b53d7ce8a5a83dfb5c", "score": "0.61068964", "text": "function databaseInit() {\n var databaseInstance1 = DatabaseSingleton.getInstance();\n var databaseInstance2 = DatabaseSingleton.getInstance();\n console.log(\"One database instance? \" + (databaseInstance1 === databaseInstance2));\n }", "title": "" }, { "docid": "92e789832e31506357212719961b75fe", "score": "0.61052877", "text": "function initialize() {\n var db = getDatabase();\n db.transaction(\n function(tx) {\n // Mail Accounts Table\n tx.executeSql('CREATE TABLE IF NOT EXISTS MailServers(name TEXT PRIMARY KEY,' +\n 'protocol TEXT, username TEXT, password TEXT, readHost TEXT, readPort INTEGER,' +\n 'readSecurity TEXT, sendHost TEXT, sendPort INTEGER, sendScurity TEXT)');\n });\n}", "title": "" } ]
08820327ad083950f860d4001979859e
RLtangent_PolyPolyC(): get the RL tangent between two convex polygons Input: m = number of vertices in polygon 1 V = array of vertices for convex polygon 1 with V[m]=V[0] n = number of vertices in polygon 2 W = array of vertices for convex polygon 2 with W[n]=W[0] Output: t1 = index of tangent point V[t1] for polygon 1 t2 = index of tangent point W[t2] for polygon 2
[ { "docid": "71eaaae32f49d0b27cbb31b1c3f9075a", "score": "0.81138885", "text": "function tangent_PolyPolyC(V, W, t1, t2, cmp1, cmp2) {\n\t var ix1, ix2; // search indices for polygons 1 and 2\n\t // first get the initial vertex on each polygon\n\t ix1 = t1(W[0], V); // right tangent from W[0] to V\n\t ix2 = t2(V[ix1], W); // left tangent from V[ix1] to W\n\t // ping-pong linear search until it stabilizes\n\t var done = false; // flag when done\n\t while (!done) {\n\t done = true; // assume done until...\n\t while (true) {\n\t if (ix1 === V.length - 1)\n\t ix1 = 0;\n\t if (cmp1(W[ix2], V[ix1], V[ix1 + 1]))\n\t break;\n\t ++ix1; // get Rtangent from W[ix2] to V\n\t }\n\t while (true) {\n\t if (ix2 === 0)\n\t ix2 = W.length - 1;\n\t if (cmp2(V[ix1], W[ix2], W[ix2 - 1]))\n\t break;\n\t --ix2; // get Ltangent from V[ix1] to W\n\t done = false; // not done if had to adjust this\n\t }\n\t }\n\t return { t1: ix1, t2: ix2 };\n\t }", "title": "" } ]
[ { "docid": "a957379af68f9e54c2751f806a330f63", "score": "0.8103846", "text": "function tangent_PolyPolyC(V, W, t1, t2, cmp1, cmp2) {\r\n var ix1, ix2; // search indices for polygons 1 and 2\r\n // first get the initial vertex on each polygon\r\n ix1 = t1(W[0], V); // right tangent from W[0] to V\r\n ix2 = t2(V[ix1], W); // left tangent from V[ix1] to W\r\n // ping-pong linear search until it stabilizes\r\n var done = false; // flag when done\r\n while (!done) {\r\n done = true; // assume done until...\r\n while (true) {\r\n if (ix1 === V.length - 1)\r\n ix1 = 0;\r\n if (cmp1(W[ix2], V[ix1], V[ix1 + 1]))\r\n break;\r\n ++ix1; // get Rtangent from W[ix2] to V\r\n }\r\n while (true) {\r\n if (ix2 === 0)\r\n ix2 = W.length - 1;\r\n if (cmp2(V[ix1], W[ix2], W[ix2 - 1]))\r\n break;\r\n --ix2; // get Ltangent from V[ix1] to W\r\n done = false; // not done if had to adjust this\r\n }\r\n }\r\n return { t1: ix1, t2: ix2 };\r\n }", "title": "" }, { "docid": "cb020d548f8aec60aea195f783493703", "score": "0.71108484", "text": "function tangent_PointPolyC(P, V) {\n\t return { rtan: Rtangent_PointPolyC(P, V), ltan: Ltangent_PointPolyC(P, V) };\n\t }", "title": "" }, { "docid": "67efb93a30d68ed96b7c50dbf5e595ab", "score": "0.70761746", "text": "function tangent_PointPolyC(P, V) {\r\n return { rtan: Rtangent_PointPolyC(P, V), ltan: Ltangent_PointPolyC(P, V) };\r\n }", "title": "" }, { "docid": "0a36313a087e643854c810bbb73a7d60", "score": "0.6908719", "text": "function Rtangent_PointPolyC(P, V) {\n\t var n = V.length - 1;\n\t // use binary search for large convex polygons\n\t var a, b, c; // indices for edge chain endpoints\n\t var upA, dnC; // test for up direction of edges a and c\n\t // rightmost tangent = maximum for the isLeft() ordering\n\t // test if V[0] is a local maximum\n\t if (below(P, V[1], V[0]) && !above(P, V[n - 1], V[0]))\n\t return 0; // V[0] is the maximum tangent point\n\t for (a = 0, b = n;;) {\n\t if (b - a === 1)\n\t if (above(P, V[a], V[b]))\n\t return a;\n\t else\n\t return b;\n\t c = Math.floor((a + b) / 2); // midpoint of [a,b], and 0<c<n\n\t dnC = below(P, V[c + 1], V[c]);\n\t if (dnC && !above(P, V[c - 1], V[c]))\n\t return c; // V[c] is the maximum tangent point\n\t // no max yet, so continue with the binary search\n\t // pick one of the two subchains [a,c] or [c,b]\n\t upA = above(P, V[a + 1], V[a]);\n\t if (upA) {\n\t if (dnC)\n\t b = c; // select [a,c]\n\t else {\n\t if (above(P, V[a], V[c]))\n\t b = c; // select [a,c]\n\t else\n\t a = c; // select [c,b]\n\t }\n\t }\n\t else {\n\t if (!dnC)\n\t a = c; // select [c,b]\n\t else {\n\t if (below(P, V[a], V[c]))\n\t b = c; // select [a,c]\n\t else\n\t a = c; // select [c,b]\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "b541918a253e2cb18c8548cdcd361dc2", "score": "0.6829847", "text": "function Ltangent_PointPolyC(P, V) {\n\t var n = V.length - 1;\n\t // use binary search for large convex polygons\n\t var a, b, c; // indices for edge chain endpoints\n\t var dnA, dnC; // test for down direction of edges a and c\n\t // leftmost tangent = minimum for the isLeft() ordering\n\t // test if V[0] is a local minimum\n\t if (above(P, V[n - 1], V[0]) && !below(P, V[1], V[0]))\n\t return 0; // V[0] is the minimum tangent point\n\t for (a = 0, b = n;;) {\n\t if (b - a === 1)\n\t if (below(P, V[a], V[b]))\n\t return a;\n\t else\n\t return b;\n\t c = Math.floor((a + b) / 2); // midpoint of [a,b], and 0<c<n\n\t dnC = below(P, V[c + 1], V[c]);\n\t if (above(P, V[c - 1], V[c]) && !dnC)\n\t return c; // V[c] is the minimum tangent point\n\t // no min yet, so continue with the binary search\n\t // pick one of the two subchains [a,c] or [c,b]\n\t dnA = below(P, V[a + 1], V[a]);\n\t if (dnA) {\n\t if (!dnC)\n\t b = c; // select [a,c]\n\t else {\n\t if (below(P, V[a], V[c]))\n\t b = c; // select [a,c]\n\t else\n\t a = c; // select [c,b]\n\t }\n\t }\n\t else {\n\t if (dnC)\n\t a = c; // select [c,b]\n\t else {\n\t if (above(P, V[a], V[c]))\n\t b = c; // select [a,c]\n\t else\n\t a = c; // select [c,b]\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "922459f061876c1f7d480f018e1a5788", "score": "0.67961776", "text": "function Rtangent_PointPolyC(P, V) {\r\n var n = V.length - 1;\r\n // use binary search for large convex polygons\r\n var a, b, c; // indices for edge chain endpoints\r\n var upA, dnC; // test for up direction of edges a and c\r\n // rightmost tangent = maximum for the isLeft() ordering\r\n // test if V[0] is a local maximum\r\n if (below(P, V[1], V[0]) && !above(P, V[n - 1], V[0]))\r\n return 0; // V[0] is the maximum tangent point\r\n for (a = 0, b = n;;) {\r\n if (b - a === 1)\r\n if (above(P, V[a], V[b]))\r\n return a;\r\n else\r\n return b;\r\n c = Math.floor((a + b) / 2); // midpoint of [a,b], and 0<c<n\r\n dnC = below(P, V[c + 1], V[c]);\r\n if (dnC && !above(P, V[c - 1], V[c]))\r\n return c; // V[c] is the maximum tangent point\r\n // no max yet, so continue with the binary search\r\n // pick one of the two subchains [a,c] or [c,b]\r\n upA = above(P, V[a + 1], V[a]);\r\n if (upA) {\r\n if (dnC)\r\n b = c; // select [a,c]\r\n else {\r\n if (above(P, V[a], V[c]))\r\n b = c; // select [a,c]\r\n else\r\n a = c; // select [c,b]\r\n }\r\n }\r\n else {\r\n if (!dnC)\r\n a = c; // select [c,b]\r\n else {\r\n if (below(P, V[a], V[c]))\r\n b = c; // select [a,c]\r\n else\r\n a = c; // select [c,b]\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "6ac15808d13cea46595151d652f8b46d", "score": "0.67255276", "text": "function Ltangent_PointPolyC(P, V) {\r\n var n = V.length - 1;\r\n // use binary search for large convex polygons\r\n var a, b, c; // indices for edge chain endpoints\r\n var dnA, dnC; // test for down direction of edges a and c\r\n // leftmost tangent = minimum for the isLeft() ordering\r\n // test if V[0] is a local minimum\r\n if (above(P, V[n - 1], V[0]) && !below(P, V[1], V[0]))\r\n return 0; // V[0] is the minimum tangent point\r\n for (a = 0, b = n;;) {\r\n if (b - a === 1)\r\n if (below(P, V[a], V[b]))\r\n return a;\r\n else\r\n return b;\r\n c = Math.floor((a + b) / 2); // midpoint of [a,b], and 0<c<n\r\n dnC = below(P, V[c + 1], V[c]);\r\n if (above(P, V[c - 1], V[c]) && !dnC)\r\n return c; // V[c] is the minimum tangent point\r\n // no min yet, so continue with the binary search\r\n // pick one of the two subchains [a,c] or [c,b]\r\n dnA = below(P, V[a + 1], V[a]);\r\n if (dnA) {\r\n if (!dnC)\r\n b = c; // select [a,c]\r\n else {\r\n if (below(P, V[a], V[c]))\r\n b = c; // select [a,c]\r\n else\r\n a = c; // select [c,b]\r\n }\r\n }\r\n else {\r\n if (dnC)\r\n a = c; // select [c,b]\r\n else {\r\n if (above(P, V[a], V[c]))\r\n b = c; // select [a,c]\r\n else\r\n a = c; // select [c,b]\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "614a8ffc964d5f1d15c8e73e0fc3d099", "score": "0.62542397", "text": "calculateTangents() {\n if (this.vertices === null) throw new Error('Vertices array is null');\n // If tangent vector array is not present, create one.\n if (this.tangents === null) {\n this.tangents = new Float32Array(this.vertices.length);\n }\n // Uh, maybe the variable names are too verbose. I think.\n for (let faceId = 0; faceId < this.indices.length; faceId += 3) {\n const vertexId1 = this.indices[faceId];\n const vertexId2 = this.indices[faceId + 1];\n const vertexId3 = this.indices[faceId + 2];\n // Calculate tangent vector.\n let origin = this.vertices.slice(vertexId1 * 3, vertexId1 * 3 + 3);\n let p1 = vec3.create();\n vec3.subtract(p1, this.vertices.slice(vertexId2 * 3, vertexId2 * 3 + 3),\n origin);\n let p2 = vec3.create();\n vec3.subtract(p2, this.vertices.slice(vertexId3 * 3, vertexId3 * 3 + 3),\n origin);\n let texOrigin = this.texCoords.slice(vertexId1 * 2, vertexId1 * 2 + 2);\n let texP1 = vec2.create();\n vec2.subtract(texP1, this.texCoords.slice(vertexId2 * 2,\n vertexId2 * 2 + 2), texOrigin);\n let texP2 = vec2.create();\n vec2.subtract(texP2, this.texCoords.slice(vertexId3 * 2,\n vertexId3 * 2 + 2), texOrigin);\n // Honestly I don't know what this does.\n let f = 1 / (texP1[0] * texP2[1] - texP2[0] * texP1[1]);\n let tangent = vec3.create();\n tangent[0] = f * (texP2[1] * p1[0] - texP1[1] * p2[0]);\n tangent[1] = f * (texP2[1] * p1[1] - texP1[1] * p2[1]);\n tangent[2] = f * (texP2[1] * p1[2] - texP1[1] * p2[2]);\n // Done! Paste them to those three vertices.\n this.tangents.set(tangent, vertexId1 * 3);\n this.tangents.set(tangent, vertexId2 * 3);\n this.tangents.set(tangent, vertexId3 * 3);\n }\n }", "title": "" }, { "docid": "334e386d7c530b2eb716da84b94a0417", "score": "0.5875945", "text": "function rT(p0, p1){\n var x0 = p0[0];\n var y0 = p0[1];\n var x1 = p1[0];\n var y1 = p1[1];\n var dx = x1 - x0;\n var dy = y1 - y0;\n \n return ([\n Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)),\n Math.atan2(dy, dx)\n ]);\n}", "title": "" }, { "docid": "aaa0b40315b5d0bbca3541cea3351a00", "score": "0.57996297", "text": "calcTangents () {\n let iStart = 0\n let iEnd = this.points.length\n let iLast = iEnd - 1\n if ((iEnd - iStart) > 2) {\n // project out first tangent from main chain\n this.tangents[iStart] = this.points[iStart + 1].clone()\n .sub(this.points[iStart])\n .normalize()\n\n // calculate tangents as averages of neighbouring residues\n for (let i = iStart + 1; i < iLast; i += 1) {\n this.tangents[i] = this.points[i + 1].clone()\n .sub(this.points[i - 1])\n .normalize()\n }\n\n // project out last tangent from main chain\n this.tangents[iLast] = this.points[iLast].clone()\n .sub(this.points[iLast - 1])\n .normalize()\n } else {\n // for short 2 point traces\n let tangent = this.points[iLast].clone()\n .sub(this.points[iStart])\n .normalize()\n\n this.tangents[iStart] = tangent\n this.tangents[iLast] = tangent\n }\n }", "title": "" }, { "docid": "b10a3320acc1d0736572b9cef680f28c", "score": "0.56610584", "text": "function getT(l1,l2){\n return ((l1[0].x - l2[0].x) * (l2[0].y - l2[1].y) - (l1[0].y - l2[0].y)*(l2[0].x - l2[1].x)) /\n ((l1[0].x - l1[1].x) * (l2[0].y - l2[1].y) - (l1[0].y - l1[1].y)*(l2[0].x - l2[1].x))\n}", "title": "" }, { "docid": "526508c1bc028dafcf14de51caf997e8", "score": "0.5644884", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "526508c1bc028dafcf14de51caf997e8", "score": "0.5644884", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "526508c1bc028dafcf14de51caf997e8", "score": "0.5644884", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "526508c1bc028dafcf14de51caf997e8", "score": "0.5644884", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "526508c1bc028dafcf14de51caf997e8", "score": "0.5644884", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "526508c1bc028dafcf14de51caf997e8", "score": "0.5644884", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math_js__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3f294f55b7acfa01e3745638135a3b50", "score": "0.5640368", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.sqrt)(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.sqrt)((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.max)(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "1910b1d6e43c015d19e637469fa26fa2", "score": "0.562101", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "351ed06f8f1d4b217693a0f5a420ac01", "score": "0.56175184", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n }", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "f6a45038f626cdd77a8875e0ee0fdeb4", "score": "0.5609128", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"l\" /* sqrt */])(Object(__WEBPACK_IMPORTED_MODULE_2__math__[\"h\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "4c4df456fd361472a76c5f5a86b32e34", "score": "0.5573698", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"d\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"d\" /* sqrt */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math_js__[\"e\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "6ae37b2d9aa8e77b748ad41beb8fc1bd", "score": "0.5571754", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"sqrt\"])(Object(_math__WEBPACK_IMPORTED_MODULE_2__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "39946145afa8e998cb8aaa64ede8035e", "score": "0.55666834", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"d\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"d\" /* sqrt */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"e\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "39946145afa8e998cb8aaa64ede8035e", "score": "0.55666834", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"d\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"d\" /* sqrt */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"e\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "39946145afa8e998cb8aaa64ede8035e", "score": "0.55666834", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"d\" /* sqrt */])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"d\" /* sqrt */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"e\" /* max */])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "02a5fe48f3c3c718b378c69ce6ec3b6c", "score": "0.5565365", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "f8eb800d2d422807cf6f0a26783d3ff4", "score": "0.5551833", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "9b32423ccdb034a822cb19e5d0e081a2", "score": "0.5548928", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"sqrt\"])(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"sqrt\"])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__math__[\"max\"])(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3488c3c54289d902768e1e6362d7bb18", "score": "0.5546638", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t }", "title": "" }, { "docid": "3488c3c54289d902768e1e6362d7bb18", "score": "0.5546638", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t }", "title": "" }, { "docid": "3488c3c54289d902768e1e6362d7bb18", "score": "0.5546638", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t }", "title": "" }, { "docid": "9b4831b5e3589ad7d628f1ca2d5538ef", "score": "0.5543469", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max$1(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "7a7aafdb9620333bb8b1cd59f10a48ac", "score": "0.5538252", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "bf39ebc53724b79df79519d9da21c494", "score": "0.55351925", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "bf39ebc53724b79df79519d9da21c494", "score": "0.55351925", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "bf39ebc53724b79df79519d9da21c494", "score": "0.55351925", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\t\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\t\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "39fa8cff244fafadf900eac2fb6e7f64", "score": "0.55270416", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(math_max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "39fa8cff244fafadf900eac2fb6e7f64", "score": "0.55270416", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(math_max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3da1708f02431a30087cf869e2181780", "score": "0.5523352", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t }", "title": "" }, { "docid": "3da1708f02431a30087cf869e2181780", "score": "0.5523352", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t }", "title": "" }, { "docid": "9c9221cb7e2b7d0da26093b03034095d", "score": "0.5522171", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "9c9221cb7e2b7d0da26093b03034095d", "score": "0.5522171", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "9c9221cb7e2b7d0da26093b03034095d", "score": "0.5522171", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n\t var x01 = x0 - x1,\n\t y01 = y0 - y1,\n\t lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n\t ox = lo * y01,\n\t oy = -lo * x01,\n\t x11 = x0 + ox,\n\t y11 = y0 + oy,\n\t x10 = x1 + ox,\n\t y10 = y1 + oy,\n\t x00 = (x11 + x10) / 2,\n\t y00 = (y11 + y10) / 2,\n\t dx = x10 - x11,\n\t dy = y10 - y11,\n\t d2 = dx * dx + dy * dy,\n\t r = r1 - rc,\n\t D = x11 * y10 - x10 * y11,\n\t d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n\t cx0 = (D * dy - dx * d) / d2,\n\t cy0 = (-D * dx - dy * d) / d2,\n\t cx1 = (D * dy + dx * d) / d2,\n\t cy1 = (-D * dx + dy * d) / d2,\n\t dx0 = cx0 - x00,\n\t dy0 = cy0 - y00,\n\t dx1 = cx1 - x00,\n\t dy1 = cy1 - y00;\n\n\t // Pick the closer of the two intersection points.\n\t // TODO Is there a faster way to determine which intersection to use?\n\t if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n\t return {\n\t cx: cx0,\n\t cy: cy0,\n\t x01: -ox,\n\t y01: -oy,\n\t x11: cx0 * (r1 / r - 1),\n\t y11: cy0 * (r1 / r - 1)\n\t };\n\t}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a37166ccf7850aadfb35a3c119a10d85", "score": "0.55216205", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "cb8f01c3679c29cdfafe2d0e5687f8e9", "score": "0.55170757", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) { cx0 = cx1, cy0 = cy1; }\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "3d6dcdb24f9c1c0fa9072ba412a48521", "score": "0.5505275", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n}", "title": "" }, { "docid": "a567d963944f710ef49331087f09fab5", "score": "0.5487898", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n }", "title": "" }, { "docid": "a567d963944f710ef49331087f09fab5", "score": "0.5487898", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n }", "title": "" }, { "docid": "7efdd92087b4b159f58323c63e912cd5", "score": "0.54754215", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n }", "title": "" }, { "docid": "7efdd92087b4b159f58323c63e912cd5", "score": "0.54754215", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;\n\n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n }", "title": "" }, { "docid": "d79cf9a62e22d134e6430aa520d0128f", "score": "0.5462723", "text": "function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {\n var x01 = x0 - x1,\n y01 = y0 - y1,\n lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),\n ox = lo * y01,\n oy = -lo * x01,\n x11 = x0 + ox,\n y11 = y0 + oy,\n x10 = x1 + ox,\n y10 = y1 + oy,\n x00 = (x11 + x10) / 2,\n y00 = (y11 + y10) / 2,\n dx = x10 - x11,\n dy = y10 - y11,\n d2 = dx * dx + dy * dy,\n r = r1 - rc,\n D = x11 * y10 - x10 * y11,\n d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),\n cx0 = (D * dy - dx * d) / d2,\n cy0 = (-D * dx - dy * d) / d2,\n cx1 = (D * dy + dx * d) / d2,\n cy1 = (-D * dx + dy * d) / d2,\n dx0 = cx0 - x00,\n dy0 = cy0 - y00,\n dx1 = cx1 - x00,\n dy1 = cy1 - y00;\n // Pick the closer of the two intersection points.\n // TODO Is there a faster way to determine which intersection to use?\n if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) {\n cx0 = cx1 , cy0 = cy1;\n }\n \n return {\n cx: cx0,\n cy: cy0,\n x01: -ox,\n y01: -oy,\n x11: cx0 * (r1 / r - 1),\n y11: cy0 * (r1 / r - 1)\n };\n }", "title": "" } ]
46f568e1345804721a0878cba2eaec77
Tell users in a room to add a new player.
[ { "docid": "a50f58fdd2c9f5e5dba247381493d85b", "score": "0.6944127", "text": "function introducePlayerToRoom(username, roomname) {\n\n for(var i = 0; i < onlinePlayers.length; i++) {\n\n if(onlinePlayers[i].name === username) {\n\n var sessionID = onlinePlayers[i].session;\n\n var player = onlinePlayers[i];\n\n io.sockets.sockets[sessionID].broadcast.to(roomname).emit('addPlayer', username, player.pos.x, player.pos.y, player.facing, player.skin);\n\n }\n\n }\n\n}", "title": "" } ]
[ { "docid": "d413ccf81254f7ccd8d126eee261042d", "score": "0.7648295", "text": "function addNewPlayer() {\n socket.emit('createNewPlayer');\n }", "title": "" }, { "docid": "28662a51e4d71437908d178cdbf8dba4", "score": "0.71198255", "text": "addPlayer(player) {\n\t\tthis.waitingPlayers.push(player);\n\t\tthis.fullLobby()\n\t}", "title": "" }, { "docid": "8be2a2df5d72091ba0dc8a10c92bd3e3", "score": "0.7054723", "text": "function addPlayer(text){\r\n let newPlayer = null;\r\n let player = {\r\n name: text,\r\n score: 0,\r\n answered: false\r\n }\r\n newPlayer = io();\r\n newPlayer.on(\"newPlayer\", updatePage);\r\n newPlayer.emit(\"add\", player);\r\n newPlayer.on(\"tQuestions\", upDateQuestions);\r\n newPlayer.emit(\"getQuestions\");\r\n}", "title": "" }, { "docid": "09e6568b29c9942e5d75d83d0b252859", "score": "0.702966", "text": "function add_player(channel, player) {\n channel.push(\"add_player\", player)\n .receive(\"error\", response => {\n console.log(\"unable to add new player: \" + player, response)\n })\n}", "title": "" }, { "docid": "9d4204a248eda7c094999d2507cc3984", "score": "0.6938655", "text": "function playerAddOnClick () {\n if (module.exports.internal.playerName.value.length > 0) {\n if (!module.exports.internal.dataObj.seasons[module.exports.internal.seasonId].players) {\n module.exports.internal.dataObj.seasons[module.exports.internal.seasonId].players = []\n }\n\n let player = {\n id: module.exports.internal.dataObj.seasons[module.exports.internal.seasonId].players.length + 1,\n name: module.exports.internal.playerName.value\n }\n module.exports.internal.dataObj.seasons[module.exports.internal.seasonId].players.push(player)\n\n debug('adding player ' + JSON.stringify(player))\n ipc.send('save-team-data', module.exports.internal.filename, module.exports.internal.dataObj)\n }\n}", "title": "" }, { "docid": "cce7149edf40c4f2cfa795a2ccc47b34", "score": "0.68686086", "text": "add_player(level, player) {\n\t\tif (player.identifier in this.players) {\n\t\t\tthrow \"identifier already used: \" + player.identifier \" for team: \" + this.identifier;\n\t\t}\n\t\tif (this.can_add_player() == false) {\n\t\t\tthrow \"max number of players has alredy been met for team: \" + this.identifier;\n\t\t}\n\t\tplayer.draft(level, this.identifier);\n\t\tthis.players[player.identifier] = player;\n\t}", "title": "" }, { "docid": "bd2d9b1d2589431012bd10c0b1c0a17e", "score": "0.6808276", "text": "addNewPlayer (player) {\n let id = null;\n\n if (!this.player1) {\n debug('Pridedam pirma zaideja');\n this.player1 = player;\n id = 'player1';\n this.setEmptyGameState();\n } else if (!this.player2) {\n debug('Pridedam antra zaideja');\n this.player2 = player;\n id = 'player2';\n } else {\n debug('Nebera vietos naujiems zaidejams');\n return;\n }\n\n player.id = id;\n debug('Pridejome nauja zaideja vardu: ' + id);\n\n player.on('message', (msg)=>{\n this.onNewMessage(id, msg);\n });\n\n player.on('close', (msg)=>{\n this.stopGame(id);\n });\n // console.dir(this);\n }", "title": "" }, { "docid": "8ff46763522677831c3a8a3d07ccf338", "score": "0.6722405", "text": "addPlayer (player) {\n if (this.players.has(player.id)) {\n this.gameEngine.emit(\n 'GameEngine-debug',\n `Could not add player to Game Session: ${this.id}`\n )\n\n return false\n }\n\n this.players.set(player.id, player)\n\n this.gameEngine.emit(\n 'GameEngine-debug',\n `Player: ${player.id} added to Game Session: ${this.id}`\n )\n\n return true\n }", "title": "" }, { "docid": "e02acd0d40262815f46f8a3fc2045dd6", "score": "0.666089", "text": "function onNewPlayer(data) {\n// Create a new player\n var newPlayer = new Player(this.id, data.nickname);\n\n// Broadcast new player to connected socket clients\n this.broadcast.emit(\"new player\", newPlayer);\n\n// Send existing players to the new player\n var roomKeys = Object.keys(socket.sockets.manager.rooms);\n for (var i = 0, ii = roomKeys.length; i < ii; i++) {\n if (roomKeys[i] != \"\") {\n var roomName = roomKeys[i].substring(1);\n var roster = socket.sockets.clients(roomName);\n for (i = 0, ii = roster.length; i < ii; i++) {\n var player = playerById(roster[i].id);\n this.emit(\"join room\", {roomName: roomName, player: player});\n }\n\n }\n }\n// Add new player to the players array\n util.log(\"New player has been created: \"+ this.id);\n players[newPlayer.nickname] = newPlayer;\n}", "title": "" }, { "docid": "e4443f6c618d3f22eb18be7eba051c7d", "score": "0.66383034", "text": "addPlayer(clientID, data) {\n debug(\"addPlayer\");\n }", "title": "" }, { "docid": "d4ecc7e63640ea34761aeb640b970325", "score": "0.65904266", "text": "function new_player() {\n current_id = entities.length;\n var player_to_add = new TYPE.Player(0, // game, server doesn't need\n current_id,\n new THREE.Mesh(WORLD.player_mesh,\n WORLD.player_material),\n new THREE.Vector3(0, 0, 0),\n 0,\n true);\n\n entities.push(player_to_add);\n\n entities[entities.length-1].id = current_id;\n client.emit('assignID', current_id);\n }", "title": "" }, { "docid": "4278dba71626f7061e2678ceb0c3a1ac", "score": "0.6572809", "text": "add_player(p) {\n this.players.push(p);\n }", "title": "" }, { "docid": "0d6c475c96f5fd90f4d48125fbfcfd6f", "score": "0.65630877", "text": "function addPlayer() {\n $.post('http://localhost:3000/game/' + gameId + '/player', function(data) {\n playerId = data.player.id;\n addPlayerDiv(playerId);\n addRollListener(playerId);\n });\n}", "title": "" }, { "docid": "429c8d7a99917d141a092b9a36e1445c", "score": "0.6548352", "text": "function onNewPlayer(data) {\n\tconsole.log(\"new player joined\");\n\tconsole.log(data.user);\n\tdata.id = this.id;\n\t// Add new player to the players array\n\tplayers[players.length] = data;\n\t\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.emit(\"new player\", players[players.length-1]);\n\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length-1; i++) {\n\t\t//existingPlayer = players[i];\n\t\tthis.emit(\"new player\", players[i]);\n\t\t//console.log(\"just sent \" + players[i].id);\n\t};\n}", "title": "" }, { "docid": "357085d0e1ca462067c9d819af26f6e6", "score": "0.65435404", "text": "function addNewPlayer(newName,newCorrect,newIncorrect){\n let newPlayerData = {\n Name: newName,\n Correct:newCorrect,\n Incorrect:newIncorrect\n }\n players.push(newPlayerData)\n }", "title": "" }, { "docid": "f646e044dc1a75de4bfe34a9e3d1e7a9", "score": "0.65374005", "text": "function addPlayer() {\n let newFirstName = document.getElementById(\"newFirstName\").value;\n let newLastName = document.getElementById(\"newLastName\").value;\n let newJerseyNum = document.getElementById(\"newJerseyNum\").value;\n let newPlayer = createPlayer(newFirstName, newLastName, newJerseyNum);\n myRoster.push(newPlayer);\n saveTempRoster();\n}", "title": "" }, { "docid": "ed5b1ac1f2b81061e78c481021851e81", "score": "0.65281826", "text": "function joinGame({ username, oldID }) {\n game.addPlayer(this, username, oldID)\n}", "title": "" }, { "docid": "9d12113057de22db62431f9b78e5eb6e", "score": "0.6509962", "text": "function addPlayer() {\n var name = $(\"#email\").val();\n if (name) {\n postPlayer(name);\n }\n }", "title": "" }, { "docid": "ce604149cc9a871e7e28b732679db3ea", "score": "0.6504815", "text": "addPlayer(currentUser, workerId) {\n const data = {\n _id: currentUser,\n workerId,\n enterTime: new Date(),\n status: 'instructions',\n passedQuiz: false,\n quizAttempts: 0,\n needRematch: false,\n };\n Players.insert(data);\n }", "title": "" }, { "docid": "0a8724809838a12dac3a9a33822874e4", "score": "0.6499119", "text": "addPlayer(player) {\n this.players.push(new GamePlayer(player));\n }", "title": "" }, { "docid": "0ab534ca30883cb84c67a6fcbda0b815", "score": "0.64836013", "text": "addPlayers(e) {\n e.preventDefault();\n const name = document.getElementById('name-player').value;\n const number = document.getElementById('nr-player').value;\n const player = new PlayerData(name, number);\n\n if (name === \"\" || number === \"\") return alert('uzupełnij pole');\n if (number.length > 3) return alert('maxymalny numer zawodnika nie może być większy od 999');\n if (name.length > 30) return alert('Imię i nazwisko nie może być dłuższe niż 30 znaków');\n //if you can make changes\n if (this.access) {\n this.players.addPlayerToList(player, number)\n this.players.storeAddPlayer(player, number)\n };\n //if no changes can be made, the race is on\n if (!this.access) {\n return alert('W trakcie wyścigu nie można dodawać zawodników do listy')\n }\n }", "title": "" }, { "docid": "e817febc7b41bdf4f64429a7f324c32e", "score": "0.64663327", "text": "function addPlayer(name) {\n const newPlayer = { id: players.length + 1, name: name, score: 0 };\n const newPlayers = [...players, newPlayer];\n set_players(newPlayers);\n }", "title": "" }, { "docid": "8471486b2940d6cb38c8531afd33c788", "score": "0.64228207", "text": "function addParticipant (data) {\n data.allPlayers.forEach(function(player, index) {\n log(player);\n\n var playerId = player.id;\n var playerName = player.username;\n var playerPoints = player.points;\n\n // update on gameboard\n var nameField = $(\"#player\" + playerId).find('.name')[0];\n var pointsField = $(\"#player\" + playerId).find('.points')[0];\n $(nameField).html(playerName);\n $(pointsField).html(playerPoints);\n })\n}", "title": "" }, { "docid": "c823c56892baf95d0f5d455e34402627", "score": "0.63911253", "text": "function addNewPlayer(data) {\n \n // get the new Player data from our client\n var newPlayer = new Player(data.x, data.y, this.id);\n \n // Now we will assign a color to our player\n // search the color array\n for (var i = 0; i < playerColors.length; i++) {\n if (playerColors[i] == \"0\") {\n playerColors[i] = this.id;\n newPlayer.setColor(i);\n break;\n }\n }\n \n this.emit('client color', newPlayer.getColor());\n \n // Here we will broadcast the new player info and coords to our other clients\n this.broadcast.emit('new player', { pid: newPlayer.getID(), x: newPlayer.getX(), y: newPlayer.getY(), c: newPlayer.getColor() });\n\n // Here, we need to get the existing player info to our new player client\n var existingPlayer;\n for (var i = 0; i < players.length; i++) {\n existingPlayer = players[i];\n this.emit('new player', { pid: existingPlayer.getID(), x: existingPlayer.getX(), y: existingPlayer.getY(), c: existingPlayer.getColor() });\n };\n players.push(newPlayer);\n // console.log(\"Current # of players\" + players.length);\n}", "title": "" }, { "docid": "c3ce1a8cddc7b775b1a0c21a3bfff184", "score": "0.6374143", "text": "function addPlayer(name, phoneNumber) {\n var newPlayer = {\n number: phoneNumber,\n name: name.toLowerCase(),\n isAlive: true\n };\n\n config.players.push(newPlayer);\n}", "title": "" }, { "docid": "8c9605ed5d918941f82f654824bdfe11", "score": "0.63589615", "text": "addPlayer(player) {\n this.players.push(player);\n }", "title": "" }, { "docid": "ab1aa39df5aa006cbdbc16ad88c01982", "score": "0.63570416", "text": "function addPlayer() {\r\n var name = $(\"#email\").val();\r\n if (name) {\r\n postPlayer(name);\r\n }\r\n }", "title": "" }, { "docid": "acd6af083f591259951490023800f205", "score": "0.634838", "text": "static createNewRoomAndAdd(player) {\r\n //console.log(\"inside createNewRoomandadd\");\r\n \r\n \r\n Room.list[Room.counter] = [];\r\n Room.list[Room.counter].push(player);\r\n player.setRoomId(Room.counter)\r\n \r\n }", "title": "" }, { "docid": "543ff4ae74591f31699dc97974e712b1", "score": "0.63470733", "text": "addPlayer(firstName, lastName, age) {\n let player = {\n firstName: firstName,\n lastname: lastName,\n age: age,\n };\n \n this.players.push(player)\n }", "title": "" }, { "docid": "32d80e500b3fbd66d1225d381f60ef57", "score": "0.6326312", "text": "function add_player(name) {\r\n jugadors.push(name);\r\n}", "title": "" }, { "docid": "6168d009b7c75675ffa601637db6feaf", "score": "0.6309239", "text": "function onNewPlayer(data) {\n\t// Create a new player\n\tvar newPlayer = new Player(data.x, data.y);\n\tnewPlayer.id = this.id;\n\n\t\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.emit(\"new player\", {id: newPlayer.id, x: newPlayer.getX(), y: newPlayer.getY()});\n\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tthis.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY()});\n\t};\n\t\n\t//util.log(players.length.toString());\n\t\t\n\t// Add new player to the players array\n\tplayers.push(newPlayer);\n\t\n}", "title": "" }, { "docid": "f6661a642142370ef4756d0c19212fe2", "score": "0.62892985", "text": "addPlayer(firstName, lastName, age) {\r\n let player = {\r\n firstName: firstName,\r\n lastName: lastName,\r\n age: age\r\n };\r\n this._players.push(player);\r\n }", "title": "" }, { "docid": "9de900bc013dfce889b6e930d5d49541", "score": "0.6284694", "text": "initPlayer(player) {\n const room = RoomService.createRoom();\n RoomService.addPlayerToRoomByID(player, room.getID());\n room.setAdmin(player);\n }", "title": "" }, { "docid": "70bcc3ac02f29bdb97d5581034612fdc", "score": "0.62722564", "text": "function onNewPlayer(data) {\n\t// Create a new player\n\tvar newPlayer = new Player(data.x, data.y, data.name, data.color);\n\tnewPlayer.id = this.id;\n\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.emit(\"new player\", {id: newPlayer.id, x: newPlayer.getX(), y: newPlayer.getY(), name: newPlayer.getName(), color: newPlayer.getColor()});\n\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tthis.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY(), name: existingPlayer.getName(), color: existingPlayer.getColor() });\n\t};\n\t\t\n\t// Add new player to the players array\n\tplayers.push(newPlayer);\n}", "title": "" }, { "docid": "ad995414327149d6481306137bf7bfec", "score": "0.62711567", "text": "addPlayer(player) {\n if (!this.players.find(p => p.username === player.username)) {\n this.players.push(player);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "70aeda208b028762227b22b1f25f6301", "score": "0.6259622", "text": "function addUser() {\n username = cleanInput($usernameInput.val().trim());\n roomname = cleanInput($roomnameInput.val().trim());\n\n // If the username and roomname is valid\n if (username && roomname) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('new user', username, roomname);\n }\n }", "title": "" }, { "docid": "97810c9d5a693d9d4d8853e77e9ab930", "score": "0.6244791", "text": "function _addPlayer() {\n //grab a new player from the PlayerMock array (basically Parse export json)\n var p = new Player(PlayerMock.players[modelservice.players.length]);\n //add the player through the modelservice\n modelservice.addPlayer(p).then(function() {\n $scope.$apply();\n }).catch(function(err) {\n console.log('_deletePlayer resulted in error in playersCtrl');\n }); \n }", "title": "" }, { "docid": "0ce58a5b66ffca9f7d063b50bc7188fd", "score": "0.62439215", "text": "function addPlayer(player) {\n // Get the side that we're going to add the hippo to.\n let side = SIDES[currentSide];\n currentSide = (currentSide + 1) % SIDES.length;\n\n // Create a hippo object for the player.\n let hippo = {\n player: player,\n side: side,\n };\n\n // Add the hippo to the hippo map and its side of the screen.\n assert(app.hippoMap[player.id] == null, 'Hippo already exists for ID: ' + player.id);\n app.hippoMap[player.id] = hippo;\n side.array.push(hippo);\n}", "title": "" }, { "docid": "04ecd3af05f0d2c738ae5a74cedaa49f", "score": "0.62413794", "text": "addPlayer(name, tank){\n if (!this.getPlayer(name)){\n this.players.push(new Player(name, tank));\n } else {\n console.log(\"the specified name is already in use\");\n }\n }", "title": "" }, { "docid": "071e941ad5815800e572e689d84f4668", "score": "0.6233085", "text": "addPlayer (player) {\n this.players.push(player);\n \n //If this is the first player, make him the \"currentPlayer\"\n if (this.players.length === 1) {\n \n this.currentPlayer = player;\n }\n }", "title": "" }, { "docid": "194c0e40859d45575ba415ec1687a281", "score": "0.6212995", "text": "function joinGame(username) {\n game.addPlayer(this, username);\n}", "title": "" }, { "docid": "9163af590dfb0bd3ef0f3181a7cae5ce", "score": "0.6203783", "text": "function add_new_user(){\n var msg = new_message(new_user + \" has joined the chat!\");\n chat_box.append(msg);\n clear_text();\n socket.emit(\"new_user\",{ name: new_user });\n }", "title": "" }, { "docid": "fc0558598fae9121aa4c241b8e3a819e", "score": "0.6201574", "text": "function createPlayer() {\n Player.create({\n phone:playerPhone,\n nick:'Mysterious Stranger '+playerPhone.substring(7),\n points:0\n }, function(err, model) {\n if (err) {\n respond('There was an error signing you up, try again later.');\n } else {\n player = model;\n respond('Welcome to Twilio Trivia! You are now signed up. Text \"help\" for instructions.');\n }\n });\n }", "title": "" }, { "docid": "b4c66c2ff25e65993b998e8b3439b0c6", "score": "0.61830777", "text": "registerPlayer(player) {\n\t\tthis.initPlayerGameData(player);\n\t\tthis.players.set(player.id, player);\n\t\tthis.emit(\"/players\");\n\n\t\tif (this.players.length() >= 3) {\n\t\t\tthis.running = true;\n\t\t\tthis.round();\n\t\t}\n\t}", "title": "" }, { "docid": "1e4bb5a9b69ea94f4d28ed8ffad16fd4", "score": "0.6182041", "text": "function goToAddPlayer() {\n $location.path('/addplayer');\n }", "title": "" }, { "docid": "374813ed10f2245cbc7aaa9abc5b3828", "score": "0.6178615", "text": "addPlayer(player){\n this.players.push(player);\n }", "title": "" }, { "docid": "127829504fd0b4916847532e211cb436", "score": "0.6176806", "text": "function onNewPlayer(data) {\n\t// Create a new player\n\tvar newPlayer = new Player(data.x, data.y);\n\tnewPlayer.id = this.id;\n\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.emit(\"new player\", {id: newPlayer.id, x: newPlayer.getX(), y: newPlayer.getY(), dead: newPlayer.dead});\n\n\tthis.emit(\"your id\", {id: this.id});\n\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tthis.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY(), dead: existingPlayer.dead});\n\t};\n\t\n\tvar existingObject;\n\tfor (i = 0; i < objects.length; i++) {\n\t\texistingObject = objects[i];\n\t\tthis.emit(\"new object\", {id: existingObject.id, x: existingObject.getX(), y: existingObject.getY(), onPlayer: existingObject.onPlayer});\n\t};\n\t\n\t// Add new player to the players array\n\tplayers.push(newPlayer);\n}", "title": "" }, { "docid": "f466366dcd257a4d83ea5f6b6f86c634", "score": "0.6164369", "text": "async function addNewPlayer(player) {\n // a new player is saved only with their userID and name\n let newRecord = new Users({ userid: player.userID, name: player.name });\n var savedRecord = await newRecord.save();\n return savedRecord;\n}", "title": "" }, { "docid": "3222a5a7818f3e4c49bc51797e539820", "score": "0.6141637", "text": "function addPlayer( objPlayer, inPosition ){\n\t\tplayers[inPosition] = objPlayer;\n\t}", "title": "" }, { "docid": "72886b12c05bee5f0cdb74e45158796c", "score": "0.61407804", "text": "addNewPlayer(e) {\n\n e.preventDefault();\n let newPlayer = {}\n\n newPlayer.username = utils.formatName(this.state.playerName);\n\n player.create(newPlayer).then(res => {\n this.setState({\n error: '',\n playerName: ''\n });\n this.props.updatePlayers();\n }).catch(error => {\n this.setState({\n error: 'Oops, that name is taken! Try again!',\n playerName: ''\n });\n throw error\n });\n }", "title": "" }, { "docid": "f94287fdb0003e40858e2d4268dcd5aa", "score": "0.61401266", "text": "function addUser(room, user) {\n var key = \"users:\" + room;\n client.rpush(key, user);\n}", "title": "" }, { "docid": "513e14e39b9397e839cd5968b749b840", "score": "0.61378556", "text": "function onNewPlayerToServer(data){\n\tconsole.log(this.id + \" has set the username \" + data.username);\n\n\tvar newPlayer = new Player(data.username, data.x, data.y);\n\tnewPlayer.setId (this.id);\n\n\t//send existing player to new client\n\tfor (var i = 0; i < players.length; i++){\n\t\tvar existingPlayer = players[i];\n\t\tthis.emit(\"newPlayerToClient\", {\n\t\t\tusername: existingPlayer.getUsername(),\n\t\t\tx: existingPlayer.getX(),\n\t\t\ty: existingPlayer.getY(),\n\t\t\tid: existingPlayer.getId()\n\t\t});\n\t}\n\t\n\t//send new player to all other clients\n\tthis.broadcast.emit(\"newPlayerToClient\",{\n\t\tusername: newPlayer.getUsername(),\n\t\tx: newPlayer.getX(),\n\t\ty: newPlayer.getY(),\n\t\tid: newPlayer.getId()\n\t});\n\n\t//add new player to server list\n\tplayers.push(newPlayer);\n}", "title": "" }, { "docid": "78ecdb860ee98eca5f3d1f2cbdf7cfd0", "score": "0.613301", "text": "addPlayer(firstName, lastName, age) {\n //Creates new player object\n let player = {\n firstName,\n lastName,\n age\n }\n //Appends it to current array of _players\n this._players.push(player);\n }", "title": "" }, { "docid": "b662bf3df0fd15ae9a6e68004ca237a2", "score": "0.61329436", "text": "function onNewPlayer (data) {\n //console.log(data)\n // Create a new player\n var newPlayer = new Player(data.x, data.y, data.angle, data.pname, data.uid, data.skin_shot, data.skin_char)\n newPlayer.id = this.id\n\n // Broadcast new player to connected socket clients\n this.broadcast.emit('new player', {id: newPlayer.id, x: newPlayer.getX(), y: newPlayer.getY(), angle: newPlayer.getAngle(), pname: newPlayer.pname, \n uid: newPlayer.uid, skin_shot: newPlayer.skin_shot, skin_char: newPlayer.skin_char})\n\n // Send existing players to the new player\n var existingPlayer\n for (var i in players) {\n existingPlayer = players[i]\n this.emit('new player', {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY(), angle: existingPlayer.getAngle(), \n pname: existingPlayer.pname, skin_shot: existingPlayer.skin_shot, skin_char: existingPlayer.skin_char})\n }\n\n // Add new player to the players array\n players[newPlayer.id] = newPlayer\n}", "title": "" }, { "docid": "e876acab51760b79460112fdcbbb2238", "score": "0.61267304", "text": "async addPlayer(player) {\n\t\tconst result = await sql.run(insertPlayerSql,\n\t\t\t{\n\t\t\t\t$username: player.username, \n\t\t\t\t$userId: player.userId, \n\t\t\t\t$name: player.name, \n\t\t\t\t$channel: player.channel, \n\t\t\t\t$powerLevel: player.level,\n\t\t\t\t$actionLevel: player.actionLevel, \n\t\t\t\t$gardenLevel: player.gardenLevel, \n\t\t\t\t$glory: player.glory, \n\t\t\t\t$lastActive: player.lastActive,\n\t\t\t\t$lastFought: player.lastFought,\n\t\t\t\t$npc: player.npc\n\t\t\t});\n\t\tlet playerId = result.lastID;\n\t\tfor(var i in player.config) {\n\t\t\tthis.setConfig(player.channel, playerId, i, player.config[i]);\n\t\t}\n\t\treturn playerId;\n\t}", "title": "" }, { "docid": "b38cdcf8bdaff011e071f0fbba8cf319", "score": "0.61147785", "text": "function addNewRoom(room) {\n $('<li><a href=\"#\" id=\"' + room + '\">' + room + '</a></li>')\n .appendTo('#roomListDropdown');\n\n $('#roomListDropdown').find('#' + room).click(function(event) {\n var roomName = this.id;\n\n event.preventDefault();\n\n changeRoom(roomName);\n });\n\n $('<div id=\"messages_' + room + '\"></div>')\n .appendTo('#messages');\n }", "title": "" }, { "docid": "6636f3f985f5001574908182e6cf4487", "score": "0.61077917", "text": "function addPlayer() {\n var player = new playerFactory.Player(\"player_\" + vm.playerList.length);\n var randomIndex = Math.floor(Math.random() * (avatarList.length));\n player.avatar = avatarList[randomIndex];\n avatarList.splice(randomIndex, 1); // remove the selected avatar from list\n\n // add player in list\n player.num = vm.playerList.length;\n player.score = [];\n vm.playerList.push(player);\n\n // create empty playerScore for each round\n for (var round = 0; round < vm.nbRound.length; round++) {\n vm.playerList[player.num].score[round] = {};\n vm.playerList[player.num].score[round].point = 0;\n vm.playerList[player.num].score[round].total = 0;\n }\n }", "title": "" }, { "docid": "453f1419d565b638d9d5baf219cf7455", "score": "0.61042", "text": "addPlayer(firstName, lastName, age) {\n const player = {\n firstName: firstName,\n lastName: lastName,\n age: age\n };\n this.players.push(player); \n}", "title": "" }, { "docid": "1b55cd053733ee2c6dabc7ebdbc269c7", "score": "0.60891634", "text": "addRoom(room) {\n room.users = []\n rooms.set(room.id, room);\n }", "title": "" }, { "docid": "a67ecebfd9c09383878cfe6fbf4c25ee", "score": "0.6084716", "text": "gameAddNewPlayer(playerSocketId, playerName) {\n playerName = playerName || 'Guest';\n playerSocketId = playerSocketId;\n const player = new Player(playerName, playerSocketId);\n storage.hset('players', playerName, JSON.stringify(player), (err) => {\n if (err) {\n console.log(`Error adding new player to storage`, err);\n }\n else {\n console.log(`${player.playerGetName()} has entered the game!`);\n }\n });\n return player.playerGetName();\n }", "title": "" }, { "docid": "e4bbdd1d99a49ade8c5a18abcacde9ef", "score": "0.6066822", "text": "function onNewPlayer(data) {\n\t// Create a new player based on 'data'\n\tvar newPlayer = new Player(data.x, data.y, data.pClass);\n\tnewPlayer.id = this.id;\n\n\n\t\n\t// Broadcast new player to all connected socket clients except\n\t// the client that just sent the 'new player' message.\n\tthis.broadcast.emit(\"new player\", {id: newPlayer.id, x: newPlayer.getX(), y: newPlayer.getY(), pClass: newPlayer.get_pClass()});\n\t\n\n\t// Send existing players to the to the client that sent the 'new player'\n\t// message.\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tthis.emit(\"new player\", {id: existingPlayer.id, x: existingPlayer.getX(), y: existingPlayer.getY(), pClass: existingPlayer.get_pClass()});\n\t}\n\t\t\n\t// Add new player to the players array\n\tplayers.push(newPlayer);\n}", "title": "" }, { "docid": "897dcd4b22075680d057f57b2454e145", "score": "0.6051455", "text": "function onNewPlayer(data) {\n console.log(\"New player connected: \"+ data.id);\n\n // Instantiate a local version of the Player object broadcast from the server.\n var newPlayer = new Player();\n\n newPlayer.set({x: data.x, y: data.y, role: data.role, id: data.id, username: data.username});\n newPlayer.makePlayerSprite(context);\n console.log(newPlayer.toJSON());\n\n // Add new player to the remote players array\n remotePlayers.push(newPlayer);\n\n\n\n}", "title": "" }, { "docid": "67b15668b01ffea832dadb76e8d75ea5", "score": "0.6039153", "text": "function handleNewPlayer(event) {\n event.preventDefault();\n\n // Don't do anything if the name fields hasn't been filled out\n if (!nameInput.val().trim().trim()) {\n return;\n }\n playerTrack.name = nameInput.val().trim().trim()\n // Calling the upsertAuthor function and passing in the value of the name input\n upsertPlayer({\n name: nameInput\n .val()\n .trim(),\n level: 1,\n effectiveLevel: 1,\n race: \"Human\",\n class: \"Captain\"\n });\n }", "title": "" }, { "docid": "be646e88c321b8eb230e85e3ef6170d7", "score": "0.60340446", "text": "function createPlayerAndAddToPlayerList(name, playerNumber){\n var player = new PlayerObject(name, playerNumber);\n\n addPlayerToPlayerList(player);\n\n}", "title": "" }, { "docid": "2083df46a256f6d9ef784b2518116158", "score": "0.603187", "text": "static add(roomId, name) {\n return db.one(`\n insert into users\n (room_id, name, points, answer)\n values\n ($1, $2, $3, $4)\n returning id, room_id, name, points, answer\n `,[roomId, name, 0, ''])\n }", "title": "" }, { "docid": "37adb0f8b9e906c3d615ac73b21969d1", "score": "0.60291106", "text": "function addPlayerToGame(data, option) {\r\n ////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\r\n var title = data;\r\n\r\n // Open up a transaction as usual\r\n var objectStore = DB.transaction([\"Players\"], \"readwrite\").objectStore(\r\n \"Players\"\r\n );\r\n\r\n // Get the to-do list object that has this title as it's title\r\n var objectStoreTitleRequest = objectStore.get(title);\r\n\r\n objectStoreTitleRequest.onsuccess = function() {\r\n // Grab the data object returned as the result\r\n var data = objectStoreTitleRequest.result;\r\n\r\n // Update the notified value in the object to \"yes\"\r\n data.playing = option;\r\n\r\n // Create another request that inserts the item back into the database\r\n var updateTitleRequest = objectStore.put(data);\r\n\r\n // Log the transaction that originated this request\r\n console.log(\r\n \"The transaction that originated this request is \" +\r\n updateTitleRequest.transaction\r\n );\r\n\r\n // When this new request succeeds, run the displayData() function again to update the display\r\n updateTitleRequest.onsuccess = function() {\r\n console.log(\"Success update \" + updateTitleRequest.readyState);\r\n\r\n location.reload();\r\n };\r\n };\r\n\r\n ////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n}", "title": "" }, { "docid": "3b73f56248dda4d8bb2dbcc24be748f3", "score": "0.6011797", "text": "addPlayer(playerID) {\n // checks to see if any player exists\n if (!this.player1) {\n this.player1 = new Player(playerID, \"x\", true);\n } else {\n this.player2 = new Player(playerID, \"o\", false);\n }\n }", "title": "" }, { "docid": "ad69eba877c046572859d34ad8f9d00e", "score": "0.60013133", "text": "Register() {\n\n if (this.gameContext.isNewPlayer()) {\n let newPlayerName = this.gameContext.getDefaultPlayerName();\n\n RegisterNewAccount(this.gameContext.ds)\n .then((authData) => {\n let newPlayer = new Player(null, {\n uid: authData.uid,\n name: newPlayerName,\n lost: 0,\n won: 0,\n draw: 0,\n score: 0,\n lastTimeAccessed: Date.now(),\n avatar: 'https://bitcoinwallet.com/images/users/unknown_user.png'\n });\n this.gameContext.players.add(newPlayer);\n this.gameContext.setActivePlayer(newPlayer.id, authData.token);\n this.router.go(this, 'Show', {playerId: newPlayer.id});\n });\n\n } else {\n this.router.go(HomeController, 'Main');\n }\n }", "title": "" }, { "docid": "303ee434a8e6a65ac13fc51ee90839bf", "score": "0.59938216", "text": "function addTeam() {\n //prompt for team members\n inquirer.prompt([{\n type: \"list\",\n name: \"teamChoice\",\n message: \"What would you like to add next?\",\n choices: [\"Engineer\", \"Intern\", \"Quit\"]\n }]).then(userChoice => {\n switch (userChoice.teamChoice) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n generateHtml();\n }\n });\n }", "title": "" }, { "docid": "dd4c98dbce4b3f1fd0bacfd502057341", "score": "0.5991179", "text": "function addPlayer(code, name, id) {\r\n var round = rooms.get(code);\r\n round.players.push(id);\r\n round.names.push(name);\r\n round.stacks.push(1000);\r\n round.amountInPot.push(0);\r\n round.phasePot.push(0);\r\n round.positions.push(round.players.length - 1);\r\n if (round.players.length > 2) {\r\n // Active game, start out folded\r\n round.folded.add(round.players.length - 1);\r\n }\r\n return round;\r\n }", "title": "" }, { "docid": "aa6fbec83bc4f9adc7a8cfeece34e735", "score": "0.598093", "text": "addPlayer(firstName, lastName, age) {\n let player = {\n firstName: firstName,\n lastName: lastName,\n age: age,\n };\n return this._players.push(player)\n }", "title": "" }, { "docid": "152ef2a6e1ad0fabfe329e93c1e55c84", "score": "0.59666055", "text": "function onNewPlayer(data) \n{\n\n\tconsole.log(\"New user\");\n\tvar newPlayer = new Player(this.id , idProvider , data.name , data.roomName);\n\tidProvider++;\n\tconsole.log(newPlayer.id+\" \"+newPlayer.name);\n\tthis.emit(\"new player\", {id: newPlayer.id, name: newPlayer.name});/*DEBUG*/\n\t// Broadcast new player to connected socket clients\n\tthis.broadcast.to(data.roomName).emit(\"new player\", {id: newPlayer.id, name: newPlayer.name});\n\n\t\n\tvar roomCounter=1;\n\t// Send existing players to the new player\n\tvar i, existingPlayer;\n\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tif(existingPlayer.roomName == data.roomName){\n\t\t\tthis.emit(\"new player\", {id: existingPlayer.id, name: existingPlayer.name});\n\t\t\troomCounter++;\n\t\t}\t\n\t};\n\n\t// Add new player to the players array\n\tplayers.push(newPlayer);\n\n\tif(roomCounter==maxRoomEntry)\n\t{\n\t\t//Start Game give time of 5 seconds so that designation arrive to all player\n\t\tthis.emit(\"StartGame\"); \n\t\tthis.broadcast.to(data.roomName).emit(\"StartGame\");\n\n\n\t\tvar index = 0;\n\t\tfor (i = 0; i < players.length; i++) {\n\t\texistingPlayer = players[i];\n\t\tif(existingPlayer.roomName == data.roomName){\n\t\t\tthis.emit(\"OnPlayerDesignation\", {id: existingPlayer.id, designation: designationList[index]});\n\t\t\tthis.broadcast.to(data.roomName).emit(\"OnPlayerDesignation\" , {id: existingPlayer.id, designation: designationList[index]});\n\t\t\tindex++;\n\t\t}\t\n\t};\n\t}\n}", "title": "" }, { "docid": "a30f5763bf981c03ccf0bff858a3e32f", "score": "0.59616464", "text": "function addPlayerListener() {\n $('.createPlayer').click(function() {\n addPlayer();\n });\n}", "title": "" }, { "docid": "c251048b1fc9de25498660084b6f6854", "score": "0.5959372", "text": "function addTeamMember() {\n inquirer\n .prompt([\n {\n name: \"role\",\n type: \"list\",\n choices: [\"Add an Engineer\", \"Add an Intern\"],\n },\n ])\n .then((answers) => {\n switch (answers.role) {\n case \"Add an Engineer\":\n console.log(\"add engineer!\");\n addEngineer();\n break;\n\n case \"Add an Intern\":\n console.log(\"add intern!\");\n addIntern();\n break;\n }\n });\n}", "title": "" }, { "docid": "723e69d1aa26edcf4c9fde9a303016fa", "score": "0.59290373", "text": "addPlayers(fnameP, lnameP, ageP) {\n const player = {\n firstName: fnameP,\n lastName: lnameP,\n age: ageP\n }\n \n \t\tthis.players = player;\n }", "title": "" }, { "docid": "f37f87495d6d89431916203667a77aba", "score": "0.58791304", "text": "function addEngineer() {\n console.log(`\n ================\n Add New Engineer\n ================\n `);\n return inquirer\n .prompt([\n {\n type: \"input\",\n name: \"engineerName\",\n message: \"Please enter the name of the engineer\",\n },\n {\n type: \"input\",\n name: \"engineerID\",\n message: \"Please enter the employee ID number\",\n },\n {\n type: \"input\",\n name: \"engineerEmail\",\n message: \"Enter their email\",\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"Enter their GitHub username\",\n },\n ])\n .then((answers) => {\n const engineer = new Engineer(\n answers.engineerName,\n answers.engineerID,\n answers.engineerEmail,\n answers.github\n );\n teamMembers.push(engineer);\n addNewMember();\n });\n}", "title": "" }, { "docid": "68534ffcd054eea03649e7394b15d905", "score": "0.5875536", "text": "function addNewMember() {\n return inquirer\n .prompt([\n {\n type: \"list\",\n name: \"memberType\",\n message:\n \"Please select a role to add a new team member, otherwise select finish. \",\n choices: [\"Engineer\", \"Intern\", \"Finish building team\"],\n },\n ])\n .then((choice) => {\n console.log(choice.memberType);\n if (choice.memberType === \"Engineer\") {\n addEngineer();\n }\n if (choice.memberType === \"Intern\") {\n addIntern();\n }\n if (choice.memberType === \"Finish building team\") {\n console.log(teamMembers);\n return finishTeam(\"./dist/index.html\", generateTeam(teamMembers));\n }\n });\n}", "title": "" }, { "docid": "03ff574ef861f80cfe306c5fb158fe2d", "score": "0.5868568", "text": "function addPlayer(socket, user, role) {\n var opponent_role;\n\n if (!socket) {\n throw \"Invalid socket!\";\n }\n\n if (!user) {\n throw \"Invalid user\";\n }\n\n if (!role || (role !== WHITE_ROLE && role !== BLACK_ROLE)) {\n throw \"Invalid role: \" + role;\n }\n\n if (role === WHITE_ROLE) {\n opponent_role = BLACK_ROLE;\n } else {\n opponent_role = WHITE_ROLE;\n }\n\n sockets[role] = socket;\n\n socket.emit('user_info', {\n name: user.gaming_id\n });\n socket.emit('role', role);\n if (infochess.getCurrentPhase() === infochess.PHASES.PAWNCAPTURE && infochess.getCurrentRole() === role) {\n updatePlayer(role, { pawn_captures: infochess.getPawnCaptures(role) });\n } else {\n updatePlayer(role, null);\n }\n\n if (infochess.getCurrentPhase() === infochess.PHASES.SETUP) {\n if (this.initialArmies && this.initialArmies[opponent_role]) {\n notify(role, 'opponent_ready', {});\n } else {\n notify(role, 'opponent_choosing', {});\n }\n }\n\n var handleError = function(callback, data) {\n try {\n var result = callback(data);\n return result;\n } catch (e) {\n socket.emit('error', e);\n console.log(\"Error: \", e);\n console.log(e.stack);\n }\n };\n\n var logAndHandle = function(message, callback) {\n socket.on(message, function(data) {\n console.log(\"[\"+user.gaming_id+\"] \" + message + \": \", data);\n\n return handleError(callback, data);\n });\n };\n\n var logAndHandleAndUpdate = function(message, callback) {\n socket.on(message, function(data) {\n console.log(\"[\"+user.gaming_id+\"] \" + message + \": \", data);\n\n var result = handleError(callback, data);\n save();\n broadcastUpdate(result);\n });\n };\n\n logAndHandleAndUpdate('select_army', function(serializedArmy) {\n infochess.setArmy(role, serializedArmy);\n if (infochess.getCurrentPhase() !== infochess.PHASES.SETUP) {\n //Game just started\n var state = {};\n state[WHITE_ROLE] = raven.ATTN;\n state[BLACK_ROLE] = raven.PEND;\n raven.setPlayerState(state);\n } else {\n notify(opponent_role, 'opponent_ready', {});\n raven.setPlayerState(role, raven.PEND);\n }\n });\n\n logAndHandleAndUpdate('unready', function() {\n infochess.clearArmy(role);\n notify(opponent_role, 'opponent_choosing', {});\n raven.setPlayerState(role, raven.ATTN);\n });\n\n logAndHandle('move', function(move) {\n var result = infochess.move(role, new Position(move.src.x, move.src.y), new Position(move.dest.x, move.dest.y));\n checkForWinner();\n save();\n updatePlayer(role, result);\n if (result.type === 'pawnbump') {\n result = {\n type: 'move'\n }\n }\n updatePlayer(opponent_role, result);\n return result;\n });\n\n /*\n * Return a function that can handle incoming messages for IW attacks.\n * Type must be 'ew' or 'psyop'\n */\n var handleIW = function(type) {\n if (type !== 'ew' && type !== 'psyop') {\n throw \"Type must be 'ew' or 'psyop'\";\n }\n\n return function(data) {\n if (typeof data.strength === 'undefined') {\n throw new InvalidMessageError(\"Protocol error: 'strength' must be specified for IW attacks\");\n }\n\n var result = infochess.iw_attack(role, {type: type, strength: data.strength});\n endOfTurn();\n if (infochess.getCurrentPhase() === infochess.PHASES.DEFENSE) {\n return true;\n }\n return result;\n };\n };\n\n logAndHandleAndUpdate('ew', handleIW('ew'));\n logAndHandleAndUpdate('psyop', handleIW('psyop'));\n\n logAndHandle('iw_defense', function(data) {\n var result = infochess.iw_defense(role, data);\n if (result.msg === 'PSYOP_CHOOSE_VICTIM') {\n updatePlayer(role, result);\n } else {\n save();\n checkForWinner();\n broadcastUpdate(result);\n }\n return result;\n });\n\n logAndHandleAndUpdate('pawn_upgrade', function(data) {\n return infochess.pawn_upgrade(role, data);\n });\n\n logAndHandle('pawn_capture_query', function() {\n var results = { pawn_captures: infochess.getPawnCaptures(role) };\n save();\n checkForWinner();\n updatePlayer(role, results);\n // Don't update the other player!\n return results;\n });\n\n logAndHandleAndUpdate('end_turn', function(data) {\n infochess.endTurn(role);\n endOfTurn();\n return true;\n });\n\n logAndHandle('notes', function(notes_content) {\n notes[role] = notes_content;\n save();\n return true;\n });\n\n socket.on('forfeit', function(data) {\n infochess.forfeit(role);\n broadcastUpdate(null);\n raven.forfeit(role);\n raven.broadcast('message', {user: 'game', message: user.gaming_id + \" has forfeited the game.\", role: role});\n });\n }", "title": "" }, { "docid": "75dff5f893cfe295044557182b965ccc", "score": "0.58652085", "text": "function addTeam() {\n inquirer\n .prompt(teamQuestions)\n .then(answer => {\n switch(answer.memberRole) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n createPage();\n }\n });\n }", "title": "" }, { "docid": "14046d34a2c40f4152a7d3da843ec11e", "score": "0.5861695", "text": "function addPlayer() {\n\n var name = $(\"#name\").val();\n var id = $(\"#id\").val();\n var game = $(\"#game\").val();\n\n\n if (name && id && game) {\n\n postPlayer(name, id, game);\n\n }\n\n }", "title": "" }, { "docid": "8d89d4e326a5de4202740393840dfec5", "score": "0.58531827", "text": "function playerJoinGame(data) {\n\n // A reference to the player's Socket.IO socket object\n var sock = this;\n\n // Look up the room ID in the Socket.IO manager object.\n // var room = gameSocket.manager.rooms[\"/\" + data.gameId];\n var room = gameSocket.adapter.rooms[data.gameId];\n\n // If the room exists...\n if (room !== undefined) {\n // attach the socket id to the data object.\n data.mySocketId = sock.id;\n\n // Join the room\n sock.join(data.gameId);\n\n // add username if unknown\n db.query('SELECT * FROM player WHERE player_name = ?', data.playerName, function (err, rows) {\n if (err) throw err;\n\n if (!rows.length) {\n var user = {player_name: data.playerName, player_win: 0};\n db.query('INSERT INTO player SET ?', user, function (err, res) {\n if (err) throw err;\n });\n }\n });\n\n // Emit an event notifying the clients that the player has joined the room.\n io.sockets.in(data.gameId).emit('playerJoinedRoom', data);\n\n } else {\n // Otherwise, send an error message back to the player.\n this.emit('gameError', {message: \"This room does not exist.\"});\n }\n}", "title": "" }, { "docid": "dde5726ff3a3551be6b00ef9f8d3d277", "score": "0.5845468", "text": "async playerJoin(playerId, gameId)\n {\n const resp = await this.sql.query(`\n select game_id as id\n from game_players\n where player_id = @playerId\n and game_id = @gameId\n `, {playerId, gameId});\n\n if (resp.firstOrNull()) {\n this.log.info('player %s already in game %s, not adding', playerId, gameId);\n return;\n }\n\n await this.sql.query(`\n insert into game_players (player_id, game_id)\n values (@playerId, @gameId)\n `, {playerId, gameId});\n }", "title": "" }, { "docid": "2b84250a46c53f1c7db9ae7b85162994", "score": "0.58372164", "text": "function onNewPlayer(data){\n\tvar new_enemy = new cd_player(data.x, data.y,data.id, data.name);\n\tenemies.push(new_enemy);\n}", "title": "" }, { "docid": "e84056d75fafb97f842565b2b3fa4d27", "score": "0.5832974", "text": "add(e) {\n\t\te.preventDefault();\n\t\tconst player = this.state.player;\n\t\tthis.setState({ player: '' }, () => this.props.add(player));\n\t}", "title": "" }, { "docid": "62be6f84313ee39d1845376ea03da1a2", "score": "0.58277327", "text": "function addingTeamMembers() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"addingMember\",\n message: \"Would you like to add an Engineer, an Intern or are you finished building your team?\",\n choices: [\"Engineer\", \"Intern\", new inquirer.Separator(), \"Finished Building my Team\"]\n }\n ]).then(data => {\n const getRole = data.addingMember;\n if (getRole === \"Engineer\") {\n getEngineer();\n } else if (getRole === \"Intern\") {\n getIntern();\n } else {\n getTeam();\n }\n })\n }", "title": "" }, { "docid": "f4706e3940e060b5a73ec07d04041988", "score": "0.58227164", "text": "function createRoom() {\n if ($addRoomName.val() === '') {\n return;\n }\n app.addRoom($addRoomName.val())\n $addRoomName.val('');\n }", "title": "" }, { "docid": "d6961ae1cf64f137d6c7727405627b20", "score": "0.5813378", "text": "addChatMessage(sender, msg) {\n\t\tvar date = new Date();\n\t\tthis.players.forEach(p => p.addChatMessage(sender, date, msg));\n\t}", "title": "" }, { "docid": "e30fb9880b9ca049996f3c76eff123f8", "score": "0.5808822", "text": "addPlayer(socket, loginUser){\n this.players[socket.id] = {\n playerId: socket.id,\n x: Math.floor(Math.random() * 700) + 50,\n y: Math.floor(Math.random() * 500) + 50,\n points: 0,\n placedThisRound: 0\n };\n if(loginUser){\n // make suer each login user has correct username in every different scene\n this.players[socket.id].username = loginUser.username;\n this.players[socket.id].uid = loginUser.uid;\n } else {\n //If a player is not logged in, give them a random Guest username\n this.players[socket.id].username = \"Guest\" + Math.floor(Math.random() * 9999)\n }\n //Increments playerCount, closes room is player is full\n this.playerCount += 1\n if(this.playerCount == 4){\n this.isOpen = false;\n }\n }", "title": "" }, { "docid": "8d496370801733944aa748137fd432d0", "score": "0.5802166", "text": "function addClient(json) {\n // TODO make sure we are waiting for players\n if (gameState == \"RUNNING\") return;\n \n document.getElementById(\"waitforplayers\").innerHTML += \"<h2>\"+json.name+\"</h2>\";\n players[json.playerid] = {score : 0, nextscore : 0, name : json.name, ready : false, ans : {time : -1, ans : -1}};\n \n // the node server will have told the player its id as well\n}", "title": "" }, { "docid": "676b5709d061c6ab6ffedb4a7a7ef985", "score": "0.5786602", "text": "createRoom(name_room) {\n this.rooms.push({\n idRoom: this.rooms.length + 1,\n nome: name_room,\n users: [],\n blackList: [],\n });\n }", "title": "" }, { "docid": "26237be282f5bf2c4ffb3e6ffdd7f499", "score": "0.57849705", "text": "addPlayer(socket, name, completion) {\n\t\tlet newPlayer;\n\t\t// If max players has not been reached, send game id and add to list\n\t\t// Otherwise, reject join\n\t\tif (this.players.length !== (this.options.maxPlayers || Game.getDefaultOptions().maxPlayers)) {\n\t\t\tnewPlayer = new Player(socket, name);\n\t\t\tthis.players.push(newPlayer);\n\t\t\tcompletion(true);\n\t\t} else {\n\t\t\treturn completion(false);\n\t\t}\n\n\t\t// Log player join to all other players\n\t\tthis.players.forEach((player) => {\n\t\t\t// Send game.player.join event (name, id)\n\t\t\tplayer.socket.emit('game.player.join', newPlayer.name, newPlayer.socket.id);\n\t\t});\n\n\t\t// If min players has been reached, start the game\n\t\tif ((this.players.length >= (this.options.minPlayers || Game.getDefaultOptions().minPlayers)) && !this.gameHasStarted) {\n\t\t\tthis.startGame();\n\t\t}\n\n\t\t// Setup socket for disconnect\n\t\tsocket.on('disconnect', () => {\n\t\t\tthis.removePlayer(socket, (gameIsEmpty) => {\n\t\t\t\t// Tell players that room is destroyed\n\t\t\t\tthis.players.forEach(player => player.socket.emit('game.destroy'));\n\n\t\t\t\t// destroy self if game is empty\n\t\t\t\tif (gameIsEmpty) {\n\t\t\t\t\tthis.destructionCallback(this.id);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Setup chat\n\t\tthis.setupChat(socket);\n\n\t\t// Send game info\n\t\tthis.sendGameInfo(newPlayer);\n\t}", "title": "" }, { "docid": "4b4bfe29308a6b0f90ce05bb494a7c6b", "score": "0.5784278", "text": "function addPlayer() {\n fc.playerIndex = Math.floor(getRandomIndex(2, fc.level+2)); // player starts low on chain\n var animalHtml = '<div data-player class=\"sprite player\"><div>' + fc.foodChain[fc.playerIndex].code + '</div></div>';\n fc.$stage.append(animalHtml);\n fc.$player = $('[data-player]');\n }", "title": "" }, { "docid": "de185bc330575e4a62fff19b41b78555", "score": "0.576174", "text": "function add_player() {\n\n //validate input\n if(!$(\"#nameinput\").val()) {\n return false;\n }\n\n //save old layout\n save_canvas();\n\n //grab name, create player, add to array\n let name = $(\"#nameinput\").val();\n let newPlayer = new Player(name);\n board.players.push(newPlayer);\n\n //clear text box\n $(\"#nameinput\").val(\"\");\n\n //refresh canvas\n draw_canvas();\n\n //post to record\n console.log(\"NEW\",name);\n\n}", "title": "" }, { "docid": "7e27b641683bffd50134bb672de5ecd9", "score": "0.57594275", "text": "function addOtherPlayer(self, playerInfo) {\n const otherPlayer = self.add.image();\n otherPlayer.playerId = playerInfo.playerId;\n self.otherPlayers.add(otherPlayer);\n}", "title": "" }, { "docid": "133825c61de36508f69adbefc1f7184d", "score": "0.57543135", "text": "async addRoom(context, room) {\n try {\n const response = await api().post(\"/api/room\", room)\n context.commit(\"ADD_ROOM\", response.data)\n } catch (error) {\n console.log(\"error\", error)\n }\n }", "title": "" }, { "docid": "c13b104c195247012df508328f593f28", "score": "0.5752961", "text": "function onNewPlayer(data) {\n controlMaps.onNewPlayer(this, data);\n}", "title": "" }, { "docid": "aa1210848452a17fa5cc2fca8bb82fe0", "score": "0.57522714", "text": "function addPlayer(event) {\r\n event.preventDefault();\r\n var playerID = event.target.newPlayer.value;\r\n localStorage.Data = JSON.stringify(playerID);\r\n userForm.removeEventListener('submit', addPlayer);\r\n window.location.href = 'html/game.html';\r\n}", "title": "" }, { "docid": "e7cfd6de1d149002d19d4eca80e62a21", "score": "0.57522625", "text": "function addPlayer(nickname) {\n\t$('#playerList').queue(function() {\n\t\tvar buddyTemplate = '<div class=\"player\" id=\"player-' \n\t\t\t+ nickname + '\"><span>' + nickname + '</span></div>'\n\t\t$(buddyTemplate).appendTo('#playerList').slideDown(100, function() {\n\t\t\t$('#player-' + nickname).unbind('click');\n\t\t\tbindPlayerClick(nickname);\n\t\t});\n\t});\n\t$('#playerList').dequeue();\n}", "title": "" }, { "docid": "e1e7744ead5988a2e1e84d350bb7a7ab", "score": "0.5750073", "text": "function addNewGame(con, res, gameName, player1, player2){\r\n\t\t\r\n\t\t\r\n\t\tlet insert = \"INSERT INTO game (name, p1name, p2name) VALUES ('\"+\r\n\t\t\t\t\tgameName +\"', '\"+player1 + \"', '\"+player2 +\"')\";\r\n\t\t\t\t\t\r\n\t\tcon.query(insert, function (err, result) {\r\n\t\t\tif (err) throw err;\r\n\t\t\t\t\t\t\r\n\t\t\tres.send(\"New account created.\");\r\n\t\t});\r\n\t\t\r\n\t\t\r\n\t}", "title": "" }, { "docid": "f112d9566ca6c1741290851267bee8e3", "score": "0.57418615", "text": "function playerPass(room) {\n let gameRoom = getRoom(room);\n // Send it to all players\n if (gameRoom) {\n let currentPlayerNumber = gameRoom.playPass();\n io.to(gameRoom.roomID).emit('nextTurn', currentPlayerNumber, gameRoom.lastPlayed);\n }\n}", "title": "" } ]
16e8188bf161f22cabc4ea3019603a46
Text nodes are stored as objects to keep things simple
[ { "docid": "b642b16f6efab6895ee4d302ad88955c", "score": "0.0", "text": "function createEmptyElement() {\n\t return {\n\t type: '#empty'\n\t };\n\t}", "title": "" } ]
[ { "docid": "57f0e2ec02902b1784227755376c4358", "score": "0.7606275", "text": "function TextNode(text) {\n this.text = text;\n}", "title": "" }, { "docid": "57f0e2ec02902b1784227755376c4358", "score": "0.7606275", "text": "function TextNode(text) {\n this.text = text;\n}", "title": "" }, { "docid": "3de2a4c28c8581a4132144a75ef7afea", "score": "0.745151", "text": "function TextNode(text) {\n\t this.text = text;\n\t}", "title": "" }, { "docid": "c52f43bc3e23a409b24831b347f51848", "score": "0.7176239", "text": "constructor(text) {\n this.text = text;\n this.endsWord = false;\n this.childNodes = new Map();\n }", "title": "" }, { "docid": "8baabbd886354607954f726cd1b557c1", "score": "0.7167045", "text": "function TTextNode(){}", "title": "" }, { "docid": "24a87e8b4d4dfebc1d153d9715c133aa", "score": "0.715141", "text": "function Text(XMLNode)\r\n{\r\n this.style = XMLNode.getAttribute(\"class\")\r\n this.views = this.LoadViews(XMLNode)\r\n}", "title": "" }, { "docid": "1ae361262fcbe6796518ef569e71b3d6", "score": "0.71342653", "text": "function TTextNode() {}", "title": "" }, { "docid": "1ae361262fcbe6796518ef569e71b3d6", "score": "0.71342653", "text": "function TTextNode() {}", "title": "" }, { "docid": "ece16b6e79f6b69a7fe4d300512c89d6", "score": "0.69559467", "text": "handleTextExpression(options){return new NodePart(options)}", "title": "" }, { "docid": "b0052935f98c21f4a28585f87d5f864a", "score": "0.69295305", "text": "function TTextNode() { }", "title": "" }, { "docid": "b0052935f98c21f4a28585f87d5f864a", "score": "0.69295305", "text": "function TTextNode() { }", "title": "" }, { "docid": "b0052935f98c21f4a28585f87d5f864a", "score": "0.69295305", "text": "function TTextNode() { }", "title": "" }, { "docid": "b0052935f98c21f4a28585f87d5f864a", "score": "0.69295305", "text": "function TTextNode() { }", "title": "" }, { "docid": "b0052935f98c21f4a28585f87d5f864a", "score": "0.69295305", "text": "function TTextNode() { }", "title": "" }, { "docid": "18d25b2a0127bec253d577e0526782a3", "score": "0.6817421", "text": "function createTextElement(text) { \n\treturn {\n\t\ttype: \"TEXT_ELEMENT\",\n\t\tprops: {\n\t\t\tnodeValue: text,\n\t\t\tchildren: []\n\t\t}\n\t}\n}", "title": "" }, { "docid": "600660a4b1c91f93a5e6cf1fe5cce9ab", "score": "0.67497283", "text": "function createTextElement(text) {\n\t return {\n\t type: '#text',\n\t nodeValue: text\n\t };\n\t}", "title": "" }, { "docid": "94c2febcb7ebdef154eb598c88c55ad8", "score": "0.67327094", "text": "handleTextExpression(e){return new NodePart(e)}", "title": "" }, { "docid": "c10e7fd3d6675b34aa2e18edeca6dde9", "score": "0.6649717", "text": "function createTextElement(text) {\n return {\n type: '#text',\n nodeValue: text\n };\n}", "title": "" }, { "docid": "c10e7fd3d6675b34aa2e18edeca6dde9", "score": "0.6649717", "text": "function createTextElement(text) {\n return {\n type: '#text',\n nodeValue: text\n };\n}", "title": "" }, { "docid": "965ac8d49cef2ab056c1398213b50306", "score": "0.66024005", "text": "text (text) {\n // act as getter\n if (text === undefined) {\n var children = this.node.childNodes\n var firstLine = 0\n text = ''\n\n for (var i = 0, len = children.length; i < len; ++i) {\n // skip textPaths - they are no lines\n if (children[i].nodeName === 'textPath') {\n if (i === 0) firstLine = 1\n continue\n }\n\n // add newline if its not the first child and newLined is set to true\n if (i !== firstLine && children[i].nodeType !== 3 && Object(_utils_adopter_js__WEBPACK_IMPORTED_MODULE_0__[\"adopt\"])(children[i]).dom.newLined === true) {\n text += '\\n'\n }\n\n // add content of this node\n text += children[i].textContent\n }\n\n return text\n }\n\n // remove existing content\n this.clear().build(true)\n\n if (typeof text === 'function') {\n // call block\n text.call(this, this)\n } else {\n // store text and make sure text is not blank\n text = text.split('\\n')\n\n // build new lines\n for (var j = 0, jl = text.length; j < jl; j++) {\n this.tspan(text[j]).newLine()\n }\n }\n\n // disable build mode and rebuild lines\n return this.build(false).rebuild()\n }", "title": "" }, { "docid": "655ccad18ef73974d666732940eb341c", "score": "0.6483371", "text": "function parseText() {\n var innerText = consumeWhile(isTextChar);\n return new TextNode(innerText);\n }", "title": "" }, { "docid": "a53a087a3f02e095602755f9b63efc1b", "score": "0.6443815", "text": "function text(){\n var att=['x', 'y', 'text'];\n var object = shape('text', att);\n\n // Override the function copy_shape mantaining the most part of\n // his code\n object.parent_copy_shape = object.copy_shape;\n object.copy_shape = function(target){\n this.parent_copy_shape(target);\n // Retrieve the 'text' and put it into the textarea\n var rows = [];\n var childs = target.childNodes;\n for (var n=0; n<childs.length; n++)\n // Between the child nodes, there are a lot of nodes\n // which are not useful (comments and any kind of\n // oddity), so take only the tspans\n if (childs[n].nodeName=='tspan')\n // Read the data of the textnode which is the first\n // child of the <tspan>\n rows.push(childs[n].childNodes[0].data);\n getById('textinput').value = rows.join('\\n');\n };\n\n object.mousedown = function(x, y){\n this.x = x;\n this.y = y;\n object.show_text_area(x, y);\n };\n\n object.server_create = function(par, id){\n this.create_group(id);\n var fill = par[1];\n var x = parseInt(par[2]);\n var y = parseInt(par[3]);\n if (id === undefined)\n //client call\n var content = unescape(unescape(par[4]));\n else\n //server call\n var content = unescape(par[4]);\n // Create the element (can't use create_element because this case\n // is not standard)\n this.element = document.createElementNS(svgns, 'text');\n sa(this.element, {'fill': fill, 'x':x, 'y':y});\n this.group.appendChild(this.element);\n var rows = content.split('\\n');\n // Process rows to create a <tspan> for each row. The vertical\n // coordinate ('y') will be incremented with rows\n for (var r=0; r < rows.length; r++){\n var tspan = document.createElementNS(svgns, 'tspan');\n // I found that characters like '<' are converted to their\n // corresponding HTML entities. I don't know if it is a\n // feature of the svgweb library or it is normal for\n // createTextNode. Differently, chat text is encoded to\n // HTML entities by the server-side code\n var tnode = document.createTextNode(rows[r], true);\n tspan.appendChild(tnode);\n tspan.setAttribute('x', x);\n tspan.setAttribute('y', y);\n this.element.appendChild(tspan);\n y = y + (g['fontSize']+1);\n }\n // In svgweb, text nodes can't inherit handlers from root like\n // other nodes do, so we have to add the handlers here\n if (svgweb.getHandlerType() == 'flash'){\n this.element.addEventListener('mousedown', handleMouseDown, false);\n this.element.addEventListener('mouseup', handleMouseUp, false);\n this.element.addEventListener('mousemove', handleMouseMove, false);\n }\n };\n return object;\n}", "title": "" }, { "docid": "7c9cbcf3754e0df8cf3ae243e4472fb0", "score": "0.6398532", "text": "get textContent() {\n return this.node.textContent;\n }", "title": "" }, { "docid": "e83b24052769f661af9439b0913031f9", "score": "0.63776106", "text": "text()\n\t{\n\t\tvar flat = [];\n\t\tthis.map( node => flat = flat.concat(Array.from( node.text()) )\t);\n\t\treturn new XMLList( flat );\n\t}", "title": "" }, { "docid": "bd440f91069aa823ba0ca629b823ff42", "score": "0.6347844", "text": "function asTextData(view, index) {\n return view.nodes[index];\n }", "title": "" }, { "docid": "bd440f91069aa823ba0ca629b823ff42", "score": "0.6347844", "text": "function asTextData(view, index) {\n return view.nodes[index];\n }", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.6344068", "text": "function TextParser() {}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.6344068", "text": "function TextParser() {}", "title": "" }, { "docid": "0523cc04000b953696b4447ca9b7b7fa", "score": "0.6344068", "text": "function TextParser() {}", "title": "" }, { "docid": "e4a60e426bf87602cf7305fd746d92cf", "score": "0.6336196", "text": "function createVirtualTextNode(el){return new VText(el.nodeValue);}", "title": "" }, { "docid": "16c48a5692c768d26ebf96d4efa508c0", "score": "0.6324988", "text": "constructor(node) {\n this.node = node;\n this.el = document.createElement('div');\n this.el.className = 'nodetext';\n this.node.el.appendChild(this.el);\n }", "title": "" }, { "docid": "239106d5d50a02dc46872b1d708354be", "score": "0.63037926", "text": "appendText(text, location) {\n this.childNodes.push(new text_1.TextNode(text, location));\n }", "title": "" }, { "docid": "0ec77fc4eeadbb0b693e31b93001b754", "score": "0.62666774", "text": "handleTextExpression(options) {\n return new NodePart(options);\n }", "title": "" }, { "docid": "6a17e12ebdb0ac3b88928bbe460c16cf", "score": "0.6250595", "text": "function TextData() {}", "title": "" }, { "docid": "6a17e12ebdb0ac3b88928bbe460c16cf", "score": "0.6250595", "text": "function TextData() {}", "title": "" }, { "docid": "53546509bb2254264b4769953d17561e", "score": "0.6246814", "text": "function createText(text) {\r\n return document.createTextNode(text);\r\n }", "title": "" }, { "docid": "307e69ae2bcdac39041c6d931a7071c2", "score": "0.62253845", "text": "function getNodes(text) {\n const parsed = Markdown.deserialize(text);\n const rendered = Markdown.serialize(parsed);\n const reparsed = Markdown.deserialize(rendered);\n return reparsed.document.nodes;\n}", "title": "" }, { "docid": "af8b96ca496812c2ec48a3e0fffbc94e", "score": "0.6223171", "text": "function TextData(){}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "1da5dfd5c5ca651a68a470b4433b8a49", "score": "0.6209866", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "387703ce7fdcfc27610036040092cd92", "score": "0.62078494", "text": "function text(txt) {\n return document.createTextNode(\"\" + txt);\n}", "title": "" }, { "docid": "907767c35cd83b20e5ed54d4a70923cb", "score": "0.62024343", "text": "function asTextData(view, index) {\n return view.nodes[index];\n}", "title": "" }, { "docid": "b4afdaefaddfa191c0acf2e85346a09c", "score": "0.61866117", "text": "text(node) {\n let oldValue;\n const textContent = value => {\n if (oldValue !== value) {\n oldValue = value;\n const type = typeof value;\n if (type === 'object' && value) {\n if (isPromise_ish(value)) {\n value.then(textContent);\n } else if ('placeholder' in value) {\n invokeAtDistance(value, textContent);\n } else if ('text' in value) {\n textContent(String(value.text));\n } else if ('any' in value) {\n textContent(value.any);\n } else if ('html' in value) {\n textContent([].concat(value.html).join(''));\n } else if ('length' in value) {\n textContent(slice.call(value).join(''));\n } else {\n textContent(Intent.invoke(value, textContent));\n }\n } else if (type === 'function') {\n textContent(value(node));\n } else {\n node.textContent = value == null ? '' : value;\n }\n }\n };\n return textContent;\n }", "title": "" }, { "docid": "8689fc39f7f681f06448745d4a77c9c1", "score": "0.6183269", "text": "function createTextFactory(type) {\n\t\ttype += 'Node';\n\n\t\treturn createText\n\n\t\t// Construct a `Text` from a bound `type`\n\t\tfunction createText(value, eat, parent) {\n\t\t\tif (value === null || value === undefined) {\n\t\t\t\tvalue = '';\n\t\t\t}\n\n\t\t\treturn (eat || noopEat)(value)(\n\t\t\t\t{\n\t\t\t\t\ttype: type,\n\t\t\t\t\tvalue: String(value)\n\t\t\t\t},\n\t\t\t\tparent\n\t\t\t)\n\t\t}\n\t}", "title": "" }, { "docid": "72129fde957b1c27d4c122b3e59ec6c7", "score": "0.6172975", "text": "function grabAllTextNodes(node, allText) {\n var\n childNodes = node.childNodes,\n length = childNodes.length,\n subnode,\n nodeType;\n while (length--) {\n subnode = childNodes[length];\n nodeType = subnode.nodeType;\n // parse emoji only in text nodes\n if (nodeType === 3) {\n // collect them to process emoji later\n allText.push(subnode);\n }\n // ignore all nodes that are not type 1, that are svg, or that\n // should not be parsed as script, style, and others\n else if (nodeType === 1 && !('ownerSVGElement' in subnode) &&\n !shouldntBeParsed.test(subnode.nodeName.toLowerCase())) {\n grabAllTextNodes(subnode, allText);\n }\n }\n return allText;\n }", "title": "" }, { "docid": "867413e09499c0341b75081e74bdbc5f", "score": "0.61607975", "text": "handleTextExpression(options) {\n return new NodePart(options);\n }", "title": "" }, { "docid": "aaf4e862be138ae54b688d21dda3fa53", "score": "0.6155806", "text": "handleTextExpression(options) {\n return new _parts.NodePart(options);\n }", "title": "" }, { "docid": "97b0120f2e512d2d53d3d3015181894d", "score": "0.6155192", "text": "function text(str) {\n return document.createTextNode(str);\n}", "title": "" }, { "docid": "1662985c8d2e8e65e5d3fa8b6ec94128", "score": "0.6152287", "text": "handleTextExpression(options) {\n return new parts_1.NodePart(options);\n }", "title": "" }, { "docid": "da40954b564909950b6cb4249fcaa4ab", "score": "0.6139708", "text": "handleTextExpression(options) {\n return new NodePart(options);\n }", "title": "" }, { "docid": "da40954b564909950b6cb4249fcaa4ab", "score": "0.6139708", "text": "handleTextExpression(options) {\n return new NodePart(options);\n }", "title": "" }, { "docid": "da40954b564909950b6cb4249fcaa4ab", "score": "0.6139708", "text": "handleTextExpression(options) {\n return new NodePart(options);\n }", "title": "" }, { "docid": "da40954b564909950b6cb4249fcaa4ab", "score": "0.6139708", "text": "handleTextExpression(options) {\n return new NodePart(options);\n }", "title": "" }, { "docid": "b12824f21e70413c5bc8e176eabba9d0", "score": "0.612878", "text": "set text(t){\n //prevent overwriting nodes\n if (this.container.childElementCount==0) this.container.innerText=t;\n }", "title": "" }, { "docid": "04ff47f793f50e152f615ec7222d8997", "score": "0.6116448", "text": "handleTextExpression(options) {\n\t return new NodePart(options);\n\t }", "title": "" }, { "docid": "5960b5e3f8d82dbcabaec742f7fe8be8", "score": "0.6112826", "text": "function textNode(node) {\n return nodeToString(node).trim();\n }", "title": "" }, { "docid": "595cac0d1de57e220df908b94f6056a5", "score": "0.61098504", "text": "function XmlText(value) {\n this.value = value;\n}", "title": "" }, { "docid": "595cac0d1de57e220df908b94f6056a5", "score": "0.61098504", "text": "function XmlText(value) {\n this.value = value;\n}", "title": "" }, { "docid": "305ece527c03bfcd97f018dcf89a0f49", "score": "0.6101791", "text": "function makeTextElement(text) {\n return document.createTextNode(text);\n}", "title": "" }, { "docid": "85d90dac3cb3f19d237b0a4693e86651", "score": "0.6095381", "text": "createNodeContent(text) {\n let innerText = document.createElement('p');\n innerText.innerText = text;\n\n let delButton = document.createElement('button');\n delButton.innerText = '-';\n delButton.setAttribute('data', 'del');\n\n let addButton = document.createElement('button');\n addButton.innerText = '+';\n addButton.setAttribute('data', 'add');\n\n innerText.appendChild(delButton);\n innerText.appendChild(addButton);\n\n return innerText;\n }", "title": "" }, { "docid": "ac7642b5b0121489c9a368e648a6766b", "score": "0.60867995", "text": "handleTextExpression(options) {\n return new parts_NodePart(options);\n }", "title": "" }, { "docid": "e362a95a60e91c5874fbf42f18c25c80", "score": "0.60730857", "text": "function createText(text) {\n // TODO\n txt = document.createTextNode(text);\n return txt;\n}", "title": "" }, { "docid": "878efd7260d7146183cea3f20596dc51", "score": "0.6069214", "text": "function VirtualText(content) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'text';\n this.content = content;\n }", "title": "" }, { "docid": "878efd7260d7146183cea3f20596dc51", "score": "0.6069214", "text": "function VirtualText(content) {\n /**\n * The type of the node.\n *\n * This value can be used as a type guard for discriminating the\n * `VirtualNode` union type.\n */\n this.type = 'text';\n this.content = content;\n }", "title": "" }, { "docid": "9c478b6797eeefac8a5f1c6086ff797c", "score": "0.6064572", "text": "function createTextFactory(type) {\n type += 'Node'\n\n return createText\n\n // Construct a `Text` from a bound `type`\n function createText(value, eat, parent) {\n if (value === null || value === undefined) {\n value = ''\n }\n\n return (eat || noopEat)(value)({type, value: String(value)}, parent)\n }\n}", "title": "" }, { "docid": "db7bb1af2d486d64a3daa84a9510662c", "score": "0.6056466", "text": "function deserialized(text) {\n return Markdown.deserialize(text).document.nodes\n //return Markdown.deserialize(Markdown.serialize(Markdown.deserialize(text))).document.nodes\n}", "title": "" }, { "docid": "87d2bb9649be6800ed9b9bef11f1d381", "score": "0.6055893", "text": "function getNodeText(e)\n{\n\tvar t = \"\";\n\twhile(e && e.nodeName == \"#text\") {\n\t\tt += e.nodeValue;\n\t\te = e.nextSibling;\n\t}\n\treturn t;\n}", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6052992", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6052992", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6052992", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6052992", "text": "function TextData() { }", "title": "" }, { "docid": "c6d366496c73f01747b07abcfe732e4c", "score": "0.6052992", "text": "function TextData() { }", "title": "" }, { "docid": "1b007bef851289d1b6fe18bb2b192904", "score": "0.6051782", "text": "function text(content) {\n\treturn document.createTextNode(content);\n}", "title": "" }, { "docid": "97a0cac078f2831b5acf3ce3a80a70d9", "score": "0.60357213", "text": "function getTextNodes() {\n var nodes = [];\n var walker = document.createTreeWalker(document, NodeFilter.SHOW_TEXT, null, null);\n var node = walker.nextNode();\n while (node) {\n nodes.push(node);\n node = walker.nextNode();\n }\n return nodes;\n}", "title": "" }, { "docid": "176d4be139c0383d6f3f77e3b3e8c9fe", "score": "0.6019119", "text": "static of(text) {\n if (text.length == 0)\n throw new RangeError(\"A document must have at least one line\");\n if (text.length == 1 && !text[0])\n return _Text.empty;\n return text.length <= 32 ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));\n }", "title": "" }, { "docid": "b7a4a3dcfb5b57abc70442e0b618c03a", "score": "0.6009239", "text": "static of(text) {\n if (text.length == 0)\n throw new RangeError(\"A document must have at least one line\");\n if (text.length == 1 && !text[0])\n return Text.empty;\n return text.length <= 32 /* Branch */ ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));\n }", "title": "" }, { "docid": "a8b503119e61cb54ab9674cc141282fb", "score": "0.5996815", "text": "function grabAllTextNodes(node, allText) {\r\n var\r\n childNodes = node.childNodes,\r\n length = childNodes.length,\r\n subnode,\r\n nodeType;\r\n while (length--) {\r\n subnode = childNodes[length];\r\n nodeType = subnode.nodeType;\r\n // parse emoji only in text nodes\r\n if (nodeType === 3) {\r\n // collect them to process emoji later\r\n allText.push(subnode);\r\n }\r\n // ignore all nodes that are not type 1 or that\r\n // should not be parsed as script, style, and others\r\n else if (nodeType === 1 && !shouldntBeParsed.test(subnode.nodeName)) {\r\n grabAllTextNodes(subnode, allText);\r\n }\r\n }\r\n return allText;\r\n }", "title": "" }, { "docid": "136ea63ad3e6de9a8c4809f8a7a010e1", "score": "0.5967902", "text": "function text(node) {\n return node && node.type === 'text'\n}", "title": "" }, { "docid": "d7323b08202816e944a5d6c7cfe9cdbc", "score": "0.59641", "text": "function Text(text, x, y) {\n this.font = \"20px Georgia\";\n this.text = text;\n this.x = x;\n this.y = y;\n this.ID = textObjects.length;\n this.color = 'black';\n textObjects.push(this);\n}", "title": "" }, { "docid": "856f733199cff7eb77e0ba68bf001e0b", "score": "0.59578264", "text": "function XmlText(value) {\n\t\t this.value = value;\n\t\t}", "title": "" }, { "docid": "c1077dc34903d4e3dd5789b7eef7eee7", "score": "0.59266263", "text": "function replaceAllText(startelem) {\n // Climb the object tree, replacing its text nodes with\n // new data.\n for (var i=0; i < startelem.childNodes.length; i = i + 1) {\n switch (startelem.childNodes.item(i).nodeType) {\n case 1: // Element nodetype\n replaceAllText(startelem.childNodes.item(i))\n break;\n case 3: // Text nodetype \n if (datacount < model.length) {\n setText(startelem.childNodes.item(i), model[datacount])\n datacount = datacount + 1\n } else {\n setText(startelem.childNodes.item(i),\" - ? - \")\n }\n break;\n } //endswitch\n } //endfor\n }", "title": "" }, { "docid": "79e7b0a37319c95ce3d9015a80014c19", "score": "0.59262896", "text": "function collectTextNodes(element, texts) {\n for (var child = element.firstChild; child !== null; child = child.nextSibling) {\n if (child.nodeType === 3)\n texts.push(child);\n else if (child.nodeType === 1)\n collectTextNodes(child, texts);\n }\n}", "title": "" }, { "docid": "d40175f9a99b951324ac0ce9a6e41736", "score": "0.5915363", "text": "function TextNodeEditor(doc)\n{\n this.initializeInline(doc);\n}", "title": "" }, { "docid": "d1e73dbba37b1fc1297010711c49d443", "score": "0.5905167", "text": "function _initialize(text) {\n _input = text;\n _childNodes = [];\n }", "title": "" }, { "docid": "bc9bd16292159ad889c5ae52219df445", "score": "0.5904685", "text": "function text(node) {\n return node && node.type === 'text';\n}", "title": "" }, { "docid": "03a16c624b82353e54cf655977d1fd0d", "score": "0.58921677", "text": "setText(viewRef, textNodeIndex, text) { }", "title": "" }, { "docid": "677d2eda9f925fd209da6e037976d114", "score": "0.58793074", "text": "function text(text) {\n return new Text(text);\n }", "title": "" }, { "docid": "7f637dce065fc9b08fc1dd1c80f6b8e7", "score": "0.5852516", "text": "function newTextNode(text,on) {\r\n var e = document.createTextNode(text);\r\n if (on) on.appendChild(e);\r\n return e;\r\n}", "title": "" }, { "docid": "077a8b04d821cdc23c294c9191da031e", "score": "0.5843051", "text": "function _textSpan(){return _textElements(\"span\",arguments)}", "title": "" }, { "docid": "077a8b04d821cdc23c294c9191da031e", "score": "0.5843051", "text": "function _textSpan(){return _textElements(\"span\",arguments)}", "title": "" }, { "docid": "43b8aa05a1fbad62066ffe5c930bab90", "score": "0.58299005", "text": "function parseNode() {\n // if the first char is a <, parse an Element\n // else parseText\n }", "title": "" } ]
34ef687e3af6057d6753ab79fc7b4cf5
Sends user input as an ajax post request to store as session data then send a get request to load the results page
[ { "docid": "961b32241f4cb183c933e2d431517247", "score": "0.6177837", "text": "function sendResults(data) {\n $.ajax({\n type: \"POST\",\n url: \"/calculated_risk_results\",\n dataType: \"json\",\n data: JSON.stringify(data),\n contentType: 'application/json',\n success: function (data) {\n $.ajax({\n type: \"GET\",\n data: data,\n success: function (){\n window.location.href = 'calculated_risk_results';\n }\n });\n }\n });\n}", "title": "" } ]
[ { "docid": "b573cb2fc99efa58a7b114201cd39100", "score": "0.6409644", "text": "function submitSession() {\n // Get selected presenterID\n var presenterSelect = document.getElementById(\"presenter-select\");\n var presenterID =\n presenterSelect.options[presenterSelect.selectedIndex].value;\n\n // Get selected roomID\n var roomSelect = document.getElementById(\"room-select\");\n var roomID = roomSelect.options[roomSelect.selectedIndex].value;\n\n // Pack in JSON object\n var jsonOBJ = {\n sessionName: document.getElementById(\"session-input\").value,\n startTime: document.getElementById(\"start-time\").value,\n endTime: document.getElementById(\"end-time\").value,\n presenterID: presenterID,\n roomID: roomID,\n };\n\n sendPostRequest(jsonOBJ, \"/sessionHandler/insert\");\n}", "title": "" }, { "docid": "c8c54b13b433a795074136ed8c9b2d2b", "score": "0.625664", "text": "function ajaxSage(input, buildAnswerDiv, index) {\n\t\tvar server = \"/submit\";\n\t\tvar data = { data : input, index: index };\n\t\tvar ajax = new XMLHttpRequest();\n\t\tajax.open(\"POST\", server, true);\n\t\tajax.setRequestHeader(\"Content-type\", \"application/JSON\");\n\t\tajax.onload = function() { \n\t\t\t displayAns(this.responseText, buildAnswerDiv); \n\t\t\t };\n\t\tajax.send(JSON.stringify(data));\n\t}", "title": "" }, { "docid": "52b80d2b298e5142c18e571e2e7b102d", "score": "0.6137297", "text": "function submit(){\n\tusername = $('#LoginId').val();\n\tpagesHistory.push(path + \"pages/insureAssistLogin.html\");\n\t/*\n\t * InsureAssistQuickQuote page is loaded and callCityAndManufacturerAPI is invoked\n\t * \n\t */\n\t$(\"#pagePort\").load(path + \"pages/InsureAssistQuickQuote.html\");\n\tcallCityAndManufacturerAPI();\n}", "title": "" }, { "docid": "bfad201e274ad1ffab03aa0134cc3f19", "score": "0.6114971", "text": "function requestSession() {\n\t$.ajax({\n url: \"rest/session_service/newSession/\"+userName,\n cache: false,\n dataType: \"json\",\n type: \"GET\",\n success: function(host) {\n \tconectToDefaultConsole(host);\n \tgetUserInfo();\n },\n error: function(error) {\n console.log(\"error updating table -\" + error.status);\n }\n });\n}", "title": "" }, { "docid": "e73233668ff0497f452e92d9b54643f8", "score": "0.6109433", "text": "function auth($username, $email, $password) {\n $result=-1;\n $.ajax({\n type: \"POST\",\n //SEND TO MY SERVER URL\n url: \"http://localhost:3000/users\",\n dataType: 'json',\n //async: false,\n data: { 'username': $username, 'email':$email,'password': $password ,'ent':-1,'lit':-1,'gk':-1,'tech':-1,'sports':-1},\n success: function (response) {\n //alert(hwllo);\n $.session.set('username', $username);\n $(window).attr('location', '../html/user_dash.html');\n console.log(response);\n }\n })\n}", "title": "" }, { "docid": "9d26cd32375f5454f229938166f63fad", "score": "0.6096942", "text": "function HandleBooking(postUrl) {\n\n var model = {\n Session: null,\n UserName: \"\"\n };\n\n if ($('input[name=\"Session\"]:checked').val()) {\n model.Session = $('input[name=\"Session\"]:checked').val();\n }\n\n model.UserName = $('#userName').val();\n\n if (model.UserName && model.Session) {\n\n $.ajax({\n url: postUrl,\n data: model,\n success: function (data) {\n alert(data);\n\n window.location.href = indexUrl;\n },\n error: function () {\n alert('error');\n }\n });\n }\n\n}", "title": "" }, { "docid": "3a8f4b06e1ec67fa144689e70cca8a8b", "score": "0.60929936", "text": "function saveValuesInSession(syncrequest) {\n\n // first check whether the user has inputed something in to formfields\n var params = {};\n\n params.posttext = Y.one('#posttext').get('value');\n params.togroupid = Y.one('#id_togroupid').get('value');\n\n var postelement = Y.one('#id_poststatus');\n if (postelement) {\n params.poststatus = postelement.get('value');\n } else {\n params.poststatus = 0;\n }\n\n params.postid = Y.one('#id').get('value');\n params.courseid = data.courseid;\n params.action = 'storeformparams';\n params.sesskey = M.cfg.sesskey;\n\n var url = M.cfg.wwwroot + '/course/format/mypdchat/ajax.php';\n\n Y.io(url, {\n data: params,\n sync: syncrequest\n });\n\n }", "title": "" }, { "docid": "0953f7da7cd9af127ab8f2cb864c5a03", "score": "0.6091993", "text": "function KeepSessionAlive() {\n $.ajax({\n type: \"GET\",\n url: \"/Index?handler=session\",\n contentType: \"application/json\",\n dataType: \"json\",\n success: function (response) {\n //nothing to do!\n },\n failure: function (response) {\n console.log(`failure ${JSON.stringify(response)}`);\n }\n });\n}", "title": "" }, { "docid": "dfbd07c50738a32bdd8e74130fd4a4de", "score": "0.6056097", "text": "create_session() {\n let email = $('#userEmail').val();\n let password = $('#userPassword').val();\n\n $.ajax(\"/api/v1/sessions\", {\n method: \"post\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: JSON.stringify({email: email, password: password}),\n success: (resp) => {\n store.dispatch({\n type: 'CREATE_SESSION',\n data: resp.data,\n });\n }\n });\n }", "title": "" }, { "docid": "1b6feb13ec428c9b876eee61aea91a54", "score": "0.6051754", "text": "function incorrect(){\n console.log(\"type=incorrect&state=\"+state+\"clicked=\"+this.id+\"&question=\"+questions[state]);\n $.ajax({\n url: \"scorereport\", // goes to https://user.tjhsst.edu/pckosek/kitchen\n type: \"get\", // use a 'get' type request\n data: \"type=incorrect&state=\"+state+\"&clicked=\"+this.id, //serialize form and pass to server\n success: function(response) {\n console.log(\"worked!\")\n },\n error: function (stat, err) {\n console.log(\"broken\")\n } \n });\n}", "title": "" }, { "docid": "c1d51a047deffc2669de54e71436fdb4", "score": "0.60161436", "text": "function getCart() {\n var userName = { email: JSON.parse(sessionStorage.getItem('user')).email };\n\n $.ajax({\n type: 'POST',\n url: '/get-cart',\n data: userName,\n dataType: 'json',\n success: function (cartData) {\n sessionStorage.setItem('cart-data', JSON.stringify(cartData));\n location.replace('/cart.html');\n },\n error: function (err) {\n alert(err);\n }\n });\n}", "title": "" }, { "docid": "e8e7464338580dee0f3230f6b8184745", "score": "0.59733886", "text": "function getSessionUser() {\n\tvar target = new XMLHttpRequest();\n\ttarget.onreadystatechange = function() {\n \tif (this.readyState == 4 && this.status == 200) {\n \t\tsession = this.response\n\t\t\tdocument.getElementById(\"send\").value = session;\n \t\tdocument.getElementById(\"profile\").innerHTML = '<a href=\"/profile?user='+session+'\">Profile</a>'\n \t\tupdatePersonalProfile(session)\n\n \t}\n }\ntarget.open(\"GET\", \"/returnSessionUser\", true);\ntarget.send();\n}", "title": "" }, { "docid": "acc9d3cda8dece7276ab2a4640c12d86", "score": "0.5969796", "text": "function doPost() {\n\t$.ajax({\n\t\t\turl: \"request\",\n\t\t\ttype: \"post\",\n\t\t\tdata: {\n\t\t\t\ttestString: $(\"#ts1\").val()\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\t$('#div1').html(data);\n\t\t\t}\n\t});\n\treturn false;\t\n}", "title": "" }, { "docid": "ec76eb2a6122f99e80a0ed836745b037", "score": "0.59445024", "text": "function getSessionData_ajax(loginToken) {\r\n var fd = new FormData();\r\n fd.append( 'login-token', loginToken);\r\n \r\n $.ajax({\r\n url: '/login/session-data',\r\n data: fd,\r\n processData: false,\r\n contentType: false,\r\n type: 'POST',\r\n success: function(data){\r\n if (\"error\" in data) {\r\n console.log(data)\r\n redirectLogin();\r\n } else {\r\n saveSessionData(data);\r\n document.dispatchEvent(loggedInEvent);\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "d658baf3f33ae94b2984d60f622abd18", "score": "0.5942011", "text": "login(url,data){\n var x= new XMLHttpRequest();\n x.onreadystatechange=function(){\n if((this.readyState==4)&&(this.status==200)){\n \t r=JSON.parse(x.response);\n console.log(x.responseText);\n console.log(toString(r.status));\n alert(r.msg);\n window.sessionStorage.username=r.username;\n\t\twindow.sessionStorage.user_id=r.user_id;\n\t\twindow.sessionStorage.type=r.type_user;\n if(r.url!=null){\n window.top.location.href=r.url;\n }\n }else{\n console.log(x.statusText);\n }\n}\n x.open(\"post\",url,true);\n x.setRequestHeader('Content-Type','application/Json');\n x.send(JSON.stringify(data));\n}", "title": "" }, { "docid": "a718fd953683f1e7b0dffd8747991a97", "score": "0.59414625", "text": "function submit()\n{\n inputname = document.getElementById(\"input_name\").value;\n var url = \"http://puigpedros.salleurl.edu/pwi/pac4/memory.php?token=\";\n url = url+uuid;\n\n ajaxPOST.request(url); \n\n document.getElementById(\"sendInformation\").style.display = \"none\";\n document.getElementById(\"tablero\").style.display = \"grid\";\n document.getElementById(\"tries\").style.display = \"block\";\n document.getElementById(\"cap\").style.display = \"block\";\n\n sleep(500).then(() => \n { \n throw window.location.assign('index.html');\n })\n}", "title": "" }, { "docid": "208b5592679420cf0e4f18e7317eb70b", "score": "0.5925946", "text": "function guestData(){\n\n\t\t\tjQuery.ajax({\n\t\t\t\ttype:'GET',\n\t\t\t\turl\t: space_settings.ajax_url,\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata:{\n\t\t\t\t\taction\t\t: 'space_survey_guest',\n\t\t\t\t\tsurvey_id \t: getSurveyID()\n\t\t\t\t},\n\t\t\t\tsuccess: function( response ){\n\n\t\t\t\t\t// SET GUEST ID WITHIN THE FORM\n\t\t\t\t\tsetGuestID( response.guest_id );\n\n\t\t\t\t\t//console.log( response.responses );\n\n\t\t\t\t\t// SET ANSWERS OF THE GUEST THAT WERE RECORDED PREVIOUSLY\n\t\t\t\t\tjQuery.each( response.responses, function( i, row ){\n\t\t\t\t\t\tsetAnswerForQuestion( row );\n\t\t\t\t\t});\n\n\t\t\t\t},\n\t\t\t\terror: function(response) {\n\t\t\t\t\tconsole.log( response.responseText );\n\t\t\t\t\tconsole.log( 'Cookie could not be created' );\n\t\t\t\t}\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "404e074c44780f88345f7b8af3c83a52", "score": "0.5906129", "text": "function request(url, data)\n{\n\txmlhttp = new XMLHttpRequest();\n\txmlhttp.open(\"POST\", url, false);\n\txmlhttp.send(data);\n\twindow.location.reload()\n}", "title": "" }, { "docid": "def2699adcfaa8710889612a475fbafd", "score": "0.58973104", "text": "function submitQuery() {\n\n // Grab the query from the page\n var query = $('#query').val();\n var idField = $('#id').val();\n\n // Launch an AJAX request to query the system\n var searchUrl = \"/search\";\n var ajaxRequest = $.getJSON(searchUrl, {\n 'query' : query,\n 'idField' : idField\n }, function(data) {\n handleResponse(data, query);\n });\n}", "title": "" }, { "docid": "ee4664c9d80be86e86d3c7497cc12d2d", "score": "0.58921003", "text": "function get_session_data(){\n $.post('http://localhost/wizardsmine/php/php-user-menu.php', function(data){\n\n var jsonObj = $.parseJSON(data); //All the variable get from the php file\n /* List of variables:\n * - login true if player has logged in and false if not\n *\n * When logged in also this variables:\n * - name the username\n * - id the users Id from the database\n */\n\n if (jsonObj.login == \"true\"){\n/* The user is logged on\n * - Change css that the logged on part will show\n * - Edit the inner text: name etc.\n * - Trigger logout button function\n */\n $(\".user-bar\").css({\n display: \"inline-block\"\n });\n\n var name = $(\"#name\");\n name.html(jsonObj.name);\n name.attr(\"href\", \"http://www.google.com/\");\n\n $(\"#user_id\").html(\"ID: \" + jsonObj.web_id);\n\n add_logout_event();\n\n } else {\n\n/* The user is NOT logged on\n * - Show the default user menu bar with the login and register button\n */\n $(\".user-bar-login\").css({\n display: \"inline-block\"\n });\n }\n });\n}", "title": "" }, { "docid": "a657efb8744209e12bb935a54293ae09", "score": "0.5875177", "text": "function post_submission(submission){\n \n //console.log(\"got into ajax_code_boolean_version\");\n\n //var user_id = \"<%= escape_javascript(session[:user_id]) %>\";\n\n //console.log(\"and the user id is: \" + user_id);\n\n // var params = { id: user_id , content: submission }; \n var params = { content: submission }; \n //var ret_val = true; //return value. default value is true (meaning that the user name is taken)\n\n $.ajax({\n type: \"POST\",\n url: \"/users/submit_post_helper/?format=json\",\n data: params,\n dataType: \"json\",\n traditional: true,\n async: false,\n success: function(data){\n \t\n document.getElementById(\"testing_page_text_box\").value = \"\";//clear text box\n\n display_posts(data);\n \n }\n\n });\n\n //return ret_val;\n\n}", "title": "" }, { "docid": "37950df88f48a124d1c2e0b9bf10a181", "score": "0.5871606", "text": "function request( data ) {\n\t\t$( '.loading' ).show();\n\t\t$.post( ajaxurl, data, function( r ) {\n\t\t\t$( '.loading' ).hide();\n\t\t\tshowResult( r );\n\t\t}, 'json' );\n\t}", "title": "" }, { "docid": "a3b67a826a58b729ac9df8f2633a7829", "score": "0.5861235", "text": "function searchPurchases(){\n try{\n //variable to make AJAX call\n var xhr = new XMLHttpRequest();\n \n //using POST method and using specific page\n xhr.open(\"POST\", PAGE_SEARCH_PURCHASES);\n\n //this means we are sending text only not media stuff\n xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');\n\n //this we take the value from our text box\n var searchedDate= document.getElementById('searchDate').value;\n var customer_uuid= document.getElementById('customer_uuid').value;\n\n //sending info to that page\n xhr.send(\"searchDate=\" + searchedDate+\"&customer_uuid=\"+customer_uuid);\n \n //this will check when its ready and add the result to specific location in the website\n xhr.onreadystatechange = function(){\n //when ajax call complete and without any erros means checking the page load correctly\n if(xhr.readyState == 4 && xhr.status == 200){\n //this will plug the html code returned by the search page\n document.getElementById(\"purchaseTableContainer\").innerHTML = xhr.responseText;\n }\n };\n \n }\n catch(error){ //will call the method to show the error\n handleError(error);\n }\n}", "title": "" }, { "docid": "e681d38cef75ad9cd57c83dfc9dbf4a1", "score": "0.5853995", "text": "function ajaxPost(url, data){\n $.ajax({\n type: \"POST\",\n url: url,\n data: data,\n dataType: 'json',\n success: function(response){\n //console.log(response);\n if(url == '/api/employees') {\n localStorage.setItem('userState', 1);\n localStorage.setItem('currentUser', JSON.stringify(response));\n location.href = '/visitors.html';\n }\n else if (url == '/api/companies') {\n localStorage.setItem('currentCompany', JSON.stringify(response));\n companyId = response._id;\n }\n },\n error: function(response){\n console.log(response);\n var resJSON = JSON.stringify(response);\n alert(jQuery.parseJSON(resJSON).responseText);\n event.preventDefault();\n location.href = '/signup.html';\n }\n });\n }", "title": "" }, { "docid": "c117f5cb27738bdaba147140a4f3cd24", "score": "0.585274", "text": "function quizStart() {\n\n var Username = sessionStorage.getItem(\"username\");\n if (Username == null || Username == '') {\n alert('You must be logged in, in order to access the Quiz. If you still don´t have an account, what are you waiting for ');\n } else {\n\n sessionStorage.setItem('quizhasStarted', 'true');\n sessionStorage.setItem('questionNumber', 0);\n $.ajax({\n type: \"GET\",\n url: \"./services/startQuiz.php\",\n data: {}, // passing the values\n success: function(res) {\n rex = res;\n\n if (rex != null && rex != '') {\n sessionStorage.setItem('questionsArray', rex);\n // alert(rex);\n }\n }\n });\n\n location.reload();\n\n }\n}", "title": "" }, { "docid": "063ad46aad3208abd4dc6af76f5cc6c6", "score": "0.5836905", "text": "function activityCheck(){\n console.log('activity Check');\n jQuery.ajax({\n type: \"POST\",\n url: 'sessionManage.php',\n dataType: 'json'});\n $('#messagesDataPanel').load(window.location.href + ' #messagesDataPanel');\n $('#loginPanel').load(window.location.href + ' #loginPanel');\n }", "title": "" }, { "docid": "a78da3ccac28864b92af69b54cfb8f67", "score": "0.5834276", "text": "function getDistDetails()\r\n{\r\n var url = \"./ajaxDist.jsp?param=\"; // The server-side script\r\n var statecode= document.forms[0].state.value;\r\n http.open(\"GET\", url + escape(statecode), true);\r\n http.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\");\r\n http.onreadystatechange = setDistDetails;\r\n http.send(null);\r\n}", "title": "" }, { "docid": "528e515d74d3eba84674dde6ac2c24e1", "score": "0.57999504", "text": "function submitData(){\n\n console.log(\"WE ARE SUBMITTING DATA \");\n\n jQuery.ajax({\n url : '/api/create',\n dataType : 'json',\n type : 'POST',\n // we send the data in a data object (with key/value pairs)\n data : {\n cupsPerWeek : cupsPerWeek,\n coffeeShop : coffeeShop,\n knowRecycleQuery : knowRecycleQuery,\n },\n success : function(response){\n // success\n console.log(response);\n\n // redirect the user once we get a response\n window.location.href = \"/result\";\n },\n\n error : function(err){\n // do error checking\n alert(\"something went wrong\");\n console.error(err);\n }\n });\n}", "title": "" }, { "docid": "daebf7bee8cba5139ee00665df8a4538", "score": "0.57932574", "text": "function rm_send_dummy_ajax_request(url){\r\n var data = {'action' : 'rm_dummy_refresh'};\r\n jQuery.post (rm_ajax_url, data, function(){\r\n if(url)\r\n window.location=url;\r\n else{\r\n //jQuery(\"#rm_ajax_login\").hide();\r\n //jQuery(\"#rm_ajax_after_login\").show();\r\n }\r\n }); \r\n}", "title": "" }, { "docid": "7b24995d94384359eef56b4fbc28a7b2", "score": "0.57837933", "text": "function get_user_data() {\n ajax_req(\n php_redir,\n \"\", \n get_succ, \n get_err\n );\n}", "title": "" }, { "docid": "61cb0ef1297e8a2af4650e05054e22d4", "score": "0.57827264", "text": "function passSearch(){\n var product= document.getElementById(\"productInput\").value;\n var city = document.getElementById(\"cityInput\").value;\n var startDate = document.getElementById(\"startDateInput\").value;\n var endDate = document.getElementById(\"endDateInput\").value;\n sessionStorage.setItem(\"product\", product);\n sessionStorage.setItem(\"city\",city);\n sessionStorage.setItem(\"startDate\",startDate);\n sessionStorage.setItem(\"endDate\",endDate);\n sessionStorage.setItem(\"option\",\"3\");\n window.open(\"SearchResult.html\");\n}", "title": "" }, { "docid": "f31dc20894ccc6580fb78e8c5a39f3c2", "score": "0.57713646", "text": "function editSession() {\n // Get selected presenterID\n var presenterSelect = document.getElementById(\"presenter-edit\");\n var presenterID =\n presenterSelect.options[presenterSelect.selectedIndex].value;\n\n // Get selected roomID\n var roomSelect = document.getElementById(\"room-edit\");\n var roomID = roomSelect.options[roomSelect.selectedIndex].value;\n\n // Pack in JSON object\n var jsonOBJ = {\n sessionID: document.getElementById(\"id-edit\").value,\n sessionName: document.getElementById(\"session-edit\").value,\n startTime: document.getElementById(\"start-edit\").value,\n endTime: document.getElementById(\"end-edit\").value,\n presenterID: presenterID,\n roomID: roomID,\n };\n\n sendPostRequest(jsonOBJ, \"/sessionHandler/update\");\n}", "title": "" }, { "docid": "b099abf2110e5f7d9f22f2104909c63e", "score": "0.5748766", "text": "function formSubmitted(event) {\n event.preventDefault();\n var url = \"http://omdbapi.com/?s=\" + $(\"#query\").val();\n $.get(url, resultsReceived);\n}", "title": "" }, { "docid": "b099abf2110e5f7d9f22f2104909c63e", "score": "0.5748766", "text": "function formSubmitted(event) {\n event.preventDefault();\n var url = \"http://omdbapi.com/?s=\" + $(\"#query\").val();\n $.get(url, resultsReceived);\n}", "title": "" }, { "docid": "b62584f52c7d8d12e2e0f375b3e8e1c8", "score": "0.5747585", "text": "post(url, data)\n {\n //------------------------------------------------------------------------------\n // Execut Ajax R\n $.ajax({\n type: \"POST\",\n url: url,\n data: data,\n cache: true,\n success: function(data){\n setTimeout(function() { window.location.reload(); }, 500);\n }\n });\n }", "title": "" }, { "docid": "a6caf66dea3808e29a358eb937c92572", "score": "0.57441777", "text": "function saveToSession(data){\n jQuery.ajax({\n dataType: \"json\",\n method: \"POST\",\n data: {'table':JSON.stringify(data)},\n url: \"api/saveTable\"\n });\n}", "title": "" }, { "docid": "f370d99de2f43c335cee5dd588c2b073", "score": "0.5725112", "text": "function saveResults()\n{\n // get values from FORM\n var request = {\n \"UserId\": $(\"input#userid\").prop(\"value\"),\n \"TemplateId\": $(\"input#template-id\").prop(\"value\"),\n \"Results\": []\n };\n var resultItems = request[\"Results\"];\n if (fillRequests(resultItems)) {\n $.ajax({\n type: \"POST\",\n url: \"result\",\n dataType: \"json\",\n data: request,\n success: function (data) {\n window.location.href = getBaseUrl() + \"/c/result/\" + data.Id;\n },\n });\n } else {\n alert(\"Please fill out all checklist items!\");\n }\n}", "title": "" }, { "docid": "4ee9485032bd9c30bce9c60d770ff579", "score": "0.57250005", "text": "function handleSessionState( action ) {\r\n\r\n\t// set hidden field\r\n\tdocument.getElementById('egHidden').name = action;\r\n\t\r\n\tvar xmlHttp = createXmlHttp();\r\n\tif( xmlHttp !== null ) {\r\n\t\t\r\n\t\tvar ajaxFuncName = \"checkSessionState\";\r\n\t\tvar ajaxFuncParm = userId;\r\n\t\t\r\n\t\turi = wgServer +\r\n\t\t\t((wgScript == null) ? (wgScriptPath + \"/index.php\") : wgScript) +\r\n\t\t\t\"?action=ajax\";\r\n\t\turi = uri + \"&rs=\" + ajaxFuncName + \"&rsargs[]=\" + ajaxFuncParm;\r\n\t\t\r\n\t\txmlHttp.open( \"GET\", uri, false );\r\n\t\txmlHttp.send();\r\n\t\t\r\n\t\tvar sessionState = xmlHttp.responseText;\r\n\t\tswitch( sessionState ) {\r\n\t\t\tcase \"SESSION_ACTIVE\":\r\n\t\t\t\tcontinueSubmit();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"SESSION_INACTIVE\":\r\n\t\t\t\tshowConfirmDiv( true );\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase \"SESSION_MISSING\":\r\n\t\t\t\tshowConfirmDiv( true );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t// unexpected response - continue form submission\r\n\t\t\t\tcontinueSubmit();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t} else {\r\n\t\tcontinueSubmit();\r\n\t}\r\n\t\r\n\treturn true;\r\n}", "title": "" }, { "docid": "c95efcc63292be1463834819bd53401a", "score": "0.57143176", "text": "function alcargar(){\n var logueado = sessionStorage.getItem(\"logueado\");\n if(!logueado){\n location.href = \"../pages/login.html\";\n }\n\n var clogin = sessionStorage.getItem(\"cuenta\");//cuenta logueada\n var saldo = document.getElementById('saldoact');//saldo actual de la cuenta\n var nombre = document.getElementById('username');//nombre + apellido\n var cuenta = document.getElementById('account');//numero cuenta\n cuenta.textContent = clogin;//no de cuenta logueada\n\n $.ajax({\n type:\"GET\",\n url:\"http://127.0.0.1:3000/versaldo/?act=\"+cuenta.textContent,\n crossDomain:true,\n success : function(data,status){\n if(status == 'success'){\n var json = JSON.parse(JSON.stringify(data).replace(\"RowDataPacket \",\"\"));\n saldo.textContent=json[0].saldoini;\n nombre.textContent=json[0].nombre+\" \"+json[0].apellido;\n }\n }\n });\n}", "title": "" }, { "docid": "c3ae77b0b03ba62953b6d50a6aff8fd3", "score": "0.5696209", "text": "function sendData() {\n\tconsole.log(\"Sending password data\"); \n\n\tconsole.log( yourPw1.value );\n\tconsole.log( yourPwImage1.src );\n\t\n\tconsole.log( yourPw2.value );\n\tconsole.log( yourPwImage2.src );\n\t\n\tconsole.log( yourPw3.value );\n\tconsole.log( yourPwImage3.src );\n\n\t//building the password data object to send to server\n\t//get the passwords from the page\n\tvar userData = {\n\t\tpass1: yourPw1.value,\n\t\tpassImage1: yourPwImage1.src,\n\t\t\n\t\tpass2: yourPw2.value,\n\t\tpassImage2: yourPwImage2.src,\n\t\t\n\t\tpass3: yourPw3.value,\n\t\tpassImage3: yourPwImage3.src\n\t\t\n\t\t\n\t}\n\t\n\t\n\t//send the password information to the server, and then runs function to load the testing page\n\t$.post(\"/submit\", userData, \n\tfunction(data) {\n\t\tconsole.log(\"response received, password data saved to database\");\n\t\tloadTestPage();\n\t});\n\t\n\t\n\t\n\t/*\n\t$.ajax({method: \"POST\", \n\t\t\tdata: userData,\n\t\t\t\n\t\t\tsuccess: function(data) {\n\t\t\t\tconsole.log(\"response received\");\n\t\t\t}\n\t});\n\t*/\n\t\n}", "title": "" }, { "docid": "92aff5bf48ea1c82ea09c172d2d4866c", "score": "0.5691597", "text": "function ajax_request() {\n // Send name and city via ajax request. Replace any spaces with underscores\n input_name_val = document.getElementById('park_name').value.split(\" \").join(\"_\");\n input_city_val = document.getElementById('park_city').value.split(\" \").join(\"_\");\n // load_val = '/parks/refresh?input_name=' + input_val\n load_val = '/parks/refresh?input_name=' + input_name_val + '&input_city=' + input_city_val;\n $('.dynamic').load(load_val);\n}", "title": "" }, { "docid": "0ae645eec9c3fc1fdfc91414e593698d", "score": "0.56910336", "text": "function submit_form(){\n\n // process answers\n // pack user's response in a dictionary structure and send to the server in JSON format\n // TODO: fill in the answers you'd like to send back to server\n answers = [];\n\n var ans = JSON.stringify(answers);\n var duration = ($.now()-init_time)/1000;\n duration = duration.toString();\n\n // set the resp to send back to the server here\n // the values to send to MTurk has already defined inside #mturk_form\n // if you don't need to bother to set value here\n resp =\n {\n // TODO: set the data to be submitted back to server\n };\n\n // post ajax request to server\n // if there's no backend to process the request, form can be directly submitted to MTurk\n $.ajax({\n type: \"POST\",\n // \"TODO: set the url of server to process the data\",\n url: \"\",\n data: {'resp':JSON.stringify(resp)}\n }).done(function(data) {\n $('#mturk_form').submit();\n });\n}", "title": "" }, { "docid": "5c8b4ba2271b2d77f4d1f48b790fc534", "score": "0.56873494", "text": "function startSession(id){\n $.ajax({\n type: \"POST\",\n url: \"../appRU/ajax/startSessionGAPI.php\",\n data: {\n id: id\n },success: function (data) {\n // redirect to programs\n location.href = '/appRU/pages_styled/programs.php';\n \n }\n });\n }", "title": "" }, { "docid": "9fc585571ca9d232ef9eb2ac2be1e40c", "score": "0.5678949", "text": "function sendAjaxPost() {\n\tconst token = $('input[name=_token]').val();\n\tconst email = $('input[name=email_reg]').val();\n\tconst username = $('input[name=username]').val();\n\tconst salutation = $( \"#salutations option:selected\" ).text();\n\tconst password = $('input[name=password]').val();\n\tconst password_confirmation = $('input[name=password_confirmation]').val();\n\t$.ajax({\n\t\turl:'/register',\n\t\ttype:'POST',\n\t\tdata: {_token: token, salutation: salutation, username: username, email: email, password: password, password_confirmation: password_confirmation},\n\t\tsuccess:function(data) {\n\t\t\t//nothing went wrong, so we refresh our page\n\t\t\tvar newDoc = document.open();\n\t\t\tnewDoc.write(data);\n\t\t\tnewDoc.close();\n\t\t},\n\t\terror: function (data, textStatus, jqXHR) {\n\t\t\t//something went wrong !\n\t\t\t//Convert Json format to array\n\t\t\tvar arr = Object.keys(data.responseJSON).map(function(k){ \n\t\t\t\treturn data.responseJSON[k];\n\t\t\t});\n\t\t\t//init a errorText to concat multiple errors\n\t\t\tvar errorText = \"\";\n\t\t\t//go through all the error messages and concat\n\t\t\tfor(i = 0; i < arr.length; i++) {\n\t\t\t\terrorText += arr[i] + \"\\n\";\n\t\t\t}\n\t\t\t//send the errorText to div paragraph\n\t\t\t$(\"#errors p\").text(errorText);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "cacd21386cdc62824056cf2cca68a50a", "score": "0.567866", "text": "function submitStuff()\n{\n $.ajax({\n crossDomain: false,\n type: 'post',\n url: '/do_archimedes',\n dataType:'json',\n data: collectData(),\n success: function (results)\n {\n //jsonResults = jQuery.parseJSON(results);\n drawResultTable(results);\n }\n });\n //surescripts API currently only returns data near minneapolis\n}", "title": "" }, { "docid": "4ecd3d952663f8a9c32e598bc6f1efde", "score": "0.5667564", "text": "function getDataFromSession() {\n var mx = session.getSession('mx'),\n mn = session.getSession('mn'),\n passengers = session.getSession('passengers'),\n activeTab = $('.flight-tabs .tab-block.active');\n\n arrivalTime = session.getSession('arrivalTime');\n departTime = session.getSession('departTime');\n source = session.getSession('source');\n dest = session.getSession('dest');\n\n if (departTime && source && dest) {\n activeTab.find('.source select').val(source);\n activeTab.find('.destination select').val(dest);\n activeTab.find('.depart-time input').val(departTime);\n activeTab.find('.arrival-time input').val(arrivalTime);\n activeTab.find('.passengers select').val(passengers);\n $sliderMin.html(mn);\n $sliderMax.html(mx);\n\n srchFilterHandler();\n }\n\n }", "title": "" }, { "docid": "5d067cfde6211592a6e561f9f26fe4db", "score": "0.56569576", "text": "function ajaxformSubmit(form)\n{\n \n var session;\n $.ajax({\n async: false,\n type: 'POST',\n url: 'checksession.htm',\n beforeSend: function()\n {\n },\n success: function(json)\n {\n if (json.check == \"true\")\n {\n session = \"true\"\n }\n else\n {\n session = \"false\";\n }\n }\n });\n \n if(session == \"false\")\n {\n window.location.reload();\n }\n \n var action = $(form).attr('action');\n var actionList = action.split(\"/\");\n action = actionList[2];\n var formid = $(form).attr('id');\n $(form).ajaxSubmit(\n {\n beforeSend:function()\n {\n $(\"#throbber\").show();\n },\n success: function(data)\n {\n $(\"#global_area_main_admin\").html(data);\n $(\"#throbber\").hide();\n },\n error: function (request, status, error)\n {\n $(\"#throbber\").hide();\n $(\"#message\").html('Updation failed');\n }\n });\n}", "title": "" }, { "docid": "aee2a6b7e85170a87aa312b379ec6130", "score": "0.56357384", "text": "function createMusician(){\n event.preventDefault();\n var musicianInfo = {\n email: emailInput.val().trim(),\n password: pw1.val().trim(),\n type: \"musician\"\n }\n //...And then adds it to the Musician table\n $.post(\"/signup/new-musician\", musicianInfo, function (musicianInfo) {\n //empty text boxes once submitted\n emailInput.val(\"\");\n pw1.val(\"\");\n pw2.val(\"\");\n //Stores submitted email into session storage\n //THIS IS WILL BE REMOVED WHEN WE FIGURE OUT AUTHENTICATION\n sessionStorage.setItem(\"email\", musicianInfo.email);\n //Alert page that new Musician is created\n //Eventually we will replace this alert with other things but this is to just let us know that everything went through\n alert(\"New Musician Created\");\n });\n\n\n}", "title": "" }, { "docid": "7c23185c5fd79b332256d0ba426bc317", "score": "0.5628704", "text": "function sendAjaxQuery(url, data) {\n $.ajax({\n url: url,\n data: data,\n dataType: 'json',\n type: 'POST',\n success: function (dataR) {\n // no need to JSON parse the result, as we are using\n // dataType:json, so JQuery knows it and unpacks the\n // object for us before returning it\n storeStoryData(dataR);\n\n // in order to have the object printed by alert\n // we need to JSON stringify the object;\n //document.getElementById('results').innerHTML= JSON.stringify(dataR);\n },\n error: function (xhr, status, error) {\n alert('Error: ' + error.message);\n }\n });\n}", "title": "" }, { "docid": "c115fd41096f86ecbeda8e6ba18afb2e", "score": "0.56240064", "text": "function get_request() {\n $.ajax({\n url: '/blogsPro/project/ajax/get_request.php',\n method: 'GET',\n success: function(data) {\n location.reload();\n $('.follow').html(data);\n \n }\n });\n }", "title": "" }, { "docid": "9a548e2cdb75fc865fed11657fe4ceed", "score": "0.56231284", "text": "function openSession(username, password){\n $.ajax({\n url: \"php/backend/verifyLogin.php\",\n type: \"POST\",\n datatype: \"json\",\n data: {\n username: username,\n password: password\n },\n success:goToHomePage,\n error: function(xhr){\n ajaxFailed('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);\n }\n });\n}", "title": "" }, { "docid": "91060a957d671d449be7416b5fde2258", "score": "0.5622191", "text": "function postPage(href, paramStr) {\n\tvar request = new XMLHttpRequest();\n\trequest.open('POST', href, false);\n\trequest.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );\n\trequest.send(paramStr);\n\n\tif(request.status == 200) {\n\t\treturn request.responseText;\n\t}\n\tconsole.log(\"help: sync ajax failed\");\n\treturn \"\";\n}", "title": "" }, { "docid": "a612bc297271796ad66281aadc02dddd", "score": "0.5615788", "text": "function user(reqType){\r\n var xhr = new XMLHttpRequest();\r\n\r\n var user = document.getElementById(\"uuser\").value;\r\n\r\n xhr.onreadystatechange = function(){\r\n if (xhr.readyState == 4 && xhr.status == 200 ) {\r\n document.getElementById(\"userreq\").innerHTML = xhr.responseText;\r\n }\r\n }\r\n xhr.open(\"POST\", \"Ajaxreq.php\", true);\r\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n xhr.send(\"reqType=\"+reqType+\"&user=\"+user); \r\n }", "title": "" }, { "docid": "a9239d6130a74c58e8f9fb19e3e731a6", "score": "0.56100404", "text": "function post_ajax(url, data) {\n var request = new XMLHttpRequest();\n request.open('POST', url, true);\n request.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n request.send(JSON.stringify(data));\n}", "title": "" }, { "docid": "e570c255fbb30d822c94c666c8482043", "score": "0.56073415", "text": "function request_search(form)\n{\n var url = './task.php';\n var title_val = form.taskInput.value;\n \n //call ready state changed and set is value to response\n ajax.onreadystatechange = request_response;\n ajax.open('POST', url, true);\n \n ajax.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n ajax.send('taskInput='+ title_val);\n}", "title": "" }, { "docid": "e823f62e6cb3ed0a063eaff140cff7dc", "score": "0.5601327", "text": "function saveResults() {\n console.log(\"Sending save request\");\n $.ajax({\n type: \"POST\",\n url: \"/quiz\",\n data: JSON.stringify(results),\n dataType: 'json'\n }).done(function (data) {\n console.log(data)\n console.log(\"Results Saved.\");\n\n });\n}", "title": "" }, { "docid": "3b88241ab85684f4ad84574c76fb6103", "score": "0.5600562", "text": "function setSessionVar(vSessionVar)\n{\n $.post(\n 'includes/libraries/sessionLibrary.php',\n { processor: 'setSessionVar', variable: vSessionVar },\n function(){\n }\n ).done(function(){\n \n });\n}", "title": "" }, { "docid": "287bf7936ffd6084d3637460ab6f2c7d", "score": "0.55956423", "text": "function loadSyncPost() {\r\n alert(\"login pressed\");\r\n var name = document.getElementById(\"NameInput\").value;\r\n var password = document.getElementById(\"PassInput\").value;\r\n var data = \"userName=\"+ name+ \"&password=\"+ password;\r\n var ajax = new XMLHttpRequest();\r\n\r\n ajax.open(\"POST\", \"http://universe.tc.uvu.edu/cs2550/assignments/PasswordCheck/check.php\", false);\r\n ajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\r\n ajax.send(data);\r\n jsonText = JSON.parse(ajax.responseText);\r\n //get div to dipslay output\r\n var dataDiv = document.getElementById(\"LoginR\");\r\n var userNDiv = document.getElementById(\"userNameDiv\");\r\n\r\n if (ajax.status == 200 && jsonText.result==\"valid\") {\r\n //get name, password and time stamp\r\n var loginText = jsonText.userName + \" \"+ jsonText.timestamp;\r\n //Stores user info in Local Storage\r\n window.localStorage.setItem(\"cs2550timestamp\", loginText);\r\n //displays success of login is accepted\r\n dataDiv.innerHTML = \"Login was successful!\";\r\n userNDiv.innerHTML = loginText;\r\n \r\n //when login succeed the sudoku grid window opens\r\n window.open(\"sudoku.html\");\r\n } else {\r\n //displays message if input was invalid\r\n dataDiv.innerHTML = \"Invalid user name and password.\";\r\n }\r\n}", "title": "" }, { "docid": "53208cba5bef839d6edd9d95c2ab0d5c", "score": "0.55778956", "text": "function sendData(data) {\n\n $.post(\"/games/data\", { \n query: data['query'], \n reference: data['reference'], \n guid: guidCookie(),\n correct : data['correct'],\n userEvents : JSON.stringify(window.userEvents)\n });\n clearUserEvents();\n }", "title": "" }, { "docid": "b2a2ed6d0b3c517f6db83ad408cac688", "score": "0.5574082", "text": "function serverPost(data){\n\n //var sessionData = JSON.parse(data);\n\n //console.log(\"sessionData is \" + sessionData);\n\n // now let's post it to the server\n request.post({\n headers: {'content-type' : 'application/x-www-form-urlencoded'},\n url: 'http://128.122.98.53:3000/Session/BroadwayWaverly/Update/',\n json: data\n }, function(error, response, body){\n console.log(\"******** the response from the server is ********\")\n console.log(body);\n console.log(\"the data measure we are sending is \" + data);\n getSessionResults(data.updates[0].measureName);\n });\n\n}", "title": "" }, { "docid": "67458d8333c4865c1eceaafa0cb7e6ae", "score": "0.55734104", "text": "function ajaxpost(email,password){\n\t\tvar request=new XMLHttpRequest();\n\t\tvar url=\"../php/Login.php\";\n\t\tvar send_data=\"email=\"+email+\"&password=\"+password;\n\t\trequest.open(\"POST\",url,true);\n\t\trequest.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n\t\trequest.onreadystatechange=function(){\n\t\t\tif(request.readyState ==4 && request.status ==200){\n\t\t\t\tvar data_return=request.responseText;\n\t\t\t\t//alert(data_return);\n\t\t\t\tif(data_return==1){\t\t\t//if email inncorrect\n\t\t\t\t\temailError.innerHTML=\"The email you entered doesn't appear belong to an account.Please check your email address and try again. \";\n\t\t\t\t\tdocument.getElementById(\"email\").style.borderColor=\"red\";\n\t\t\t\t}\n\t\t\t\telse if(data_return==2){\t// if password incorrect\n\t\t\t\t\tpasswordError.innerHTML=\"The password that you've entered is incorrect.Please try again.\";\n\t\t\t\t\tdocument.getElementById(\"password\").style.borderColor=\"red\";\n\t\t\t\t}\n\t\t\t\telse if(data_return==31){\t//if email & password is correct and user_type is advance\n\t\t\t\t\twindow.open(\"../html/MyAccount.html\",\"_self\");\t// don't use window.location() because firefox browser error,\n\t\t\t\t\tCookieUtil.set(\"user_type\",\"advanceuser\");\n\t\t\t\t\t//alert(CookieUtil.get(\"user_type\"));\n\t\t\t\t\t\t//to reload homepage to show alerady love & wishlist\n\t\t\t\t\t\tvar iframe=parent.document.getElementById(\"iframe\");\n\t\t\t\t\t\t\tiframe.src=\"displayPost.html\";\n\t\t\t\t\t\t\tiframe.name=\"home\";\n\t\t\t\t\t\tparent.document.getElementById('home').style.color=\"red\";\n\t\t\t\t\t\tparent.document.getElementById('category').style.color=\"blue\";\n\t\t\t\t\t\tforyou.style.display=\"block\";\n\t\t\t\t\t\tprofile.style.display=\"block\";\n\t\t\t\t\t\tpost.style.display=\"block\";\n\t\t\t\t\t\twishlist.style.display=\"block\";\n\t\t\t\t\t\torder.style.display=\"block\";\n\t\t\t\t}\n\t\t\t\telse if(data_return==32){\t//if email & password is correct and user_type is normal\n\t\t\t\t\twindow.open(\"../html/MyAccount.html\",\"_self\");\n\t\t\t\t\tCookieUtil.set(\"user_type\",\"normaluser\");\n\t\t\t\t\t//alert(CookieUtil.get(\"user_type\"));\n\t\t\t\t\t\t//to reload homepage to show alerady love & wishlist\n\t\t\t\t\t\tvar iframe=parent.document.getElementById(\"iframe\");\n\t\t\t\t\t\t\tiframe.src=\"displayPost.html\";\n\t\t\t\t\t\t\tiframe.name=\"home\";\n\n\t\t\t\t\t\tforyou.style.display=\"block\";\n\t\t\t\t\t\twishlist.style.display=\"block\";\n\t\t\t\t\t\tprofile.style.display=\"none\";\n\t\t\t\t\t\tpost.style.display=\"none\";\n\t\t\t\t\t\torder.style.display=\"none\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(\"Program Error......\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\trequest.send(send_data);\n\t}", "title": "" }, { "docid": "a59716559c91bb47ccd6d8e5ad6b84fb", "score": "0.556684", "text": "function getAddressDetails() {\n //Get request from server - get all profile details from DB\n var userName = {\n email: JSON.parse(sessionStorage.getItem('user')).email,\n }\n $.ajax({\n type: 'POST',\n url: '/profiledetails',\n data: userName,\n success: function (profile_details) {\n showAddressTabFields(profile_details);\n },\n error: function (err) { console.log(err); }\n });\n}", "title": "" }, { "docid": "adec304d2badd064fea927f0372ff8ab", "score": "0.55649835", "text": "function youthLeaderNewPosPostGet(pageid, unitID, ptr) {\n if (leaderNewList.length == ptr) {\n youthLeaderDone(unitID);\n return;\n }\n\n var scoutID = leaderNewList[ptr].scoutid;\n\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status != 200) {\n errStatusHandle(this.status, genError, [pageid, unitID, 'Youth Leadership'], youthLeaderNewPosPostGet, [pageid, unitID, ptr]);\n }\n if (this.readyState == 4 && this.status == 200) {\n resetLogoutTimer(url);\n servErrCnt = 0;\n //get the userMemberShipID\n var umID = ''; // code set, raw html is not set =$(':radio[name=UserMembershipID]:checked', this.response).val();\n\n\n var resphtml = $('html', this.response).html();\n\n var st = resphtml.indexOf(\":radio[id ^= userMembershipID\");\n var en = resphtml.indexOf('})', st);\n if (resphtml.slice(st, en).match(/val\\(\\) == (\\d+)/) != null) {\n umID = resphtml.slice(st, en).match(/val\\(\\) == (\\d+)/)[1];\n\n } else {\n if (resphtml.slice(st, en).match(/attr\\('data-unitid'\\) == (\\d+)/) != null) {\n var tid = resphtml.slice(st, en).match(/attr\\('data-unitid'\\) == (\\d+)/)[1];\n $(':radio[name=UserMembershipID]', this.response).each(function () {\n if ($(this).attr('data-unitid') == tid) {\n umID = $(this).val();\n }\n });\n } else {\n //alert('Processing error determining Scout Unit');\n genError(pageid, unitID, 'Processing error determining Scout MembershipID');\n return false;\n }\n }\n\n youthLeaderNewPosPost(pageid, unitID, ptr, umID);\n }\n };\n\n var url = 'https://' + host +'/mobile/dashboard/admin/position.asp?UserPositionID=&ScoutUserID=' + scoutID + '&AdultUserID=&UnitID=' + unitID + '&DenID=&PatrolID=';\n\n xhttp.open(\"GET\", url, true);\n xhttp.responseType = \"document\";\n xhttp.send();\n\n xhttp.onerror = function () {\n errStatusHandle(500, genError, [pageid, unitID, 'Youth Leadership'], youthLeaderNewPosPostGet, [pageid, unitID, ptr]);\n };\n}", "title": "" }, { "docid": "bae08d45ca9e0229ca4727e2dc3f2d71", "score": "0.5545883", "text": "function postNewStatus() {\n $('#new-status').on('submit', (e) => {\n\t\t\t$('.update-status').addClass('hide-display');\n e.preventDefault();\n let loggedInUser = localStorage.getItem('token');\n let username = localStorage.getItem('username');\n if (!(loggedInUser)) {\n alert('Please log in or register.');\n } else {\n let dateInput = $('#date').val();\n let textInput = $('#textbox').val();\n let dataInput = {\n date: dateInput,\n text: textInput,\n username: username\n };\n let htmlOutput = \"\";\n $.ajax({\n type: 'POST',\n data: JSON.stringify(dataInput),\n url: '/status',\n contentType: 'application/JSON',\n }).done((statuses) => {\n\t\t\t\t\t\t\t\t$('.update-status').addClass('hide-display');\n displayAllStatuses()\n }).fail((err) => {\n console.log(\"error\");\n });\n };\n });\n}", "title": "" }, { "docid": "9655de198c66262bccfaa222687d8f0f", "score": "0.5541539", "text": "function updateCart() {\n $.post('u2c_Cart?action=updateCart&sid=' + rnd(), $('#shopping_cart').serialize(),\n function(data) {\n $('#login_content').load('login.jsp?sid=' + rnd());\n $('#cart_content').html(data);\n }\n );\n}", "title": "" }, { "docid": "1db9e6ed8f5b633c40385a90d4856407", "score": "0.5539166", "text": "function viewAllSearchers(outputDiv){\r\n\tvar strSessionKey = $(\"#sessionKey\").val();\r\n\t\r\n\trequest = new Request;\r\n\trequest.addAction(\"viewAllSearchers\");\r\n\trequest.addSessionKey(strSessionKey);\r\n\t\r\n\tif (window.XMLHttpRequest)\r\n\t {// code for IE7+, Firefox, Chrome, Opera, Safari\r\n\t\txmlhttp=new XMLHttpRequest();\r\n\t }\r\n\telse\r\n\t {// code for IE6, IE5\r\n\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t }\r\n\t\r\n\t//send the parameters to the servlet with POST\r\n\t$(\"#feedback\").html(\"<h2>Sending Request</h2>\");\r\n\txmlhttp.open(\"POST\",\"../ServletProfile\" ,true);\r\n\txmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\r\n\txmlhttp.send(request.toString());\r\n\t\r\n\txmlhttp.onreadystatechange=function()\r\n\t {\r\n\t if (xmlhttp.readyState==4 && xmlhttp.status==200)\r\n\t {\r\n\t\t\t//parse XML response from server\r\n\t\t\tbuildJSListTb(\"profile\", outputDiv);\r\n\r\n\t }\r\n\t };\r\n\t}", "title": "" }, { "docid": "d74c0245879d2aa1861f5f5caf801c88", "score": "0.55382586", "text": "function submitWork() {\n //this part sends to the server the chosen option from the SELECT\n var selection = $('#poll').val();\n var rawSelect = $(\"#poll option:selected\").text();\n var name = $('#name').val();\n if (name === \"\" || name == \" \") {\n //no name given\n console.log(\"no input\");\n $('#noInput').fadeIn(\"slow\");\n setTimeout(function() {\n $('#noInput').fadeOut(\"slow\");\n }, 10000);\n } else {\n\n $.ajax({\n //URL MIGHT NEED TO BE CHANGED !\n type: \"GET\",\n url: \"../poll/pollHandler.php\",\n data: {\n selection: selection,\n name: name,\n rawSelect: rawSelect\n },\n datatype: \"html\",\n success: function(result) {\n console.log(result);\n //set cookie for the part's name\n setCookie(\"partName\", $('#name').val());\n setCookie(\"partTime\", rawSelect);\n\n },\n error: function(result) {\n alert(\"something went wrong, please try again later.\");\n console.error(result);\n }\n\n\n });\n }\n\n }", "title": "" }, { "docid": "1ca2fe277ae161194303db7961df54fb", "score": "0.5532068", "text": "function getResults() {\n\n var testId = $('#testId').val();\n var passwort = $('#passwort').val();\n\n try {\n if (testId !== \"\" && passwort !== \"\") {\n\n $.ajax({\n type: \"POST\",\n url: \"https://www.neurocare-aal.de/screening/functions/results.php\",\n data: {\n testId: testId,\n passwort: passwort\n }\n }).success(function (data) {\n $('#resultsText').html(data);\n $.mobile.changePage('#displayResults', {transition: \"slideup\"});\n\n }).fail(function (data) {\n $.mobile.changePage('#requestFailed', {transition: \"slideup\"});\n console.log(\"request failed!\" + testId + \" \" + passwort + data);\n\n })\n\n .done(function (data) {\n console.log(\"request successfull! \" + testId + \" \" + passwort);\n });\n }\n }\n\n catch (error) {\n console.log(\"Fehler beim Abfragen der Ergebnisse! \" + error);\n }\n\n}", "title": "" }, { "docid": "7e07f677d9b45e33b397e65a41b82116", "score": "0.5529514", "text": "function getSessionVar(vRequestedVariable)\n{\n var sessionVar;\n $.post(\n 'includes/libraries/sessionLibrary.php',\n { processor: 'getSessionVar', variable: vRequestedVariable },\n function(data) {\n sessionVar = data;\n }\n ).done(function(){\n return sessionVar;\n });\n}", "title": "" }, { "docid": "a620151c1de392944ac0f1804f4cd544", "score": "0.5529176", "text": "sendData(e){\n\t e.preventDefault();\n\t console.log(\"sending data\");\n\t\tthis.collectData();\n\t\tlet data = this.formatData();\n\t\tlet request = new Requests(\"POST\", this.response, this.respondedWithError);\n\t\trequest.dataType = \"form\";\n\t\trequest.send(\"/login\", data);\n\n\t}", "title": "" }, { "docid": "f5dc78615a61f571f20e722693b6b43a", "score": "0.55279386", "text": "function ajxSelectPostits() {\n serializedData = JSON.stringify({});\n jQuery.ajax({type: 'POST', url: \"ajxSelectPostit.php\", dataType: 'json', data: \"data=\" + serializedData,\n success: function(data) {\n ajxSelectPostitsDone(data);\n }\n });\n }", "title": "" }, { "docid": "8ad9ad0325fcc8587872f389cf2258f1", "score": "0.552723", "text": "function scraping(event) {\n event.preventDefault();\n $.get(\"/scrape\", function (data) {\n console.log(data);\n window.location = \"/\"\n });\n}", "title": "" }, { "docid": "f615614a9997e1244b2554fe28178dc0", "score": "0.5527081", "text": "function SubmitCart() {\n\n jQuery.ajax({ //make ajax request to cart_process.php\n url: \"cart_process.php\",\n type: \"POST\",\n dataType: \"json\", //expect json value from server\n data: \"save_to_db=true\",\n success: function (xhr) {\n if (xhr === true) {\n alert(\"Prenotazione eseguita con successo!, \\n grazie!\");\n window.location.href = \"dashboard.php\";\n } else\n alert(\"Spiacente, prenotazione non accettata \\nper favore riprova.\");\n }\n })\n }", "title": "" }, { "docid": "d63a48dbc41f42516b37d00810c5bc71", "score": "0.5521687", "text": "function questionSave(){\n // console.log(JSON.stringify(data));\n $.ajax({\n url: subUrl,\n type: 'post',\n dataType: 'json',\n contentType: 'application/json',\n success: function (responseData) {\n while(!responseData){\n\n }\n // window.location.replace(\"/question/\"+ learnId +\"/edit\");\n\n\n },\n data: JSON.stringify(data)\n });\n}", "title": "" }, { "docid": "e3047eaaa0a4af7ea38aab3bf5df0d7a", "score": "0.5519273", "text": "function runSearch() {\n var searchString = document.getElementById(\"search_inputs\");\n var searchedString = searchString.value;\n var searchObject = {\n searchString: searchedString\n };\n post(`/search`, searchObject);\n}", "title": "" }, { "docid": "adcda0afd0df72f347db0d29bc561012", "score": "0.5514711", "text": "function getResults() {\n\tvar data = document.getElementById(\"text\").value;\n\txhrPost(dataUrl, \"text\", data, function(responseText){\n\t\tdocument.getElementById('input').innerHTML = \"\";\n\t\tdocument.getElementById('result').innerHTML = resultHeader + responseText;\n\t}, function(err){\n\t\tconsole.log(err);\n\t});\n}", "title": "" }, { "docid": "175b9d3285d3a4d96aa58c71e648e2f5", "score": "0.55101544", "text": "function sendInput() {\n\n var data = JSON.stringify(frames);\n\n var xhr = new XMLHttpRequest();\n var url = window.location.href + \"post_case/\";\n\n xhr.onreadystatechange = function () {\n // Check if fetch request is done\n if (xhr.readyState == 4 && xhr.status == 200) {\n // Handle answer from server\n handleRes(xhr.responseText);\n }\n\n };\n xhr.open(\"POST\", url, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(data);\n}", "title": "" }, { "docid": "641059e9a0385107dd23d1b287988504", "score": "0.55067253", "text": "function getDesktopQuery() {\n // saves data to session storage\n src = document.getElementById('desktop_source').value;\n sessionStorage.setItem(\"source\", src);\n document.getElementById('desktop_source').value = \"\";\n dest = document.getElementById('desktop_destination').value;\n sessionStorage.setItem(\"destination\", dest);\n document.getElementById('desktop_destination').value = \"\";\n date = document.getElementById('desktop_date').value;\n sessionStorage.setItem(\"date\", date);\n document.getElementById('desktop_date').value = \"\";\n window.location.href = \"./search-result.html\";\n}", "title": "" }, { "docid": "9abfc4c30d29c19ec81ba81d387cc1e0", "score": "0.5501266", "text": "function getProfileDetails() {\n //Get request from server - get all profile details from DB\n\n var userName = {\n email: JSON.parse(sessionStorage.getItem('user')).email,\n }\n $.ajax({\n type: 'POST',\n url: '/profiledetails',\n data: userName,\n success: function (profile_details) {\n updateUserProfileFields(profile_details);\n },\n error: function (err) { console.log(err); }\n });\n}", "title": "" }, { "docid": "acb6edb949f0c3e788de5ce6ef257572", "score": "0.5494968", "text": "function accept_req(reqid) {\n var desc = $(\"#request-response-\"+reqid)[0].value;\n $.post('/it/accept_req/', {\n 'reqid': reqid,\n 'desc': desc,\n }, function(data) {\n if (data == \"ok\") {\n // refresh the page to update the view\n location.reload();\n } else {\n alert(\"Failed to do action: \" + data);\n }\n });\n}", "title": "" }, { "docid": "b53199b62091f30e3f96862d79150ba1", "score": "0.54939896", "text": "function reviewPost(index) {\n var reviewUrl = $(\"#news-url\").val();\n var url = \"/review/\" +reviewUrl;\n var request_method = \"POST\";\n var reviewTitle = $(\"#review-title\").val();\n var reviewContent = $(\"#review-content\").val();\n\n\n\n $.ajax({\n url: url,\n type: request_method,\n data:JSON.stringify({\"reviewTitle\" : reviewTitle, \"reviewContent\" : reviewContent, \"newsUrl\" : reviewUrl}),\n }).done(function (response) {\n window.location.href = response;\n });\n}", "title": "" }, { "docid": "0c435026e71ac3bfc88107e791a07953", "score": "0.5493942", "text": "function sendAjaxFromFormsToServer(data) {\r\n let json = JSON.stringify(data);\r\n\tcl(json);\r\n $.ajax({\r\n url: '../controllers/room_endpoint.php',\r\n dataType: 'json',\r\n type: 'post',\r\n contentType: 'application/x-www-form-urlencoded',\r\n data: {'data':json},\r\n success: function(data){\r\n if(data['result']) {\r\n\t\t\t\tlet current_location = window.location.href;\r\n window.location.replace(current_location + \"room/\" + data['result']);\r\n }\r\n },\r\n error: function(errorThrown){\r\n console.log( errorThrown );\r\n }\r\n });\r\n}", "title": "" }, { "docid": "c3ebacbcb24443a9a6de3e70dd287b1e", "score": "0.54847926", "text": "function getProfile () {\n let email = $('#loginEmail').val();\n let password = $('#loginPassword').val();\n let input = document.getElementsByTagName('input');\n let valid = document.getElementsByClassName('validText');\n let userData = {\n email: email,\n password: password\n };\n\n validField(input, valid);\n\n $.ajax({\n type: \"POST\",\n url: '/login',\n data: JSON.stringify(userData),\n dataType: 'json',\n contentType: 'application/json', \n })\n .done(function(response) {\n console.log(\"We have verified the user:\", response);\n window.currentUser = response;\n // navigate to profile page\n document.location.href = '/profile.html';\n })\n .fail(function(error) {\n console.log(\"It didnt post.\", error);\n });\n}", "title": "" }, { "docid": "151427e2f20d3911fe84946817474264", "score": "0.54835314", "text": "function submitTheForm(username, password) {\n\t$.ajax({\n \t context: this,\n url:'login',\n data:{'email':username,\n \t 'password': password},\n type:'POST',\n cache:false,\n success: function(data){\n \t//Front-end here.\n \taccPassMismatch(data);\n },\n error:function(){\n \tconsole.log(\"error searchResult.js\");\n }\n });\n}", "title": "" }, { "docid": "d50d3c109a8f91086f6799d7f2eb9949", "score": "0.54818404", "text": "function form_post(data, url, refreshElement, loadingOpt){\n if(loadingOpt)\n loadingStart();\n // now that it's loading let's send our request\n $.ajax({\n type: \"POST\",\n url: url,\n data: data,\n success: function(viewRendered) {\n // this function is suposed to receive a full view on the resonse\n // if refresh element is set the we must refresh it on success\n if (refreshElement){\n refreshElement[0].innerHTML = viewRendered;\n }\n loadingEnd();\n }.bind(refreshElement )\n ,\n error: function(XMLHttpRequest, textStatus, errorThrown) {\n console.error(\"Some error submiting the form...\" + errorThrown);\n }\n });\n return false;\n }", "title": "" }, { "docid": "e70c6561e6762aa5e529d0ffb5ee70aa", "score": "0.5476205", "text": "function evaluateSubmission() {\n //gives name based on question-id and returns value based on selected choice\n const form = $(\"form\").serializeArray();\n const mappedFormData = form.map(item => {\n const question_id = item.name.replace(\"question-id-\", \"\");\n return {\n 'question_id': question_id,\n 'answer': item.value\n }\n });\n const currentTopic = document.title.replace(' Layer Quiz', '');\n\n const bodyData = {\n topic: currentTopic,\n quizData: mappedFormData\n }\n $.ajax({\n url: '/submit-quiz',\n type: \"POST\",\n contentType: \"application/json\",\n dataType: \"json\",\n data: JSON.stringify(bodyData),\n }).done(result => {\n if (result.error) {\n processError();\n } else {\n processResults(result.data);\n resultsMode();\n }\n })\n}", "title": "" }, { "docid": "e3f24bdcde0b130c8374a9a3589690a2", "score": "0.54725707", "text": "function testSubmit(){\n\n // Takes the current url-path to a variable\n var pagepath = window.location.pathname;\n\n // Checks wheter the page is a schoolquestionform or a companyquestionform\n if ( jQuery(\"#schoolQuestForm\").length ) {\n var pageelem = document.getElementById('schoolQuestForm');\n var activefunction = 'school_question_insert';\n }\n\n if ( jQuery(\"#companyQuestForm\").length ) {\n var pageelem = document.getElementById('companyQuestForm');\n var activefunction = 'company_question_insert';\n }\n// TODO: setting the user to the right page\n // The questionsets are numbered so by adding to the pagenumber the script can create the new url.\n var pagenumber = parseInt(pageelem.dataset.pgnumber);\n var maxpages = parseInt(pageelem.dataset.maxpages);\n var newpagenumber = pagenumber + 1;\n\t\t\t// TODO : what\n if (newpagenumber <= maxpages + 1 ) {\n\t\t\tvar newpage = window.location.protocol;\n\t\t\tnewpage = newpage + \"//\" + window.location.hostname + \"/questionform\";\n } else {\n\t\t\tvar newpage = window.location.protocol;\n\t\t\tnewpage = newpage + \"//\" + window.location.hostname + \"/any_splash\";\n\n }\n // Ajax that sends the data to the corresponding PHP-function.\n\n var testData = jQuery(this).serialize();\n\n jQuery.ajax({\n\n url : questionFormFunctions.ajax_url,\n type : 'POST',\n data : {\n 'action' : activefunction,\n 'cont' : testData\n },\n success : function( response ) {\n // This redirects the page\n window.location.href = newpage;\n }\n });\n return false;\n }", "title": "" }, { "docid": "3d0c94564e6e24eb75ddf27d2f2cf5cd", "score": "0.54719627", "text": "function getuserName()\n{\n\tnew Ajax.Request(\"session.php\" , { onSuccess: onUpdateName});\n}", "title": "" }, { "docid": "4425f4a962ebe86ba6bc67c9877206e8", "score": "0.54657876", "text": "function submitReport() {\n var data = {\n uuid: getVisitorUUID(),\n path: window.location.pathname,\n id: websiteID\n };\n var vData = readOwnCookies();\n for (var key in vData) {\n if (vData.hasOwnProperty(key)) {\n data[key] = vData[key];\n }\n }\n $.post(apiURL, data);\n }", "title": "" }, { "docid": "6e7d71409440dab1d00599c9d963d892", "score": "0.54575586", "text": "function nextQuestion(answer, theory_id) {\n\n var userID = sessionStorage.getItem('user_id');\n var today = new Date();\n var date = new String();\n var dd = String(today.getDate()).padStart(2, '0');\n var mm = String(today.getMonth() + 1).padStart(2, '0');\n var yyyy = String(today.getFullYear());\n today = yyyy + '.' + mm + '.' + dd;\n date = today;\n\n $.ajax({\n type: \"POST\",\n url: \"./services/postQuizAnswer.php\",\n data: { user_id: userID, theory_id: theory_id, answer_date: date, answer: answer }, // passing the values\n success: function(res) {\n rex = res;\n if (rex == 'We were unable to post your answer. Please try again') {\n alert(rex);\n } else if (rex != null && rex != '') {\n // alert('Success + ' + rex);\n var currentQuestion = parseInt(sessionStorage.getItem('questionNumber'));\n var nextQuestion = currentQuestion + 1;\n sessionStorage.setItem(\"questionNumber\", nextQuestion);\n location.reload();\n }\n }\n });\n\n\n}", "title": "" }, { "docid": "29aa7d8f091cf2ce1b2739f2a47b31ab", "score": "0.5457393", "text": "function ajaxPost(currDate) {\r\n\t$.ajax(\"/injuryreporting\",{\r\n\t\tdata:{\r\n\t\t\temployeeId: getUrlParameter(\"employeeId\"),\r\n\t\t\treporterId: $(\"#reporterId\").html(),\r\n\t\t\tweatherId: $(\"#weatherSelect\").val(),\r\n\t\t\tbodyPartId: $(\"#bodyPartSelect\").val(),\r\n\t\t\tinjuryTypeId: $(\"#injuryTypeSelect\").val(),\r\n\t\t\treportDate: currDate,\r\n\t\t\treportManagementDate: $(\"#dateReported\").val(),\r\n\t\t\ttimeOfInjury: $(\"#timepicker\").val(),\r\n\t\t\tdescription: $(\"#description\").val()\r\n\t\t},\r\n\t\ttype:\"POST\",\r\n\t\tdataType:\"text\",\r\n\t\tsuccess: function(data){\r\n\t\t\twindow.location.href = \"/confirmation/\" + data;\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "1a42f8d75b94f9c669478036d597b219", "score": "0.5456522", "text": "function post_this()\n{\n\tvar order = $(\"#selSort\").val();\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"/ajax/set_order.php\",\n\t\tdata:'&sort='+order,\n\t\terror: function(){\n\t\t\talert('Registering sort order failed')\n\t\t},\n\t\tsuccess: function(data){\n\t\t\tif(data == 'OK')\n\t\t\t{\n\t\t\t\tlocation.reload(); \n\t\t\t}\n\t\t}\n\t})\n}", "title": "" }, { "docid": "af5304fc6f128f83f20295504cf8a358", "score": "0.5456274", "text": "function getRequest(){\nmakeRequest(getFavRequest,\"session.php\",null);\n}", "title": "" }, { "docid": "0c3e7af830512e0cc4ba511dbb394e17", "score": "0.5456156", "text": "function initPage(){\n $.post('http://dev.xpttk.com/ajax.php', {action: 'login_check'}, function(response){\n // user already logs in\n if(response.ok === '1'){\n $('.userImage').attr('src', response.user.image_small);\n $('.userName').html(response.user.name);\n \n $('.notLoggedIn').hide();\n $('.loggedIn').show();\n \n // reminder options radio button\n if(response.user.reminder === 'digit'){\n $('input:radio[value=digit]').attr('checked', true);\n }else{\n $('input:radio[value=popup]').attr('checked', true);\n }\n }\n // user not logged in\n else{\n $('.notLoggedIn').show();\n $('.loggedIn').hide();\n }\n return false;\n }, 'json');\n}", "title": "" }, { "docid": "a6aa92c6f77f7fa6a626a115f21141ff", "score": "0.5451154", "text": "function doLogin()\n{\n\tuserId = 0;\n\tfirstName = \"\";\n\tlastName = \"\";\n\t\n\tvar login = document.getElementById(\"loginName\").value;\n\tvar password = document.getElementById(\"loginPassword\").value;\n\t//parent=login;\n\t//var firstName = document.getElementById(\"firstName\").value;\n\t//var lastName = document.getElementById(\"lastName\").value;\n\tvar hash = md5( password );\n\tdocument.cookie = login;\n\tdocument.getElementById(\"loginResult\").innerHTML = \"\";\n\tjsonPayload = '{\"login\" : \"' + login + '\", \"password\" : \"' + hash + '\"}';\n\t//var jsonPayload = '{\"login\" : \"' + login + '\", \"password\" : \"' + hash + '\", \"firstName\" : \"' + firstName + '\", \"lastName\" : \"' + lastName + '\"}';\n//\tvar jsonPayload = '{\"login\" : \"' + login + '\", \"password\" : \"' + password + '\"}';\n\tvar url = urlBase + '/Login.' + extension;\n\t\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", url, false);\n\txhr.setRequestHeader(\"Content-type\", \"application/json; charset=UTF-8\");\n\ttry\n\t{\n\t\txhr.send(jsonPayload);\n\t\t\n\t\tvar jsonObject = JSON.parse( xhr.responseText );\n\t\t//alert(xhr.responseText);\t\n\t\tuserId = jsonObject.id;\n\t\t//sessionStorage.setItem('userID', userId);\n\n\t\tif( userId < 1 )\n\t\t{\n\t\t\tdocument.getElementById(\"loginResult\").innerHTML = \"User/Password combination incorrect\";\n\t\t\treturn;\n\t\t}\n\t\tfirstName = jsonObject.firstName;\n\t\tlastName = jsonObject.lastName;\n\n\t\tsaveCookie();\n\t\n\t\twindow.location.href = \"contacts.html\";\n\t}\n\tcatch(err)\n\t{\n\t\tdocument.getElementById(\"loginResult\").innerHTML = err.message;\n\t}\n\n}", "title": "" }, { "docid": "a0c7b0a93d2f1051bc0f50c374bff66a", "score": "0.544811", "text": "function submit() {\n var inputs = document.getElementsByClassName(\"FormField\");\n var parameters = {};\n for(var i=0;i<inputs.length;i++){\n parameters[inputs[i].name] = inputs[i].value;\n }\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = XMLHttpErrorHandler({\n onSuccess:function (responseText) {\n if((responseText).AccessToken){\n localStorage.setItem('accessToken',(responseText).AccessToken);\n if((responseText).RefreshToken){\n localStorage.setItem('refreshToken',(responseText).RefreshToken);\n }\n }\n if((responseText).redirectURL){\n window.location.href = ((responseText).redirectURL);\n }else if(URLparameters && URLparameters.hasOwnProperty('redirectURL') &&localStorage.getItem('accessToken')){\n window.location.href = (URLparameters.redirectURL + '?token=' + localStorage.getItem('accessToken') + '&isAuth=true');\n }else{\n window.location.href = ('/');\n }\n }\n });\n xhttp.open(\"POST\", (window.location.pathname+ window.location.search) );\n xhttp.setRequestHeader(\"Content-Type\", \"application/json;charset=UTF-8\");\n xhttp.send(JSON.stringify(parameters));\n}", "title": "" }, { "docid": "3c1e64b9a62a87d0552bfdad26e2e0f2", "score": "0.5446601", "text": "enterData() {\n $.ajax({\n url: '/submit',\n type: 'POST',\n data: this.state.userData,\n success: (data) => {\n console.log('Added morsel to db...', data);\n }, \n error: (data) => {\n console.log('Error: ', data)\n }\n });\n }", "title": "" }, { "docid": "5db290548f974924cb37cce10548db11", "score": "0.54463434", "text": "function getUserInput() {\n console.log('App loaded')\n $('form').on('submit', function (event) {\n event.preventDefault();\n let state = $('#js-state').val();\n let resultNum = $('#js-number').val();\n changeState(state);\n const getState = changeState(state);\n getParks(getState, resultNum);\n $('#results').empty();\n })\n}", "title": "" }, { "docid": "196838f68b00234e1eb1cc1ea70b97da", "score": "0.54456735", "text": "function post(url) {\r\n http = (window.XMLHttpRequest) ? new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n if(!http) return false;\r\n http.open(\"GET\", url, false); \r\n http.send(null); \r\n return http.responseText;\r\n\t \r\n}", "title": "" }, { "docid": "74676667b82c38961103722ae9b2d0c8", "score": "0.5435684", "text": "function submitDataToServer() {\n console.log(\"SUBMIT clicked!!!\"); // display a message on the console\n\n // create an object to post to the server\n // IMPORTANT: ONE NAME - VALUE PAIR FOR EACH FIELD\n let dataObj = {fname: document.getElementById(\"firstName\").value,\n sname: document.getElementById(\"surName\").value,\n wname: document.getElementById(\"email\").value,\n pname: document.getElementById(\"career\").value};\n\n // JUST USE THESE LINES AS THEY ARE - NO NEED TO CHANGE\n event.preventDefault(); // prevents 2 calls to this function!!\n const requestMsg = new XMLHttpRequest();\n requestMsg.open('post', '/putData', true);\n requestMsg.setRequestHeader('Content-Type', \"application/json;charset=UTF-8\");\n requestMsg.send(JSON.stringify(dataObj));\n \n document.getElementById(\"firstName\"). value = '';\n document.getElementById(\"surName\"). value = '';\n document.getElementById(\"email\"). value = '';\n document.getElementById(\"career\"). value = '';\n \t\n //need to update the screen so that the new user is displayed\n getDataFromServer();\n}", "title": "" } ]
0c732f0ad5017d68f92e79b6c6052675
A RPG games bread and butter
[ { "docid": "b66accf16034275feaf0f0ec40ce8c5f", "score": "0.0", "text": "function dice(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" } ]
[ { "docid": "7b22173564ea2346a67ca8ab5b4f997b", "score": "0.705599", "text": "function Rpg() {\n \n \n let game = new Game(1088, 832); // taille du jeu \n \n\n\n game.fps = 15; //fps game\n\n\n //scholar, banner, quest selector, to add\n\n //chargement image and music\n game.preload('img/Villager-6.gif','img/agitated.gif','img/grave1.gif','img/Fruit_Basket.gif',\n 'img/basket1.gif','img/Sheep.gif','img/jar5.gif','img/yellow_chocobo_weak.gif',\n 'img/palace_chair.gif','img/oven.gif','img/Blaze_Torch_Lit.gif',\n 'img/Ice_Pillar.gif','img/Cursed_Tree.gif','img/Entangled_Pillar.gif','img/woodman_weak.gif','img/Gabomba_Statue.gif',\n 'img/big_basket_wtr.gif','img/chocobo.gif','img/Chicken.gif','img/Growth.gif',\n 'img/Iris.gif','img/angel1.gif','img/Jupiter_Statue2.gif',\n 'img/Jupiter_Statue.gif','img/Sea_Gods_Tear.gif','img/statue_angel.gif','img/Izanami.gif','img/Hail.gif','img/Prison_Key.gif',\n 'img/Silence.gif','img/baum.png','img/Knowledge_Tree.png','img/Maha.gif','img/Teleport_Pad.gif',\n 'img/tree.png','img/Venus_Statue_Yellow.gif',\n 'img/Venus_Statue_Red.gif','img/Venus_Statue_Blue.gif','img/Scholar-2.gif','img/banner.gif',\n 'img/huh.gif','img/Exclamatory.gif', 'img/chara6',\n 'img/Kolima_Bridge.gif','img/monster6.gif',\n 'img/Villager7.gif', 'img/Apojii_House.gif', \n 'img/Saturos.gif','img/Venus_Djinn_Front.gif', 'img/skull.gif', \n 'img/Shell_Torch.gif', 'img/blazT.gif','img/sack1.gif', 'img/Dragon.gif', 'img/woodpile3.gif', \n 'img/Teepee.gif', 'img/Round_Rug2.gif', 'img/Karst_Fight.gif', 'img/flipped_jar.gif', \n 'img/Floating_Barrel.gif', 'img/Loho_Statue.gif', 'img/misc_pillar.gif', 'img/end-table.gif', 'img/Great_Healer.gif',\n 'img/Warrior.gif', 'img/Yi.gif', 'img/Turtle.gif', 'img/well2.gif', 'img/Kraden_Right.gif', \n 'img/Menardi_Walk_Up.gif', 'img/Bilibin_Statue.gif', 'img/Jenna_SW.gif','img/Menardi_Small.gif',\n 'img/sign2.gif', 'img/tiedup_villager.gif', 'img/sign3.gif', \n 'img/Mars_Statue.gif', 'img/Procne.gif', 'img/barrel7.gif', 'img/Sheba_Situp.gif', \n 'img/Hay_Bundle.gif', 'img/Felix_Situp.gif', 'img/fallen_Sheba.gif', \n 'img/Big_Stump2.gif', 'img/Mercury_Statue.gif', 'img/Venus_Aerie_Statue.gif', 'img/Kolima_Potion_Shop.gif', 'img/sign.gif',\n 'img/sword3.gif', 'img/Theif.gif', 'img/book.gif', 'img/Yallam_House.gif',\n 'img/8.png','img/9.png', 'img/Yallam_House.gif', 'img/Prox_Villager5.gif',\n 'img/2.png', 'img/6.png', 'img/Villager-2.gif', 'img/map1.png', 'img/chara6.png','img/chara5.png', 'img/monster6.gif', \n 'img/Mia_Left.gif', 'img/Apojii_Inn_Shop.gif', 'img/1.png', 'img/flame.gif',\n 'img/Condemn.gif','img/Kolima_Potion_Shop.gif', 'img/stone_face.gif', 'img/Yallam_Blacksmith.gif', 'img/Yallam_Inn.gif');\n\n \n game.preload('113 the white cloud in the sky.mp3');\n\n\n \n // Au chargement du jeu \n game.onload = function () {\n let map = new Map(16, 16); // new instance map \n map.image = game.assets['img/map1.png']; // ajout images au jeu\n map.loadData([\n \n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1,112,112,112,112,112,112, 7, 23, 23, 7,112,112,112,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,111,111,112,112,112,112,112, 7, 1, 1, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23,112,112,112,112,112,112,112, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 23, 23, 23, 23, 23, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 23, 23, 23, 23, 23, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 23, 23, 23, 7,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 23, 23, 23,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 83, 84, 83, 84, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,116,116,115,116, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,112,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 7,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7,112,112,112, 7, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 23, 23, 23, 23, 23, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 98, 98, 98, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 32, 0],\n \n \n \n \n \n \n \n ], [\n\n\n [ -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, 76, 77, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, 7, 7, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1,112,112, -1, -1, -1, -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,112,112, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1,112,112,112, -1, -1, -1, -1, -1, 76, 77, -1, 60, 61, 60, 61, 60, 61, 60, 61, -1, -1, -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1,112,112,112, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, 76, 77, 76, 77, -1, -1, -1, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ 60, 61, 60, 61, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, 76, 77, 76, 77, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, 60, 61, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, 76, 77, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99, 69, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 99,116, -1, -1, -1, 28, 28, 28, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 28, 28, 28, 28, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, 60, 61, 76, 77, 76, 77, -1, 60, 61, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 60, 61, 60, 61, 76, 77, 60, 61, -1, 60, 61, 76, 77, 60, 61, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, 76, 77, 76, 77, 60, 61, 76, 77, -1, 76, 77, -1, -1, 76, 77, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 76, 77, 60, 61, 60, 61, -1, 76, 77, 60, 61, 60, 61, 60, 61, 60, 61, -1, -1, -1],\n [ -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, -1, 76, 77, 60, 61, 76, 77, 76, 77, -1, 60, 61, 76, 77, 76, 77, 76, 77, 76, 77, -1, -1, -1],\n [ -1, -1, -1, -1, 76, 77, -1, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, -1, 60, 61, 60, 61, 60, 61, -1, -1, -1, -1, -1, 60, 61, 76, 77, 60, 61, -1, 76, 77, 60, 61, 60, 61, -1, 76, 77, 60, 61, 60, 61, -1, -1, -1, 60, 61, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, -1, 76, 77, 76, 77, 76, 77, -1, -1, -1, -1, -1, 76, 77, -1, -1, 76, 77, 60, 61, -1, 76, 77, 76, 77, -1, -1, -1, 76, 77, 76, 77, -1, -1, -1, 76, 77, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, -1, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [ -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, -1, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, 7, 23, 23, 23, 23, 23, 23, 23, 23, 23, 7, 23, 23, 23, 23, 7, -1, -1, -1, 7, 23, 23, 23, 23, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, 7,144,145,145,145,145,145,145,145,146, 7,144,145,145,146, 7, -1, -1, -1, 7,144,145,145,146, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, 7,160,161,161,161,161,161,161,161,162, 23, 23, 23, 23,162, 7, -1, -1, -1, 7,160,161,161,162, 7, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, 7,160,161,161,161,161,161,161,161,161,145,145,145,145,162, 7, -1, -1, -1, 7,160,161,161,162, 7, 60, 61, -1, -1, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,226,226,226,211,212,213,226,226,226, 7,160,161,161,161,161,161,161,161,161,161,161,161,161,162, 23, 23, 23, 23, 23,160,161,161,162, 7, 76, 77, 60, 61, -1, -1, 76, 77, 60, 61, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,197,226,226,227,228,229,226,226,226, 7,160,161,161,161,161,161,161,161,161,161,161,161,161,161,145,145,145,145,145,161, 60, 61,162, 7, 60, 61, 76, 77, -1, 60, 61, -1, 76, 77, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,210,226,226,243,244,245,226,226,226, 7,160,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, 76, 77,162, 7, 76, 77, 60, 61, -1, 76, 77, -1, -1, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,210,195,226,226,226,226,226,226,226, 7,176,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,178, 7, 60, 61, 76, 77, 60, 61, -1, -1, -1, 76, 77, 60, 61, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n [226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226,226, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 76, 77, -1, -1, 76, 77, -1, -1, -1, -1, -1, 76, 77, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n \n\n\n ]);\n\n map.collisionData = [\n\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 1, 1],\n [ 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, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 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, 1, 1, 1],\n [ 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, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1],\n [ 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, 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, 1, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 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, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 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, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 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, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1],\n [ 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, 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, 1, 1, 1, 0, 0, 0, 1, 1, 1],\n [ 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, 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, 1, 1, 1, 0, 0, 0, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1],\n [ 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1],\n [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1],\n \n\n\n\n ];\n\n\n // utiliser pour disposer des (sprites) class du framework # M\n\n // let foregroundMap = new Map(16, 16);\n // foregroundMap.image = game.assets['img/map1.png'];\n // foregroundMap.loadData([\n\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n // [ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1],\n\n // ]);\n\n game.score = 0;\n\n game.Musashi_Sound = game.assets['113 the white cloud in the sky.mp3']; // ajout son au jeu \n game.Musashi_Sound.play(); // lancement de la fonction son du framework \n\n //start-circle\n\n\n\n // instanciation à partir des images \n\n\n\n \n\n\n\n\n\n\n\n //Quest !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n //Silence Quest \n\n let silence_yoda = new Sprite(16, 16);\n silence_yoda.image = game.assets['img/Silence.gif'];\n silence_yoda.x = 10 * 27;\n silence_yoda.y = 10 * 46;\n silence_yoda.opacity = 1;\n\n\n let silence_chief = new Sprite(16, 16);\n silence_chief.image = game.assets['img/Silence.gif'];\n silence_chief.x = 10 * 104;\n silence_chief.y = 10 * 14;\n silence_chief.opacity = 1;\n\n\n\n let silence_chaman = new Sprite(16, 16);\n silence_chaman.image = game.assets['img/Silence.gif'];\n silence_chaman.x = 10 * 88;\n silence_chaman.y = 10 * 10;\n silence_chaman.opacity = 0;\n\n\n \n let silence_Statue_Aquarius = new Sprite(16, 16);\n silence_Statue_Aquarius.image = game.assets['img/Silence.gif'];\n silence_Statue_Aquarius.x = 10 * 96;\n silence_Statue_Aquarius.y = 10 * 26;\n silence_Statue_Aquarius.opacity = 0;\n\n\n\n let silence_Cupidon = new Sprite(16, 16);\n silence_Cupidon.image = game.assets['img/Silence.gif'];\n silence_Cupidon.x = 10 * 31;\n silence_Cupidon.y = 10 * 74;\n silence_Cupidon.opacity = 0;\n\n\n\n\n let silence_Husim = new Sprite(16, 16);\n silence_Husim.image = game.assets['img/Silence.gif'];\n silence_Husim.x = 10 * 50;\n silence_Husim.y = 10 * 69;\n silence_Husim.opacity = 0;\n\n\n let silence_flame = new Sprite(16, 16);\n silence_flame.image = game.assets['img/Silence.gif'];\n silence_flame.x = 10 * 27;\n silence_flame.y = 10 * 71;\n silence_flame.opacity = 0;\n\n\n\n\n\n\n\n\n\n\n\n //Exclamatory \n\n\n\n let excla_yoda = new Sprite(16, 16);\n excla_yoda.image = game.assets['img/Exclamatory.gif'];\n excla_yoda.x = 10 * 27;\n excla_yoda.y = 10 * 46;\n \n\n let excla_yoda_2 = new Sprite(16, 16);\n excla_yoda_2.image = game.assets['img/Exclamatory.gif'];\n excla_yoda_2.x = 10 * 76;\n excla_yoda_2.y = 10 * 66;\n excla_yoda_2.opacity = 0;\n\n\n\n\n\n let excla_chaman = new Sprite(16, 16);\n excla_chaman.image = game.assets['img/Exclamatory.gif'];\n excla_chaman.x = 10 * 88;\n excla_chaman.y = 10 * 10;\n excla_chaman.opacity = 0;\n\n\n let excla_chaman_2 = new Sprite(16, 16);\n excla_chaman_2.image = game.assets['img/Exclamatory.gif'];\n excla_chaman_2.x = 10 * 74;\n excla_chaman_2.y = 10 * 66;\n excla_chaman_2.opacity = 0;\n\n \n \n let excla_Hino = new Sprite(16, 16);\n excla_Hino.image = game.assets['img/Exclamatory.gif'];\n excla_Hino.x = 10 * 11;\n excla_Hino.y = 10 * 38;\n excla_Hino.opacity = 0;\n \n \n\n\n \n \n \n let excla_chief = new Sprite(16, 16);\n excla_chief.image = game.assets['img/Exclamatory.gif'];\n excla_chief.x = 10 * 104;\n excla_chief.y = 10 * 14;\n\n \n let excla_Jenna = new Sprite(16, 16);\n excla_Jenna.image = game.assets['img/Exclamatory.gif'];\n excla_Jenna.x = 10 * 93;\n excla_Jenna.y = 10 * 25;\n excla_Jenna.opacity = 0;\n\n\n \n\n let excla_warrior = new Sprite(16, 16);\n excla_warrior.image = game.assets['img/Exclamatory.gif'];\n excla_warrior.x = 10 * 84;\n excla_warrior.y = 10 * 50;\n excla_warrior.opacity = 0;\n\n\n\n let excla_Sainte = new Sprite(16, 16);\n excla_Sainte.image = game.assets['img/Exclamatory.gif'];\n excla_Sainte.x = 10 * 77;\n excla_Sainte.y = 10 * 38;\n excla_Sainte.opacity = 0;\n\n\n let excla_Phenix = new Sprite(16, 16);\n excla_Phenix.image = game.assets['img/Exclamatory.gif'];\n excla_Phenix.x = 10 * 86;\n excla_Phenix.y = 10 * 30;\n excla_Phenix.opacity = 0;\n\n \n let excla_Aquarius = new Sprite(16, 16);\n excla_Aquarius.image = game.assets['img/Exclamatory.gif'];\n excla_Aquarius.x = 10 * 105;\n excla_Aquarius.y = 10 * 22;\n excla_Aquarius.opacity = 0;\n\n\n let excla_Nehemiel = new Sprite(16, 16);\n excla_Nehemiel.image = game.assets['img/Exclamatory.gif'];\n excla_Nehemiel.x = 10 * 53;\n excla_Nehemiel.y = 10 * 72;\n excla_Nehemiel.opacity = 0;\n\n\n\n let excla_Ananai = new Sprite(16, 16);\n excla_Ananai.image = game.assets['img/Exclamatory.gif'];\n excla_Ananai.x = 10 * 37;\n excla_Ananai.y = 10 * 65;\n excla_Ananai.opacity = 0;\n\n\n let excla_Izanami = new Sprite(16, 16);\n excla_Izanami.image = game.assets['img/Exclamatory.gif'];\n excla_Izanami.x = 10 * 21;\n excla_Izanami.y = 10 * 65;\n excla_Izanami.opacity = 0;\n\n\n let excla_Pillar = new Sprite(16, 16);\n excla_Pillar.image = game.assets['img/Exclamatory.gif'];\n excla_Pillar.x = 10 * 1;\n excla_Pillar.y = 10 * 72;\n excla_Pillar.opacity = 0;\n\n\n\n \n\n\n\n\n\n\n\n\n //Interogative !!!!!!!!!!!!!!!!!!!!!!!!!!\n\n \n \n let inter_brother_sainte = new Sprite(16, 16);\n inter_brother_sainte.image = game.assets['img/huh.gif'];\n inter_brother_sainte.x = 10 * 78;\n inter_brother_sainte.y = 0;\n inter_brother_sainte.opacity = 0;\n\n\n\n\n let inter_aquarius = new Sprite(16, 16);\n inter_aquarius.image = game.assets['img/huh.gif'];\n inter_aquarius.x = 10 * 74;\n inter_aquarius.y = 0;\n inter_aquarius.opacity = 0;\n\n\n\n\n\n\n //TP ring !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n let Tp_hell = new Sprite(64, 48);\n Tp_hell.image = game.assets['img/Teleport_Pad.gif'];\n Tp_hell.x = 10 * 36;\n Tp_hell.y = 10 * 74;\n Tp_hell.opacity = 0.2;\n\n\n \n\n\n\n \n \n \n\n\n\n\n\n //###################################\n // SACRED FOREST\n\n\n\n\n let Knowledge_tree = new Sprite(281, 255);\n Knowledge_tree.image = game.assets['img/Knowledge_Tree.png'];\n Knowledge_tree.x = 10 * 86;\n Knowledge_tree.y = 10 * 49;\n \n\n let Guardian_tree = new Sprite(128, 128);\n Guardian_tree.image = game.assets['img/baum.png'];\n Guardian_tree.x = 10 * 77;\n Guardian_tree.y = 10 * 61;\n Guardian_tree.opacity = 1;\n\n\n let Gaia_statue = new Sprite(64, 64);\n Gaia_statue.image = game.assets['img/Gabomba_Statue.gif'];\n Gaia_statue.x = 10 * 87;\n Gaia_statue.y = 10 * 63;\n Gaia_statue.opacity = 1;\n \n \n let Little_Ent = new Sprite(34, 36);\n Little_Ent.image = game.assets['img/woodman_weak.gif'];\n Little_Ent.x = 10 * 93;\n Little_Ent.y = 10 * 69;\n Little_Ent.opacity = 1;\n\n let Baby_Ent = new Sprite(26, 32);\n Baby_Ent.image = game.assets['img/Cursed_Tree.gif'];\n Baby_Ent.x = 10 * 100;\n Baby_Ent.y = 10 * 70;\n Baby_Ent.opacity = 1;\n \n \n \n\n let Pillar_Forest = new Sprite(19, 43);\n Pillar_Forest.image = game.assets['img/Entangled_Pillar.gif'];\n Pillar_Forest.x = 10 * 86;\n Pillar_Forest.y = 10 * 76;\n Pillar_Forest.opacity = 0.90;\n \n\n\n let Pillar_Forest_enter = new Sprite(19, 43);\n Pillar_Forest_enter.image = game.assets['img/Entangled_Pillar.gif'];\n Pillar_Forest_enter.x = 10 * 77;\n Pillar_Forest_enter.y = 10 * 65;\n Pillar_Forest_enter.opacity = 1;\n Pillar_Forest_enter.scaleX = Math.sin(30);\n Pillar_Forest_enter.opacity = 0.90;\n\n\n let Pillar_Forest_south = new Sprite(19, 43);\n Pillar_Forest_south.image = game.assets['img/Entangled_Pillar.gif'];\n Pillar_Forest_south.x = 10 * 77;\n Pillar_Forest_south.y = 10 * 72;\n Pillar_Forest_south.opacity = 0.90;\n Pillar_Forest_south.scaleX = Math.sin(30);\n\n\n\n\n\n\n\n\n\n\n\n\n\n // sorcerer shop etc\n\n let Sorcerer = new Sprite(32, 32);\n Sorcerer.image = game.assets['img/Maha.gif'];\n Sorcerer.x = 10 * 49;\n Sorcerer.y = 10 * 5;\n \n\n\n\n\n let kolima_shop = new Sprite(144, 112);\n kolima_shop.image = game.assets['img/Kolima_Potion_Shop.gif'];\n kolima_shop.x = 10 * 55;\n kolima_shop.y = 10 * 11;\n\n\n\n\n\n\n\n\n\n\n //South-East forest \n\n // let Tree_1 = new Sprite(65, 86);\n // Tree_1.image = game.assets['img/tree.png'];\n // Tree_1.x = 10 * 80;\n // Tree_1.y = 10 * 50;\n \n\n\n\n\n\n\n\n //fashion & items quest castle \n let banner_castle = new Sprite(16, 26);\n banner_castle.image = game.assets['img/banner.gif'];\n banner_castle.x = 10 * 51;\n banner_castle.y = 10 * 14;\n\n\n let blazT = new Sprite(16, 24); // new instance sprite \n blazT.image = game.assets['img/blazT.gif']; //ajout image au jeu \n blazT.x = 10 * 79; // positionnement en x de l'objet\n blazT.y = 10 ; // positionnement en y de l'objet \n \n\n let Round_Rug2 = new Sprite(32, 24);\n Round_Rug2.image = game.assets['img/Round_Rug2.gif'];\n Round_Rug2.x = 10 * 62;\n Round_Rug2.y = 10;\n \n\n\n\n\n\n\n\n\n\n //teepee & bandit\n\n\n let Teepee = new Sprite(48, 61);\n Teepee.image = game.assets['img/Teepee.gif'];\n Teepee.x = 10 * 13;\n Teepee.y = 10 * 30;\n\n let ElBarto = new Sprite(32, 32);\n ElBarto.image = game.assets['img/Karst_Fight.gif'];\n ElBarto.x = 10 * 13;\n ElBarto.y = 10 * 35;\n \n\n let Jar = new Sprite(16, 14);\n Jar.image = game.assets['img/flipped_jar.gif'];\n Jar.x = 10 * 11;\n Jar.y = 10 * 43;\n\n\n\n let Chicken = new Sprite(32, 32);\n Chicken.image = game.assets['img/Chicken.gif'];\n Chicken.x = 10 * 10;\n Chicken.y = 10 * 49;\n\n\n let Chicken2 = new Sprite(32, 32);\n Chicken2.image = game.assets['img/Chicken.gif'];\n Chicken2.x = 10 * 15;\n Chicken2.y = 10 * 52;\n Chicken.scaleX = Math.sin(30);\n\n\n let Sea_barrel = new Sprite(24, 24);\n Sea_barrel.image = game.assets['img/Floating_Barrel.gif'];\n Sea_barrel.x = 10 * 106;\n Sea_barrel.y = 10 * 13;\n\n let tiedup_villager = new Sprite(31, 32);\n tiedup_villager.image = game.assets['img/tiedup_villager.gif'];\n tiedup_villager.x = 10 * 78;\n tiedup_villager.y = 10;\n tiedup_villager.opacity = 1;\n\n let Warrior = new Sprite(31, 32);\n Warrior.image = game.assets['img/Warrior.gif'];\n Warrior.x = 10 * 83;\n Warrior.y = 10 * 52;\n\n\n let Yi = new Sprite(31, 32);\n Yi.image = game.assets['img/Yi.gif'];\n Yi.x = 10 * 82;\n Yi.y = 10 * 22;\n\n\n\n //King Statue\n\n\n\n let King_Statue = new Sprite(24, 40);\n King_Statue.image = game.assets['img/Loho_Statue.gif'];\n King_Statue.x = 10 * 53;\n King_Statue.y = 10 * 1;\n\n\n let King_Chair = new Sprite(26, 27);\n King_Chair.image = game.assets['img/palace_chair.gif'];\n King_Chair.x = 10 * 56;\n King_Chair.y = 0;\n\n \n\n\n\n let imgskull = new Sprite(14, 16);\n imgskull.image = game.assets['img/skull.gif'];\n imgskull.x = 10 * 7;\n imgskull.y = 10 * 70;\n \n\n let Pillar1 = new Sprite(16, 32);\n Pillar1.image = game.assets['img/misc_pillar.gif'];\n Pillar1.x = 10 * 1;\n Pillar1.y = 10 * 73;\n \n\n let Well = new Sprite(31, 28);\n Well.image = game.assets['img/well2.gif'];\n Well.x = 10 * 29;\n Well.y = 10 * 46;\n\n\n\n let Chaman = new Sprite(16, 32);\n Chaman.image = game.assets['img/Great_Healer.gif'];\n Chaman.x = 10 * 88;\n Chaman.y = 10 * 12;\n\n\n let Lose = new Sprite(14, 28);\n Lose.image = game.assets['img/Villager-6.gif'];\n Lose.x = 10 * 93;\n Lose.y = 10 * 12;\n Lose.opacity = 0;\n\n\n\n let Sheep_sacred_village = new Sprite(32, 32);\n Sheep_sacred_village.image = game.assets['img/Sheep.gif'];\n Sheep_sacred_village.x = 10 * 85;\n Sheep_sacred_village.y = 10 * 19;\n\n let Sheep_sacred_village_Sin = new Sprite(32, 32);\n Sheep_sacred_village_Sin.image = game.assets['img/Sheep.gif'];\n Sheep_sacred_village_Sin.x = 10 * 84;\n Sheep_sacred_village_Sin.y = 10 * 20;\n Sheep_sacred_village_Sin.scaleX = Math.sin(30);\n\n\n let Sheep_sacred_village_Sin2 = new Sprite(32, 32);\n Sheep_sacred_village_Sin2.image = game.assets['img/Sheep.gif'];\n Sheep_sacred_village_Sin2.x = 10 * 85;\n Sheep_sacred_village_Sin2.y = 10 * 21;\n Sheep_sacred_village_Sin2.scaleX = Math.sin(40);\n\n\n\n\n let Oven_sacred_village = new Sprite(30, 22);\n Oven_sacred_village.image = game.assets['img/oven.gif'];\n Oven_sacred_village.x = 10 * 101;\n Oven_sacred_village.y = 10 * 12;\n\n\n\n\n\n\n\n let Turtle = new Sprite(32, 32);\n Turtle.image = game.assets['img/Turtle.gif'];\n Turtle.x = 10 * 98;\n Turtle.y = 10 * 10;\n\n\n\n let flower = new Sprite(16, 30);\n flower.image = game.assets['img/end-table.gif'];\n flower.x = 10 * 50;\n flower.y = 10 * 5;\n\n let Queen = new Sprite(17, 27);\n Queen.image = game.assets['img/Mia_Left.gif'];\n Queen.x = 10 * 58;\n Queen.y = 10 * 8;\n\n\n\n let King = new Sprite(32, 32);\n King.image = game.assets['img/Kraden_Right.gif'];\n King.x = 10 * 53;\n King.y = 10 * 8;\n\n\n\n \n\n let Ishtar_Statue = new Sprite(29, 54);\n Ishtar_Statue.image = game.assets['img/Bilibin_Statue.gif'];\n Ishtar_Statue.x = 10 * 103;\n Ishtar_Statue.y = 10 * 4;\n \n\n let Venus_Statue = new Sprite(25, 40);\n Venus_Statue.image = game.assets['img/Venus_Aerie_Statue.gif'];\n Venus_Statue.x = 10 * 45;\n Venus_Statue.y = 10 * 42;\n \n\n\n\n\n let Jenna = new Sprite(17, 29);\n Jenna.image = game.assets['img/Jenna_SW.gif'];\n Jenna.x = 10 * 93;\n Jenna.y = 10 * 27;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n //###############################################################\n // Angel's Temple !!!#############################################\n\n\n let Angel_statue = new Sprite(28, 52);\n Angel_statue.image = game.assets['img/statue_angel.gif'];\n Angel_statue.x = 10 * 62;\n Angel_statue.y = 10 * 66;\n Angel_statue.opacity = 1;\n\n\n\n\n\n\n let Cupidon = new Sprite(23, 51);\n\n Cupidon.image = game.assets['img/Jupiter_Statue.gif'];\n Cupidon.x = 10 * 30;\n Cupidon.y = 10 * 75;\n Cupidon.opacity = 1;\n\n\n let Nehemiel = new Sprite(21, 41);\n \n Nehemiel.image = game.assets['img/angel1.gif'];\n Nehemiel.x = 10 * 52;\n Nehemiel.y = 10 * 74;\n Nehemiel.opacity = 1;\n\n \n\n\n let Husim = new Sprite(34, 64);\n \n Husim.image = game.assets['img/Jupiter_Statue2.gif'];\n Husim.x = 10 * 50;\n Husim.y = 10 * 69;\n Husim.opacity = 1;\n\n\n let Tears_God = new Sprite(16, 16);\n \n Tears_God.image = game.assets['img/Sea_Gods_Tear.gif'];\n Tears_God.x = 10 * 47;\n Tears_God.y = 10 * 70;\n Tears_God.opacity = 1;\n\n\n let Blaze_Angel_right_ananai = new Sprite(16, 32);\n \n Blaze_Angel_right_ananai.image = game.assets['img/Blaze_Torch_Lit.gif'];\n Blaze_Angel_right_ananai.x = 10 * 43;\n Blaze_Angel_right_ananai.y = 10 * 68;\n Blaze_Angel_right_ananai.opacity = 1;\n\n\n let Blaze_Angel_left_ananai = new Sprite(16, 32);\n \n Blaze_Angel_left_ananai.image = game.assets['img/Blaze_Torch_Lit.gif'];\n Blaze_Angel_left_ananai.x = 10 * 31;\n Blaze_Angel_left_ananai.y = 10 * 68;\n Blaze_Angel_left_ananai.opacity = 1;\n\n\n\n\n\n\n\n \n \n\n\n\n\n\n\n\n\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //Déesse IZANAMI AQUARIUS VENUS ######################################\"\"\n \n\n let Aquarius_spirit = new Sprite(64, 103);\n Aquarius_spirit.image = game.assets['img/Izanami.gif'];\n Aquarius_spirit.x = 10 * 103;\n Aquarius_spirit.y = 10 * 24;\n Aquarius_spirit.opacity = 0;\n\n let Izanami = new Sprite(128, 128);\n Izanami.image = game.assets['img/Iris.gif'];\n Izanami.x = 10 * 10;\n Izanami.y = 10 * 57;\n Izanami.opacity = 0;\n\n\n\n let Blue_statue = new Sprite(26, 41);\n Blue_statue.image = game.assets['img/Venus_Statue_Blue.gif'];\n Blue_statue.x = 10 * 75;\n Blue_statue.y = 0;\n Blue_statue.opacity = 1;\n\n\n\n let Red_statue = new Sprite(26, 41);\n Red_statue.image = game.assets['img/Venus_Statue_Red.gif'];\n Red_statue.x = 10 * 20;\n Red_statue.y = 10 * 67;\n \n \n \n let Yellow_statue = new Sprite(26, 41);\n Yellow_statue.image = game.assets['img/Venus_Statue_Yellow.gif'];\n Yellow_statue.x = 10 * 36;\n Yellow_statue.y = 10 * 67;\n \n\n\n\n let sign_shop = new Sprite(15, 23);\n sign_shop.image = game.assets['img/sign2.gif'];\n sign_shop.x = 10 * 66;\n sign_shop.y = 10 * 23;\n \n let sign_phenix = new Sprite(16, 23);\n sign_phenix.image = game.assets['img/sign3.gif'];\n sign_phenix.x = 10 * 67;\n sign_phenix.y = 10 * 39;\n\n\n\n let Dragon_Statue = new Sprite(61, 55);\n Dragon_Statue.image = game.assets['img/Dragon.gif'];\n Dragon_Statue.x = 10 * 40;\n Dragon_Statue.y = 10 * 48;\n \n\n\n let Mars_Statue = new Sprite(32, 64);\n Mars_Statue.image = game.assets['img/Mars_Statue.gif'];\n Mars_Statue.x = 10 * 103;\n Mars_Statue.y = 10 * 20;\n\n let Saint = new Sprite(32, 32);\n Saint.image = game.assets['img/Menardi_Walk_Up.gif'];\n Saint.x = 10 * 76;\n Saint.y = 10 * 40;\n \n\n\n // let sign = new Sprite(16, 23);\n // sign.image = game.assets['img/sign3.gif'];\n // sign.x = 10 * 69;\n // sign.y = 10 * 68;\n\n\n\n let sign_castle = new Sprite(19, 25);\n sign_castle.image = game.assets['img/sign.gif'];\n sign_castle.x = 10 * 45;\n sign_castle.y = 10 * 14;\n\n let sign2 = new Sprite(19, 25);\n sign2.image = game.assets['img/sign.gif'];\n sign2.x = 10 * 94;\n sign2.y = 10 * 47;\n \n\n\n\n\n let Tiamat = new Sprite(74, 95);\n Tiamat.image = game.assets['img/Procne.gif'];\n Tiamat.x = 10 * 82;\n Tiamat.y = 10 * 31;\n\n\n\n\n\n\n\n\n //SACRED VILLAGE\n\n\n\n let Chief_village = new Sprite(16, 32);\n Chief_village.image = game.assets['img/Villager7.gif'];\n Chief_village.x = 10 * 104;\n Chief_village.y = 10 * 16;\n\n\n\n\n\n let Felix_Situp = new Sprite(21, 29);\n Felix_Situp.image = game.assets['img/Felix_Situp.gif'];\n Felix_Situp.x = 10 * 68;\n Felix_Situp.y = 10 * 17;\n\n\n\n \n let fallen_Sheba = new Sprite(24, 27);\n fallen_Sheba.image = game.assets['img/fallen_Sheba.gif'];\n fallen_Sheba.x = 10 * 8;\n fallen_Sheba.y = 10 * 56;\n\n\n\n\n\n\n let Big_Stump2 = new Sprite(28, 19);\n Big_Stump2.image = game.assets['img/Big_Stump2.gif'];\n Big_Stump2.x = 10 * 68;\n Big_Stump2.y = 10 * 14;\n \n\n\n\n //#####################################\n ///AQUARIUS TEMPLE\n\n\n\n let TorchAqua = new Sprite(15, 31);\n TorchAqua.image = game.assets['img/Shell_Torch.gif'];\n TorchAqua.x = 10 * 102;\n TorchAqua.y = 10 * 27;\n\n\n\n let Jar_Aquarius = new Sprite(15, 31);\n Jar_Aquarius.image = game.assets['img/jar5.gif'];\n Jar_Aquarius.x = 10 * 100;\n Jar_Aquarius.y = 10 * 26;\n \n let Jar_Aquarius_statue = new Sprite(15, 31);\n Jar_Aquarius_statue.image = game.assets['img/jar5.gif'];\n Jar_Aquarius_statue.x = 10 * 96;\n Jar_Aquarius_statue.y = 10 * 32;\n Jar_Aquarius_statue.opacity = 0.89;\n \n \n \n \n let aquarius_statue = new Sprite(19, 43);\n aquarius_statue.image = game.assets['img/Mercury_Statue.gif'];\n aquarius_statue.x = 10 * 96;\n aquarius_statue.y = 10 * 28;\n\n\n\n \n let Pillar_Aquarius = new Sprite(32, 64);\n Pillar_Aquarius.image = game.assets['img/Ice_Pillar.gif'];\n Pillar_Aquarius.x = 10 * 102;\n Pillar_Aquarius.y = 10 * 23;\n Pillar_Aquarius.opacity = 0.3;\n \n let Pillar_Aquarius_left = new Sprite(32, 64);\n Pillar_Aquarius_left.image = game.assets['img/Ice_Pillar.gif'];\n Pillar_Aquarius_left.x = 10 * 95;\n Pillar_Aquarius_left.y = 10 * 23;\n Pillar_Aquarius_left.opacity = 0.3;\n\n let Pillar_Aquarius_secret_enter = new Sprite(32, 64);\n Pillar_Aquarius_secret_enter.image = game.assets['img/Ice_Pillar.gif'];\n Pillar_Aquarius_secret_enter.x = 10 * 97;\n Pillar_Aquarius_secret_enter.y = 10 * 35;\n Pillar_Aquarius_secret_enter.opacity = 0.7;\n\n\n\n\n\n \n let Pillar_Aquarius_down_right = new Sprite(32, 64);\n Pillar_Aquarius_down_right.image = game.assets['img/Ice_Pillar.gif'];\n Pillar_Aquarius_down_right.x = 10 * 102;\n Pillar_Aquarius_down_right.y = 10 * 48;\n Pillar_Aquarius_down_right.opacity = 0.43;\n\n let Pillar_Aquarius_down_left = new Sprite(32, 64);\n Pillar_Aquarius_down_left.image = game.assets['img/Ice_Pillar.gif'];\n Pillar_Aquarius_down_left.x = 10 * 98;\n Pillar_Aquarius_down_left.y = 10 * 48;\n Pillar_Aquarius_down_left.opacity = 0.4;\n\n\n \n \n \n \n\n\n\n\n\n\n \n \n //LOOTS & items quest\n\n\n let knowledge_stone = new Sprite(13, 13);\n knowledge_stone.image = game.assets['img/Hail.gif'];\n knowledge_stone.x = 10 * 75;\n knowledge_stone.y = 0;\n knowledge_stone.opacity = 0;\n\n \n let crown = new Sprite(16, 16);\n crown.image = game.assets['img/9.png'];\n crown.x = 10 * 78;\n crown.y = 10 * 6;\n\n let graal = new Sprite(16, 16);\n graal.image = game.assets['img/6.png'];\n graal.x = 10 * 80;\n graal.y = 10 * 5;\n\n let castle_key = new Sprite(16, 16);\n castle_key.image = game.assets['img/Prison_Key.gif'];\n castle_key.x = 10 * 84;\n castle_key.y = 10 * 42;\n castle_key.opacity = 0;\n\n\n\n\n\n\n\n\n\n\n\n\n //VILLAGE\n\n\n let Menardi_Small = new Sprite(20, 27);\n Menardi_Small.image = game.assets['img/Menardi_Small.gif'];\n Menardi_Small.x = 10 * 40;\n Menardi_Small.y = 10 * 45;\n\n let blue_man = new Sprite(32, 32);\n blue_man.image = game.assets['img/Prox_Villager5.gif'];\n blue_man.x = 10 * 30;\n blue_man.y = 10 * 42;\n\n\n let Grave_ancient_king = new Sprite(15, 16);\n Grave_ancient_king.image = game.assets['img/grave1.gif'];\n Grave_ancient_king.x = 10 * 41;\n Grave_ancient_king.y = 10 * 60;\n\n\n\n\n\n\n\n /////////////#####################################\n //HOUSE PLAYER#####################################\n\n\n\n let Yallam_House = new Sprite(64, 64);\n Yallam_House.image = game.assets['img/Yallam_House.gif'];\n Yallam_House.x = 10;\n Yallam_House.y = 10;\n\n\n let Golden_Chocobo = new Sprite(31, 43);\n Golden_Chocobo.image = game.assets['img/chocobo.gif'];\n Golden_Chocobo.x = 10 * 10;\n Golden_Chocobo.y = 10;\n // Golden_Chocobo.opacity.Math.Floor(Math.random(0.2) * Math.floor(1))\n\n\n let Chocobo_water = new Sprite(22, 24);\n Chocobo_water.image = game.assets['img/big_basket_wtr.gif'];\n Chocobo_water.x = 10 * 11;\n Chocobo_water.y = 10 * 5;\n\n\n let Golden_Chocobo_Food = new Sprite(16, 14);\n Golden_Chocobo_Food.image = game.assets['img/basket1.gif'];\n Golden_Chocobo_Food.x = 10 * 7;\n Golden_Chocobo_Food.y = 10 * 4;\n Golden_Chocobo_Food.scaleX = Math.sin(40);\n\n\n let Flag = new Sprite(14, 14);\n Flag.image = game.assets['img/Condemn.gif'];\n Flag.x = 8;\n Flag.y = 11;\n\n\n let sack1 = new Sprite(15, 14);\n sack1.image = game.assets['img/sack1.gif'];\n sack1.x = 10* 7;\n sack1.y = 10 * 6;\n\n\n let Woodpile1 = new Sprite(13, 16);\n Woodpile1.image = game.assets['img/woodpile3.gif'];\n Woodpile1.x = 0;\n Woodpile1.y = 10 * 8;\n\n\n\n let Hay_Bundle = new Sprite(24, 16);\n Hay_Bundle.image = game.assets['img/Hay_Bundle.gif'];\n Hay_Bundle.x = 3 * 23;\n Hay_Bundle.y = 10 * 56;\n \n\n\n\n\n\n\n\n //HOUSE STORAGE\n\n\n \n let Apojihouse = new Sprite(80, 103);\n Apojihouse.image = game.assets['img/Apojii_House.gif'];\n Apojihouse.x = 10 * 80;\n Apojihouse.y = 10 * 10;\n\n \n let Yallam_Blacksmith2 = new Sprite(104, 88);\n Yallam_Blacksmith2.image = game.assets['img/Yallam_Blacksmith.gif'];\n Yallam_Blacksmith2.x = 10 * 34;\n Yallam_Blacksmith2.y = 10 * 38;\n\n\n //Rock village\n let Yallam_Blacksmith = new Sprite(104, 88);\n Yallam_Blacksmith.image = game.assets['img/Yallam_Blacksmith.gif'];\n Yallam_Blacksmith.x = 10 * 20;\n Yallam_Blacksmith.y = 10 * 38 ;\n \n\n\n let Yallam_Inn = new Sprite(96, 80);\n Yallam_Inn.image = game.assets['img/Yallam_Inn.gif'];\n Yallam_Inn.x = 10 * 15; \n Yallam_Inn.y = 10 * 45;\n\n\n let flame = new Sprite(10, 16);\n flame.image = game.assets['img/flame.gif'];\n flame.x = 10 * 27;\n flame.y = 10 * 72;\n\n let Theif_Right = new Sprite(32, 32);\n Theif_Right.image = game.assets['img/Theif.gif'];\n Theif_Right.x = 10 * 10;\n Theif_Right.y = 10 * 40;\n\n let shop = new Sprite(160, 128); \n shop.image = game.assets['img/Apojii_Inn_Shop.gif'];\n shop.x = 10 * 90;\n shop.y = 1;\n\n\n let barrel7 = new Sprite(15, 15);\n barrel7.image = game.assets['img/barrel7.gif'];\n barrel7.x = 10 * 60;\n barrel7.y = 10 * 13;\n\n \n\n\n\n let oldman = new Sprite (17, 26);\n oldman.image = game.assets['img/Villager-2.gif'];\n oldman.x = 14 * 19;\n oldman.y = 12 * 40;\n\n\n let Oven_rock_village = new Sprite (30, 22);\n Oven_rock_village.image = game.assets['img/oven.gif'];\n Oven_rock_village.x = 14 * 10;\n Oven_rock_village.y = 12 * 42;\n\n\n\n\n\n\n let Tired_Chocobo = new Sprite (34, 33);\n Tired_Chocobo.image = game.assets['img/yellow_chocobo_weak.gif'];\n Tired_Chocobo.x = 10 * 3;\n Tired_Chocobo.y = 12 * 38;\n Tired_Chocobo.scaleX = Math.sin(30);\n\n // let Facial_agitated_expression_chocobo = new Sprite (16, 16);\n // Facial_agitated_expression_chocobo.image = game.assets['img/agitated.gif'];\n // Facial_agitated_expression_chocobo.x = 14 * 3;\n // Facial_agitated_expression_chocobo.y = 12 * 37;\n // Facial_agitated_expression_chocobo.opacity = 0.4;\n\n\n let Up_Chocobo = new Sprite(31, 43);\n Up_Chocobo.image = game.assets['img/chocobo.gif'];\n Up_Chocobo.x = 10 * 3;\n Up_Chocobo.y = 12 * 38;\n Up_Chocobo.opacity = 0;\n Up_Chocobo.scaleX = Math.sin(30);\n\n\n\n\n let Food_Chocobo = new Sprite(22, 23);\n Food_Chocobo.image = game.assets['img/Fruit_Basket.gif'];\n Food_Chocobo.x = 10 * 17;\n Food_Chocobo.y = 10 * 52;\n Food_Chocobo.opacity = 1;\n\n\n\n\n\n\n\n\n //####################################################\n //BOOK END GAME #######################################\n\n\n let book = new Sprite(16, 16);\n book.image = game.assets['img/book.gif'];\n book.x = 10 * 102;\n book.y = 10 * 76;\n book.opacity = 0;\n\n let Growth = new Sprite(14, 14);\n Growth.image = game.assets['img/Growth.gif'];\n Growth.x = 10 * 100;\n Growth.y = 10 * 73;\n Growth.opacity = 0;\n \n \n \n \n \n\n\n\n\n\n \n \n //excalibur\n\n\n let sword = new Sprite(7, 16);\n sword.image = game.assets['img/sword3.gif'];\n sword.x = 10 * 68;\n sword.y = 10 * 4;\n\n \n let treasure = new Sprite(16, 16);\n treasure.image = game.assets['img/8.png'];\n treasure.x = 10 * 80;\n treasure.y = 10 * 7;\n \n\n \n let Sunflower = new Sprite(32, 32);\n Sunflower = game.assets['img/monster6.gif'];\n Sunflower.x = 10 * 4;\n Sunflower.y = 10 * 13;\n \n\n let piece = new Sprite(16, 16);\n piece.image = game.assets['img/1.png'];\n piece.x = 10 * 25;\n piece.y = 10 * 35;\n \n\n\n\n\n\n\n // open door soldier\n\n let piece2 = new Sprite(16, 16);\n piece2.image = game.assets['img/1.png'];\n piece2.x = 10 * 63;\n piece2.y = 10 * 35;\n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n //Player control...\n \n \n \n let player = new Sprite(32, 32);\n player.x = 10 * 3; // positionnement en x sur le canvas\n player.y = 10 * 10; // positionnement en y sur le canvas\n let image = new Surface(96, 128); // création d'une surface d'affichage \n image.draw(game.assets['img/chara6.png'], 96, 0, 96, 128, 0, 0, 96, 128); // dessine, ajoute l'image au jeu et positionne (récupération en x de l'image , en y, sizepix, surface en pix, repeat) ) \n player.image = image; // .image framework keyword pour dessiner le sprite sur la surface definie\n player.walk = 1; // .walk key framework déplacement par frame\n \n \n\n let playerSpeed = 10; // Number of pixels to move the sprite each frame.\n \n\n //right/left création d'un event en entrée de frame de bouger le sprite\n player.addEventListener(Event.ENTER_FRAME, function () {\n this.frame = this.direction * 3 + this.walk; // changement d'image a chaque frame du jeu en lancement du sprite \n \n // game.input = input du jeu \n // this.direction : selection de la direction du sprite par rapport au différentes image des personnages \n // !game.input si on entre pas d'input 0 move\n // !game.frame si il n'ya pas de frame par le déplacement du personnage \n // \n if (!game.input) {\n this.walk %= 0;\n }\n \n if (game.input.right && !game.input.left) {\n this.direction = 6;\n player.x += playerSpeed; \n if (map.hitTest(player.x + 8, player.y + 8)) {\n player.x -= playerSpeed;\n }\n if (!(game.frame % 3)) {\n this.walk++;\n this.walk %= 3;\n }\n\n //délimitation de déplacement du joueur par rapport à la taille du game \n if (player.x > game.width - player.width) {\n player.x = game.width - player.width;\n }\n \n \n } else if (game.input.left && !game.input.right) {\n this.direction = 5;\n player.x -= playerSpeed;\n \n // map.hitest: paramètre des collisions du canvas par rapport à l'objet player en x et y \n if (map.hitTest(player.x + 8, player.y + 8)) {\n player.x += playerSpeed;\n }\n // synchronisation frame du jeu et changement de sprite à chaque frame\n if (!(game.frame % 3)) {\n this.walk++; // incrémentation \n this.walk %= 3;\n }\n \n //délimitation sortie du canvas\n if (player.x < 0) {\n player.x = 0;\n \n }\n }\n\n\n //up/down\n if (game.input.down && !game.input.up) {\n this.direction = 4;\n player.y += playerSpeed;\n\n if (map.hitTest(player.x + 8, player.y + 8)) {\n player.y -= playerSpeed;\n }\n if (!(game.frame % 3)) {\n this.walk++;\n this.walk %= 3;\n }\n \n if (player.y > game.height - player.height) {\n player.y = game.height - player.height;\n }\n if (player.y < 0){\n player.y = 0;\n }\n \n\n\n } else if (game.input.up && !game.input.down) {\n this.direction = 3;\n player.y -= playerSpeed;\n if(map.hitTest(player.x + 8, player.y + 8)) {\n player.y += playerSpeed;\n }\n if(!(game.frame % 3)) {\n this.walk++; \n this.walk %= 3;\n }\n // if (player.y > game.height - player.height) {\n // player.y = game.height - player.height;\n // }\n\n if(player.y < 0){\n player.y = 0;\n }\n } \n\n });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n //Soldier control soldier\n\n\n let soldier1 = new Sprite(32, 32);\n soldier1.speed = 5;\n soldier1.x = 20 * 27;\n soldier1.y = 10 * 12;\n soldier1.image = game.assets['img/chara5.png'];\n // soldier1.move = true;\n soldier1.walk = 1;\n \n\n\n soldier1.addEventListener(Event.ENTER_FRAME, function () {\n this.frame = this.direction + this.walk;\n if(game.frame%2){\n\n this.x += 2;\n this.walk++; //test\n this.walk %=2;\n this.direction = 10; \n\n \n \n if (map.hitTest(soldier1.x -16 , soldier1.y - 16)) {\n this.x -= 2;\n this.walk++;\n // this.walk %= 0;\n this.direction = 2;\n\n }\n else {\n this.x -= soldier1.speed;\n \n }\n\n if (soldier1.x > game.width - soldier1.width) {\n soldier1.x = game.width - soldier1.width;\n }\n }\n \n \n });\n \n \n\n\n let soldier2 = new Sprite(32, 32); \n soldier2.image = game.assets['img/chara5.png'];\n soldier2.speed = 5; \n soldier2.x = 10 * 69;\n soldier2.y = 10 * 1;\n soldier2.walk = 1;\n\n soldier2.addEventListener(Event.ENTER_FRAME, function(){\n this.frame = this.direction + this.walk;\n\n if(game.frame%2){\n\n this.y += 2;\n this.walk++;\n this.walk %=2;\n this.direction = 1;\n if(map.hitTest(soldier2.x +16, soldier2.y +16)){\n this.y -= 2;\n this.walk++;\n // this.walk%= 0;\n this.direction = 12;\n \n }\n \n \n \n }\n\n\n });\n\n\n\n\n\n\n let soldier3 = new Sprite(32, 32); \n soldier3.image = game.assets['img/chara5.png'];\n soldier3.speed = 5;\n soldier3.speed = 3 ; \n soldier3.x = 10 * 97;\n soldier3.y = 10 * 41;\n soldier3.walk = 1;\n\n soldier3.addEventListener(Event.ENTER_FRAME, function(){\n\n\n // if(map.hitTest(soldier3.x +16, soldier3.y +16)){\n // // soldier3.y -= soldier3.speed;\n // soldier3.walk %= 0;\n // // soldier3.x -= soldier3.speed;\n // soldier3.x += soldier3.speed;\n // soldier3.y -= 2;\n \n \n\n // } \n\n\n\n\n\n });\n\n\n\n\n\n\n let soldier4 = new Sprite(32, 32); \n soldier4.image = game.assets['img/chara5.png'];\n soldier4.speed = 3 ; \n soldier4.x = 10 * 97;\n soldier4.y = 10 * 48;\n soldier4.direction = 10;\n\n\n soldier4.addEventListener(Event.ENTER_FRAME, function(){\n this.frame = this.direction;\n if(map.hitTest(soldier4.x -32, soldier4.y -32)){\n soldier4.direction = 13;\n\n }\n\n\n });\n \n \n\n let soldier5 = new Sprite(32, 32); \n soldier5.image = game.assets['img/chara5.png'];\n soldier5.speed = 3 ; \n soldier5.x = 10 * 35;\n soldier5.y = 10 * 34;\n soldier5.direction = 10; \n\n\n\n\n\n let monster1 = new Sprite(32, 96);\n monster1.x = 20; // positionnement en x sur le canvas\n monster1.y = 10 * 20; // positionnement en y sur le canvas\n monster1 = game.assets['img/monster6.gif'];\n // let image2 = new Surface(96, 128); // création d'une surface d'affichage 96 , 128 player\n // image.draw(game.assets['img/monster6.gif'],0, 0, 96, 128, 96, 96, 96, 0); // dessine, ajoute l'image au jeu et positionne (récupération en x de l'image , en y, sizepix, surface en pix, repeat) ) \n // monster1.image2 = image2; // .image framework keyword pour dessiner le sprite sur la surface definie\n \n\n\n\n \n\n\n\n\n\n\n\n\n \n //LABEL Setting\n\n\n let label = new Label();\n\n\n\n label.text = \"Du Néant naquit Gaïa la terre mère, une énergie créatrice sans limites dépourvue de penser, pour l'accompagner Gaïa engendra Aquarius déesse de l'espace, du temps et du savoir qui créa le ciel et les premières étoiles. Afin d'équilibrer cette puissance, Aquarius m'y en place la dualité et 2 mondes celui des anges et démons. Mètis la première fût chargé de guider le royaume des anges. Izanami a été destiné au royaume des démons. Chacune façonnèrent une relique stabilisant leur monde.\";\n label.width = 320;\n label.height = 350;\n label.color = 'rgb(13, 2, 6)';//'rgb(255,255, 255)';\n label.font = \"italic 13px Comics sans-serif\";\n label.x = 10 * 19;\n label.y = 10 * 17;\n\n\n \n\n let info = new Label(\"\");\n\n \n info.backgroundcolor = 'rbg(255,255,255)';\n info.width = 270;\n info.height = 160;\n info.color = 'rgb(34, 11, 145)';//'rgb(255,255, 255)';\n info.font = \"italic 13px Comics sans-serif\";\n info.x = 160;\n info.y = 10 ;\n info.opacity = 1;\n \n\n\n\n\n \n\n game.keybind(122, 'up'); // 87 is the ASCII code for 'W'.\n game.keybind(113, 'left'); // 65 is the ASCII code for 'A'.\n game.keybind(115, 'down'); // 83 is the ASCII code for 'S'.\n game.keybind(111, 'right');\n\n\n\n\n\n\n\n\n\n\n\n\n //Instance objet Group game\n\n //addchild : ajoute les objets dans le group map \n\n let stage = new Group();\n \n \n stage.addChild(map);\n stage.addChild(player);\n\n\n //Silence quest\n stage.addChild(silence_yoda);\n stage.addChild(silence_chief);\n stage.addChild(silence_chaman);\n stage.addChild(silence_Statue_Aquarius);\n stage.addChild(silence_Cupidon);\n stage.addChild(silence_Husim);\n stage.addChild(silence_flame);\n \n \n \n\n\n\n //exclamatory quest \n\n stage.addChild(excla_yoda);\n stage.addChild(excla_yoda_2);\n \n stage.addChild(excla_chaman);\n stage.addChild(excla_chaman_2);\n\n stage.addChild(excla_Hino);\n stage.addChild(excla_Jenna);\n \n stage.addChild(excla_chief);\n stage.addChild(excla_warrior);\n stage.addChild(excla_Sainte);\n stage.addChild(excla_Phenix);\n stage.addChild(excla_Aquarius);\n stage.addChild(excla_Nehemiel);\n stage.addChild(excla_Ananai);\n stage.addChild(excla_Izanami);\n stage.addChild(excla_Pillar);\n \n \n \n\n\n //inter quest \n\n stage.addChild(inter_brother_sainte);\n stage.addChild(inter_aquarius);\n \n\n // TP ring\n\n stage.addChild(Tp_hell);\n \n \n\n // KNOWLEDGE FOREST\n\n\n stage.addChild(Knowledge_tree);\n stage.addChild(Guardian_tree);\n stage.addChild(Growth);\n stage.addChild(Gaia_statue);\n stage.addChild(Little_Ent);\n stage.addChild(Baby_Ent);\n \n stage.addChild(Pillar_Forest);\n stage.addChild(Pillar_Forest_enter);\n stage.addChild(Pillar_Forest_south);\n \n \n \n\n\n\n \n\n //soldier !!!!!!!!!!!!!!!!!!!!!!\n stage.addChild(soldier1);\n stage.addChild(soldier2);\n stage.addChild(soldier3);\n stage.addChild(soldier4);\n\n stage.addChild(Big_Stump2);\n stage.addChild(sign2);\n stage.addChild(treasure);\n stage.addChild(shop);\n\n //Loots Items quest !!!!!!!!!!!!\n\n stage.addChild(piece);\n stage.addChild(piece2);\n stage.addChild(castle_key);\n stage.addChild(knowledge_stone);\n \n\n //castle fashion !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n stage.addChild(banner_castle);\n stage.addChild(crown);\n stage.addChild(graal);\n stage.addChild(blazT);\n stage.addChild(barrel7);\n stage.addChild(flame);\n stage.addChild(King_Chair);\n \n \n //middle ???????????????????\n\n stage.addChild(ElBarto);\n stage.addChild(Teepee);\n stage.addChild(Saint);\n stage.addChild(King);\n stage.addChild(Well);\n\n stage.addChild(imgskull);\n stage.addChild(Pillar1);\n stage.addChild(flower);\n \n\n\n //###########################\n // Angel Sanctuary \n\n stage.addChild(Angel_statue);\n stage.addChild(Cupidon); \n stage.addChild(Husim);\n stage.addChild(Nehemiel);\n stage.addChild(Tears_God);\n\n //TORCH TEMPLE\n stage.addChild(Blaze_Angel_right_ananai);\n stage.addChild(Blaze_Angel_left_ananai);\n \n \n\n\n\n \n //GODS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n stage.addChild(Aquarius_spirit);\n stage.addChild(Izanami);\n stage.addChild(Blue_statue);\n stage.addChild(Red_statue);\n stage.addChild(Yellow_statue);\n \n stage.addChild(King_Statue);\n stage.addChild(Queen);\n stage.addChild(Tiamat);\n stage.addChild(Dragon_Statue);\n stage.addChild(Mars_Statue);\n stage.addChild(sign_castle);\n\n\n\n \n\n //sorcerer\n \n\n stage.addChild(Sorcerer);\n stage.addChild(sign_phenix);\n stage.addChild(sign_shop);\n stage.addChild(fallen_Sheba);\n // stage.addChild(sign);\n stage.addChild(kolima_shop);\n stage.addChild(aquarius_statue);\n stage.addChild(book);\n stage.addChild(Theif_Right);\n stage.addChild(Felix_Situp);\n stage.addChild(blue_man);\n stage.addChild(Menardi_Small);\n stage.addChild(Jenna);\n \n stage.addChild(Jar);\n stage.addChild(Chicken);\n stage.addChild(Chicken2);\n stage.addChild(Sheep_sacred_village);\n stage.addChild(Sheep_sacred_village_Sin);\n stage.addChild(Sheep_sacred_village_Sin2);\n \n\n stage.addChild(Oven_rock_village);\n \n \n stage.addChild(Round_Rug2);\n \n //PNG c'est le bordel\n stage.addChild(Chief_village);\n stage.addChild(Chaman);\n stage.addChild(Ishtar_Statue);\n stage.addChild(sign2);\n stage.addChild(Sea_barrel);\n \n //################################################\n //HOUSE PLAYER & ITEMS && HOUSES MAP\n stage.addChild(Apojihouse);\n stage.addChild(Flag);\n stage.addChild(Golden_Chocobo);\n stage.addChild(Golden_Chocobo_Food);\n \n stage.addChild(Tired_Chocobo);\n // stage.addChild(Facial_agitated_expression_chocobo);\n \n stage.addChild(Up_Chocobo);\n stage.addChild(Food_Chocobo);\n \n stage.addChild(Grave_ancient_king);\n \n \n stage.addChild(Chocobo_water);\n \n stage.addChild(sack1);\n stage.addChild(Woodpile1);\n stage.addChild(Yallam_House);\n stage.addChild(Venus_Statue);\n stage.addChild(Hay_Bundle);\n stage.addChild(Yallam_Inn);\n stage.addChild(Yallam_Blacksmith);\n stage.addChild(Yallam_Blacksmith2);\n stage.addChild(Sunflower);\n \n stage.addChild(Oven_sacred_village);\n \n \n\n\n\n //#######################################\n // AQUARIUS TEMPLE #######################\n stage.addChild(TorchAqua);\n stage.addChild(Jar_Aquarius);\n stage.addChild(Jar_Aquarius_statue);\n \n stage.addChild(Pillar_Aquarius);\n stage.addChild(Pillar_Aquarius_left);\n stage.addChild(Pillar_Aquarius_secret_enter);\n \n stage.addChild(Pillar_Aquarius_down_right);\n stage.addChild(Pillar_Aquarius_down_left);\n \n \n\n\n\n //label etc\n stage.addChild(label);\n stage.addChild(info);\n \n\n \n stage.addChild(sword);\n \n stage.addChild(oldman);\n stage.addChild(Turtle);\n stage.addChild(Yi);\n stage.addChild(tiedup_villager);\n stage.addChild(Warrior);\n stage.addChild(monster1);\n // stage.addChild(soldier5);\n \n //no comment\n stage.addChild(Lose);\n \n\n game.rootScene.addChild(stage);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n //Utilisation de la variable magic stage !!\n //ajout d'un event entrée de la première scene du jeu pour le label \n //label: création de surface de text \n\n\n stage.addEventListener(Event.ENTER_FRAME, function () {\n // fade label out until it's invisible\n if (label.opacity > 0.15) {\n label.opacity -= 0.015;\n }\n else {\n stage.removeChild(label);\n }\n });\n\n\n\n\n\n\n stage.addEventListener('enterframe', function(){\n \n \n \n \n \n \n if(player.within(Dragon_Statue, 16)){\n \n // soldier2.frame = soldier2.direction; \n \n\n console.log(\"Regardez vers les étoiles et pas vers vos pieds. Essayez de donner un sens à ce que vous voyez, et demandez-vous ce qui fait que l'univers existe. Soyez curieux.-> Stephen Hawking\");\n \n \n \n }\n \n \n \n if(player.within(Pillar1, 16)){\n \n let pillar_message =\"Stone:L'homme est un accident de parcours, dans un cosmos vide et froid. Il est un enfant du hasard.\"\n\n console.log(pillar_message);\n \n\n \n \n \n \n } \n \n \n \n // if(player.within(Chaman, 16)){\n \n // console.log(\"Chaman-Yallam: Ishtar est une divinité astrale qui est identifiée à la planète Vénus, l'étoile du matin et du soir\");\n \n // console.log(\"Chaman-Yallam: Pourquoi se battre pour des croyances ?!\");\n \n // }\n \n \n \n \n });\n \n\n \n //ajout de l' écoute d'un event \n //enterframe : En entrée de frame déploiement de la function \n \n //within : si un objet intercepte un autre objet \n\n\n\n\n // Passage secret du château \n\n\n\n\n \n stage.addEventListener('enterframe', function(){\n if(player.within(Pillar1, 16)){\n \n let pillar_message =\"Stone:L'homme est un accident de parcours, dans un cosmos vide et froid. Il est un enfant du hasard.\"\n\n console.log(pillar_message);\n\n }\n });\n \n \n stage.addEventListener('enterframe', function(){\n if(player.intersect(ElBarto, 32)){\n console.log(\"ElBarto: Ne te soucies pas, de ne pas être remarqué. Cherche plutôt à faire quelque chose de remarquable.\");\n console.log(\"ElBarto: On a toujours à apprendre des autres, même quand on le sait déjà.\");\n \n }\n });\n \n \n \n \n\n\n \n\n\n\n stage.addEventListener('enterframe', function(){\n \n if(player.within(Yi, 8)){\n \n console.log(\"YI: Si tu cherches un moyen de rentrer dans le château, je connais un passage secret, au Nord-Ouest\");\n \n \n \n }\n \n \n if(player.within(King, 32)){\n stage.removeChild(player);\n console.log(\"King: my wife's lover!!\");\n console.log(\"You has been kill by the King!\");\n \n }\n });\n\n\n\n\n\n\n\n\n\n //######################################################################\n //END GAME Open Aquarius Sanctuary######################################\n\n\n stage.addEventListener('enterframe', function(){\n \n if(player.within(Tiamat, 25)) {\n \n stage.removeChild(excla_Phenix);\n\n\n if(game.frame%4){\n\n soldier3.frame = soldier3.direction * 3 + soldier3.walk;\n soldier3.x += 2;\n soldier3.y += 2;\n soldier3.walk++;\n soldier3.walk %= 2;\n soldier3.direction = 19;\n if(map.hitTest(soldier3.x +32, soldier3.y +32)){\n \n soldier3.walk %= 1;\n soldier3.x -= 2;\n soldier3.y -= 2;\n soldier3.direction = 15;\n \n\n }else{\n soldier3.x += soldier3.speed;\n soldier3.y += soldier3.speed;\n }\n\n\n\n }\n\n \n \n }\n\n \n\n });\n\n\n\n\n stage.addEventListener('enterframe', function(){\n\n\n if(player.within(soldier3, 26)){\n \n player.x -= 3;\n playerSpeed -= 4;\n \n if(!player.within(soldier3, 26)){\n\n playerSpeed = 5;\n \n \n }\n\n\n }\n\n\n\n\n\n });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n\n\n ///KICK OUT ENTER\n\n\n\n //Guardian tree Enter \n\n stage.addEventListener('enterframe', function(){\n \n \n if(Guardian_tree.within(player, 50)){\n \n \n player.x -= 3;\n playerSpeed -= 4;\n \n if(!player.within(Guardian_tree, 50)){\n\n playerSpeed = 5;\n \n }\n\n if(Guardian_tree.opacity == 0){\n\n player.x += 3;\n playerSpeed += 4; //keep boost or not for other quests\n\n\n if(!player.within(Guardian_tree, 32)){\n\n playerSpeed = 5;\n \n\n }\n }\n \n }\n });\n\n\n\n\n\n\n\n\n\n\n //TEST kick-out Enter Castle \n\n\n stage.addEventListener('enterframe', function(){\n if(soldier1.within(player, 32)){\n \n player.y += 3;\n playerSpeed -= 4;\n\n if(!player.within(soldier1, 32)){\n \n playerSpeed = 5;\n \n }\n \n }\n });\n\n\n\n\n\n\n\n\n\n\n\n \n \n\n\n\n\n //Kick-out enter aquarius temple\n\n\n\n\n\n stage.addEventListener('enterframe', function(){\n \n \n if(soldier4.within(player, -32)){\n \n \n player.x -= 3;\n playerSpeed -= 4;\n \n if(!player.within(soldier4, 32)){\n\n playerSpeed = 5;\n \n }\n\n \n\n\n }\n });\n\n\n\n\n\n\n\n\n\n\n //#########################################################################\n // REST TO DELETE #########################################################\n\n\n\n\n stage.addEventListener('enterframe', function(){\n \n if(King_Statue.within(player, 16)){\n \n console.log(\"you has been kill by a Trap\");\n }\n });\n\n stage.addEventListener('enterframe', function(){\n \n if(player.intersect(crown, 8)){\n stage.removeChild(crown);\n console.log(\"whaa, Tu as obtenu la couronne du roi\");\n }\n });\n stage.addEventListener('enterframe', function(){\n \n if(player.intersect(piece2, 32)){\n stage.removeChild(piece2);\n console.log(\"Pièce d'une ancienne civilisation\");\n }\n });\n \n\n\n\n //Excalibur\n\n stage.addEventListener('enterframe', function(){\n \n if(player.intersect(sword, 8)){\n stage.removeChild(sword);\n console.log(\"Tu as obtenu l'épée d'Excalibur, L'épée du roi est à toi !!\");\n }\n });\n\n\n\n\n \n \n stage.addEventListener('enterframe', function(){\n \n if(player.intersect(piece, 8)){\n stage.removeChild(piece);\n console.log(\"une pièce dont la déesse Aquarius est représenté\");\n }\n });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n // HIDE ITEM QUEST ETC... !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n\n\n stage.addEventListener(Event.ENTER_FRAME, function(){\n\n\n //HIDE Excla_quest!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n // silence_yoda.opacity = Math.random(Math.random(0.7), Math.random(1));\n // excla_yoda.opacity = Math.random(Math.random(0.7), Math.random(1));\n\n castle_key.scaleX = Math.sin(castle_key.age * 0.1);\n // excla_Hino.opacity = Math.random(Math.random(0.15), Math.random(1), excla_Hino.age * 1);\n \n if(book.opacity == 0){\n stage.removeChild(book);\n }\n if(excla_Hino.opacity == 0){\n stage.removeChild(excla_Hino);\n\n }\n if(excla_Jenna.opacity == 0){\n stage.removeChild(excla_Jenna);\n }\n if(inter_aquarius.opacity == 0){\n stage.removeChild(inter_aquarius);\n\n \n }\n if(inter_brother_sainte.opacity == 0){\n stage.removeChild(inter_brother_sainte);\n\n }\n if(castle_key.opacity == 0){\n stage.removeChild(castle_key);\n\n\n }\n if(knowledge_stone.opacity == 0){\n stage.removeChild(knowledge_stone);\n\n }\n\n if(silence_chaman.opacity == 0){\n stage.removeChild(silence_chaman);\n }\n\n if(excla_Phenix.opacity == 0){\n stage.removeChild(excla_Phenix);\n }\n\n if(knowledge_stone.opacity == 0){\n stage.removeChild(knowledge_stone);\n }\n\n if(Aquarius_spirit.opacity == 0){\n stage.removeChild(Aquarius_spirit);\n }\n\n\n if(excla_Nehemiel.opacity == 0){\n stage.removeChild(excla_Nehemiel);\n }\n\n\n if(silence_Cupidon.opacity == 0){\n stage.removeChild(silence_Cupidon);\n\n }\n\n if(silence_Husim.opacity == 0){\n stage.removeChild(silence_Husim)\n\n\n }\n if(excla_yoda_2.opacity == 0){\n stage.removeChild(excla_yoda_2);\n\n }\n\n if(excla_chaman_2.opacity == 0){\n stage.removeChild(excla_chaman_2);\n\n }\n\n if(excla_Ananai.opacity == 0){\n stage.removeChild(excla_Ananai);\n }\n\n if(excla_Izanami.opacity == 0){\n stage.removeChild(excla_Izanami);\n\n }\n\n if(Izanami.opacity == 0){\n stage.removeChild(Izanami);\n }\n\n if(excla_Pillar.opacity == 0){\n stage.removeChild(excla_Pillar);\n }\n\n if(Lose.opacity == 0){\n stage.removeChild(Lose);\n\n\n }\n \n\n \n });\n\n\n\n \n stage.addEventListener('enterframe', function(){\n \n //Chocobo hs quest #Faire quelque chose sans rien n'attendre en retour...\n\n\n\n if(player.within(Food_Chocobo, 32)){\n Food_Chocobo.opacity = 0;\n\n\n }\n \n if(player.within(Tired_Chocobo, 32)){\n \n\n if(Food_Chocobo.opacity === 0){\n\n Food_Chocobo.x = 10 * 6;\n Food_Chocobo.y = 10 * 48;\n Food_Chocobo.opacity = 1;\n }\n if(Food_Chocobo.within(Tired_Chocobo, 32)){\n\n Tired_Chocobo.opacity = 0;\n \n if(Tired_Chocobo.opacity == 0){\n Up_Chocobo.opacity = 1;\n\n }\n\n }\n\n\n\n\n }\n\n\n\n\n // Hino Jenna Quest !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n \n if(excla_yoda.opacity === 1 && excla_chief.opacity === 1){\n if(player.within(oldman, 32) && excla_Hino.opacity === 0){\n \n excla_yoda.opacity = 0;\n stage.addChild(excla_Hino);\n if(excla_Hino.opacity == 0){\n \n excla_Hino.opacity = 1;\n // excla_Hino.opacity = Math.random(Math.random(0.7), Math.random(1));\n \n \n }\n }\n }\n if(player.within(Theif_Right, 32)){\n stage.removeChild(excla_Hino);\n\n }\n\n \n\n if(player.within(Chief_village, 32)){\n stage.addChild(excla_Jenna);\n \n \n if(excla_yoda.opacity === 1 && excla_chaman.opacity === 0){\n \n if(excla_Jenna.opacity == 0){\n excla_Jenna.opacity = 1;\n \n excla_chief.opacity = 0;\n }\n }\n if(silence_yoda.opacity === 1 && excla_yoda.opacity === 0){\n excla_chaman.opacity = 1;\n excla_chief.opacity = 0;\n\n }\n\n \n \n }\n \n \n \n if(player.within(Jenna, 32)){\n\n stage.removeChild(excla_Jenna);\n\n }\n \n });\n\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //Chaman excla Quest !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n stage.addEventListener('enterframe', function(){\n\n \n \n if(excla_yoda.opacity === 0 && excla_chief.opacity === 0){\n \n \n if(excla_chaman.opacity == 0){\n excla_chaman.opacity = 1;\n\n console.log(excla_chaman);\n \n }\n if(player.within(Chaman, 32)){\n\n stage.removeChild(excla_chaman);\n stage.addChild(silence_chaman)\n\n }\n \n \n \n }\n \n });\n\n\n\n\n\n\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //Magician excla -> Sainte !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n\n\n stage.addEventListener('enterframe', function(){\n\n if(player.within(Chaman, 32)){\n \n excla_warrior.opacity = 1;\n if(silence_chaman.opacity = 0){\n silence_chaman.opacity = 1;\n }\n \n\n \n }\n if(player.within(Warrior, 32)){\n\n silence_chaman.opacity = 0;\n excla_Sainte.opacity = 1;\n stage.removeChild(excla_warrior);\n }\n if(player.within(Saint, 16) && silence_chaman.opacity === 0){\n\n stage.removeChild(excla_Sainte);\n silence_yoda.opacity = 0;\n silence_chief.opacity = 0;\n silence_yoda.opacity = 0;\n silence_chaman.opacity = 0;\n \n stage.addChild(inter_aquarius); \n stage.addChild(inter_brother_sainte);\n inter_aquarius.opacity = 1;\n inter_brother_sainte.opacity = 1;\n \n\n \n oldman.x = 10 * 79;\n oldman.y = 10 * 38;\n\n Chaman.x = 10 * 75;\n Chaman.y = 10 * 38;\n\n Warrior.x = 10 * 76;\n Warrior.y = 10 * 37;\n\n stage.addChild(castle_key);\n\n castle_key.opacity = 1;\n \n \n \n\n \n\n }\n if(player.within(castle_key, 15)){\n \n player.x = 10 * 47;\n player.y = 10 * 2;\n\n // King_Statue.x += 50;\n King_Statue.moveBy( 0, -20, 2);\n\n player.opacity = 0.4;\n \n if(!player.within(castle_key, 32)){\n\n stage.removeChild(castle_key);\n\n }\n \n\n }\n\n\n });\n\n \n\n\n\n \n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //CASTLE QUEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n stage.addEventListener('enterframe', function(){\n\n\n if(player.within(Blue_statue, 16) || player.within(tiedup_villager, 16)){\n\n Chaman.x = 10 * 74;\n Chaman.y = 10 * 67;\n oldman.x = 10 * 76;\n oldman.y = 10 * 68;\n Warrior.x = 10 * 86;\n Warrior.y = 10 * 20;\n \n\n if(tiedup_villager.opacity === 0 && Blue_statue.opacity === 0){\n \n \n stage.addChild(knowledge_stone);\n \n \n \n if(knowledge_stone.opacity == 0){\n knowledge_stone.opacity = 1;\n \n \n }\n if(player.within(knowledge_stone, 16)){\n \n player.x = 10 * 70;\n player.y = 10 * 34;\n player.opacity = 1;\n playerSpeed = 5;\n \n knowledge_stone.opacity = 0;\n \n \n \n stage.addChild(excla_Phenix);\n \n \n \n if(excla_Phenix.opacity == 0){\n \n excla_Phenix.opacity = 1;\n }\n \n \n \n }\n \n }\n }\n\n\n \n if(player.within(tiedup_villager, 16)){\n inter_brother_sainte.opacity = 0;\n tiedup_villager.opacity = 0;\n Saint.x = 10 * 84;\n Saint.y = 10 * 22;\n\n if(tiedup_villager.opacity = 0){\n stage.removeChild(tiedup_villager);\n\n }\n \n \n\n }\n if(player.within(Blue_statue, 16)){\n inter_aquarius.opacity = 0;\n Blue_statue.opacity = 0;\n if(Blue_statue.opacity == 0){\n stage.removeChild(Blue_statue);\n }\n\n }\n\n \n\n\n });\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n //Phenix Quest !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n stage.addEventListener('enterframe', function(){\n\n\n\n if(player.within(Tiamat, 32)){\n \n stage.removeChild(excla_Phenix);\n stage.addChild(Aquarius_spirit);\n if(Aquarius_spirit.opacity < 1){\n Aquarius_spirit.opacity += 0.055;\n\n\n }\n if(excla_Aquarius.opacity == 0){\n\n excla_Aquarius.opacity = 1;\n \n console.log(excla_Aquarius);\n }\n\n // Aquarius_spirit.fadeTo(+ 0.023, 2);\n \n }\n \n\n if(player.within(Aquarius_spirit, 32)){\n\n excla_Aquarius.opacity = 0\n if(silence_Statue_Aquarius.opacity == 0){\n silence_Statue_Aquarius.opacity = 1;\n\n }\n \n \n \n\n\n }\n if(player.within(aquarius_statue, 32)){\n silence_Statue_Aquarius.opacity = 0;\n\n stage.addChild(excla_Nehemiel);\n \n if(excla_Aquarius.opacity === 0 && silence_Statue_Aquarius.opacity === 0){\n \n \n player.x = 10 * 64;\n player.y = 10 * 70;\n // // player.opacity = Math.random(Math.random(1), Math.random(0.7), player.age * 1);\n \n \n // if(game.input){\n // player.opacity = 1;\n \n // }\n }\n \n if(excla_Nehemiel.opacity == 0){\n excla_Nehemiel.opacity = 1;\n\n }\n \n \n }\n \n \n \n });\n\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n // ANGEL's TEMPLE QUEST !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! \n\n\n stage.addEventListener('enterframe', function(){\n\n\n\n if(player.within(Nehemiel, 16)){\n stage.addChild(silence_Cupidon);\n stage.addChild(silence_Husim);\n \n excla_Nehemiel.opacity = 0;\n\n\n if(silence_Husim.opacity == 0){\n silence_Husim.opacity = 1;\n }\n if(silence_Cupidon.opacity == 0){\n silence_Cupidon.opacity = 1;\n\n }\n\n\n }\n\n if(player.within(Cupidon, 32) && silence_Cupidon.opacity === 1){\n \n silence_Cupidon.opacity = 0;\n \n if(silence_Husim.opacity === 0 && silence_Cupidon.opacity === 0 ){\n stage.addChild(excla_Ananai);\n \n if(excla_Ananai.opacity == 0){\n excla_Ananai.opacity = 1;\n \n }\n \n }\n \n \n }\n\n if(player.within(Husim, 32)){\n\n silence_Husim.opacity = 0;\n\n }\n\n \n\n if(player.within(Yellow_statue, 32) && silence_Cupidon.within(Cupidon, 32)){\n\n excla_Ananai.opacity = 0;\n\n Tears_God.opacity = 0;\n\n\n\n if(excla_Ananai.opacity == 0){\n\n stage.removeChild(excla_Ananai);\n\n }\n if(Tears_God.opacity == 0){\n stage.removeChild(Tears_God);\n\n }\n stage.addChild(excla_chaman_2);\n stage.addChild(excla_yoda_2);\n player.x = 10 * 70;\n player.y = 10 * 65;\n\n\n if(excla_chaman_2.opacity == 0){\n excla_chaman_2.opacity = 1;\n\n }\n\n if(excla_yoda_2.opacity == 0){\n excla_yoda_2.opacity = 1;\n\n }\n \n\n }\n\n\n\n });\n\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n // JOURNEY IN HELL !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\n stage.addEventListener('enterframe', function(){\n\n if(player.within(Chaman, 32) && excla_chaman_2.within(Chaman, 32)){\n\n excla_chaman_2.opacity = 0;\n\n\n\n }\n \n if(player.within(oldman, 32) && excla_yoda_2.within(oldman, 32)){\n\n excla_yoda_2.opacity = 0;\n \n }\n\n \n if(player.within(oldman, 32) && player.within(Chaman, 32)){\n\n\n \n if(excla_yoda_2.within(oldman, 32) && excla_chaman_2.within(Chaman, 32)){\n\n player.x = 10; //TP hell\n player.y = 10 * 79;\n stage.addChild(excla_Izanami);\n \n \n if(excla_Izanami.opacity == 0){\n excla_Izanami.opacity = 1;\n\n }\n\n\n }\n\n\n }\n\n\n\n if(player.within(Red_statue, 16)){\n\n stage.addChild(excla_Pillar);\n excla_Izanami.opacity = 0;\n\n if(excla_Pillar.opacity == 0){\n excla_Pillar.opacity = 1;\n }\n\n\n\n\n }\n\n if(player.within(Pillar1, 32)){\n\n stage.addChild(Izanami);\n excla_Pillar.opacity = 0;\n \n \n if(Izanami.opacity < 1){\n Izanami.opacity += 0.019;\n\n }\n if(silence_flame.opacity == 0){\n silence_flame.opacity = 1;\n }\n\n\n }\n \n if(player.within(flame, 32)){\n\n player.x = 10 * 70;\n player.y = 10 * 74;\n\n Chaman.x = 10 * 88;\n Chaman.y = 10 * 12;\n\n oldman.x = 10 * 25;\n oldman.y = 10 * 50;\n\n silence_flame.opacity = 0;\n flame.opacity = 0;\n stage.removeChild(excla_Pillar);\n\n if(flame.opacity == 0){\n \n stage.removeChild(flame);\n }\n if(Izanami.opacity > 0 && Aquarius_spirit.opacity > 0){\n\n\n Guardian_tree.opacity = 0; //TREE OPen\n \n if(Guardian_tree.opacity > 0.025){\n Guardian_tree.opacity -= 0.025;\n\n if(Guardian_tree.opacity == 0 ){\n stage.removeChild(Guardian_tree);\n \n }\n\n }\n \n \n }\n\n\n\n }\n \n if(player.within(Knowledge_tree, 120)){\n\n stage.addChild(book);\n \n if(book.opacity == 0){\n \n \n book.opacity = 1;\n \n \n }\n \n }\n if(player.within(book, 8)){\n\n if(book.opacity == 1){\n book.opacity -= 0.75;\n\n\n }\n if(flame.opacity == 0){\n flame.opacity = 1;\n }\n\n if(Tears_God.opacity == 0){\n Tears_God.opacity = 1;\n\n }\n if(Growth.opacity == 0){\n Growth.opacity += 0.25;\n \n\n }\n if(Growth.opacity = 1){\n game.end();\n }\n\n }\n \n\n if(book.opacity == 1){\n stage.addChild(Lose);\n if(Lose.opacity == 0){\n Lose.opacity = 1;\n\n\n }\n\n\n\n }\n \n });\n\n \n \n\n\n\n\n\n\n\n\n\n\n\n //#############################################################\n //#############################################################\n // object in oject !!! \n\n \n\n\n\n //RootScene event -> display text\n\n\n \n game.rootScene.addEventListener('enterframe', function(){\n \n\n \n \n\n\n if(player.within(ElBarto, 16)){\n \n let Bandit_str = \"ElBarto: Ne te soucies pas, de ne pas être remarqué. Cherche plutôt à faire quelque chose de remarquable.\";\n info.text = Bandit_str;\n\n }\n\n\n\n\n //Sacred village\n\n if(player.within(Chief_village, 32)){\n\n if(excla_yoda.opacity === 1){\n let start_chief = \"Bonjour, Aventurier, une relique de grand pouvoir à été voler par le roi nous devont réunir les sages. Va voir Jenna pour avoir plus d'info\";\n info.text = start_chief;\n }\n\n if(excla_yoda.opacity === 0){\n let Chief_str = \"Sacred forest's chief: J'entends la raison de ta venue, le chef du village de la terre du milieu est sage. Nos souffrances proviennent d'un même maux. Va voir le chaman, nous allons ensemble réfléchir à un moyen d'arrêter le roi...\";\n info.text = Chief_str;\n\n\n }\n \n \n \n }\n\n if(player.within(Dragon_Statue, 32)){\n\n let Dragon_str = \"On a toujours à apprendre des autres, même quand on le sait déjà.\";\n let Dragon_str2 = \"Regardez vers les étoiles et pas vers vos pieds. Essayez de donner un sens à ce que vous voyez, et demandez-vous ce qui fait que l'univers existe. Soyez curieux.-> Stephen Hawking\";\n info.text = Dragon_str + Dragon_str2;\n }\n\n\n \n\n\n \n\n if(player.within(Yi, 8)){\n \n let Yi_str = \"Lazy Peon: Nous voulons un monde qui procure du travail à chacun, un moyen de vivre à ceux qui sont hors d'état de travailler et une demeure des hommes ou toutes les âmes s'agrandiront...: Robespierre\";\n info.text = Yi_str;\n \n \n }\n\n\n if(player.within(King, 32)){\n \n let King_str = \"<br>King: my wife's lover!!\";\n let king_str2 = \"<br>You has been kill by the King!\";\n \n info.text = King_str + king_str2;\n }\n\n\n \n\n\n if(player.within(kolima_shop, 32)){\n let kolima_shop_str = \"Shop: Closed\";\n info.text = kolima_shop_str;\n }\n\n\n if(player.within(Venus_Statue, 32)){\n let Venus_Statue_str = \"Venus: Le plus beau triomphe de l'écrivain est de faire penser ceux qui peuvent penser...\";\n info.text = Venus_Statue_str;\n \n }\n\n\n if(player.within(Jenna, 32)){\n\n let Jenna_str = \"Jenna: L'arbre de vie se meurt depuis que le roi utilise les pouvoirs de la relique d'Aquarius.<br> Citation: Un combattant de la liberté apprend de façon brutale que c'est l'oppresseur qui définit la nature de la lutte, il ne reste souvent à l'opprimé d'autre recours que d'utiliser les méthodes qui reflètent celles de l'oppresseur. N.Mandela \";\n info.text = Jenna_str;\n\n }\n\n\n if(player.within(Ishtar_Statue, 32)){\n\n let Ishtar_str = \"Ishtar: Aimer, ce n'est pas se regarder l'un l'autre, c'est regarder ensemble dans la même direction.\";\n info.text = Ishtar_str;\n\n }\n\n\n if(player.within(Saint, 32)){\n\n let Saint_str = \"The Sainte: Enfin les 2 villages ont décider de s'unir. Mon frère a été capturer pour sa forte affinité à la magie d'aquarius et l'ont forcé à utiliser ses pouvoirs pour la capturer grâce à des sorts interdits depuis des temps anciens\";\n info.text = Saint_str;\n \n }\n\n\n\n if(player.within(blue_man, 32)){\n\n let blue_man_str = \"sauve-nous de ce désastre...\";\n\n info.text = blue_man_str;\n\n }\n\n\n\n if(player.within(Theif_Right, 32)){\n let Theif_Right_str = \"Hino: Le roi à perdu la raison depuis qu'il détient la relique d'Aquarius,ils nous dépoyent de nos richesses et crée des conflits d'intérêt entre les 2 villages. Nous devons aller de l'avant... Va voir le Chef du village Sacré\";\n\n info.text = Theif_Right_str;\n\n }\n\n\n\n if(player.within(Tiamat, 32)){\n\n if(Saint.within(Yi, 32)){\n let Tiamat_str = \"Phenix: Approche et concentre toi, je vais t'aider à entrer dans son temple.<br>Citation:Préjugé, vanité, calcul, voilà ce qui gouverne le monde. Celui qui ne connaît pour règle de sa conduite que raison, vérité,sentiment,n'a presque rien de commun avec la société.\";\n info.text = Tiamat_str;\n\n\n }\n \n }\n\n\n\n if(player.within(Felix_Situp, 32)){\n \n let Felix_Situp_str = \"Shinji: La guerre... le seul divertissement de roi où les peuples aient leur part !\";\n info.text = Felix_Situp_str;\n \n }\n\n\n\n if(player.within(fallen_Sheba, 32)){\n let fallen_Sheba_str = \"Meliodas: Laisse moi dormir en paix!\";\n\n info.text = fallen_Sheba_str;\n }\n\n\n \n\n\n\n if(player.within(Menardi_Small, 32)){\n let Menardi_Small_str = \"Asuka: La forêt se défend afin de protéger Gaïa\";\n info.text = Menardi_Small_str;\n\n }\n\n\n\n //SIGN !!!!!!!!!!!!!!\n\n\n if(player.within(sign_phenix, 32)){\n let sign_phenix_str = \"Phenix Sanctuary\";\n info.text = sign_phenix_str;\n\n }\n\n\n\n if(player.within(sign_shop, 32)){\n let sign_shop_str = \"Sorcerer's shop\"\n info.text = sign_shop_str;\n }\n\n\n\n if(player.within(sign_castle, 32)){\n let sign_castle_str = \"King's castle:\";\n \n info.text = sign_castle_str;\n\n }\n\n\n\n if(player.within(sign2, 32)){\n let sign2_str = \"Aquarius Temple\";\n \n info.text = sign2_str; \n }\n\n\n\n if(player.within(Warrior, 32)){\n let Warrior_str = \"Je peux ressentir la souffrance de la forêt sacrée, si les sages se sont mis d'accord et ont un plan, je suis prêt à me joindre à vous. Rejoignons-nous auprès de la Sainte Guardienne!\"; \n info.text = Warrior_str;\n }\n\n\n\n\n\n\n\n\n\n ///STORY LINE #######################################\n\n\n \n\n if(oldman.within(Warrior, 32) && Saint.within(Chaman, 32)){\n\n \n let union_plan = \"Nous allons pouvoir commencer le rituel, prends cette clée, elle te téléportera et nous t'apporterons l'invisibilité nécessaire pour traverser le château sans problème. Libère Aquarius et le frère de la Sainte. Aquarius t'aiderais très probablement à revenir, courage !\"\n info.text = union_plan ;\n\n if(!oldman.within(Warrior, 32) && !Saint.within(Chaman, 32)){\n\n info.text = \"\";\n \n }\n\n \n }\n\n \n\n //#################################################\n //Castle quest !!!!################################\n\n if(player.within(tiedup_villager, 32)){\n \n \n let tiedup_villager_str = \"Brother's Saint: Merci de m'avoir sauver!! Je te serais éternellement reconnaissant...\";\n info.text = tiedup_villager_str;\n }\n \n \n if(player.within(Blue_statue, 32)){\n let Aquarius_quest = \"Je suis heureux d'entendre que les hommes se soient unis afin de remettre de l'ordre dans notre monde.<br> Je suis épuisé, prends ma relique pour te ramener au sanctuaire, demande de l'aide au Phenix afin de rentrer dans mon temple, ton initiation ne fait que commencé.\";\n info.text = Aquarius_quest;\n }\n\n\n\n if(player.within(graal, 8)){\n let graal_str = \"U obtain The Saint Graal, the power of Alexandre Astier is yours\";\n \n info.text = graal_str;\n \n }\n\n\n\n if(player.within(treasure, 8)){\n let treasure_str = \"king's chest, some strange things are inside\";\n info.text = treasure_str;\n }\n\n\n\n if(player.within(soldier1, 32)){\n let soldier1_str = \"Go away !\";\n info.text = soldier1_str;\n\n }\n\n\n\n\n\n ////////////!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n ///Aquarius Temple###############################\n\n\n\n if(player.within(aquarius_statue, 32)){\n \n let aquarius_str = \"Sur la statue est inscrit: β Aquarii, Est l'étoile la plus brillante de la constellation du Verseau. Elle porte également le nom traditionnel Sadalsuud signifiant « chance des chances ».\";\n info.text = aquarius_str;\n }\n\n if(player.within(Aquarius_spirit, 32)){\n\n let Aquarius_temple_str = \"Pour rétablir l'équilibre de ce monde, tu dois partir découvrir le monde des anges et des démons et récupérer les 2 autres reliques afin d'avoir le pouvoir de faire renaître Gaïa protégé par la forêt sacrée! Bois l'eau de la fontaine, elle t'enverra dans le monde des anges\";\n info.text = Aquarius_temple_str;\n\n }\n\n\n\n\n\n\n\n\n\n\n //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n // ANGEL's TEMPLE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!<3!!!!!!!!!!!!!!!!!!!!\n\n\n if(player.within(Nehemiel, 32)){\n\n let Nehemiel_lesson = \"Les idées justes éclosent lorsque le coeur, la mémoire et la pensée sont en harmonie...\";\n info.text = Nehemiel_lesson;\n\n }\n\n if(player.within(Husim, 32)){\n\n let Husim_str = \"On dit: Malheur à celui qui tombe et qui n'a personne pour le reveler, mon pouvoir t'empêchera de sombrer et de quitter le monde des hommes.\";\n\n info.text = Husim_str;\n \n }\n\n if(player.within(Cupidon, 32)){\n \n let Cupidon_str = \"Love looks not with the eyes, but with the mind, and therefore is winged Cupid painted blind \";\n info.text = Cupidon_str;\n }\n\n if(player.within(Yellow_statue, 32)){\n \n let Yellow_statue_str = \"Mètis: Maintenant que ton initiation est terminer auprès de nous, tu peux rentrer et continuer ta destiné. Les sages t'attendent à l'entrée de la forêt sacrée. <br>Citation: Le sage, sans agir, oeuvre. Lao Tseu \";\n info.text = Yellow_statue_str;\n\n }\n\n\n //###############################################################################\n //HELL QUEST ##########################################\n\n\n if(player.within(Chaman, 32)){\n \n\n if(silence_chief.opacity == 1){\n let Chaman_str = \"Chaman-Yallam: \";\n \n let Chaman_str2 = \"Maintenant que les 2 sages sont réunis et enfin d'accord, va voir le jeune mage\";\n \n info.text = Chaman_str + Chaman_str2;\n\n\n }\n \n \n if(Chaman.within(oldman, 32)){\n \n let Chaman_hell_str = \"Bois une gorgée de cet excellent breuvage, ensuite parle au sage du village du milieu.\";\n info.text = Chaman_hell_str;\n }\n\n \n }\n\n if(player.within(oldman, 32)){\n \n \n if(excla_chief.opacity === 1){\n \n let oldman_start = \"Bonjour, aventurier, le savoir se perd, le roi a capturé aquarius déesse et soutire le pouvoir d'une effroyable sorcière, nous devons âgir au plus vite, passe voir Hino pour prendre connaissance de la situation\";\n info.text = oldman_start;\n }\n\n if(excla_chief.opacity === 0){\n let oldman_answerd = \"Je suis prêt à joindre mes forces pour arrêter le roi, retourne auprès du Chaman du village sacrée\";\n \n info.text = oldman_answerd;\n\n\n }\n \n \n if(oldman.within(Chaman, 32)){\n\n let oldman_hell = \"Pars visiter l'enfer, pour te connaitre un peu plus, je serais ton guide\";\n info.text = oldman_hell;\n\n } \n \n \n }\n\n if(player.within(Red_statue, 32)){\n\n let Red_statue_str = \"Un étranger dans la demeure des démons, prouve ta valeur auprès de la stèle des tourments, si tu réussis j'apparaitrais sous ma vrai forme et t'offriras ma relique\";\n info.text = Red_statue_str;\n }\n \n if(player.within(Pillar1, 32)){\n \n let pillar_message = \"Stone:L'homme est un accident <br/> de parcours, dans un cosmos vide et froid. Il est un enfant du hasard.\";\n info.text = pillar_message;\n\n if(Izanami.opacity > 0){\n\n let Izanami_str = \"Souffrance, Désespoir,Haine, Malheur t'apportera flamme éternelle. Je te permets de me l'emprunter afin de retrouver une stabilité entre nos mondes\";\n info.text = Izanami_str;\n\n }\n\n }\n \n \n if(Izanami.opacity > 0){\n\n let End_game_str = \"La forêt s'ouvre à toi, apporte les reliques auprès de l'arbre sacrée qui renferme Gaïa.\";\n info.text = End_game_str;\n\n if(player.within(Guardian_tree, 32)){\n\n info.text = \"\";\n\n }\n }\n\n if(player.within(Knowledge_tree, 160)){\n \n let Gaia_str = \"Le vent se lève, un livre mystérieux semble vous appeler...\";\n info.text = Gaia_str;\n }\n\n\n\n\n //ITEMS ETC...\n\n if(player.within(sword, 8)){\n\n let sword_str = \"Tu as obtenu l'épée d'excalibur\";\n info.text = sword_str;\n\n \n }\n\n\n\n if(player.within(piece2, 32)){\n let piece2_str = \"Pièce d'une ancienne civilisation\";\n info.text = piece2_str;\n\n }\n\n if(player.within(crown, 8)){\n let crown_str = \"Tu as obtenu la couronne du roi\";\n info.text = crown_str;\n }\n\n if(player.within(piece, 8)){\n let piece_str = \"une pièce dont la déesse Aquarius est représenté\";\n info.text = piece_str;\n\n }\n\n\n //END GAME !!!!!!!\n \n if(player.within(book, 8)){\n let book_str = \"Gaïa renaît, l'équilibre entre les mondes semblent s'être stabilisé, Le roi retrouve ses esprits peu à peu .Tu seras dorénavant Guardien de la forêt sacrée!: Multinationnal arrêtez de vouloir controler la nature, comprenez et aimez la!\";\n info.text = book_str;\n\n }\n if(player.within(Lose, 32)){\n\n let start = \"un nouveau départ \";\n info.text = start;\n \n game.end();\n \n }\n \n\n });\n\n\n }\n\n\n //lancement de la fonction start du framework et démarrage du jeu \n game.start();\n \n}", "title": "" }, { "docid": "7c43db49ad3aa523d2f7857d46990a76", "score": "0.6494471", "text": "function newGame() {\n catBreeds = [\n \"Abyssinian\",\n \"Aegean\",\n \"American Curl\",\n \"American Bobtail\",\n \"American Shorthair\",\n \"American Wirehair\",\n \"Arabian Mau\",\n \"Australian Mist\",\n \"Asian\",\n \"Balinese\",\n \"Bambino\",\n \"Bengal\",\n \"Birman\",\n \"Bombay\",\n \"Brazilian Shorthair\",\n \"British Shorthair\",\n \"British Longhair\",\n \"Burmese\",\n \"Burmilla\",\n \"California Spangled\",\n \"Chantilly-Tiffany\",\n \"Chartreux\",\n \"Chausie\",\n \"Cheetoh\",\n \"Colorpoint Shorthair\",\n \"Cornish Rex\",\n \"Cymric\",\n \"Cyprus\",\n \"Devon Rex\",\n \"Donskoy\",\n \"Dragon Li\",\n \"Dwarf cat\",\n \"Egyptian Mau\",\n \"European Shorthair\",\n \"Exotic Shorthair\",\n \"Foldex\",\n \"German Rex\",\n \"Havana Brown\",\n \"Highlander\",\n \"Himalayan\",\n \"Japanese Bobtail\",\n \"Javanese\",\n \"Karelian Bobtail\",\n \"Khao Manee\",\n \"Korat\",\n \"Korean Bobtail\",\n \"Korn Ja\",\n \"Kurilian Bobtail\",\n \"LaPerm\",\n \"Lykoi\",\n \"Maine Coon\",\n \"Manx\",\n \"Mekong Bobtail\",\n \"Minskin\",\n \"Munchkin\",\n \"Nebelung\",\n \"Napoleon\",\n \"Norwegian Forest cat\",\n \"Ocicat\",\n \"Ojos Azules\",\n \"Oregon Rex\",\n \"Oriental Bicolor\",\n \"Oriental Shorthair\",\n \"Oriental Longhair\",\n \"PerFold\",\n \"Persian\",\n \"Peterbald\",\n \"Pixie-bob\",\n \"Raas\",\n \"Ragamuffin\",\n \"Ragdoll\",\n \"Russian Blue\",\n \"Russian White\",\n \"Sam Sawet\",\n \"Savannah\",\n \"Scottish Fold\",\n \"Selkirk Rex\",\n \"Serengeti\",\n \"Serrade petit\",\n \"Siamese\",\n \"Siberian\",\n \"Singapura\",\n \"Snowshoe\",\n \"Sokoke\",\n \"Somali\",\n \"Sphynx\",\n \"Suphalak\",\n \"Thai\",\n \"Thai Lilac\",\n \"Tonkinese\",\n \"Toyger\",\n \"Turkish Angora\",\n \"Turkish Van\",\n \"Ukrainian Levkoy\"\n ];\n\n wrongLetters = [];\n correctLetters = [];\n wins = 0;\n guessesRemaining = 10;\n currentWord = catBreeds[Math.floor(Math.random() * catBreeds.length)];\n updateHtml();\n}", "title": "" }, { "docid": "34c8c21406d3a3e2f79868b74083c58a", "score": "0.64805263", "text": "function doReb() {\n\n var possPlayersDREB = this.DEFteam.players;\n var possPlayersOREB = this.OFFteam.players;\n\n var glassCleaner = Math.random();\n\n //Defensive Rebunders\n for (let i = 0; i < possPlayersDREB.length; i++) {\n var defenderREB = possPlayersDREB.sort(function (a, b) {\n return a.TRBpct - b.TRBpct\n });\n this.selectedPlayerDREB = defenderREB[Math.floor(Math.random() * defenderREB.length)];\n }\n //Offensive Rebounders\n for (let i = 0; i < possPlayersOREB.length; i++) {\n var teamMateREB = possPlayersOREB.sort(function (a, b) {\n return b.TRBpct - a.TRBpct\n });\n this.selectedPlayerOREB = teamMateREB[Math.floor(Math.random() * teamMateREB.length)];\n }\n // console.log((((this.selectedPlayerOREB.ORBpct/10) + this.OFFteam.offense/100) / ((this.selectedPlayerDREB.DRBpct/10) + (this.selectedPlayerDREB.TRBpct/100))));\n\n // console.log(this.selectedPlayerDREB);\n\n //OFF rebound check\n if ((((this.selectedPlayerOREB.ORBpct / 10) + this.OFFteam.offense / 100) / ((this.selectedPlayerDREB.DRBpct / 10) + (this.selectedPlayerDREB.TRBpct / 100)) / 6) > Math.random()) {\n this.selectedPlayerOREB.REB += 1;\n this.selectedPlayerOREB.OREB += 1;\n this.OFFteam.REB += 1;\n this.OFFteam.OREB += 1;\n // this.gameLog.push(this.selectedPlayerOREB.ORBpct/10) + this.OFFteam.offense/100 / ((this.selectedPlayerDREB.DRBpct/100) + (this.selectedPlayerDREB.TRBpct/100));\n this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.OFFteam.tag + \" - \" + this.selectedPlayerOREB.name + \" grabbed the offensive rebound!\");\n this.gameLog.push(this.selectedPlayerOREB.name + \"(\" + this.OFFteam.tag + \")\" + \" REB: \" + (this.selectedPlayerOREB.REB) + \" OREB: \" + this.selectedPlayerOREB.OREB);\n //update time and go through player matchups again\n simPossession();\n return \"orb\";\n }\n //DEF rebound\n //For better distribution, a few checks\n else {\n //If their DRBpct > a random number, they get it\n if (this.selectedPlayerDREB.DRBpct / 100 > glassCleaner) {\n // console.log(this.selectedPlayerDREB);\n // console.log(this.selectedPlayerDef);\n // console.log(this.selectedPlayerDREB.DRBpct/100);\n this.selectedPlayerDREB.REB += 1;\n this.DEFteam.REB += 1;\n this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.DEFteam.tag + \" - \" + this.selectedPlayerDREB.name + \" grabbed the defensive rebound.\");\n this.gameLog.push(this.selectedPlayerDREB.name + \"(\" + this.DEFteam.tag + \")\" + \" REB: \" + (this.selectedPlayerDREB.REB));\n changePossession();\n return \"drb\";\n }\n //If it's less than a random number, another player gets a chance at the rebound\n else if (this.selectedPlayerDREB.DRBpct / 100 < glassCleaner) {\n\n //If they are different, the one with the higher TRB% will get the rebound\n //Some players just concede rebounds to their teammates who are known for rebounding.\n if (this.selectedPlayerDREB != this.selectedPlayerDef) {\n\n\n if (this.selectedPlayerDREB.TRBpct < this.selectedPlayerDef.TRBpct) {\n this.selectedPlayerDef.REB += 1;\n this.DEFteam.REB += 1;\n this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.DEFteam.tag + \" - \" + this.selectedPlayerDef.name + \" grabbed the defensive rebound.\");\n this.gameLog.push(this.selectedPlayerDef.name + \"(\" + this.DEFteam.tag + \")\" + \" REB: \" + (this.selectedPlayerDef.REB));\n changePossession();\n return \"drb\";\n }\n\n else {\n this.selectedPlayerDREB.REB += 1;\n this.DEFteam.REB += 1;\n this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.DEFteam.tag + \" - \" + this.selectedPlayerDREB.name + \" grabbed the defensive rebound.\");\n this.gameLog.push(this.selectedPlayerDREB.name + \"(\" + this.DEFteam.tag + \")\" + \" REB: \" + (this.selectedPlayerDREB.REB));\n changePossession();\n return \"drb\";\n\n }\n }\n\n //If the Defensive Player and the Rebounder are the same player\n // for loop and re-sort by DRB%\n // Rebound goes to the best 3 defensive rebounders randomly \n //This prevents players not known for grabbing a lot of rebounds from doing so\n //The best rebounders are usually forwards and centers, some shooting guards are good rebounders\n //Few PGs will get rebounds in this scenario, if any\n else if (this.selectedPlayerDREB = this.selectedPlayerDef) {\n\n for (let i = 0; i < possPlayersDREB.length; i++) {\n var defenderREB = possPlayersDREB.sort(function (a, b) {\n return b.DRBpct - a.DRBpct\n });\n\n this.selectedPlayerDREB = defenderREB[Math.floor(Math.random() * 3)];\n }\n\n\n // console.log(this.selectedPlayerDREB);\n this.selectedPlayerDREB.REB += 1;\n this.DEFteam.REB += 1;\n this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.DEFteam.tag + \" - \" + this.selectedPlayerDREB.name + \" grabbed the defensive rebound.\");\n this.gameLog.push(this.selectedPlayerDREB.name + \"(\" + this.DEFteam.tag + \")\" + \" REB: \" + (this.selectedPlayerDREB.REB));\n changePossession();\n return \"drb\";\n\n\n }\n\n }\n // else {\n // this.selectedPlayerDef.REB +=1;\n // this.DEFteam.REB +=1;\n // this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.DEFteam.tag + \" - \" + this.selectedPlayerDef.name + \" grabbed the defensive rebound.\");\n // this.gameLog.push(this.selectedPlayerDef.name + \"(\"+this.DEFteam.tag+\")\" + \" REB: \" + (this.selectedPlayerDef.REB));\n // changePossession();\n // return \"drb\";\n // }\n // console.log(this.selectedPlayerDREB);\n // this.selectedPlayerDREB.REB +=1;\n // this.DEFteam.REB +=1;\n // this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.DEFteam.tag + \" - \" + this.selectedPlayerDREB.name + \" grabbed the defensive rebound.\");\n // this.gameLog.push(this.selectedPlayerDREB.name + \"(\"+this.DEFteam.tag+\")\" + \" REB: \" + (this.selectedPlayerDREB.REB));\n // changePossession();\n // return \"drb\";\n }\n}", "title": "" }, { "docid": "d55e4da78097f394deb1a3d134fc6d81", "score": "0.64395034", "text": "function rush() {\n activeCondition = \"SPEED\";\n // Increase speed of ball\n ball.faster();\n // Trigger narration() to display descriptive text\n gameTitle = \"WHITE RABBIT\";\n displayTitle = true;\n // Stop Perlin noise and move white rabbit quickly across screen\n whiteRabbit.fast = true;\n if (whiteRabbit.isOffScreen()) {\n whiteRabbit.reset();\n }\n // Revert to original behaviour and DEFAULT condition after 10 sec\n setTimeout(textTimer,10000);\n setTimeout(speedTimer,10000);\n}", "title": "" }, { "docid": "36f4ea016912bd4ee2d80eee5f01ba32", "score": "0.6437194", "text": "function spinReels() {\n if (wonJackpot) {\n wonJackpot = false;\n stage.removeChild(jackpotWon);\n stage.addChild(jackpotTotal);\n }\n\n var betLine = [\" \", \" \", \" \"];\n var outCome = [0, 0, 0];\n\n for (var spin = 0; spin < 3; spin++) {\n outCome[spin] = Math.floor((Math.random() * 65) + 1);\n switch (outCome[spin]) {\n case checkRange(outCome[spin], 1, 27): // 41.5% probability\n betLine[spin] = \"blank\";\n blanks++;\n break;\n case checkRange(outCome[spin], 28, 37): // 15.4% probability\n betLine[spin] = \"grape\";\n grapes++;\n break;\n case checkRange(outCome[spin], 38, 46): // 13.8% probability\n betLine[spin] = \"banana\";\n bananas++;\n break;\n case checkRange(outCome[spin], 47, 54): // 12.3% probability\n betLine[spin] = \"orange\";\n oranges++;\n break;\n case checkRange(outCome[spin], 55, 59): // 7.7% probability\n betLine[spin] = \"cherry\";\n cherries++;\n break;\n case checkRange(outCome[spin], 60, 62): // 4.6% probability\n betLine[spin] = \"bar\";\n bars++;\n break;\n case checkRange(outCome[spin], 63, 64): // 3.1% probability\n betLine[spin] = \"lemon\";\n lemons++;\n break;\n case checkRange(outCome[spin], 65, 65): // 1.5% probability\n betLine[spin] = \"seven\";\n sevens++;\n break;\n }\n }\n return betLine;\n}", "title": "" }, { "docid": "814be6b916fabd92b183af3cfb358f85", "score": "0.640726", "text": "function pilgrimDropping() {\n this.findDropoffs();\n if (this.dropoffs.length == 0) {\n return this.move(...this.randomMove());\n }\n // return to normal turn function\n let restore = () => {\n if (this.karbonite < 25 && !this.karbonite_map[this.queue[0][1]][this.queue[0][0]]) {\n while (!this.karbonite_map[this.queue[0][1]][this.queue[0][0]])\n this.queue.push(this.queue.shift()); // cycle if mining fuel when needing karbonite\n } else if (this.fuel < 100 && !this.fuel_map[this.queue[0][1]][this.queue[0][0]]) {\n while (!this.fuel_map[this.queue[0][1]][this.queue[0][0]])\n this.queue.push(this.queue.shift()); // the opposite\n }\n this.turn = pilgrimTurn;\n }\n let [x, y] = this.dropoffs.reduce((a, b) =>\n this.dist([this.me.x, this.me.y], a) < this.dist([this.me.x, this.me.y], b) ? a : b);\n let [z, w] = this.randomMove.call({ // center move on castle\n occupied: (x, y) =>\n y < 0 || x < 0 || y >= this.map.length\n || x >= this.map[0].length || !this.map[y][x],\n me: {x: x, y: y},\n });\n for (let i of this.getVisibleRobots()) {\n if (i.unit <= 1 && i.team == this.me.team\n && Math.abs(i.x - this.me.x) <= 1\n && Math.abs(i.y - this.me.y) <= 1) {\n restore();\n if (this.occupied(i.x, i.y))\n return this.give(i.x - this.me.x, i.y - this.me.y, this.me.karbonite, this.me.fuel);\n else return;\n }\n }\n let route = this.path([x + z, y + w]);\n if (route.length && this.fuel > 5) {\n let [dx, dy] = route[0];\n return this.move(dx, dy);\n } else {\n if (x == this.me.x - z && y == this.me.y - w) {\n restore();\n if (this.occupied(x, y))\n return this.give(-z, -w, this.me.karbonite, this.me.fuel);\n else\n return;\n }\n }\n}", "title": "" }, { "docid": "f3b90ad88b0a7a9d4e15a1561455891d", "score": "0.6397545", "text": "function playing() {\n\n // если страница закрыта (нет возможности найти элемент баланс), то открыть вкладку\n // и перейти на страницу freebitco.in\n if (window.document.getElementById(\"balance\") == null) {\n window.open(\"https://freebitco.in\", \"_blank\");\n wait(5);\n iimPlayCode('TAG POS=1 TYPE=A ATTR=TXT:Got<SP>it!');\n } else {\n wait(3);\n iimPlayCode('REFRESH\\nWAIT SECONDS=#DOWNLOADCOMPLETE#');\n wait(3);\n }\n\n var balance = parseFloat(getBalance());\n var koefic = 0.15; // коэффициент умножения по принципу мартингейл 4\n var maxStep = 13; // максимальное количество шагов getRandomInRange(7, 8);\n var game_bets = []; // массив ставок (вычисляется ниже)\n var pre_game_bets = []; // массив для предварительной (временной) работы\n var streams = getRandomInRange(4, 6); // количество отдновременно играющих потоков\n var percent_array = [108, 108, 216, 144, 108, 87, 72]; // массив процента ставок (для 1,2 сат)\n // var percent_array = [108, 108, 207, 134, 98, 72]; // массив процента ставок (для 3 сат)\n\n // коэффициент прибыли, относительно ставки\n var percent_profit = percent_array[streams];\n var spines = {}; // для учёта спинов\n\n // устанавливаем ставку и сразу же строим массив ставок по принципу мартингейл 4\n stavkin:\n for (var st = 1; st <= 17; st++) {\n for (var stp = 1; stp <= maxStep + 1; stp++) {\n if (stp == 1) {\n sum = st / 100000000;\n }\n else {\n sum = Math.ceil((sum * 2 + sum * koefic) * 100000000) / 100000000\n }\n pre_game_bets[stp] = sum;\n }\n if (balance < sum && st == 1) {\n log('Играть рано. Ждём минимального баланса:' + str8(sum) + ', а пока баланс:' + str8(balance) + '\\n');\n return;\n }\n if (balance <= sum) {\n var stavka = game_bets[1];\n break stavkin;\n }\n // создание копии массива (не ссылка на предварительный, а копия)\n game_bets = JSON.parse(JSON.stringify(pre_game_bets));\n }\n\n var stopSliv = -1 * game_bets[maxStep]; //Ограничение на слив\n\n //Ограничение на профит\n var stopProfit = (stavka * percent_profit + stavka * getRandomInRange(11, 21)) * streams;\n\n var stopProfit = 0.00000072 + 0.00000001 * getRandomInRange(11, 21);// тест\n\n // переходим на вкладку игры\n window.document.querySelector(\".double_your_btc_link\").click();\n wait(3);\n window.scrollBy(0,550);\n\n // стартовые значения\n var old_balance = balance; // баланс перед игрой\n var games = 0; // сколько игр всего сыграно\n var valueBet = 0; // объём ставок\n var hit = 0; // сколько выигрышных\n\n // массивы для последовательных потоков (streams)\n var g_stavka = [];\n var g_spin = [];\n var g_lo_hi = [];\n\n var start_hi_lo = getRandomInRange(0, 1);\n\n for (i = 1; i <= streams; i++) {\n g_stavka[i] = stavka; // игровая ставка\n g_spin[i] = 1; // ход игры\n g_lo_hi[i] = start_hi_lo; // чтобы стартовало со одинаковой кнопки на всех потоках\n // g_lo_hi[i] = getRandomInRange(0, 1); // кнопка Lo или Hi разная на всех потоках\n }\n\n // основная игра\n multiplyBit:\n while (true) {\n for (i = 1; i <= streams; i++) {\n\n // принцип вписывания нужного значения в поле ставки\n window.document.querySelector('input[type=\"text\"][id=\"double_your_btc_stake\"]').value=str8(g_stavka[i]);\n\n // принцип простого умножения ставки. Нажатие на кнопку.\n // iimPlayCode('TAG POS=1 TYPE=A ATTR=ID:double_your_btc_2x');\n\n if (g_lo_hi[i] == 0) {\n window.document.querySelector(\"#double_your_btc_bet_hi_button\").click();\n } else {\n window.document.querySelector(\"#double_your_btc_bet_lo_button\").click();\n }\n\n valueBet = valueBet + g_stavka[i];\n games++;\n wait(1);\n\n // если игра висит\n proverka:\n for (ji=0; ji<20; ji++) {\n var rollResultHi = window.document.getElementById('double_your_btc_bet_hi_button').getAttribute('disabled');\n if (rollResultHi == null) {\n break proverka;\n }\n else {\n iimDisplay('игра Multiply висит');\n wait(2.5);\n if (ji == 19) {\n log('Freebitcoin: игра Multiply зависла!!!' + ' | ' + str_spines + '\\n');\n break multiplyBit;\n }\n }\n }\n\n var prib = parseFloat(getBalance()) - old_balance;\n\n // сообщение в аймакросе\n iimDisplay('Прибыль MULTIPLY = ' + str8(prib) + ' BTC' +\n '\\nставка: '+ str8(stavka) + ' (' + str8(g_stavka[i]) +\n ')\\nиграем до: '+ str8(stopProfit) + ' [' + streams + ' пот.] [к:' + koefic + ']' +\n '\\nстопСлив: '+ str8(stopSliv) + ' [' + maxStep + ']' +\n '\\nобъём ставок: ' + str8(valueBet));\n\n // прибыль\n if (prib >= stopProfit) {\n if (!spines[String(g_spin[i])]) {\n spines[String(g_spin[i])] = 1;\n } else {\n spines[String(g_spin[i])]++;\n }\n spines['all'] = games;\n spines['hit'] = hit;\n spines['str'] = streams;\n str_spines = JSON.stringify(spines);\n str_spines = str_spines.split('\"').join('')\n str_spines = str_spines.split(',').join(', ')\n log('MULTIPLY: ' + str8(prib) + '(' + getBalance() + ') BTC, ставка: ' + str8(stavka) + ' | объём ставок: ' +\n str8(valueBet) + '\\n | ' + str_spines + '\\n');\n wait(3);\n break multiplyBit;\n }\n\n // слив\n if (g_stavka[i] * -1 <= stopSliv && window.document.getElementById(\"double_your_btc_bet_lose\").style.display == 'block') {\n if (!spines[String(g_spin[i])]) {\n spines[String(g_spin[i])] = 1;\n } else {\n spines[String(g_spin[i])]++;\n }\n spines['all'] = games;\n spines['hit'] = hit;\n spines['sliv'] = String(g_spin[i]) + '(' + str8(g_stavka[i]) + ')';\n spines['str'] = streams;\n str_spines = JSON.stringify(spines);\n str_spines = str_spines.split('\"').join('')\n str_spines = str_spines.split(',').join(', ')\n\n log('СЛИВ!: ' + str8(prib) + '(' + getBalance() + ') BTC, ставка: ' + str8(stavka) + ' | ' + str_spines + '\\n');\n break multiplyBit;\n }\n\n // если проиграли, то увеличиваем ставку\n if (window.document.getElementById(\"double_your_btc_bet_lose\").style.display == 'block') {\n\n g_spin[i]++;\n\n // увеличиваем ставку, беря её из словаря\n g_stavka[i] = game_bets[g_spin[i]];\n\n if (g_spin[i] == maxStep) {\n g_lo_hi[i] = (g_lo_hi[i] == 0) ? 1 : 0; // меняем кнопку\n } else if (g_spin[i] >= maxStep - getRandomInRange(2, 4)) { g_lo_hi[i] = getRandomInRange(0, 1); }\n\n // задержка после проигрышного спина c условием\n // (g_spin[i] > 3) ? wait(getRandomInRange(3, 4)* 0.1 * g_spin[i] + 0) : wait(0.2 + getRandomInRange(0, 1));\n wait(0.2 + getRandomInRange(0, 1));\n\n } else {\n // выиграло\n // объект-массив для статистики на каком ходу был выигрыш\n if (!spines[String(g_spin[i])]) {\n spines[String(g_spin[i])] = 1;\n } else {\n spines[String(g_spin[i])]++;\n }\n\n g_stavka[i] = stavka; // игровая ставка\n g_spin[i] = 1;\n // g_lo_hi[i] = (g_lo_hi[i] == 0) ? 1 : 0; // меняем кнопку\n g_lo_hi[i] = getRandomInRange(0, 1); // меняем кнопку или нет\n hit++;\n wait(0.5);\n }\n }\n }\n}", "title": "" }, { "docid": "e0b1a93e92482f52effaa99d18b9b159", "score": "0.63733035", "text": "function gameLogic() {\n\t\n\t// Se non c'è una bomba a schermo...\n\tif( !isBomb ) {\n\t\t\n\t\t// Modifico la flag, do un valore casuale alla X della bomba e setto la Y della bomba a 0\n\t\tisBomb = 1;\n\t\tbombX = Math.floor( Math.random() * 496 );\n\t\tbombY = 0;\n\t\t\n\t}\n\t// Altrimenti se la bomba è a schermo...\n\telse {\n\t\t\n\t\t// Aggiungo il valore di velocità alla Y della bomba\n\t\tbombY += bombSpeed;\n\t\t\n\t\t// Se la bomba è oltre 480px sulla sua Y...\n\t\tif( bombY >= 480 ) {\n\t\t\t\n\t\t\t// Determino una delta X tra la X della bomba e la X della racchetta\n\t\t\tvar deltaX = bombX - batX;\n\t\t\t\n\t\t\t// Se la delta X è tra -16 (metà bomba) e 64\n\t\t\tif( ( deltaX >= -16 ) && ( deltaX <= 64 ) ) {\n\t\t\t\t\n\t\t\t\t// Aumento il punteggio, lo aggiorno a schermo, aumento la velocità e aggiorno la flag\n\t\t\t\tscore += 10;\n\t\t\t\tdocument.getElementsByTagName( 'h1' )[ 0 ].innerHTML = \"Score: \" + score.toString();\n\t\t\t\tbombSpeed++;\n\t\t\t\tisBomb = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\t// Altrimenti la delta X è fuori range, quindi la racchetta è troppo lontana dalla bomba, quindi...\n\t\t\telse {\n\t\t\t\t\n\t\t\t\t// Segnalo il game over e re-inizializzo il gioco\n\t\t\t\talert( \"GAME OVER\" );\n\t\t\t\tinitVars();\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t}\n\n}", "title": "" }, { "docid": "18eb4733e399f25fdbc44a9c9126cf69", "score": "0.63537306", "text": "function raumAlle()\n{\n if (JOY.verb == 1) {\n if (JOY.geg1 == 8 && JOY.state.transport[8] == 2) {\n JOY.state.flag[2] = 1;\n // TODO mz -> JOY.mz\n JOY.state.inventar[mz-4] = 9;\n JOY.state.invent[mz-4] = Chr$ ( 10 ) + \"DIE HAST DU SCHON GELESEN !\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 );\n inventory();\n JOY.state.transport[8] = 0;\n JOY.state.transport[9] = 2;\n }\n if (JOY.geg1 == 11) {\n //Bset.<> 1 , JOY.state.flag[53]\n flagSet(1, 53);\n }\n if (geg1 = 15) {\n JOY.state.personName[1] = \"JUPP JENNSEN\";\n JOY.state.flag[54] = 1;\n JOY.state.person[1] = JOY.state.raum;\n personenDisplay();\n punkte(100);\n }\n }\n if (JOY.verb == 2) {\n if (JOY.geg1 = 110) {\n JOY.oeffne = 1;\n showText(Chr$ ( 10 ) + \"TOLL ! JETZT HAST DU DIE AUFNAHMEN ZERSTÖRT !\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 ));\n //Call 'clickmouse$'\n // Call 'screco$'\n ablegen(110);\n }\n if (geg1 = 127 && JOY.state.flag[42] > 0) {\n JOY.oeffne = 1;\n JOY.state.flag[42] = 0;\n\n //Gosub testinventar\n if (!testInventar())\n return false;\n\n //Call 'iconbank$' [ 1 ]\n // TODO: use bobs for inventory\n SwitchScreen(0);\n for (var i = 1; i <= 24; ++i) {\n if (JOY.state.inventar[i] == 0) {\n JOY.state.inventar[i] = 165;\n JOY.state.invent[i] = Chr$ ( 10 ) + \"DIESE BATTERIEN SIND FAST SCHON WIE\" + Chr$ ( 10 ) + \"STROM AUS DER STECKDOSE\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 );\n break;\n }\n }\n inventory();\n JOY.state.transport[165] = 2;\n JOY.state.geg[127] = \"TASCHENLAMPE\";\n //Pop\n //Goto parser\n return false;\n }\n }\n if (JOY.verb == 7) {\n if (JOY.geg1 == 165 && JOY.geg2 == 127 && JOY.state.flag[42] == 0) {\n JOY.benutze = 1;\n JOY.state.flag[42] = 1;\n ablegen(165);\n JOY.state.transport[165] = 1;\n JOY.state.geg[127] = \"TASCHENLAMPE+BATTERIEN\";\n }\n if (JOY.geg1 == 222 && JOY.geg2 == 223 && JOY.state.raum != 12) {\n showText(Chr$ ( 10 ) + \"WORAN DENN, DU NASE ?\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 ));\n //Call 'clickmouse$'\n // Call 'screco$'\n //Pop\n //Goto parser\n return false;\n }\n }\n if (JOY.verb == 8) {\n if (JOY.geg1 == 127 && JOY.state.flag[42] == 1) {\n JOY.schalte = 1;\n JOY.state.flag[42] == 2;\n }\n }\n if (JOY.verb == 9) {\n if (geg1 == 127 && JOY.state.flag[42] == 2) {\n JOY.schalte = 1;\n JOY.state.flag[42] == 1;\n }\n }\n if (JOY.verb = 13 && JOY.geg1 == 131 && JOY.pers == 9) {\n JOY.gib = 1;\n ablegen(131);\n showText(JOY.ereignis[54]);\n //Call 'clickmouse$'\n // Call 'screco$'\n //Pop\n //Goto parser\n return false;\n }\n if (JOY.verb == 16) {\n if (JOY.pers == 1) {\n showText(Chr$ ( 10 ) + \"FÜHRST DU IMMER SELBSTGESPRÄCHE ?\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 ));\n // Call 'clickmouse$'\n // Call 'screco$'\n }\n if (JOY.pers == 8) {\n if (JOY.state.reden[8] == 0) {\n //Call 'unterhaltung_laden$' [ 1 ]\n unterhaltungLaden(1);\n //Call 'unterhaltung$'\n unterhaltung();\n JOY.state.reden[8] = 1;\n punkte(53);\n JOY.verb = JOY.verb2;\n //Pop\n //Goto parser\n return false;\n }\n if (JOY.state.reden[8] == 1) {\n showText(Chr$ ( 10 ) + \"ICH HABE ES EILIG !\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 ));\n // Call 'clickmouse$'\n // Call 'screco$'\n }\n }\n if (JOY.pers == 9) {\n if (JOY.state.reden[9] == 0) {\n //Call 'unterhaltung_laden$' [ 3 ]\n unterhaltungLaden(3);\n //Call 'unterhaltung$'\n unterhaltung();\n\n if (JOY.state.gefragt & (1<<0)) {\n JOY.state.reden[9] = 1;\n if (JOY.state.transport[36] == 1) {\n showText(JOY.ereignis[22]);\n //Call 'clickmouse$'\n // Call 'screco$'\n JOY.state.transport[36] = 0;\n } else {\n showText(JOY.ereignis[21]);\n //Call 'clickmouse$'\n // Call 'screco$'\n }\n }\n JOY.verb = JOY.verb2;\n //Pop\n //Goto parser\n return false;\n }\n if (JOY.reden.flag[9] == 1) {\n showText(Chr$ ( 10 ) + \"ICH STREIKE !\" + Chr$ ( 10 ) + \"*\" + Chr$ ( 10 ));\n //Call 'clickmouse$'\n // Call 'screco$'\n }\n }\n }\n if (JOY.state.flag[53] == 111 && JOY.state.flag[30] == 0) {\n JOY.state.flag[30] = 1;\n showText(JOY.ereignis[2]);\n //Call 'clickmouse$'\n // Call 'screco$'\n punkte(500);\n }\n return true;\n}", "title": "" }, { "docid": "fa25b22aa7293cf9bfd1c439a59a76b4", "score": "0.6324986", "text": "function makeBabies(pet1, pet2) {\r\n //console.log(\"the meeracoal of life\");\r\n if (numPets < 15 && petBreedTimer < game.time.now) {\r\n petBreedTimer = game.time.now + 1500;\r\n var pet = pets.getFirstExists(false);\r\n var rand = game.rnd.integerInRange(0, 1);\r\n var childKey;\r\n var childRequires;\r\n \r\n //Select which parent sprite to use\r\n if (rand == 0) {\r\n childKey = pet1.mystuff.key;\r\n }\r\n else {\r\n childKey = pet2.mystuff.key;\r\n }\r\n\r\n var random = game.rnd.integerInRange(0, 1);\r\n //Select which parent requirement to use\r\n if (random == 0) {\r\n childRequires = pet1.mystuff.required;\r\n }\r\n else {\r\n childRequires = pet2.mystuff.required;\r\n }\r\n // spawn at a random location to the right\r\n pet.reset(game.rnd.integerInRange(game.world.centerX, 1100), game.rnd.integerInRange(75, 700));\r\n pet.loadTexture(keys[childKey], 0, false);\r\n //pet.frame = rand;\r\n //pet.angle = 180;\r\n \r\n //Initialize the pet information.\r\n pet.mystuff = {};\r\n\r\n pet.mystuff.key = null;\r\n pet.mystuff.required = null;\r\n pet.mystuff.color = null;\r\n pet.mystuff.pattern = null;\r\n pet.mystuff.index = null;\r\n \r\n pet.mystuff.key = childKey;\r\n pet.mystuff.required = childRequires;\r\n pet.mystuff.color = colors[childKey];\r\n pet.mystuff.pattern = patterns[pet1.mystuff.index];\r\n pet.mystuff.index = \"\";\r\n\r\n //Add text to the new pets. Adapted from the html5 example: http://www.html5gamedevs.com/topic/7837-how-do-i-align-text-with-a-sprite/\r\n var petText = game.add.text(0, 0, pet.mystuff.required, { font: \"20px Arial\", fill: \"#ffffff\", align: \"left\" });\r\n pet.addChild(petText);\r\n petText.anchor.x = 0.5;\r\n petText.anchor.y = 0.5;\r\n petText.x = ((pet.width - petText.width) / 2) + 15;\r\n petText.y = (pet.height - 100) / 2;\r\n\r\n // put every living pet in an array\r\n pets.forEachAlive(function (pet) {\r\n currentPets.push(pet);\r\n });\r\n pet.alive = true;\r\n numPets++;\r\n meow.play();\r\n meow.volume = 0.1;\r\n }\r\n }", "title": "" }, { "docid": "cb03131484749fe6354827b16ca22586", "score": "0.6301679", "text": "function playingGame(){\n\n\n image(Bread,0,0);\n if (Bread.time() == 0){\n Bread.play();\n \n }\n else if (Bread.time() >= Bread.duration()){\n Bread.stop();\n console.log(\"stopped video of: \");\n //currentScreen = 2;\n ingCount++;\n }\n\n textSize(48);\n text('Ingredients:' + ingCount, 1550, 50);\n}", "title": "" }, { "docid": "f3a7a33a156347ad032c7b0ee1a62bfe", "score": "0.62779725", "text": "function draw() {\n\n//..beacuse we drive what is in the draw loop with \"States\" set up in our conditions.js file.\n//The states are our start screen, our victory screen, our instructions/credit page, our loss\n//screen and finally, our actual game play screen. Thus begins my madness.\nif (play === 0) {\n background(0);\n States.startDisplay();\n} else if (play === 4) {\n background(0);\n stopGameDetails();\n States.victoryDisplay();\n} else if (play === 2) {\n background(0);\n stopGameDetails();\n States.creditDisplay();\n} else if (play === 3) {\n background(0);\n stopGameDetails();\n States.crashDisplay();\n} else if (play === 1) {\n noCursor();\n background(0);\n\n//So in our gameplay screen we need to make and draw some stars beyond our initial set from reUp.\n for (let t = 0; t < 50 - starfield.length; t++) {\n starfield.push(new Stars());\n }\n for (let u = 0; u < starfield.length; u++) {\n starfield[u].frame();\n }\n\n//And we need some debris for our player to blast.\n for (let a = 0; a < r - asteroids.length; a++) {\n asteroids.push(new Rocks());\n }\n\n for (let a = 0; a < asteroids.length; a++) {\n asteroids[a].frame();\n }\n\n//This for loop checks to see if our blasters have hit a rock, and if so, splice the rock and\n//increment our score counter.\n for (let b = 0; b < blaster.length; b++) {\n blaster[b].frame();\n for (let e = 0; e < asteroids.length; e++) {\n if (blaster[b].blast(asteroids[e])) {\n asteroids[e].blast();\n score+=5;\n }\n }\n }\n\n//This bit removes our blaster that just destroyed a rock from above. No shooting through rocks!\n//It also cuts the blaster if it passes beyond the screen\n for (let y = blaster.length - 1; y >= 0; y--) {\n if (blaster[y].cut === true ){\n blaster.splice(y, 1);\n }\n else if (blaster[y].pY < -5){\n blaster.splice(y, 1);\n }\n }\n\n//This splices the asteroids when they pass beyond the bottom of the screen so they don't clutter up the array\n for (let a = asteroids.length - 1; a >= 0; a--) {\n if (asteroids[a].pY > 1100) {\n asteroids.splice(a, 1);\n }\n\n//And this does the same for the stars.\n }\n for (let z = starfield.length - 1; z >= 0; z--) {\n if (starfield[z].pY > 1020) {\n starfield.splice(z, 1);\n }\n }\n\n//Here's our base HUD with the score tracker. It also calls our ship to be drawn.\n push();\n fill(80, 10, 10);\n quad(0, 0, 750, 0, 700, 30, 50, 30);\n fill(255);\n textFont(font);\n textSize(16);\n text('Score:', 50, 20);\n text(score, 150, 20);\n pop();\n push();\n playership.display();\n pop();\n\n//Here we track asteroid/ship collisions and, if occuring, trigger a lose state.\n for (let v = 0; v < asteroids.length; v++) {\n let dis = dist(asteroids[v].pX, asteroids[v].pY, playership.pX, playership.pY);\n let rad = asteroids[v].rR + ((playership.rF) || (playership.rS));\n if (dis < rad) {\n stopGameDetails();\n play = 3;\n }\n }\n\n//This forces our players to stay in their sector by generating the lose state if they try to leave the play area.\n if (playership.pX >= width + 25 || playership.pX <= -25 || playership.pY >= height + 25 || playership.pY <= -25) {\n stopGameDetails();\n play = 3;\n }\n\n//This controls our ship motion.\n playership.motion();\n\n//This is used to track and trigger our win state. Why such a huge number? We're using\n//Division to affect difficulty, so easy has a score threshhold of 500, medium is 3500,\n//and hard is 5000. We also throw more rocks at you, too.\n if (score >= (1000000000 / difficulty)) {\n stopGameDetails();\n play = 4;\n }\n}\n}", "title": "" }, { "docid": "d5b07b015453aa41ffe3f456b0c8154a", "score": "0.62695915", "text": "function balle_brique() {\n briques.forEach(colonne=>{\n // on prends chaque brique de chaque colonne\n colonne.forEach(brique=>{\n \n if (brique.status) {\n if(balle.x + balle.rayon > brique.x\n && balle.x - balle.rayon < brique.x + brique.w\n && balle.y + balle.rayon > brique.y\n && balle.y-balle.rayon < brique.y + brique.h){\n BRICK_HIT.play();\n balle.dy *=-1;\n brique.status=false;\n score+= SCORE_UNITE;\n \n\n }\n }\n })\n })\n \n}", "title": "" }, { "docid": "3be51b9bd271709b30899bb07153e27a", "score": "0.620298", "text": "function startPlay(){\n\t\tif(running) return;\n\t\trunning = true;\n\t\tslotRoll();\n\t\tremoveBets();\n\t\t\n\t\tfor(var i = 0; i < reels.length; i++){\n\t\t\tvar r = reels[i];\n\t\t\tvar extra = Math.floor(Math.random()*4);\n\t\t\ttweenTo(r, \"position\", r.position + 10+i*10+extra, 2500+i*600+extra*600, backout(0.6), null, i == reels.length-1 ? reelsComplete : null);\n\t\t}\n\t}", "title": "" }, { "docid": "4a2e47277dc942b3d39104920e4ecd33", "score": "0.6200969", "text": "function draw() {\n var fg = getImage(imageEnums.kFOREGROUND);\n var bg = getImage(imageEnums.kBACKGROUND);\n var pipeNorth = getImage(imageEnums.kPIPENORTH);\n var pipeSouth = getImage(imageEnums.kPIPESOUTH);\n var bird = getImage(imageEnums.kBIRD);\n if (!pauseGame && preloaded) {\n for (var i = 0; i < cvs.width; i += bg.width) {\n ctx.drawImage(bg, i, 0);\n }\n for (var i = 0; i < pipe.length; i++) {\n constant = pipeNorth.height + gap;\n ctx.drawImage(pipeNorth, pipe[i].x, pipe[i].y);\n ctx.drawImage(pipeSouth, pipe[i].x, pipe[i].y + constant);\n pipe[i].x--;\n if (pipe[i].x == (cvs.width / 2)) // was 125 -- NOTE -- need to make these dynamic on the window size...\n {\n pipe.push({\n x: cvs.width,\n y: Math.floor(Math.random() * pipeNorth.height) - pipeNorth.height\n });\n }\n // detect collision\n var birdWidth = bird.width;\n if (bX + birdWidth >= pipe[i].x && bX <= pipe[i].x + pipeNorth.width && (bY <= pipe[i].y + pipeNorth.height || bY + bird.height >= pipe[i].y + constant) || bY + bird.height >= cvs.height - fg.height) {\n location.reload(); // reload the page\n }\n if (pipe[i].x == 5) {\n score++;\n scor.play();\n if (((score % 5) == 0) && (level >= 1)) {\n level++;\n }\n }\n }\n if (pipe[0].x < -pipeNorth.width)\n pipe.shift();\n for (var i = 0; i < cvs.width; i += fg.width) {\n ctx.drawImage(fg, i, cvs.height - fg.height);\n }\n ctx.drawImage(bird, bX, bY);\n bY += gravity;\n } // if !pauseGame\n ctx.fillStyle = \"#000\";\n ctx.font = \"20px Verdana\";\n ctx.fillText(\"Score : \" + score, 10, cvs.height - 80);\n ctx.fillText(\"Level : \" + level, 10, cvs.height - 20);\n requestAnimationFrame(draw);\n }", "title": "" }, { "docid": "3534c715af13b8bf2a2b2ca94ec3a1d3", "score": "0.61738145", "text": "function setupRabbit(game, obj) {\n \n game.physics.enable(obj, Phaser.Physics.ARCADE);\n //obj.body.setSize(60, 25, 0, 38);\n obj.health = 60;\n obj.anchor.setTo(0.5, 0);\n obj.jumping = false;\n obj.activated = false;\n \n obj.jump = function() {\n \t\n \tvar dir = (this.position.x < frog.position.x ? 1 : -1);\n \t\n \tthis.scale.x = -dir;\n this.frame = 1;\n this.body.velocity.y = -650;\n this.body.velocity.x = 200 * dir;\n this.jumping = true;\n };\n \n obj.update = function() {\n \t\n if (this.body.onFloor() && this.jumping) {\n this.jumping = false;\n this.body.velocity.x = 0;\n this.frame = 0;\n game.time.events.add(2500, function() {\n this.jump();\n }, this);\n }\n\n \tif (!this.activated && Math.abs(this.position.x - frog.position.x) < 200) {\n \t\tthis.activated = true;\n \t\tgame.time.events.add(100, function() {\n this.jump();\n }, this);\n \t}\n \n\n };\n \n }", "title": "" }, { "docid": "588a8ffbf6cf7495c97e82f77b321e54", "score": "0.61705196", "text": "function sceneOne() {\n// TODO: add input puller and make it choices.choice1\n\n// Bandit stats declared/////////////////////////////////////////\n baddie.hp = 6;\n baddie.mp = 3;\n baddie.chase = -1;\n baddie.damageDie = 8;\n// End stats/////////////////////////////////////////\n\n console.log(\"\\n\\n\\n\" +\n\n \"Scene One: Our Journey Begins...\\n\\n\" +\n\n \"What started as a quiet night enjoying\\n\" +\n \"a couple pints of grog at the local pub\\n\" +\n \"ends with the townsfolk of Friendly\\n\" +\n \"chasing you out the city gates with torches,\\n\" +\n \"pitchforks, and other makeshift\\n\" +\n \"weaponry early the next morning.\\n\\n\\n\" +\n\n \"After a bath in the local river and a hearty\\n\" +\n \"breakfast of varmint and woodland critters,\\n\" +\n \"you continue along your lonesome journey.\\n\\n\" +\n \"Through the forests and dales,\\n\" +\n \"over the valleys and hills you trod,\\n\" +\n \"eager to to overcome whatever might stand \\n\" +\n \"between you and the great City of Whoknowsville...\\n\");\n\n\n console.log(\n \"\\n\" +\n\n \"*snap!*\\n\\n\" +\n\n \"What was that?\\n\" +\n \"Hello?\\n\\n\" +\n\n \"What will you do now?\\n\" +\n \"Will you try to sneak past whatever is there? [type: AGI]\\n\" +\n \"Will you try to spot the danger before it even strikes? [type: SHP]\\n\" +\n \"Or will you bellow out a challenge and rush into combat? [type: #bravebutfoolish]\\n\\n\");\n\n // choices.choice1 = scanner.nextLine().toLowerCase();\n switch (game_shop.choices.choice1) {\n case \"agi\":\n console.log(\n \"As you try to be sneaky,\\n\" +\n \"we will roll to see what happens.\");\n\n rolls.roll1 = twoDice(6) + character.agility;\n console.log(\"\" +\n\n \"You rolled a \" + rolls.roll1 + \".\\n\" +\n \"Let's see what they means for our adventurer...\\n\\n\");\n\n agiSceneOne();\n break;\n case \"shp\":\n console.log(\n \"As you try spot the danger before it has the jump\\n\" +\n \"on you, we will roll to see what happens.\\n\");\n\n rolls.roll1 = twoDice(6) + character.sharp;\n console.log(\n \"You rolled a \" + rolls.roll1 + \".\\n\" +\n \"Lets see what they means for our adventurer...\\n\\n\");\n\n shpSceneOne();\n break;\n default:\n console.log(\n \"Shit you made a lot of noise!\\n\" +\n \"Here they come....\\n\\n\");\n\n shitHitsFanSceneOne();\n break;\n }\n}", "title": "" }, { "docid": "b7f42592430ed1cc0a42c9881833bac1", "score": "0.61681235", "text": "function tick() {\n if (gameState == GAME_STATE.PLAYING) { // if the game is playing, then check if the player has won or lost\n if (bacteria.length == 0) { // if there are no bacteria left, then the player has won\n gameState = GAME_STATE.WON;\n } else {\n var fullCircleBacteria = false; // this flag is used to save if tehre is any bacteria which is a ful circle\n for (var i in bacteria) { // go through all bacteria\n if (bacteria[i].angle > thresholdAngle && !bacteria[i].passedThreshold) { // if any bacteria has passed the threshold\n numOfBacteriaPassedThreshold++; // increase the count of bacteria passing the threshold\n bacteria[i].passedThreshold = true; // set a flag so the same bacteria is not counted twice.\n }\n if (bacteria[i].angle >= 360) { // if a bacteria is already a full circle, then the game is lost\n fullCircleBacteria = true;\n }\n }\n // if the maximum bacteria threshold is passed or if there is a full size bacteria, the game is lost\n if (numOfBacteriaPassedThreshold >= maxNumOfBacteriaPassedThreshold || fullCircleBacteria) {\n gameState = GAME_STATE.LOST;\n }\n }\n }\n\n\n if (gameState == GAME_STATE.PLAYING) { // if the game is playing\n // find all the bacteria in shapes and make them grow\n for (var i in bacteria) { // increase size of bacteria\n bacteria[i].angle += bacteriaGrowthRate;\n }\n\n for (var i in poisons) { // increase size of poison\n poisons[i].angle += poisonGrowthRate;\n }\n\n // if the maximum bacteria is not passed, then check if a new bacteria should be added\n if (bacteria.length < maximumBacteria && Math.random() < chanceOfNewBacteria) {\n createNewBacteria();\n }\n\n if (createPoisonRandomly) {\n // if there is a bacteria, then check if a new poison should be added\n if (bacteria.length != 0 && Math.random() < chanceOfNewPoison) {\n createNewPoison();\n }\n }\n\n // check if any bacteria should be merged\n mergeOverlappingBacteria();\n } else if (gameState == GAME_STATE.WON) {\n if (Math.random() < 0.2) { // randombly create explosions\n document.getElementById('UserMessage').innerHTML = 'You Won The Game!';\n var explosion = new Explosion();\n explosion.originX = 2 * Math.random() - 1;\n explosion.originY = 2 * Math.random() - 1;\n explosionEffect.push(explosion);\n }\n } else if (gameState == GAME_STATE.LOST) {\n setLargerExplosionSize(); // increase the size of the explosions\n\n if (!earthExploded) { // only explode the earth once\n document.getElementById('UserMessage').innerHTML = 'You Have Lost!';\n earthExploded = true;\n numOfBacteriaPassedThreshold = maxNumOfBacteriaPassedThreshold;\n var explosion = new Explosion();\n explosion.originX = 0;\n explosion.originY = 0;\n explosionEffect.push(explosion);\n }\n }\n\n // the bacteria has already grown above, now draw it on the screen\n drawScene();\n\n // ask weggl to call tick again\n requestAnimFrame(tick);\n}", "title": "" }, { "docid": "fb7706329b3bc35e3b94e44d0de6f4ac", "score": "0.6146026", "text": "Broom() {\n\n if (this.round !== 0) {\n\n var handcombinationsum = 0;\n for (let i = this.analytics.analyzedhand.length - 1; i >= 0; i--){\n for (let j = this.analytics.analyzedhand[i].length - 1; j >= 0; j--)\n handcombinationsum += this.analytics.analyzedhand[i][j].length\n }\n //console.log(\"handcombinationsum\", handcombinationsum);\n\n //If you can directly end the game\n for (let i = this.analytics.analyzedhand.length - 1; i >= 0; i--){\n if (this.analytics.analyzedhand[i][0].length !== 0){\n\n var combinations = this.analytics.analyzedhand[i][0];\n\n for (let k = combinations.length - 1; k >= 0; k--) {\n\n //you can play the highest combination and then one more hand\n if ((combinations[k][3] == 1) &&\n (handcombinationsum <= 2)) {\n //console.log(\"Broom | End Game Broom\")\n this.commandrate = combinations[k][3];\n return combinations[k][0];\n }\n }\n }\n }\n\n for (let i = this.analytics.analyzedhand.length - 1; i >= 0; i--){\n if (this.analytics.analyzedhand[i][0].length !== 0){\n \n this.commandrate = this.analytics.analyzedhand[i][0][0][3];\n return this.analytics.analyzedhand[i][0][0][0];\n }\n }\n }\n\n //Account for the '3♦' situation for the first player\n if(this.round == 0) {\n for (let i = this.analytics.analyzedhand.length - 1; i >= 0; i--){\n if (this.analytics.analyzedhand[i][0].length !== 0){\n\n var combinations = this.analytics.analyzedhand[i][0];\n\n for (let k = combinations.length - 1; k >= 0; k--) {\n for (let j = 0; j <= combinations[k][0].length - 1; j++){\n\n if (combinations[k][0][j].cardranking == 1){\n this.commandrate = combinations[k][3];\n return combinations[k][0];\n }\n }\n }\n }\n }\n }\n return [];\n }", "title": "" }, { "docid": "28f6409b040366490b990e8ebb21d66d", "score": "0.611562", "text": "function preload() {\n game.load.bitmapFont('super_mario_font', 'assets/fonts/super_mario_font.png', 'assets/fonts/super_mario_font.fnt');\n game.load.image('floor', 'assets/images/floor_block.png');\n game.load.image('pipe_small_green', 'assets/images/pipe_small_green.png');\n game.load.image('pipe_medium_green', 'assets/images/pipe_medium_green.png');\n game.load.image('pipe_big_green', 'assets/images/pipe_big_green.png');\n game.load.image('grass_small', 'assets/images/grass_small.png');\n game.load.image('grass_medium', 'assets/images/grass_medium.png');\n game.load.image('grass_big', 'assets/images/grass_big.png');\n game.load.image('heel_small', 'assets/images/heel_small.png');\n game.load.image('heel_big', 'assets/images/heel_big.png');\n game.load.image('cloud_small', 'assets/images/cloud_small.png');\n game.load.image('cloud_medium', 'assets/images/cloud_medium.png');\n game.load.image('cloud_big', 'assets/images/cloud_big.png');\n game.load.image('hard_block', 'assets/images/hard_block.png');\n game.load.image('x_sign', 'assets/images/x.png');\n game.load.image('pole_flag', 'assets/images/finish_flag.png');\n game.load.image('pole', 'assets/images/finish_pole.png');\n game.load.image('castle0', 'assets/images/castle_small_0f.png');\n game.load.image('castle1', 'assets/images/castle_small_1f.png');\n game.load.image('castle_flag', 'assets/images/castle_flag.png');\n game.load.spritesheet('breakable_block', 'assets/images/breakable_block.png', 16, 16);\n game.load.spritesheet('hidden_block', 'assets/images/hidden_block.png', 16, 16);\n game.load.spritesheet('coin', 'assets/images/coin.png', 10, 14, 4, 0, 6);\n game.load.spritesheet('coin_spin', 'assets/images/coin_spin.png', 8, 14, 4, 1, 8);\n game.load.spritesheet('coin_mini', 'assets/images/coin_mini.png', 5, 8, 3, 0, 3);\n game.load.spritesheet('loot_block', 'assets/images/loot_block.png', 16, 16);\n game.load.spritesheet('piranha_plant', 'assets/images/piranha_plant.png', 16, 24);\n game.load.spritesheet('firework', 'assets/images/firework.png', 16, 16);\n game.load.audio('theme_song', 'assets/audio/theme.wav');\n game.load.audio('fast_theme_song', 'assets/audio/theme-x1.5.wav');\n game.load.audio('warning', 'assets/audio/warning.wav');\n game.load.audio('death', 'assets/audio/mariodie.wav');\n game.load.audio('coin', 'assets/audio/coin.wav');\n game.load.audio('bump', 'assets/audio/bump.wav');\n game.load.audio('1up', 'assets/audio/1-up.wav');\n game.load.audio('firework', 'assets/audio/firework.wav');\n\n game.stage.smoothed = false;\n game.stage.disableVisibilityChange = true;\n game.physics.arcade.gravity.y = 2000;\n}", "title": "" }, { "docid": "001018290dc420c7b1f975c3f4b155df", "score": "0.6108489", "text": "function initializeRogue(seed) {\n\tlet i, j, k;\n\tlet theItem;\n\tlet playingback, playbackFF, playbackPaused;\n\n\t// generate libtcod font bitmap\n\t// add any new unicode characters here to include them\n// #ifdef GENERATE_FONT_FILES\n// generateFontFiles();\n// #endif\n\n\tplayingback = rogue.playbackMode; // the only three animals that need to go on the ark\n\tplaybackPaused = rogue.playbackPaused;\n\tplaybackFF = rogue.playbackFastForward;\n\t// memset((void *) &rogue, 0, sizeof( playerCharacter )); // the flood\n\t// rogue = playerCharacter();\t// reset\n\n\t// rogue.warningPauseMode = true;\t// removed 1.7.5\n\n\trogue.playbackMode = playingback;\n\trogue.playbackPaused = playbackPaused;\n\trogue.playbackFastForward = playbackFF;\n\n\trogue.gameHasEnded = false;\n\trogue.highScoreSaved = false;\n\trogue.cautiousMode = false;\n\trogue.milliseconds = 0;\n\n\tbrogueAssert(rogue.RNG == RNG_SUBSTANTIVE);\n\n\tif (!rogue.playbackMode) {\n\t\trogue.seed = seedRandomGenerator(seed);\n\t\tpreviousGameSeed = rogue.seed;\n\t\tconsole.log('SEED', rogue.seed);\n\t}\n\n // await benchmark();\n\n\t// initRecording();\n\n levels = ARRAY((DEEPEST_LEVEL+1), () => levelData() );\n\tlevels[0].upStairsLoc[0] = Math.floor((DCOLS - 1) / 2) - 1;\n\tlevels[0].upStairsLoc[1] = DROWS - 2;\n\n\t// reset enchant and gain strength frequencies\n rogue.lifePotionFrequency = 0;\n\trogue.strengthPotionFrequency = 40;\n\trogue.enchantScrollFrequency = 60;\n\n\t// all DF messages are eligible for display\n\tresetDFMessageEligibility();\n\n\t// initialize the levels list\n\tfor (i=0; i<DEEPEST_LEVEL+1; i++) {\n\t\tlevels[i].levelSeed = rand_range(0, 9999);\n levels[i].levelSeed += 10000 * rand_range(0, 9999);\n\t\tconsole.log(\"levelSeed\", i, levels[i].levelSeed);\n\t\tlevels[i].monsters = NULL;\n\t\tlevels[i].dormantMonsters = NULL;\n\t\tlevels[i].items = NULL;\n\t\tlevels[i].visited = false;\n\t\tlevels[i].playerExitedVia[0] = 0;\n\t\tlevels[i].playerExitedVia[1] = 0;\n\t\tdo {\n\t\t\tlevels[i].downStairsLoc[0] = rand_range(1, DCOLS - 2);\n\t\t\tlevels[i].downStairsLoc[1] = rand_range(1, DROWS - 2);\n\t\t} while (distanceBetween(levels[i].upStairsLoc[0], levels[i].upStairsLoc[1],\n\t\t\t\t\t\t\t\t levels[i].downStairsLoc[0], levels[i].downStairsLoc[1]) < Math.floor(DCOLS / 3) );\n\t\tif (i < DEEPEST_LEVEL) {\n\t\t\tlevels[i+1].upStairsLoc[0] = levels[i].downStairsLoc[0];\n\t\t\tlevels[i+1].upStairsLoc[1] = levels[i].downStairsLoc[1];\n\t\t}\n\t}\n\n // initialize the waypoints list\n for (i=0; i<MAX_WAYPOINT_COUNT; i++) {\n rogue.wpDistance[i] = allocGrid();\n fillGrid(rogue.wpDistance[i], 0);\n }\n\n\trogue.rewardRoomsGenerated = 0;\n\n\t// pre-shuffle the random terrain colors\n\t// assureCosmeticRNG();\n\tfor (i=0; i<DCOLS; i++) {\n\t\tfor( j=0; j<DROWS; j++ ) {\n\t\t\tfor (k=0; k<8; k++) {\n\t\t\t\tterrainRandomValues[i][j][k] = cosmetic_range(0, 1000);\n\t\t\t}\n\t\t}\n\t}\n\t// restoreRNG();\n\n\tzeroOutGrid(displayDetail);\n\n\tfor (i=0; i<NUMBER_MONSTER_KINDS; i++) {\n\t\tmonsterCatalog[i].monsterID = i;\n\t}\n\n\tbrogueAssert(rogue.RNG == RNG_SUBSTANTIVE);\n\n\tshuffleFlavors();\n\n for (i = 0; i < FEAT_COUNT; i++) {\n rogue.featRecord[i] = featTable[i].initialValue;\n }\n\n\tdeleteMessages();\n\tfor (i = 0; i < MESSAGE_ARCHIVE_LINES; i++) { // Clear the message archive.\n\t\tmessageArchive[i] = '';\n\t}\n\tmessageArchivePosition = 0;\n\n\t// Seed the stacks.\n\tfloorItems = item();\t// (item *) malloc(sizeof(item));\n\t// memset(floorItems, '\\0', sizeof(item));\n\tfloorItems.nextItem = NULL;\n\n packItems = item(); // (item *) malloc(sizeof(item));\n\t// memset(packItems, '\\0', sizeof(item));\n\tpackItems.nextItem = NULL;\n\n monsterItemsHopper = item(); // (item *) malloc(sizeof(item));\n // memset(monsterItemsHopper, '\\0', sizeof(item));\n monsterItemsHopper.nextItem = NULL;\n\n for (i = 0; i < MAX_ITEMS_IN_MONSTER_ITEMS_HOPPER; i++) {\n theItem = generateItem(ALL_ITEMS & ~FOOD, -1); // Monsters can't carry food: the food clock cannot be cheated!\n theItem.nextItem = monsterItemsHopper.nextItem;\n monsterItemsHopper.nextItem = theItem;\n }\n\n\tmonsters = creature(); // (creature *) malloc(sizeof(creature));\n\t// memset(monsters, '\\0', sizeof(creature));\n monsters.nextCreature = NULL;\n\n\tdormantMonsters = creature(); // (creature *) malloc(sizeof(creature));\n\t// memset(dormantMonsters, '\\0', sizeof(creature));\n\tdormantMonsters.nextCreature = NULL;\n\n graveyard = creature(); // (creature *) malloc(sizeof(creature));\n\t// memset(graveyard, '\\0', sizeof(creature));\n\tgraveyard.nextCreature = NULL;\n\n purgatory = creature(); // (creature *) malloc(sizeof(creature));\n\t// memset(purgatory, '\\0', sizeof(creature));\n\tpurgatory.nextCreature = NULL;\n\n\tscentMap\t\t\t= NULL;\n\tsafetyMap\t\t\t= allocGrid();\n\tallySafetyMap = allocGrid();\n\tchokeMap\t\t\t= allocGrid();\n\n\trogue.mapToSafeTerrain = allocGrid();\n\n\t// Zero out the dynamic grids, as an essential safeguard against OOSes:\n\tfillGrid(safetyMap, 0);\n\tfillGrid(allySafetyMap, 0);\n\tfillGrid(chokeMap, 0);\n\tfillGrid(rogue.mapToSafeTerrain, 0);\n\n\t// initialize the player\n\n\t// memset(&player, '\\0', sizeof(creature));\n\tplayer = creature();\n\tplayer.info = monsterCatalog[0];\n\tinitializeGender(player);\n\tplayer.movementSpeed = player.info.movementSpeed;\n\tplayer.attackSpeed = player.info.attackSpeed;\n\tclearStatus(player);\n\tplayer.carriedItem = NULL;\n\tplayer.status[STATUS_NUTRITION] = player.maxStatus[STATUS_NUTRITION] = STOMACH_SIZE;\n\tplayer.currentHP = player.info.maxHP;\n\t// rogue.previousHealthPercent = 100;\n // rogue.previousPoisonPercent = 0;\n\tplayer.creatureState = MONSTER_ALLY;\n\tplayer.ticksUntilTurn = 0;\n player.mutationIndex = -1;\n\tplayer.info.displayChar = PLAYER_CHAR;\n\n\trogue.depthLevel = 1;\n rogue.deepestLevel = 1;\n\trogue.scentTurnNumber = 1000;\n\trogue.playerTurnNumber = 0;\n rogue.absoluteTurnNumber = 0;\n\trogue.previousPoisonPercent = 0;\n\trogue.foodSpawned = 0;\n rogue.lifePotionsSpawned = 0;\n\trogue.gold = 0;\n\trogue.goldGenerated = 0;\n\trogue.disturbed = false;\n\trogue.autoPlayingLevel = false;\n\trogue.automationActive = false;\n\trogue.justRested = false;\n\trogue.justSearched = false;\n\trogue.easyMode = false;\n\trogue.inWater = false;\n\trogue.creaturesWillFlashThisTurn = false;\n\trogue.updatedSafetyMapThisTurn = false;\n\trogue.updatedAllySafetyMapThisTurn = false;\n\trogue.updatedMapToSafeTerrainThisTurn = false;\n\trogue.updatedMapToShoreThisTurn = false;\n\trogue.strength = 12;\n\trogue.weapon = NULL;\n\trogue.armor = NULL;\n\trogue.ringLeft = NULL;\n\trogue.ringRight = NULL;\n\trogue.monsterSpawnFuse = rand_range(125, 175);\n\trogue.ticksTillUpdateEnvironment = 100;\n\trogue.mapToShore = NULL;\n\trogue.cursorLoc[0] = rogue.cursorLoc[1] = -1;\n\trogue.xpxpThisTurn = 0;\n\n rogue.yendorWarden = NULL;\n\n rogue.flares = [];\n rogue.flareCount = rogue.flareCapacity = 0;\n\n\trogue.minersLight.copy(lightCatalog[MINERS_LIGHT]);\n\n\trogue.clairvoyance = rogue.regenerationBonus = rogue.stealthBonus = rogue.transference = rogue.wisdomBonus = rogue.reaping = 0;\n\trogue.lightMultiplier = 1;\n\n\ttheItem = generateItem(FOOD, RATION);\n\ttheItem = addItemToPack(theItem);\n\n\ttheItem = generateItem(WEAPON, DAGGER);\n\ttheItem.enchant1 = theItem.enchant2 = 0;\n\ttheItem.flags &= ~(ITEM_CURSED | ITEM_RUNIC);\n\tidentify(theItem);\n\ttheItem = addItemToPack(theItem);\n\tequipItem(theItem, false);\n\n\ttheItem = generateItem(WEAPON, DART);\n\ttheItem.enchant1 = theItem.enchant2 = 0;\n\ttheItem.quantity = 15;\n\ttheItem.flags &= ~(ITEM_CURSED | ITEM_RUNIC);\n\tidentify(theItem);\n\ttheItem = addItemToPack(theItem);\n\n\ttheItem = generateItem(ARMOR, LEATHER_ARMOR);\n\ttheItem.enchant1 = 0;\n\ttheItem.flags &= ~(ITEM_CURSED | ITEM_RUNIC);\n\tidentify(theItem);\n\ttheItem = addItemToPack(theItem);\n\tequipItem(theItem, false);\n player.status[STATUS_DONNING] = 0;\n\n recalculateEquipmentBonuses();\n\n\tif (DEBUGGING) {\n\t\ttheItem = generateItem(RING, RING_CLAIRVOYANCE);\n\t\ttheItem.enchant1 = max(DROWS, DCOLS);\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(WEAPON, DAGGER);\n\t\ttheItem.enchant1 = 50;\n\t\ttheItem.enchant2 = W_QUIETUS;\n\t\ttheItem.flags &= ~(ITEM_CURSED);\n\t\ttheItem.flags |= (ITEM_PROTECTED | ITEM_RUNIC | ITEM_RUNIC_HINTED);\n\t\ttheItem.damage.lowerBound = theItem.damage.upperBound = 25;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(ARMOR, LEATHER_ARMOR);\n\t\ttheItem.enchant1 = 50;\n\t\ttheItem.enchant2 = A_REFLECTION;\n\t\ttheItem.flags &= ~(ITEM_CURSED | ITEM_RUNIC_HINTED);\n\t\ttheItem.flags |= (ITEM_PROTECTED | ITEM_RUNIC);\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_FIRE);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_LIGHTNING);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_BLINKING);\n\t\ttheItem.enchant1 = theItem.charges = 10;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_TUNNELING);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 3000;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_OBSTRUCTION);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(WAND, WAND_BECKONING);\n\t\ttheItem.charges = 3000;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_ENTRANCEMENT);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_HEALING);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_CONJURATION);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(STAFF, STAFF_POISON);\n\t\ttheItem.enchant1 = 10;\n\t\ttheItem.charges = 300;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(WAND, WAND_DOMINATION);\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(WAND, WAND_POLYMORPH);\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(WAND, WAND_PLENTY);\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(WAND, WAND_NEGATION);\n\t\ttheItem.charges = 300;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n\t\ttheItem = generateItem(RING, RING_AWARENESS);\n\t\ttheItem.enchant1 = 30;\n\t\ttheItem.flags &= ~ITEM_CURSED;\n\t\tidentify(theItem);\n\t\ttheItem = addItemToPack(theItem);\n\n//\t\tshort i;\n//\t\tfor (i=0; i < NUMBER_CHARM_KINDS && i < 4; i++) {\n//\t\t\ttheItem = generateItem(CHARM, i);\n//\t\t\ttheItem = addItemToPack(theItem);\n//\t\t}\n\t}\n\tblackOutScreen();\n\twelcome();\n}", "title": "" }, { "docid": "70f9e83d93f72d1be920204583ed28fc", "score": "0.610487", "text": "function runPlay(offG, offF, offC, defG, defF, defC, gameLength){\n //console.log(offG);\n var visionResult={score:0};\n var fastBreak=false;\n var fastMod = 40;\n var ballPosition = 4;\n var gameObj={score:0};\n var fastResult ={};\n var playersInQ = {offP:offG, defP:defG,assist:false, pos:\"G\"};\n //HAVE GUARD DRIBLE ACROSS HALF COURT.\n var dribble = dribbleCheck(offG, defG,gameLength,80);\n if (dribble) {\n for(var y in offG){\n offG[y].stats.drive += 1;\n console.log( y+\" dribbled the ball past halfcourt, now setting up off play. stats obj below:\");\n console.log(offG[y][\"stats\"]);\n }\n }else if(!dribble){\n for(var x in offG){\n offG[x].stats.turnOver += 1;\n }\n for(var y in defG){\n defG[y].stats.steal += 1;\n console.log( y+\" stole the ball. and starts fast break.\");\n }\n ballPosition -= 1;\n fastResult = runFastBreak(defG, offG, gameLength,40);\n defG = fastResult.offP;//REVERSED BECAUSE OF THE INTERACTION WITH FAST BREAK FUNCTION\n offG = fastResult.defP;\n if (typeof fastResult.side == 'undefined' && !fastResult.stay){\n gameObj = {oG:offG,oF:offF,oC:offC,dG:defG,dF:defF,dC:defC};\n gameObj.side = \"off\";\n gameObj.score = -2;\n console.log(\"Def scored \"+gameObj.score+\" points.\");\n return gameObj;\n }\n else if(fastResult.stay){\n gameObj = {oG:offG,oF:offF,oC:offC,dG:defG,dF:defF,dC:defC};\n gameObj.side = \"def\";\n gameObj.score = 0;\n return gameObj;\n }\n else{console.log(\"Offense stole the ball back and is now beginning to run thier play.\");}\n }else{alert(\"ERROR 826: warning. dribble function returned niether true nor false.\");}\n ballPosition = 3;\n //GUARD HAS MADE TO HALFCOURT, NOW BEGIN OFFENSE LOOP\n for (var finish = 20; finish > 0; finish--) {\n if (ballPosition > 3){ballPosition = 3;alert(\"ERROR 832: BALLPOSTION failed\");}\n visionResult = runVisionCheck(playersInQ.offP,playersInQ.defP, gameLength, ballPosition, playersInQ.assist);\n // GUARD HAS EITHER LOST THE BALL, DRIBBLED, PASSED OR SHOT\n playersInQ.offP = visionResult.offP;\n playersInQ.defP = visionResult.defP;\n if(visionResult.score){\n console.log(\"visionResult score =\"+visionResult.score);\n gameObj.score += visionResult.score;\n for(var x in playersInQ.assist){\n playersInQ.assist[x].stats.assist +=1;\n console.log (\"assist stat given to \"+x+\". He now has \"+playersInQ.assist[x].stats.assist);\n }\n }\n console.log(\"score changed by \"+gameObj.score+\". Side:\"+visionResult.side+\". Fb:\"+visionResult.fB+\". Rebound:\"+visionResult.rebound+\". assist:\"+visionResult.assist);\n //CHANGE OF POSSESION, WITH OR WITHOUT FAST BREAK\n if (visionResult.side){\n if(visionResult.fB){\n console.log(\"defense stole the ball and has a fast break.\");\n fastResult = runFastBreak(playersInQ.defP, playersInQ.offP, gameLength,40);\n if(fastResult.score){\n console.log(\"fastResult score =\"+fastResult.score);\n gameObj.score = -1*fastResult.score;\n for(var x in playersInQ.assist){\n playersInQ.assist[x].stats.assist +=1;\n console.log (\"assist stat given to \"+x+\". He now has \"+playersInQ.assist[x].stats.assist);\n }\n }\n playersInQ.defP = fastResult.offP;\n playersInQ.offP = fastResult.defP;\n if(fastResult.stay){\n gameObj.side = \"def\";\n }else{gameObj.side = \"off\";}\n if (!fastResult.side){\n if(typeof playersInQ.pos == 'undefined'){alert(\"ERROR 849: V.SIDE PLAYERSINQ.POS EMPTY\");}\n if (playersInQ.pos == \"G\"){gameObj.oG = playersInQ.offP; gameObj.dG = playersInQ.defP;}\n else{gameObj.oG = offG; gameObj.dG = defG;}\n if (playersInQ.pos == \"F\"){gameObj.oF = playersInQ.offP; gameObj.dF = playersInQ.defP;}\n else{gameObj.oF = offF; gameObj.dF = defF;}\n if (playersInQ.pos == \"C\"){gameObj.oC = playersInQ.offP; gameObj.dC = playersInQ.defP;}\n else{gameObj.oC = offC; gameObj.dC = defC;}\n return gameObj;\n //break;\n }\n }else{\n console.log(\"change of possesion without FB.\");\n gameObj.side = \"def\"; //DEFENSE WILL HAVE THE BALL AND BECOME OFFENSE\n if(typeof playersInQ.pos == 'undefined'){alert(\"error 861, V.SIDE PLAYERSINQ.POS EMPTY!!!\");}\n if (playersInQ.pos == \"G\"){gameObj.oG = playersInQ.offP; gameObj.dG = playersInQ.defP;}\n else{gameObj.oG = offG; gameObj.dG = defG;}\n if (playersInQ.pos == \"F\"){gameObj.oF = playersInQ.offP; gameObj.dF = playersInQ.defP;}\n else{gameObj.oF = offF; gameObj.dF = defF;}\n if (playersInQ.pos == \"C\"){gameObj.oC = playersInQ.offP; gameObj.dC = playersInQ.defP;}\n else{gameObj.oC = offC; gameObj.dC = defC;}\n return gameObj;\n //break;\n }\n }\n //OFFENSE FAST BREAK\n else if(!visionResult.side && visionResult.fB){\n console.log(\"offence fast break\");\n ballPosition -= 1;\n fastMod = 60-(10*ballPosition);\n fastResult = runFastBreak(playersInQ.offP, playersInQ.defP, gameLength, fastMod);\n if(fastResult.score){\n console.log(\"fastResult score =\"+fastResult.score);\n gameObj.score += fastResult.score;\n for(var x in playersInQ.assist){\n playersInQ.assist[x].stats.assist +=1;\n console.log (\"assist stat given to \"+x+\". He now has \"+playersInQ.assist[x].stats.assist);\n }\n }\n if(!fastResult.stay){\n gameObj.side = \"def\"; //DEFENSE WILL HAVE THE BALL AND BECOME OFFENSE\n }\n playersInQ.offP = fastResult.offP;\n playersInQ.defP = fastResult.defP;\n if(typeof playersInQ.pos == 'undefined'){console.log(\"!!!!WARNING, V.SIDE PLAYERSINQ.POS EMPTY!!!\");}\n if (playersInQ.pos == \"G\"){gameObj.oG = playersInQ.offP; gameObj.dG = playersInQ.defP;}\n else{gameObj.oG = offG; gameObj.dG = defG;}\n if (playersInQ.pos == \"F\"){gameObj.oF = playersInQ.offP; gameObj.dF = playersInQ.defP;}\n else{gameObj.oF = offF; gameObj.dF = defF;}\n if (playersInQ.pos == \"C\"){gameObj.oC = playersInQ.offP; gameObj.dC = playersInQ.defP;}\n else{gameObj.oC = offC; gameObj.dC = defC;}\n return gameObj;\n }\n //REBOUND TO DETERMINE POSSESION AND BALL POSITION.\n else if(visionResult.rebound){\n fastResult = runRebound(offG, offF, offC, defG, defF, defC, gameLength, ballPosition);\n ballPosition = fastResult.bP;\n if (fastResult.bP <= 1){playersInQ.offP=fastResult.oC; playersInQ.defP=fastResult.dC; playersInQ.pos=\"C\";}\n else if (fastResult.bP == 2){playersInQ.offP=fastResult.oF; playersInQ.defP=fastResult.dF; playersInQ.pos=\"F\";}\n else if (fastResult.bP == 3){playersInQ.offP=fastResult.oG; playersInQ.defP=fastResult.dG; playersInQ.pos=\"G\";}\n else{alert(\"ERROR 1157: REBOUND BALL POSTION NOT WITHIN RANGE\");}\n gameObj.side = fastResult.side;\n gameObj.oG = fastResult.oG;\n gameObj.oF = fastResult.oF;\n gameObj.oC = fastResult.oC;\n gameObj.dG = fastResult.dG;\n gameObj.dF= fastResult.dF;\n gameObj.dC= fastResult.dC;\n if (fastResult.score){gameObj.score = fastResult.score;}\n if(gameObj.side ==\"def\" && !fastResult.score) {\n console.log(\" defence rebounded. gameObj being returned: \"); console.log(gameObj);\n return gameObj;\n }\n else if(gameObj.side ==\"def\" && fastResult.score) {\n console.log(\" defence gets the ball after offense scores: \"); console.log(gameObj);\n return gameObj;\n }else{\n console.log(\"offense gets back the ball after rebound... outside range 0 correct? \"+ballPosition);\n }\n }\n //SUCCESFUL PASS, POSSIBLE ASSIST.\n else if(typeof visionResult.assist != 'undefined'){\n console.log(\"assist opportunity\");\n fastResult = visionResult.assist;\n var randPos = randNum(1,3);\n console.log(\"random target for pass is\"+randPos+\". and the passing position is \"+playersInQ.pos);\n if (randPos ==1 && playersInQ.pos != \"C\"){playersInQ={offP:offC,defP:defC, assist:fastResult , pos:\"C\"};}\n else if (randPos == 1 && playersInQ.pos != \"F\"){playersInQ={offP:offF,defP:defF, assist:fastResult , pos:\"F\"};}\n else if (randPos == 2 && playersInQ.pos != \"F\"){playersInQ={offP:offF,defP:defF, assist:fastResult , pos:\"F\"};}\n else if (randPos == 2 && playersInQ.pos != \"C\"){playersInQ={offP:offC,defP:defC, assist:fastResult , pos:\"C\"};}\n else if (randPos == 3 && playersInQ.pos != \"G\"){playersInQ={offP:offG,defP:defG, assist:fastResult , pos:\"G\"};}\n else if (randPos == 3 && playersInQ.pos != \"F\"){playersInQ={offP:offF,defP:defF, assist:fastResult , pos:\"F\"};}\n else{alert(\"ERROR 919: PASS NO ASSIST PLAYER RECIEVED\");}\n ballPosition -= randPos;\n if (ballPosition<0 || ballPosition > 3){\n ballPosition = 0;\n console.log(\"had to adj ball position to 0. It was out of range.\");\n }\n for(var x in playersInQ.assist){\n console.log (\"assist opprortunity for \"+x+\". Passed to the \"+playersInQ.pos+\" at position \"+ballPosition);\n }\n }\n //ERROR WARNING\n else{alert(\"ERROR 991. NO VISION RESULT FOUND!!!\");}\n }//END OF PLAY LOOP\n\n //FINALLY, RETURN OBJ TO GAME LOOP. INCLUDE .SIDE TO NOTE WHO HAS BALL NEXT.\n if(typeof playersInQ.pos == 'undefined'){alert(\"ERROR 995: PLAYERSINQ.POS EMPTY\");}\n if (playersInQ.pos == \"G\"){\n gameObj.oG = playersInQ.offP;\n gameObj.dG = playersInQ.defP;\n for(var x in gameObj.oG){\n console.log(x +\" returned as offensive guard to the simGames function.\");\n }\n }\n else{gameObj.oG = offG; gameObj.dG = defG;}\n if (playersInQ.pos == \"F\"){gameObj.oF = playersInQ.offP; gameObj.dF = playersInQ.defP;}\n else{gameObj.oF = offF; gameObj.dF = defF;}\n if (playersInQ.pos == \"C\"){gameObj.oC = playersInQ.offP; gameObj.dC = playersInQ.defP;}\n else{gameObj.oC = offC; gameObj.dC = defC;}\n return gameObj;\n}", "title": "" }, { "docid": "45b9ae7657ceaed047a2e652bc4cd1fc", "score": "0.6097158", "text": "function gambleWithSupplies(supply){\n if(supply === 'med'){\n //if a pl \n if(player.life === 100){\n var gamble = readline.keyIn(\"You don't have any Medicine, Do you want to [U]se something around you or [C]hange you're mind \",{limit: 'uc'})\n if(gamble===\"u\"){\n console.log(\"There's nothing wrong with you(not that you have any medicine even if there was), but you feel the need to be healed, you eat some berries you think will make you feel better and are temporarily poisoned. You lose 30 life points.\")\n player.life=player.life-30\n }\n \n }\n else{\n var gamble = readline.keyIn(\"You don't have any Medicine, Do you want to [U]se something around you or [C]hange you're mind \",{limit: 'uc'})\n if(gamble===\"u\"){\n if(Math.floor(Math.random() * 11)<6){\n console.log(\"You don't have any medicine, but you're desparate for first aid. You smash some mud in an open wound and the wound immediately begins to fester. Bad idea maybe? You lose 20 life points.\")\n if(player.life-20<=0){\n console.log(\"It won't stop festering!! someone help!! It's spreading oh noooo! someonendajfkbfdibfiodsjkfnvid.....\")\n }\n player.life=player.life-20\n console.log(`new stamina:${player.stamina}`)\n }else{\n console.log(\"You don't have any medicine, but you're desparate for first aid. You find some horsetail and boil it into some tea, you can feel your bones healing as you sip.\")\n player.life=player.life+20>=100 ? 100 :player.life+20\n console.log(`new stamina:${player.stamina}`)\n }\n \n }\n }\n }else{\n if(player.stamina === 10){\n var gamble = readline.keyIn(\"You don't have any food, Do you want to [E]at something around you or [C]hange you're mind \",{limit: 'ec'})\n if(gamble===\"e\"){\n console.log(\"Yoe feel full and well rested, but have the stupidest-I'm sorry - oddest urge to eat a spotted frog you see. You eat the frog and begin to feel sluggish you lose half your stamina.\")\n player.stamina=player.stamina/2||0\n console.log(`new stamina:${player.stamina}`)\n }\n }\n else{\n var gamble = readline.keyIn(\"You don't have any food, Do you want to [E]at something around you or [C]hange you're mind \",{limit: 'ec'})\n if(gamble===\"e\"){\n if(Math.floor(Math.random() * 11)<6){\n console.log(\"You don't have any food, but you're famished, you find some brightly colored fruit hanging from a tree, it taste funny enough for you to stop, but it's to late, the strange fruit makes you lethargic. You lose all your stamina\")\n player.stamina=0\n console.log(`new stamina:${player.stamina}`)\n }else{\n console.log(\"You don't have any food but you're famished, you find some cavasa burried in the ground and dig it up, you make some flavorful cavassa soup and feel better than ever.\")\n player.stamina=player.stamina +7 >=10 ? 10 : player.stamina + 7\n console.log(`new stamina:${player.stamina}`)\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e89199811420c220ddbe1194b54627c6", "score": "0.60815746", "text": "function tick() {\n\tif (gameState == GAME_STATE.PLAYING) { // if the game is playing, then check if the player has won or lost\n\t\tif (bacteria.length == 0) { // if there are no bacteria left, then the player has won\n\t\t\tgameState = GAME_STATE.WON;\n\t\t} else {\n\t\t\tvar fullCircleBacteria = false; // this flag is used to save if tehre is any bacteria which is a ful circle\n\t\t\tfor (var i in bacteria) { // go through all bacteria\n\t\t\t\tif (bacteria[i].angle > thresholdAngle && !bacteria[i].passedThreshold) { // if any bacteria has passed the threshold\n\t\t\t\t\tnumOfBacteriaPassedThreshold++; // increase the count of bacteria passing the threshold\n\t\t\t\t\tbacteria[i].passedThreshold = true; // set a flag so the same bacteria is not counted twice.\n\t\t\t\t}\n\t\t\t\tif (bacteria[i].angle >= 360) { // if a bacteria is already a full circle, then the game is lost\n\t\t\t\t\tfullCircleBacteria = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if the maximum bacteria threshold is passed or if there is a full size bacteria, the game is lost\n\t\t\tif (numOfBacteriaPassedThreshold >= maxNumOfBacteriaPassedThreshold || fullCircleBacteria) {\n\t\t\t\tgameState = GAME_STATE.LOST;\n\t\t\t}\n\t\t}\n\t}\n\n\n\tif (gameState == GAME_STATE.PLAYING) { // if the game is playing\n\t\t// find all the bacteria in shapes and make them grow\n\t\tfor (var i in bacteria) { // increase size of bacteria\n\t\t\tbacteria[i].angle += bacteriaGrowthRate;\n\t\t}\n\t\t// if the maximum bacteria is not passed, then check if a new bacteria should be added\n\t\tif (bacteria.length < maximumBacteria && Math.random() < chanceOfNewBacteria) {\n\t\t\tcreateNewBacteria();\n\t\t}\n\n\t\t// check if any bacteria should be merged\n\t\tmergeOverlappingBacteria();\n\t} else if (gameState == GAME_STATE.WON) {\n\t\tif (Math.random() < 0.1) { // randombly create explosions\n\t\t\tdocument.getElementById('UserMessage').innerHTML = 'You Won The Game!';\n\t\t\tvar explosion = new Explosion();\n\t\t\texplosion.originX = 100 * Math.random() - 50;\n\t\t\texplosion.originY = 100 * Math.random() - 50;\n\t\t\texplosion.originZ = 100 * Math.random() - 50;\n\t\t\texplosionEffect.push(explosion);\n\t\t}\n\t} else if (gameState == GAME_STATE.LOST) {\n\t\tsetLargerExplosionSize(); // increase the size of the explosions\n\n\t\tif (!earthExploded) { // only explode the earth once\n\t\t\tdocument.getElementById('UserMessage').innerHTML = 'You Have Lost!';\n\t\t\tearthExploded = true;\n\t\t\tnumOfBacteriaPassedThreshold = maxNumOfBacteriaPassedThreshold;\n\t\t\tvar explosion = new Explosion();\n\t\t\texplosion.originX = 0;\n\t\t\texplosion.originY = 0;\n\t\t\texplosionEffect.push(explosion);\n\t\t}\n\t}\n\n\t// the bacteria has already grown above, now draw it on the screen\n\tcalculateAllPoints();\n\tdrawScene();\n\n\t// ask weggl to call tick again\n\trequestAnimFrame(tick);\n}", "title": "" }, { "docid": "d6402865999e4d05c49002371b669ce9", "score": "0.6078237", "text": "function Reels() {\n var betLine = [\" \", \" \", \" \"];\n var outCome = [0, 0, 0];\n\n for (var spin = 0; spin < 3; spin++) {\n outCome[spin] = Math.floor((Math.random() * 65) + 1);\n switch (outCome[spin]) {\n case checkRange(outCome[spin], 1, 27): // 41.5% probability\n betLine[spin] = \"0\";\n blanks++;\n break;\n case checkRange(outCome[spin], 28, 37): // 15.4% probability\n betLine[spin] = \"1\";\n grapes++;\n break;\n case checkRange(outCome[spin], 38, 46): // 13.8% probability\n betLine[spin] = \"2\";\n bananas++;\n break;\n case checkRange(outCome[spin], 47, 54): // 12.3% probability\n betLine[spin] = \"3\";\n oranges++;\n break;\n case checkRange(outCome[spin], 55, 59): // 7.7% probability\n betLine[spin] = \"4\";\n cherries++;\n break;\n case checkRange(outCome[spin], 60, 62): // 4.6% probability\n betLine[spin] = \"5\";\n bars++;\n break;\n case checkRange(outCome[spin], 63, 64): // 3.1% probability\n betLine[spin] = \"6\";\n bells++;\n break;\n case checkRange(outCome[spin], 65, 65): // 1.5% probability\n betLine[spin] = \"7\";\n sevens++;\n break;\n }\n }\n return betLine;\n}", "title": "" }, { "docid": "813b942497f93e7ef2516424f7788583", "score": "0.60768133", "text": "function drawGame() {\n //draw the background\n // N-- 0, 0, 128, 80, zwart\n drawRectangle(0,0,width,height, backgroundColor);\n\n //draw player 1 (middle)\n // N-- initially 1, 37, 1, 12, groen\n drawRectangle(bat1PositionX, bat1PositionY, batSizeX, batSizeYPart, bat1ColorTopBottom);\n drawRectangle(bat1PositionX, bat1PositionY + batSizeYPart, batSizeX, batSizeYPart, bat1ColorMiddle);\n drawRectangle(bat1PositionX, bat1PositionY + batSizeYPart * 2, batSizeX, batSizeYPart, bat1ColorTopBottom);\n\n //draw player 2\n // N-- initially 126, 37, 1, 12, paars\n drawRectangle(bat2PositionX, bat2PositionY, batSizeX, batSizeYPart, bat2ColorTopBottom);\n drawRectangle(bat2PositionX, bat2PositionY + batSizeYPart, batSizeX, batSizeYPart, bat2ColorMiddle);\n drawRectangle(bat2PositionX, bat2PositionY + batSizeYPart * 2, batSizeX, batSizeYPart, bat2ColorTopBottom);\n\n //draw ball\n // N-- initially 64, 40, 1, 1, rood\n drawRectangle(ballPositionX, ballPositionY, ballSizeX, ballSizeY, ballColor);\n\n //draw the score\n drawScore();\n}", "title": "" }, { "docid": "d8cb1f33101e9185eea41555c49f3d79", "score": "0.6062498", "text": "function addBadger(e){\n\tif(atBadgerScene){\n\t\tif (e.keyCode == 66){ // 66 is the magic number that maps to the B key\n\t\t\tif(numBadgers >= 12){\n\t\t\t\tnumBadgers = 0;\n\t\t\t\tatBadgerScene = false;\n\t\t\t\tif(gotoShroom){atShroomScene = true; shroomMike.play();}\n\t\t\t\telse{atSnakeScene = true; snakuYirong.play();}\n\t\t\t}\n\t\t\telse{\n\t\t\tbadgerTom[Math.floor(Math.random()*3)].play();\n\t\t\tbadgerAnim[numBadgers++] = new animate(badgerIM,270,340/2,2,2,whereX, whereY);\n\t\t\t}\t\n\t\t}\n\telse if(atShroomScene){\n\t\t\n\t\t\n\t\t\n\t}\n\telse if(atSnakeScene){\n\t\t\t\n\t}\n\t}\n}", "title": "" }, { "docid": "daced82eba84e451bbe25db9080cabef", "score": "0.60476077", "text": "function showBoats() {\n if (boats.length > 0) {\n if (\n boats.length < 4 &&\n boats[boats.length - 1].body.position.x < width - 300\n ) {\n var positions = [-40, -60, -70, -20];\n var position = random(positions);\n var boat = new Boat(\n width,\n height - 100,\n 170,\n 170,\n position,\n boatAnimation\n );\n\n\n boats.push(boat);\n }\n\n for (var i = 0; i < boats.length; i++) {\n Matter.Body.setVelocity(boats[i].body, {\n x: -0.9,\n y: 0\n });\n\n boats[i].display();\n boats[i].animate();\n\n var collision=Matter.SAT.collides(tower.body,boats[i].body);\n if(collision.collided && !boats[i].isBroken){\n if(!isLaughing && !pirateLaughSound.isPlaying()){\n pirateLaughSound.play();\n isLaughing=true;\n }\n isGameOver=true;\n gameOver();\n }\n \n }\n } else {\n var boat = new Boat(width, height - 60, 170, 170, -60, boatAnimation);\n boats.push(boat);\n }\n}", "title": "" }, { "docid": "aeec6d5883a488e0db7d0c5a51683a8e", "score": "0.6043957", "text": "function bunnyDecide() {\n\n\t\tvar foundOne = false, enemyLeft = false, enemyRight = false, bDist = 600, absDist = 0, newDist = 0,\n\t\t\twallTrapped = false, realBx = bX + 50;\n\n\t\tif (bActive === true) {\n\t\t\tfunction go(direction) {\n\t\t\t\tbMoving = true;\n\t\t\t\tbButton = direction;\n\t\t\t}\n\n\t\t\t//Enemy checking behaviours\n\t\t\tif (bMoving === false) {\n\n\t\t\t\t//Iterate through snowballs.\n\t\t\t\tfor (f=0; f<snowballs.length; f+=1) {\n\n\t\t\t\t\t//Only check inactive ones.\n\t\t\t\t\tif (snowballs[f].active === false) {\n\t\t\t\t\t\tnewDist = realBx - snowballs[f].x;\n\t\t\t\t\t\tabsDist = Math.abs(newDist);\n\t\t\t\t\t\tif (absDist < bFocus && absDist < bDist) {\n\t\t\t\t\t\t\tbDist = absDist;\n\t\t\t\t\t\t\tfoundOne = true;\n\t\t\t\t\t\t\tbScared = true;\n\n\t\t\t\t\t\t\tif (bOuttaHere === false) {\n\n\t\t\t\t\t\t\t\tif (newDist >= 0) {\n\t\t\t\t\t\t\t\t\t//console.log(\"Scared.\")\n\t\t\t\t\t\t\t\t\tif (bX < canvaswidth - 120) {\n\t\t\t\t\t\t\t\t\t\tgo(\"right\");\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\twallTrapped = true;\n\t\t\t\t\t\t\t\t\t\tgo(\"left\");\n\t\t\t\t\t\t\t\t\t\t//console.log(\"And wall trapped.\")\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tenemyLeft = true;\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (newDist < 0 ) {\n\t\t\t\t\t\t\t\t\t//console.log(\"Scared.\")\n\n\t\t\t\t\t\t\t\t\tif (bX > 60) {\n\t\t\t\t\t\t\t\t\t\t\tgo(\"left\");\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\twallTrapped = true;\n\t\t\t\t\t\t\t\t\t\tgo(\"right\");\n\t\t\t\t\t\t\t\t\t\t//console.log(\"And wall trapped.\")\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tenemyRight = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//End of the buunny.\n\t\t\t\t\t\t\tif (absDist < 60 && bOuttaHere === false) {\n\t\t\t\t\t\t\t\tbOuttaHere = true;\n\t\t\t\t\t\t\t\tbMoving = true;\n\t\t\t\t\t\t\t\t///console.log(\"DEAD\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (enemyRight === false || enemyLeft === false) {\n\t\t\t\t\t\t\tbSurrounded = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Mark the bunny as surrounded.\n\t\t\t\tif (enemyLeft === true && enemyRight === true) {\n\t\t\t\t\t//console.log(\"Surrounded (enemies)\");\n\t\t\t\t\tbSurrounded = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (foundOne === false) {\n\t\t\t\tbScared = false;\n\t\t\t}\n\t\t\t//On no other input:\n\t\t\t//decide to move.\n\t\t\tif (bMoving === false && bWait === false && bScared === false && bOuttaHere === false){\n\t\t\t\tif (bX <= 10 || (bX > 11 && bX < (canvaswidth / 2 - 30)) ) {\n\t\t\t\t\tgo(\"right\");\n\t\t\t\t}\n\t\t\t\telse if ( bX > canvaswidth - 5 || (bX < canvaswidth - 5 && bX > (canvaswidth /2 - 30)) ) {\n\t\t\t\t\tgo(\"left\");\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t}\n\t\t//Bunny gone.\n\t\telse if (bActive === false) {\n\n\t\t\t//Entry point, v.2\n\t\t\t//console.log (\"Finding re-entry!\")\n\t\t\twhereX = bX;\n\t\t\tbBuffer = canvaswidth / 6;\n\n\t\t\twhile(absDist < 200) {\n\t\t\t\twhereX = bitwise( (Math.random() * (canvaswidth - bBuffer)) + bBuffer);\n\t\t\t\tabsDist = Math.abs(whereX - bX);\n\n\t\t\t}\n\n\t\t\tbunnyReset();\n\n\t\t\tbActive = true;\n\t\t\tbOuttaHere = false;\n\t\t\tbBack = true;\n\t\t\tbWait = false;\n\t\t\tbSurrounded = false;\n\t\t\tbScared = false;\n\t\t\tbMoving = true;\n\n\t\t\tbX = whereX;\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "aae0ec09fa644bd957bfa7dbb5955a72", "score": "0.60317445", "text": "function spinButtonClicked(event) {\n //Player Amount checking\n if (playerMoney == 0) {\n if (confirm(\"NO Money! \\nPlay again?\")) {\n resetAll();\n }\n }\n else if (playerBet > playerMoney) {\n alert(\"Not enought to play the bet\");\n }\n else if (playerBet == 0)\n alert(\"Please select how much you want to bet\");\n else if (playerBet <= playerMoney) {\n playerMoney = playerMoney - playerBet;\n playerMoneySet = playerMoney;\n spinResult = Reels(); //generates random number\n //Spin for first slot+++++++++++++++++++++++++++++++++++++++++++++\n switch (spinResult[0]) {\n case \"blank\":\n reel0 = new createjs.Bitmap(assets.getResult(\"blank\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"grapes\":\n reel0 = new createjs.Bitmap(assets.getResult(\"grapes\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"banana\":\n reel0 = new createjs.Bitmap(assets.getResult(\"banana\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"orange\":\n reel0 = new createjs.Bitmap(assets.getResult(\"orange\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"cherry\":\n reel0 = new createjs.Bitmap(assets.getResult(\"cherry\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"bar\":\n reel0 = new createjs.Bitmap(assets.getResult(\"bar\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"bell\":\n reel0 = new createjs.Bitmap(assets.getResult(\"bell\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n case \"seven\":\n reel0 = new createjs.Bitmap(assets.getResult(\"seven\"));\n reel0.x = 53;\n reel0.y = 180;\n stage.addChild(reel0);\n break;\n }\n //Spin for second slot+++++++++++++++++++++++++++++ \n switch (spinResult[1]) {\n case \"blank\":\n reel1 = new createjs.Bitmap(assets.getResult(\"blank\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"grapes\":\n reel1 = new createjs.Bitmap(assets.getResult(\"grapes\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"banana\":\n reel1 = new createjs.Bitmap(assets.getResult(\"banana\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"orange\":\n reel1 = new createjs.Bitmap(assets.getResult(\"orange\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"cherry\":\n reel1 = new createjs.Bitmap(assets.getResult(\"cherry\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"bar\":\n reel1 = new createjs.Bitmap(assets.getResult(\"bar\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"bell\":\n reel1 = new createjs.Bitmap(assets.getResult(\"bell\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n case \"seven\":\n reel1 = new createjs.Bitmap(assets.getResult(\"seven\"));\n reel1.x = 129;\n reel1.y = 180;\n stage.addChild(reel1);\n break;\n }\n //spin for third slot+++++++++++++++++++++++++++++++++++++\n switch (spinResult[2]) {\n case \"blank\":\n reel2 = new createjs.Bitmap(assets.getResult(\"blank\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"grapes\":\n reel2 = new createjs.Bitmap(assets.getResult(\"grapes\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"banana\":\n reel2 = new createjs.Bitmap(assets.getResult(\"banana\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"orange\":\n reel2 = new createjs.Bitmap(assets.getResult(\"orange\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"cherry\":\n reel2 = new createjs.Bitmap(assets.getResult(\"cherry\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"bar\":\n reel2 = new createjs.Bitmap(assets.getResult(\"bar\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"bell\":\n reel2 = new createjs.Bitmap(assets.getResult(\"bell\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n case \"seven\":\n reel2 = new createjs.Bitmap(assets.getResult(\"seven\"));\n reel2.x = 204;\n reel2.y = 180;\n stage.addChild(reel2);\n break;\n }\n ResultOutput(); //displays result\n UpdatePlayerMoney();\n }\n}", "title": "" }, { "docid": "bc1d695f80045ff6dff90b211ea2cbd5", "score": "0.6026432", "text": "function draw() {\n\tctx.drawImage(bg,0,0);\n\tfor(var i = 0; i < pipe.length; i++) {\n\t\tctx.drawImage(k1, pipe[i].x, pipe[i].y);\n\t\tif ((i>=10)&&(i<20)){\n\t\t\tlvl=2;\n\t\t}\n\t\telse if((i>=20)&&(i<30)){\n\t\t\tlvl=3;\n\t\t}\n\t\telse if(i>=30){\n\t\t\tlvl=4;\n\t\t}\n\t\tpipe[i].y+=5;\n\t\tif (lvl>=2){\n\t\t\tctx.drawImage(k2, pipe[i].x1, pipe[i].y1);\n\t\t\tpipe[i].y1+=2;\n\t\t}\n\t\tif (lvl>=3){\n\t\t\tpipe[i].y2+=2;\n\t\t\tpipe[i].x2+=1;\n\t\t\tctx.drawImage(k3, pipe[i].x2, pipe[i].y2);\n\t\t} \n\t\tif (lvl>=4){\n\t\t\tpipe[i].y3+=2;\n\t\t\tpipe[i].x3-=1;\n\t\t\tctx.drawImage(k4, pipe[i].x3, pipe[i].y3);\n\t\t}\n\t\tif(pipe[i].y == 350) {\n\t\t\tpipe.push({\n\t\t\t\tx : Math.floor(Math.random() * (330-20))+20,\n\t\t\t\ty : -50\n\t\t\t});\n\t\t}\n\t\tif(pipe[i].y1 == 500) {\n\t\t\tpipe.push({\n\t\t\t\tx1 : Math.floor(Math.random() * (330-20))+20,\n\t\t\t\ty1 : -50\n\t\t\t});\n\t\t}\n\t\tif(pipe[i].y2 == 500) {\n\t\t\tpipe.push({\n\t\t\t\tx2 : Math.floor(Math.random() * (200+100))-100,\n\t\t\t\ty2 : -50\n\t\t\t});\n\t\t}\n\t\tif(pipe[i].y3 == 500) {\n\t\t\tpipe.push({\n\t\t\t\tx3 : Math.floor(Math.random() * (500-200))+200,\n\t\t\t\ty3 : -50\n\t\t\t});\n\t\t}\n\t\tfunction damage(a,b,c){\n\t\t\tif((xPos + ship.width >= a\n\t\t\t\t&& xPos <= a + c.width)\n\t\t\t\t&& (yPos+ship.height>=b\n\t\t\t\t\t&& yPos <= b + c.height))\n\t\t\t{\n\t\t\t\tend.play();\n\t\t\t\tgameOver();\n\t\t\t\tlabel1.Canvas.Rectangle(0,0,label1. Width,label1.Height); \n\n\n\t\t\t}\n\t\t}\n\t\tdamage(pipe[i].x,pipe[i].y,k1);\n\t\tdamage(pipe[i].x1,pipe[i].y1,k2);\n\t\tdamage(pipe[i].x2,pipe[i].y2,k3);\n\t\tdamage(pipe[i].x3,pipe[i].y3,k4);\n\t\t\n\t\tif((pipe[i].y == 400) || (pipe[i].y1==400)||(pipe[i].y2==400)||(pipe[i].y3==400)) {\n\t\t\tscore++;\n\t\t\tscore_audio.play();\n\t\t\tlet flag=document.getElementById('score');\n\t\t\tflag.innerHTML='Score: '+score;\n\t\t\tsr=score;\n\t\t\n\t}\n\t}\n\n\n\tctx.drawImage(neodd, -15, 0);\n\tctx.drawImage(neodd, cvs.width - 35, 0);\n\tctx.drawImage(ship, xPos, yPos);\n\tctx.fillStyle = \"#fdd816\";\n\tctx.font = \"24px Verdana\";\n\tctx.fillText(\"Lvl: \" + lvl, 30, cvs.height - 40);\n\tctx.fillText(\"Счет: \" + score, 30, cvs.height - 20);\n\trequestAnimationFrame(draw);\n}", "title": "" }, { "docid": "9276dfcc01abed1ec93c12aad43cb4a4", "score": "0.60194504", "text": "function battle() {\n if (currentRep === 2) {\n if ((hero.currentPosition.x === 1 && hero.currentPosition.y === 2) || (hero.currentPosition.x === 2 && hero.currentPosition.y === 1)) {\n currentMonster = goblin1;\n } else {\n currentMonster = goblin2;\n }\n } else {\n currentMonster = orc;\n }\n while ((currentRep === 2 || currentRep === 3) && (currentMonster.hp > 0 || hero.hp > 0)) {\n var sword = new Audio('assets/sound/sword.mp3')\n sword.play();\n hero.hp -= (currentMonster.attack - hero.defense);\n $(\"#prompt\").append(\"You hit the monster and did \" + hero.attack + \" damage!\" + \"<br>\");\n currentMonster.hp -= (hero.attack - currentMonster.defense);\n $(\"#prompt\").append(\"The monster did \" + currentMonster.attack + \" damage!\" + \"<br>\");\n autoscroll();\n if (currentMonster.hp < 1) {\n $(\"#prompt\").append(\"You killed the monster\" + \"<br>\");\n autoscroll();\n $('#attack').hide();\n $('#up').show();\n $('#left').show();\n $('#down').show();\n $('#right').show();\n Mousetrap.unpause();\n switch (currentMonster) {\n case goblin1:\n console.log(goblin1)\n area[goblin1.currentPosition.y][goblin1.currentPosition.x] = 1;\n $('#tile' + goblin1.currentPosition.y + goblin1.currentPosition.x).html(\"<img src='assets\\\\images\\\\floor.png' alt='tile' width='40px'/>\");;\n break;\n case goblin2:\n console.log(goblin2)\n area[goblin2.currentPosition.y][goblin2.currentPosition.x] = 1;\n $('#tile' + goblin2.currentPosition.y + goblin2.currentPosition.x).html(\"<img src='assets\\\\images\\\\floor.png' alt='tile' width='40px'/>\");;\n break;\n case orc:\n area[orc.currentPosition.y][orc.currentPosition.x] = 5;\n console.log(area[0][3]);\n bossDefeated = true;\n $('#tile03').html(\"<img src='assets\\\\images\\\\chest.png' id='chest' alt='chest' width='40px'/>\");\n var treasure = new Audio('assets\\\\sound\\\\treasure.mp3')\n treasure.play();\n break;\n default:\n break;\n }\n break;\n } else if (hero.hp < 1) {\n $(\"#prompt\").append(\"You died\" + \"<br>\");\n autoscroll();\n area[hero.currentPosition.y][hero.currentPosition.x] = 1;\n $('#tile' + hero.currentPosition.y + hero.currentPosition.x).html(\"<img src='assets\\\\images\\\\floor.png' alt='tile' width='40px'/>\");\n break;\n }\n break;\n }\n}", "title": "" }, { "docid": "1be89df0c9cb307a66339c19abbb1b5f", "score": "0.6010052", "text": "function GetBrew() {\n let BestPotion = 0;\n let PrevResult = 0;\n PotionArray.forEach((Potion, i) => {\n let delta = [Myinv[0] + Potion.d0, Myinv[1] + Potion.d1, Myinv[2] + Potion.d2, Myinv[3] + Potion.d3]\n let time = 0;\n\n delta.forEach((d, i) => {\n if (d < 0) {\n time -= d * DeltaTime[i];\n }\n })\n\n if (PrevResult < Potion.price / time) {\n PrevResult = Potion.price / time;\n BestPotion = i;\n }\n })\n choosenBrewId = BestPotion;\n\n let cast = ingridient();\n if (cast != \"READY\") {\n if (CastArray.find(el => el.id == cast).used == true) {\n console.log(`CAST ${cast}`);\n } else {\n console.log(\"REST\")\n }\n\n } else {\n console.log(`BREW ${PotionArray[BestPotion].id}`)\n choosenBrewId = 0;\n }\n\n\n}", "title": "" }, { "docid": "a43f7f77dfb909ce561b2e27803a252e", "score": "0.5999944", "text": "function greedyAiThinking(board){\r\n\tvar pebblesAlreadyOwned = board[13];\r\n\t// this array will hold the number of pebbles earned for each of the possible moves\r\n\tvar pebblesEarned = [0, 0, 0, 0, 0, 0];\r\n\tvar thinkBoard;\r\n\t// for each of the computer's possible moves\r\n\tfor (let i = 7; i < 13; i++){\r\n\t\t// make a copy of the actual board\r\n\t\tthinkBoard = board.slice();\r\n\t\t// set flag to false at the start of each move check\r\n\t\tlandedInBig = false;\r\n\t\t// only think about a move if it's valid\r\n\t\tif (thinkBoard[i] != 0){\r\n\t\t\t// make the move on the temporary thinking board with our position in this loop dictating which pit has been chosen\r\n\t\t\tpitChosen = i;\r\n\t\t\tmove(thinkBoard, false);\r\n\t\t\t// store the number of pebbles this move earned us\r\n\t\t\tpebblesEarned[i-7] += pebblesIn13AfterThinking - pebblesAlreadyOwned;\r\n\t\t\t// if this move landed the computer in the big pit, it should be worth a bit more\r\n\t\t\tif (landedInBig)\r\n\t\t\t\tpebblesEarned[i-7] += 1.5;\r\n\t\t}\r\n\t}\r\n\t\r\n\t// find the most pebbles we were able to earn with a move\r\n\tvar mostEarned = 0;\r\n\tfor (let i = 0; i < 6; i++)\r\n\t\tif (pebblesEarned[i] > mostEarned)\r\n\t\t\tmostEarned = pebblesEarned[i];\r\n\t// now let's store the moves that gave us the most pebbles in an array\r\n\tvar bestMoves = [];\r\n\tfor (let i = 0; i < 6; i++)\r\n\t\tif (pebblesEarned[i] == mostEarned)\r\n\t\t\tbestMoves.push(i);\r\n\t// if there was only one best move, then choose it\r\n\tif (bestMoves.length == 1){\r\n\t\tpitChosen = bestMoves[0] + 7;\r\n\t}\r\n\t// if there was more than one, we will just randomly choose one\r\n\telse{\r\n\t\tpitChosen = bestMoves[Math.round(Math.random() * (bestMoves.length - 1))] + 7;\r\n\t}\r\n\t// finally the computer can make its move\r\n\tmove(realBoard, true);\t\r\n}", "title": "" }, { "docid": "e2709b7f026a8cb8e95ae06373ae6960", "score": "0.5997077", "text": "function runGame() {\n character.update();\n\n if(Math.random() < 0.025) {\n makeGreenEnemy();\n }\n\n if(Math.random() < 0.025) {\n makeEnemy();\n }\n\n if(Math.random() < 0.025) {\n makePickup();\n }\n\n }", "title": "" }, { "docid": "f0f9c24cd2894ebb752a0828764f7973", "score": "0.59934", "text": "function bait () {\n if (game.fire) {\n\n return ' you have put out the fire'\n } else {\n\n game.bait++\n return 'you have 1 piece of bait'\n }\n\n}", "title": "" }, { "docid": "4f26db42436d45f2fcc61f44b39632b6", "score": "0.59898853", "text": "function takeTreasure() {\r\n\tRSPEAK(128);\r\n\t// Out from the shadows behind you pounces a bearded pirate! \"Har, har,\" \r\n\t// he chortles, \"I\\'ll just take all this booty and hide it away with me \r\n\t// chest deep in the maze!\" He snatches your treasure and vanishes into \r\n\t// the gloom. \r\n\t\r\n\t//DON'T STEAL CHEST BACK FROM TROLL!\r\n\tif (PLACE[MESSAG] == 0) MOVE(CHEST, CHLOC); // *message in second maze , chloc=114 (pirate chest)\r\n\tMOVE(MESSAG, CHLOC2); //CHLOC2=140, dead end\r\n\tfor (var j = 50; j <= MAXTRS; j++) {\r\n\t\tif (j != PYRAM || (LOC != PLAC[PYRAM] && LOC != PLAC[EMRALD])) {\r\n\t\t\tif (AT(j) && FIXED[j] == 0) CARRY(j,LOC); // take object from location\r\n\t\t\tif (TOTING(j)) DROP(j,CHLOC); // drop object at chest-loc\r\n\t\t}\r\n\t}\r\n\tDLOC[6] = CHLOC;\r\n\tODLOC[6] = CHLOC;\r\n\tDSEEN[6] = false;\r\n}", "title": "" }, { "docid": "4541ea6037b2bf8af78b03a4a5ca33da", "score": "0.5975734", "text": "function testBots2() {\n var depthSearched = [2, 3, 4, 5, 6];\n var numGamesToPlay = [1500, 200, 20, 4, 1];\n var numGamesToPlayScalingFactor = 1;\n var averages = [];\n var averagesNormalized = [];\n\n for (var d = 0; d < depthSearched.length; d++) {\n averages.push([]);\n averagesNormalized.push([]);\n var gameAI = require('../src/GameAI')\n var b = require('./bots/Bots');\n var state = new g.GameState();\n var minibots = [\n [false , null, true, depthSearched[d]],\n [true, null, true, depthSearched[d]]\n ];\n\n var timePerMove = [];\n for (var k = 0; k < minibots.length; k++) {\n timePerMove.push([]);\n }\n\n var numGames = numGamesToPlay[d]*numGamesToPlayScalingFactor;\n results = new Array(2);\n for (var bot1 = 0; bot1 < 2; bot1++) {\n results[bot1] = 0;\n }\n\n for (var gameNr = 0; gameNr < numGames; gameNr++) {\n //if (Math.floor(gameNr/(numGames)*100) % 10 === 0) {\n if (gameNr % Math.floor(numGames/10) === 0) {\n console.log(Math.floor(gameNr/(numGames)*100) +\"% complete\");\n }\n state = new g.GameState();\n var playerNum = 0;\n var move = -1;\n var success = false;\n while (state.isGameOver() !== true) {\n if (gameNr*2 >= numGames) {\n var rBot = new b.Random();\n move = rBot.getMove(state);\n success = state.move(move);\n if (success !== true) {\n console.log(\" provided invalid move (\"+move+\"), game terminated\");\n break;\n }\n if (state.isGameOver() === true) {\n break;\n }\n }\n var bestPaths = new Array(minibots.length);\n for (var m = 0; m < minibots.length; m++) {\n var search = new gameAI.Search();\n var startTime = process.hrtime();\n bestPaths[m] = search.MinimaxID(state, minibots[m][0], minibots[m][1], minibots[m][2], minibots[m][3]);\n var diff = process.hrtime(startTime);\n timePerMove[m].push((diff[0] * 1e9 + diff[1]));\n }\n for (var i = 0; i < bestPaths[0].length; i++) {\n for (var j = 1; j < bestPaths.length; j++) {\n if (bestPaths[j][i] !== bestPaths[j-1][i]) {\n console.log(\"Discrepancy found!\");\n break;\n }\n } \n }\n //console.log(bestPaths[0] +\" === \"+ bestPaths[1]);\n move = bestPaths[0][0];\n success = state.move(move);\n if (success !== true) {\n console.log(\" provided invalid move (\"+move+\"), game ended\");\n break;\n } \n if (state.isGameOver() === true) {\n results[0]++;\n }\n\n if (gameNr*2 < numGames) {\n var rBot = new b.Random();\n move = rBot.getMove(state);\n success = state.move(move);\n if (success !== true) {\n console.log(\" provided invalid move (\"+move+\"), game ended\");\n break;\n }\n if (state.isGameOver() === true) {\n break;\n }\n }\n }\n }\n\n var sums = new Array(minibots.length);\n for (var i = 0; i < minibots.length; i++) {\n sums[i] = 0;\n for (var j = 0; j < timePerMove[0].length; j++) {\n sums[i] += timePerMove[i][j];\n }\n averages[d].push(Math.round(sums[i]/timePerMove[0].length/1000));\n }\n for (var i = 0; i < minibots.length; i++) {\n averagesNormalized[d].push(Math.round(sums[0]/sums[i]*100));\n }\n console.log(\"final score for depth \"+d+\": \"+String(results));\n }\n for (var d = 0; d < depthSearched.length; d++) {\n console.log(\"Depth = \"+depthSearched[d]+\":\\tabs time avg (us): \"+String(averages[d]));\n console.log(\"\\t\\ttime avg increase: \"+String(averagesNormalized[d]));\n }\n \n}", "title": "" }, { "docid": "b389640cadf829264049f9d8962d1aa6", "score": "0.59750074", "text": "function playGame() {\n var tiles = getBricksArray();\n gameBoard = printGameScreen(tiles);\n container.appendChild(gameBoard);\n }", "title": "" }, { "docid": "97d78631ba198500d164520867780631", "score": "0.59716624", "text": "function doBlk() {\n\n var inbounds = (Math.floor(Math.random() * 2) == 0);\n\n this.selectedPlayerBLK.BLK += 1;\n this.DEFteam.BLK += 1;\n this.gameLog.push(minTommss(this.quarterLength) + \" \" + this.OFFteam.tag + \" - \" + this.selectedPlayerOff.name + \" attempted a \" + this.shot + \" and was blocked by \" + this.selectedPlayerBLK.name + \"!\");\n this.selectedPlayerOff.FGA += 1;\n this.OFFteam.FGA += 1;\n this.gameLog.push(this.selectedPlayerOff.name + \"(\" + this.OFFteam.tag + \")\" + \" FG%: \" + (((this.selectedPlayerOff.FGM / this.selectedPlayerOff.FGA) * 100).toFixed(1)) + \"% \" + this.selectedPlayerBLK.name + \"(\" + this.DEFteam.tag + \")\" + \" BLK:\" + this.selectedPlayerBLK.BLK);\n\n if (inbounds != 0) {\n this.gameLog.push(\"The ball went out of bounds!\");\n this.liveBall = false;\n simPossession();\n }\n else {\n\n doReb();\n }\n}", "title": "" }, { "docid": "a86e4f9bc68ce763ecfd40ec91f47181", "score": "0.5970736", "text": "function updateGame(){\n t+=1;\n try{\n absorbSound.volume.gain.value = 0;\n harverterSuckSound.volume.gain.value = 0;\n sectorFillSound.volume.gain.value = 0;\n } catch { }\n\n view.x = p.x - mw;\n view.y = p.y - mh;\n Fuelrocks.forEach(e=>e.update());\n splodes.forEach(e=>e.update());\n planets.forEach(e=>e.update());\n artifacts.forEach(e=>e.update());\n planetSectors.forEach(e=>e.update());\n harvesters.forEach(e=>e.update());\n babies.forEach(e=>e.update());\n drones.forEach(e=>e.update());\n p.update();\n pruneDead(splodes);\n pruneDead(artifacts);\n pruneDead(Fuelrocks);\n pruneDead(planetSectors);\n pruneDead(harvesters);\n pruneDead(babies);\n pruneDead(drones);\n pruneScreen(p.enemiesInView);\n pruneDead(p.enemiesInView);\n\n if(Key.justReleased(Key.m)){\n minimapToggle = !minimapToggle;\n mapTriggered = true;\n }\n if(Key.justReleased(Key.h)){\n helpToggle = !helpToggle;\n \n }\n if(Key.justReleased(Key.r)){\n resetGame();\n }\n}", "title": "" }, { "docid": "2cd1f5afb82bbaee4237c1d84d722363", "score": "0.5969592", "text": "function Reels() {\n var betLine = [\" \", \" \", \" \"];\n var outCome = [0, 0, 0];\n\n for (var spin = 0; spin < 3; spin++) {\n outCome[spin] = Math.floor((Math.random() * 65) + 1);\n switch (outCome[spin]) {\n case checkRange(outCome[spin], 1, 27):\n betLine[spin] = \"blank\";\n blanks++;\n break;\n case checkRange(outCome[spin], 28, 37):\n betLine[spin] = \"apple\";\n apple++;\n break;\n case checkRange(outCome[spin], 38, 46):\n betLine[spin] = \"diamond\";\n bigwin++;\n break;\n case checkRange(outCome[spin], 47, 54):\n betLine[spin] = \"dollar\";\n diamond++;\n break;\n case checkRange(outCome[spin], 55, 59):\n betLine[spin] = \"flower\";\n dollar++;\n break;\n case checkRange(outCome[spin], 60, 62):\n betLine[spin] = \"bigwin\";\n flower++;\n break;\n case checkRange(outCome[spin], 63, 64):\n betLine[spin] = \"srtawberry\";\n srtawberry++;\n break;\n case checkRange(outCome[spin], 65, 65):\n betLine[spin] = \"seven\";\n seven++;\n break;\n }\n }\n return betLine;\n}", "title": "" }, { "docid": "fbcdd39ae2b549470d8ea821f9069850", "score": "0.59621096", "text": "function runGame() {\n var player = new Player(\"Joan\", 500, 30, 70);\n var zombie = new Zombie(40, 50, 20);\n var charger = new FastZombie(175, 25, 60);\n var tank = new StrongZombie(250, 100, 15);\n var spitter = new RangedZombie(150, 20, 20);\n var boomer = new ExplodingZombie(50, 15, 10);\n\n var shovel = new Weapon(\"shovel\", 15);\n var sandwich = new Food(\"sandwich\", 30);\n var chainsaw = new Weapon(\"chainsaw\", 25);\n\n player.takeItem(shovel);\n player.takeItem(sandwich);\n player.takeItem(chainsaw);\n player.discardItem(new Weapon(\"scythe\", 21));\n player.discardItem(shovel);\n player.checkPack();\n player.takeItem(shovel);\n player.equip(shovel);\n console.log('========');\n player.checkPack();\n\n player.equippedWith();\n player.useItem(chainsaw);\n player.equippedWith();\n player.checkPack();\n\n player.useItem(shovel);\n player.equippedWith();\n player.checkPack();\n\n player.health = 487;\n console.log(\"Before health: \" + player.health);\n player.useItem(sandwich);\n console.log(\"After health: \" + player.health);\n player.checkPack();\n}", "title": "" }, { "docid": "6266f1af16fab5ab4610110c4ae25320", "score": "0.5946081", "text": "function bowl() {\n const pinsKnockedDown = Math.floor(Math.random() * (pinsRemaining + 1));\n \n return bowledAndKnockedDown(pinsKnockedDown);\n }", "title": "" }, { "docid": "6547cc6af42f8e7d31314bf0edbd9873", "score": "0.5939959", "text": "function rpgGame(yourChoice) {\n var humanChoice, botChoice;\n humanChoice = yourChoice.id;\n botChoice = getAutoNumber(randToRpsInt());\n console.log(botChoice);\n result = decideWinner(humanChoice, botChoice); //[0,1] human lost| bot win\n console.log(result);\n message = finalMessage(result);\n console.log(message);\n rpsFrontEnd(humanChoice, botChoice, message);\n}", "title": "" }, { "docid": "6582e411b59e131a16091b300c5a0434", "score": "0.59330726", "text": "function playEasy() {\n\n\n nbAsteroids = 6;\n createAsteroid();\n playgame();\n creerUI();\n}", "title": "" }, { "docid": "fd77fdb663605cefebdf16f1549e10a4", "score": "0.5931357", "text": "function loop(state) {\n if (!state) {\n return;\n }\n const snakeOne = state.players[0];\n const snakeTwo = state.players[1];\n snakeOne.pos.x += snakeOne.vel.x;\n snakeOne.pos.y += snakeOne.vel.y;\n snakeTwo.pos.x += snakeTwo.vel.x;\n snakeTwo.pos.y += snakeTwo.vel.y;\n \n // Definition de la position actuelle de la tete du serpent\n if (snakeOne.pos.x < 0 || snakeOne.pos.x > GridLength || snakeOne.pos.y < 0 || snakeOne.pos.y > GridLength) {\n return 2;\n }\n if (snakeTwo.pos.x < 0 || snakeTwo.pos.x > GridLength || snakeTwo.pos.y < 0 || snakeTwo.pos.y > GridLength) {\n return 1;\n }\n if (state.apple.x === snakeOne.pos.x && state.apple.y === snakeOne.pos.y) {\n snakeOne.snake.push({ ...snakeOne.pos });\n snakeOne.pos.x += snakeOne.vel.x;\n snakeOne.pos.y += snakeOne.vel.y;\n randomapple(state);\n }\n if (state.apple.x === snakeTwo.pos.x && state.apple.y === snakeTwo.pos.y) {\n snakeTwo.snake.push({ ...snakeTwo.pos });\n snakeTwo.pos.x += snakeTwo.vel.x;\n snakeTwo.pos.y += snakeTwo.vel.y;\n randomapple(state);\n }\n if (snakeOne.vel.x || snakeOne.vel.y) {\n for (let cell of snakeOne.snake) {\n if (cell.x === snakeOne.pos.x && cell.y === snakeOne.pos.y) {\n return 2;\n }\n }\n snakeOne.snake.push({ ...snakeOne.pos });\n snakeOne.snake.shift();\n }\n if (snakeTwo.vel.x || snakeTwo.vel.y) {\n for (let cell of snakeTwo.snake) {\n if (cell.x === snakeTwo.pos.x && cell.y === snakeTwo.pos.y) {\n return 1;\n }\n }\n snakeTwo.snake.push({ ...snakeTwo.pos });\n snakeTwo.snake.shift();\n }\n return false;\n }", "title": "" }, { "docid": "6d9483dce21e087459f63887868308af", "score": "0.59306854", "text": "function handle(x) {\n latestBowlerCounter1=bowlerCounter;\n if(latestBowlerCounter1==4) {\n latestBowlerCounter2=0;\n } else {\n latestBowlerCounter2=bowlerCounter+1;\n }\n //First thing that is done is to increment the ball count for the team and the bowler\n teamBalls++;\n teamBallsCount++;\n bowlerBalls[bowlerCounter]++;\n ballsRemaining--;\n /*\n * handling numbers should be done in a more efficient way\n * This is just the basic handling for testing - a more efficient way to handle the random number\n * will be created that depends on a number of factors like the batsman, bowler, ground, team fielding, pitch\n */\n if (x==5) {\n x=Math.floor(Math.random()*7)+1;\n if(x==5) {\n x=Math.floor(Math.random()*7)+1;\n if(x==5) {\n x=Math.floor(Math.random()*7)+1;\n if(x==5) {\n x=Math.floor(Math.random()*7)+1;\n }\n }\n }\n }\n if(x==0){\n x=Math.floor(Math.random()*8);\n if(x==6||x==4||x==7||x==0) {\n x=0;\n }\n if (x==5) {\n x=Math.floor(Math.random()*7)+1;\n if(x==5) {\n x=Math.floor(Math.random()*8);\n if(x==5) {\n x=Math.floor(Math.random()*8);\n if(x==5) {\n x=Math.floor(Math.random()*8);\n }\n }\n }\n }\n }\n if(x==4|x==6){\n x=Math.floor(Math.random()*7)+1;\n if (x==5) {\n x=Math.floor(Math.random()*7)+1;\n if(x==5) {\n x=Math.floor(Math.random()*8);\n if(x==5) {\n x=Math.floor(Math.random()*8);\n if(x==5) {\n x=Math.floor(Math.random()*8);\n }\n }\n }\n }\n }\n if(x==3){\n x=Math.floor(Math.random()*3)+1;\n }\n\n /*\n * 7 is for dot ball.\n * Hence the score isn't increased, but the ball count is increased\n */\n\n if(x!=7){\n batsmanRuns[batsmanCounter]+=x; //Increasing the runs scored if x is not 7\n teamTotal+=x; //Increasing the team total\n bowlerRuns[bowlerCounter]+=x; //Increasing the runs for the bowler\n partnershipRuns[partnershipCounter]+=x;\n requiredRuns-=x;\n }\n batsmanBalls[batsmanCounter]++; //Increasing the ball count for the batsman\n partnershipBalls[partnershipCounter]++;\n\n //Variables used to assign values to the Span IDs\n\n partnershipIndicator = \"partnership\"+partnershipCounter;\n partnershipRunsIndicator = \"partnershipRuns\"+partnershipCounter;\n partnershipBallsIndicator = \"partnershipBalls\"+partnershipCounter;\n partnershipStrikeIndicator = \"partnershipStrike\"+partnershipCounter;\n fallOfWicketIndicator = \"fallOfWicket\"+partnershipCounter;\n\n batsmanInFieldIndicator=\"batsman_infield\"+batsman1;\n batsmanInFieldIndicator2=\"batsman_infield\"+batsman2;\n\n batsmanRunIndicator=\"batsman_runs\"+batsmanCounter;\n batsmanTotalIndicator=\"batsman_total\"+batsmanCounter;\n batsmanStrikeIndicator=\"batsman_strike\"+batsmanCounter;\n\n bowlerBallsIndicator=\"bowler_balls\"+bowlerCounter;\n bowlerMaidensIndicator=\"bowler_maidens\"+bowlerCounter;\n bowlerRunsIndicator=\"bowler_runs\"+bowlerCounter;\n bowlerWicketsIndicator=\"bowler_wickets\"+bowlerCounter;\n bowlerStrikeIndicator=\"bowler_strike\"+bowlerCounter;\n\n //Setting a * near the current batsman and bowler\n document.getElementById(batsmanInFieldIndicator).innerHTML = \"<b>\" + document.getElementById(batsmanInFieldIndicator).innerHTML + \"</b>\";\n document.getElementById(batsmanInFieldIndicator2).innerHTML = \"<b>\" + document.getElementById(batsmanInFieldIndicator2).innerHTML + \"</b>\";\n\n document.getElementById(batsmanStrikeIndicator).innerHTML = \"*\";\n document.getElementById(bowlerStrikeIndicator).innerHTML = \"*\";\n document.getElementById(partnershipIndicator).innerHTML = batsmanName[batsman1]+\" and \"+batsmanName[batsman2];\n document.getElementById(partnershipStrikeIndicator).innerHTML = \"*\";\n\n\n //If the ball is a dot ball(x==7), then setting a dot in the scoring section\n if(x==7) {\n document.getElementById(batsmanRunIndicator).innerHTML = document.getElementById(batsmanRunIndicator).innerHTML + \".\" + \" \";\n document.getElementById(\"allLatestBalls\").innerHTML = \".\" + \" \" + document.getElementById(\"allLatestBalls\").innerHTML;\n document.getElementById(\"latestBall\").innerHTML = \".\" + \" \" ;\n }\n\n //If the ball is a Big hit, then bolding it scoring section\n if(x==6 || x==4 || x==5) {\n document.getElementById(batsmanRunIndicator).innerHTML = document.getElementById(batsmanRunIndicator).innerHTML + \"<b>\"+x+\"</b>\" + \" \";\n document.getElementById(\"latestBall\").innerHTML = \"<b>\"+x+\"</b>\" + \" \";\n document.getElementById(\"allLatestBalls\").innerHTML = \"<b>\"+x+\"</b>\" + \" \" + document.getElementById(\"allLatestBalls\").innerHTML;\n }\n\n //If the ball is a wicket, then bolding it\n if(x==0) {\n document.getElementById(batsmanRunIndicator).innerHTML = document.getElementById(batsmanRunIndicator).innerHTML + \"<b>\"+\"W\"+\"</b>\" + \" \";\n document.getElementById(\"latestBall\").innerHTML = \"<b>\"+\"W\"+\"</b>\" + \" \" ;\n document.getElementById(\"allLatestBalls\").innerHTML = \"<b>\"+\"W\"+\"</b>\" + \" \" + document.getElementById(\"allLatestBalls\").innerHTML;\n }\n\n //For everything else, just displaying the score\n if(x==1 || x==2 || x==3 ) {\n document.getElementById(batsmanRunIndicator).innerHTML = document.getElementById(batsmanRunIndicator).innerHTML + x + \" \";\n document.getElementById(\"allLatestBalls\").innerHTML = x + \" \" + document.getElementById(\"allLatestBalls\").innerHTML;\n document.getElementById(\"latestBall\").innerHTML = x + \" \";\n }\n\n //Showing the total score of the batsman\n document.getElementById(batsmanTotalIndicator).innerHTML = batsmanRuns[batsmanCounter]+\"(\"+batsmanBalls[batsmanCounter]+\")\";\n\n //Incrementing the team score at the bottom of batting card\n document.getElementById(\"team_score\").innerHTML = teamTotal+\"/\"+teamWickets;\n document.getElementById('teamOvers').innerHTML = teamOvers+\".\"+teamBalls;\n\n //Adjusting the bowler details after the ball has been handled\n document.getElementById(bowlerBallsIndicator).innerHTML=bowlerOvers[bowlerCounter]+\".\"+bowlerBalls[bowlerCounter];\n document.getElementById(bowlerMaidensIndicator).innerHTML=bowlerMaidens[bowlerCounter];\n document.getElementById(bowlerRunsIndicator).innerHTML=bowlerRuns[bowlerCounter];\n document.getElementById(bowlerWicketsIndicator).innerHTML=bowlerWickets[bowlerCounter];\n\n //Adjusting the partnership details after the ball has been handled\n document.getElementById(partnershipRunsIndicator).innerHTML=partnershipRuns[partnershipCounter];\n document.getElementById(partnershipBallsIndicator).innerHTML=partnershipBalls[partnershipCounter];\n\n //Changing the batsman counter when the runs scored is odd\n if(x==5||x==1||x==3) {\n if(batsmanCounter==batsman1){\n batsmanCounter=batsman2;\n strikeIndicatorChange(batsman1,batsman2);\n }else if(batsmanCounter==batsman2){\n batsmanCounter=batsman1;\n strikeIndicatorChange(batsman2,batsman1);\n }\n }\n //Handling a wicket\n if(x==0) {\n teamWickets++; //Adding wickets to the total team tally\n bowlerWickets[bowlerCounter]++; //Adding wickets for a bowler's tally\n wicketsRemaining--; //Reducing the number of available wickets!\n //Showing the score in bold after the batsman is out\n //Handling things like editing the scorecard, bowler's stats once the batsman is out\n document.getElementById(batsmanTotalIndicator).innerHTML = \"<b>\"+batsmanRuns[batsmanCounter]+\"(\"+batsmanBalls[batsmanCounter]+\")\"+\"</b>\";\n document.getElementById(batsmanStrikeIndicator).innerHTML = \"\";\n document.getElementById(\"team_score\").innerHTML = teamTotal+\"/\"+teamWickets;\n document.getElementById(bowlerWicketsIndicator).innerHTML=bowlerWickets[bowlerCounter];\n document.getElementById(partnershipStrikeIndicator).innerHTML = \"\";\n document.getElementById(partnershipBallsIndicator).innerHTML = partnershipBalls[partnershipCounter];\n document.getElementById(partnershipRunsIndicator).innerHTML = partnershipRuns[partnershipCounter];\n document.getElementById(fallOfWicketIndicator).innerHTML = teamTotal+\"/\"+teamWickets+\" at \"+teamOvers+\".\"+teamBalls+\"<br/>\"+batsmanName[batsmanCounter]+\" to \"+bowlerName[bowlerCounter];\n\n //Increasing the batsman counter so that the next man comes in\n if(batsmanCounter==batsman1){\n document.getElementById(batsmanInFieldIndicator).innerHTML = \"<i>\" + document.getElementById(batsmanInFieldIndicator).innerHTML+\"</i>\";\n batsman1=teamWickets+1;\n batsmanCounter=batsman1;\n }else if(batsmanCounter==batsman2){\n document.getElementById(batsmanInFieldIndicator2).innerHTML = \"<i>\" + document.getElementById(batsmanInFieldIndicator2).innerHTML+\"</i>\";\n batsman2=teamWickets+1;\n batsmanCounter=batsman2;\n }\n partnershipCounter++;\n }\n\n //Handling the end of an over for the bowling team\n if(teamBalls==6) {\n teamOvers++;\n teamBalls=0;\n document.getElementById('teamOvers').innerHTML = teamOvers+\".\"+teamBalls;\n document.getElementById(\"latestBowlerOvers0\").innerHTML=bowlerOvers[bowlerCounter]+\".\"+bowlerBalls[bowlerCounter];\n document.getElementById(bowlerBallsIndicator).innerHTML=bowlerOvers[bowlerCounter]+\".\"+bowlerBalls[bowlerCounter];\n document.getElementById(\"allLatestBalls\").innerHTML = \"<b> | </b> \" + document.getElementById(\"allLatestBalls\").innerHTML;\n if(batsmanCounter==batsman1){\n batsmanCounter=batsman2;\n strikeIndicatorChange(batsman1,batsman2);\n } else if(batsmanCounter==batsman2){\n batsmanCounter=batsman1;\n strikeIndicatorChange(batsman2,batsman1);\n }\n }\n\n if(batsmanCounter==batsman1) {\n document.getElementById(\"latestBatsmanStrike1\").innerHTML = \"\";\n document.getElementById(\"latestBatsmanStrike0\").innerHTML = \"*\";\n } else if(batsmanCounter==batsman2) {\n document.getElementById(\"latestBatsmanStrike0\").innerHTML = \"\";\n document.getElementById(\"latestBatsmanStrike1\").innerHTML = \"*\";\n }\n\n //Handling the end of an over for an individual bowler\n if(bowlerBalls[bowlerCounter]==6) {\n bowlerOvers[bowlerCounter]++;\n bowlerBalls[bowlerCounter]=0;\n document.getElementById(bowlerStrikeIndicator).innerHTML = \"\";\n document.getElementById(bowlerBallsIndicator).innerHTML=bowlerOvers[bowlerCounter]+\".\"+bowlerBalls[bowlerCounter];\n document.getElementById(\"latestBowlerOvers0\").innerHTML=bowlerOvers[bowlerCounter]+\".\"+bowlerBalls[bowlerCounter];\n //Incrementing the bowler counter at the end of an over\n bowlerCounter++;\n //If all the five bowlers have bowled, then bringing back the first bowler again\n if(bowlerCounter==5){\n bowlerCounter=0;\n }\n }\n\n // Calculating Batsman Strike Rate and Bowler Economy separately\n batsmanStrRate[batsman1] = ((batsmanRuns[batsman1]/batsmanBalls[batsman1])*100).toFixed(2);\n batsmanStrRate[batsman2] = ((batsmanRuns[batsman2]/batsmanBalls[batsman2])*100).toFixed(2);\n\n if(!isFinite(batsmanStrRate[batsman1])) {\n batsmanStrRate[batsman1] = \"--\";\n }\n if(!isFinite(batsmanStrRate[batsman2])) {\n batsmanStrRate[batsman2] = \"--\";\n }\n\n bowlerEconomy[latestBowlerCounter1] = ((bowlerRuns[latestBowlerCounter1]/(bowlerOvers[latestBowlerCounter1]*6+bowlerBalls[latestBowlerCounter1]))*6).toFixed(2);\n bowlerEconomy[latestBowlerCounter2] = ((bowlerRuns[latestBowlerCounter2]/(bowlerOvers[latestBowlerCounter2]*6+bowlerBalls[latestBowlerCounter2]))*6).toFixed(2);\n if(!isFinite(bowlerEconomy[latestBowlerCounter1])) {\n bowlerEconomy[latestBowlerCounter1] = \"--\";\n }\n if(!isFinite(bowlerEconomy[latestBowlerCounter2])) {\n bowlerEconomy[latestBowlerCounter2] = \"--\";\n }\n //Latest Batsman and Bowler score Handling\n\n document.getElementById(\"latestBatsmanName0\").innerHTML=batsmanName[batsman1];\n document.getElementById(\"latestBatsmanRuns0\").innerHTML=batsmanRuns[batsman1];\n document.getElementById(\"latestBatsmanBalls0\").innerHTML=batsmanBalls[batsman1];\n document.getElementById(\"latestBatsmanStrRate0\").innerHTML=batsmanStrRate[batsman1];\n document.getElementById(\"latestBatsmanName1\").innerHTML=batsmanName[batsman2];\n document.getElementById(\"latestBatsmanRuns1\").innerHTML=batsmanRuns[batsman2];\n document.getElementById(\"latestBatsmanBalls1\").innerHTML=batsmanBalls[batsman2];\n document.getElementById(\"latestBatsmanStrRate1\").innerHTML=batsmanStrRate[batsman2];\n\n\n document.getElementById(\"latestBowlerName0\").innerHTML=bowlerName[latestBowlerCounter1];\n document.getElementById(\"latestBowlerOvers0\").innerHTML=bowlerOvers[latestBowlerCounter1]+\".\"+bowlerBalls[latestBowlerCounter1];\n document.getElementById(\"latestBowlerMaidens0\").innerHTML=bowlerMaidens[latestBowlerCounter1];\n document.getElementById(\"latestBowlerRuns0\").innerHTML=bowlerRuns[latestBowlerCounter1];\n document.getElementById(\"latestBowlerWicket0\").innerHTML=bowlerWickets[latestBowlerCounter1];\n document.getElementById(\"latestBowlerEconomy0\").innerHTML=bowlerEconomy[latestBowlerCounter1];\n document.getElementById(\"latestBowlerName1\").innerHTML=bowlerName[latestBowlerCounter2];\n document.getElementById(\"latestBowlerOvers1\").innerHTML=bowlerOvers[latestBowlerCounter2]+\".\"+bowlerBalls[latestBowlerCounter2];\n document.getElementById(\"latestBowlerMaidens1\").innerHTML=bowlerMaidens[latestBowlerCounter2];\n document.getElementById(\"latestBowlerRuns1\").innerHTML=bowlerRuns[latestBowlerCounter2];\n document.getElementById(\"latestBowlerWicket1\").innerHTML=bowlerWickets[latestBowlerCounter2];\n document.getElementById(\"latestBowlerEconomy1\").innerHTML=bowlerEconomy[latestBowlerCounter2];\n $(\"#gameStatus\").text(requiredRuns+\" Runs required in \"+ballsRemaining+\" balls with \"+wicketsRemaining+\" wickets in hand\");\n $(\"#gameCurrentScore\").text(\"Score - \"+teamTotal+\"/\"+teamWickets+\" in \"+teamOvers+\".\"+teamBalls+\" overs\");\n if(requiredRuns<=0) {\n alert(\"You have won the game!\");\n gameover = true;\n result=\"WON\";\n $(\"#gameStatus\").text(\"You have won the game with \"+ballsRemaining+\" balls remaining and \"+wicketsRemaining+\" wickets in hand\");\n } else if(wicketsRemaining==0 && requiredRuns >1) {\n alert(\"You lost the game!\");\n gameover = true;\n result = \"LOST\";\n $(\"#gameStatus\").text(\"You lost the game by \"+(requiredRuns-1)+\" runs\");\n } else if(ballsRemaining==0 && requiredRuns >1) {\n alert(\"You lost the game!\");\n gameover = true;\n result = \"LOST\";\n $(\"#gameStatus\").text(\"You lost the game by \"+(requiredRuns-1)+\" runs\");\n } else if(wicketsRemaining==0 && requiredRuns ==1) {\n alert(\"You lost the game!\");\n gameover = true;\n result = \"TIE\";\n $(\"#gameStatus\").text(\"You tied the game\");\n } else if(ballsRemaining==0 && requiredRuns ==1) {\n alert(\"You lost the game!\");\n gameover = true;\n result = \"TIE\";\n $(\"#gameStatus\").text(\"You tied the game\");\n }\n if(gameover) {\n $(\"#playButton\").hide();\n $(\"#statsRestart\").show();\n }\n}", "title": "" }, { "docid": "c61c407976ee4f8323eb6c2f72c0bcaa", "score": "0.59269994", "text": "function berry(){\r\n //location vector is a percentage of the total screen size\r\n this.x = 0;\r\n this.y = random(2/3, 14/15);\r\n this.alive = true;\r\n //k is the image in the roll\r\n this.k = 0;\r\n //speed is a percentage of the total screen size\r\n this.speed = random(1/600, 1/400 * sqrt(level));\r\n this.move = move; \r\n this.display = display;\r\n this.tick = tick;\r\n //helps with death animation\r\n this.deathCount = 0;\r\n \r\n \r\n}", "title": "" }, { "docid": "063e5f863195cce2ab5691bd3b5c6007", "score": "0.5917166", "text": "function dripGems() {\n\t\n\tif (currentGems < maxGems) {\n\t\t\n\t\t// the green neutral gem always spawns\n\t\tvar greenGem = Bodies.circle(canvas.width/2 + (Math.random()*20 - 10), -10, gemRad);\n\t\tgreenGem.render.sprite.texture = IMAGES.GREEN_GEM;\n\t\tgreenGem.restitution = 0.5;\n\t\tgreenGem.objectType = {\n\t\t\tname: \"Gem\",\n\t\t\tcolor: COLORS.GREEN,\n\t\t\tlifetime: gemScoreTime,\n\t\t\tinGoal: false\n\t\t};\n\t\tadd(greenGem);\n\t\t\t\n\t\t// the player-specific gems only spawn on all gem frames\n\t\tif (currentGems < maxGems && allGemFrame) {\n\t\t\tvar orangeGem = Bodies.circle(canvas.width/3.5 + (Math.random()*100 - 50), -10, gemRad, { restitution: 0.3 });\n\t\t\torangeGem.render.sprite.texture = IMAGES.ORANGE_GEM;\n\t\t\torangeGem.restitution = 0.5;\n\t\t\torangeGem.objectType = {\n\t\t\t\tname: \"Gem\",\n\t\t\t\tcolor: COLORS.ORANGE,\n\t\t\t\tlifetime: gemScoreTime,\n\t\t\t\tinGoal: false\n\t\t\t};\n\t\t\tadd(orangeGem);\n\t\t\t\n\t\t\tif (currentGems < maxGems) {\n\t\t\t\tvar purpleGem = Bodies.circle(canvas.width - canvas.width/3.5 + (Math.random()*100 - 50), -10, gemRad, { restitution: 0.3 });\n\t\t\t\tpurpleGem.render.sprite.texture = IMAGES.PURPLE_GEM;\n\t\t\t\tpurpleGem.restitution = 0.5;\n\t\t\t\tpurpleGem.objectType = {\n\t\t\t\t\tname: \"Gem\",\n\t\t\t\t\tcolor: COLORS.PURPLE,\n\t\t\t\t\tlifetime: gemScoreTime,\n\t\t\t\t\tinGoal: false\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tadd(purpleGem);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// next spawn frame does opposite\n\tallGemFrame = !allGemFrame;\n}", "title": "" }, { "docid": "dc2948d65b2fbbb8cb73dfce813cf79b", "score": "0.590601", "text": "function startGame() {\n play = true;\n displayPipes = true;\n currentScore = 0;\n pipesPerFrame = 100;\n gameLost = false;\n startingSpeed = 2;\n bird.reset();\n}", "title": "" }, { "docid": "45f848533292514baa96569efbb8e72a", "score": "0.59041375", "text": "function hurtBossAnimation(){\n timeOfBottleCollision = new Date().getTime();\n AUDIO_BREAKING_BOTTLE.play();\n reduceBossEnergy();\n AUDIO_CHICKEN.play();\n }", "title": "" }, { "docid": "d683b29feaec5fafb605a4a91708801c", "score": "0.59003115", "text": "function manualeRumble() {\n startRumble();\n}", "title": "" }, { "docid": "c5925750a6dd1736a1413688ac420183", "score": "0.59000486", "text": "function cheat() {\n resetGame();\n createBox(4096);\n }", "title": "" }, { "docid": "37fcbb8bbc1319842ef66be64c79b213", "score": "0.5884168", "text": "function preloadSummon(game) {\n game.load.image('summon-bg', 'assets/bg/summon.png');\n game.load.image(\"screentint\", \"assets/ui/screentint-alpha-50.png\");\n game.load.image('black', 'assets/ui/black.png');\n\n game.load.image(\"button-back\", \"assets/ui/button-back.png\");\n game.load.image(\"button-summon\", \"assets/ui/button-summon.png\");\n game.load.image(\"shadow-small\", \"assets/ui/shadow-small.png\");\n\n game.load.image(\"Back-Bronze\", \"assets/ui/Cards/Back-Bronze.png\");\n game.load.image(\"Back-Silver\", \"assets/ui/Cards/Back-Silver.png\");\n game.load.image(\"Back-Gold\", \"assets/ui/Cards/Back-Gold.png\");\n\n for (const unitClass of Object.values(classEnum)) {\n for (const unitRank of Object.values(rankEnum)) {\n\n if (unitClass == \"Shielder\") { continue; }\n if (unitClass == \"Unknown\") { continue; }\n\n var image = unitRank + \"-\" + unitClass;\n game.load.image(\"Card-\" + image, \"assets/ui/Cards/\" + image + \".png\");\n }\n }\n\n preloadDialogue(game);\n preloadUI(game);\n preloadUnits(game);\n preloadClassIcons(game);\n preloadSkills(game);\n preloadTokenUI(game);\n\n game.load.audio(\"menu-select\", [\"assets/sounds/select01.mp3\"]);\n game.load.audio('menu-accept', ['assets/sounds/accept01.mp3']);\n\n game.load.audio('summon-sound', ['assets/sounds/summon01.mp3']);\n game.load.audio('summon-sound2', ['assets/sounds/summon02.mp3']);\n game.load.audio('summon-finish', ['assets/sounds/summon-finish.mp3']);\n game.load.audio('summon-cards', ['assets/sounds/summon-cards.mp3']);\n}", "title": "" }, { "docid": "373fa385777c195d5b1b09773eaee9e1", "score": "0.58840793", "text": "function knockout(z, t, sr, sp, hl0, hl1, sp0, sp1, sp2, stage, gz = 0, gt = 0) {\r\n\r\n for (q = 0; q < coeficients.length; q++) {\r\n gz += (Math.round(Math.random() * coeficients[q] * z.power / t.power));\r\n gt += (Math.round(Math.random() * coeficients[q] * t.power / z.power));\r\n et = (Math.floor(Math.random() * 10));\r\n }\r\n\r\n if (((gz + gt) > 4) && (gz !== gt) && (gz !== 0) && (gt !== 0)) {\r\n var res;\r\n res = z.name + \" vs. \" + t.name + \" \" + gz + \"-\" + gt + hl0;\r\n highlights.push(res);\r\n }\r\n\r\n var outcome;\r\n if (gz === gt) {\r\n if ((gz + gt) === 0) {\r\n outcome = drawBoring[Math.floor(Math.random() * drawBoring.length)]\r\n } else if ((gz + gt) === 2) {\r\n outcome = drawNormal[Math.floor(Math.random() * drawNormal.length)]\r\n } else {\r\n outcome = drawHighscore[Math.floor(Math.random() * drawHighscore.length)]\r\n }\r\n } else {\r\n if ((((z.power - t.power) > 10) && (gt > gz)) || ((gz > gt) && ((t.power - z.power) > 10))) {\r\n outcome = winSurprise[Math.floor(Math.random() * winSurprise.length)]\r\n } else {\r\n if (((gz - gt) > 3) || (3 < (gt - gz))) {\r\n outcome = winEasy[Math.floor(Math.random() * winEasy.length)]\r\n } else {\r\n if (((gz + gt) > 3) && (((gz - gt) < 3) || ((gt - gz) < 3))) {\r\n outcome = winHighscore[Math.floor(Math.random() * winHighscore.length)]\r\n } else {\r\n if (((gz - gt) === 1) || (1 === (gt - gz))) {\r\n outcome = winHard[Math.floor(Math.random() * winHard.length)]\r\n } else {\r\n outcome = winNormal[Math.floor(Math.random() * winNormal.length)]\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (gz > gt) {\r\n output = \"<br>\" + z.name + outcome + t.name;\r\n stage.push(z);\r\n if (stage === final) {\r\n third.push(t)\r\n }\r\n $(sr).text(gz + \" - \" + gt);\r\n $(sp).text(sp0);\r\n return output;\r\n } else if (gz < gt) {\r\n output = \"<br>\" + t.name + outcome + z.name;\r\n stage.push(t);\r\n if (stage == final) {\r\n third.push(z)\r\n }\r\n $(sr).text(gt + \" - \" + gz);\r\n $(sp).text(sp0);\r\n return output;\r\n } else {\r\n var hg;\r\n var res;\r\n var pen = Math.round(Math.random() * 3);\r\n if (pen === 0) {\r\n hg = \",\" + z.name + \" won it on penalties!\"\r\n } else if (pen === 1) {\r\n hg = \",\" + t.name + \" won it on penalties!\"\r\n } else if (pen === 2) {\r\n hg = \",\" + z.name + \" won it \" + extraTime[et] + \" in extra time!\"\r\n } else if (pen === 3) {\r\n hg = \",\" + t.name + \" won it \" + extraTime[et] + \" in extra time!\"\r\n }\r\n if ((gz === gt) && ((gz + gt) > 3)) {\r\n res = z.name + \" vs. \" + t.name + \" \" + gz + \"-\" + gt + hl1 + hg;\r\n highlights.push(res);\r\n }\r\n if (pen === 0) {\r\n stage.push(z);\r\n if (stage === final) {\r\n third.push(t)\r\n }\r\n output = \"<br>\" + z.name + \" and \" + t.name + outcome;\r\n $(sr).text(gz + \" - \" + gt);\r\n $(sp).text(\" in regular time. \" + z.name + sp1);\r\n return output;\r\n } else if (pen === 1) {\r\n stage.push(t);\r\n if (stage === final) {\r\n third.push(z)\r\n }\r\n output = \"<br>\" + z.name + \" and \" + t.name + outcome;\r\n $(sr).text(gz + \" - \" + gt);\r\n $(sp).text(\" in regular time. \" + t.name + sp1);\r\n return output;\r\n } else if (pen === 2) {\r\n stage.push(z);\r\n if (stage === final) {\r\n third.push(t)\r\n }\r\n output = \"<br>\" + z.name + \" and \" + t.name + outcome;\r\n $(sr).text(gz + \" - \" + gt);\r\n $(sp).text(\" in regular time. \" + z.name + +extraTime[et] + \" extra time!\");\r\n return output;\r\n } else {\r\n stage.push(t);\r\n if (stage === final) {\r\n third.push(z)\r\n }\r\n output = \"<br>\" + z.name + \" and \" + t.name + outcome;\r\n $(sr).text(gz + \" - \" + gt);\r\n $(sp).text(\" in regular time. \" + t.name + \" advances to next round after an \" + extraTime[et] + \" extra time!\");\r\n return output;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "daf6c3e2e71c5a519c58dcaab754ac4a", "score": "0.5877064", "text": "function initBefehle()\n{\n //Screen Display 1 , 128 , 309 , ,\n SwitchScreen(1);\n //Load pfad$ + \"Grafiken/Befehle2.Pic\" , 8\n //Unpack 8 To 1\n // TODO: die JA/NEIN Befehle werden per Cblock vorgehalten\n //Erase 8\n //Get Cblock 2 , 0 , 0 , 320 , 90\n //Load pfad$ + \"Grafiken/Befehle.Pic\" , 8\n //Unpack 8 To 1\n Unpack('befehle');\n\n //Erase 8\n inventory();\n // Ink 0 , 5\n // if (half = 1) {\n // Screen Display 1 , 128 , , 160 , 90\n // }\n\n SwitchScreen(1);\n //Call 'font$' [ \"JOY\" , 6 ]\n\n //Reserve Zone 28\n SetZone(1, 0, 9, 57, 90);\n SetZone(2, 58, 9, 115, 44);\n SetZone(3, 58, 46, 115, 68);\n SetZone(4, 58, 68, 115, 90);\n var feld = 5;\n for (var j = 1; j <= 3; ++j) {\n for (var i = 1; i <= 8; ++i) {\n var x = 100 + i * 24;\n var y = - 6 + j * 24;\n SetZone(feld ,x ,y, x + 16 , y + 16);\n feld++;\n }\n }\n\n if (spr = 0) {\n //Call 'befehle_hoch$'\n } else {\n spr = 0;\n }\n verbRein();\n}", "title": "" }, { "docid": "7ebe2e6094f3d09b0b22d6a1b34292f1", "score": "0.58590376", "text": "function tricycle()\r\n\t{\tvar head, tail1, tail2, muscle1x, muxcle2x, pc, pcCycle, tiller, goal;\r\n\r\n\t\thead = pushRandomNode().setRadius(7).makeEater().setGrip(gMinGrip*18).setClan(\"trike\"); \r\n\t\ttail1 = pushRandomNode().setRadius(5).setGrip(gMinGrip).setClan(\"trike\");\r\n\t\ttail2 = pushRandomNode().setRadius(5).setGrip(gMinGrip).setClan(\"trike\");\r\n\t\t//total 20xgMinGrip. Without excess grip shiftGrip can do nothing\r\n\r\n\t\ttail1.stomach = tail2.stomach = head;\r\n\t \r\n\t\t// assuming gPhotoYield is 1, with three muscles to power off of two photosynthesizers, rate = 1/3 of 2 = 0.66\r\n\t\t// But you want this to be hungry, i.e. to be underpowered off its own two photosynthesizers. So go with a much higher rate\r\n\t\tmuscle1x = head.links.length; //0\r\n\t\thead.addLinkToBot(tail1).setRestLength(14).setRate(1.33);\r\n\r\n\t\tmuscle2x = head.links.length; //1\r\n\t\thead.addLinkToBot(tail2).setRestLength(14).setRate(1.33);\r\n\r\n\t\ttail1.addLinkToBot(tail2).setRestLength(14).setRate(1.33); //unchanging frame\r\n\r\n\t\t// at fully fed rate of 1.33, a muscle with throw of 40, would take 40/1.33 = 30 steps\r\n\t\t// if both ends gMingrip, twice that if one end is heavy, so say 60. \r\n\t\t// On pull in, you have both links pulling a gMinGrip tail each, so should take 30 pull in.\r\n\t\t// Total is 90\r\n\t\t//prep program counter, start at random place in cycle. \r\n\t\tpcCycle = 90; \r\n\t\tpc = Math.floor(Math.random()*pcCycle);\r\n\t\ttiller = -0.1 + 0.2*Math.random(); //avg is 0. Barring steering, will go straight ahead, some have slight turning radius\r\n\r\n\t\t//can't be in prototype because needs closure access to variables tail1, tail2 etc\r\n\t\t//AND it's only on head, not on all nodes, and not on the bot, which isn't an object\r\n\t\thead.smarts = function()\r\n\t\t{\ttrySteerToGoal();\r\n\r\n\t\t\t//rotating the tail1-tail2 frame constitutes turning progress.\r\n\t\t\t//interpret tiller as turning -1 towards tail1 (muscle1 short slow, muscle2 long fast), 1 towards tail2 (vice versa).\r\n\t\t\tif (pc == 0) \r\n\t\t\t{\tshiftGrip(1,[tail1,tail2],[this]); //shift all possible grip to tails\r\n\t\t\t\tthis.tryRestLength(muscle1x,40+4*tiller); //range 36 to 44\r\n\t\t\t\tthis.tryRate(muscle1x,1.33+tiller/3); //range 1.0 to 1.66. Longer also faster, so even when underpowered will turn\r\n\t\t\t\tthis.tryRestLength(muscle2x,40-4*tiller);\r\n\t\t\t\tthis.tryRate(muscle2x,1.33-tiller/3);\r\n\t\t\t}\r\n\r\n\t\t\tif (pc == 60) //start pull back to restore equilateral\r\n\t\t\t{\tshiftGrip(1,[this],[tail1,tail2]); //shift all possible grip head\r\n\t\t\t\tthis.tryRestLength(muscle1x,14); //restore equilateral, leaving rates as they were\r\n\t\t\t\tthis.tryRestLength(muscle2x,14);\r\n\t\t\t}\r\n/*\r\n\t\t\tif (pc == Math.round(pcCycle/3)) \r\n\t\t\t{\tshiftGrip(0,[this],[tail1,tail2]); //shift grip to tails\r\n\t\t\t\tthis.tryRestLength(muscle1x,50); this.tryRestLength(muscle2x,50); //begin pushing head forward\r\n\t\t\t}\r\n\r\n\t\t\tif (pc == Math.round(2*pcCycle/3)) \r\n\t\t\t{\tshiftGrip(1,[this],[tail1,tail2]); //shift grip to head\r\n\t\t\t\tthis.tryRestLength(muscle1x,14); this.tryRestLength(muscle2x,14); //begin pulling degripped tails toward head\r\n\t\t\t}\r\n*/\r\n\t\t\tpc = (pc + 1)%pcCycle;\r\n\r\n\t }\r\n\r\n\t\tvar trySteerToGoal = function()\r\n\t\t{\tif (!goal) return;\r\n\t\t\tvar c = center(),\r\n\t\t\t\ttheta = direction(),\r\n\t\t\t\tcPlus = { x: c.x+Math.sin(theta), y:c.y+Math.cos(theta) };\r\n\t\t\t\toffBy = signedAngle(goal,c,cPlus); // negative if we're going too far to the right, positive if too far to the left, botCentric\r\n\t\t\tif (offBy) steer(offBy/Math.PI);\r\n\t\t}\r\n\r\n\t\t//prepare user intrface\r\n\t\t// if goal is defined, 'manual' steering via the UI will be overridden by automatic attempt to go to goal\r\n\t\tvar steer = function(tlr) //tlr is -1 (hardest possible left) to +1 (hardest possible right)\r\n\t\t{\tif (tlr< -1) tlr = -1;\r\n\t\t\tif (tlr> 1) tlr = 1;\r\n\t\t\tif (signedAngle(tail1,head,tail2) > 0) //tail1 is left side of bot viewed from TAIL TOWARDS HEAD, tail2 is right side\r\n\t\t\t\ttiller = tlr;\r\n\t\t\telse tiller = -tlr; //tail2 is left side, tail1 is right side\r\n\t\t\t//console.log(\" tlr: \"+tlr.toFixed(3)+\" tiller:\"+tiller.toFixed(3));\r\n\t\t};\r\n\r\n\t\tvar center = function(){return { x:(tail1.x+tail2.x)/2, y:(tail1.y+tail2.y)/2 };}\r\n\r\n\t\tvar direction = function()\r\n\t\t{\tif (signedAngle(tail1,head,tail2) > 0) //tail1 is left side of bot viewed from TAIL TOWARDS HEAD, tail2 is right side\r\n\t\t\t\treturn signedAngle(tail2,tail1,{x:tail1.x, y:tail1.y + 20})-Math.PI/2;\r\n\t\t\telse\r\n\t\t\t\treturn signedAngle(tail1,tail2,{x:tail2.x, y:tail2.y + 20})-Math.PI/2;\r\n\t\t}\r\n\r\n\t\t//This is a higher level steering capability than steer\r\n\t\tvar setGoal = function(gol) //gol is a point that we're to steer towards. Use undefined to stop use of goal.\r\n\t\t{\tgoal = gol;\r\n\t\t}\r\n\r\n\t\thead.intrface = {steer:steer, center:center, direction:direction, setGoal: setGoal }\r\n\r\n\t\treturn head;\r\n\t}", "title": "" }, { "docid": "9654d91721dbbcb045ae9b1e0f2f8947", "score": "0.58569944", "text": "play(recap, field) {\n const snapPos = this.getSnapPos(recap, field);\n const catchPos = this.getCatchPos(recap, field);\n const downPos = this.getDownPos(recap, field);\n\n const sequence = [];\n const receiver = new PlayerAnimation();\n\n sequence.push(() => receiver.load(recap, field, 'kick_return'));\n\n // Mark the play (only Punts)\n if (recap.playType() === NFLPlayRecapVO.PUNT) {\n sequence.push(() => {\n const animation = new YardlineAnimation();\n return animation.play(recap, field, snapPos.x, YardlineAnimation.COLOR_LINE_OF_SCRIMAGE);\n });\n }\n\n // Catch the ball\n sequence.push(() => {\n const timeline = new Timeline();\n\n const catchCP = receiver._clip.clip.getCuepoint('catch');\n const receiverClip = receiver._clip.clip;\n const receiverEl = receiverClip.getElement().parentNode;\n const receiverX = parseFloat(receiverEl.style.left, 10);\n const receiverY = parseFloat(receiverEl.style.top, 10);\n\n const ballDuration = 1.5 * 30;\n const ballStart = field.getFieldPos(snapPos.x, snapPos.y);\n const ballEnd = {\n x: receiverX,\n y: receiverY + catchCP.data.y * 0.5,\n };\n\n if (recap.driveDirection() === NFLPlayRecapVO.LEFT_TO_RIGHT) {\n ballEnd.x += catchCP.data.x * 0.5;\n } else {\n ballEnd.x += receiverClip.frameWidth * 0.5 - catchCP.data.x * 0.5;\n }\n\n const ball = new FlightArrow(field, ballStart, ballEnd, 220, 0, 0);\n ball.progress = 0;\n field.addChild(ball.el, 0, 0, 30);\n\n timeline.add({\n from: 1,\n length: ballDuration,\n onUpdate: (frame, len) => (ball.progress = frame / len),\n });\n\n // Receiver catches ball.\n const catchIn = ballDuration - catchCP.in + 1;\n timeline.add(receiver.getSequence(catchIn, receiver._clip, timeline));\n\n return new Promise(resolve => timeline.play(resolve));\n });\n\n // Rush the ball (if they ran with it)\n if (recap.rushingYards() > 0) {\n sequence.push(() => {\n const animation = new RushArrowAnimation();\n return animation.play(recap, field, catchPos.x, downPos.x, catchPos.y);\n });\n }\n\n // Down the ball\n sequence.push(() => {\n const animation = new YardlineAnimation();\n return animation.play(recap, field, downPos.x, YardlineAnimation.COLOR_DOWN_LINE);\n });\n\n return sequence.reduce((p, fn) => p.then(fn), Promise.resolve());\n }", "title": "" }, { "docid": "c436273cde509df056c9471b107e6ee3", "score": "0.5853929", "text": "function startGame() {\n addGiants(startingGiantPosition)\n moveGiants()\n oilDripping()\n }", "title": "" }, { "docid": "c29980bb64b99e0d0bc1b7303fff80c9", "score": "0.58528495", "text": "function runGame() {\n var game = [\n [E, E, E],\n [E, E, E],\n [E, E, E]\n ];\n var redType = Number(document.getElementById(\"redplayer\").value);\n var blueType = Number(document.getElementById(\"blueplayer\").value);\n players[0][redType].startGame();\n players[1][blueType].startGame();\n var redPlaying = Math.random() > 0.5;\n var state = E;\n while(state == E) {\n if(redPlaying) {\n var spot = players[0][redType].takeTurn(game);\n game[spot[0]][spot[1]] = R\n } else {\n spot = players[1][blueType].takeTurn(game);\n game[spot[0]][spot[1]] = B\n }\n redPlaying = (redPlaying == false);\n state = gameState(game);\n draw(game, ctx);\n }\n players[0][redType].endGame(state);\n players[1][blueType].endGame(state);\n if(state == R) redWins++;\n if(state == B) blueWins++;\n if(state == T) draws++;\n document.getElementById(\"counter\").innerHTML = \"Red: \" + redWins + \" Blue: \" + blueWins + \" Ties: \" + draws;\n}", "title": "" }, { "docid": "8ad71e5e7a1157b5791330acb1c84ff0", "score": "0.5848912", "text": "function keyPressed() {\r\n\r\n if (keyCode === UP_ARROW) {\r\n Matter.Body.applyForce(candy.body, candy.body.position, { x: null, y: -400 })\r\n }\r\n\r\n if (keyCode===32&&gameState===END) {\r\n gameState=PLAY\r\n Matter.Body.setPosition(candy.body,{x:50,y:height-90})\r\n\r\n spider1.x=width/2;\r\n spider1.y=height-195;\r\n\r\n spider2.x=width/2;\r\n spider2.y=height-300;\r\n \r\n spider3.x=width/2;\r\n spider3.y=height-405;\r\n }\r\n\r\n if (keyCode===32&&gameState===WON) {\r\n gameState=PLAY\r\n Matter.Body.setPosition(candy.body,{x:50,y:height-90})\r\n\r\n spider1.x=width/2;\r\n spider1.y=height-195;\r\n\r\n spider2.x=width/2;\r\n spider2.y=height-300;\r\n \r\n spider3.x=width/2;\r\n spider3.y=height-405;\r\n }\r\n\r\n if(keyCode === 84&&gameState===PLAY){\r\n gameState=TUT\r\n }\r\n \r\n if(keyCode === 82&&gameState===TUT){\r\n gameState=PLAY\r\n Matter.Body.setPosition(candy.body,{x:50,y:height-90})\r\n\r\n spider1.x=width/2;\r\n spider1.y=height-195;\r\n\r\n spider2.x=width/2;\r\n spider2.y=height-300;\r\n \r\n spider3.x=width/2;\r\n spider3.y=height-405;\r\n }\r\n \r\n\r\n\r\n if(keyCode === 32 ){\r\n Matter.Body.setStatic(candy.body,true) \r\n }\r\n\r\n if (keyCode === DOWN_ARROW) {\r\n Matter.Body.applyForce(candy.body, candy.body.position, { x: null, y: 400 })\r\n }\r\n if (keyCode === LEFT_ARROW) {\r\n Matter.Body.applyForce(candy.body, candy.body.position, { x: -400, y: null })\r\n }\r\n if (keyCode === RIGHT_ARROW) {\r\n Matter.Body.applyForce(candy.body, candy.body.position, { x: 400, y: null })\r\n }\r\n //NOTES: to remember about kecodes\r\n //32=space; 13=enter; 16=shift; 18=alt;\r\n}", "title": "" }, { "docid": "6fb4e73aad7e996667e8c74023b51972", "score": "0.58487827", "text": "function runGame(){\n\n /////////// GAME ///////////\n\n // draw background\n // display background\n fill(game.menuBGcolor); stroke(0); rect(0, 0, game.width-1, game.height-1);\n // display text at the bottom of the screen\n game.displayScore();\n\n // if both paddles' score falls below the gameOverScore, game is over.\n if(leftPaddle.score<gameOverScore&&rightPaddle.score<gameOverScore){\n gameOver();\n }\n\n // if a paddle reaches the target score, this round is over\n matchWon();\n\n /////////// BISCUIT ///////////\n\n // move biscuit\n biscuit.update();\n // display (or not)\n biscuit.display();\n // check for collision with paddle\n biscuit.handlePaddleCollision(leftPaddle);\n biscuit.handlePaddleCollision(rightPaddle);\n\n /////////// PADDLE ///////////\n\n // handle paddle inputs and update position\n leftPaddle.handleInput();\n rightPaddle.handleInput();\n leftPaddle.update();\n rightPaddle.update();\n\n // display paddles\n leftPaddle.display();\n rightPaddle.display();\n\n /////////// FIRE BALL ///////////\n\n // check for any fire balls currently on screen\n if (fireBalls.length>0){\n for(var i=0; i<fireBalls.length; i++){\n // update position and display\n fireBalls[i].update();\n fireBalls[i].display();\n // handle ant collision\n fireBalls[i].handleCollision();\n // handle paddle collision\n fireBalls[i].handlePaddleCollision(leftPaddle);\n fireBalls[i].handlePaddleCollision(rightPaddle);\n // remove any fireballs off screen\n fireBalls[i].isOffScreen();\n if(fireBalls[i].offScreen){\n actions.removeFireBall(i);\n }\n }\n }\n\n /////////// ANTS ///////////\n\n // if there are any ants on screen,\n if (ants.length>0){\n // for all ants\n for (var j=0; j<ants.length; j++){\n // update position\n ants[j].update();\n // check collisions:\n // paddle collision,\n ants[j].handleCollision(leftPaddle);\n ants[j].handleCollision(rightPaddle);\n // ball collisions,\n for (var k=0; k<balls.length; k++){\n ants[j].handleCollision(balls[k]);\n }\n // display ants\n ants[j].display();\n }\n }\n\n /////////// BALL ///////////\n\n // If there are not enough balls create more balls\n if(balls.length<=minBalls){\n actions.createBalls();\n }\n\n // for all balls in balls array\n for(var i=0; i<balls.length; i++){\n\n // update ball position\n balls[i].update();\n\n // check if ball is off screen then reset\n if (balls[i].isOffScreen()) {\n balls[i].reset();\n }\n\n // handle ball collisions\n // ball-paddle collision\n balls[i].handlePaddleCollision(leftPaddle);\n balls[i].handlePaddleCollision(rightPaddle);\n // ball+ball = ant\n // balls that merge into an ant are removed from balls array\n balls[i].handleBallCollision(i);\n }\n\n // declare balls.length again in case its value\n // changed when ants were created\n for (var i=0; i<balls.length; i++){\n //display balls\n balls[i].display();\n }\n}", "title": "" }, { "docid": "cd3ddfb44669f595c737921dde888455", "score": "0.5847783", "text": "function mob_grinder(levels) {\n this\n .chkpt('mob_grinder')\n .box(blocks.chest, 2, 1, 1)\n .up()\n .box(blocks.hopper, 2, 1, 1)\n .down()\n .fwd()\n .left()\n .box(blocks.stone, 4, 1, 5)\n .up()\n .box(blocks.stone, 4, 1, 5)\n .up()\n .back()\n .box(blocks.glass, 1, 1, 6)\n .box(blocks.obsidian, 1, 1, 1)\n .turn(3)\n .wallsign([])\n .turn(1)\n .up()\n .back()\n .box(blocks.glass, 1, 1, 7)\n .box(blocks.obsidian, 1, 1, 3)\n .turn(3)\n .wallsign([])\n .turn(1)\n .fwd(2)\n .turn(3)\n .wallsign([])\n .turn(1)\n .back(2)\n .right(3)\n .box(blocks.glass, 1, 1, 7)\n .box(blocks.obsidian, 1, 1, 3)\n .turn(1)\n .wallsign([])\n .turn(3)\n .fwd(2)\n .turn(1)\n .wallsign([])\n .turn(3)\n .back(1)\n .down()\n .box(blocks.glass, 1, 1, 6)\n .box(blocks.obsidian, 1, 1, 1)\n .turn(1)\n .wallsign([])\n .turn(3)\n .up()\n .left(2)\n .box(blocks.lava, 2, 1, 1)\n .fwd(5)\n .down()\n .box(blocks.water, 2, 1, 1)\n .fwd()\n .down(2)\n .left()\n .box(blocks.stone, 4, 2, 1)\n .up(2)\n .box(blocks.glass, 4, 2, 1)\n .up(2)\n .back(3)\n .box0(blocks.glass, 4, 5, 4)\n .back(4)\n .box(blocks.glass, 4, 1, 4)\n .right(1)\n .fwd(5)\n .up(5)\n .mob_spawner(levels);\n}", "title": "" }, { "docid": "34bad4c27073df3ab845f78f56e46905", "score": "0.5847199", "text": "function spawnApples()\n{\n //write code here to spawn the apples\n if (frameCount % 60 === 0) \n {\n apples = createSprite(150,50,10,20);\n apples.velocityY = 3;\n apples.lifetime = 100;\n apples.scale = 0.1;\n\n var rand = Math.round(random(1,4));\n\n switch(rand)\n {\n case 1 : apples.addImage(apple_Img);\n break;\n case 2 : apples.addImage(leaf);\n break;\n case 3 : apples.addImage(redLeaf);\n break;\n case 4 : apples.addImage(orgLeaf);\n break;\n\n }\n\n //adjust the depth\n apples.depth = rabbit.depth\n rabbit.depth = rabbit.depth + 1;\n \n }\n}", "title": "" }, { "docid": "3178ed407475faea911f3ac62f1bf06a", "score": "0.58469117", "text": "function newGame(){\n console.clear();\n setPlayfield();\n printBoard();\n generateBombs(howMany);\n mapValues();\n}", "title": "" }, { "docid": "7f6c093e098848fabf3e8ab0de79981d", "score": "0.5846209", "text": "function Reels() {\n var betLine = [\" \", \" \", \" \"];\n var outCome = [0, 0, 0];\n\n for (var spin = 0; spin < 3; spin++) {\n outCome[spin] = Math.floor((Math.random() * 65) + 1);\n switch (outCome[spin]) {\n case checkRange(outCome[spin], 1, 27):\n betLine[spin] = \"blank\";\n blanks++;\n break;\n case checkRange(outCome[spin], 28, 37):\n betLine[spin] = \"grapes\";\n grapes++;\n break;\n case checkRange(outCome[spin], 38, 46):\n betLine[spin] = \"banana\";\n bananas++;\n break;\n case checkRange(outCome[spin], 47, 54):\n betLine[spin] = \"orange\";\n oranges++;\n break;\n case checkRange(outCome[spin], 55, 59):\n betLine[spin] = \"cherry\";\n cherries++;\n break;\n case checkRange(outCome[spin], 60, 62):\n betLine[spin] = \"bar\";\n bars++;\n break;\n case checkRange(outCome[spin], 63, 64):\n betLine[spin] = \"bell\";\n bells++;\n break;\n case checkRange(outCome[spin], 65, 65):\n betLine[spin] = \"seven\";\n sevens++;\n break;\n }\n }\n return betLine;\n}", "title": "" }, { "docid": "5423042e91694e48bf666cb2ae783961", "score": "0.5845507", "text": "function generatePipes() {\n\t// maximo de un pipe\n\tconst max = canvas.height - 100;\n\t// minimo de un pipe\n\tconst min = 50;\n\t// espacio calculado a traves de mucho research para saber donde si quepo, sin albur\n\tconst ventanita = 100;\n\t// expresion matematica, hecha por los dioses, e Isaac Newton, para calcular max o min\n\tconst randomHeight = Math.floor(Math.random() * (max - min));\n\tif (frames % 300 === 0) {\n\t\tobstacles.push(new Obstacle(0, randomHeight, true));\n\t\tobstacles.push(new Obstacle(randomHeight + ventanita, canvas.height - randomHeight - ventanita, false));\n\t}\n}", "title": "" }, { "docid": "2ee01b5ff079cb9a35ce32aae9600ef6", "score": "0.5845267", "text": "function act_drink_fountain() {\n\n if (rnd(1501) < (ULARN ? 4 : 2)) {\n var sleepExclaim = ULARN ? `OH MY GOD!! You` : `Oops! You seem to`;\n updateLog(` ${sleepExclaim} have caught the dreadful sleep!`);\n beep();\n died(DIED_DREADFUL_SLEEP, false); /* fell into the dreadful sleep */\n return;\n }\n\n var x = rnd(100);\n\n if (ULARN) {\n if (x == 1) {\n player.raiselevel();\n } else if (x < 11) {\n var hitloss = rnd((level << 2) + 2);\n updateLog(` Bleah! The water tasted like stale gatorade! You lose ${hitloss} hit point`);\n exclaim(hitloss);\n lastnum = DIED_BAD_WATER;\n player.losehp(hitloss);\n } else if (x < 14) {\n player.HALFDAM += 200 + rnd(200);\n updateLog(` The water makes you vomit${period}`);\n } else if (x < 17) {\n quaffpotion(createObject(OPOTION, 17), false); /* giant strength, but don't know the potion */\n } else if (x < 45) {\n updateLog(` Nothing seems to have happened${period}`);\n } else if (rnd(3) != 2) {\n fntchange(1); /* change char levels upward */\n } else {\n fntchange(-1); /* change char levels downward */\n }\n } else {\n if (x < 7) {\n player.HALFDAM += 200 + rnd(200);\n updateLog(` You feel a sickness coming on${period}`);\n } else if (x < 13) {\n quaffpotion(createObject(OPOTION, 23), false); /* see invisible, but don't know the potion */\n } else if (x < 45) {\n updateLog(` Nothing seems to have happened${period}`);\n } else if (rnd(3) != 2) {\n fntchange(1); /* change char levels upward */\n } else {\n fntchange(-1); /* change char levels downward */\n }\n }\n\n if (rnd(12) < 3) {\n updateLog(` The fountains bubbling slowly quiets${period}`);\n setItem(player.x, player.y, ODEADFOUNTAIN); /* dead fountain */\n player.level.know[player.x][player.y] = 0;\n }\n}", "title": "" }, { "docid": "e9091b9e71f0e402000c598604668e24", "score": "0.5842784", "text": "function showBoats(){\r\n if (boats.length>0){\r\n if (boats.length<4 && boats[boats.length-1].body.position.x<width-300){\r\n var positions = [-40,-60,-70,-20];\r\n var position = random(positions);\r\n var boat = new Boat(width,height-100,170,170,position,boatAnimation);\r\n boats.push(boat);\r\n }\r\n \r\n for(var i=0;i<boats.length; i++){\r\n Matter.Body.setVelocity(boats[i].body,{x:-0.9,y:0});\r\n boats[i].display();\r\n boats[i].animate();\r\n }\r\n}\r\n else{\r\n var boat = new Boat(width,height-60,170,170,-60,boatAnimation);\r\n boats.push(boat);\r\n }\r\n}", "title": "" }, { "docid": "811fb7d9721e5eac90f25f91f9f52078", "score": "0.5842256", "text": "function mainGame() {\n //background color will pulse according to the values coming from our EDrums\n background(follow.getValue() * 255, 0, 0);\n\n //This will act as the player's healthbar\n rect(5, windowHeight -50, play.health, 30);\n\n //On screen instructions\n fill(255);\n textSize(30);\n text(\"↑\", 10, 50);\n text (\"↓\", 10, 600);\n //Lose conditions\n if (play.health === 0) {\n state = \"GAMEOVER\";\n }\n\n // Handle input for the player\n play.handleInput();\n\n // Move all the notes\n play.move();\n pause.move();\n\n //array for the notes\n for (let i = 0; i < notes.length; i++) {\n notes[i].move();\n play.handleEating(notes[i]);\n notes[i].display();\n }\n\n // Handle the tiger eating any of the prey\n\n\n // Display all the players\n play.display();\n pause.display();\n\n\n //point system\n textSize(20);\n text(\"You saved \" + point + \" notes!\", windowWidth / 2, 50);\n\n console.log(\"POINTS:: \" + point);\n\n if (play.x >= mute.x) {\n state = \"GAMEOVER\";\n }\n\n //if the player hits points, spawn in the mute buttons\n if (point >= 10) {\n for (let i = 0; i < mute.length; i++) {\n mute[i].move();\n play.handleEating(mute[i]);\n pause.handleEating(mute[i]);\n mute[i].display();\n }\n }\n\n if (point >= 40) {\n for (let i = 0; i < mute.length; i++) {\n mute[i].move();\n play.handleEating(mute[i]);\n pause.handleEating(mute[i]);\n mute[i].display();\n }\n }\n\n //If you score more than 15 points, throw in a new beat\n if (point >= 15 && soundPlaying === false) {\n soundPlaying = true;\n console.log(\"remix2!\");\n\n Mono('bass').note.seq([0, 7], 1 / 8)\n\n }\n\n //if you score more than 35 points, throw in ANOTHER beat\n if (point >= 35 && soundPlaying2 === false) {\n soundPlaying2 = true;\n console.log(\"remix3!\");\n Pluck().play(Rndi(100, 1000), 1 / 4)\n\n }\n\n //if you score more than 50 points, throw in ANOTHER beat\n if (point >= 50 && soundPlaying3 === false) {\n soundPlaying3 = true;\n console.log(\"remix4!\");\n Mono('easyfx')\n .note.seq(Rndi(0, 12), [1 / 4, 1 / 8, 1 / 2, 1, 2].rnd(1 / 8, 4))\n\n\n }\n\n if (point >= 60) {\n state = \"VICTORY\"\n }\n\n}", "title": "" }, { "docid": "3975445fa6606953a89559ce88757434", "score": "0.5833628", "text": "function brag() {\r\n\t//brag area\r\n\tvar totals =[0,0,0,0,0]; //used for total of each award\r\n\tvar globalTotal = 0;\r\n\tvar awardArrayRanks = GM_getValue('awardListRanks','').split('#X#');\r\n\r\n\tfor (var x in awardArrayRanks) {\r\n\t\tif (awardArrayRanks[x] >= 1 && awardArrayRanks[x] <= 4) {\r\n\t\t\ttotals[awardArrayRanks[x]]++;\r\n\t\t\tglobalTotal++;\r\n\t\t}\r\n\t}\r\n\r\n\tvar theTextAreaBody ='[n][b][url=http://passthepopcorn.me/forums.php?action=viewthread&threadid=8593]iCheckPopcorn Awards ('+globalTotal+')[/url]:[/b]';\r\n\tvar anS;\r\n\tif (totals[1]!=0){\r\n\t\tif (totals[1]>1) {anS='s';}\r\n\t\telse {anS='';}\r\n\t\ttheTextAreaBody += '\\n[img]http://imgur.com/f9Bzw.gif[/img] [b]' + totals[1] + ' [color=#e5e5e5]Platinum'+anS+'[/color][/b]'\r\n\t}\r\n\tif (totals[2]!=0){\r\n\t\tif (totals[2]>1) {anS='s';}\r\n\t\telse {anS='';}\r\n\t\ttheTextAreaBody += '\\n[img]http://imgur.com/51Pw8.gif[/img] [b]' + totals[2] + ' [color=#fdf2b9]Gold'+anS+'[/color][/b]'\r\n\t}\r\n\tif (totals[3]!=0){\r\n\t\tif (totals[3]>1) {anS='s';}\r\n\t\telse {anS='';}\r\n\t\ttheTextAreaBody += '\\n[img]http://imgur.com/O165j.gif[/img] [b]' + totals[3] + ' [color=#9b9b9b]Silver'+anS+'[/color][/b]'\r\n\t}\r\n\tif (totals[4]!=0){\r\n\t\tif (totals[4]>1) {anS='s';}\r\n\t\telse {anS='';}\r\n\t\ttheTextAreaBody += '\\n[img]http://imgur.com/SmW8T.gif[/img] [b]' + totals[4] + ' [color=#d9b480]Bronze'+anS+'[/color][/b]'\r\n\t}\r\n\ttheTextAreaBody += '[n]';\r\n\r\n\tvar head = document.getElementById('content').getElementsByTagName('h2');\r\n\tvar button = document.createElement('a');\r\n\thead[0].parentNode.insertBefore(button, head[0].nextSibling);\r\n\tbutton.innerHTML = 'BRAG!';\r\n\tbutton.href = 'JavaScript:void(0);';\r\n\tbutton.addEventListener(\"click\", function(e) {\r\n\t\tvar lol = document.getElementById('content').getElementsByTagName('textarea');\r\n\t\tfor (var x in lol) {\r\n\t\t\tif (lol[x].name == 'info'){\r\n\t\t\t\tif (lol[x].value.match(/\\[n\\]\\[b\\]\\[url\\=/)) {\r\n\t\t\t\t\tvar tempStart = lol[x].value.substring(0,lol[x].value.indexOf('[n][b][url='));\r\n\t\t\t\t\tvar tempMiddle = lol[x].value.substring(lol[x].value.indexOf('[n][b][url='), lol[x].value.indexOf('[/b][n]')+7);\r\n\t\t\t\t\tvar tempEnd = lol[x].value.substring(lol[x].value.indexOf('[/b][n]')+7, lol[x].value.length);\r\n\t\t\t\t\tlol[x].value = tempStart +theTextAreaBody + tempEnd;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tlol[x].value += '\\n\\n'+theTextAreaBody;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\twindow.scrollBy(0,1000);\r\n\t\r\n\t}, false);\r\n\t\t\t\r\n}", "title": "" }, { "docid": "9d1b98f5308c09ebb17d390dd3ec7c3e", "score": "0.5832429", "text": "e84() {\n const BOARD = [\n 'GO', 'A1', 'CC1', 'A2', 'T1', 'R1', 'B1', 'CH1', 'B2', 'B3',\n 'JAIL', 'C1', 'U1', 'C2', 'C3', 'R2', 'D1', 'CC2', 'D2', 'D3',\n 'FP', 'E1', 'CH2', 'E2', 'E3', 'R3', 'F1', 'F2', 'U2', 'F3',\n 'G2J', 'G1', 'G2', 'CC3', 'G3', 'R4', 'CH3', 'H1', 'T2', 'H2',\n ];\n // list of special squares\n const SQUARES = {\n GO: 0,\n JAIL: 10,\n C1: 11,\n E3: 24,\n H2: 39,\n R1: 5,\n R: [5, 15, 25, 35],\n U: [12, 28],\n };\n // community chest cards\n const COMM_CHEST = shuffle([\n () => SQUARES.GO, // advance to GO\n () => SQUARES.JAIL, // go to jail\n ...Array(14),\n ]);\n // chance cards\n const CHANCE = shuffle([\n () => SQUARES.GO, // advance to GO\n () => SQUARES.JAIL, // go to jail\n () => SQUARES.C1, // go to C1\n () => SQUARES.E3, // go to E3\n () => SQUARES.H2, // go to H2\n () => SQUARES.R1, // go to R1\n (square) => (SQUARES.R.find(r => r > square) || SQUARES.R[0]), // go to next R (railroad)\n (square) => (SQUARES.R.find(r => r > square) || SQUARES.R[0]), // id.\n (square) => (SQUARES.U.find(u => u > square) || SQUARES.U[0]), // go to next U (utility)\n (square) => square - 3, // if square <= 2, return 40 + square - 3\n ...Array(6),\n ]);\n // shuffle an array and return the result\n function shuffle(arr = []) {\n const shuffled = [];\n let source = [...arr];\n while (shuffled.length < arr.length) {\n const randomIndex = Math.floor(Math.random() * source.length);\n shuffled.push(source[randomIndex]);\n source = [...source.slice(0, randomIndex), ...source.slice(randomIndex + 1, source.length)];\n }\n return shuffled;\n }\n\n // initialize a result table\n // {\n // 0: 0,\n // 1: 0,\n // ...,\n // 39: 0\n // }\n const RESULTS = Object.assign({}, ...[...Array(40)].map((_, i) => ({ [i]: 0 })));\n const DICE_SIDES = 4;\n const SIM_COUNT = 1000000;\n // run simulation\n runSim(SIM_COUNT);\n // format and output result\n const sortedSquares = Object.keys(RESULTS).sort((a, b) => RESULTS[b] - RESULTS[a]).map(x => x.padStart(2, '0'));\n return `${sortedSquares[0]}${sortedSquares[1]}${sortedSquares[2]}`;\n\n // run simulation for simCount turns, each turn may have multiple rolls due to doubles\n function runSim(simCount) {\n // initial square\n let currentSquare = 0;\n for (let rolls = 0; rolls < simCount; rolls++) {\n let doubles = 0;\n let isDouble = true;\n // keep rolling if we get a double\n while (isDouble) {\n // roll the dices!\n const [r1, r2] = roll(DICE_SIDES);\n // if we rolled a double, incr the count\n if (r1 === r2) {\n doubles++;\n // if it's the third double, exit immediately\n if (doubles === 3) {\n currentSquare = 10;\n RESULTS[10]++;\n break;\n }\n } else {\n // if we didnt roll a double, the loop will not execute again, go to next sim after resolving\n isDouble = false;\n }\n // advance!\n currentSquare = (currentSquare + r1 + r2) % 40;\n // resolve any chance/comm_chest/go_to_jail events\n const [resolvedSquare, stop] = resolveSquare(currentSquare);\n currentSquare = resolvedSquare;\n RESULTS[currentSquare]++;\n if (stop) {\n break;\n }\n }\n }\n }\n\n // roll 2 dices, return [dice_1_result, dice_2_result]\n function roll(side) {\n return [Math.ceil(Math.random() * side), Math.ceil(Math.random() * side)];\n }\n\n // resolve any chance/comm_chest/go_to_jail events\n // returns [resolved_square_index, stop?]\n function resolveSquare(square) {\n const squareContent = BOARD[square];\n // go to jail\n if (squareContent === 'G2J' || squareContent === 'JAIL') {\n return [10, true];\n }\n // chance\n if (squareContent.slice(0, 2) === 'CH') {\n // draw a card and move to that square\n const movedTo = resolveCard(square, 'CH');\n // recursively resolve that square\n if (movedTo !== square) {\n return resolveSquare(movedTo);\n }\n }\n // community chest\n if (squareContent.slice(0, 2) === 'CC') {\n // draw a card and move to that square\n const movedTo = resolveCard(square, 'CC');\n // recursively resolve that square\n if (movedTo !== square) {\n return resolveSquare(movedTo);\n }\n }\n // no G2J nor cards, just return the square\n return [square, false];\n }\n\n // resolve card and return result square\n function resolveCard(square, type) {\n if (type === 'CH') {\n const card = CHANCE.shift();\n CHANCE.push(card);\n if (card) {\n return card(square);\n }\n }\n if (type === 'CC') {\n const card = COMM_CHEST.shift();\n COMM_CHEST.push(card);\n if (card) {\n return card(square);\n }\n }\n return square;\n }\n }", "title": "" }, { "docid": "dfe9494a5ab2c6035aec81e7397879be", "score": "0.5831841", "text": "function Reels() {\n var betLine = [\"\", \"\", \"\"];\n var outCome = [0, 0, 0];\n for (var spin = 0; spin < 3; spin++) {\n outCome[spin] = Math.floor((Math.random() * 65) + 1);\n switch (outCome[spin]) {\n case checkRange(outCome[spin], 1, 27):\n betLine[spin] = \"blank\";\n blanks++;\n break;\n case checkRange(outCome[spin], 28, 37):\n betLine[spin] = \"grapes\";\n grapes++;\n break;\n case checkRange(outCome[spin], 38, 46):\n betLine[spin] = \"banana\";\n bananas++;\n break;\n case checkRange(outCome[spin], 47, 54):\n betLine[spin] = \"orange\";\n oranges++;\n break;\n case checkRange(outCome[spin], 55, 59):\n betLine[spin] = \"cherry\";\n cherries++;\n break;\n case checkRange(outCome[spin], 60, 62):\n betLine[spin] = \"bar\";\n bars++;\n break;\n case checkRange(outCome[spin], 63, 64):\n betLine[spin] = \"bell\";\n bells++;\n break;\n case checkRange(outCome[spin], 65, 65):\n betLine[spin] = \"seven\";\n sevens++;\n break;\n }\n }\n return betLine;\n}", "title": "" }, { "docid": "dd349227899a0b7479c7b81a3c897761", "score": "0.5822138", "text": "function bach() {\n var registry = new Vex.Flow.Registry();\n Vex.Flow.Registry.enableDefaultRegistry(registry);\n var vf = new Vex.Flow.Factory({\n renderer: {elementId: 'sheet-vexflow', width: 1100, height: 900}\n });\n var score = vf.EasyScore({throwOnError: true});\n\n var voice = score.voice.bind(score);\n var notes = score.notes.bind(score);\n var beam = score.beam.bind(score);\n\n var x = 120, y = 80;\n function makeSystem(width) {\n var system = vf.System({x: x, y: y, width: width, spaceBetweenStaves: 10});\n x += width;\n return system;\n }\n\n function id(id) { return registry.getElementById(id); }\n function concat(a,b) { return a.concat(b); }\n\n score.set({time: '3/4'});\n\n /* Measure 1 */\n var system = makeSystem(220);\n system.addStave({\n voices: [\n voice([\n notes('D5/q[id=\"m1a\"]'),\n beam(notes('G4/8, A4, B4, C5', {stem: \"up\"}))\n ].reduce(concat)),\n voice([vf.TextDynamics({text: 'p', duration: 'h', dots: 1, line: 9 })]),\n ]\n })\n .addClef('treble')\n .addKeySignature('G')\n .addTimeSignature('3/4')\n .setTempo({ name: \"Allegretto\", duration: \"h\", dots: 1, bpm: 66}, -30);\n\n system.addStave({ voices: [voice(notes('(G3 B3 D4)/h, A3/q', {clef: 'bass'}))] })\n .addClef('bass').addKeySignature('G').addTimeSignature('3/4');\n system.addConnector('brace');\n system.addConnector('singleRight');\n system.addConnector('singleLeft');\n\n id('m1a').addModifier(0, vf.Fingering({number: '5'}));\n\n /* Measure 2 */\n system = makeSystem(150);\n system.addStave({ voices: [voice(notes('D5/q[id=\"m2a\"], G4[id=\"m2b\"], G4[id=\"m2c\"]'))] });\n system.addStave({ voices: [voice(notes('B3/h.', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m2a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m2b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m2c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n\n vf.Curve({\n from: id('m1a'),\n to: id('m2a'),\n options: { cps: [{x: 0, y: 40}, {x: 0, y: 40}]}\n });\n\n /* Measure 3 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('E5/q[id=\"m3a\"]'),\n beam(notes('C5/8, D5, E5, F5', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n id('m3a').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n system.addStave({ voices: [ voice(notes('C4/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n /* Measure 4 */\n system = makeSystem(150);\n system.addStave({ voices: [ voice(notes('G5/q[id=\"m4a\"], G4[id=\"m4b\"], G4[id=\"m4c\"]')) ] });\n\n system.addStave({ voices: [ voice(notes('B3/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n id('m4a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m4b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m4c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n\n vf.Curve({\n from: id('m3a'),\n to: id('m4a'),\n options: { cps: [{x: 0, y: 20}, {x: 0, y: 20}]}\n });\n\n /* Measure 5 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('C5/q[id=\"m5a\"]'),\n beam(notes('D5/8, C5, B4, A4', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n id('m5a').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n\n system.addStave({ voices: [ voice(notes('A3/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n /* Measure 6 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('B5/q'),\n beam(notes('C5/8, B4, A4, G4[id=\"m6a\"]', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [ voice(notes('G3/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n vf.Curve({\n from: id('m5a'),\n to: id('m6a'),\n options: {\n cps: [{x: 0, y: 20}, {x: 0, y: 20}],\n invert: true,\n position_end: 'nearTop',\n y_shift: 20,\n }\n });\n\n /* Measure 7 (New system) */\n x = 20;\n y += 230;\n\n var system = makeSystem(220);\n system.addStave({\n voices: [\n voice([\n notes('F4/q[id=\"m7a\"]'),\n beam(notes('G4/8[id=\"m7b\"], A4, B4, G4', {stem: \"up\"}))\n ].reduce(concat))\n ]\n }).addClef('treble').addKeySignature('G');\n\n system.addStave({ voices: [voice(notes('D4/q, B3[id=\"m7c\"], G3', {clef: 'bass'}))] })\n .addClef('bass').addKeySignature('G');\n system.addConnector('brace');\n system.addConnector('singleRight');\n system.addConnector('singleLeft');\n\n id('m7a').addModifier(0, vf.Fingering({number: '2', position: 'below'}));\n id('m7b').addModifier(0, vf.Fingering({number: '1'}));\n id('m7c').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n /* Measure 8 */\n system = makeSystem(180);\n var grace = vf.GraceNote({keys: ['d/3'], clef: 'bass', duration: '8', slash: true });\n\n system.addStave({ voices: [voice(notes('A4/h.[id=\"m8c\"]'))] });\n system.addStave({ voices: [\n score.set({clef: 'bass'}).voice([\n notes('D4/q[id=\"m8a\"]'),\n beam(notes('D3/8, C4, B3[id=\"m8b\"], A3', {stem: \"down\"}))\n ].reduce(concat))\n ]});\n system.addConnector('singleRight');\n\n id('m8b').addModifier(0, vf.Fingering({number: '1', position: 'above'}));\n id('m8c').addModifier(0, vf.GraceNoteGroup({notes: [grace]}));\n\n vf.Curve({\n from: id('m7a'),\n to: id('m8c'),\n options: {\n cps: [{x: 0, y: 20}, {x: 0, y: 20}],\n invert: true,\n position: 'nearTop',\n position_end: 'nearTop',\n }\n });\n\n vf.StaveTie({from: grace, to: id('m8c')});\n\n /* Measure 9 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('D5/q[id=\"m9a\"]'),\n beam(notes('G4/8, A4, B4, C5', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('B3/h, A3/q', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m9a').addModifier(0, vf.Fingering({number: '5'}));\n\n /* Measure 10 */\n system = makeSystem(170);\n system.addStave({ voices: [voice(notes('D5/q[id=\"m10a\"], G4[id=\"m10b\"], G4[id=\"m10c\"]'))] });\n system.addStave({ voices: [voice(notes('G3/q[id=\"m10d\"], B3, G3', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m10a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m10b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m10c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m10d').addModifier(0, vf.Fingering({number: '4'}));\n\n vf.Curve({\n from: id('m9a'),\n to: id('m10a'),\n options: { cps: [{x: 0, y: 40}, {x: 0, y: 40}]}\n });\n\n /* Measure 11 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('E5/q[id=\"m11a\"]'),\n beam(notes('C5/8, D5, E5, F5', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n id('m11a').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n system.addStave({ voices: [ voice(notes('C4/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n /* Measure 12 */\n system = makeSystem(170);\n system.addStave({ voices: [ voice(notes('G5/q[id=\"m12a\"], G4[id=\"m12b\"], G4[id=\"m12c\"]')) ] });\n\n system.addStave({\n voices: [\n score.set({clef: 'bass'}).voice([\n notes('B3/q[id=\"m12d\"]'),\n beam(notes('C4/8, B3, A3, G3[id=\"m12e\"]', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n system.addConnector('singleRight');\n\n id('m12a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m12b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m12c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n\n id('m12d').addModifier(0, vf.Fingering({number: '2', position: 'above'}));\n id('m12e').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n\n vf.Curve({\n from: id('m11a'),\n to: id('m12a'),\n options: { cps: [{x: 0, y: 20}, {x: 0, y: 20}]}\n });\n\n /* Measure 13 (New system) */\n x = 20;\n y += 230;\n\n var system = makeSystem(220);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('c5/q[id=\"m13a\"]'),\n beam(notes('d5/8, c5, b4, a4', {stem: \"down\"}))\n ].reduce(concat))\n ]\n }).addClef('treble').addKeySignature('G');\n\n system.addStave({ voices: [voice(notes('a3/h[id=\"m13b\"], f3/q[id=\"m13c\"]', {clef: 'bass'}))] })\n .addClef('bass').addKeySignature('G');\n\n system.addConnector('brace');\n system.addConnector('singleRight');\n system.addConnector('singleLeft');\n\n id('m13a').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n id('m13b').addModifier(0, vf.Fingering({number: '1'}));\n id('m13c').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n /* Measure 14 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('B4/q'),\n beam(notes('C5/8, b4, a4, g4', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('g3/h[id=\"m14a\"], b3/q[id=\"m14b\"]', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m14a').addModifier(0, vf.Fingering({number: '2'}));\n id('m14b').addModifier(0, vf.Fingering({number: '1'}));\n\n /* Measure 15 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('a4/q'),\n beam(notes('b4/8, a4, g4, f4[id=\"m15a\"]', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('c4/q[id=\"m15b\"], d4, d3', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m15a').addModifier(0, vf.Fingering({number: '2'}));\n id('m15b').addModifier(0, vf.Fingering({number: '2'}));\n\n /* Measure 16 */\n var system = makeSystem(130);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('g4/h.[id=\"m16a\"]'),\n ].reduce(concat))\n ]\n }).setEndBarType(Vex.Flow.Barline.type.REPEAT_END);\n\n system.addStave({ voices: [voice(notes('g3/h[id=\"m16b\"], g2/q', {clef: 'bass'}))] })\n .setEndBarType(Vex.Flow.Barline.type.REPEAT_END);\n system.addConnector('boldDoubleRight');\n\n id('m16a').addModifier(0, vf.Fingering({number: '1'}));\n id('m16b').addModifier(0, vf.Fingering({number: '1'}));\n\n vf.Curve({\n from: id('m13a'),\n to: id('m16a'),\n options: {\n cps: [{x: 0, y: 50}, {x: 0, y: 20}],\n invert: true,\n position_end: 'nearTop',\n }\n });\n\n /* Measure 17 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('b5/q[id=\"m17a\"]'),\n beam(notes('g5/8, a5, b5, g5', {stem: \"down\"}))\n ].reduce(concat)),\n voice([vf.TextDynamics({text: 'mf', duration: 'h', dots: 1, line: 10 })]),\n ]\n }).setBegBarType(Vex.Flow.Barline.type.REPEAT_BEGIN);\n\n system.addStave({ voices: [voice(notes('g3/h.', {clef: 'bass'}))] })\n .setBegBarType(Vex.Flow.Barline.type.REPEAT_BEGIN);\n\n system.addConnector('boldDoubleLeft');\n system.addConnector('singleRight');\n\n id('m17a').addModifier(0, vf.Fingering({number: '5', position: 'above'}));\n\n /* Measure 18 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('a5/q[id=\"m18a\"]'),\n beam(notes('d5/8, e5, f5, d5[id=\"m18b\"]', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('f3/h.', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m18a').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n\n vf.Curve({\n from: id('m17a'),\n to: id('m18b'),\n options: {\n cps: [{x: 0, y: 20}, {x: 0, y: 30}],\n }\n });\n\n Vex.Flow.Registry.disableDefaultRegistry();\n return vf;\n}", "title": "" }, { "docid": "7aee69224212a1bbf07c937eac3bc1fd", "score": "0.58153075", "text": "function bingo(){\n\tjugador = {nombre:\"nombre\",puntuacion: 0};\n\tconsole.log(\"El sistema de puntos es el siguiente: La puntuación final del jugador será 30 menos el número de turnos que haya usado en completar el cartón\")\n\tplayer = newPlayer();\n\tjugador.nombre=player;\n\tconsole.log(\"Bienvenido \"+player)\n\tcarton = newCarton();\n\tshowCarton(carton);\n\tokCarton();\n\tconsole.log(letsplay(carton));\n\tranking.unshift(jugador);\n\tif(ranking.length>1){\n\tordena();}\n\tshowranking();\n\tplayAgain();\n\n\n}", "title": "" }, { "docid": "90c2502456efc073c666b352fa424f6b", "score": "0.58134663", "text": "function gameLoop() {\n\t\t\t//Press Space in KeyHandler\n\t\t\tif (this.GameStarted) {\n\t\t\t\t\n\t\t\t\tif(this.blocksLeft == 0 && !sent) {\n\t\t\t\t\tthis.win = true;\n\t\t\t\t\t\n\t\t\t\t\tif (this.hitPoints != 0 && this.hitPoints <= 1 && this.canAddScore) { //Ammount of Blocks That Has Been Hit And If It Can Be Added/Not\n\t\t\t\t\t\taddScore(this.BlockWorth); //Adds 250 Only\n\t\t\t\t\t\tthis.canAddScore = false;\n\t\t\t\t\t} else if(this.hitPoints > 1 && this.canAddScore){\n\t\t\t\t\t\tvar ac = this.BlockWorth * (hitPoints * 1.5); //Bonus Points\n\t\t\t\t\t\taddScore(ac); //Adds Original Score(250) With amount of extra points times 1.5 making blocks more Worth foreach block hitted in one run\n\t\t\t\t\t\tthis.canAddScore = false;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tthis.hitPoints = 0; //Reset Hitpoints When Score Has Been Added When Ball Hits Plank\n\t\t\t\t\tInsertHighscore(this.Name,this.score);\n\t\t\t\t\tthis.sent = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this.Name == \"DEMO\") {\n\t\t\t\t\tif(b.getX()<(p.getX()+15)) {\n\t\t\t\t\t\tleft = true;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleft = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (b.getX()>(p.getX()+p.getWidth()-15)) {\n\t\t\t\t\t\tright = true;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tright = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.sticky = false;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tp.movePlanka(left, right);\n\t\t\t\t\n\t\t\t\t//console.log(this.stuck);\n\t\t\t\tif(!this.stuck) {\n\t\t\t\t\tb.moveBall(this.debug);\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tb.followPlank(p.getX()+this.stuckDistance, p.getY()-10);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(b.getY()> this.height) {\n\t\t\t\t\t\n\t\t\t\t\tlifeSystem();\n\t\t\t\t}\n\t\t\t\tif (this.sticky) {\n\t\t\t\t\t\n\t\t\t\t\tthis.stickyCounter++;\n\t\t\t\t\t\n\t\t\t\t\tif(this.stickyCounter>3000) {\n\t\t\t\t\t\n\t\t\t\t\tthis.sticky = false;\n\t\t\t\t\tthis.stickyCounter = 0;\n\t\t\t\t\tthis.stuck = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(this.ghostball) {\n\t\t\t\t\t\n\t\t\t\t\tthis.ghostCounter++;\n\t\t\t\t\t\n\t\t\t\t\tif(this.ghostCounter > 750) {\n\t\t\t\t\t\tthis.ghostCounter = 0;\n\t\t\t\t\t\tthis.ghostball = false;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tb.setSKey(sKey);\n\t\t\t\tcollision();\n\t\t\t\tb.speedUp();\n\t\t\t\tif (!this.canSpawnPUBool) {\n\t\t\t\t\t//console.log(this.canSpawnPUTimer);\n\t\t\t\t\tthis.canSpawnPUTimer++;\n\t\t\t\t\tif (this.canSpawnPUTimer == 200) {\n\t\t\t\t\t\tthis.canSpawnPUBool = !this.canSpawnPUBool;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.canSpawnPUBool) {\n\t\t\t\t\t\tthis.puIntervall++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!this.GameStarted) { //Pre-Game Stuff\n\t\t\t\tp.movePlanka(left, right); //Movement of Plank\n\t\t\t\tvar x = p.x + (p.width/2); //Planks X pos\n\t\t\t\tvar y = p.y - (p.height*1) //Planks Y pos\n\t\t\t\tb.followPlank(x,y); //Follows Plank In Pregame, Can Be Used For Power Up\n\t\t\t\t\n\t\t\t\tif(this.Name == \"DEMO\") {\n\t\t\t\t\tthis.GameStarted = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tdraw();\n\t\t\tthis.yHitTimer++;\n\t\t\tthis.xHitTimer++;\n\n\t\t\tif(this.game) {\n\t\t\t\tsetTimeout(\"gameLoop();\", GLSleep);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "3134dd0479d20528345bf921d66d383e", "score": "0.58017874", "text": "function gameLoop() {\nshortcuts();\nif(pause == 0) {\n // partea cu sfaturile random\n if(achivementContor == 0) {\n randomAchivement();\n achivementContor = achivementTime;\n }\n -- achivementContor;\n\n // partea cu bonusuri\n if(bonusContor == 0) {\n bonuses[Math.floor(Math.random()*bonuses.length) % bonuses.length].effect();\n bonusTime *= 2 + 1;\n bonusContor = bonusTime; \n }\n -- bonusContor;\n\n}\n\nif(userScore < 200)\n\tshowMoneyLimitError = true;\nelse{\n\tif(showMoneyLimitError == true){\n\t\t$.notify(\"You`re too greedy and you will receive no more money until you cool down\", \"error\")\n\t\tshowMoneyLimitError = false;\n\t}\n\tuserScore = 200;\n}\nif (pause == 0){\n // game logic\n updateAchievements();\n takeLife();\n \n if(gameOver()) {\t\n finishedMessage = \"You lasted untill level: \" + userLevel +\" and had the score: \" + score\n location.reload();\n return 0;\n }\n\t\n for(turretIndex in turrets) {\n \n var turret = turrets[turretIndex];\n detectEnemy(turret);\n\n\tfor (var i = waves.length-1; i >= 0; i--) {\n\t if((distanta(waves[i], turret) > turret.range) && waves[i].slowingTurret==turretIndex) {\n waves[i].redoMonster();\n }\t\n }\n\tturret.isAttaking = false;\n \n }\n\t\n\tif(goala() == false)\n\t{\n\t\tif(toAdd == 0) {\n\t\t\tspawn()\n\t\t}\n if(loopOffset < 20) {\n\t\t toAdd = (toAdd+1) % (loopOffset > 0 ? Math.floor(loopOffset/3) : rate);\n } else {\n\t\t toAdd = (toAdd+1) % (loopOffset > 0 ? Math.floor(loopOffset/7) : rate);\n }\n\t}\n\telse\n if(waveFinished()){\n toAdd = 0;\n \twaves_won_perBattle ++; //ACHIEVEMENTS\n generateWave();\n sizeMonsters(); \n }\n\t\n\t\n\t\n \n\n for(var m = 0; m < waves.length; ++ m) {\n\tvar monster = waves[m];\n\t \n \tif(monster.reachedDestination() && monster.current < path_x.length-1) {\n \tmonster.moveTo(path_y[monster.current+1], path_x[monster.current+1]);\n\n\t} else {\n\t\tmonster.moveTo(monster.destinationX, monster.destinationY)\n\t}\n\t\t\n\t\t\n }\n\t\n\t \n\n // desenam\n\n draw();\n $(\"#money\").html(String(userScore));\n $(\"#health\").html(String(life));\n $(\"#score\").html(String(score))\n } // end if\n\t\n gml = setTimeout(gameLoop, loopInterval);\n} // end function", "title": "" }, { "docid": "0dc8f0ac373d3c347140d3b0db2288b4", "score": "0.580083", "text": "function freezeGame()\n{\n\tif((drawX >= -655) && (drawX <= -653))\n\t{\n\n\t\t//textballon tekenen\n\t\tctxText.clearRect(0,0,800,600);\n\t\tctxText.drawImage(textBallonImg,0,0,width,height,110,100,900,900);\n\n\t\t//functie aanroepen om textballon te vullen\n\t\ttextSpawnen();\n\n\t\tstatus = 6;\n\n\t\t//achtergrond stilzetten\n\t\tbgDrawX1 += 3;\n\t\tbgDrawX2 += 3;\n\t\t\n\t\t//speler en collectant stoppen\n\t\tplayer.speed = 0;\n\n\t\t//timer stoppen\n\t\ttimer = timer + 20;\n\n\t\t//na drukken op spatiebalk herstart alles\n\t\tif(keys[74] || keys[78])\n\t\t{\n\t\t\tctxBg.clearRect(0,0,800,600);\n\t\t\tctxGeld.clearRect(0,0,500,380);\n\n\t\t\tbgDrawX1 -= 3;\n\t\t\tbgDrawX2 -= 3;\n\t\t\tplayer.speed = 3;\n\t\t\tdrawX -= player.speed;\n\t\t\tstatus = 0;\n\t\t}\n\n\t\tif(keys[78])\n\t\t{\n\t\t\tnee = true;\n\t\t}\n\n\n\t}\n}", "title": "" }, { "docid": "760ad845a3112d42fb8afd52ed85766a", "score": "0.57980525", "text": "function getTreasure(message, reward){\n var title = \"Treasure!!\";\n var num = 0;\n var total = 0;\n try {var dice = roller.roll(\"1d20\");}\n catch (error){ return message.reply(\"Incorrect command; Hank has stolen your dice as penance!\");}\n var roll = dice.total; \n var description = roll + \": \";\n if (roll <= 9){\n // Money money money money\n roll = roller.roll(\"1d4\");\n num = roll.total;\n if (num == 1) description += \"One Red Rupee\";\n else if (num == 2) description += \"One Purple Rupee\";\n else if (num == 3) description += \"One Silver Rupee\";\n else description += \"One Gold Rupee\";\n }\n else if (roll>=10 && roll <=14){\n // Arrow time\n roll = roller.roll(\"1d4\");\n num = roll.total;\n if (num == 1) description += \"Arrows (x20)\";\n else if (num == 2) description += \"Electric Arrows (x10)\";\n else if (num == 3) description += \"Ice Arrows (x10)\";\n else description += \"Fire Arrows (x10)\";\n }\n else if (roll == 15) description += \"Bomb Arrows (x5)\";\n else if (roll>=16 && roll <= 18){\n // Common Ore\n roll = roller.roll(\"1d4\");\n num = roll.total;\n if (num == 1) description += \"One Opal\";\n else if (num == 2) description += \"One Amber\";\n else if (num == 3) description += \"One Flint\";\n else if (num == 4) description += \"One Luminous Stone\";\n }\n else if (roll == 19) {\n // Rare Ore\n roll = roller.roll(\"1d8\");\n num = roll.total;\n if (num == 1 || num == 2) description += \"One Topaz\";\n else if (num == 3 || num == 4) description += \"One Sapphire\";\n else if (num == 5 || num == 6) description += \"One Ruby\";\n else if (num == 7) description += \"One Diamond\";\n else description += \"One Star Fragment\";\n }\n else description += \"A Weapon!\"\n if (reward) return description;\n else message.reply(embedFactory(title, null, description, null, null, null, null, null));\n}", "title": "" }, { "docid": "7845782a184694370060094c9f723ca8", "score": "0.5798029", "text": "function set_up_sceen1(){\r\n //Setting up background\r\n game_screen.backgroundurl =\"files/pictures/forest.png\" //\"files/pictures/pub_back.png\"\r\n game_screen.backgroundurl2 = -1 //\"files/pictures/pub_front.png\"\r\n num_rest_items = 8\r\n //Setting up characters\r\n var urlHeads = []\r\n var urlBodies = []\r\n var urlLegs = []\r\n var selectedH = []\r\n var selectedB = []\r\n var selectedL = []\r\n var dressL = []\r\n var colours = []\r\n urlHeads.push(\"files/pictures/Face1.png\")\r\n urlHeads.push(\"files/pictures/Face2.png\")\r\n urlHeads.push(\"files/pictures/Face4.png\")\r\n urlHeads.push(\"files/pictures/Face5.png\")\r\n urlBodies.push(\"files/pictures/Body1.png\")\r\n urlBodies.push(\"files/pictures/Body2.png\")\r\n urlBodies.push(\"files/pictures/Body3.png\")\r\n urlBodies.push(\"files/pictures/Body4.png\")\r\n urlLegs.push(\"files/pictures/Legs3.png\")\r\n urlLegs.push(\"files/pictures/Legs2.png\")\r\n urlLegs.push(\"files/pictures/Legs1.png\")\r\n urlLegs.push(\"files/pictures/Legs4.png\")\r\n shuffle(urlHeads)\r\n shuffle(urlBodies)\r\n shuffle(urlLegs)\r\n var random = getRandomInt(0,100)\r\n var otherRandom\r\n if(random < 30){\r\n otherRandom = getRandomInt(0,3)\r\n urlHeads[otherRandom] = \"files/pictures/Face3.png\"\r\n }\r\n random = getRandomInt(0,100)\r\n if(random < 30){\r\n otherRandom = getRandomInt(0,3)\r\n urlBodies[otherRandom] = \"files/pictures/Dress.png\"\r\n dressL[otherRandom] = 1\r\n }\r\n for(var i = 0; i < 4; i++){\r\n var n_colour = new DrawingInfo(urlHeads[i],urlBodies[i],urlLegs[i],dressL[i],-1)\r\n colours.push(n_colour)\r\n }\r\n characters.push(new DrawableBox(100, (game_screen.height - 200), 40, 90, colours[3],0,new Equipment(2),-1, character_names[0]))\r\n characters.push(new DrawableBox(200, (game_screen.height - 150), 40, 90, colours[2],0,new Equipment(2),-1, character_names[1]))\r\n characters.push(new DrawableBox(400, (game_screen.height - 200), 40, 90, colours[1],0,new Equipment(2),-1, character_names[2]))\r\n characters.push(new DrawableBox(500, (game_screen.height - 150), 40, 90, colours[0],0,new Equipment(2),-1, character_names[3]))\r\n //Setting up items\r\n init_items()\r\n}", "title": "" }, { "docid": "4cc709dfe3f2d2019ee9e6f566df4161", "score": "0.57976174", "text": "function preload() {\n\n //PreLoad Sounds\n aFX_button_press = loadSound('assets/audio/add.mp3');\n aFX_fruit_hit = loadSound('assets/audio/mixkit-game-ball-tap-2073.wav');\n aFX_loses_game = loadSound('assets/audio/mixkit-negative-guitar-tone-2324.wav');\n \n\n\n //In the future this object should enlguf every game variable\n game = {\n game_started : false,\n viewport: {\n 'w': 0,\n 'h': 0\n },\n score: 0,\n setScoreUp: function(){\n this.score += 1;\n },\n setViewPort: function(){\n let a = document.getElementById('game_viewport');\n this.viewport.h = a.offsetHeight;\n this.viewport.w = a.offsetWidth;\n console.log(this.viewport.h)\n },\n getScore: function(){\n return this.score;\n },\n gameOver: function(){\n this.game_started = false;\n aFX_loses_game.play();\n },\n gameStart: function(){\n this.game_started = true;\n localStorage.setItem('creloadgame','false');\n }\n }\n \n playarea = {\n 'w': game.viewport.w,\n 'h': game.viewport.h\n }\n\n\n font_regular = loadFont('assets/fonts/Staatliches-Regular.ttf');\n fruit_img = loadImage('assets/img/fruit.png');\n \n fruit = {\n icon: loadImage('assets/img/fruits/1.png'),\n w: 30,\n h: 30,\n x: xFruit-(this.w/2),\n y: yFruit-(this.w/2),\n fruit_basket : [],\n cycleIcon: function(){\n //Lazy load of random fruit resource\n let seed = getRandomInt(11);\n let fruit_icon_uri = 'assets/img/fruits/'+ seed.toString() + '.png';\n this.fruit_basket.push(fruit_icon_uri);\n this.icon = loadImage(fruit_icon_uri);\n },\n hit: function(){\n printFruitBasket();\n aFX_fruit_hit.play();\n }\n }\n \n btn_up = {\n 'src' : 'assets/img/btn_up.png',\n 'x': 20 + this.w ,\n 'y': playarea['h'] +60,\n 'w': 80,\n 'h': 80,\n 'alt': 'Para cima',\n click : function(){\n controls(87);\n aFX_button_press.play();\n }\n }\n\n btn_down = {\n 'src' : 'assets/img/btn_down.png',\n 'x': 20 + this.w ,\n 'y': playarea['h'] + 60,\n 'w': 80,\n 'h': 80,\n 'alt': 'Para baixo',\n click : function(){\n controls(83);\n aFX_button_press.play();\n }\n }\n\n btn_left = {\n 'src' : 'assets/img/btn_left.png',\n 'x': 20 + this.w ,\n 'y': playarea['h'] +60,\n 'w': 80,\n 'h': 80,\n 'alt': 'Para a esquerda',\n click : function(){\n controls(65);\n aFX_button_press.play();\n }\n }\n\n btn_right = {\n 'src' : 'assets/img/btn_right.png',\n 'x': 20 + this.w ,\n 'y': playarea['h'] +60,\n 'w': 80,\n 'h': 80,\n 'alt': 'Para a direita',\n click : function(){\n controls(68);\n aFX_button_press.play();\n }\n }\n\n}", "title": "" }, { "docid": "77ea7ec27118daab33b956cfe15a84e5", "score": "0.57975817", "text": "function basketPlayerGenerator() {\n var player_code = '';\n //controllo che il codice di ogni giocatore sia unico\n do {\n //genero 3 caratteri da concatenare al codice giocatore\n for (var i = 0; i < 3; i++) {\n var rndChar = rndNum(0,25);\n player_code += char.charAt(rndChar);\n }\n\n //genero 3 cifre da concatenare al codice giocatore\n for (var i = 0; i < 3; i++) {\n player_code += rndNum(0,9);\n }\n //console.log(player_code);\n }while(basketPlayer_codes.includes(player_code));\n\n //aggiungo il codice ad un array di codici giocatori in modo che nel ciclo while mi verifica che ogni codice sia unico\n basketPlayer_codes.push(player_code);\n\n //genero i punteggi\n var punti = rndNum(0,50);\n var rimbalzi = rndNum(0,200);\n var falli = rndNum(0,5);\n\n //genero le percentuali per i tiri da 2 e da 3\n var tiri_2 = (rndNum(0,1000)/10).toFixed(1); //in modo che mi ritorni anche un float\n var tiri_3 = (100 - tiri_2).toFixed(1);\n\n //oggetto giocatore\n var basketPlayer = {\n 'code' : player_code,\n 'punti' : punti,\n 'rimbalzi' : rimbalzi,\n 'falli' : falli,\n 'strike_2' : tiri_2,\n 'strike_3' : tiri_3\n };\n\n return basketPlayer;\n}", "title": "" }, { "docid": "afece017da6daea86da5d222f1ca5193", "score": "0.5797067", "text": "function change_bird() {\n\t\t\tfor (var i = 0; i < vogel.length; i++) {\n\t\t\t\tif (vogel[i].isalive == true) {\n\t\t\t\t\tswitch (vogel[i].img) {\n\t\t\t\t\t\tcase feld.vogel1:\n\t\t\t\t\t\t\tvogel[i].img = feld.vogel3;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase feld.vogel2:\n\t\t\t\t\t\t\tvogel[i].img = feld.vogel1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase feld.vogel3:\n\t\t\t\t\t\t\tvogel[i].img = feld.vogel2;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase feld.vogel4:\n\t\t\t\t\t\t\tvogel[i].img = feld.vogel6;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase feld.vogel5:\n\t\t\t\t\t\t\tvogel[i].img = feld.vogel4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase feld.vogel6:\n\t\t\t\t\t\t\tvogel[i].img = feld.vogel5;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (vogel[i].direction >= 1) {\n\t\t\t\t\t\tvogel[i].x += vogel[i].speed;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvogel[i].x -= vogel[i].speed;\n\t\t\t\t\t}\n\t\t\t\t} else if (vogel[i].y <= 320) {\n\n\t\t\t\t\tvogel[i].y += 15;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4278f354fb115cfd63490007412234ed", "score": "0.57967204", "text": "function game() {\n // Draw all sprites\n drawSprites();\n\n // Move non-fish creatures\n for (let i = 0; i < creatures.length; i++) {\n let creature = creatures[i];\n creature.move();\n }\n\n // Stores all the methods to make More Food button work\n useMoreFoodButton();\n\n // Display food trackers and update food tracker bar every time fish eats scrumptious food\n for (let i = 0; i < foodTrackers.length; i++) {\n for (let i = 0; i < fishes.length; i++) {\n let fish = fishes[i];\n let foodTracker = foodTrackers[i];\n foodTracker.updateBar(fish, totalFood);\n foodTracker.display();\n }\n }\n\n // Food is released and fish are displayed; fish interact with food by eitehr eating it or feeding it to the anemone\n for (let i = 0; i < fishes.length; i++) {\n let fish = fishes[i];\n // Release fish food if the More Food Button is clicked and it is active\n if (moreFoodButton.showFood) {\n releaseFishFood(fish);\n }\n\n // Define what happens if fish has food stored in mouth (meaning it intends to feed anemone)\n fishHasFoodStoredInMouth(fish);\n\n // Define the fish's movement: either the fish follows finger, casually swims, or swims to the anemone\n defineFishMovement(fish);\n\n // Display animated fish\n displayAnimatedFish(fish);\n }\n\n // Display and move finger\n moveAndDisplayFinger();\n\n // Cue ending if all fish have eaten the total number of food\n fishAreFull();\n}", "title": "" }, { "docid": "18ab784d3485a62b9a244353f3f7b5dc", "score": "0.57950294", "text": "function computerBet(){\n //Declaration d un tableau avec 3 choice\n let computerMemory = ['stone', 'paper', 'scissors'];\n let max = computerMemory.length;\n computerChoice = computerMemory[Math.floor(Math.random() * max)];\n computerGame.html('<img src=\"img/' + computerChoice +'.svg\" alt=\"'+ computerChoice +'\">');\n \n }", "title": "" }, { "docid": "a00e6da97815a10407401530a126dfc3", "score": "0.57946223", "text": "function appleshitsbuscket(){\n noStroke();\n for (let i = 0; i < appleY.length; i++) {\n let appleX = (i+2)*230;\n if (appleX > basketX - (basketSize/2) && appleX < basketX + (basketSize/2) \n && appleY[i] > basketY - (basketSize/2) && appleY[i] < basketY + (basketSize/2)) {\n score ++;\n appleY[i] = 0;\n \n // mysound effect each time apple hits or tiuches the basket\n mysound.play();\n }\n if (appleY[i] > height){\n appleY[i] = 0;\n }\n }\n}", "title": "" }, { "docid": "4947f6afc63e0e69f3f50bfa58537b3b", "score": "0.5793278", "text": "function bach() {\n var registry = new Vex.Flow.Registry();\n Vex.Flow.Registry.enableDefaultRegistry(registry);\n var vf = new Vex.Flow.Factory({\n renderer: {elementId: 'sheet-vexflow', width: 1100, height: 900}\n });\n var score = vf.EasyScore({throwOnError: true});\n\n var voice = score.voice.bind(score);\n var notes = score.notes.bind(score);\n var beam = score.beam.bind(score);\n\n var x = 120, y = 80;\n function makeSystem(width) {\n var system = vf.System({x: x, y: y, width: width, spaceBetweenStaves: 10});\n x += width;\n return system;\n }\n\n function id(id) { return registry.getElementById(id); }\n\n score.set({time: '3/4'});\n\n /* Measure 1 */\n var system = makeSystem(220);\n system.addStave({\n voices: [\n voice([\n notes('D5/q[id=\"m1a\"]'),\n beam(notes('G4/8, A4, B4, C5', {stem: \"up\"}))\n ].reduce(concat)),\n voice([vf.TextDynamics({text: 'p', duration: 'h', dots: 1, line: 9 })]),\n ]\n })\n .addClef('treble')\n .addKeySignature('G')\n .addTimeSignature('3/4')\n .setTempo({ name: \"Allegretto\", duration: \"h\", dots: 1, bpm: 66}, -30);\n\n system.addStave({ voices: [voice(notes('(G3 B3 D4)/h, A3/q', {clef: 'bass'}))] })\n .addClef('bass').addKeySignature('G').addTimeSignature('3/4');\n system.addConnector('brace');\n system.addConnector('singleRight');\n system.addConnector('singleLeft');\n\n id('m1a').addModifier(0, vf.Fingering({number: '5'}));\n\n /* Measure 2 */\n system = makeSystem(150);\n system.addStave({ voices: [voice(notes('D5/q[id=\"m2a\"], G4[id=\"m2b\"], G4[id=\"m2c\"]'))] });\n system.addStave({ voices: [voice(notes('B3/h.', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m2a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m2b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m2c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n\n vf.Curve({\n from: id('m1a'),\n to: id('m2a'),\n options: { cps: [{x: 0, y: 40}, {x: 0, y: 40}]}\n });\n\n /* Measure 3 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('E5/q[id=\"m3a\"]'),\n beam(notes('C5/8, D5, E5, F5', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n id('m3a').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n system.addStave({ voices: [ voice(notes('C4/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n /* Measure 4 */\n system = makeSystem(150);\n system.addStave({ voices: [ voice(notes('G5/q[id=\"m4a\"], G4[id=\"m4b\"], G4[id=\"m4c\"]')) ] });\n\n system.addStave({ voices: [ voice(notes('B3/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n id('m4a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m4b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m4c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n\n vf.Curve({\n from: id('m3a'),\n to: id('m4a'),\n options: { cps: [{x: 0, y: 20}, {x: 0, y: 20}]}\n });\n\n /* Measure 5 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('C5/q[id=\"m5a\"]'),\n beam(notes('D5/8, C5, B4, A4', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n id('m5a').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n\n system.addStave({ voices: [ voice(notes('A3/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n /* Measure 6 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('B5/q'),\n beam(notes('C5/8, B4, A4, G4[id=\"m6a\"]', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [ voice(notes('G3/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n vf.Curve({\n from: id('m5a'),\n to: id('m6a'),\n options: {\n cps: [{x: 0, y: 20}, {x: 0, y: 20}],\n invert: true,\n position_end: 'nearTop',\n y_shift: 20,\n }\n });\n\n /* Measure 7 (New system) */\n x = 20;\n y += 230;\n\n var system = makeSystem(220);\n system.addStave({\n voices: [\n voice([\n notes('F4/q[id=\"m7a\"]'),\n beam(notes('G4/8[id=\"m7b\"], A4, B4, G4', {stem: \"up\"}))\n ].reduce(concat))\n ]\n }).addClef('treble').addKeySignature('G');\n\n system.addStave({ voices: [voice(notes('D4/q, B3[id=\"m7c\"], G3', {clef: 'bass'}))] })\n .addClef('bass').addKeySignature('G');\n system.addConnector('brace');\n system.addConnector('singleRight');\n system.addConnector('singleLeft');\n\n id('m7a').addModifier(0, vf.Fingering({number: '2', position: 'below'}));\n id('m7b').addModifier(0, vf.Fingering({number: '1'}));\n id('m7c').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n /* Measure 8 */\n system = makeSystem(180);\n var grace = vf.GraceNote({keys: ['d/3'], clef: 'bass', duration: '8', slash: true });\n\n system.addStave({ voices: [voice(notes('A4/h.[id=\"m8c\"]'))] });\n system.addStave({ voices: [\n score.set({clef: 'bass'}).voice([\n notes('D4/q[id=\"m8a\"]'),\n beam(notes('D3/8, C4, B3[id=\"m8b\"], A3', {stem: \"down\"}))\n ].reduce(concat))\n ]});\n system.addConnector('singleRight');\n\n id('m8b').addModifier(0, vf.Fingering({number: '1', position: 'above'}));\n id('m8c').addModifier(0, vf.GraceNoteGroup({notes: [grace]}));\n\n vf.Curve({\n from: id('m7a'),\n to: id('m8c'),\n options: {\n cps: [{x: 0, y: 20}, {x: 0, y: 20}],\n invert: true,\n position: 'nearTop',\n position_end: 'nearTop',\n }\n });\n\n vf.StaveTie({from: grace, to: id('m8c')});\n\n /* Measure 9 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('D5/q[id=\"m9a\"]'),\n beam(notes('G4/8, A4, B4, C5', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('B3/h, A3/q', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m9a').addModifier(0, vf.Fingering({number: '5'}));\n\n /* Measure 10 */\n system = makeSystem(170);\n system.addStave({ voices: [voice(notes('D5/q[id=\"m10a\"], G4[id=\"m10b\"], G4[id=\"m10c\"]'))] });\n system.addStave({ voices: [voice(notes('G3/q[id=\"m10d\"], B3, G3', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m10a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m10b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m10c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m10d').addModifier(0, vf.Fingering({number: '4'}));\n\n vf.Curve({\n from: id('m9a'),\n to: id('m10a'),\n options: { cps: [{x: 0, y: 40}, {x: 0, y: 40}]}\n });\n\n /* Measure 11 */\n system = makeSystem(150);\n system.addStave({\n voices: [\n voice([\n notes('E5/q[id=\"m11a\"]'),\n beam(notes('C5/8, D5, E5, F5', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n id('m11a').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n system.addStave({ voices: [ voice(notes('C4/h.', {clef: 'bass'})) ] });\n system.addConnector('singleRight');\n\n /* Measure 12 */\n system = makeSystem(170);\n system.addStave({ voices: [ voice(notes('G5/q[id=\"m12a\"], G4[id=\"m12b\"], G4[id=\"m12c\"]')) ] });\n\n system.addStave({\n voices: [\n score.set({clef: 'bass'}).voice([\n notes('B3/q[id=\"m12d\"]'),\n beam(notes('C4/8, B3, A3, G3[id=\"m12e\"]', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n system.addConnector('singleRight');\n\n id('m12a').addModifier(0, vf.Articulation({type: 'a.', position: \"above\"}));\n id('m12b').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n id('m12c').addModifier(0, vf.Articulation({type: 'a.', position: \"below\"}));\n\n id('m12d').addModifier(0, vf.Fingering({number: '2', position: 'above'}));\n id('m12e').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n\n vf.Curve({\n from: id('m11a'),\n to: id('m12a'),\n options: { cps: [{x: 0, y: 20}, {x: 0, y: 20}]}\n });\n\n /* Measure 13 (New system) */\n x = 20;\n y += 230;\n\n var system = makeSystem(220);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('c5/q[id=\"m13a\"]'),\n beam(notes('d5/8, c5, b4, a4', {stem: \"down\"}))\n ].reduce(concat))\n ]\n }).addClef('treble').addKeySignature('G');\n\n system.addStave({ voices: [voice(notes('a3/h[id=\"m13b\"], f3/q[id=\"m13c\"]', {clef: 'bass'}))] })\n .addClef('bass').addKeySignature('G');\n\n system.addConnector('brace');\n system.addConnector('singleRight');\n system.addConnector('singleLeft');\n\n id('m13a').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n id('m13b').addModifier(0, vf.Fingering({number: '1'}));\n id('m13c').addModifier(0, vf.Fingering({number: '3', position: 'above'}));\n\n /* Measure 14 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('B4/q'),\n beam(notes('C5/8, b4, a4, g4', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('g3/h[id=\"m14a\"], b3/q[id=\"m14b\"]', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m14a').addModifier(0, vf.Fingering({number: '2'}));\n id('m14b').addModifier(0, vf.Fingering({number: '1'}));\n\n /* Measure 15 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('a4/q'),\n beam(notes('b4/8, a4, g4, f4[id=\"m15a\"]', {stem: \"up\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('c4/q[id=\"m15b\"], d4, d3', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m15a').addModifier(0, vf.Fingering({number: '2'}));\n id('m15b').addModifier(0, vf.Fingering({number: '2'}));\n\n /* Measure 16 */\n var system = makeSystem(130);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('g4/h.[id=\"m16a\"]'),\n ].reduce(concat))\n ]\n }).setEndBarType(Vex.Flow.Barline.type.REPEAT_END);\n\n system.addStave({ voices: [voice(notes('g3/h[id=\"m16b\"], g2/q', {clef: 'bass'}))] })\n .setEndBarType(Vex.Flow.Barline.type.REPEAT_END);\n system.addConnector('boldDoubleRight');\n\n id('m16a').addModifier(0, vf.Fingering({number: '1'}));\n id('m16b').addModifier(0, vf.Fingering({number: '1'}));\n\n vf.Curve({\n from: id('m13a'),\n to: id('m16a'),\n options: {\n cps: [{x: 0, y: 50}, {x: 0, y: 20}],\n invert: true,\n position_end: 'nearTop',\n }\n });\n\n /* Measure 17 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('b5/q[id=\"m17a\"]'),\n beam(notes('g5/8, a5, b5, g5', {stem: \"down\"}))\n ].reduce(concat)),\n voice([vf.TextDynamics({text: 'mf', duration: 'h', dots: 1, line: 10 })]),\n ]\n }).setBegBarType(Vex.Flow.Barline.type.REPEAT_BEGIN);\n\n system.addStave({ voices: [voice(notes('g3/h.', {clef: 'bass'}))] })\n .setBegBarType(Vex.Flow.Barline.type.REPEAT_BEGIN);\n\n system.addConnector('boldDoubleLeft');\n system.addConnector('singleRight');\n\n id('m17a').addModifier(0, vf.Fingering({number: '5', position: 'above'}));\n\n /* Measure 18 */\n var system = makeSystem(180);\n system.addStave({\n voices: [\n score.set({clef: 'treble'}).voice([\n notes('a5/q[id=\"m18a\"]'),\n beam(notes('d5/8, e5, f5, d5[id=\"m18b\"]', {stem: \"down\"}))\n ].reduce(concat))\n ]\n });\n\n system.addStave({ voices: [voice(notes('f3/h.', {clef: 'bass'}))] });\n system.addConnector('singleRight');\n\n id('m18a').addModifier(0, vf.Fingering({number: '4', position: 'above'}));\n\n vf.Curve({\n from: id('m17a'),\n to: id('m18b'),\n options: {\n cps: [{x: 0, y: 20}, {x: 0, y: 30}],\n }\n });\n\n Vex.Flow.Registry.disableDefaultRegistry();\n return vf;\n}", "title": "" }, { "docid": "120f1edf176c5b4345eb7af6e17fd810", "score": "0.57931435", "text": "winGame() {\n background(this.youLoseBgr);\n textFont(\"Potta One\");\n textSize(60 * RATIO);\n textAlign(CENTER);\n text(\"Congraturation!\", 0, 20, width);\n textSize(35 * RATIO);\n text(\"You have destroyed the entire universe!\", 0, 100, width);\n\n textFont(\"Orbitron\");\n textSize(45 * RATIO);\n text(\n `Your scores: ${this.destroyer.scores}`,\n 0,\n height / 2 - (width * 0.562) / 2 - 60,\n width\n );\n\n // Ranking list, later\n\n image(\n this.youWon,\n 0,\n height / 2 - (width * 0.562) / 2,\n width,\n width * 0.562\n );\n\n textFont(\"Potta One\");\n textSize(50 * RATIO);\n text(\"PRESS M TO REPLAY\", 0, height / 2 + (width * 0.562) / 2 + 100, width);\n\n textFont(\"Orbitron\");\n textSize(35 * RATIO);\n fill(\"white\");\n text(\"Weed, The Destroyer\", 0, height - 100 * RATIO, width);\n textSize(26 * RATIO);\n text(\n \"Don't feel bad when wiping all civilizations \",\n 0,\n height - 50 * RATIO,\n width\n );\n textAlign(LEFT);\n }", "title": "" }, { "docid": "e40eb3c57fec8f167b46f02b4b28a6cd", "score": "0.5791746", "text": "function rpsGame(yourChoice) {\n console.log(yourChoice);\n var humanChoice, botChoise;\n humanChoice = yourChoice.id;\n ///console.log('My choise',humanChoice);\n botChoise = randomChoise(randomInt());\n //console.log('Computers choise',botChoise);\n result = decideWinner(humanChoice, botChoise);\n //console.log(result);\n message = finalMessage(result);\n //console.log(message);\n rpsFontEnd(humanChoice, botChoise ,message);\n}", "title": "" }, { "docid": "354f0fd9a6f67d2ec232191b0940edd2", "score": "0.5782946", "text": "function fillingBraceletInGame(level){\n\n let white = [`url('assets/image/backgrounds/jewels/heart-white.gif')`,`url('assets/image/backgrounds/jewels/octagon-white.gif')`,`url('assets/image/backgrounds/jewels/oval-white.gif')`,`url('assets/image/backgrounds/jewels/asscher-white.gif')`,`url('assets/image/backgrounds/jewels/marquise-white.gif')`,`url('assets/image/backgrounds/jewels/pear-white.gif')`,`url('assets/image/backgrounds/jewels/trillon-white.gif')`];\n let red = [`url('assets/image/backgrounds/jewels/heart-red.gif')`,`url('assets/image/backgrounds/jewels/octagon-red.gif')`,`url('assets/image/backgrounds/jewels/oval-red.gif')`,`url('assets/image/backgrounds/jewels/asscher-red.gif')`,`url('assets/image/backgrounds/jewels/marquise-red.gif')`,`url('assets/image/backgrounds/jewels/pear-red.gif')`,`url('assets/image/backgrounds/jewels/trillon-red.gif')`];\n let blue = [`url('assets/image/backgrounds/jewels/heart-blue.gif')`,`url('assets/image/backgrounds/jewels/octagon-blue.gif')`,`url('assets/image/backgrounds/jewels/oval-blue.gif')`,`url('assets/image/backgrounds/jewels/asscher-blue.gif')`,`url('assets/image/backgrounds/jewels/marquise-blue.gif')`,`url('assets/image/backgrounds/jewels/pear-blue.gif')`,`url('assets/image/backgrounds/jewels/trillon-blue.gif')`];\n let yellow = [`url('assets/image/backgrounds/jewels/heart-yellow.gif')`,`url('assets/image/backgrounds/jewels/octagon-yellow.gif')`,`url('assets/image/backgrounds/jewels/oval-yellow.gif')`,`url('assets/image/backgrounds/jewels/asscher-yellow.gif')`,`url('assets/image/backgrounds/jewels/marquise-yellow.gif')`,`url('assets/image/backgrounds/jewels/pear-yellow.gif')`,`url('assets/image/backgrounds/jewels/trillon-yellow.gif')`];\n let jewelstofillup = document.getElementsByClassName(`jewels-space`);\n let divdejoyas = document.getElementsByClassName(\"joyas\");\n let joyas = document.getElementById(\"bracelettomake\");\n let colors = document.getElementById(\"jewelscolors\");\n let testbutton = document.getElementById(\"jewelstochose\");\n let cache;\n for(let i=0;i<level;i++)\n {\n jewelstofillup[i].classList.remove(\"hiddenforjewels\");\n }\n joyas.addEventListener(\"click\",function(){\n cache = event.target;\n if(cache.classList.contains(\"joyas\"))\n {\n for(let i=0;i<divdejoyas.length;i++){\n if(divdejoyas[i]!=cache)\n {\n divdejoyas[i].removeEventListener(\"click\",null);\n }\n }\n \n }\n });\n\n colors.addEventListener(`click`,function(){\n let itemstochange = document.getElementsByClassName(\"shapes\");\n if(event.target.innerHTML==`<p>White</p>`){\n for(let i=0;i<itemstochange.length;i++){\n itemstochange[i].style.backgroundImage=white[i];\n }\n }\n if(event.target.innerHTML==\"Red\"){\n for(let i=0;i<itemstochange.length;i++){\n itemstochange[i].style.backgroundImage=red[i];\n }\n }\n if(event.target.innerHTML==\"Blue\"){\n for(let i=0;i<itemstochange.length;i++){\n itemstochange[i].style.backgroundImage=blue[i];\n }\n }\n if(event.target.innerHTML==\"Yellow\"){\n for(let i=0;i<itemstochange.length;i++){\n itemstochange[i].style.backgroundImage=yellow[i];\n }\n }\n });\n\n testbutton.addEventListener(\"click\", function (){\n try{\n if(cache.classList.contains(\"joyas\")){\n cache.style.backgroundImage = event.target.style.backgroundImage;\n cache.classList.add(\"filled\");\n }\n }catch(error){\n customAlert('Please select first the space to be filled');\n return;\n }\n }); \n \n}", "title": "" }, { "docid": "2598f819a423589d3cccda2e774103f0", "score": "0.57777256", "text": "function startGame(){\n\t\tbirdBottom -= gravity; \n\t\tbird.style.bottom = birdBottom + 'px';\n\t\tbird.style.left = birdLeft + 'px';\n\t}", "title": "" }, { "docid": "30dba42bc86eb8fcd318f9275219a187", "score": "0.57530135", "text": "function createGameBoard(rows, cols){\n var timer;\n $('#face').attr(\"src\", \"SmilingFace.png\")\n var correctFlags = 0;\n var gameBoard = \"\";\n var arr = [[],[]]\n let bombs = Math.floor(Math.random() * (rows*cols - 1)) + 1;\n let placedBombs = 0;\n var flaggedBombs = 0;\n $('#board').empty();\n for(i =1; i<= rows; i++){\n for(j=1; j <= cols; j++){\n $('#board').append('<div class=\"space\" data-row=\"' + i + '\" data-col=\"' + j + '\">&nbsp;</div>');\n }\n $('#board').append('<br>');\n }\n $(\".space\").css(\"pointer-events\", \"auto\")\n\n while(placedBombs < bombs){\n x = Math.floor(Math.random()* rows) +1;\n y = Math.floor(Math.random() * cols) + 1;\n if($('[data-row=' + x+ '][data-col='+ y+']').hasClass(\"bomb\") != true){\n $('[data-row=' + x+ '][data-col='+ y+']').addClass(\"bomb\");\n placedBombs++;\n }\n }\n $(\"#BombsRemaing\").text(placedBombs-flaggedBombs);\n for(i =1; i <= rows; i++){\n for(j = 1; j <= cols; j++){\n let c = 0;\n if($('[data-row=' + i+ '][data-col='+ j+']').hasClass(\"bomb\")){\n c=-1;\n }else{\n if($('[data-row=' + i+ '][data-col='+ (j+1)+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + (i-1)+ '][data-col='+ (j+1)+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + (i+1)+ '][data-col='+ (j+1)+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + i+ '][data-col='+ (j-1)+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + (i-1)+ '][data-col='+ (j-1)+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + (i+1)+ '][data-col='+ (j-1)+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + (i-1)+ '][data-col='+ j+']').hasClass(\"bomb\")){\n c++;\n }\n if($('[data-row=' + (i+1)+ '][data-col='+ j+']').hasClass(\"bomb\")){\n c++;\n }\n }\n $('[data-row=' + i+ '][data-col='+ j+']').attr('data-distance', c);\n }\n }\n $('.space').on('click',function(e) {\n if(timer){\n \n }else{\n startTimer();\n timer = true;\n }\n let target = event.target\n if($(target).hasClass(\"visited\")){\n return\n }\n if(e.shiftKey){\n if($(target).hasClass(\"flagged\")){\n $(target).empty();\n $(target).append(\"&nbsp;\")\n $(target).removeClass(\"flagged\")\n if($(target).hasClass(\"bomb\")){\n correctFlags--;\n }\n flaggedBombs--\n $(\"#BombsRemaing\").text(placedBombs-flaggedBombs);\n }\n else{\n $(target).append(\"<i class='fa fa-flag' aria-hidden='true'></i>\")\n flaggedBombs++;\n $(target).addClass(\"flagged\")\n $(\"#BombsRemaing\").text(placedBombs-flaggedBombs);\n if($(target).hasClass(\"bomb\")){\n correctFlags++;\n }\n if(correctFlags == placedBombs && flaggedBombs == correctFlags){\n gameOver(true)\n }\n }\n }\n else{\n if($(target).hasClass(\"flagged\")){\n\n }\n else if($(target).hasClass(\"bomb\")){\n $(target).addClass(\"visited\")\n gameOver(false)\n }else{\n if($(target).hasClass(\"visited\")){\n }else{\n $(target).addClass(\"visited\")\n $(target).text($(target).data(\"distance\"))\n if($(target).data(\"distance\")== 0){\n reveal(target)\n }\n console.log($('.visited').length)\n if(placedBombs == ((rows*cols) - $('.visited').length)){\n gameOver(true)\n }\n }\n }\n }\n \n });\n}", "title": "" }, { "docid": "c2b74c19d6f0b119d586de2997420fe1", "score": "0.57517457", "text": "function preload() {\n song = loadSound(`assets/sounds/song.mp3`);\n for (let i = 0; i < 15; i++) {\n // Black and brown hairstyles\n hairBlack.push(loadImage(`assets/images/hair/hair${i}_1.png`));\n hairBrown.push(loadImage(`assets/images/hair/hair${i}_2.png`));\n }\n\n for (let i = 0; i < 6; i++) {\n // Blonde hairstyles\n hairBlonde.push(loadImage(`assets/images/hair/hairBlonde${i}.png`));\n }\n\n for (let i = 1; i < 9; i++) {\n // Black and brown eyes\n eyes.push(loadImage(`assets/images/eyes/eye${i}_1.png`));\n eyes.push(loadImage(`assets/images/eyes/eye${i}_2.png`));\n }\n eyes.push(loadImage(`assets/images/eyes/eyeGrey1.png`));\n eyes.push(loadImage(`assets/images/eyes/eyeGrey2.png`)); // Grey eyes\n\n for (let i = 1; i < 13; i++) {\n // Black and brown brows\n brow.push(loadImage(`assets/images/brows/brow${i}.png`));\n }\n for (let i = 1; i < 5; i++) {\n // Gre brows\n browBlonde.push(loadImage(`assets/images/brows/browBlonde${i}.png`));\n }\n\n for (let i = 0; i < 5; i++) {\n // Heads\n head.push(loadImage(`assets/images/head/head1_${i}_0.png`));\n head.push(loadImage(`assets/images/head/head2_${i}_0.png`));\n head.push(loadImage(`assets/images/head/head3_${i}_0.png`));\n head.push(loadImage(`assets/images/head/head4_${i}_0.png`)); // Heads without hair\n\n headWithHair.push(loadImage(`assets/images/head/head1_${i}_1.png`));\n headWithHair.push(loadImage(`assets/images/head/head1_${i}_2.png`));\n headWithHair.push(loadImage(`assets/images/head/head1_${i}_3.png`));\n headWithHair.push(loadImage(`assets/images/head/head2_${i}_1.png`));\n headWithHair.push(loadImage(`assets/images/head/head2_${i}_2.png`));\n headWithHair.push(loadImage(`assets/images/head/head2_${i}_3.png`));\n headWithHair.push(loadImage(`assets/images/head/head3_${i}_1.png`));\n headWithHair.push(loadImage(`assets/images/head/head3_${i}_2.png`));\n headWithHair.push(loadImage(`assets/images/head/head3_${i}_3.png`));\n headWithHair.push(loadImage(`assets/images/head/head4_${i}_1.png`));\n headWithHair.push(loadImage(`assets/images/head/head4_${i}_2.png`));\n headWithHair.push(loadImage(`assets/images/head/head4_${i}_3.png`)); // Heads with hair\n }\n noseImage = loadImage(`assets/images/head/nose.png`);\n mouthImage = loadImage(`assets/images/head/mouth.png`);\n glasses = loadImage(`assets/images/head/glasses.png`);\n\n names = loadJSON(`assets/data/names.json`);\n quests = loadJSON(`assets/data/quests.json`);\n card.yes = loadImage(`assets/images/tendr/yes.png`);\n card.no = loadImage(`assets/images/tendr/no.png`);\n card.font = loadFont(`assets/fonts/tendr.ttf`);\n}", "title": "" }, { "docid": "1c51d887aa900ab785e39e11a79f65bf", "score": "0.57513064", "text": "function gemFall(){\n for(var i = 0; i < 20; i++){\n var gem = gems.create(i * 500, 10, 'gems');\n\n //Makes the hearts float down the canvas.\n gem.body.gravity.y = 100;\n }\n }", "title": "" }, { "docid": "e546045e8fbaee20cf21f31a0d2c0f33", "score": "0.5746522", "text": "function walk() {\r\n const battleChance = Math.floor(Math.random() * 4)\r\n if(battleChance === 0) {\r\n startBattle()\r\n }\r\n else if (battleChance != 0) {\r\n adventureScript()\r\n }\r\n}", "title": "" }, { "docid": "24141eca7975e3aad919f51dca7c1df7", "score": "0.57447714", "text": "ball() {\n\t\tlet numRuns = 0;\n\t\tthis.balls++;\n\t\tif (this.balls === 4) {\n\t\t\tthis.balls = 0;\n\t\t\tif (this.third && this.second && this.first) {\n\t\t\t\tthis.third = false;\n\t\t\t\tnumRuns++;\n\t\t\t}\n\t\t\tif (this.second && this.first) {\n\t\t\t\tthis.second = false;\n\t\t\t\tthis.third = true;\n\t\t\t}\n\t\t\tif (this.first) {\n\t\t\t\tthis.first = false;\n\t\t\t\tthis.second = true;\n\t\t\t}\n\t\t\tthis.first = true;\n\t\t\tif (this.inningSide === false) {\n\t\t\t\tthis.visitTeam.score(numRuns);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthis.homeTeam.score(numRuns);\n\t\t\t}\n\t\t\tthis.newAB();\n\t\t\tthis.lastPitch.play = \"walk\";\n\t\t}\n\t\telse {\n\t\t\tthis.lastPitch.play = \"ball\";\n\t\t\tthis.lastPitch.newAB = false;\n\t\t}\n\t\tthis.lastPitch.out = false;\n\t\tthis.lastPitch.newInning = false;\n\t\tthis.lastPitch.runsScored = numRuns;\n\t}", "title": "" }, { "docid": "fda76c817d52a360770ca84709f87c21", "score": "0.5743226", "text": "function increaseBet() {\n addSound = new Audio('https://freesound.org/data/previews/333/333038_3908740-lq.mp3');\n addSound.play();\n if (stopped.includes(false)) return; //prevents from being clickable when reels are running\n if (bankroll < 5) return; //caps to 0, cant press if less than 5\n bet += 5; \n bankroll -= 5;\n render();\n}", "title": "" }, { "docid": "fbc9850d4a9854fc2c723aa9b9742bc5", "score": "0.5740216", "text": "play() {\n this.chrometer();\n const frameRate = this.frameRate;\n let element = 0, elementX = 0, elementY = 0, batmanPos = 0;\n let obstacles = this.obstacles;\n let gOver = this.gameOver;\n gameLoop = setInterval( () => {\n obstacles.forEach( obstacle => {\n obstacle.restartPosX();\n element = obstacle.name.getBoundingClientRect();\n elementX = parseInt( element.x );\n elementY = parseInt( element.y );\n batmanPos = batman.getBoundingClientRect();\n let batmanPosY0 = parseInt ( batmanPos.y );\n let batmanPosY1 = parseInt (batmanPosY0 )+ 160;\n if ( elementX >= batmanPos.x && elementX <= batmanPos.x + batmanPos.width ) {\n if ( elementY >= batmanPosY0 && elementY < batmanPosY1 || \n elementY+element.height >= batmanPosY0 && elementY+element.height <= batmanPosY1 ) { \n if ( obstacle.isKiller ) {\n gOver();\n obstacle.name.style.left = elementX + parseInt(obstacle.width) + 'px'; \n clearInterval( gameLoop );\n } else {\n let currentDollars = parseInt( amountOfDollars.innerHTML );\n if ( !(currentDollars === 0 && obstacle.value < 0) )\n amountOfDollars.innerHTML = currentDollars + obstacle.value;\n obstacle.setPositionX( \"5000px\" )\n }\n }\n } \n })\n }, frameRate)\n }", "title": "" }, { "docid": "cac3649959ed7f41db8347e40383411c", "score": "0.5738354", "text": "function pick() {\n if (harvest == 1) {\n peachesPicked += farmMods;\n peachesInCooler += farmMods;\n }\n updateScreen();\n}", "title": "" }, { "docid": "77d688b239fea2ee1eafbcc7a3d24f3d", "score": "0.5729734", "text": "function heavyAttackRival()\n{\n\tvar damage = (dice(1, 6) + rival.att) *2;\n\tplayer.pv -= damage;\n\tlifeBarHited(player.pv, hpMaxPlayer, hpPlayer);\n\tmakeBubble(BubbleRivalContent, \"fa fa-hand-rock-o\", RivalBubbleChoice);\n\tinfoTextDown.textContent = \"Ken uses Grosse Patate !\";\n}", "title": "" } ]
53948eb077f0df2288e8d1cba197509c
import PageNotFound from '../assets/images/PageNotFound';
[ { "docid": "02c99eed28c564d8554207094a389550", "score": "0.59970075", "text": "function NotFoundPage (){\n return <Jumbotron className=\"not-found-page\" style={{padding:\"150px 0\", background:\"#414F5E\"}}>\n <Row>\n <Col xs=\"12\"><h1>404</h1></Col>\n <Col xs=\"12\"><h2>PAGE NOT FOUND</h2></Col>\n <Col xs=\"12\" style={{textAlign:\"center\"}}><Link to=\"/\">Go back Home </Link></Col>\n </Row>\n </Jumbotron>\n}", "title": "" } ]
[ { "docid": "85eda78283d8f04b02e99315c490288b", "score": "0.6706125", "text": "function E404() {\n return (\n <ul>\n <li className=\"not-found\">\n <h1>404 someone took this page</h1>\n <img src={IMG404} alt=\"Error 404 Page Not Found\" />\n </li>\n </ul>\n );\n}", "title": "" }, { "docid": "9d476609845d4808463b0b0c37d409b5", "score": "0.6522175", "text": "function notFound() {\n\treturn (\n\t\t<div>\n\t\t\t<div>\n\t\t\t\t<div className=\"w-100\">\n\t\t\t\t\t<Img class=\"img-fluid\" src={pic404} />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "fc7f983cbbbe2fa39dbe0987a229e41a", "score": "0.64870226", "text": "function PageNotFound() {\n\n return (\n <ErrorPage status=\"404\"\n text=\"Ups. Stránka nenalezena :(\"\n buttonAdress=\"/app/dashboard\"\n buttonName=\"Dashboard\"\n />\n );\n}", "title": "" }, { "docid": "a76e7c503346f18222b94c13379a435c", "score": "0.63738203", "text": "function NotFound(){\n return(\n <div>\n <h1>Page Not Found 404</h1>\n </div>\n )\n }", "title": "" }, { "docid": "c28347ef5c3d437f2959920f8692e0a9", "score": "0.6302731", "text": "function App() {\n return <Header img=\"assets/img/log.png\" />;\n}", "title": "" }, { "docid": "ba6c7ee5170badc18c7fd8142f20068d", "score": "0.627524", "text": "function NotFound () {\n return <div>404</div>\n}", "title": "" }, { "docid": "770b1d37f2f6f001ab207ff7f9636bc2", "score": "0.61497164", "text": "function LoadingPage(){\n return(\n <div className=\"state__page img\">\n {/* <img src={loading} alt=\"Loading_page\" /> */}\n </div>\n )\n}", "title": "" }, { "docid": "bbfc47524c97fcb65c288f54a9200b68", "score": "0.61429507", "text": "function NotFound() {\n return (\n <div id=\"wrapper\">\n <img src=\"https://i.imgur.com/qIufhof.png\" alt='NotFoundImage'/>\n <div id=\"info\">\n <h3>This page could not be found</h3>\n </div>\n </div >\n )\n}", "title": "" }, { "docid": "00713cd2af884959f9755efd7689c795", "score": "0.61285204", "text": "function NotFound(){\n return <h1>404: Not Found</h1>\n}", "title": "" }, { "docid": "eeaf91c4b992dbb71a40626e6721ac04", "score": "0.6092452", "text": "function Page404() {\r\n\r\n return (\r\n <Grid fluid className='page404' \r\n />\r\n )\r\n}", "title": "" }, { "docid": "5d57052b4cb15abce24585bb0e1458fb", "score": "0.60805327", "text": "function PageNotFound() {\n return (\n <div className='PageNotFound'>\n <h1>404 | Oops!</h1>\n <h2>No logramos encontrar la página que buscas :(</h2>\n <Link to='/'>\n <FontAwesomeIcon icon={faArrowLeft} />\n Ir a la página principal\n </Link>\n </div>\n );\n}", "title": "" }, { "docid": "2db431f4bae19ee44c0cb8b9792de4aa", "score": "0.5912965", "text": "render() {\n return(\n <p>NotFound</p>\n )\n }", "title": "" }, { "docid": "d7654fdfb61ee904cd94f972de5221d0", "score": "0.5901696", "text": "function NotFound(){\n\n return(\n <div>\n <h1>404</h1>\n <h3>Cannot Find The Page You Are Looking For!</h3>\n <NavLink to=\"/\">Click to Go Back!</NavLink>\n </div>\n );\n}", "title": "" }, { "docid": "3b1b123c3942b82e91377146114348cb", "score": "0.5895275", "text": "function _404(){ //página 404\n return(\n <div>\n <h1>404</h1>\n </div>\n );\n}", "title": "" }, { "docid": "12a34d1772ede82a1358c96bb8ee686f", "score": "0.58577406", "text": "render () {\n // Make sure to return some UI\n return (\n <div>\n <h1>Hello World!</h1>\n <p>Paragraph</p>\n <img src={require(\"./images/images.jpeg\")}></img>\n </div>\n )\n }", "title": "" }, { "docid": "ad590a21fdd2e1d653e6aa2dd20b8873", "score": "0.5787889", "text": "function InvalidURL() {\n\n return (\n\n <li className=\"not-found\">\n <h3>404 Error</h3>\n <p>Sorry! Page not found.</p>\n </li>\n\n )\n}", "title": "" }, { "docid": "aab19f156fa25f773a0b85a14b4a7f80", "score": "0.57782316", "text": "posterError(event) {\n event.target.src = \"./assets/img/404_screen.jpg\"\n }", "title": "" }, { "docid": "a63272dff2fa1b7517d7db3e71a09eda", "score": "0.5777771", "text": "function PageNotFound() {\n\n return (\n <Main>\n <NavBar />\n <Jumbotron />\n <section className = \"is-desktop has-text-centered\">\n <h1 className=\"mt-5 ml-4 mr-4 mb-3 has-text-weight-bold is-size-2\">\n 404: Page Not Found</h1>\n <a href=\"/\">\n <button className=\"button is-link is-size-5 ml-2 mr-2 mt-5\">\n Return Home</button>\n </a>\n </section>\n </Main>\n );\n }", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.5776651", "text": "notFound() {}", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.5776651", "text": "notFound() {}", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.5776651", "text": "notFound() {}", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.5776651", "text": "notFound() {}", "title": "" }, { "docid": "5409cce78b0cd54f2bb988309f8ab4ea", "score": "0.5776651", "text": "notFound() {}", "title": "" }, { "docid": "bffed5ffb16afd223c0bb730c9c4814a", "score": "0.5753274", "text": "render() {\n return (\n <div>\n <h1 className = \"appName\" >404. That’s an error.</h1>\n <div className=\"signIn\">\n <p className=\"signInHead\">Sorry, this page isn't available.</p>\n <p className = \"linkToAccount\"> The link you followed may be broken, or the page may have been removed.<br/>\n <Link className=\"linkToImageAnnotation\" to = '/'>Go back to Homepage.</Link>\n </p>\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "232eb3477861620b836b706db15d5cad", "score": "0.573455", "text": "function notFound() {\n return error(404, 'Not found', 'NOT_FOUND_ERROR');\n}", "title": "" }, { "docid": "e34f22d8583cdd897f2d581757861b78", "score": "0.56834745", "text": "function getImage() {\n return '/images/Floorish_900.jpg'\n}", "title": "" }, { "docid": "611c785235636ddce839b5023bb8ec16", "score": "0.5658864", "text": "render() {\n return h(\"img\", { src: getAssetPath(\"/assets/carta3.png\") });\n }", "title": "" }, { "docid": "9226c1708cdbe3f467bf3f71e1558739", "score": "0.5658284", "text": "function notFound(req, res) {\n res.status(404).render('error', {\n error: '404 Not found. We could not find this page :(',\n page: 'Error!'\n })\n}", "title": "" }, { "docid": "11496d3a6becc281b7aa42100186e857", "score": "0.5627813", "text": "function notFound(req, res) {\n res.status(404).render('404.ejs')\n}", "title": "" }, { "docid": "6ba7bc8a985699080504c4e83e4641f2", "score": "0.56222576", "text": "error404(req, res, next) {\n res.status(404).render('errors/error_404');\n }", "title": "" }, { "docid": "73215caedeb72fd5927e8c41fee07327", "score": "0.5603057", "text": "function LandingPage() {\r\n return (\r\n <div className=\"landing-bg\">\r\n <img src={home} className=\"landingimg\" alt=\"logo\" />\r\n </div>\r\n );\r\n}", "title": "" }, { "docid": "a21dc4878c783bcc6ddb97f53d3fd2de", "score": "0.55749506", "text": "function Logo() {\n\n return (\n <div>\n <Image\n className=\"foot\"\n img src={logo} alt=\"logo\" \n //src=\"./logo.png\"\n height={100}\n width={400}\n />\n </div>\n );\n \n}", "title": "" }, { "docid": "73dd68a1afab02596c368d279da110d8", "score": "0.5548862", "text": "function imagePath(assetName) {\n return `${process.env.PUBLIC_URL}/images/${assetName}`;\n}", "title": "" }, { "docid": "20e629286e1f5f4914d4d814525e74fc", "score": "0.55324334", "text": "function NotFound() {\n return <_Layout.default title={(0, _Translate.translate)({\n id: 'theme.NotFound.title',\n message: 'Page Not Found'\n })}>\n <main className=\"container margin-vert--xl\">\n <div className=\"row\">\n <div className=\"col col--6 col--offset-3\">\n <h1 className=\"hero__title\">\n <_Translate.default id=\"theme.NotFound.title\" description=\"The title of the 404 page\">\n Page Not Found\n </_Translate.default>\n </h1>\n <p>\n <_Translate.default id=\"theme.NotFound.p1\" description=\"The first paragraph of the 404 page\">\n We could not find what you were looking for.\n </_Translate.default>\n </p>\n <p>\n <_Translate.default id=\"theme.NotFound.p2\" description=\"The 2nd paragraph of the 404 page\">\n Please contact the owner of the site that linked you to the\n original URL and let them know their link is broken.\n </_Translate.default>\n </p>\n </div>\n </div>\n </main>\n </_Layout.default>;\n}", "title": "" }, { "docid": "793457226a9e02557ec0e33b0e3b9631", "score": "0.55264074", "text": "function NoMatch() {\n return (\n <Container fluid>\n <Row>\n <Col size=\"md-12\">\n <Jumbotron>\n <h1 className=\"text-center\">404 Page Not Found</h1>\n <h1 className=\"text-center\">\n <span role=\"img\" aria-label=\"Face With Rolling Eyes Emoji\">\n 🙄\n </span>\n </h1>\n </Jumbotron>\n </Col>\n </Row>\n </Container>\n );\n}", "title": "" }, { "docid": "793457226a9e02557ec0e33b0e3b9631", "score": "0.55264074", "text": "function NoMatch() {\n return (\n <Container fluid>\n <Row>\n <Col size=\"md-12\">\n <Jumbotron>\n <h1 className=\"text-center\">404 Page Not Found</h1>\n <h1 className=\"text-center\">\n <span role=\"img\" aria-label=\"Face With Rolling Eyes Emoji\">\n 🙄\n </span>\n </h1>\n </Jumbotron>\n </Col>\n </Row>\n </Container>\n );\n}", "title": "" }, { "docid": "793457226a9e02557ec0e33b0e3b9631", "score": "0.55264074", "text": "function NoMatch() {\n return (\n <Container fluid>\n <Row>\n <Col size=\"md-12\">\n <Jumbotron>\n <h1 className=\"text-center\">404 Page Not Found</h1>\n <h1 className=\"text-center\">\n <span role=\"img\" aria-label=\"Face With Rolling Eyes Emoji\">\n 🙄\n </span>\n </h1>\n </Jumbotron>\n </Col>\n </Row>\n </Container>\n );\n}", "title": "" }, { "docid": "793457226a9e02557ec0e33b0e3b9631", "score": "0.55264074", "text": "function NoMatch() {\n return (\n <Container fluid>\n <Row>\n <Col size=\"md-12\">\n <Jumbotron>\n <h1 className=\"text-center\">404 Page Not Found</h1>\n <h1 className=\"text-center\">\n <span role=\"img\" aria-label=\"Face With Rolling Eyes Emoji\">\n 🙄\n </span>\n </h1>\n </Jumbotron>\n </Col>\n </Row>\n </Container>\n );\n}", "title": "" }, { "docid": "0aaa6a9decd1e4c0800802fa512720f0", "score": "0.5517599", "text": "function LogoTitle() {\n return (\n <Image\n style={{ width: 40, height: 40 }}\n source={require('./assets/PlayerRaterLogo.png')}\n />\n );\n}", "title": "" }, { "docid": "5cdb7f0ee80f4eb0ad49f43a244c7461", "score": "0.55044615", "text": "function notFound(req, res) {\n res.status(404).render(\"notfound\", {\n pageTitle: \"404\"\n });\n}", "title": "" }, { "docid": "d55dc75616e412fba2289894e7855bb8", "score": "0.5503757", "text": "render() {\n return (\n <View style={styles.viewStyles}>\n <Image\n source={require('../../public/images/splashscreen.png')}\n style={[styles.boxing]}\n />\n </View>\n );\n }", "title": "" }, { "docid": "269263506e83c2e7d5716b6b221d0034", "score": "0.5463177", "text": "function Home(){\n\n return(\n <div>\n <h1>Hello. I am a Vending Machine. Give me yo monies.</h1>\n <img \n src=\"https://vignette.wikia.nocookie.net/to-aru-majutsu-no-index/images/2/26/Jihanki.png/revision/latest?cb=20120504161315\"\n alt=\"nippon-vending-machine\" \n className=\"img-fluid\"\n />\n </div>\n )\n}", "title": "" }, { "docid": "fa2f48cd0b1dde71c4fb385de8b21015", "score": "0.5461595", "text": "fetchMissingAsset( path ){ console.error(\"No fetch handler for \", path, \" you need to overwrite the fetchMissingAsset method\"); }", "title": "" }, { "docid": "690ae0a879e17a64d924a08484d5c825", "score": "0.5447793", "text": "function fileNotFound (request, response) {\n fileServer.serveFile('/not-found.html', 404, {},request, response);\n}", "title": "" }, { "docid": "cb146256106c5d5caf987a2be48a4c8c", "score": "0.5433524", "text": "function notFound(req, res) {\r\n\tres.status(404).render('not-found.ejs');\r\n}", "title": "" }, { "docid": "cb9f343762890515e7084a8a20e9fefd", "score": "0.54109794", "text": "render() {\n return (\n <View style={styles.container}>\n {/* display image and loading indicator */}\n <Image source={require(\"../assets/glass.png\")} style={styles.logo} />\n <ActivityIndicator size=\"large\" style={styles.loading} />\n </View>\n );\n }", "title": "" }, { "docid": "4139d019ba8a49ec2e2f67178f179510", "score": "0.539713", "text": "function imgError() {\r\n alert(\"Image couldn't be loaded\");\r\n console.log(\"error when loading image path\");\r\n}", "title": "" }, { "docid": "29c8a779bfd32cf5820311944d89c0a0", "score": "0.5375146", "text": "getIcon(icon) {\n return `//openweathermap.org/img/w/${icon}.png`;\n }", "title": "" }, { "docid": "04532cd6202901a366427e79a35a21a9", "score": "0.5373881", "text": "show404(err, req, res) {\n res.sendStatus(404);\n }", "title": "" }, { "docid": "5895c1a6811bfbd49bea055aabfb0544", "score": "0.5360828", "text": "function LoadStaticFolder() {\r\n const staticPath = configAPI.getStaticPath();\r\n viewAPI.setStatic(staticPath.route, staticPath.path)\r\n}", "title": "" }, { "docid": "33eff6737b2c0bd0a7fc45bdcee589f4", "score": "0.5357649", "text": "notFound() {\n this.navigator.replace(this.paths.notFound);\n }", "title": "" }, { "docid": "da72173ddb3b7eea7f307469f4909372", "score": "0.5348207", "text": "function Loading() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <img src={vwi_logo} className=\"App-logo\" alt=\"logo\" />\n <p>\n Vishaka welding Institute\n </p>\n </header>\n </div>\n );\n}", "title": "" }, { "docid": "232059e0094f394ece0f6781fbf7613d", "score": "0.53435", "text": "function handleNotFound(url) {\n \tvar template = getTemplate('404.jst'),\t\n \t\tfile = tmpl(template, { url: url.pathname });\n \treturn { code: 404, file: file };\n }", "title": "" }, { "docid": "26b10f112deb757bf2768c67dbf0ecf2", "score": "0.53399134", "text": "render() {\n\n return (\n <div className='pagenotfound'>\n <Redirect to='/' />\n </div>\n\n );\n }", "title": "" }, { "docid": "b3e8ff8abadc6b9e324e7b6a698debee", "score": "0.5329108", "text": "getModuleName() {\n return 'image';\n }", "title": "" }, { "docid": "74676fc4fee899846f2028abb279e3a0", "score": "0.5328738", "text": "render() {\n return (\n <div>not found</div>\n );\n }", "title": "" }, { "docid": "567ea940fd069c4fdea81d3d73657c34", "score": "0.5314739", "text": "addDefaultSrc(ev) {\n ev.target.src = require(\"../assets/User Small/User Icon Small.png\");\n }", "title": "" }, { "docid": "a544b347187053889b77297b19736aa1", "score": "0.5314486", "text": "function imageError(image) {\n image.src = 'images/no-image.png';\n}", "title": "" }, { "docid": "a544b347187053889b77297b19736aa1", "score": "0.5314486", "text": "function imageError(image) {\n image.src = 'images/no-image.png';\n}", "title": "" }, { "docid": "a544b347187053889b77297b19736aa1", "score": "0.5314486", "text": "function imageError(image) {\n image.src = 'images/no-image.png';\n}", "title": "" }, { "docid": "baad28d7a6ed86b44cbad201290ccad6", "score": "0.5301213", "text": "function LoadingMessage() {\n return (\n <div className={style.loadingScreenWrapper}>\n <div className={style.loadingText}>\n <h1 className={style.loadingMessage}>\n Acts of Kindness\n </h1>\n </div>\n <div className={style.logoWrapper}>\n <img\n className={style.logo}\n id=\"logo\"\n src={require(\"../../assets/logoNew.svg\")}\n alt=\"logo\"\n \n />\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "e42c3d4c0be4f118eef644ac95b8c11b", "score": "0.5285752", "text": "UNSAFE_componentWillMount() {\n new Image().src = HEADER_IMG;\n }", "title": "" }, { "docid": "851b5772a040d5515036711e965ea5cf", "score": "0.5283412", "text": "render () {\n\n return (\n <div>\n <img className=\"iphone-photo\" src=\"iphone_6_plus_white_port.png\"/>\n </div>\n )\n }", "title": "" }, { "docid": "92807173820a4f7efdf8bf7702d3986f", "score": "0.5274696", "text": "function preloader() {\n let loadingImage = new Image();\n loadingImage.src = \"images/aboutMiguel/backgrounds/gifs/rocketBackground.gif\";\n}", "title": "" }, { "docid": "b53e168d9abf67a66b314f584b71e2f7", "score": "0.5268656", "text": "function Loader (props){\n return (\n <div >\n <img className='loader-img' src=\"http://i.imgur.com/ssjmxXz.gif\"/>\n\n \n </div>\n )\n}", "title": "" }, { "docid": "ab4086ebb9a9e807f21d7ec955ceb2e2", "score": "0.5268562", "text": "_notFound(){\n this.app.use((req, res, next)=>{\n const err = new Error('Not Found');\n err.code = 404;\n next(err);\n });\n }", "title": "" }, { "docid": "b15803f54cef915760d906c7eb7a2f65", "score": "0.5265551", "text": "function notFoundPage (req, res) {\n res.status(404);\n res.render('400');\n }", "title": "" }, { "docid": "824d1f34e1e2ef1cab49e760acd5a337", "score": "0.5262601", "text": "function NotFound() {\n\n return (\n\n <li className=\"not-found\">\n <h3>Opps we can't find what you are looking for</h3>\n <p>Please try again</p>\n </li>\n\n )\n}", "title": "" }, { "docid": "67e8101dc7e5b8fb482d76483d846895", "score": "0.52543926", "text": "function error404(request, response, next) {\n // Código 400: Internal server error\n response.status(404);\n response.render(\"error404\", {\n mensaje: \"NO SE ENCONTRO LO QUE BUSCABAS BRO, DEJALO TODO Y VENTE AL TFT\",\n }\n )\n}", "title": "" }, { "docid": "3a98b483de87a52dd82294b94e633cbe", "score": "0.52507067", "text": "function view_404() {\n let self = this;\n self.theme(F.config['theme']);\n self.view('404', {title: F.functions.build_title(\"404\")});\n}", "title": "" }, { "docid": "9e82454f36187f971f8b2afb2dd4b1d5", "score": "0.5245112", "text": "function notFoundHandler(next) {\n const err = new Error(\"Not Found\");\n err.status = 404;\n // Logs error to the console\n console.log(\"Sorry, we couldn't find the webpage you were looking for :( Error code:\", err.status);\n next(err);\n}", "title": "" }, { "docid": "0e6a20a0bd77855f15e841de7e7b086b", "score": "0.52340573", "text": "function fileNotFound(res)\n{\n res.statusCode = 404;\n res.end('Resource Not Found.');\n}", "title": "" }, { "docid": "7699ac0bafed06c46377e3bc0eacaad4", "score": "0.5232325", "text": "notFound(req, res) {\n res.sendStatus(404);\n }", "title": "" }, { "docid": "108846a9fcb7895255c6bd65782edca5", "score": "0.5228545", "text": "function AssignIcon() {\n return (\n <Link to={\"/Helper/\"}>\n <img className=\"assigned\" src={Assign} alt= \"Assigned\" />\n </Link>\n );\n}", "title": "" }, { "docid": "20e992a58d05e3ffb859db4070235b53", "score": "0.5222706", "text": "function notFound(req, res) {\n res.status(404).send(\"URL not found.\");\n}", "title": "" }, { "docid": "3e43de99aebbabf44c350369c233144b", "score": "0.5219492", "text": "function BasePage(props) {\n\n const img = require('../../assets/images/leaves.png');\n\n return (\n <div className=\"base-page-container\">\n\n <Helmet defaultTitle={'HIDS-Sustentabilidade Corporativa'}/>\n <Menu />\n <div className=\"base-page-container-content\">\n <Header title={props.title} backBtn={props.backBtn}/>\n <div className=\"base-page-content\">\n {props.children}\n </div>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "c87411357c8ab8c3d1af6e1bd1fe77b5", "score": "0.52124083", "text": "function notFound(req, res, next) {\n next(new ErrorHTTP(404));\n}", "title": "" }, { "docid": "f7a82e69fe7352b381612d28b08136bd", "score": "0.52013576", "text": "function Home() {\n return (\n <div>\n <img \n src=\"https://i.imgur.com/C9BqQTO.png\" \n alt=\"picture of film board and tickets\" \n className=\"homepage-pic\"\n />\n </div>\n );\n}", "title": "" }, { "docid": "f337f7affc0f54fc0f275e39c638a8ed", "score": "0.5199968", "text": "setStaticFolder(path){\n this.core.use(this.assets(path))\n }", "title": "" }, { "docid": "2ba3a910aab75d48168b744ea77c2678", "score": "0.51952535", "text": "function handleElementError(e) {\n console.log(\"Error Loading Asset : \" + e.target.src);\n }", "title": "" }, { "docid": "2f30ec1d70d41b6eac73c46a64ce4133", "score": "0.5181487", "text": "function hook_404(router_path) {}", "title": "" }, { "docid": "3eff29288a46c0a92c285daa7678fa65", "score": "0.5176707", "text": "componentDidMount() {\n this.iconReturn = <img alt=\"return\" src={ReturnIcon}></img>;\n }", "title": "" }, { "docid": "2db9647ec32f413a4363adc9b8e3cb1e", "score": "0.5173319", "text": "function node_images() {\n return gulp.src(PATHS.img)\n .pipe(gulp.dest('src/assets/img/'));\n}", "title": "" }, { "docid": "bad8d60c74fac441f9a1f60006afe323", "score": "0.51714295", "text": "function getIconImage(bundle) {\n var imageLoc = '/var/mobile/Library/FrontPageCache/' + bundle + '.png';\n if(bundle.includes('pageJump')){\n imageLoc = \"src/images/pageJump.png\";\n }\n if(bundle.includes('drawerIcon')){\n imageLoc = \"src/images/drawerIcon.png\";\n }\n if(bundle.includes('folderIcon')){\n imageLoc = \"src/images/folderIcon.png\";\n }\n if (lStorage.iconImageLocations && lStorage.iconImageLocations[bundle]) {\n imageLoc = lStorage.iconImageLocations[bundle];\n }\n return imageLoc;\n}", "title": "" }, { "docid": "3c31af0fbc8862e02f861ea10596d5e4", "score": "0.5167745", "text": "function layzLoading(path) {\n return () => import(`components/${path}.vue`)\n}", "title": "" }, { "docid": "d5c2b834df62b2de9c60af28a4ab01d4", "score": "0.5165134", "text": "function handle404(req, res) {\n res.statusCode = 404;\n res.sendfile(__dirname + '/public/notfound.html');\n}", "title": "" }, { "docid": "b60479f1c5416ece38be4a5f88543b5e", "score": "0.5163464", "text": "function spritePath(sprite_name) {\n return `img/${sprite_name}.png`;\n}", "title": "" }, { "docid": "601a4da8cf458aa63e1e9237e4e8cd66", "score": "0.51545626", "text": "function notFoundRenderer (request, response) {\n\tresponse.status(404).json({\n\t\tstatus: 404, \n\t\terror: \"Resource not found\"\n\t});\n}", "title": "" }, { "docid": "d5c131927ba53558d6ba92f62a96d514", "score": "0.5150839", "text": "function notFound(props) {\n // console.log(\"notFound(): \", props);\n return (\n <div className=\"text-center\">\n <h2 className=\"mt-5\">Page Not Found</h2>\n <br></br>\n <h4>The page \"{props.location.pathname}\" does not exist!</h4>\n <p>\n Would you like to return to<Link to=\"/\"> Project's</Link> page\n instead?\n </p>\n </div>\n );\n}", "title": "" }, { "docid": "06d439555d7c2e8942bab77e0a85f46a", "score": "0.5148292", "text": "function fileNotFound(req, res) {\n let url = req.url;\n res.type('text/plain');\n res.status(404);\n res.send('Cannot find ' + url);\n}", "title": "" }, { "docid": "d1af8309b2250ef3b690dfc26570e800", "score": "0.51474655", "text": "function rutadeimagen(login){\n //if(tieneImagen)\n return \"../images/perfiles/\"+login+\"/icono.jpg\"\n //return \"../images/default/perfil.jpg\"\n}", "title": "" }, { "docid": "1fc217f6f9cfeffcfc4ab1e353559d82", "score": "0.51448333", "text": "function pageNotFound(){\n container.innerHTML = `<h1>Uh oh...Page not found</h1><p>Sorry, but this page could not be located</p>`;\n }", "title": "" }, { "docid": "69800065f425c04a59f0aad7ab9066c9", "score": "0.51402944", "text": "function notFound(req, res) {\n res.status(404).send('Not Found');\n}", "title": "" }, { "docid": "69800065f425c04a59f0aad7ab9066c9", "score": "0.51402944", "text": "function notFound(req, res) {\n res.status(404).send('Not Found');\n}", "title": "" }, { "docid": "7f9bf63fcd783cd16aaa786f7ce48cd2", "score": "0.51399267", "text": "render() {\n return (\n <ImageBackground source={require('../assets/images/splash.png')} style={styles.container}>\n <ActivityIndicator size=\"large\" color=\"#881111\" style={styles.indicator}/>\n </ImageBackground>\n );\n }", "title": "" }, { "docid": "c67f216cdc69b0b848068775e34969ba", "score": "0.51356226", "text": "render() {\n return (\n <div>\n <h1>Welcome to Dana's Test App</h1>\n <img id='welcome-photo' alt='smiley face' src='https://upload.wikimedia.org/wikipedia/commons/thumb/e/e0/SNice.svg/1200px-SNice.svg.png'/>\n </div>\n )\n }", "title": "" }, { "docid": "ae8cdb7e3c886b0f5bfcc5d3cd28a992", "score": "0.5135226", "text": "render() {\n\n return (\n <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>\n <Image source={require('../Images/ajax-loader.gif')} />\n <StatusBar barStyle=\"default\" />\n </View>\n );\n\n }", "title": "" }, { "docid": "69213879f97c97ddf3f5f79fec74b05e", "score": "0.51251745", "text": "onUrlExists() {\n this.importFile();\n }", "title": "" }, { "docid": "b9538500472d21aa531e9a434ff01384", "score": "0.51172006", "text": "function notFound(upload, mobile) {\n templateEngine.render(\"/404.html\",\n {otaTitle:upload.title\n ,mobileType:mobile.mobileType\n ,filename:mobile[fileType]\n ,referrer:res.referrer\n ,version:config.version\n ,date:otaUtil.patternTime(\"MM月DD日 HH:mm\", new Date())},\n function(err, html) {\n res.writeHead(404, {\"content-type\": WML_MIME_TYPE});\n res.end(html);\n });\n }", "title": "" }, { "docid": "0feaa1c109a99cc07246a51b21d44def", "score": "0.5107967", "text": "preload() {\n this.load.image(\"flappy-duck\", \"assets/flappyduck.png\")\n }", "title": "" } ]
d5d17e17987892f476d81ea0a24fb31f
Criando de forma literal:
[ { "docid": "6dfc2f0cb6af0da4b4efa9183c1bb4e7", "score": "0.0", "text": "function func1(){ // Em funções normais, não se pode omitir seus blocos, denotados por chaves. Apenas em arrow-functions.\r\n \r\n // O retorno de valor é facultativo. Caso você não ponha, ele retornará 'undefined'.\r\n }", "title": "" } ]
[ { "docid": "b089e710f9fe7a88d3f3cdb29cb1dea1", "score": "0.7455929", "text": "function Literal( arg ) {\r\n}", "title": "" }, { "docid": "7f02a6d18df971c09f820368f277722a", "score": "0.69278026", "text": "function Bind_Oliteral() {\r\n}", "title": "" }, { "docid": "d9c36167d3dc4d93304458ca73755bd8", "score": "0.6902781", "text": "function Literal(t, v, l, c) {\n var _this = _super.call(this) || this;\n _this.tipo = t;\n _this.valor = v;\n _this.linea = l;\n _this.columna = c;\n return _this;\n }", "title": "" }, { "docid": "be579a6d102e9cfb827caaab3a77fd8e", "score": "0.68683195", "text": "function Bind_A_Oliteral() {\r\n}", "title": "" }, { "docid": "1bcf27af2447631aa7fd16b5ae441b65", "score": "0.68229717", "text": "$literal (obj, expr) {\r\n return expr\r\n }", "title": "" }, { "docid": "3a34e926e606961a8ad504dbf7d38805", "score": "0.68026674", "text": "function createLiteral(value, type) {\n\t return '\"' + value + '\"^^' + type;\n\t }", "title": "" }, { "docid": "f74968cd03bba7662f98d29e72548576", "score": "0.6754401", "text": "function LiteralObject() {\r\n}", "title": "" }, { "docid": "3137782c4843e0e94e2fb9fe2912ced4", "score": "0.67307585", "text": "function Stack_Oliteral() {\r\n}", "title": "" }, { "docid": "3d5b3cc65677b56f3bd06fa113ce099e", "score": "0.6724563", "text": "function Obj(){ return Literal.apply(this,arguments) }", "title": "" }, { "docid": "babe91138484234670b17d3a10e6f40e", "score": "0.6624594", "text": "function lit(value) { return new TLiteral(value); }", "title": "" }, { "docid": "babe91138484234670b17d3a10e6f40e", "score": "0.6624594", "text": "function lit(value) { return new TLiteral(value); }", "title": "" }, { "docid": "173e3681bede9bd5c08e98eb322c812d", "score": "0.65664583", "text": "function createLiteral(value, type) {\n return '\"' + value + '\"^^' + type;\n }", "title": "" }, { "docid": "fa12701550db98cce773f05b71cb1210", "score": "0.655541", "text": "static initialize(obj) { \n obj['rightToLiteral'] = rightToLiteral;\n }", "title": "" }, { "docid": "b868078b882ac2d15ac883b0789aa9c1", "score": "0.653892", "text": "Literal(value, options = {}) {\r\n return { ...options, kind: exports.LiteralKind, const: value, type: typeof value };\r\n }", "title": "" }, { "docid": "18a78444ca84b007891f7530517f1831", "score": "0.650407", "text": "function If_bound_literal_literal() {\r\n}", "title": "" }, { "docid": "6c54cdbd7cdd205ec15f2560bc6fc562", "score": "0.6449136", "text": "function Symbol(){ return Literal.apply(this,arguments) }", "title": "" }, { "docid": "d5586d620b93d31fcce39b35b01dc8f4", "score": "0.6393289", "text": "function Literal(v){\n\t\tthis._traversed = false;\n\t\tthis._expression = true;\n\t\tthis._cache = null;\n\t\tthis._raw = null;\n\t\tthis._value = v;\n\t}", "title": "" }, { "docid": "d63c75f74077e74f45c9c1f9a1793ed4", "score": "0.6356782", "text": "function Assign_Free_Literal() {\r\n}", "title": "" }, { "docid": "e64ce764afa6d56ffcf4ecbd6b847e98", "score": "0.6350548", "text": "function literals(name, age) {\n return 'Hello ' + name + '. Your age is ' + age + ' years old.';\n}", "title": "" }, { "docid": "aff793b9915d6518c10ee06ebc6ad40b", "score": "0.63349164", "text": "function literal () {\n const result = nOrMore(1, escapedOrRegularLiteral)()\n return result === null ? null : result.join('')\n }", "title": "" }, { "docid": "2f168f77c332c0c438853ba736cc701f", "score": "0.6319353", "text": "_completeLiteral(token) {\n // Create a simple string literal by default\n let literal = this._literal(this._literalValue);\n switch (token.type) {\n // Create a datatyped literal\n case 'type':\n case 'typeIRI':\n const datatype = this._readEntity(token);\n if (datatype === undefined) return; // No datatype means an error occurred\n literal = this._literal(this._literalValue, datatype);\n token = null;\n break;\n // Create a language-tagged string\n case 'langcode':\n literal = this._literal(this._literalValue, token.value);\n token = null;\n break;\n }\n return {\n token,\n literal\n };\n }", "title": "" }, { "docid": "f2a089ef260693fa260e5e9583d73fef", "score": "0.6300398", "text": "function literal(val) {\n Program.call(this);\n this.val = val;\n this.toString = function(){\n if(this.val===true) return \"#t\";\n if(this.val===false) return \"#f\";\n return types.toWrittenString(this.val);\n }\n}", "title": "" }, { "docid": "d8e267a4383729fec5f94670c1efe0b6", "score": "0.62871665", "text": "function Stack_A_Oliteral() {\r\n}", "title": "" }, { "docid": "159f21fdc6547183df43aaaeb306b169", "score": "0.6263174", "text": "function Assign_Lex_Literal() {\r\n}", "title": "" }, { "docid": "d5412f80c077be7e60fd24b0aae9884d", "score": "0.6201993", "text": "function assemble(literal, params) {\n // ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\n return new Function(params, \"return `\"+literal+\"`;\");\n }", "title": "" }, { "docid": "335b4645b0153e9e863b854aee84c715", "score": "0.61944765", "text": "Literal() {\n switch (this._lookahead.type) {\n case 'NUMBER':\n return this.NumericLiteral();\n case 'STRING':\n return this.StringLiteral();\n case 'true':\n return this.BooleanLiteral(true);\n case 'false':\n return this.BooleanLiteral(false);\n case 'null':\n return this.NullLiteral();\n }\n throw new SyntaxError(`Literal: unexpected literal production`);\n }", "title": "" }, { "docid": "ce308812e0cd49bb3fa14a635ef85812", "score": "0.61582637", "text": "function Literal(node) {\n this.push(\"\"); // hack: catch up indentation\n this._push(this._Literal(node));\n}", "title": "" }, { "docid": "99c098f63eeb45f48f7a08719221a478", "score": "0.61509055", "text": "function If_bound_other_literal() {\r\n}", "title": "" }, { "docid": "3007b7928dc9c3caa32f8d46565edab9", "score": "0.6093752", "text": "Literal() {\n switch (this._lookahead.type) {\n case 'NUMBER':\n return this.NumericLiteral()\n case 'STRING':\n return this.StringLiteral()\n }\n throw new SyntaxError('Literal: unexpected literal production')\n }", "title": "" }, { "docid": "5a41af96425abd8916fd208b972c7a1a", "score": "0.60594535", "text": "function Literal(node) {\n\t this.push(\"\"); // hack: catch up indentation\n\t this._push(this._Literal(node));\n\t}", "title": "" }, { "docid": "5a41af96425abd8916fd208b972c7a1a", "score": "0.60594535", "text": "function Literal(node) {\n\t this.push(\"\"); // hack: catch up indentation\n\t this._push(this._Literal(node));\n\t}", "title": "" }, { "docid": "76586c2b5495cd523f66de9fa63a1c4a", "score": "0.6046114", "text": "function Literal(){\n\tthis.value=[];\n\tvar failCnt=0;\n\t\t\n\tthis.create=function(value) {\n\t\treturn new _$optional(value);\n\t}\n\t\n\tthis.get=function(value){\n\t\tif (this.value[value]==undefined) this.value[value]=this.create(value);\n\t\treturn this.value[value];\n\t}\n\t\n\tthis.lookUp=function(value){\n\t\tif (this.value[value]==undefined) {\n\t\t\tif (failCnt<2 && this.value.length<1000) {\n\t\t\t\tthis.value[value]=this.create(value);\n\t\t\t\tfailCnt++;\n\t\t\t} else return this.create(value);\n\t\t} else failCnt=0;\n\t\treturn this.value[value];\n\t}\n}", "title": "" }, { "docid": "01bc8e95c57b7505c6b021de87783453", "score": "0.60357416", "text": "function transformLiteral(lit) {\n if (!lit.datatype) {\n return (lit.language)\n ? new E.LangStringLiteral(lit.value, lit.language)\n : new E.StringLiteral(lit.value);\n }\n switch (lit.datatype.value) {\n case null:\n case undefined:\n case '': {\n return (lit.language)\n ? new E.LangStringLiteral(lit.value, lit.language)\n : new E.StringLiteral(lit.value);\n }\n case Consts_1.TypeURL.XSD_STRING:\n return new E.StringLiteral(lit.value);\n case Consts_1.TypeURL.RDF_LANG_STRING:\n return new E.LangStringLiteral(lit.value, lit.language);\n case Consts_1.TypeURL.XSD_DATE_TIME:\n case Consts_1.TypeURL.XSD_DATE: {\n const val = new Date(lit.value);\n if (isNaN(val.getTime())) {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.DateTimeLiteral(new Date(lit.value), lit.value);\n }\n case Consts_1.TypeURL.XSD_BOOLEAN: {\n if (lit.value !== 'true' && lit.value !== 'false') {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.BooleanLiteral(lit.value === 'true', lit.value);\n }\n case Consts_1.TypeURL.XSD_INTEGER:\n case Consts_1.TypeURL.XSD_DECIMAL:\n case Consts_1.TypeURL.XSD_NEGATIVE_INTEGER:\n case Consts_1.TypeURL.XSD_NON_NEGATIVE_INTEGER:\n case Consts_1.TypeURL.XSD_NON_POSITIVE_INTEGER:\n case Consts_1.TypeURL.XSD_POSITIVE_INTEGER:\n case Consts_1.TypeURL.XSD_LONG:\n case Consts_1.TypeURL.XSD_SHORT:\n case Consts_1.TypeURL.XSD_BYTE:\n case Consts_1.TypeURL.XSD_UNSIGNED_LONG:\n case Consts_1.TypeURL.XSD_UNSIGNED_INT:\n case Consts_1.TypeURL.XSD_UNSIGNED_SHORT:\n case Consts_1.TypeURL.XSD_UNSIGNED_BYTE:\n case Consts_1.TypeURL.XSD_INT: {\n const val = P.parseXSDDecimal(lit.value);\n if (val === undefined) {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.NumericLiteral(val, lit.datatype, lit.value);\n }\n case Consts_1.TypeURL.XSD_FLOAT:\n case Consts_1.TypeURL.XSD_DOUBLE: {\n const val = P.parseXSDFloat(lit.value);\n if (val === undefined) {\n return new E.NonLexicalLiteral(undefined, lit.datatype, lit.value);\n }\n return new E.NumericLiteral(val, lit.datatype, lit.value);\n }\n default: return new E.Literal(lit.value, lit.datatype, lit.value);\n }\n}", "title": "" }, { "docid": "d6b46896f3dd7c1ccaba0909d7c1379a", "score": "0.6015562", "text": "function If_other_other_literal() {\r\n}", "title": "" }, { "docid": "4c749ac8023148f6fc959b345cfe4aa9", "score": "0.5930817", "text": "function TemplateLiteral() {\n\t return t.stringTypeAnnotation();\n\t}", "title": "" }, { "docid": "4c749ac8023148f6fc959b345cfe4aa9", "score": "0.5930817", "text": "function TemplateLiteral() {\n\t return t.stringTypeAnnotation();\n\t}", "title": "" }, { "docid": "cfa7f86e7d700244729e03fd83b33f47", "score": "0.5928596", "text": "function createLiteralTD() {\r\n tabulator.log.msg('creating literalTD for addRow');\r\n var td = thisTable.document.createElement(\"TD\");\r\n td.setAttribute('type', 'lit');\r\n td.innerHTML = '---';\r\n return td;\r\n }", "title": "" }, { "docid": "02b7249eeb9e781ad84d2577eda1b2ec", "score": "0.59111714", "text": "enterLiteral(ctx) {\n\t}", "title": "" }, { "docid": "baa4ad242ce81ade3ba66909a6757e94", "score": "0.5908659", "text": "_encodeLiteral(literal) {\n // Escape special characters\n let value = literal.value;\n if (escape.test(value)) value = value.replace(escapeAll, characterReplacer);\n\n // Write a language-tagged literal\n if (literal.language) return `\"${value}\"@${literal.language}`;\n\n // Write dedicated literals per data type\n if (this._lineMode) {\n // Only abbreviate strings in N-Triples or N-Quads\n if (literal.datatype.value === xsd.string) return `\"${value}\"`;\n } else {\n // Use common datatype abbreviations in Turtle or TriG\n switch (literal.datatype.value) {\n case xsd.string:\n return `\"${value}\"`;\n case xsd.boolean:\n if (value === 'true' || value === 'false') return value;\n break;\n case xsd.integer:\n if (/^[+-]?\\d+$/.test(value)) return value;\n break;\n case xsd.decimal:\n if (/^[+-]?\\d*\\.\\d+$/.test(value)) return value;\n break;\n case xsd.double:\n if (/^[+-]?(?:\\d+\\.\\d*|\\.?\\d+)[eE][+-]?\\d+$/.test(value)) return value;\n break;\n }\n }\n\n // Write a regular datatyped literal\n return `\"${value}\"^^${this._encodeIriOrBlank(literal.datatype)}`;\n }", "title": "" }, { "docid": "fd40e4edb9fcddbd9fcfed9c13c2e8be", "score": "0.58784515", "text": "function TemplateLiteral() {\n return t.stringTypeAnnotation();\n}", "title": "" }, { "docid": "b95c8f17959c540107b47d05279bcfd6", "score": "0.5864775", "text": "get termType() {\n return 'Literal';\n }", "title": "" }, { "docid": "b95c8f17959c540107b47d05279bcfd6", "score": "0.5864775", "text": "get termType() {\n return 'Literal';\n }", "title": "" }, { "docid": "9aab4580b254c5594ab1ecb76578247b", "score": "0.58589786", "text": "function createTypedLiteral(value, type) {\n if (type && type.termType !== 'NamedNode'){\n type = Parser.factory.namedNode(type);\n }\n return Parser.factory.literal(value, type);\n }", "title": "" }, { "docid": "149ca1747c662750fb4c225b2d7af61d", "score": "0.5858716", "text": "function lit(val) {\n if (isStr) val = \"\\\"\" + val.replace(/\"/g, \"\\\\\\\"\") +\"\\\"\";\n return val;\n }", "title": "" }, { "docid": "57a611b9346bcdf710049317ac506832", "score": "0.5845267", "text": "_encodeLiteral(literal) {\n // Escape special characters\n var value = literal.value;\n if (escape.test(value)) value = value.replace(escapeAll, characterReplacer); // Write the literal, possibly with type or language\n\n if (literal.language) return '\"' + value + '\"@' + literal.language;else if (literal.datatype.value !== xsd.string) return '\"' + value + '\"^^' + this._encodeIriOrBlank(literal.datatype);else return '\"' + value + '\"';\n }", "title": "" }, { "docid": "af268215fa0b3ff6153f8ae72588f3f0", "score": "0.58393127", "text": "function If_bound_bound_literal() {\r\n}", "title": "" }, { "docid": "473fee3a5050b6c9786a319408639109", "score": "0.5837793", "text": "function Arr(){ return Literal.apply(this,arguments) }", "title": "" }, { "docid": "4afc3bcc52749f7537bdb2680e3853e0", "score": "0.58258873", "text": "static typeLiteral(value) {\n if (typeof value === 'string') {\n return TypeNames.anyType(`'${value}'`);\n }\n else {\n return TypeNames.anyType(`${value}`);\n }\n }", "title": "" }, { "docid": "5699418ed01a96a3d89f051c3868c9b0", "score": "0.579892", "text": "function Student(){\r\nreturn {}; //this is a literal\r\n}", "title": "" }, { "docid": "3440d4725e725327a0815462b6fe80e7", "score": "0.57868516", "text": "function Expr() {}", "title": "" }, { "docid": "65bf475fd2a4e5e7cf8bd4c5795a3e7c", "score": "0.5762688", "text": "parseLiteral() {\n if (this.currentToken === SyntaxKind.StringLiteral) {\n const literal = new types.StringLiteral(this.lexer.getTokenValue())\n this.nextToken()\n return literal\n } else if (this.currentToken === SyntaxKind.NumericLiteral) {\n const literal = new types.NumberLiteral(this.lexer.getTokenValue())\n this.nextToken()\n return literal\n } else {\n throw new Error('Syntax error')\n }\n }", "title": "" }, { "docid": "7209f0684754115bfa40cf57220e6d8b", "score": "0.57387894", "text": "function createObjectLiteral(name, batch, hobbies) {\n\n}", "title": "" }, { "docid": "c44031747a98172289696c336068dfd6", "score": "0.571283", "text": "function endLit() {\n res.push({\n type: 'literal',\n value: lit\n });\n lit = '';\n }", "title": "" }, { "docid": "c44031747a98172289696c336068dfd6", "score": "0.571283", "text": "function endLit() {\n res.push({\n type: 'literal',\n value: lit\n });\n lit = '';\n }", "title": "" }, { "docid": "39d7ed11e3085c907a9c5f5a6c33ee22", "score": "0.5703304", "text": "function Literal(node) {\n var value = node.value;\n if (typeof value === \"string\") return t.stringTypeAnnotation();\n if (typeof value === \"number\") return t.numberTypeAnnotation();\n if (typeof value === \"boolean\") return t.booleanTypeAnnotation();\n if (value === null) return t.voidTypeAnnotation();\n if (node.regex) return t.genericTypeAnnotation(t.identifier(\"RegExp\"));\n}", "title": "" }, { "docid": "cc19479698476cfa8620cf0dc310bb33", "score": "0.56840384", "text": "function Literal(node) {\n\t var value = node.value;\n\t if (typeof value === \"string\") return t.stringTypeAnnotation();\n\t if (typeof value === \"number\") return t.numberTypeAnnotation();\n\t if (typeof value === \"boolean\") return t.booleanTypeAnnotation();\n\t if (value === null) return t.voidTypeAnnotation();\n\t if (node.regex) return t.genericTypeAnnotation(t.identifier(\"RegExp\"));\n\t}", "title": "" }, { "docid": "cc19479698476cfa8620cf0dc310bb33", "score": "0.56840384", "text": "function Literal(node) {\n\t var value = node.value;\n\t if (typeof value === \"string\") return t.stringTypeAnnotation();\n\t if (typeof value === \"number\") return t.numberTypeAnnotation();\n\t if (typeof value === \"boolean\") return t.booleanTypeAnnotation();\n\t if (value === null) return t.voidTypeAnnotation();\n\t if (node.regex) return t.genericTypeAnnotation(t.identifier(\"RegExp\"));\n\t}", "title": "" }, { "docid": "2fa2da7ac521d51c56c8f07b299b2424", "score": "0.5679405", "text": "function createLangLiteral(value, lang) {\n return Parser.factory.literal(value, lang);\n }", "title": "" }, { "docid": "81bffe112c47ad27f7412c4590252afd", "score": "0.5672701", "text": "function tokenLiteral(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n\tif (ch == quote && !escaped) {\n\t state.tokenize = tokenBase;\n\t break;\n\t}\n\tescaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "20736525abc27559e345d84e40205e5a", "score": "0.56698084", "text": "function stringsLiteral(){\n const x = \"todos\";\n const y = \"clase\";\n console.log(`Hola a ${x} los de la ${y}`);\n}", "title": "" }, { "docid": "8a301bea44fb4a452d2e229b6e08d62d", "score": "0.5661693", "text": "function formatLiteral(type) {\n return function(literal) { return type + '\"' + literal + '\"'; }\n}", "title": "" }, { "docid": "902b5897188b1b87cb40dd1ca061bd0a", "score": "0.5646694", "text": "literalToken() {\r\n\t\t\t\tvar match, message, origin, prev, ref, ref1, ref2, ref3, ref4, ref5, skipToken, tag, token, value;\r\n\t\t\t\tif (match = OPERATOR.exec(this.chunk)) {\r\n\t\t\t\t\t[value] = match;\r\n\t\t\t\t\tif (CODE.test(value)) {\r\n\t\t\t\t\t\tthis.tagParameters();\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvalue = this.chunk.charAt(0);\r\n\t\t\t\t}\r\n\t\t\t\ttag = value;\r\n\t\t\t\tprev = this.prev();\r\n\t\t\t\tif (prev && indexOf.call(['=', ...COMPOUND_ASSIGN], value) >= 0) {\r\n\t\t\t\t\tskipToken = false;\r\n\t\t\t\t\tif (value === '=' && ((ref = prev[1]) === '||' || ref === '&&') && !prev.spaced) {\r\n\t\t\t\t\t\tprev[0] = 'COMPOUND_ASSIGN';\r\n\t\t\t\t\t\tprev[1] += '=';\r\n\t\t\t\t\t\tif ((ref1 = prev.data) != null ? ref1.original : void 0) {\r\n\t\t\t\t\t\t\tprev.data.original += '=';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tprev[2].range = [prev[2].range[0], prev[2].range[1] + 1];\r\n\t\t\t\t\t\tprev[2].last_column += 1;\r\n\t\t\t\t\t\tprev[2].last_column_exclusive += 1;\r\n\t\t\t\t\t\tprev = this.tokens[this.tokens.length - 2];\r\n\t\t\t\t\t\tskipToken = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (prev && prev[0] !== 'PROPERTY') {\r\n\t\t\t\t\t\torigin = (ref2 = prev.origin) != null ? ref2 : prev;\r\n\t\t\t\t\t\tmessage = isUnassignable(prev[1], origin[1]);\r\n\t\t\t\t\t\tif (message) {\r\n\t\t\t\t\t\t\tthis.error(message, origin[2]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (skipToken) {\r\n\t\t\t\t\t\treturn value.length;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (value === '(' && (prev != null ? prev[0] : void 0) === 'IMPORT') {\r\n\t\t\t\t\tprev[0] = 'DYNAMIC_IMPORT';\r\n\t\t\t\t}\r\n\t\t\t\tif (value === '{' && this.seenImport) {\r\n\t\t\t\t\tthis.importSpecifierList = true;\r\n\t\t\t\t} else if (this.importSpecifierList && value === '}') {\r\n\t\t\t\t\tthis.importSpecifierList = false;\r\n\t\t\t\t} else if (value === '{' && (prev != null ? prev[0] : void 0) === 'EXPORT') {\r\n\t\t\t\t\tthis.exportSpecifierList = true;\r\n\t\t\t\t} else if (this.exportSpecifierList && value === '}') {\r\n\t\t\t\t\tthis.exportSpecifierList = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (value === ';') {\r\n\t\t\t\t\tif (ref3 = prev != null ? prev[0] : void 0, indexOf.call(['=', ...UNFINISHED], ref3) >= 0) {\r\n\t\t\t\t\t\tthis.error('unexpected ;');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.seenFor = this.seenImport = this.seenExport = false;\r\n\t\t\t\t\ttag = 'TERMINATOR';\r\n\t\t\t\t} else if (value === '*' && (prev != null ? prev[0] : void 0) === 'EXPORT') {\r\n\t\t\t\t\ttag = 'EXPORT_ALL';\r\n\t\t\t\t} else if (indexOf.call(MATH, value) >= 0) {\r\n\t\t\t\t\ttag = 'MATH';\r\n\t\t\t\t} else if (indexOf.call(COMPARE, value) >= 0) {\r\n\t\t\t\t\ttag = 'COMPARE';\r\n\t\t\t\t} else if (indexOf.call(COMPOUND_ASSIGN, value) >= 0) {\r\n\t\t\t\t\ttag = 'COMPOUND_ASSIGN';\r\n\t\t\t\t} else if (indexOf.call(UNARY, value) >= 0) {\r\n\t\t\t\t\ttag = 'UNARY';\r\n\t\t\t\t} else if (indexOf.call(UNARY_MATH, value) >= 0) {\r\n\t\t\t\t\ttag = 'UNARY_MATH';\r\n\t\t\t\t} else if (indexOf.call(SHIFT, value) >= 0) {\r\n\t\t\t\t\ttag = 'SHIFT';\r\n\t\t\t\t} else if (value === '?' && (prev != null ? prev.spaced : void 0)) {\r\n\t\t\t\t\ttag = 'BIN?';\r\n\t\t\t\t} else if (prev) {\r\n\t\t\t\t\tif (value === '(' && !prev.spaced && (ref4 = prev[0], indexOf.call(CALLABLE, ref4) >= 0)) {\r\n\t\t\t\t\t\tif (prev[0] === '?') {\r\n\t\t\t\t\t\t\tprev[0] = 'FUNC_EXIST';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttag = 'CALL_START';\r\n\t\t\t\t\t} else if (value === '[' && (((ref5 = prev[0], indexOf.call(INDEXABLE, ref5) >= 0) && !prev.spaced) || (prev[0] === '::'))) { // `.prototype` can’t be a method you can call.\r\n\t\t\t\t\t\ttag = 'INDEX_START';\r\n\t\t\t\t\t\tswitch (prev[0]) {\r\n\t\t\t\t\t\t\tcase '?':\r\n\t\t\t\t\t\t\t\tprev[0] = 'INDEX_SOAK';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttoken = this.makeToken(tag, value);\r\n\t\t\t\tswitch (value) {\r\n\t\t\t\t\tcase '(':\r\n\t\t\t\t\tcase '{':\r\n\t\t\t\t\tcase '[':\r\n\t\t\t\t\t\tthis.ends.push({\r\n\t\t\t\t\t\t\ttag: INVERSES[value],\r\n\t\t\t\t\t\t\torigin: token\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase ')':\r\n\t\t\t\t\tcase '}':\r\n\t\t\t\t\tcase ']':\r\n\t\t\t\t\t\tthis.pair(value);\r\n\t\t\t\t}\r\n\t\t\t\tthis.tokens.push(this.makeToken(tag, value));\r\n\t\t\t\treturn value.length;\r\n\t\t\t}", "title": "" }, { "docid": "6c1c6a44daf631e651c027fa50638fe1", "score": "0.5637683", "text": "function tokenLiteral (quote) {\n return function (stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "53657ee282614fc8814dba525fd1d939", "score": "0.5626905", "text": "_isLiteral(tokenType) {\n return tokenType === 'NUMBER' ||\n tokenType === 'STRING' ||\n tokenType === 'true' ||\n tokenType === 'false' ||\n tokenType === 'null';\n }", "title": "" }, { "docid": "f57cd2e1ce52f334f74a13b2a77cd5ae", "score": "0.5621667", "text": "set Raw(value) {}", "title": "" }, { "docid": "d09c83ad44134edc02c3f7c1528d1984", "score": "0.5603344", "text": "function parseLiteral(list){\n var tkn=list.next()\n if(tkn.type==TokenType.INTEGER || tkn.type==TokenType.FLOAT || tkn.type==TokenType.STRING){\n return new Expression(ExpressionType.VALUE,tkn);\n }\n if(tkn.type==TokenType.IDENTIFIER ){\n if(tkn.data===\"true\" || tkn.data===\"false\")return new Expression(ExpressionType.VALUE,tkn);\n }\n list.returnToken()\n return null\n}", "title": "" }, { "docid": "d6fb77c2f2aa4a617120385a9b8ac0e1", "score": "0.56012475", "text": "function tokenLiteral(quote) {\n return function (stream, state) {\n var escaped = false,\n ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "7cbbbbb18121eaf88fb000fc632ebb3b", "score": "0.5566578", "text": "getLiteralValue() {\r\n return this.compilerNode.text;\r\n }", "title": "" }, { "docid": "7c854d706f75efedba4c413c09a0681b", "score": "0.5549451", "text": "function createCircleWithLiteralNotation() {\n\tvar myCircle = {\n\t\tradius : 10,\n\t\t_pi : 3.141,\n\t\tdiameter : function() {\n\t\t\tvar result= 2 * this.radius;\n\t\t\treturn result;\n\t\t},\n\t\tcircumference : function() {\n\t\t\tvar result= 2 * this._pi * this.radius;\n\t\t\treturn result;\n\t\t},\n\t\tarea : function() {\n\t\t\tvar result= this._pi * this.radius * this.radius;\n\t\t\treturn result;\n\t\t}\n\t}\n\talert(myCircle.diameter());\n\talert(myCircle.circumference());\n\talert(myCircle.area());\n}", "title": "" }, { "docid": "3bf4ce8399b0b5bbd0a2b8dee058c963", "score": "0.55492467", "text": "function tokenLiteral(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "3bf4ce8399b0b5bbd0a2b8dee058c963", "score": "0.55492467", "text": "function tokenLiteral(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "3bf4ce8399b0b5bbd0a2b8dee058c963", "score": "0.55492467", "text": "function tokenLiteral(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "3bf4ce8399b0b5bbd0a2b8dee058c963", "score": "0.55492467", "text": "function tokenLiteral(quote) {\n return function(stream, state) {\n var escaped = false, ch;\n while ((ch = stream.next()) != null) {\n if (ch == quote && !escaped) {\n state.tokenize = tokenBase;\n break;\n }\n escaped = !escaped && ch == \"\\\\\";\n }\n return \"string\";\n };\n }", "title": "" }, { "docid": "62b6b690e49fb4518cfca25108ac610c", "score": "0.5536707", "text": "function isLiteral(term) {\n return !!term && term.termType === 'Literal';\n}", "title": "" }, { "docid": "8e61228140d4682987defb1fbf56c824", "score": "0.5527745", "text": "function literalize(which) {\n\tmyField = document.getElementById(which);\n\tvar selectedText = '';\n\tif (document.selection) {\n\t\tmyField.focus();\n\t\tvar sel = document.selection.createRange();\n\t\tif (sel.text.length > 0) {\n\t\t\tselectedText = sel.text;\n\t\t}\n\t}\n\telse if (myField.selectionStart || myField.selectionStart == '0') {\n\t\tvar startPos = myField.selectionStart;\n\t\tvar endPos = myField.selectionEnd;\n\t\tif (startPos != endPos) {\n\t\t\tselectedText = myField.value.substring(startPos, endPos);\n\t\t}\n\t}\n\tvar i = 0;\n\tvar literalizedStr = '';\n\tfor (i=0; i<selectedText.length; i++) {\n\t\tif (selectedText.substr(i,1) == '&') {\n\t\t\tliteralizedStr = literalizedStr + '&amp;';\n\t\t} else if (selectedText.substr(i,1) == '<') {\n\t\t\tliteralizedStr = literalizedStr + '&lt;';\n\t\t} else if (selectedText.substr(i,1) == '>') {\n\t\t\tliteralizedStr = literalizedStr + '&gt;';\n\t\t} else if (selectedText.substr(i,1) == '[') {\n\t\t\tliteralizedStr = literalizedStr + '&#91;';\n\t\t} else if (selectedText.substr(i,1) == ']') {\n\t\t\tliteralizedStr = literalizedStr + '&#93;';\n\t\t} else {\n\t\t\tliteralizedStr = literalizedStr + selectedText.substr(i,1);\n\t\t}\n\t}\n\tedInsertContent(which,literalizedStr);\n}", "title": "" }, { "docid": "ff661998aa5db2659b24da7cef1eabcb", "score": "0.5491113", "text": "function Const(){ return Identifier.apply(this,arguments) }", "title": "" }, { "docid": "c16f467404af01f4a25b35ac9ee80d1c", "score": "0.546534", "text": "function insertLiterals(literals){\n let contact = `<li>name: ${inputn} <br> phone: ${inputp} <br> email: ${inpute}</li>`;\n return contact\n}", "title": "" }, { "docid": "d0c03fc635931023f523c5eb9df1e9e9", "score": "0.54486656", "text": "function literalWithoutBar () {\n\t\t\t\tvar result = nOrMore( 1, escapedOrLiteralWithoutBar )();\n\n\t\t\t\treturn result === null ? null : result.join( '' );\n\t\t\t}", "title": "" }, { "docid": "de0ae969cf09a23485bf7b81dbc9a006", "score": "0.5447263", "text": "function constructStatement(){\n\n }", "title": "" }, { "docid": "ca721aaae1e3ccae06529421f2398f39", "score": "0.54233855", "text": "function QuasiQuotation() {\r\n}", "title": "" }, { "docid": "cab33d02ced4d59bfddc4760cba454ff", "score": "0.5418717", "text": "static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }", "title": "" }, { "docid": "cab33d02ced4d59bfddc4760cba454ff", "score": "0.5418717", "text": "static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }", "title": "" }, { "docid": "cab33d02ced4d59bfddc4760cba454ff", "score": "0.5418717", "text": "static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }", "title": "" }, { "docid": "cab33d02ced4d59bfddc4760cba454ff", "score": "0.5418717", "text": "static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }", "title": "" }, { "docid": "cab33d02ced4d59bfddc4760cba454ff", "score": "0.5418717", "text": "static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }", "title": "" }, { "docid": "cab33d02ced4d59bfddc4760cba454ff", "score": "0.5418717", "text": "static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }", "title": "" }, { "docid": "d69a7321a55b087188dbd912c14a04b0", "score": "0.54162574", "text": "function TemplateLiteral(node, print) {\n\t this.push(\"`\");\n\n\t var quasis = node.quasis;\n\t var len = quasis.length;\n\n\t for (var i = 0; i < len; i++) {\n\t print.plain(quasis[i]);\n\n\t if (i + 1 < len) {\n\t this.push(\"${ \");\n\t print.plain(node.expressions[i]);\n\t this.push(\" }\");\n\t }\n\t }\n\n\t this._push(\"`\");\n\t}", "title": "" }, { "docid": "d69a7321a55b087188dbd912c14a04b0", "score": "0.54162574", "text": "function TemplateLiteral(node, print) {\n\t this.push(\"`\");\n\n\t var quasis = node.quasis;\n\t var len = quasis.length;\n\n\t for (var i = 0; i < len; i++) {\n\t print.plain(quasis[i]);\n\n\t if (i + 1 < len) {\n\t this.push(\"${ \");\n\t print.plain(node.expressions[i]);\n\t this.push(\" }\");\n\t }\n\t }\n\n\t this._push(\"`\");\n\t}", "title": "" }, { "docid": "e0b8380f08274fe3dbd572dcc7d09303", "score": "0.5413475", "text": "function literalWithoutSpace () {\n const result = nOrMore(1, escapedOrLiteralWithoutSpace)()\n return result === null ? null : result.join('')\n }", "title": "" }, { "docid": "204e06798849a88d84d90458bcf62ce1", "score": "0.53749704", "text": "function stringLiteralNode(def) {\n return {\n type: 'StringLiteral',\n value: def['Source String'],\n };\n}", "title": "" }, { "docid": "67014ffed39d081f2242f065f4233ee6", "score": "0.53741187", "text": "function funname() {} //literals", "title": "" }, { "docid": "c12eea19d69bef67b82a621e15437e84", "score": "0.53669804", "text": "function ae(t) {\n return {\n integerValue: \"\" + t\n };\n}", "title": "" }, { "docid": "c1c61fce8225109fe36ea068018cde32", "score": "0.5363668", "text": "function toLiteralString(value) {\n return typeof value === 'string' ? `\"${value.replace(/\"/g, '\"')}\"` : `${value}`;\n}", "title": "" }, { "docid": "c1c61fce8225109fe36ea068018cde32", "score": "0.5363668", "text": "function toLiteralString(value) {\n return typeof value === 'string' ? `\"${value.replace(/\"/g, '\"')}\"` : `${value}`;\n}", "title": "" }, { "docid": "319aa9b2ce278b9951f951ed5d255e05", "score": "0.53568983", "text": "NullLiteral() {\n this._eat('null');\n return {\n type: 'NullLiteral',\n value: null,\n };\n }", "title": "" }, { "docid": "d5f449537390ec4ccd0147b8c388f486", "score": "0.53448796", "text": "function buildLiteralString(s) {\n return \"'\" + s.replace(/(['\\\\])/g, \"\\\\$1\") + \"'\";\n }", "title": "" }, { "docid": "9e38ae20cecd1e8d1587fe4adff9ee2c", "score": "0.5340852", "text": "function literalRC (row, col) {\r\n var t = thisTable.document.getElementById('tabulated_data'); \r\n var tdNode = t.childNodes[row].childNodes[col];\r\n if (tdNode.getAttribute('type') =='lit') return true;\r\n }", "title": "" }, { "docid": "100fc8dc3d656197d2127c3224c10a00", "score": "0.53328407", "text": "function PureExpressionData() {}", "title": "" }, { "docid": "100fc8dc3d656197d2127c3224c10a00", "score": "0.53328407", "text": "function PureExpressionData() {}", "title": "" }, { "docid": "100fc8dc3d656197d2127c3224c10a00", "score": "0.53328407", "text": "function PureExpressionData() {}", "title": "" }, { "docid": "4b9c0f2d729a46306304c02e2bee6270", "score": "0.5329916", "text": "function Unquote() {\r\n}", "title": "" } ]
91f44052da4f79b2768abbdc7416d5b6
Try to parse input as a time stamp.
[ { "docid": "c7e481d9ec77ba9a181b9e790fe881c7", "score": "0.7332546", "text": "function parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n }", "title": "" } ]
[ { "docid": "05f81c9e8e7cdfa8e5a325e7a3b769dd", "score": "0.74135697", "text": "function parseTimeStamp(input) {\n\n\t function computeSeconds(h, m, s, f) {\n\t return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n\t }\n\n\t var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n\t if (!m) {\n\t return null;\n\t }\n\n\t if (m[3]) {\n\t // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n\t return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n\t } else if (m[1] > 59) {\n\t // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n\t // First position is hours as it's over 59.\n\t return computeSeconds(m[1], m[2], 0, m[4]);\n\t } else {\n\t // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n\t return computeSeconds(0, m[1], m[2], m[4]);\n\t }\n\t }", "title": "" }, { "docid": "ef511b592f4e44e921edb89bfd958e0e", "score": "0.7287743", "text": "function parseTimeStamp(input){function computeSeconds(h,m,s,f){return(h|0)*3600+(m|0)*60+(s|0)+parseFloat(f||0);}var m=input.match(/^(?:(\\d+):)?(\\d{2}):(\\d{2})(\\.\\d+)?/);if(!m){return null;}if(parseFloat(m[2])>59){// Timestamp takes the form of [hours]:[minutes].[milliseconds]\n// First position is hours as it's over 59.\nreturn computeSeconds(m[2],m[3],0,m[4]);}// Timestamp takes the form of [hours (optional)]:[minutes]:[seconds].[milliseconds]\nreturn computeSeconds(m[1],m[2],m[3],m[4]);}// A settings object holds key/value pairs and will ignore anything but the first", "title": "" }, { "docid": "a38257e734e702c51b2b67c4f0e75538", "score": "0.7241569", "text": "function parseTimeStamp(input) {\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n } // A settings object holds key/value pairs and will ignore anything but the first", "title": "" }, { "docid": "1c06d80c7939038d914bc08e74199e06", "score": "0.72205806", "text": "function parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}", "title": "" }, { "docid": "87aeb40de79c010e4944aa3127128c95", "score": "0.721569", "text": "function parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}", "title": "" }, { "docid": "87aeb40de79c010e4944aa3127128c95", "score": "0.721569", "text": "function parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}", "title": "" }, { "docid": "87aeb40de79c010e4944aa3127128c95", "score": "0.721569", "text": "function parseTimeStamp(input) {\n\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(\":\", \"\"), m[4]);\n } else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n } else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}", "title": "" }, { "docid": "6d7b8975d0fe407811a321d40a0a58bd", "score": "0.7199651", "text": "function parseTimeStamp(input) {\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + (f | 0) / 1000;\n }\n var m = input.match(/^(\\d+):(\\d{2})(:\\d{2})?\\.(\\d{3})/);\n if (!m) {\n return null;\n }\n if (m[3]) {\n // Timestamp takes the form of [hours]:[minutes]:[seconds].[milliseconds]\n return computeSeconds(m[1], m[2], m[3].replace(':', ''), m[4]);\n }\n else if (m[1] > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[1], m[2], 0, m[4]);\n }\n else {\n // Timestamp takes the form of [minutes]:[seconds].[milliseconds]\n return computeSeconds(0, m[1], m[2], m[4]);\n }\n}", "title": "" }, { "docid": "135368ddd9a163f9a87d6d7099130c61", "score": "0.71685797", "text": "function parseTimeStamp(input) {\n function computeSeconds(h, m, s, f) {\n return (h | 0) * 3600 + (m | 0) * 60 + (s | 0) + parseFloat(f || 0);\n }\n\n var m = input.match(/^(?:(\\d+):)?(\\d{2}):(\\d{2})(\\.\\d+)?/);\n\n if (!m) {\n return null;\n }\n\n if (parseFloat(m[2]) > 59) {\n // Timestamp takes the form of [hours]:[minutes].[milliseconds]\n // First position is hours as it's over 59.\n return computeSeconds(m[2], m[3], 0, m[4]);\n } // Timestamp takes the form of [hours (optional)]:[minutes]:[seconds].[milliseconds]\n\n\n return computeSeconds(m[1], m[2], m[3], m[4]);\n} // A settings object holds key/value pairs and will ignore anything but the first", "title": "" }, { "docid": "e9a30323fa92bbd94d877850c691b816", "score": "0.6314867", "text": "function is_tmstmp(input){\n var re = /^\\d{10}$/;\n console.log(re.test(input)+' tesing TIMESTAMP');\n return re.test(input);\n}", "title": "" }, { "docid": "c4e3ef14f81f92d3ed390e70618f8f93", "score": "0.6252012", "text": "function parseTime(time) {\r\n if (time.length == 4) {\r\n // 24 hr time\r\n for (i = 0; i < 4; i++) {\r\n if (i == 0) {\r\n if (time[i] < '0' || time[i] > '2') throw new Error('Invalid time input. Error in 1st number. Try again.');\r\n }\r\n if (i == 1) {\r\n if (time[0] == 0 || time[0] == 1) {\r\n if (time[i] < '0' || time[i] > '9') throw new Error('Invalid time input. Error in 2nd number. Try again.');\r\n }\r\n if (time[0] == 2) {\r\n if (time[i] < '0' || time[i] > '3') throw new Error('Invalid time input. Error in 2nd number. Try again.');\r\n }\r\n }\r\n if (i == 2) {\r\n if (time[i] < '0' || time[i] > '5') throw new Error('Invalid time input. Error in 3rd number. Try again.');\r\n }\r\n if (i == 3) {\r\n if (time[i] < '0' || time[i] > '9') throw new Error('Invalid time input. Error in 4th number. Try again.');\r\n }\r\n }\r\n return parseInt(time);\r\n } else if (time.length == 8 || time.length == 7) {\r\n // 12 hr time\r\n const hour = parseInt(time);\r\n if (hour < 0 || hour > 12) throw new Error('Invalid time input. Error in hours. Try again.');\r\n const colonIndex = time.indexOf(':');\r\n const temp = time.substr(colonIndex + 1);\r\n const minute = parseInt(temp);\r\n if (minute < 0 || minute > 59) throw new Error('Invalid time input. Error in minutes. Try again.');\r\n const ampm = time[time.length - 2];\r\n if (ampm != 'a' && ampm != 'A' && ampm != 'p' && ampm != 'P') throw new Error('Invalid time input. AM/PM in wrong location. Try again.');\r\n if (ampm == 'a' || ampm == 'A') {\r\n if (hour == 12) {\r\n return minute;\r\n } else {\r\n return hour * 100 + minute;\r\n }\r\n } else {\r\n if (hour == 12) {\r\n return hour * 100 + minute;\r\n } else {\r\n return (hour + 12) * 100 + minute;\r\n }\r\n }\r\n } else {\r\n throw new Error('Invalid time input. Incorrect number of characters. Try again.');\r\n }\r\n}", "title": "" }, { "docid": "4e33d89ea2e4eeb5370d0ac5d627a5d0", "score": "0.6211865", "text": "function tryParse(val, len, format) {\n var isValid = typeof val === 'string'\n && val.length === len \n && d3.time.format(format).parse(val);\n return isValid ? d3.time.format(format).parse(val) : false;\n }", "title": "" }, { "docid": "cf11e17c99580f14348f33a0e24aacd0", "score": "0.6202583", "text": "function _getDateTs(str, fmt) { \n var d;\n d = new Date(str).getTime();\n if (!isNaN(d)) {\n return d;\n }\n str = str.replace(/-/g, ' '); //1 Jan 2010 works but 1-Jan-2010 doesn't\n d = new Date(str).getTime();\n if (!isNaN(d)) {\n return d;\n }\n // may be what we've is a time stamp. \n if((d = parseInt(str)) > 100000) { \n // we are not handling something that's up on 1st Jan 1971, as yet.\n // assume it is a valid time stamp and just send it back.\n return d;this\n } \n }", "title": "" }, { "docid": "d7eb75bc1eacfe1939736c906f702517", "score": "0.59573317", "text": "function checkTime(inputTime){\n\tvar parseText = inputTime.split(\" \");\n\treturn new Date(parseInt(parseText[2]), changeMonth(parseText[0]), parseInt(parseText[1]));\n}", "title": "" }, { "docid": "73491d50a226c79eb4cfaf8f9846d1fb", "score": "0.5956635", "text": "function parse_time(str, now_ts) {\n\tvar m = /^([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2}))?(?:\\.[0-9]*)?$/.exec(str);\n\tvar now = new Date(now_ts);\n\tif (m) {\n\t\tnow.setMilliseconds(0);\n\t\tnow.setSeconds(m[3] ? parseInt(m[3]) : 0);\n\t\tnow.setMinutes(parseInt(m[2]));\n\t\tnow.setHours(parseInt(m[1]));\n\t\treturn now.getTime();\n\t}\n}", "title": "" }, { "docid": "990c5515eebdde2a27a4a2c618a3d3bc", "score": "0.58803713", "text": "function parseTimestamp() {\n var editor = vscode.window.activeTextEditor;\n if (!editor) {\n vscode.window.showErrorMessage(\"Only work in active editor!\");\n return; // No open text editor\n }\n var selection = editor.selection;\n var text = editor.document.getText(selection);\n var ts = new Date(text);\n editor.edit(editorBuilder => {\n editorBuilder.replace(selection, \"\" + parseInt(ts.getTime() / 1000));\n vscode.window.showInformationMessage(\"Base64 Decode Succeed!\");\n });\n}", "title": "" }, { "docid": "d96ef514743268e5eb57897ed7dff5e8", "score": "0.5849614", "text": "function parseTimeStamp(time){\n\tvar elems = time.split(/,|:|-/),\n\t d = new Date(elems[0], elems[1], elems[2], elems[3], elems[4], elems[5]); // Date(month, day, year, hour, minutes, seconds);\n\treturn (d.getTime()); \n}", "title": "" }, { "docid": "fb567a189405362df1082f9f53625f86", "score": "0.58191484", "text": "function parseDateWithSpecFormat(dateTimeStr) {\n\tvar parts = dateTimeStr.split(' '),\n\t\tdateParts = parts[0].split(':'),\n\t\ttimeParts = parts[1].split(':');\n\n\tvar timestamp = parseDateTimeParts(dateParts, timeParts);\n\n\tif(typeof timestamp === 'number' && !isNaN(timestamp)) {\n\t\treturn timestamp;\n\t}\n}", "title": "" }, { "docid": "fdd66ba0ea0182714ec73fee925500ee", "score": "0.5817661", "text": "function checkValidTimestamp (timestamp) {\n\n let t = timestamp;\n if (t == undefined) {\n throw new CustomError(`millis is undefined`, `apierror`);\n }\n\n if (typeof t !== 'number') {\n t = parseInt(t, 10);\n }\n\n // check if rev is a number\n if (isNaN(t)) {\n throw new CustomError(`millis (${timestamp}) is not a number`, `apierror`);\n }\n\n // ensure this is not a negative number\n if (t < 0) {\n throw new CustomError(`millis (${timestamp}) is a negative number`, `apierror`);\n }\n\n // ensure this is not a float value\n if (!Number.isInteger(t)) {\n throw new CustomError(`millis (${timestamp}) is not an int value`, `apierror`);\n }\n return t;\n\n }", "title": "" }, { "docid": "144f1ac936741442062722716da4e7f4", "score": "0.5804224", "text": "function parseTime(input) {\n let date = new Date(parseInt(input));\n let meridiem = 'am';\n let hours = date.getHours();\n let minutes = date.getMinutes();\n if (hours === 12) {\n meridiem = 'pm';\n } else if (hours > 12) {\n meridiem = 'pm';\n hours -= 12;\n }\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n return hours + \":\" + minutes + \" \" + meridiem;\n}", "title": "" }, { "docid": "00000e4860407827bee065bae3d677b8", "score": "0.58005804", "text": "parseTime (time) {\n time = time.toString();\n if (time.length < 2) {\n return `0${time}`;\n }\n return time;\n }", "title": "" }, { "docid": "0a58968914ddb310904556a4712f2207", "score": "0.57721776", "text": "function parseTime(str){\r\n\t\ttorYear = null;\r\n\t\ttorMonth = null;\r\n\t\ttorDate = null;\r\n\t\ttorHour = null;\r\n\t\ttorMinute = null;\r\n\t\tdispTime = true;\r\n\r\n\t\tif(str.indexOf('Today') > -1) {\r\n\t\t// Format is in 'Today hh:mm'\r\n\t\t\ttorYear = tpbTodayYear;\r\n\t\t\ttorMonth = tpbTodayMonth;\r\n\t\t\ttorDate = tpbTodayDay;\r\n\t\t\ttorHour = str.slice(11,13);\r\n\t\t\ttorMinute = str.slice(14,16);\r\n\t\t}\r\n\t\t\r\n\t\telse if(str.indexOf('Y-day') > -1){\r\n\t\t// Format is in 'Y-day hh:mm'\r\n\t\t\ttorYear = tpbYdayYear;\r\n\t\t\ttorMonth = tpbYdayMonth;\r\n\t\t\ttorDate = tpbYdayDay;\r\n\t\t\ttorHour = str.slice(11,13);\r\n\t\t\ttorMinute = str.slice(14,16);\r\n\t\t}\r\n\t\t\r\n\t\telse if((str.indexOf('-') > -1) && (str.indexOf(':') > -1) && (str.length == 16)){\r\n\t\t// Format is in 'MM-DD hh:mm'\r\n\t\t\ttorYear = tpbTodayYear;\r\n\t\t\ttorMonth = str.slice(0,2)-1;\r\n\t\t\ttorDate = str.slice(3,5);\r\n\t\t\ttorHour = str.slice(11,13);\r\n\t\t\ttorMinute = str.slice(14,16);\r\n\t\t}\t\t\t\r\n\t\telse if((str.indexOf('-') > -1) && (str.length == 15)){\r\n\t\t// Format is in 'MM-DD YYYY'\r\n\t\t\ttorYear = str.slice(11,15);\r\n\t\t\ttorMonth = str.slice(0,2)-1;\r\n\t\t\ttorDate = str.slice(3,5);\r\n\t\t\ttorHour = hours;\r\n\t\t\ttorMinute = '00';\r\n\t\t\tdispTime = false;\r\n\t\t}\r\n\r\n\t\tvar torFullDate = new Date(torYear, torMonth, torDate, torHour, torMinute);\r\n\t\t\r\n\t\ttorFullDate.addHours(-hours);\r\n\t\toutput = formatTime(torFullDate);\r\n\t\treturn output;\r\n}", "title": "" }, { "docid": "632bf52722befc084e1f4b09c5b47d31", "score": "0.5735503", "text": "_parseTime(time) { //parse time for event\n let semi = ':';\n let space = ' ';\n let nTime = time.split(':')\n let hour = nTime[0];\n let min = nTime [1];\n if ( hour > 12){\n let tod = 'PM';\n hour = hour - 12;\n let parsedTime = hour+semi+min+space+tod;\n return parsedTime;\n\n }else{\n let tod = 'AM';\n let parsedTime = hour+semi+min+space+tod;\n return parsedTime;\n\n } \n }", "title": "" }, { "docid": "60af2ca63f1c01ced75e84c3f8da82ef", "score": "0.572639", "text": "function parseTimestamp(time, offset) {\n\t if (!time) return;\n\n\t var match;\n\n\t // Parse absolute times ISO 8601 format ([hh:]mm:ss[.mmm])\n\t match = time.match(rAbsTime);\n\t if (match) {\n\t var _match = match;\n\t var h = _match[2];\n\t var m = _match[3];\n\t var s = _match[4];\n\t var ms = _match[6];\n\n\t return parseInt(h || 0, 10) * 3600 + parseInt(m, 10) * 60 + parseInt(s, 10) + parseFloat(\"0.\" + ms);\n\t }\n\n\t // Parse relative times (fraction followed by a unit metric d.ddu)\n\t match = time.match(rRelTime);\n\t if (match) {\n\t var _match2 = match;\n\t var n = _match2[1];\n\t var metric = _match2[4];\n\n\t return parseFloat(n) * MULTS[metric] + offset;\n\t }\n\t}", "title": "" }, { "docid": "2ec19e3d3230c4692b0c81aadedfec25", "score": "0.56697905", "text": "function isTimeString(str){return typeof str==='string'&&/^\\d+\\:\\d+(?:\\:\\d+\\.?(?:\\d{3})?)?$/.test(str);}", "title": "" }, { "docid": "a2831d8ca14907b4636149a04fc20cc9", "score": "0.5634415", "text": "function getValidTimeFormatData(time1) \n{\n if (time1 == null) time1 = ''\n else time1 = time1.replace(/^\\s+|\\s+$/g,'');\n\n if (time1 == '') return ''\n\n if (time1.indexOf(':', 0) <= 0) return ''\n\n var val = ''\n var i\n for (i=0;i<2;i++)\n { \n var timeS = time1.split(':')[i]\n timeS = timeS.replace(/^\\s+|\\s+$/g,'')\n if (timeS == '') return ''\n\n while(timeS.substring(0, 1) == '0')\n {\n if (timeS.length == 1) break\n timeS = timeS.substring(1) \n }\n\n var timeI = parseInt(timeS)\n\n if (isNaN(timeI)) return ''\n\n if (timeI < 0) return ''\n if ((i == 0)&&(timeI > 23)) return ''\n if ((i == 1)&&(timeI > 59)) return ''\n\n if (timeI < 10) val = val + '0' + timeI\n else val = val + timeI\n\n if (i == 0) val = val + ':'\n }\n return val\n}", "title": "" }, { "docid": "ed21931bd67a5d671b3e7dea618f31df", "score": "0.56266344", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n datePartArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = getLangDefinition(config._l).isPM(input);\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n config._tzm = timezoneMinutesFromString(input);\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "ed21931bd67a5d671b3e7dea618f31df", "score": "0.56266344", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n datePartArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = getLangDefinition(config._l).isPM(input);\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n config._tzm = timezoneMinutesFromString(input);\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "d0ea4a78029082f8de76ae55f7c30e3e", "score": "0.5615283", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, b, datePartArray = config._a;\n switch (token) {\n // MONTH\n case \"M\":\n // fall through to MM\n case \"MM\":\n datePartArray[1] = input == null ? 0 : ~~input - 1;\n break;\n\n case \"MMM\":\n // fall through to MMMM\n case \"MMMM\":\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n\n // DAY OF MONTH\n case \"D\":\n // fall through to DDDD\n case \"DD\":\n // fall through to DDDD\n case \"DDD\":\n // fall through to DDDD\n case \"DDDD\":\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n\n // YEAR\n case \"YY\":\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2e3);\n break;\n\n case \"YYYY\":\n case \"YYYYY\":\n datePartArray[0] = ~~input;\n break;\n\n // AM / PM\n case \"a\":\n // fall through to A\n case \"A\":\n config._isPm = (input + \"\").toLowerCase() === \"pm\";\n break;\n\n // 24 HOUR\n case \"H\":\n // fall through to hh\n case \"HH\":\n // fall through to hh\n case \"h\":\n // fall through to hh\n case \"hh\":\n datePartArray[3] = ~~input;\n break;\n\n // MINUTE\n case \"m\":\n // fall through to mm\n case \"mm\":\n datePartArray[4] = ~~input;\n break;\n\n // SECOND\n case \"s\":\n // fall through to ss\n case \"ss\":\n datePartArray[5] = ~~input;\n break;\n\n // MILLISECOND\n case \"S\":\n case \"SS\":\n case \"SSS\":\n datePartArray[6] = ~~((\"0.\" + input) * 1e3);\n break;\n\n // UNIX TIMESTAMP WITH MS\n case \"X\":\n config._d = new Date(parseFloat(input) * 1e3);\n break;\n\n // TIMEZONE\n case \"Z\":\n // fall through to ZZ\n case \"ZZ\":\n config._useUTC = true;\n a = (input + \"\").match(parseTimezoneChunker);\n if (a && a[1]) {\n config._tzh = ~~a[1];\n }\n if (a && a[2]) {\n config._tzm = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === \"+\") {\n config._tzh = -config._tzh;\n config._tzm = -config._tzm;\n }\n break;\n }\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "66bb63d3aea4b4259c447c17c6507d92", "score": "0.56131923", "text": "function getDateAndTimeBeingFormatted(input) {\n if (input.constructor === Date || isMockedDate(input)) {\n return {\n date: input,\n time: input.getTime()\n };\n }\n\n if (typeof input === 'number') {\n return {\n time: input // `date` is not required for formatting\n // relative times unless \"twitter\" preset is used.\n // date : new Date(input)\n\n };\n } // For some weird reason istanbul doesn't see this `throw` covered.\n\n /* istanbul ignore next */\n\n\n throw new Error(\"Unsupported relative time formatter input: \".concat(_typeof(input), \", \").concat(input));\n} // During testing via some testing libraries `Date`s aren't actually `Date`s.", "title": "" }, { "docid": "1544db9efd3bdbfa96ca3df756a84219", "score": "0.5611085", "text": "function parseTime(str) {\n if (!str) {\n return 0;\n }\n var strings = str.split(\":\");\n var l = strings.length,\n i = l;\n var ms = 0,\n parsed;\n if (l > 3 || !/^(\\d\\d:){0,2}\\d\\d?$/.test(str)) {\n throw new Error(\"tick only understands numbers and 'h:m:s'\");\n }\n while (i--) {\n parsed = parseInt(strings[i], 10);\n if (parsed >= 60) {\n throw new Error(\"Invalid time \" + str);\n }\n ms += parsed * Math.pow(60, l - i - 1);\n }\n return ms * 1000;\n }", "title": "" }, { "docid": "0b432742603b322aaf8f96c63d622250", "score": "0.5595449", "text": "parseTime(str)\n {\n var errorMsg = null;\n \n try\n {\n var hhmm = str.split(\":\");\n if(hhmm && 2 == hhmm.length)\n {\n var date = new Date(this._date.getTime());\n date.setHours(hhmm[0]);\n date.setMinutes(hhmm[1]);\n return date;\n }\n }\n catch(e)\n {\n errorMsg = e.toString();\n }\n super.dispatchIfError(errorMsg, \"ClassSession::parseTime()\", 56);\n return null;\n }", "title": "" }, { "docid": "5b0df5e4e68902ecb1f74bbb4a364aac", "score": "0.55766606", "text": "function parseTime(str) {\n return xmlToTime(xmlToDoc(str).documentElement);\n}", "title": "" }, { "docid": "d7e0eba3b7406ad0334c939ee5cf8fec", "score": "0.55719745", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, b,\n datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n datePartArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = ((input + '').toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n a = (input + '').match(parseTimezoneChunker);\n if (a && a[1]) {\n config._tzh = ~~a[1];\n }\n if (a && a[2]) {\n config._tzm = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n config._tzh = -config._tzh;\n config._tzm = -config._tzm;\n }\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "d7e0eba3b7406ad0334c939ee5cf8fec", "score": "0.55719745", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, b,\n datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n datePartArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = ((input + '').toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n a = (input + '').match(parseTimezoneChunker);\n if (a && a[1]) {\n config._tzh = ~~a[1];\n }\n if (a && a[2]) {\n config._tzm = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n config._tzh = -config._tzh;\n config._tzm = -config._tzm;\n }\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "d7e0eba3b7406ad0334c939ee5cf8fec", "score": "0.55719745", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, b,\n datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n datePartArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = ((input + '').toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n a = (input + '').match(parseTimezoneChunker);\n if (a && a[1]) {\n config._tzh = ~~a[1];\n }\n if (a && a[2]) {\n config._tzm = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n config._tzh = -config._tzh;\n config._tzm = -config._tzm;\n }\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "d7e0eba3b7406ad0334c939ee5cf8fec", "score": "0.55719745", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, b,\n datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[1] = a;\n } else {\n config._isValid = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n datePartArray[0] = ~~input;\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = ((input + '').toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n a = (input + '').match(parseTimezoneChunker);\n if (a && a[1]) {\n config._tzh = ~~a[1];\n }\n if (a && a[2]) {\n config._tzm = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n config._tzh = -config._tzh;\n config._tzm = -config._tzm;\n }\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "8226425467cbf5dff2dfd2e669e85071", "score": "0.5565797", "text": "function parseTime(str) {\n if (!str.match(/^\\d{2}\\.\\d{2}\\.\\d{4}\\s\\d{2}\\:\\d{2}$/)) return NaN;\n var a = str.split(\" \");\n a[0] = a[0].split('.');\n var t1 = a[0][1]+\"/\"+a[0][0]+\"/\"+a[0][2]+\" \"+a[1];\n return Date.parse(t1);\n}", "title": "" }, { "docid": "9c01276cfaa0f0c6c5ac60a87c378848", "score": "0.5547115", "text": "function parseTime( t ) {\n var d = new Date();\n var time = t.match( /(\\d+)(?::(\\d\\d))?\\s*(p?)/ );\n d.setHours( parseInt( time[1]) + (time[3] ? 12 : 0) );\n d.setMinutes( parseInt( time[2]) || 0 );\n return d;\n}", "title": "" }, { "docid": "935740a286b388ad3502ab85ff23b6de", "score": "0.55358404", "text": "parseTimeField(field) {\n if (field === '') {\n return 0;\n }\n else {\n return parseInt(field, 10);\n }\n }", "title": "" }, { "docid": "7d7e866ed5075c80bdacffb12f91c4f4", "score": "0.55342734", "text": "function parseTimeParam(url, pattern) {\n var match = url.match(pattern);\n\n if (match) {\n var stamp = match[1];\n\n if (stamp.match(MATCH_START_STAMP)) {\n return parseTimeString(stamp);\n }\n\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp);\n }\n }\n\n return undefined;\n}", "title": "" }, { "docid": "7d7e866ed5075c80bdacffb12f91c4f4", "score": "0.55342734", "text": "function parseTimeParam(url, pattern) {\n var match = url.match(pattern);\n\n if (match) {\n var stamp = match[1];\n\n if (stamp.match(MATCH_START_STAMP)) {\n return parseTimeString(stamp);\n }\n\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp);\n }\n }\n\n return undefined;\n}", "title": "" }, { "docid": "7e34f8c5ef88279f7e6a7e83efb4bfe9", "score": "0.55119205", "text": "function AFTime_Format( ptf )\n{\n if( !event.value )\n {\n return;\n }\n var tokens = event.value.split( /\\D/ );\n var invalidDate = false;\n\n // Remove empty elements of the array\n tokens = tokens.filter(Boolean);\n\n if( tokens.length < 2 )\n invalidDate = true;\n\n // Check if every number is valid\n for( i = 0 ; i < tokens.length ; ++i )\n {\n if( isNaN( tokens[i] ) )\n {\n invalidDate = true;\n break;\n }\n switch( i )\n {\n case 0:\n {\n if( tokens[i] > 23 || tokens[i] < 0 )\n invalidDate = true;\n break;\n }\n case 1:\n case 2:\n {\n if( tokens[i] > 59 || tokens[i] < 0 )\n invalidDate = true;\n break;\n }\n }\n }\n if( invalidDate )\n {\n event.value = \"\";\n return;\n }\n\n // Make it of lenght 3, since we use hh, mm, ss\n while( tokens.length < 3 )\n tokens.push( 0 );\n\n // We get pm string in the user locale to search.\n var dummyPm = util.printd( 'ap', new Date( 2018, 5, 11, 23, 11, 11) ).toLocaleLowerCase();\n // Add 12 to time if it's PM and less than 12\n if( event.value.toLocaleLowerCase().search( dummyPm ) !== -1 && Number( tokens[0] ) < 12 )\n tokens[0] = Number( tokens[0] ) + 12;\n\n // We use a random date, because we only care about time.\n var date = new Date( 2019, 7, 12, tokens[0], tokens[1], tokens[2] );\n var ret;\n switch( ptf )\n {\n case 0:\n ret = util.printd( \"hh:MM\", date );\n break;\n case 1:\n ret = util.printd( \"h:MM ap\", date );\n break;\n case 2:\n ret = util.printd( \"hh:MM:ss\", date );\n break;\n case 3:\n ret = util.printd( \"h:MM:ss ap\", date );\n break;\n }\n event.value = ret;\n}", "title": "" }, { "docid": "d9163f0055354183d23d498f23cc735a", "score": "0.5493809", "text": "function parseStartTime(url) {\n\t var match = url.match(MATCH_START_QUERY);\n\t if (match) {\n\t var stamp = match[1];\n\t if (stamp.match(MATCH_START_STAMP)) {\n\t return parseStartStamp(stamp);\n\t }\n\t if (MATCH_NUMERIC.test(stamp)) {\n\t return parseInt(stamp, 10);\n\t }\n\t }\n\t return 0;\n\t}", "title": "" }, { "docid": "d9163f0055354183d23d498f23cc735a", "score": "0.5493809", "text": "function parseStartTime(url) {\n\t var match = url.match(MATCH_START_QUERY);\n\t if (match) {\n\t var stamp = match[1];\n\t if (stamp.match(MATCH_START_STAMP)) {\n\t return parseStartStamp(stamp);\n\t }\n\t if (MATCH_NUMERIC.test(stamp)) {\n\t return parseInt(stamp, 10);\n\t }\n\t }\n\t return 0;\n\t}", "title": "" }, { "docid": "d9163f0055354183d23d498f23cc735a", "score": "0.5493809", "text": "function parseStartTime(url) {\n\t var match = url.match(MATCH_START_QUERY);\n\t if (match) {\n\t var stamp = match[1];\n\t if (stamp.match(MATCH_START_STAMP)) {\n\t return parseStartStamp(stamp);\n\t }\n\t if (MATCH_NUMERIC.test(stamp)) {\n\t return parseInt(stamp, 10);\n\t }\n\t }\n\t return 0;\n\t}", "title": "" }, { "docid": "f22571c7b8ad65c501ff2d459c1b9146", "score": "0.5491358", "text": "parseTime(t) {\n if (t == null) {\n return null; // If no string was passed in, it can't be parsed - return null\n }\n\n var d = {};\n /* This regex looks for and remembers:\n one or more digits (stored as time[1])\n a colon (optional),\n two digits (optional, stored as time[2])\n 0 or more whitespace characters,\n then a \"p\", \"P\", \"a\" or \"A\" (optional, stored as time[3])\n */\n var time = t.match( /(\\d+)(?::(\\d\\d))?\\s*([pPaA]?)/ );\n\n /*\n Calculate hours as follows:\n If time[3] doesn't exist (there is no am or pm indication), hours is just time[1].\n If time[3] is \"p\" or \"P\", and hours is NOT 12, add 12 to hours\n If time[3] is \"a\" or \"A\", and hours IS 12, SUBTRACT 12 from hours\n */\n d.hours = parseInt(time[1]);\n if ((time[3] === \"p\" || time[3] === \"P\") && d.hours !== 12) {\n d.hours += 12;\n }\n if ((time[3] === \"a\" || time[3] === \"A\") && d.hours === 12) {\n d.hours = 0;\n }\n\n // And the minutes are equal to time[2] if it exists, and 0 otherwise.\n d.minutes = parseInt( time[2]) || 0;\n return d;\n }", "title": "" }, { "docid": "9f080d66dadf157d64776b93f8140e1f", "score": "0.548013", "text": "function parseTimestamp(time, offset) {\n if (!time) {\n return null;\n }\n\n var match = void 0;\n\n // Parse absolute times ISO 8601 format ([hh:]mm:ss[.mmm])\n match = time.match(rAbsTime);\n if (match) {\n var _match = match,\n h = _match[2],\n m = _match[3],\n s = _match[4],\n ms = _match[6];\n\n return parseInt(h || 0, 10) * 3600 + parseInt(m, 10) * 60 + parseInt(s, 10) + parseFloat(\"0.\" + ms);\n }\n\n // Parse relative times (fraction followed by a unit metric d.ddu)\n match = time.match(rRelTime);\n if (match) {\n var _match2 = match,\n n = _match2[1],\n metric = _match2[4];\n\n return parseFloat(n) * MULTS[metric] + offset;\n }\n\n return null;\n}", "title": "" }, { "docid": "dcc1a73dbd35ba89770e131b3d8718cd", "score": "0.5479604", "text": "function parseTime(target) {\r\n var output = timeQuery(target);\r\n var timeData = '';\r\n var difference = '';\r\n //var servertime = '';\r\n\r\n // Checks to see if there is an error code in the shell command.\r\n if(output.indexOf('error:') > -1) {\r\n output = output.split('error: ')[1].trim();\r\n if (output == '0x800705B4' ) {\r\n timeData = {'error' : 'NTP request failed'};\r\n debug('NTP request failed');\r\n } else {\r\n timeData = {'error': 'could not query server time. error code: ' + output};\r\n debug('Could not query server time, error code: ' + output);\r\n }\r\n } else if (output.indexOf('The following error occurred: No such host is known.') > -1) {\r\n timeData = {'Error' : 'No host by this name was found!'};\r\n debug('failed to find host '+ target);\r\n } else {\r\n// get only the difference in time from the server!\r\n difference = output.split(', ')[1].trim();\r\n\r\n// Calculate how big the time difference is, if it is grater then 270 seconds (4.5 minutes), it consider the time to be wrong.\r\n var regdif1 = /^\\D/g;\r\n var regdif2 = /\\..*/g;\r\n difference = difference.replace(regdif1,'').replace(regdif2,'');\r\n timeData = parseInt(difference) > 270 ? false : true;\r\n\r\n }\r\n\r\n // remove all the additional data from the time line\r\n return timeData;\r\n}", "title": "" }, { "docid": "f145b7faee572aa0c556c56dffd0eded", "score": "0.54765713", "text": "getTime(input){\n let [hours, minutes] = input.split(':');\n let date = new Date();\n date.setHours(hours);\n date.setMinutes(minutes);\n date.setSeconds(0);\n date.setMilliseconds(0);\n return date.getTime();\n }", "title": "" }, { "docid": "6d5efb148ea0c55d54b4e5207b69b638", "score": "0.5475084", "text": "function parseTime(str) {\n if (!str) {\n return 0;\n }\n\n var strings = str.split(\":\");\n var l = strings.length, i = l;\n var ms = 0, parsed;\n\n if (l > 3 || !/^(\\d\\d:){0,2}\\d\\d?$/.test(str)) {\n throw new Error(\"tick only understands numbers and 'h:m:s'\");\n }\n\n while (i--) {\n parsed = parseInt(strings[i], 10);\n\n if (parsed >= 60) {\n throw new Error(\"Invalid time \" + str);\n }\n\n ms += parsed * Math.pow(60, (l - i - 1));\n }\n\n return ms * 1000;\n }", "title": "" }, { "docid": "dfea58807f9345dfcf3747ff8b74a51d", "score": "0.54721624", "text": "function _get_time(timestamp) {\n try {\n var match = /(\\d{4})-(\\d)-(\\d{2}) (\\d{2}):(\\d{2})/.exec(timestamp);\n return {\n hour: parseInt(match[4]),\n minute: parseInt(match[5])\n };\n } catch (e) {\n console.log(timestamp);\n }\n }", "title": "" }, { "docid": "65de106da879019489de3958a8ba867e", "score": "0.54618317", "text": "function dateParser(input) {\r\n\tvar xval, yval;\r\n\txval = moment.utc(input).format();\r\n\tyval = moment.utc(input).format('HH');\r\n console.log(`Have ${yval} hours`)\r\n\treturn {x:xval, y:yval};\r\n}", "title": "" }, { "docid": "531f319dd31fafff8c9a07086702dbdf", "score": "0.54598767", "text": "function timeParser(time_string)\n{\n time_string = time_string.split(':');\n var out_var = {};\n out_var.hours = time_string[0];\n if(time_string[1].indexOf('p') !== -1){\n out_var.minutes = time_string[1].split('p')[0];\n //transform to 24 hour time\n if(out_var.hours != 12)\n {\n out_var.hours = parseInt(out_var.hours) + 12;\n }\n }\n else{\n out_var.minutes = time_string[1].split('a')[0];\n //transform to 24 hour time\n if(out_var.hours === 12){\n out_var.hours = 0;\n }\n }\n return out_var;\n}", "title": "" }, { "docid": "f6cf4f35e2f9423801d91705cce105cd", "score": "0.54560983", "text": "function parseStartTime(url) {\n var match = url.match(MATCH_START_QUERY);\n if (match) {\n var stamp = match[1];\n if (stamp.match(MATCH_START_STAMP)) {\n return parseStartStamp(stamp);\n }\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp, 10);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "f6cf4f35e2f9423801d91705cce105cd", "score": "0.54560983", "text": "function parseStartTime(url) {\n var match = url.match(MATCH_START_QUERY);\n if (match) {\n var stamp = match[1];\n if (stamp.match(MATCH_START_STAMP)) {\n return parseStartStamp(stamp);\n }\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp, 10);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "f6cf4f35e2f9423801d91705cce105cd", "score": "0.54560983", "text": "function parseStartTime(url) {\n var match = url.match(MATCH_START_QUERY);\n if (match) {\n var stamp = match[1];\n if (stamp.match(MATCH_START_STAMP)) {\n return parseStartStamp(stamp);\n }\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp, 10);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "f6cf4f35e2f9423801d91705cce105cd", "score": "0.54560983", "text": "function parseStartTime(url) {\n var match = url.match(MATCH_START_QUERY);\n if (match) {\n var stamp = match[1];\n if (stamp.match(MATCH_START_STAMP)) {\n return parseStartStamp(stamp);\n }\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp, 10);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "f6cf4f35e2f9423801d91705cce105cd", "score": "0.54560983", "text": "function parseStartTime(url) {\n var match = url.match(MATCH_START_QUERY);\n if (match) {\n var stamp = match[1];\n if (stamp.match(MATCH_START_STAMP)) {\n return parseStartStamp(stamp);\n }\n if (MATCH_NUMERIC.test(stamp)) {\n return parseInt(stamp, 10);\n }\n }\n return 0;\n}", "title": "" }, { "docid": "dd38c4ef1241bbd7b3b469830c94ab75", "score": "0.5445437", "text": "function timeParse(value){\n \n var values, output = 0;\n \n if(value == undefined || value == null){\n return false;\n }\n \n //If the value is numeric, make sure it's an integer and return that.\n if(!isNaN(value)){\n return parseInt(value, 10);\n }\n \n //Split the input into time strings.\n values = $.trim(value.toString()).split(timeSplitRegex);\n \n //If that failed; the value must have been invalid.\n if(!values || values.length == 0){\n return false;\n }\n \n //For every time string.\n for(var i = 0; i < values.length; i++){\n \n var result, num, multiplier, add = 0;\n \n //Parse it.\n result = timeRegex.exec(values[i]) || [];\n \n //If we have a suffix; use the value and find the multiplier to get to a result.\n if(result[2]){\n num = parseInt(result[1], 10);\n multiplier = abbreviations[result[2]] || 1;\n add = (num * multiplier);\n }\n \n //Otherwise cast the value to integer and do not multiply.\n else if(result[1]){\n add = parseInt(value, 10);\n }\n \n //The parsing failed so the time string must have been invalid.\n else{\n return false;\n }\n \n //Add the converted timestring to the total time.\n output += add;\n \n }\n \n //Return the total time.\n return output;\n \n }", "title": "" }, { "docid": "fb17cc8177255392989943f1132257d8", "score": "0.5442959", "text": "function parseDate(input) {\n\tvar parts = input.match(/(\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+)(Z|\\+|-)((\\d+):(\\d+))?/);\n\t\n\tvar timezoneOffset = 0;\n\tif (parts[7] == '+') {\n\t timezoneOffset = -(parseInt(parts[9], 10) * 60 + parseInt(parts[10], 10));\n } else if (parts[7] == '-') {\n \ttimezoneOffset = parseInt(parts[9], 10) * 60 + parseInt(parts[10], 10);\n }\n\treturn new Date(parts[1], parts[2]-1, parts[3], parts[4], parseInt(parts[5],10)+timezoneOffset-(new Date()).getTimezoneOffset(), parts[6]);\n}", "title": "" }, { "docid": "195e8dce02f7b66edebfd96e12376446", "score": "0.54423815", "text": "function convertTimeStamp(inputTimestampString) {\n const date = new Date(inputTimestampString.replace(' ', 'T'));\n return `${date.toDateString()} ${date.toLocaleTimeString('nb-NO')}`;\n }", "title": "" }, { "docid": "88418ab9af681a2d30485c34d9fe8d07", "score": "0.5439895", "text": "fixTime(wrong_time){\n return wrong_time = wrong_time.split(\"T\").pop();\n }", "title": "" }, { "docid": "c9d932093f2bb1baaeb0cb91242065d5", "score": "0.54389805", "text": "function parseTime(time)\r\n{\t\r\n\ttime = time + \"\";\r\n\t\r\n\tif(time.includes(\"<i>\"))\r\n\t\treturn time;\r\n\t\t\r\n\tvar h;\r\n\tvar m;\r\n\t\r\n\tif(time.length <= 2)\r\n\t{\r\n\t\th = \"00\";\r\n\t\tm = time.length == 2 ? time : (\"0\" + time);\r\n\t}\r\n\telse if(time.length == 3)\r\n\t{\r\n\t\th = \"0\" + time.substring(0, 1);\r\n\t\tm = time.substring(1, 3);\r\n\t}\r\n\telse\r\n\t{\r\n\t\th = time.substring(0, 2);\r\n\t\tm = time.substring(2, 4);\r\n\t}\r\n\t\r\n\treturn h + \":\" + m;\r\n}", "title": "" }, { "docid": "b4d631588f894b62d62f09ecf3cbab13", "score": "0.5437427", "text": "function parseDate(input) \n{\n var parts = input.match(/(\\d+)/g);\n return new Date(parts[0], parts[1]-1, parts[2]);\n}", "title": "" }, { "docid": "e2810f1ddebf5d12a9ba3ff3293873cc", "score": "0.54370683", "text": "function timestamp(str){\n return new Date(str).getTime(); \n}", "title": "" }, { "docid": "6b239d5c8174f658d4fd81259ce89cb0", "score": "0.5410996", "text": "function IsTimeValid(time2Chk)\n{\n\ttime2Chk = GetStringValue(time2Chk);\n\tvar d = new Date();\n\tvar time = time2Chk.match(/(\\d+)(?::(\\d\\d))?\\s*(p?)/);\n\td.setHours(parseInt(time[1]) + (time[3] ? 12 : 0));\n\td.setMinutes(parseInt(time[2]) || 0);\n\tconsole.log(d);\n\treturn d;\n}", "title": "" }, { "docid": "43d0010806d509317a9823ec360f93a4", "score": "0.53926504", "text": "function parseDate(input) {\n\t\tvar parts = input.split('-');\n\t\treturn Date.UTC(parts[0], parts[1]-1, parts[2]);\n\t}", "title": "" }, { "docid": "6b73875432799d4d0003d99f22981231", "score": "0.5362126", "text": "function parse(str) {\n if (!(typeof(str) === 'string'))\n throw new UCCException('parse expects a string to parse!');\n // first check for an ISO 8601 datestring, which has a 'T' marking the time element\n if (str.indexOf('T') != -1) {\n return UnixToUCC((new Date(str)).valueOf());\n } else {\n // replace non-digits with spaces and pad right to supply missing arguments\n str = str.replace(/\\D/g,\" \") + ' 0 0 0 0 0 0 0 0';\n var dt = str.split(\" \");\n // assume UCC datestring, year 1st, use UCCDate() long constructor to calculate the instant\n return (new UCCDate(dt[0], dt[1], dt[2], dt[3], dt[4], dt[5], dt[6])).instant; \n }\n }", "title": "" }, { "docid": "294608b6a2955a50e4dfd6d51340a182", "score": "0.5360787", "text": "function temporalMediaFragmentParser(value) {\n\t var components = value.split(\",\");\n\t assert(components.length <= 2, errMessage);\n\n\t var start = components[0] ? components[0] : \"\";\n\t var end = components[1] ? components[1] : \"\";\n\t assert((start || end) && (!start || end || value.indexOf(\",\") === -1), errMessage);\n\n\t start = start.replace(/^smpte(-25|-30|-30-drop)?\\:/, \"\").replace(\"clock:\", \"\");\n\n\t // hours:minutes:seconds.milliseconds\n\t var npt = /^((npt\\:)?((\\d+\\:(\\d\\d)\\:(\\d\\d))|((\\d\\d)\\:(\\d\\d))|(\\d+))(\\.\\d*)?)?$/;\n\t // hours:minutes:seconds:frames.further-subdivison-of-frames\n\t var smpte = /^(\\d+\\:\\d\\d\\:\\d\\d(\\:\\d\\d(\\.\\d\\d)?)?)?$/;\n\t // regexp adapted from http://delete.me.uk/2005/03/iso8601.html\n\t var wallClock = /^((\\d{4})(-(\\d{2})(-(\\d{2})(T(\\d{2})\\:(\\d{2})(\\:(\\d{2})(\\.(\\d+))?)?(Z|(([-\\+])(\\d{2})\\:(\\d{2})))?)?)?)?)?$/;\n\t // float%\n\t var percentage = /^(\\d*(\\.\\d+)? ?%)?$/;\n\n\t var timeNormalizer;\n\t if (npt.test(start) && npt.test(end)) {\n\t timeNormalizer = normalizeNTPTime;\n\t } else if (smpte.test(start) && smpte.test(end)) {\n\t timeNormalizer = normalizeSMPTETime;\n\t } else if (wallClock.test(start) && wallClock.test(end)) {\n\t timeNormalizer = normalizeWallClockTime;\n\t } else if (percentage.test(start) && percentage.test(end)) {\n\t timeNormalizer = normalizePercentage;\n\t } else {\n\t throw new Error(errMessage);\n\t }\n\n\t start = timeNormalizer(start);\n\t end = timeNormalizer(end);\n\t assert(start !== false || end !== false, errMessage);\n\t return {\n\t start: start === false ? \"\" : start,\n\t end: end === false ? \"\" : end\n\t };\n\t}", "title": "" }, { "docid": "37eb06ec1d8646e3bd4839ae865f74c3", "score": "0.53541285", "text": "processTimeInput() {\n\n var timeTokens = this._currentTimeInput.value.split(\":\");\n if (timeTokens.length != 2)\n {\n console.log(\"Provided invalid time (minutes:seconds) expected: \" + this._currentTimeInput.value);\n this._currentTimeInput.classList.add(\"has-border\");\n this._currentTimeInput.classList.add(\"is-invalid\");\n return;\n }\n\n var minutes = parseInt(timeTokens[0]);\n if (isNaN(minutes))\n {\n console.log(\"Provided invalid time (minutes:seconds) expected: \" + this._currentTimeInput.value);\n this._currentTimeInput.classList.add(\"has-border\");\n this._currentTimeInput.classList.add(\"is-invalid\");\n return;\n }\n\n var seconds = parseInt(timeTokens[1]);\n if (isNaN(seconds))\n {\n console.log(\"Provided invalid time (minutes:seconds) expected: \" + this._currentTimeInput.value);\n this._currentTimeInput.classList.add(\"has-border\");\n this._currentTimeInput.classList.add(\"is-invalid\");\n return;\n }\n\n var frame = this._timeToFrame(minutes, seconds);\n const maxFrame = this._maxFrameNumber;\n if (frame > maxFrame)\n {\n frame = maxFrame;\n }\n else if (frame < 0)\n {\n frame = 0;\n }\n\n this._currentTimeInput.classList.remove(\"has-border\");\n this._currentTimeInput.classList.remove(\"is-invalid\");\n this.goToFrame(frame);\n this.checkAllReady();\n }", "title": "" }, { "docid": "3951484d37893b71034fa7c0182f0552", "score": "0.534113", "text": "function timestamp(str){\r\n return new Date(str).getTime();\r\n }", "title": "" }, { "docid": "285b7c6c590bf149b75041070ea150cc", "score": "0.53330183", "text": "function isValidTime(input){\n // Parse the ISO time string to a JS date object\n let bookingTime = Date.parse(input);\n\n // Get the number of hours from now to the booking time\n let hours = Math.abs(bookingTime - Date.now()) / 36e5;\n\n // If the difference in hours between now and booking time is more than specified, return false\n if(hours > MAX_HOURS_FUTURE){\n return false;\n }\n\n // If the booking time is in the PAST, return false\n if(bookingTime < Date.now()){\n return false;\n }\n\n // If the difference in minutes between now and booking time is less than specified, return false\n if((hours*60) < MIN_MINUTES_NOTICE){\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "419c0b9975eb4054393373fb48951244", "score": "0.532286", "text": "function addTimeToArrayFromToken(token, input, datePartArray, config) {\n var a, b;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n datePartArray[1] = (input == null) ? 0 : ~~input - 1;\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n for (a = 0; a < 12; a++) {\n if (getLangDefinition().monthsParse[a].test(input)) {\n datePartArray[1] = a;\n b = true;\n break;\n }\n }\n // if we didn't find a month name, mark the date as invalid.\n if (!b) {\n datePartArray[8] = false;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DDDD\n case 'DD' : // fall through to DDDD\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n datePartArray[2] = ~~input;\n }\n break;\n // YEAR\n case 'YY' :\n datePartArray[0] = ~~input + (~~input > 70 ? 1900 : 2000);\n break;\n case 'YYYY' :\n datePartArray[0] = ~~Math.abs(input);\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config.isPm = ((input + '').toLowerCase() === 'pm');\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[3] = ~~input;\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[4] = ~~input;\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[5] = ~~input;\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n datePartArray[6] = ~~ (('0.' + input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config.isUTC = true;\n a = (input + '').match(parseTimezoneChunker);\n if (a && a[1]) {\n config.tzh = ~~a[1];\n }\n if (a && a[2]) {\n config.tzm = ~~a[2];\n }\n // reverse offsets\n if (a && a[0] === '+') {\n config.tzh = -config.tzh;\n config.tzm = -config.tzm;\n }\n break;\n }\n\n // if the input is null, the date is not valid\n if (input == null) {\n datePartArray[8] = false;\n }\n }", "title": "" }, { "docid": "10420be3fbd6d3ab785fafdb57631f65", "score": "0.5321852", "text": "function generateTimeStamp(input) {\n let current = new Date(input);\n let hours = current.getHours();\n let min = current.getMinutes();\n let sec = current.getSeconds();\n let meridiem = hours >= 12 ? \"PM\" : \"AM\";\n hours = hours % 12;\n if (hours == 0) hours = 12;\n if (min < 10) min = \"0\" + min;\n if (sec < 10) sec = \"0\" + sec;\n return hours + \":\" + min + \":\" + sec + \" \" + meridiem;\n }", "title": "" }, { "docid": "3aaf41c9cee40e0c713b4f163a66e05c", "score": "0.5313537", "text": "function timestamp(str) {\n\t return new Date(str).getTime();\n\t }", "title": "" }, { "docid": "1453a7982da2e1b4f1c0e6e599f0c6fa", "score": "0.5302089", "text": "function parseTimeRegistrations(input){\n\t\ttry{\n\t\t\tif(input !== undefined && input !== null && input.length > 0){\n\t\t\t\tfor(var i=0, j=input.length; i<j;i++){\n\t\t\t\t\tvar entry = input[i];\n\t\t\t\t\tif(entry[0]){\n\t\t\t\t\t\tvar tr = JSON.parse(entry[0]);\n\t\t\t\t\t\tData.TimeReports[tr.Id] = tr;\n\t\t\t\t\t}\n\t\t\t\t\tif(entry[1]){\n\t\t\t\t\t\tvar te = JSON.parse(entry[1]);\n\t\t\t\t\t\tif(te){\n\t\t\t\t\t\t\tData.TimeEntries[te.Id] = te;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(entry[2]){\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar wh = JSON.parse(entry[2]);\n\t\t\t\t\t\tif(wh){\n\t\t\t\t\t\t\tData.WorkedHours[wh.Id] = wh;\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}catch(err){\n\t\t\tLOG.store(err,input);\n\t\t}\n\t}", "title": "" }, { "docid": "3e591c4545826227018e8dc64b85f270", "score": "0.53009176", "text": "function oldCheckTime(obj)\r\n{\r\n\tvar value = obj.value;\r\n\tvar re1 = /^\\s*(\\d\\d?)\\s*[:h]\\s*(\\d\\d)?\\s*$/;\r\n\tvar scores;\r\n\tif ( (scores = value.match(re1)) != undefined)\r\n\t{\r\n\t\ts1 = parseInt(scores[1]);\r\n\t\ts2 = parseInt(scores[2]);\r\n\t\tif ( s1 < 10 ) {\r\n\t\t\tif ( s2 < 10 ) {\r\n\t\t\t\tobj.value = '0' + s1 + ':0' + s2;\r\n\t\t\t} else {\r\n\t\t\t\tobj.value = '0' + s1 + ':' + s2;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif ( s2 < 10 ) {\r\n\t\t\t\tobj.value = s1 + ':0' + s2;\r\n\t\t\t} else {\r\n\t\t\t\tobj.value = s1 + ':' + s2;\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\tif (s1 == 3 && s2 >= 0 && s2 < 3) { return true; }\r\n\t\tif (s2 == 3 && s1 >= 0 && s1 < 3) { return true; }\r\n\t}\r\n\r\n\tvar errmsg = value + \": Format d'heure incorrect, veuillez re-saisir.\";\r\n\talert(msg);\r\n\tobj.select();\r\n\tobj.focus();\r\n}", "title": "" }, { "docid": "249c465d578e0ac88971074317a5bdfd", "score": "0.5296824", "text": "function timestamp(str) {\n return new Date(str).getTime();\n }", "title": "" }, { "docid": "2717d9f2ff37bb6a2b0df9d9a64e7880", "score": "0.5288975", "text": "function parseTime(str) {\n if (!str) {\n return 0;\n }\n\n var strings = str.split(\":\");\n var l = strings.length, i = l;\n var ms = 0, parsed;\n\n if (l > 3 || !/^(\\d\\d:){0,2}\\d\\d?$/.test(str)) {\n throw new Error(\"tick only understands numbers and 'h:m:s'\");\n }\n\n while (i--) {\n parsed = parseInt(strings[i], 10);\n\n if (parsed >= 60) {\n throw new Error(\"Invalid time \" + str);\n }\n\n ms += parsed * Math.pow(60, (l - i - 1));\n }\n\n return ms * 1000;\n}", "title": "" }, { "docid": "386824b4a87957a506fd04c7c2df6c17", "score": "0.5286798", "text": "function checkFormat(date, time) {\n\tvar day = date.substr(3,2);\n\tvar month = date.substr(0,2);\n\tvar year = date.substr(6);\n\n\tvar hour = time.substr(0,2);\n\tvar min = time.substr(3,2);\n\n\t//console.log(\"day: \" + day + '\\nmonth: ' + month + '\\nyear: ' + year);\n\t//console.log(\"hour: \" + hour + '\\nminute: ' + min);\n\n\t// Perform checks\n\tif (month > 12 || month < 1 || year < 1 || day > 31 || hour > 24 || hour < 0 || min < 0 || min > 60) return false;\n\n\treturn $.isNumeric(day) && $.isNumeric(month) && $.isNumeric(year) && $.isNumeric(min) && $.isNumeric(hour) && /\\d{2}\\:\\d{2}/.test(time) && /\\d{2}\\/\\d{2}\\/\\d{4}/.test(date);\n}", "title": "" }, { "docid": "7a012a286f987fc7aa0e61627bec9ffc", "score": "0.52853894", "text": "function normalizeSMPTETime(time) {\n\t if (!time) return false;\n\n\t // possible cases:\n\t // 12:34:56\n\t // 12:34:56:78\n\t // 12:34:56:78.90\n\t var hours;\n\t var minutes;\n\t var seconds;\n\t var frames;\n\t var subframes;\n\t time = time.split(\":\");\n\t var length = time.length;\n\t switch (length) {\n\t case 3:\n\t hours = parseInt(time[0], 10);\n\t minutes = parseInt(time[1], 10);\n\t seconds = parseInt(time[2], 10);\n\t frames = 0;\n\t subframes = 0;\n\t break;\n\t case 4:\n\t hours = parseInt(time[0], 10);\n\t minutes = parseInt(time[1], 10);\n\t seconds = parseInt(time[2], 10);\n\t if (time[3].indexOf(\".\") === -1) {\n\t frames = parseInt(time[3], 10);\n\t subframes = 0;\n\t } else {\n\t var frameSubFrame = time[3].split(\".\");\n\t frames = parseInt(frameSubFrame[0], 10);\n\t subframes = parseInt(frameSubFrame[1], 10);\n\t }\n\t break;\n\t default:\n\t return false;\n\t }\n\t assert(hours <= 23, errMessage);\n\t assert(minutes <= 59, errMessage);\n\t assert(seconds <= 59, errMessage);\n\t return hours * 3600 + minutes * 60 + seconds + frames * 0.001 + subframes * 0.000001;\n\t}", "title": "" }, { "docid": "92a2da664f9c054020d5cb1a47592f14", "score": "0.5281261", "text": "function parseDate(inputTime) {\n var parts = inputTime.split(/[ \\/:-]/g);\n var dateFormated = parts[1] + \"/\" + parts[2] + \"/\" + parts[0] + \" \" + parts[3] + \":\" + parts[4] + \":\" + parts[5];\n return new Date(dateFormated); \n}", "title": "" }, { "docid": "507b7b7e5aa4b2bb9af8d8f7f94828bf", "score": "0.52756816", "text": "function parseTime(s) {\n var c = s.split(':');\n return parseInt(c[0]) * 3600 + parseInt(c[1]) * 60 + parseInt(c[2]);\n }", "title": "" }, { "docid": "c2b0ea49b70600eb5cc245358d6888d9", "score": "0.5273801", "text": "_parsedDate(date) { //parse date for events\n let ndate = date.toString().split(' ');\n let time = this._parseTime(ndate[4]);\n return time.toString();\n }", "title": "" }, { "docid": "783df33e343ba81da0acc28331240dae", "score": "0.52607185", "text": "function parseTimeString(str) {\n var pat = /(\\d+)(?::0*(\\d*))?(?::0*(\\d*))?([wsugz])?$/;\n var hms = str.match(pat);\n hms[1] = parseInt(hms[1], 10);\n hms[2] = hms[2] ? parseInt(hms[2], 10) : 0;\n hms[3] = hms[3] ? parseInt(hms[3], 10) : 0;\n return hms.slice(1, 5);\n }", "title": "" }, { "docid": "f6c14cff4f862f4631a0aa745f202437", "score": "0.5259743", "text": "function toUnixTimestamp(time) {\n if (typeof time === 'string' && +time == time) {\n return +time;\n }\n if (typeof time === 'number') {\n if (!Number.isFinite(time) || time < 0) {\n return Date.now() / 1000;\n }\n return time;\n }\n if (util.isDate(time)) {\n // convert to 123.456 UNIX timestamp\n return time.getTime() / 1000;\n }\n throw new Error('Cannot parse time: ' + time);\n}", "title": "" }, { "docid": "f254293bd70903d75064cee0e6eb71d0", "score": "0.5259301", "text": "function processTimeStamp(timeString) {\n const dayIndex = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n const monthIndex = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\n\n const sentAt = new Date(timeString);\n\n //Format the day, date and time\n const dateSegment = `${dayIndex[sentAt.getDay()]} ${monthIndex[sentAt.getMonth()]} ${sentAt.getDate()}, ${sentAt.getFullYear()}`;\n let hour = sentAt.getHours();\n let min = sentAt.getMinutes().toString().padStart(2, '0');\n\n let amPM = 'am';\n if (hour > 12)\n amPM = 'pm';\n\n hour = hour > 12 ? hour % 12 : hour;\n\n let time = `${hour}:${min} ${amPM}`;\n\n return dateSegment + ' at ' + time;\n }", "title": "" }, { "docid": "0b0784227a909085bda2a1932f95eee6", "score": "0.52548", "text": "function start_timestamp(str) {\r\n return new Date(str).getTime();\r\n }", "title": "" }, { "docid": "6c4a9e2ad0eca6ba1c3754ebacca6268", "score": "0.52416843", "text": "function parsePseudoversionTimestamp(version) {\n const split = version.split('-');\n if (split.length < 2) {\n return null;\n }\n if (!semver.valid(version)) {\n return null;\n }\n if (!pseudoVersionRE.test(version)) {\n return null;\n }\n const sv = semver.coerce(version);\n if (!sv) {\n return null;\n }\n // Copied from src/cmd/go/internal/modfetch.go.\n const build = sv.build.join('.');\n const buildIndex = version.lastIndexOf(build);\n if (buildIndex >= 0) {\n version = version.substring(0, buildIndex);\n }\n const lastDashIndex = version.lastIndexOf('-');\n version = version.substring(0, lastDashIndex);\n const firstDashIndex = version.lastIndexOf('-');\n const dotIndex = version.lastIndexOf('.');\n let timestamp;\n if (dotIndex > firstDashIndex) {\n // \"vX.Y.Z-pre.0\" or \"vX.Y.(Z+1)-0\"\n timestamp = version.substring(dotIndex + 1);\n }\n else {\n // \"vX.0.0\"\n timestamp = version.substring(firstDashIndex + 1);\n }\n return moment.utc(timestamp, 'YYYYMMDDHHmmss');\n}", "title": "" }, { "docid": "5a98f9052079e4de32a034a4b83e5729", "score": "0.523824", "text": "function validateTime(x)\n {\n \tvar t=x.value;\n\tvar hh=t.substr(0,2); hh = parseInt(hh);\n\tvar colon = t.substr(2,1);\n\tvar mm=t.substr(3,2); mm = parseInt(mm);\n\t//alert(hh+colon+mm);\n\tif(hh<0 || hh>23){\n\t\tflag=false;\n\t}else if(colon!=\":\"){\n\t\tflag=false;\n\t}else if(mm <0 || mm >59){\n\t\tflag=false;\n\t}else{\n\t\tflag=true;\n\t}\n\tif(flag==true){\n\t\t return true;\n\t}else{\n\t\t alert(\"Invalid time. Please enter between 00:00 & 23:59\");\n\t\t return false;\n\t}\n }", "title": "" }, { "docid": "db5cb518e67ea81abb278afee11efec8", "score": "0.5228706", "text": "function addTimeToArrayFromToken(token, input, config) {\n var a, datePartArray = config._a;\n\n switch (token) {\n // MONTH\n case 'M' : // fall through to MM\n case 'MM' :\n if (input != null) {\n datePartArray[MONTH] = toInt(input) - 1;\n }\n break;\n case 'MMM' : // fall through to MMMM\n case 'MMMM' :\n a = getLangDefinition(config._l).monthsParse(input);\n // if we didn't find a month name, mark the date as invalid.\n if (a != null) {\n datePartArray[MONTH] = a;\n } else {\n config._pf.invalidMonth = input;\n }\n break;\n // DAY OF MONTH\n case 'D' : // fall through to DD\n case 'DD' :\n if (input != null) {\n datePartArray[DATE] = toInt(input);\n }\n break;\n // DAY OF YEAR\n case 'DDD' : // fall through to DDDD\n case 'DDDD' :\n if (input != null) {\n config._dayOfYear = toInt(input);\n }\n\n break;\n // YEAR\n case 'YY' :\n datePartArray[YEAR] = toInt(input) + (toInt(input) > 68 ? 1900 : 2000);\n break;\n case 'YYYY' :\n case 'YYYYY' :\n case 'YYYYYY' :\n datePartArray[YEAR] = toInt(input);\n break;\n // AM / PM\n case 'a' : // fall through to A\n case 'A' :\n config._isPm = getLangDefinition(config._l).isPM(input);\n break;\n // 24 HOUR\n case 'H' : // fall through to hh\n case 'HH' : // fall through to hh\n case 'h' : // fall through to hh\n case 'hh' :\n datePartArray[HOUR] = toInt(input);\n break;\n // MINUTE\n case 'm' : // fall through to mm\n case 'mm' :\n datePartArray[MINUTE] = toInt(input);\n break;\n // SECOND\n case 's' : // fall through to ss\n case 'ss' :\n datePartArray[SECOND] = toInt(input);\n break;\n // MILLISECOND\n case 'S' :\n case 'SS' :\n case 'SSS' :\n case 'SSSS' :\n datePartArray[MILLISECOND] = toInt(('0.' + input) * 1000);\n break;\n // UNIX TIMESTAMP WITH MS\n case 'X':\n config._d = new Date(parseFloat(input) * 1000);\n break;\n // TIMEZONE\n case 'Z' : // fall through to ZZ\n case 'ZZ' :\n config._useUTC = true;\n config._tzm = timezoneMinutesFromString(input);\n break;\n case 'w':\n case 'ww':\n case 'W':\n case 'WW':\n case 'd':\n case 'dd':\n case 'ddd':\n case 'dddd':\n case 'e':\n case 'E':\n token = token.substr(0, 1);\n /* falls through */\n case 'gg':\n case 'gggg':\n case 'GG':\n case 'GGGG':\n case 'GGGGG':\n token = token.substr(0, 2);\n if (input) {\n config._w = config._w || {};\n config._w[token] = input;\n }\n break;\n }\n }", "title": "" } ]
4b01665520f63126939d8a39f77ad126
TODO: make sendMessage function
[ { "docid": "729b88284e6cb4f730f043c8589ef849", "score": "0.0", "text": "function sendMessage() {\n let data = {\n // \n };\n\n $.ajax({\n type: POST,\n url: \"mail.php\",\n data: data,\n success: function () {\n console.log(\"message is sended\");\n }\n });\n}", "title": "" } ]
[ { "docid": "8b5b53caa21ec7aedcd41396bc79e3e7", "score": "0.8614542", "text": "function sendMessage(){}", "title": "" }, { "docid": "acbb0619116bd25599f1f59970df9b01", "score": "0.81689", "text": "function sendMessage() {\n}", "title": "" }, { "docid": "35eca8a26f6eb1b24447ea5208f034d0", "score": "0.8141307", "text": "function sendMessage() {\n \n\n}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.80977315", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.80977315", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.80977315", "text": "SendMessage() {}", "title": "" }, { "docid": "2664c07c2657e5cb81267408f87c73af", "score": "0.80977315", "text": "SendMessage() {}", "title": "" }, { "docid": "baa55503427fa00d578d4cf6a4ac3482", "score": "0.7770007", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n var senddata = message.split(\"|\");\n var targetid = senddata[0];\n message = senddata[1];\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n\n // tell server to execute 'new message' and send along one parameter\n\n socket.emit('controll special user', { uid: targetid, msg:message });\n }\n }", "title": "" }, { "docid": "b42f2dbecd5ce9d869e79e19e5ed1fc7", "score": "0.76184094", "text": "function sendMessage() {\n if (!that.connection.isConnected()) {\n displayMessage(\"<span style='color: red'>Verbindung beendet oder noch nicht geöffnet.</span>\");\n return;\n }\n\n var textMessage = getChatMessageFromInput();\n\n if (!textMessage) {\n $(\"gameInputField\").focus();\n return;\n }\n\n var message = new GameMessage(GameMessage.GameChatMessage);\n message.text = \"<b>\" + User.load().getUsername() + \": </b> \" + textMessage;\n\n that.connection.send(message);\n\n // adding \"Ich: \" in front of every printed message from the user so\n // that he knows it was his\n displayMessage(\"<b>Ich: </b>\" + textMessage);\n\n }", "title": "" }, { "docid": "3f2828a2d593a90d06780b8eea883d82", "score": "0.75921285", "text": "function sendMessage() {\n // Create a new message object\n var message = {\n text: vm.messageText\n };\n\n // Emit a 'gameMessage' message event\n Socket.emit('gameMessage', message);\n\n // Clear the message text\n vm.messageText = '';\n }", "title": "" }, { "docid": "ab1847f0545efa1c003b142f829d88ce", "score": "0.75666666", "text": "function sendMessage() {\n\n channel.push('shout', { \n name: name.value || \"guest\", // get value of \"name\" of person sending the message. Set guest as default\n message: msg.value, // get message text (value) from msg input field.\n inserted_at: new Date() // date + time of when the message was sent\n });\n\n msg.value = ''; // reset the message input field for next message.\n}", "title": "" }, { "docid": "316a76246eeb036e7d16bed313916dd3", "score": "0.7509115", "text": "function sendMessage () {\n var message = $('#input_' + target).val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $('#input_' + target).val('');\n \n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', {\n message: message,\n target: target,\n displayName: displayName,\n });\n }\n }", "title": "" }, { "docid": "d2021f5b34cfba97d2e0c7397ae5060c", "score": "0.74790496", "text": "function sendMessage() {\n let message = $inputMessage.value;\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n addChatMessage({ username, message }, { kind: \"sent\" });\n // tell server to execute 'new message' and send along one parameter\n\n let payload = {\n username: username,\n message: message\n }\n if (!dev) {\n socket.emit('new message', payload);\n }\n }\n }", "title": "" }, { "docid": "4d7367f7fe88574cba86144d4b806672", "score": "0.74731684", "text": "function sendMessage () {\n var message = $inputMessage.val();\n console.log(message);\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n console.log(message + ' and connected');\n $inputMessage.val('');\n addChatMessage({\n name: name,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n \n if (canPlay) {\n if (message === cleanInput('start')) {\n startRound();\n }\n } else if (playing) {\n if (message === cleanInput(answer)) {\n personal_score += score; \n }\n }\n }\n }", "title": "" }, { "docid": "b71342c3af9ee94f5ba54720187b342f", "score": "0.7471472", "text": "handleSendMessage() {\n this.props.sendMessageAction({\n \"userId\": this.state.to,\n \"fromNumber\": this.props.profile.mobile,\n \"text\": this.state.text,\n \"read\": false,\n \"sentDate\": new Date().getTime()\n });\n }", "title": "" }, { "docid": "ce02308ffe8912bb2999b118a920d4e2", "score": "0.7469718", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n console.log(\"sendMessage\")\n }", "title": "" }, { "docid": "0230bea19d4c29b4e917390069557ed0", "score": "0.74605495", "text": "function sendMessage() {\n \t\tvar message = data.value;\n\t\tdata.value = \"\";\n\t\t// tell server to execute 'sendchat' and send along one parameter\n\t\tsocket.emit('sendchat', message);\n\t}", "title": "" }, { "docid": "b15e582f9e010d29dde0bed2218604ce", "score": "0.7459509", "text": "function sendMessage() {\n\t//Pebble.sendAppMessage({\"status\": 0});\n //testRequest();\n //testRequestTime();\n\t\n\t// PRO TIP: If you are sending more than one message, or a complex set of messages, \n\t// it is important that you setup an ackHandler and a nackHandler and call \n\t// Pebble.sendAppMessage({ /* Message here */ }, ackHandler, nackHandler), which \n\t// will designate the ackHandler and nackHandler that will be called upon the Pebble \n\t// ack-ing or nack-ing the message you just sent. The specified nackHandler will \n\t// also be called if your message send attempt times out.\n}", "title": "" }, { "docid": "749c990b74fdda123da955391f4d2eba", "score": "0.73805326", "text": "function onSendMessage(data){\n\t//TODO \n}", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.7379428", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "fede61935806c34d3c7a5b66f30de195", "score": "0.7379428", "text": "function sendMessage() {\n let message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit(\"sendchat\", message);\n }", "title": "" }, { "docid": "d3db8ac217b69ba35f746418439cdd9b", "score": "0.7364395", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n namecolor: namecolor,\n floatdir: 'right',\n msgbgcolor: '#94C2ED'\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "349cb8f2838119d4267bfc48bad5126c", "score": "0.73583806", "text": "function chatBotMessage() {\r\n newBotMsg(getBotMessage())\r\n console.log(\"chatbot message\")\r\n}", "title": "" }, { "docid": "b4973682f011a44f2964e3c44fcdae49", "score": "0.73161095", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "b4973682f011a44f2964e3c44fcdae49", "score": "0.73161095", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "b4973682f011a44f2964e3c44fcdae49", "score": "0.73161095", "text": "function sendMessage () {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message);\n }\n }", "title": "" }, { "docid": "8b7f1afdfb4173974177be42e20df890", "score": "0.73082185", "text": "function sendMessage () {\n var message = $inputMessage.val();\n if(message.charAt(0) == '@'){\n var pmuser = message.substr(1,message.indexOf(' ')).trim();\n message = message.substr(message.indexOf(\" \") + 1);\n $inputMessage.val('@'+pmuser+' ');\n addChatMessage({\n username: username,\n message: message,\n pmuser: pmuser\n }); \n socket.emit('new message', message,pmuser);\n }\n else {\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n addChatMessage({\n username: username,\n message: message,\n pmuser: null\n });\n // tell server to execute 'new message' and send along one parameter\n socket.emit('new message', message,null);\n }\n }\n }", "title": "" }, { "docid": "9d3167fe3794748d5e7a3f1c9337d081", "score": "0.7306823", "text": "function sendMessage() {\n sendNewMessage({ dsText: valueInput.trim(), usuario: getUsuarioLogado() });\n setValueInput('');\n }", "title": "" }, { "docid": "20e596a554747b2e478574b19278fbda", "score": "0.729101", "text": "function sendMessage() {\n let text = messageInput.value.trim();\n if (text === \"\") {\n return;\n }\n messageInput.value = \"\";\n\n if (text !== history.commands[0]) {\n history.commands.unshift(text);\n }\n history.index = -1;\n\n let to = text.match(/^@\\S+/);\n\n if (to) {\n to = to[0].split(\"@\")[1];\n }\n sock.emit(\"message\", { to: to, text: text });\n }", "title": "" }, { "docid": "50eeeecda82f2a31a0363c4c92a050dd", "score": "0.72813624", "text": "function sendMessage() {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message && connected) {\n $inputMessage.val('');\n\n //Check if we want to send private message\n if (message.indexOf(\"/p \") == 0) {\n var to_start = message.indexOf(\"/p \") + 3;\n var user_to = message.substr(to_start).trim();\n user_to = user_to.substr(0, user_to.indexOf(\" \")).trim();\n\n var mess = message.substr(to_start).trim();\n mess = mess.substr(mess.indexOf(\" \")).trim();\n\n var data = {\n username: username,\n to: user_to,\n message: mess,\n private: true\n };\n\n addChatMessage(data);\n\n var privateIp = \"\";\n\n users.forEach(function (el, i) {\n if (el.name == user_to) {\n privateIp = el.ip;\n }\n });\n\n /*\n var test = {\n key1: 42,\n key2: 'foo'\n };\n test.getKeyByValue( 42 ); // returns 'key1'\n */\n\n // tell server to execute 'new message' and send along one parameter\n socket.send('msg', mess, privateIp);\n lastmessage = mess;\n } else {\n addChatMessage({\n username: username,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n socket.send('msg', message);\n lastmessage = message;\n }\n\n }\n }", "title": "" }, { "docid": "7e050b419575fccb75ef0e45542f1c42", "score": "0.72690606", "text": "function sendMessage (message) {\n connection.sendMessage({\n message: message\n });\n renderMessage(message);\n }", "title": "" }, { "docid": "e677dfafaa458e7a8d52670dd66cc492", "score": "0.7259365", "text": "sendMessage(text) {\n const msg = {\n type: \"newMessage\",\n chatId: this.chatId(),\n user: this.state.user,\n text: text\n };\n this.ws.send(JSON.stringify(msg));\n }", "title": "" }, { "docid": "31942c729fd8911f1038321f70e7c3f3", "score": "0.72575", "text": "function sendMessage() {\n text = newMessage.val();\n if (text) {\n // Refactored:\n msgDisplay(text, true);\n }\n }", "title": "" }, { "docid": "fa30d06c4e8c8e72f91c7ab14c492779", "score": "0.7214907", "text": "function sendMessage() {\n var message = $inputMessage.val();\n // Prevent markup from being injected into the message\n message = cleanInput(message);\n // if there is a non-empty message and a socket connection\n if (message) {\n $inputMessage.val('');\n addChatMessage({\n userName: userName,\n message: message\n });\n // tell server to execute 'new message' and send along one parameter\n chattingSocket.emit('chat', {\n userName: userName,\n message: message\n });\n }\n}", "title": "" }, { "docid": "f661dfa3227d4d0a1af656d1dac230cf", "score": "0.7200741", "text": "function SendMessage(message)\n{\n client.sendEvent(new Message(JSON.stringify(message))); //, printResultFor(\"send\"));\n}", "title": "" }, { "docid": "38f812ffd79eb58ace1a3ea7ba0726cf", "score": "0.7190399", "text": "function sendMessage(m) {\n process.send(m);\n}", "title": "" }, { "docid": "d1a0ca74a8750def91d9b7f632550348", "score": "0.71889067", "text": "function sendMessage() {\n\tconst message = messageInputBox.value;\n\tdisplayMessage(message);\n\tdataChannel.send(message);\n\n\t// Clear the input box and re-focus it, so that we're\n\t// ready for the next message.\n\tmessageInputBox.value = \"\";\n\tmessageInputBox.focus();\n}", "title": "" }, { "docid": "36662ccabb884ee00c3ac9ecb8035b8d", "score": "0.7179668", "text": "sendMessage() {\n\n // get the message from the messaging input\n const message = App.elements.input.val();\n\n // make sure the message is not empty or just spaces.\n if (message.trim().length > 0) {\n\n // do a POST request with the message\n App.requests.sendMessage(message).done(() => {\n\n // clear the message box.\n App.dom.clearMessageBox();\n });\n }\n }", "title": "" }, { "docid": "8eceb4df90644f440ea3717e1378d39c", "score": "0.71707505", "text": "function sendMessage() {\n if(data.value === \"\")\n return;\n var message = data.value;\n data.value = \"\";\n // tell server to execute 'sendchat' and send along one parameter\n socket.emit('sendchat', message);\n }", "title": "" }, { "docid": "cf5c6e8e1e83f2ed6a6fcc034b00bf9a", "score": "0.71487087", "text": "function sendMessage () {\n var message = $inputMessage.val();\n message = cleanInput(message);\n var username = $usernameInput.val();\n // This section clears out input fields:\n $inputMessage.val('');\n addNewChatMessage({\n username: username,\n message: message\n });\n let data = {username,message};\n socket.emit('new message', data);\n }", "title": "" }, { "docid": "7ae4421b543ca15198a16de612fda212", "score": "0.7146357", "text": "function sendMessage(message)\r\n { \r\n try\r\n {\r\n ChatWindow.SendMessage(getMyWebID(),getOtherWebID(), escape(getMyNick()), escape( message ) ,sendMessage_CallBack);\r\n }\r\n catch(ex)\r\n { \r\n \r\n }\r\n }", "title": "" }, { "docid": "d5dd6428454a27ba547d32d171cdfd36", "score": "0.7117773", "text": "function sendMessage() {\n var windSpeed = 8 + (Math.random() * 7);\n var data = JSON.stringify({ \n deviceId: device, \n uuid: uuid(), \n windSpeed: windSpeed \n });\n var message = new Message(data);\n console.log(\"Sending message: \" + message.getData());\n client.sendEvent(message, printResultFor('send'));\n}", "title": "" }, { "docid": "b4285c1eaf9a4c1f19b7b000bc1d3416", "score": "0.71143603", "text": "function sendMessage() {\n var data = messageBox.value();\n var destination = addressBox.value();\n var outGoing = encodeURI(data);\n httpGet('/destination/' + destination + '/msg/' + outGoing, 'text', requestDone);\n}", "title": "" }, { "docid": "dd3b78804af268295a79e0c0b22c9f12", "score": "0.7092939", "text": "function sendMessage() {\n json.activeSince = moment();\n \n var message = JSON.stringify(json);\n \n console.log('Music ' + SOUNDS[json.instrument] + ' message : ' + message);\n\n socket.send(message, 0, message.length, protocol.PORT, protocol.MULTICAST_ADDRESS, function (err, bytes) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "159011e182280c0a44563935f3e1951b", "score": "0.70876324", "text": "function sendMessage(cmd, value) {\n console.log(\"Sending Message \" + cmd + \",\" + value);\n Pebble.sendAppMessage({\"cmd\": cmd, \"value\": value});\n}", "title": "" }, { "docid": "61de75f8bfebf83e28a3abb8d0b22d5e", "score": "0.7083197", "text": "sendMessage (msg) {\n throw new Error('sendMessage should be implemented in a concrete class')\n }", "title": "" }, { "docid": "b67b2f9e332e4b242bcb78e21d41b559", "score": "0.7082586", "text": "function processSendMessage() {\n // check to send message\n if (client_connection_status.get(current_chat_id) != CONNECTED) {\n return;\n }\n\n let current_time = (new Date()).getTime() / 1000; // time in seconds since epoch time\n client_curr_sent_msg_time = current_time;\n\n // add message to user's chat history\n let message_list = chat_messages.get(current_chat_id);\n message_list.push({\n message: chat_text_area.innerHTML,\n sender_profile: {\n name: agent_info.name,\n picture: agent_info.picture\n },\n time: current_time\n });\n\n // check to create header or tail message\n if ((client_curr_sent_msg_time - client_prev_sent_msg_time) > 60) { // create header message\n // add message to chat view\n chat_window_msg_list_elem.appendChild(createAgentHeaderMessageBox({\n message: chat_text_area.innerHTML,\n sender_profile: {\n name: agent_info.name,\n picture: agent_info.picture\n },\n time: current_time\n }));\n\n } else { // create tail message\n chat_window_msg_list_elem.appendChild(createAgentTailMessageBox({\n message: chat_text_area.innerHTML\n }));\n }\n\n client_prev_sent_msg_time = client_curr_sent_msg_time;\n\n // forward the message\n agent_chat.sendMessage(chat_text_area.innerHTML);\n\n // clear the message input and show the placeholder text\n chat_text_area.innerHTML = \"\";\n placeholder_toggle = true;\n chat_text_area_placeholder.removeAttribute(\"style\");\n\n // scroll chat message container to bottom\n chat_window_msg_list_elem.scrollTop = 100000;\n }", "title": "" }, { "docid": "565e8fb67025e6aa59b8e004125afa68", "score": "0.7076303", "text": "function sendMessage (target,message) {\n\t// twitch seems to cut message that are over 500 chars:\n\n\tlet timesToCut = (message.length / 500);\n\tlet messages = [];\n\tif (timesToCut > 0){\n\t\t//\t\tconsole.log(\"gachipls:\" + timesToCut);\n\t\tfor (var i = 0; i < Math.floor(timesToCut) + 1 ; i++){\n\t\t\tmessages.push( message.substr(i*500, i*500+500) );\t\t\n\t\t\t//\t\t\tconsole.log(i);\n\t\t}\n\t}else{\n\t\tmessages.push(message);\n\t}\n\n\t// send the first one immediately\n\t//client.chat.say(target, messages[0] );\n\t/*for (i = 1; i < messages.length; i++){\n\t console.log(\"gnééé:\" + messages[i]);\n\t setTimeout( () => { client.chat.say(target, messages[i] ) }, i*500);\n\t }*/\n\n\ti = 0;\n\tmessages.forEach( (element) => {\n\t\t\tsetTimeout(() => {client.chat.say(target, element)},i * 500)\n\t\t\ti++;\n\t\t\t});\n\n}", "title": "" }, { "docid": "ab9781da1e4dd3284513cdebe214fc8f", "score": "0.70744497", "text": "function sendMessage() {\n //message content listener\n var text = document.getElementById('sendMessageText').value;\n if (text.replace(/\\s/g, \"\").length === 0) { // Don't send just whitespace\n return;\n }\n\n //data to send\n var data = {\n type: \"message\",\n id: generateMessageId(getUserId(), text),\n author: selfEasyrtcid,\n date: getDate(),\n parentMessageId: getSelectedNodeId(),//getParentMessageId(),// makes it dynamic.\n content: text\n };\n\n //sends data to server\n sendData(\"message\", data);\n\n //will generate message node on client\n addToRoom(\"message\", JSON.stringify(data));\n\n //saves message to db\n addMessagetoDB(data);\n\n //empties text field\n document.getElementById('sendMessageText').value = \"\";\n}", "title": "" }, { "docid": "45c8358a716f0f3212bbfa27515bc24d", "score": "0.70382726", "text": "sendMessage(options) {\n return this.execute('sendMessage', options);\n }", "title": "" }, { "docid": "7778c4e3782a3e5db47a3c6f00f9619f", "score": "0.70196223", "text": "function sendMessageText() {\n var msg = id(\"sendMessageText\").value;\n\n if (msg.length > 0) {\n var msgLength = dataWriter.measureString(msg);\n dataWriter.writeInt32(msgLength);\n dataWriter.writeString(msg);\n dataWriter.storeAsync().done(\n function (byteCount) {\n if (byteCount > 0) {\n id(\"messageDiv\").innerHTML += \"Message sent: \" + msg + \"<br />\";\n } else {\n id(\"messageDiv\").innerHTML += \"The remote peer closed the socket.\";\n closeSocket();\n }\n },\n function (err) {\n id(\"messageDiv\").innerHTML += \"Send error: \" + err.message + \"<br />\";\n closeSocket();\n });\n }\n }", "title": "" }, { "docid": "91a0191276d81e628bc030b411f2a997", "score": "0.7017866", "text": "sendMessage() {\n\n const userMessage = {\n message: this.newMessage,\n status: 'sent',\n date: dayjs().format('DD/MM/YYYY HH:mm:ss'),\n }\n\n if (!this.newMessage) {\n return;\n } else {\n this.contacts[this.currentChat].messages.push(userMessage);\n this.newMessage = '';\n }\n\n // risposta cpu dopo un secondo\n setTimeout(this.receiveMessage, 3000);\n }", "title": "" }, { "docid": "7ea216267819f162ae8fee6465b9d41f", "score": "0.7012519", "text": "function sendMessage() {\n // Construct a msg object containing the data the server needs to process the message from the chat client.\n var msg = {\n type: \"message\",\n text: jq(\"#ATOMspyPopUpDiv\").attr('obj-prop'),\n id: \"objInfo\",\n date: Date.now()\n };\n\t\n //connection.send(JSON.stringify(msg));\n connection.send(jq(\"#ATOMspyPopUpDiv\").attr('obj-prop'))\n\n connection.onmessage = function(msg){\n \tvar uiRsp=JSON.parse(msg.data).data.text\n if (uiRsp.substring(0, 6)=='UIResp'){\n var msgToShow=uiRsp.split('::')[1];\n var msgtoShowtype\n if (msgToShow.search(\"Already\")>0) {\n \tmsgtoShowtype=\"Error!!!\"\n } else {\n \tmsgtoShowtype=\"Message\"\n }\n \n showAlert(msgtoShowtype,msgToShow);\n }\n \n }\n\t\t\n }", "title": "" }, { "docid": "17b0d1eaf37ee7f5993a4d57a8b65501", "score": "0.700428", "text": "function sendMessage(client, str) {\n client.send(str);\n}", "title": "" }, { "docid": "a2c67d72321f50bba1b28258e75343dc", "score": "0.698175", "text": "sendMessage() {\n const {input} = this.elements;\n const value = input.value;\n if (value === '') {\n return;\n }\n input.value = '';\n drone.publish({\n room: selectedRoom,\n message: value,\n });\n addMessageToRoomArray(selectedRoom, me, value);\n this.addMessageToList(value, me);\n }", "title": "" }, { "docid": "e93d47126d67b038d49321ac9c5f0361", "score": "0.69717455", "text": "function sendMessage(data) {\n\t\tlog('sendMessage', data);\n\t\tthread.sendMessage(data);\n\t}", "title": "" }, { "docid": "37e32a26259c14a47af05dd67ae0ee93", "score": "0.6965919", "text": "function sendMessage() {\n\tvar inputText = document.getElementById('chatinput').value;\n\tvar message = {'type': 'message', 'message': inputText};\n\tconn.send(JSON.stringify(message));\n\t\n\taddMessageToScreen(inputText, \"You\");\n\t\n\t//Clear input field\n\tdocument.getElementById('chatinput').value = '';\n}", "title": "" }, { "docid": "24da4302c3adfbf94151ee8d6f5a8a34", "score": "0.6964402", "text": "function handleSendButton() {\n var msg = {\n text: chatBox.value,\n msgType: PEER_TEXT,\n id: uniqueId,\n name: myName,\n date: Date.now()\n };\n chatBox.value = \"\";\n var time = new Date(msg.date);\n var timeStr = time.toLocaleTimeString();\n if (msg.text.length) {\n for(var peer_id in dataChannels) {\n //simply try to send for each. Its okay if any one fails\n try {\n trace('sending to ' + peer_id);\n dataChannels[peer_id].send(JSON.stringify(msg));\n }catch(e) {\n trace(peer_id + ' Error sending msg: ' + e);\n }\n }\n updateChat(msg);\n }\n}", "title": "" }, { "docid": "c4b47777083fd86f10de6f90e0bd33d8", "score": "0.69547874", "text": "function sendMessage(msg) {\n self.clients.matchAll().then(res => {\n if (!res.length) {\n debug('SHIM SW Error: no clients are currently controlled.');\n } else {\n debug('SHIM SW Sending...');\n res[0].postMessage(msg);\n }\n });\n }", "title": "" }, { "docid": "417e58a4d2b3c415bc8d51b2587da906", "score": "0.69055134", "text": "_sendMessageFromUser (value) {\n let message = this._createNewMessage('you', this._validValue(value));\n this._viewNewMessage(message);\n this._goodCrashAnswers();\n }", "title": "" }, { "docid": "e2788109dced8a7d462f3394a8850a88", "score": "0.6899776", "text": "sendMessage(message) {\n if (this.handler) {\n this.handler.sendMessageFor(message, this.identity);\n }\n }", "title": "" }, { "docid": "5a8e6e686683117f50157cf13875fb88", "score": "0.68917394", "text": "function sendMessage(message){\n // show the messsage as an alert\n alert(message);\n}", "title": "" }, { "docid": "4b635fd2b9f4437c180baee9b9ca7a75", "score": "0.68869627", "text": "sendMessage() {\n if (this.state.value.length <= 0) return;\n\n if (this.props.openContinueModal) {\n this.props.openContinueModal();\n return;\n }\n this.setState({ busy: true });\n\n const htmlBody = new Markdown(this.state.value).toHtml();\n\n if (this.props.mxEvent == null) {\n // Message is not a reply\n this.props.client.sendHtmlMessage(this.props.roomId, this.state.value, \n htmlBody, this._msgCallback);\n } else {\n // Message is a reply\n this.props.client.sendMessage(this.props.roomId, \n this._constructReply(htmlBody), null, this._msgCallback);\n this.props.unsetReply();\n }\n this.setState({ value: '' });\n }", "title": "" }, { "docid": "de67166466d4bc3da4cdc460619af3f4", "score": "0.6883992", "text": "sending () {\n }", "title": "" }, { "docid": "76e6ead043088d1cb45191f3cd5421c3", "score": "0.6878705", "text": "function sendMessage() {\n const message = Buffer.from(`Message from process ${process.pid}`);\n \n socket.send(message, 0, message.length, PORT, MULTICAST_ADDR, function() {\n console.info(`Sending message \"${message}\"`);\n });\n}", "title": "" }, { "docid": "f1f21a63fd297ade2424201ef28bb183", "score": "0.6878418", "text": "sendMessage() {\n let id = this.generateID();\n let unix = this.generateTimestamp();\n let message = {\"id\": id, \"to\": this.props.pair.receiver, \"from\": this.props.pair.sender, \"body\": this.state.messages[0].text, \"time\": unix, \"read\": true};\n // add to senders persistant storage\n this.props.addMessage(message);\n // set same message object but with read set to false for the reciever\n message = {\"id\": id, \"to\": this.props.pair.receiver, \"from\": this.props.pair.sender, \"body\": this.state.messages[0].text, \"time\": unix, \"read\": false};\n setTimeout(function(){\n Actions.lockbox({title:\"Encrypt Message\", mode: \"encrypt\", message: message, returnTo: \"thread\"});\n }, 100);\n }", "title": "" }, { "docid": "be62db02818270751ec8e68c6c10ba42", "score": "0.68747437", "text": "sendUserMessage(text) {\n this.state.currentUser.sendMessage({\n text,\n roomId: this.state.currentRoom.id\n });\n }", "title": "" }, { "docid": "57ae4d5c45df6fc006054276e28b6575", "score": "0.6873268", "text": "sendMessage(message) {\n self.socket.emit('message', message);\n }", "title": "" }, { "docid": "70b40b644767c9f19208dd5d5beb9d7f", "score": "0.6871115", "text": "function sendMessages(type){\n\n var message = \"\";\n switch(type){\n case 'fall':\n message = 'I think I\\'m falling';\n break;\n case 'stroke':\n message = 'I think I\\'m having a stroke';\n break;\n case 'heartattack':\n message = 'I think I\\'m having a heart attack';\n break;\n case 'other':\n message = 'I need help.'\n break;\n }\n\n\n action.forEach(function(profile){\n\n console.log(profile);\n\n client.sendMessage({\n from: '+16473609283',\n to: profile.phoneNumber,\n body: message\n }, function(err, responseData){\n if (!err){\n console.log('Hello, it\\'s me.');\n }else{\n console.log(err);\n }\n });\n });\n\n}", "title": "" }, { "docid": "0fdfa87f77e13facdba7fdabb2aa21ec", "score": "0.68559223", "text": "function sendMessage (message) {\n\n // no message no fun\n if (!message || !message.event) { return; }\n\n switch (message.type) {\n\n case \"client\":\n if (clients[message.dest]) {\n clients[message.dest].emit(message.event, message.data);\n }\n break;\n\n case \"session\":\n for (var i in sessions[message.dest]) {\n var clientId = sessions[message.dest][i];\n if (clients[clientId]) {\n clients[clientId].emit(message.event, message.data);\n }\n }\n break;\n\n case \"group\":\n // TODO\n break;\n\n case \"all\":\n for (var clientId in clients) {\n clients[clientId].emit(message.event, message.data);\n }\n break;\n }\n}", "title": "" }, { "docid": "63ee9ff4d772e1c77ac665fd80646324", "score": "0.68503594", "text": "sendMessage({ sender, receiver, message }) {\n\t\tconsole.log(`${sender.userName} dice ${message} a ${receiver.userName}`);\n\t}", "title": "" }, { "docid": "5906f127910bf2e1339c660ace2cbdfd", "score": "0.68502575", "text": "sendMessage(content_message)\n {\n\n let recipient = this.props.participants.get(this.props.currentUser);\n let sender = this.props.participants.get(recipient)\n\n let message = {\n content : content_message,\n recipient : recipient,\n sender: sender,\n fkConversation : this.props.conversation,\n date:Date.now()\n }\n this.client.send('/EZChat/'+message.fkConversation.id+'/private',{},JSON.stringify(message))\n }", "title": "" }, { "docid": "e137f40562e323e3d45e59af9d930654", "score": "0.6845081", "text": "function sendMessage(message) {\n if (message !== \"\" && players == \"double\") {\n \tconsole.log(\"typed + message\" + message);\n webSocket.send(message);\n id(\"message\").value = \"\";\n }\n}", "title": "" }, { "docid": "6bf3ccce1174563617dd4a82d0dff00f", "score": "0.6843932", "text": "function sendMessage() {\r\n\tvar input = tabs.getActiveTab().getComponent(tabs.getActiveTab().title + 'inputField');\r\n\tvar msg = input.getValue();\r\n if(msg != '') {\r\n \tmsg = cleanMessage(msg);\r\n addMessage(currentUserName, msg, tabs.getActiveTab().title);\r\n\r\n conn.request({\r\n url: CONTACT_LIST_JSON_URL,\r\n method: 'POST',\r\n params: { method: \"sendMessage\", recipient:tabs.getActiveTab().title, message:msg},\r\n\t\t success: function(responseObject) {\r\n input.reset();\r\n },\r\n failure: function() {\r\n\t Ext.Msg.alert(getLocalizationValue('application.javascript.messagingWindow.alert.errorTitle'), getLocalizationValue('application.javascript.messagingWindow.alert.errorMsg'));\r\n }\r\n });\r\n\r\n input.focus();\r\n }\r\n}", "title": "" }, { "docid": "9f90907f4fbfbbc2b17c24657bc064a0", "score": "0.68385655", "text": "async function sendMessage(event) {\n var input = document.getElementById(\"messageText\");\n //#ws.send(JSON.stringify(mess))\n let mess = {\n type: \"text\",\n from: `${user}`,\n message: input.value,\n time: Date.now(),\n broadcast: false,\n course_name: eBookConfig.course,\n div_id: currentQuestion,\n };\n await publishMessage(mess);\n var messages = document.getElementById(\"messages\");\n var message = document.createElement(\"li\");\n message.classList.add(\"outgoing-mess\");\n var content = document.createTextNode(`${user}: ${input.value}`);\n message.appendChild(content);\n messages.appendChild(message);\n input.value = \"\";\n // not needed for onclick event.preventDefault()\n}", "title": "" }, { "docid": "d8e5b9e04947cd3ecc5578da04ccc483", "score": "0.6837297", "text": "sendTo(id, message) {\n var player = this.players.find((p) => p.id === id);\n player.connection.send(JSON.stringify(message));\n }", "title": "" }, { "docid": "87f8a01ee0593932faa4d4839fceb64f", "score": "0.68362117", "text": "function sendMessage() {\n const messageToSend = messageInput.value.replace(/\\r?\\n|\\r/g, '');\n const trimmed = messageToSend.replace(/(\\s)/g, '');\n\n if (trimmed.length > 0) {\n pubnub.publish({\n channel: currentlySelectedChat,\n message: {\n sender_name: username, // this can be spoofed in this implementation\n text: messageToSend\n }\n });\n }\n\n messageInput.value = '';\n}", "title": "" }, { "docid": "e17b46519a274e5ec29c4a1acc6c40d3", "score": "0.68324715", "text": "function sendMessage(type, content, visgoth_content) {\n ws.send(JSON.stringify({\n \"type\": type,\n \"content\": content,\n \"visgoth_content\": visgoth_content,\n }));\n}", "title": "" }, { "docid": "538e3b151caf2b20582f1d224ac242d7", "score": "0.683067", "text": "function sendMessage(myName, myMessage) {\r\n const d = new Date();\r\n const h = d.getHours();\r\n const m = d.getMinutes();\r\n const s = d.getSeconds();\r\n const newMsg = messageLine.value;\r\n const allMsg = `<br>${h}:${m}:${s} ${myName}: ${myMessage}`;\r\n return allMsg;\r\n}", "title": "" }, { "docid": "14c6dfc9092c17a2eabd49039fa92b4a", "score": "0.6820913", "text": "function sendMessage(to, message, id) {\n let msg = candy.starwave.createMessage(message, to, undefined, id);\n candy.starwave.sendMessage(msg);\n}", "title": "" }, { "docid": "2c3a84f276d54ba12765d2733d7ca53b", "score": "0.68193454", "text": "sendMessage(type, data) {\n const message = { type: type, data: data };\n this.connection.send(JSON.stringify(message)); //La méthode JSON.stringify() convertit une valeur JavaScript en chaîne JSON\n }", "title": "" }, { "docid": "288e3f42d5036e220d8d06a0b2a082e6", "score": "0.6819301", "text": "function sendMessage(message){\n console.log('Sending message: ', message);\n socket.emit('message', message);\n}", "title": "" }, { "docid": "5d8087b88a0fdb864a7c171af39700f6", "score": "0.68154275", "text": "sendMessage(id, data) {\n if (process.send) {\n process.send({\n id,\n data,\n });\n }\n }", "title": "" }, { "docid": "f833ff5632ccf49c89f156dc42ab562d", "score": "0.68147486", "text": "newMessage(userName, messageText) {\n const newMessageObj = {\n type: 'user',\n username: userName,\n content: messageText\n };\n console.log('about to send:', newMessageObj);\n this.socket.send(JSON.stringify(newMessageObj));\n }", "title": "" }, { "docid": "004c725613552dacc1b25b0ea1edd279", "score": "0.68128306", "text": "function sentMsgConsole(messageChatched) {\n console.log(\"inviato \", messageChatched);\n}", "title": "" }, { "docid": "9a422e8bf6295bed5a853cfecc01f8ac", "score": "0.681095", "text": "function onSendMessage(e)\n{\n\tvar self = this;\n\te.preventDefault();\n\n\tshh.post({\n\t\t\"from\": this.identity,\n\t\t\"topic\": [ web3.fromAscii(TEST_TOPIC) ],\n\t\t\"payload\": [ web3.fromAscii(self.messagePayload()) ],\n\t\t\"ttl\": 1000,\n\t\t\"priority\": 10000\n\t});\n}", "title": "" }, { "docid": "1ae5085aa90e6eeacafa08a27d31191d", "score": "0.6806377", "text": "onSend() {\n this.sendMSG(this.state.message)\n }", "title": "" }, { "docid": "17480856eaa197a9cb6f746cc2078025", "score": "0.6795671", "text": "function sendMessage(message){\n\n let msg = {\n user: name,\n message: message.trim() //to trim the extra spaces in textarea\n }\n\n //now we have to append the msg into the box with username specifying msg type\n\n appendMessage(msg, 'outgoing_msg')\n textarea.value = \"\" //as soon as msg is sent, empty the text area\n scrollBottom()\n\n //send to server via web-socket\n socket.emit('message', msg) //now this can be listen in server.js\n \n}", "title": "" }, { "docid": "3e12f99a5366f48081c0ecbab375b71b", "score": "0.67791325", "text": "sendMessage() {\n const currentTime = new Date();\n this.state.socket.send(JSON.stringify({\n who_send: Cookie.get('userId'),\n message: this.messageRef.current.value,\n time: currentTime.toISOString().replace(/T/, ' ').replace(/\\..+/, ''),\n person: this.state.selected_contact\n }));\n }", "title": "" }, { "docid": "aa3a1a11406a30d6e71865b244eaec88", "score": "0.67673105", "text": "function sendMessage(message){\n socket.emit('message', message);\n}", "title": "" }, { "docid": "f117fcfa18a255a898a7f3f55793c534", "score": "0.6758276", "text": "function sendMessage(message) {\n\tdrone.publish({\n\t room: roomName,\n\t message\n\t});\n }", "title": "" }, { "docid": "212a374c81039c7ad436a5b20645e91a", "score": "0.67574835", "text": "function sendMessage(message){\n console.log('Sending message: ', message);\n socket.emit('message', {\n 'destination' : destination,\n 'msgObj' : message\n });\n}", "title": "" }, { "docid": "eb42963782b9c2c068ccbad1f2688d52", "score": "0.6754491", "text": "function sendMessage(content){\n\tsocket.emit('relay_me', {username:username, content:content});\n}", "title": "" }, { "docid": "2995b097ebc996938aaf7b738db6ad29", "score": "0.67444557", "text": "static async sendText(sessionName, number, text) {\r\n var session = Sessions.getSession(sessionName);\r\n if (session) {\r\n let checar = Sessions.setConnection(sessionName); //Obriga a mudar para CONNECTED\r\n if (session.state == \"CONNECTED\" || session.state == \"CONFLICT\") {\r\n // Corrigir conflito\r\n var resultSendText = await session.client.then(async (client) => {\r\n if (session.state == \"CONFLICT\") {\r\n client.useHere();\r\n } // Forçar uso.\r\n const user = await client.getNumberProfile(number + \"@c.us\");\r\n console.log(user);\r\n\r\n const messages = await client.getAllUnreadMessages();\r\n console.log(\"Mensagens\", messages);\r\n\r\n return await client.sendText(number + \"@c.us\", text);\r\n });\r\n return { result: \"success\" };\r\n } else {\r\n return { result: \"error\", message: session.state };\r\n }\r\n } else {\r\n return { result: \"error\", message: \"NOTFOUND\" };\r\n }\r\n }", "title": "" }, { "docid": "add526eb36a451b9901e3cc990034125", "score": "0.67404544", "text": "function sendMessage(inputValue) {\n console.log('message sent:', inputValue);\n\n // create new message object to add to the messages array in state\n const newMessage = {\n username,\n message: inputValue,\n };\n\n const newMessages = [...messages, newMessage];\n\n // adds new message to state\n setMessages(newMessages);\n\n // emit message via socket\n socket.emit('sendMessage', newMessage);\n }", "title": "" }, { "docid": "1a7512994c6e96ec5603c01e02e4fb71", "score": "0.6736714", "text": "sendMessage(userID, message) {\n Dispatcher.handleViewAction({\n type: ActionTypes.SEND_MESSAGE,\n userID: userID,\n message: message,\n timestamp: +new Date(),\n })\n }", "title": "" }, { "docid": "f8e313bb556ea84ee9969180f4830531", "score": "0.6733946", "text": "function sendTheMessage() {\r\n\r\n console.log(\"sending data: \\\"\", sendText, \"\\\"\");\r\n // Send Data to the server to draw it in all other canvases\r\n dataServer.publish(\r\n {\r\n channel: channelName,\r\n message:\r\n {\r\n text: sendText //text: is the message parameter the function is expecting\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "b6324c29ecbd48c519bb95050130de54", "score": "0.6725673", "text": "async sendMessage({ request }) {\n const sender_id = request.input(\"sender_id\");\n const room_id = request.input(\"room_id\");\n const message = request.input(\"message\");\n if (sender_id && room_id && message) {\n await chatkit\n .sendMessage({\n userId: sender_id,\n roomId: room_id,\n text: message\n })\n .then(console.log(\"Message Sent\"))\n .catch(err => console.error(err));\n }\n }", "title": "" }, { "docid": "8b81225928f09f4d6b500845c268293c", "score": "0.6722215", "text": "function sendMessage (message) { socket.emit('new message', cleanInput(message)); }", "title": "" }, { "docid": "1fe1053c449fbd37196672e29cc9661c", "score": "0.67217124", "text": "function messageSend(message) {\n sendMessage(message, roomID);\n }", "title": "" }, { "docid": "2db52c7dd596adbef55d9b284d1c92bf", "score": "0.67183405", "text": "function sendMessage(msg, chan)\n\t{\n\t\tif(msg !== ''){\n\t\t\tmod.toServer('C_CHAT', 1, {\n\t\t\t\tchannel: chan,\n\t\t\t\tmessage: msg\n\t\t\t});\n\t\t}\n\t}", "title": "" } ]
8cc45d712ab72f36b41bbf0d18f12122
create element & render cafe
[ { "docid": "e2bb9c33f3b1f8019e1f7b38662ce7d5", "score": "0.0", "text": "function renderRequest(doc) {\n // li\n let li = document.createElement('li');\n li.setAttribute('data-id', doc.id);\n\n // requester\n let requester = document.createElement('span');\n requester.textContent = doc.data().requester;\n li.appendChild(requester);\n\n // content\n let content = document.createElement('span');\n content.textContent = doc.data().sort + ': ' + doc.data().content;\n li.appendChild(content);\n\n // date\n let date = document.createElement('span');\n date.textContent = 'Aangevraagd op: ' + doc.data().date;\n date.style.fontSize = '0.8em';\n li.appendChild(date);\n\n // imdb link\n if (doc.data().imdblink != \"\") {\n var imdblink = document.createElement('a');\n var linkText = document.createTextNode(\"Bekijk op IMDB\");\n imdblink.appendChild(linkText);\n imdblink.title = doc.data().imdblink;\n imdblink.href = doc.data().imdblink;\n li.appendChild(imdblink);\n }\n\n // status\n li.style.backgroundRepeat = 'no-repeat';\n li.style.backgroundPosition = 'right';\n li.style.backgroundSize = '60%';\n switch (doc.data().status) {\n case '0': // pending\n li.style.backgroundImage = 'url(\\'img/pending_trans.jpg\\')';\n li.style.backgroundColor = pending;\n break;\n case '1': // finished\n li.style.backgroundImage = 'url(\\'img/finished_trans.jpg\\')';\n li.style.backgroundColor = finished;\n break;\n case '-': // no can do\n li.style.backgroundImage = 'url(\\'img/no_can_do_trans.jpg\\')';\n li.style.backgroundColor = nocando;\n break;\n case 'b': // bezig\n li.style.backgroundImage = 'url(\\'img/busy_trans.jpg\\')';\n li.style.backgroundColor = progress;\n break;\n default:\n }\n\n if (firebase.auth().currentUser) {\n // cross\n let cross = document.createElement('div');\n cross.textContent = 'x';\n li.appendChild(cross);\n // deleting data\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute('data-id');\n db.collection('requests').doc(id).delete();\n });\n\n // update\n let update = document.createElement('div');\n update.className = 'update';\n update.textContent = 'Verander status';\n // drop down\n let drop = document.createElement('div');\n drop.className = 'drop';\n let btn1 = document.createElement('button');\n btn1.textContent = 'Finished';\n btn1.addEventListener('click', (e) => {\n let id = e.target.parentElement.parentElement.parentElement.getAttribute('data-id');\n db.collection('requests').doc(id).update({\n status: '1'\n });\n });\n drop.appendChild(btn1);\n let btn2 = document.createElement('button');\n btn2.textContent = 'Pending...';\n btn2.addEventListener('click', (e) => {\n let id = e.target.parentElement.parentElement.parentElement.getAttribute('data-id');\n db.collection('requests').doc(id).update({\n status: '0'\n });\n });\n drop.appendChild(btn2);\n let btn3 = document.createElement('button');\n btn3.textContent = 'No Can Do';\n btn3.addEventListener('click', (e) => {\n let id = e.target.parentElement.parentElement.parentElement.getAttribute('data-id');\n db.collection('requests').doc(id).update({\n status: '-'\n });\n });\n drop.appendChild(btn3);\n let btn4 = document.createElement('button');\n btn4.textContent = 'In Progress...';\n btn4.addEventListener('click', (e) => {\n let id = e.target.parentElement.parentElement.parentElement.getAttribute('data-id');\n db.collection('requests').doc(id).update({\n status: 'b'\n });\n });\n drop.appendChild(btn4);\n update.appendChild(drop);\n\n li.appendChild(update);\n }\n // add to list\n requestList.prepend(li);\n}", "title": "" } ]
[ { "docid": "2022b874dfbb0b34a411d646bb6704f4", "score": "0.7041105", "text": "function renderCafe(doc){\n let li = document.createElement('li');\n let name = document.createElement('span');\n let city = document.createElement('span');\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().data_humidity;\n city.textContent = doc.data().data_ph;\n\n li.appendChild(name);\n li.appendChild(city);\n \n console.log(\"rendered\");\n\n cafeList.appendChild(li);\n}", "title": "" }, { "docid": "67c670597f6ceb88fff3b880b7f9d0b6", "score": "0.67421937", "text": "function renderCafe(doc){\n let li = document.createElement('li');\n let name = document.createElement('span');\n let amount = document.createElement('span');\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n amount.textContent = doc.data().amount;\n\n li.appendChild(name);\n li.appendChild(amount);\n\n itemList.appendChild(li);\n}", "title": "" }, { "docid": "e8c0bf5cc57bd46cac3e7677b0db8cb6", "score": "0.66211027", "text": "function renderCafe(doc) {\r\n let li = document.createElement(\"div\");\r\n li.setAttribute(\"class\", \"form_detail\");\r\n\r\n let name = document.createElement(\"div\");\r\n name.setAttribute(\"class\", \"pad name_input\");\r\n\r\n let address = document.createElement(\"div\");\r\n address.setAttribute(\"class\", \"pad address_input\");\r\n\r\n let date = document.createElement(\"div\");\r\n date.setAttribute(\"class\", \"pad date_input\");\r\n\r\n let expiry_date = document.createElement(\"div\");\r\n expiry_date.setAttribute(\"class\", \"pad expirydate_input\");\r\n\r\n let phone = document.createElement(\"div\");\r\n phone.setAttribute(\"class\", \"pad phone_input\");\r\n\r\n let food = document.createElement(\"div\");\r\n food.setAttribute(\"class\", \"pad food_input\");\r\n\r\n let quantity = document.createElement(\"div\");\r\n quantity.setAttribute(\"class\", \"pad quantity_input\");\r\n\r\n\r\n let cross = document.createElement(\"div\");\r\n\r\n li.setAttribute(\"data-id\", doc.id);\r\n\r\n name.textContent = doc.data().name;\r\n address.textContent = doc.data().address;\r\n date.textContent = doc.data().date;\r\n expiry_date.textContent = doc.data().expiry_date;\r\n phone.textContent = doc.data().phone;\r\n food.textContent = doc.data().food;\r\n quantity.textContent = doc.data().quantity;\r\n\r\n cross.textContent = \"x\";\r\n\r\n name.textContent = 'Name: ' + name.textContent;\r\n address.textContent = 'Address: ' + address.textContent;\r\n date.textContent = 'Date and Time: ' + date.textContent;\r\n expiry_date.textContent = 'Date of Expiry: ' + expiry_date.textContent;\r\n phone.textContent = 'Contact: ' + phone.textContent;\r\n food.textContent = 'Food present: ' + food.textContent;\r\n quantity.textContent = 'Number of people who can be fed: ' + quantity.textContent;\r\n\r\n // name=\"Name: \"+name;\r\n li.appendChild(name);\r\n li.appendChild(address);\r\n li.appendChild(date);\r\n li.appendChild(expiry_date);\r\n li.appendChild(phone);\r\n li.appendChild(food);\r\n li.appendChild(quantity);\r\n\r\n\r\n //li.appendChild(cross);\r\n\r\n cafeList.appendChild(li);\r\n\r\n //delete data\r\n cross.addEventListener(\"click\", (event) => {\r\n event.stopPropagation();\r\n let id = event.target.parentElement.getAttribute(\"data-id\");\r\n db.collection(\"cafes\").doc(id).delete();\r\n });\r\n}", "title": "" }, { "docid": "c3a000afde5f9ff28bf2113007764ca9", "score": "0.6494695", "text": "function renderCafe(doc){\n let li = document.createElement('li');\n let name = document.createElement('span');\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().RAM;\n\n\n li.appendChild(name);\n\n\n myList.appendChild(li);\n}", "title": "" }, { "docid": "d5706b8978e4830b97731852c8da0c0b", "score": "0.61462736", "text": "function renderCoffee(coffee) {\n var html = '<div class=\"coffee-card card d-flex align-items-center border-0 m-2\">';\n html += '<div class=\"card-body m-3 w-100 d-flex justify-content-center \"><img src=\"img/bean.png\" height=\"50px\" alt=\"\">' + '</div>';\n html += '<span>' + coffee.name + '</span>';\n html += '<span>' + coffee.roast + '</span>';\n html += '</div>';\n return html;\n}", "title": "" }, { "docid": "895c7fe24a0d8961993b688c4637ea97", "score": "0.611871", "text": "function renderListCafe(doc){\n\n let li = document.createElement('li');\n let title = document.createElement('h2');\n let ingredient = document.createElement('span');\n\n li.setAttribute('id' , doc.id);\n title.textContent = doc.data().title;\n ingredient.textContent = doc.data().ingredient;\n\n li.appendChild(title);\n li.appendChild(ingredient);\n listCafe.appendChild(li);\n}", "title": "" }, { "docid": "be16673f3b0cfa60f1b862d24137e0f7", "score": "0.6107693", "text": "_render() {\n // Text and icon are inside selectorDetails\n const selectorDetails = htmlHelper.createDivWithClass('selectorDetails');\n const i = htmlHelper.createIconWithClass(this.icon, '');\n const text = htmlHelper.createDivWithTextAndClass(this.text, 'description');\n \n selectorDetails.appendChild(i);\n selectorDetails.appendChild(text);\n\n this.contentSelector.appendChild(selectorDetails);\n }", "title": "" }, { "docid": "c97e36e138b8b1258036a1f6b17e0af4", "score": "0.60426766", "text": "function buildUI(object) {\n let card = document.createElement(\"div\");\n card.classList.add(\"card\", \"flex-c\", \"flex-31\");\n let cardImage = document.createElement(\"img\");\n cardImage.src = object.image;\n cardImage.setAttribute(\"alt\", object.name);\n cardImage.setAttribute(\"data-id\", object.name);\n let cardName = document.createElement(\"h2\");\n cardName.innerText = object.name;\n let cardDes = document.createElement(\"p\");\n cardDes.innerText = object.description;\n let button = document.createElement(\"button\");\n button.innerText = \"KNOW MORE!\";\n card.append(cardImage, cardName, cardDes, button);\n cards.append(card);\n}", "title": "" }, { "docid": "0c9a4d4ff30372abf9f0bf58bc639f9c", "score": "0.6037022", "text": "create(element, scenes, show_controls) {\r\n this.patch_ios_bug();\r\n element = document.querySelector(\"#\" + element);\r\n try {\r\n this.populate_canvas(element, scenes, show_controls);\r\n } catch (error) {\r\n element.innerHTML = \"<H1>Error loading the demo.</H1>\" + error\r\n }\r\n }", "title": "" }, { "docid": "f8e8612988bd3d69099681c815cc9525", "score": "0.60079944", "text": "function buildCruiseDomNode(cruise) {\n let cruiseLi = document.createElement(\"div\");\n\n cruiseLi.innerHTML =\n `<div class=\"card mt-2\">\n <div class=\"card-header\"> ${cruise.offer_name} </div>\n\n <div class=\"card-body\">\n <div class=\"card-body__left pr-4\">\n <p> <b>Offer Name</b>: ${cruise.offer_name} </p>\n <p> <b>Departure Date:</b> ${cruise.departure_date} </p>\n <p> <b>Itinerary:</b> ${cruise.itinerary} </p>\n </div>\n\n <div class=\"card-body__right\">\n <img src=\"/images/${cruise.cruise_line_logo}\" />\n </div>\n </div>\n </div>`\n\n return cruiseLi\n}", "title": "" }, { "docid": "0c0e6ee6ac3e48bc8ab678e9ec91a079", "score": "0.59731776", "text": "function renderCafe(doc) {\n let li = document.createElement(\"li\");\n let name = document.createElement(\"span\");\n let city = document.createElement(\"span\");\n let cross = document.createElement(\"div\");\n\n li.setAttribute(\"data-id\", doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n cross.textContent = \"x\";\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n\n cafeList.appendChild(li);\n\n //deleting data\n cross.addEventListener(\"click\", (e) => {\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute(\"data-id\");\n db.collection(\"cafe\").doc(id).delete();\n });\n}", "title": "" }, { "docid": "bfcc6c08775535647ea89908507d9836", "score": "0.5963753", "text": "function renderCafe(doc){\n let li = document.createElement(\"li\"); \n let city = document.createElement('div');\n\n li.setAttribute('data-id', doc.id)\n city.innerHTML = doc.data().city;\n city.onclick = function(){restaurantTableMaker(doc.id)};\n li.appendChild(city); // make the list using text made from the firebase data.\n\n cafelist.appendChild(li); // add the list to the HTML element\n }", "title": "" }, { "docid": "6cac5971ee843b6018232e66f5788450", "score": "0.5955607", "text": "function renderCoffee(coffee) {\n\n let html = '<div class=\"coffee\">';\n // html += coffee.id;\n html += '<div>' + '<span class=\"coffeeName\">' + coffee.name + '<span class=\"text-muted coffeeRoast\">' + coffee.roast + '</span>' + '</div>';\n\n html += '</div>';\n\n return html;\n}", "title": "" }, { "docid": "5d4b6bf547036bc6aa7fd6555f63f292", "score": "0.59390163", "text": "render() {\n this.element.innerHTML =\n `\n <h2>${this.title}</h2>\n <img src=\"${this.image}\">\n `\n this.element.classList.add(\"card\")\n return this.element\n }", "title": "" }, { "docid": "f8f8e2676233d0698608746610b73b5e", "score": "0.59240454", "text": "createDomElement() {\n var domElement = $(\"<div>\")\n .addClass(\"card\")\n .css(\"background-image\", \"url(\" + this.image + \")\")\n .click(this.clickHandler);\n this.domElement = domElement;\n return domElement;\n }", "title": "" }, { "docid": "dad933f3c034c1cf98045b4f9e981a9a", "score": "0.5905743", "text": "_createCard() {\n if (this._blockElements && this._props) {\n this._createDomElement();\n this._setBookmark();\n this._updateDomElementContent();\n\n this._cardBookmarkIcon = this._domElement.querySelector('.card__bookmark-icon');\n }\n }", "title": "" }, { "docid": "e489ac79b3a6d9b0f1dff0fa6395c1ca", "score": "0.58828586", "text": "function createBordHolder() {\n const templat = `\n<div id=\"mainCardHolders\">\n <button class=\"btn navbar-btn btn-catcher add-button\">Add new List</button>\n </div>\n \n`\n document.querySelector('.main-screen').innerHTML = templat;\n }", "title": "" }, { "docid": "b798f93d0db7903734d85107b662d572", "score": "0.58553565", "text": "function generatePage(elem){\n content.insertAdjacentHTML('beforeend', \n `\n <div class='card'>\n <div class='card-name'>${elem.name}</div>\n <div class='card-photo'><img src=\"${elem.img}\"></div>\n <div class='card-info'>\n <span class='card-info_style'>Style: ${elem.style}</span>\n <span class='card-info_brand'>Brand: ${elem.brand}</span>\n <span class='card-info_count'>${elem.count} left </span>\n <span class='card-info_text'>Description: Lorem ipsum dolor sit amet consectetur adipisicing elit. Maiores esse ad sequi. Aliquam, sit, numqua.</span>\n </div>\n <div class='card-buy'>\n <div class='card-add-to-cart'>Add to cart</div>\n <div class='card-price'>${elem.price} €</div>\n </div>\n </div>`\n )\n}", "title": "" }, { "docid": "15f0c751747eea8a5d05bc61c77bd551", "score": "0.5842364", "text": "function generateDIV(cupcake) {\n return `\n<div class=\"col-sm\" data-cupcake-id=${cupcake.id}>\n<div class=\"card\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\"${cupcake.image}\" alt=\"(no image provided)\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${cupcake.flavor}</h5>\n <p class=\"card-text\"> ${cupcake.size} / ${cupcake.rating}</p>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "9f80966f85f10cc41ca5617f10fb1055", "score": "0.5787437", "text": "function renderPage (){\n const text = document.createElement('p');\n text.textContent= \"Yuki's cafe is a chill, laid back spot to enjoy a cup of coffee, grab a pastry, and relax with friends and family. Come check us out sometime! Of course this site is completely made up and this cafe does not exist, so good luck actually finding us. Go to our contact page to \\\"get in touch\\\".\";\n content.classList.add(\"content\");\n text.classList.add(\"page-text\");\n\n const icon = new Image();\n const iconDiv = document.createElement(\"div\");\n iconDiv.classList.add(\"coffee-img\");\n icon.src=HappyCoffee;\n icon.classList.add(\"coffee-icon\");\n document.body.appendChild(content);\n content.appendChild(text);\n content.appendChild(iconDiv);\n iconDiv.appendChild(icon);\n}", "title": "" }, { "docid": "66408bd2163fba4def3d94b743c4516d", "score": "0.57715523", "text": "function renderCafe(doc){\n\n let li = document.createElement('div');\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n let adhar = document.createElement('span');\n var img = document.createElement('img'); \n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n img.src = doc.data().img;\n adhar.textContent = doc.data().adhar;\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n li.appendChild(adhar);\n li.appendChild(img);\n li.classList.add(\"card\");\n cross.classList.add(\"close\");\n img.style.width = \"200px\";\n cafeList.appendChild(li);\n\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n console.log('clicked');\n cafeList.innerHTML='';\n let id = e.target.parentElement.getAttribute('data-id');\n db.collection('cafes').doc(id).delete().then(()=>getData());\n\n });\n}", "title": "" }, { "docid": "8a5d9988a6a6e9ca05d9f71e89541fde", "score": "0.5767025", "text": "_createElement() {\n this._parent.append(`<div class=\"${Select.classes.field}\"></div>`);\n this._parent.find(`.${Select.classes.field}`).append(`<div class=\"${Select.classes.text}\"></div>`);\n this._parent.append(`<div class=\"${Select.classes.dropdown}\"></div>`);\n this._parent.find(`.${Select.classes.dropdown}`).append(`<ul class=\"${Select.classes.list}\"></ul>`);\n this.options.each((i, elem) => {\n let optionValue = $(elem).html();\n this._parent.find(`.${Select.classes.list}`).append(`<li>${optionValue}</li>`);\n this._parent.find(`.${Select.classes.list} li`).eq(0).addClass(Select.classes.active);\n });\n }", "title": "" }, { "docid": "98a9bd41fb37f4120d392cfdcd28483a", "score": "0.5762786", "text": "function createBordHolder() {\n const templat = `\n<div id=\"mainCardHolders\">\n <button class=\"btn navbar-btn btn-catcher add-button\">Add new List</button>\n </div>\n \n`\n\n document.querySelector('.main-screen').innerHTML = templat;\n\n}", "title": "" }, { "docid": "4c3d0a09cf418d96912f1e5951cf6a2d", "score": "0.57573324", "text": "function build(){\n\n engine.common.tell('building',log);\n\n //sample greetings\n let greetings = engine.make.div({\n id:\"greetings\",\n parent:compId,\n class:'greetings',\n text:'greetings this is the image comp'\n });\n\n return true; //always return after build it can be\n\n}", "title": "" }, { "docid": "f20c39578c1582d751bf7ef5cbaafdbb", "score": "0.5753596", "text": "renderElement() {\n let Element = document.createElement('div');\n Element.classList.add('post');\n Element.setAttribute('data-postid', this.ID);\n\n let fieldset = document.createElement('fieldset');\n let legend = document.createElement('legend');\n let content = document.createElement('p');\n let createdAt = document.createElement('p');\n\n content.innerHTML = this.Content.replace(/(?:\\r\\n|\\r|\\n)/g, '<br>');\n legend.innerHTML = this.Title;\n createdAt.innerHTML = \"Created at: \" + this.CreatedAt;\n\n fieldset.appendChild(legend);\n fieldset.appendChild(content);\n fieldset.appendChild(document.createElement('hr'));\n fieldset.appendChild(createdAt);\n\n Element.appendChild(fieldset);\n\n this.PostElementReady = true;\n this.PostElement = Element;\n }", "title": "" }, { "docid": "863585c2b36f5c1205d0ef0cc02861f3", "score": "0.5749111", "text": "build() {\n if (this.state !== STATE_INITIALIZED) {\n return;\n }\n\n this._element = this.hot.rootDocument.createElement('div');\n this.state = STATE_BUILT;\n }", "title": "" }, { "docid": "bd816a2aeb649b4baf3fab289a52e924", "score": "0.57460886", "text": "render() {\n //Fills the background to be unique among other games\n this.changeBackground();\n\n //Creating the page content\n let content = `<div class=\"details-container-top\">\n <div class=\"details-left\">\n <img src=\"${this.#game.background_image}\" alt=\"${this.#game.name}'s image\" style=\"width: 18rem;margin-top: 10px;\"><h1>${this.#game.name}</h1></img>\n <h4>Details</h4>\n <p><h5>Note</h5> ${this.#game.metacritic}</p>`;\n\n content += this.showGenres();\n content += this.showDevelopers();\n\n content += `\n <p><h5>Release date</h5> ${this.#game.released}</p>\n <p><h5>Platforms</h5> ${getPlatformsAsTag(this.#game.parent_platforms)}</p>\n <button class=\"btn btn-light\"> Add to favorites</button>\n </div>\n <div class=\"details-right\"><h4>Description</h4>${this.#game.description}</div>\n </div>\n <div class=\"details-container-bottom\">`;\n\n content += this.showScreenshots();\n\n content += this.showRelatives();\n\n content += `</div></div>`;\n\n return content;\n }", "title": "" }, { "docid": "368fded2dc3d14032c067067042ab6fc", "score": "0.5707078", "text": "function generateEngineerCard(engineer) {\n return `<div class=\"column is-one-quarter-desktop\">\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"media\">\n <div class=\"media-left\">\n <i class=\"fas fa-glasses fa-3x\"></i>\n </div>\n <div class=\"media-content\">\n <p class=\"title is-4\">${engineer.getName()}</p>\n <p class=\"subtitle is-6\">${engineer.getRole()}</p>\n </div>\n </div>\n \n <div class=\"content\">\n <p><span class=\"has-text-weight-bold\">ID:</span> ${engineer.getID()}</p>\n <p><span class=\"has-text-weight-bold\">Email:</span><a href=\"mailto:${engineer.getEmail()}\"> ${engineer.getEmail()}</a></p>\n <p><span class=\"has-text-weight-bold\">GitHub:</span><a href=\"https://github.com/${engineer.getGithub()}\"> ${engineer.getGithub()}</a></p>\n </div>\n </div>\n </div>\n </div>`\n}", "title": "" }, { "docid": "8dfc33b78780ee18bca9bcef852065cc", "score": "0.5704501", "text": "function buildPage() {\n //created preview part\n var previewElement = createPreview();\n //created items part\n var itemsElement = createItems();\n var mainContent = document.getElementsByClassName(\"mainContent\")[0];\n mainContent.appendChild(itemsElement);\n mainContent.appendChild(previewElement);\n}", "title": "" }, { "docid": "832873e7da2fab0ff66413b63769babb", "score": "0.5701529", "text": "function renderCafe(doc) {\n let li = document.createElement('li'); //for each document, DOM manipulation\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n\n li.setAttribute('data-id', doc.id); // sets attribute of li to id of the doucment\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n\n //documents appended to li tag\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n\n //appended to cafeList, displays on index\n cafeList.appendChild(li);\n\n //delete data\n cross.addEventListener('click', (e) => {\n let id = e.target.parentElement.getAttribute('data-id'); //gets the unique id for each doc\n db.collection('cafes').doc(id).delete(); //deletes document\n })\n}", "title": "" }, { "docid": "00000b0091041fef7df7610341d32d4c", "score": "0.57009834", "text": "renderElem() {\n const user = document.createElement(\"div\");\n user.className = \"user\";\n\n const thumbnail = document.createElement(\"img\");\n thumbnail.src = this.info.picture.thumbnail;\n user.appendChild(thumbnail);\n\n const name = document.createElement(\"h3\");\n name.appendChild(document.createTextNode(`${this.info.name.first} ${this.info.name.last}`));\n user.appendChild(name);\n\n const city = document.createElement(\"p\");\n city.textContent = `City: ${this.info.location.city}`;\n user.appendChild(city);\n\n const phone = document.createElement(\"p\");\n phone.textContent = `Phone: ${this.info.phone}`;\n user.appendChild(phone);\n \n this._elem = user;\n }", "title": "" }, { "docid": "2aae7ee410904f7526d8aa49b362b0f8", "score": "0.56874555", "text": "function rendercafe(doc){\n let li = document.createElement('li');\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n\n\n li.setAttribute('data-id',doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n\n\n cafelist.appendChild(li);\n\n //deleting data directly from the database\n\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute('data-id'); //we get the unique id of each item on the list from this line of code and stored in id varible.\n db.collection('myproject').doc(id).delete();\n })\n\n\n}", "title": "" }, { "docid": "f9b1c5db3115e34c68f53cc8b9678b37", "score": "0.5675071", "text": "function createDealersNewCardDivHTML() {\n obj.dealersNewCard = document.createElement(\"div\");\n obj.dealersNewCard.classList.add(\"dCard\", \"newCard\");\n obj.dealersNewCard.id = \"dealers-new-card\";\n}", "title": "" }, { "docid": "2747f082e3f1eae784483fce51a51cd7", "score": "0.5673392", "text": "function setupContainer() {\n var container = document.createElement('div');\n container.className = \"bevyup_chat_widget\";\n\n var html = \"\\\n<h2>Chat</h2>\\\n<div class='cw_chatArea'>\\\n <ul class='cw_list'></ul>\\\n <textarea class='cw_chatInput'></textarea>\\\n <div class='cw_chatStatus'></div>\\\n</div>\";\n container.innerHTML = html;\n return container;\n }", "title": "" }, { "docid": "349a51f7fea68a7bc22cd9456b0db978", "score": "0.5665767", "text": "function renderCafe(doc){\r\n let li = document.createElement('li');\r\n let name = document.createElement('span');\r\n let city = document.createElement('span');\r\n let cross = document.createElement('div');\r\n\r\n li.setAttribute('data-id', doc.id);\r\n name.textContent = doc.data().name;\r\n city.textContent = doc.data().city;\r\n cross.textContent = 'X';\r\n\r\n li.appendChild(name);\r\n li.appendChild(city);\r\n li.appendChild(cross);\r\n\r\n cafeList.appendChild(li);\r\n// deleting data\r\ncross.addEventListener('click', (e) =>{\r\n //stops continous propagation of the event (optional but prevents errors)\r\n e.stopPropagation();\r\n //grabs attribute tied to UI element (which is also connected to Firebase ID)\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n //queries firestore and deletes that id\r\n db.collection('cafes').doc(id).delete();\r\n\r\n})\r\n}", "title": "" }, { "docid": "b326222570710fc39ef63710affa5e6d", "score": "0.5659859", "text": "createElement() {\n \n }", "title": "" }, { "docid": "12655b1c37403442917530a1839f749f", "score": "0.56594086", "text": "function build(){\n\n engine.common.tell('building',log);\n\n //sample greetings\n let greetings = engine.make.div({\n id:\"greetings\",\n parent:compId,\n class:'greetings',\n text:'greetings this is the about comp'\n });\n\n return true; //always return after build it can be\n\n}", "title": "" }, { "docid": "a5c655187764f4ca528696fa4d42e8d1", "score": "0.5624737", "text": "_buildElement() {\r\n // Set the element's styling and position on page\r\n const positions = this.data.position.split(',');\r\n const style = {\r\n top: positions[0],\r\n left: positions[1],\r\n height: this.data.size,\r\n width: this.data.size\r\n };\r\n\r\n // this.data.style is the button's default styling merged with the\r\n // styling for the button within the preset\r\n Object.assign(this.element.style, this.data.styles, style);\r\n\r\n // Set the element's tooltip that shows on hover\r\n this.element.title = this.data.tooltip;\r\n\r\n this.data.content = decodeURIComponent(this.data.content);\r\n\r\n // Set the element's content\r\n if (this.data.content.indexOf('data:image/png;base64') == 0)\r\n this.element.innerHTML = `<img src=\"${this.data.content}\" />`;\r\n else this.element.innerText = this.data.content;\r\n\r\n // Add the button to its container\r\n this.container.appendChild(this.element);\r\n }", "title": "" }, { "docid": "f784e3cd39b7ab02f5c50608ce477be3", "score": "0.5622105", "text": "createCustomElements() {\n // let full_news_block = document.registerElement('full-news-block', {\n // extends: 'div'\n // });\n // let blife_block = document.registerElement('blife-block', {\n // extends: 'div'\n // });\n //\n let block_edit = document.registerElement('block-edit', {\n extends: 'div'\n });\n document.body.appendChild(new block_edit());\n //\n // let author_block = document.registerElement('author-block', {\n // extends: 'div'\n // });\n //\n // document.body.appendChild(new full_news_block());\n // document.body.appendChild(new blife_block());\n // document.body.appendChild(new author_block());\n\n }", "title": "" }, { "docid": "9a3272fb966f3b46ae8431012eff540f", "score": "0.56176823", "text": "function showCupcake(cupcake) {\r\n $(\".cupcake_list\").append(`<div id=${cupcake.id} class=\"cupcakes\">\r\n <img src=${cupcake.image}>\r\n <p>Flavor: &nbsp&nbsp${cupcake.flavor}</p>\r\n <p>Size: &nbsp&nbsp${cupcake.size}</p>\r\n <p>Rating:&nbsp&nbsp${cupcake.rating}</p>\r\n <button id=${cupcake.id} class=\"edit_btn\">Edit</button>\r\n </div>`);\r\n }", "title": "" }, { "docid": "774ccef3ff70ec6ba6cbb6024332c20b", "score": "0.56086075", "text": "function build(){\n\n engine.common.tell('building',log);\n\n //sample greetings\n let greetings = engine.make.div({\n id:\"greetings\",\n parent:compId,\n class:'greetings',\n text:'greetings this is the features comp'\n });\n\n return true; //always return after build it can be\n\n}", "title": "" }, { "docid": "2801da21bd908718f6d6b7d82bdc697e", "score": "0.56061023", "text": "function renderCafe(doc) {\n console.log(doc.data());\n let li = document.createElement('li');\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n\n cafeList.appendChild(li);\n\n // Deleting data\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n\n let id = e.target.parentElement.getAttribute('data-id');\n\n db.collection('cafes').doc(id).delete();\n\n })\n}", "title": "" }, { "docid": "9d0ac5903a27ce5bc22ab18aa38dc99b", "score": "0.5605509", "text": "render() {\n // For example:\n // console.log('The object \"' + this.holder.id + '\" is ready');\n // this.holder.style.backgroundColor = this.options.color;\n // this.holder.innerHTML = 'Hello World!';\n }", "title": "" }, { "docid": "150ac5d58df3943c2b553f46706ba9cc", "score": "0.5605373", "text": "function createCard() {\r\n\r\n let card = document.createElement(\"div\");\r\n card.className = \"card\"\r\n\r\n let cardBody = document.createElement(\"div\");\r\n cardBody.className = \"card-body\";\r\n\r\n let title = document.createElement('h5');\r\n title.innerText = (\"Setup: \" + this.tagline);\r\n title.className = 'card-title';\r\n\r\n let cardText = document.createElement(\"p\");\r\n cardText.innerText = (\"Punchline: \" + this.punchline);\r\n cardText.className = \"card-text\";\r\n\r\n mainDiv.appendChild(card);\r\n card.appendChild(cardBody.appendChild(title));\r\n title.appendChild(cardText);\r\n\r\n // jokeList.pop(joke);\r\n\r\n}", "title": "" }, { "docid": "9e7b3af831aa8d4997ef29b76908a133", "score": "0.55908304", "text": "function renderCafe(doc){\n let li=document.createElement('li');\n let name=document.createElement('span');\n let city=document.createElement('span');\n let cross=document.createElement('div');\n\n li.setAttribute('data-id',doc.id);\n name.textContent=doc.data().name;\n city.textContent=doc.data().city;\n cross.textContent='X';\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n\n cafeList.appendChild(li);\n\n //Deleting Data (Deleting)\n cross.addEventListener('click',(e)=>{\n e.stopPropagation();\n let id=e.target.parentElement.getAttribute('data-id'); //get the id of the document\n db.collection('Cafes').doc(id).delete();\n })\n\n}", "title": "" }, { "docid": "37b15a8d76be4651c73122ed4aa94fe0", "score": "0.55808246", "text": "function makeCard() {\n let card = document.createElement(\"div\");\n card.classList.add(\"card\");\n getRandomDesign(card);\n card.addEventListener(\"click\", cardSelect);\n $(\"game\").append(card);\n }", "title": "" }, { "docid": "19de37b16f13fcffde6a1632c00576e6", "score": "0.5579614", "text": "function CupcakeHTML(cake) {\n return `\n <div cake-id=\"${cake.id}\">\n <div class=\"col-sm\">\n <div class=\"card\" style=\"width: 14rem;\">\n <img class=\"Cupcake-img\" src=\"${cake.image}\" alt=\"(no image provided)\" width=\"220\" height=\"220\">\n <div class=\" card-body\">\n <li>\n ${cake.id}\n </li>\n <li>\n ${cake.flavor}\n </li>\n <li>\n ${cake.size}\n </li>\n <li>\n ${cake.rating}\n </li>\n <button class=\"delete-button btn btn-primary\" data-id=\"${cake.id}\">Delete</button>\n </div>\n </div>\n <br>\n</div>\n</div>\n `;\n}", "title": "" }, { "docid": "044cb6f2d4e8a4e19fa6e73487ae877d", "score": "0.557868", "text": "function creatEl(){\n // let el = document.createElement('div');\n let el = document.createElement('pre');\n var btn =document.createElement('button')\n // Lodash(目前通过一个 script 脚本引入)对于执行这一行是必需的\n // el.innerHTML = _.join(['Hello', 'webpack'], ' ');\n // btn.innerHTML='Click me and check the console!'\n // btn.onclick = printMe;\n // el.appendChild(btn);\n el.innerHTML= [\n 'Hello webpack',\n '5 cubed is equal to' + cube(5)\n ].join('\\n\\n')\n return el\n}", "title": "" }, { "docid": "f0ebed7e9204f3584f67c950e4843381", "score": "0.55773747", "text": "createElement() {\n let viewport = this.getViewport()\n this.viewportStyle.width = `${viewport.width}px`\n this.viewportStyle.height = `${viewport.height}px`\n this.renderedViewport = viewport\n\n return html`<div class=\"layer-map\" onclick=${this.handleClick} style=\"${this.style}\">\n <div class=\"layer-viewport\" style=\"${this.viewportStyle}\">\n ${this.layers.map(x => x.render())}\n ${this.avatars.map(x => x.render())}\n </div>\n </div>`\n }", "title": "" }, { "docid": "7b45d2db3d45a2667a1bf1ff55b0abdc", "score": "0.5561278", "text": "function newQuizHeroTemplate() {\n return `<h3>Welcome to the Quiz!</h3>\n <p>This is a short quiz to test your knowledge of 3D printing. When you are ready to begin, press the button below!</p>\n <button class=\"beginQuiz\">\n <span>START</span>\n </button>`;\n}", "title": "" }, { "docid": "cad23f7128b0e2c36cdf55b0145b4712", "score": "0.5555816", "text": "function populateCoffeeArea(){\n cardArea.innerHTML = '';\n for(let x = 0; x<coffees.length;x++){\n cardArea.innerHTML += '<div class=\"card float-left mx-3 mb-2 border-dark-shade\" style=\"width: 40%;\">\\n' +\n ' <div class=\"card-body bg-soft-white \">\\n' +\n ' <h4 class=\"card-title text-center spookyText\">' + coffees[x].name + '</h4>\\n' +\n ' <h6 class=\"card-subtitle mb-2 text-muted text-center\">' + coffees[x].roast + '</h6>\\n' +\n ' <p class=\"card-text text-center\">'+ coffees[x].description +'</p>\\n' +\n ' <button type=\"button\" class=\"btn btn-outline-primary mx-auto w-100\">Buy Now!</button>\\n' +\n ' </div>\\n' +\n ' </div>'\n }\n}", "title": "" }, { "docid": "fcf4fad09ec7c5002b2fbaf8f89632ad", "score": "0.55557936", "text": "initElement(info) {\n let element = info.targets[Object.keys(info.targets)[0]];\n let template = info.templates[Object.keys(info.templates)[0]];\n element.innerHTML = template(info.context);\n }", "title": "" }, { "docid": "ed29f8fb3e8206f3640393daa729bb9f", "score": "0.55497134", "text": "function cardCreator(response)\n\n{\n card=document.createElement(\"div\");\n card.className=\"card\";\n card.id=response.id;\n\n \n \n var pic=document.createElement(\"img\")\n pic.setAttribute(\"src\",response.preview);\n pic.setAttribute(\"width\",\"100%\");\n pic.className=\"pic\";\n\n card.appendChild(pic);\n \n\n var dataContainer=document.createElement(\"div\");\n dataContainer.className=\"dataContainer\";\n\n card.appendChild(dataContainer);\n\n var name=document.createElement(\"h3\")\n var nm=document.createTextNode(response.name)\n name.className=\"name\";\n name.appendChild(nm);\n\n var brand=document.createElement('h5')\n var brandName=document.createTextNode(response.brand);\n brand.className=\"brand\";\n brand.appendChild(brandName);\n\n var price=document.createElement('a');\n var amount=document.createTextNode(\"Price : Rs\" + response.price);\n price.className=\"price\"; \n price.appendChild(amount);\n\n dataContainer.appendChild(name);\n dataContainer.appendChild(brand);\n dataContainer.appendChild(price);\n var btn=document.createElement(\"button\");\n var view=document.createTextNode(\"VIEW ITEM\");\n btn.appendChild(view);\n btn.id=\"view\"\n dataContainer.appendChild(btn);\n console.log(card);\n container.appendChild(card);\n}", "title": "" }, { "docid": "2efa413b0b1157c55664356874d6eb10", "score": "0.5542199", "text": "function createComponentUnderTest() {\n const element = createElement('c-cart-contents', {\n is: CartContents\n });\n document.body.appendChild(element);\n return element;\n}", "title": "" }, { "docid": "4e8318c0005ced9739bfc401e2ca0061", "score": "0.5539543", "text": "function createCard(tempObject){\n $('#card-container').prepend(`\n <div id=\"${tempObject.id}\" class=\"card\">\n <div class=\"delete\" aria-label=\"Button to delete idea\" aria-required=\"true\"></div>\n <section class=\"searchable\">\n <h2 class=\"title-text\" contenteditable>${tempObject.title}</h2>\n <h3 class=\"body-text\" contenteditable>${tempObject.body}</h3>\n </section>\n <section class=\"quality-container\">\n <div class=\"upvote buttons\" aria-label=\"Button to upvote idea quality\" aria-required=\"true\"></div>\n <div class=\"downvote buttons\" aria-label=\"Button to downvote idea quality\" aria-required=\"true\"></div>\n <h4 class=\"buttons\">quality: </h4>\n <span class=\"quality\">${tempObject.quality}</span>\n </section>\n </div> `);\n clearInput();\n}", "title": "" }, { "docid": "34978bf270454745b2468576a4dd2f16", "score": "0.5535485", "text": "static newDesign(elem, index, option){\n let elClass = this.replaceAll(elem.classList.value, ' ', '');\n let id = `id_${elClass}_${index}_${Math.floor(Math.random() * 1000000)}`;\n if(elem.hasAttribute('id')){\n elem.removeAttribute('id');\n elem.setAttribute('id', id);\n }else{\n elem.setAttribute('id', id);\n }\n elem.classList.add('arm-checkbox');\n\n let div = document.createElement('div');\n div.classList.add('arm-checkbox-parent-component');\n\n let armCheckBox = this.chreateArmCheckBoxParent(elem, id, option);\n\n let parent = elem.parentNode;\n\n div.appendChild(elem);\n div.appendChild(armCheckBox);\n\n parent.appendChild(div);\n }", "title": "" }, { "docid": "77da02c558e473ff514df5bed7fd53af", "score": "0.5535083", "text": "function createCard(list) {\n var cardHTML =\n `<article class=\"section__card--card\" data-id= ${list.id}>\n <h2></h2>\n <ul class= \"card__item\" ></ul>\n <footer class= \"card__item--image\">\n <div>\n <img src=\"images/urgent.svg\" class=\"card__urgent\">\n <p class=\"card__item--txt\">URGENT</p>\n </div>\n <div>\n <img src=\"images/delete.svg\" class=\"card__delete\">\n <p class=\"card__item--txt\">DELETE</p>\n </div>\n </footer>\n </article>`;\n\n cardSection.insertAdjacentHTML('afterbegin', cardHTML);\n createList(list);\n setCardTitle(list);\n setCardUrgency(list);\n taskEmptyPrompt()\n}", "title": "" }, { "docid": "ab9642d9f5482491500affe856b9a551", "score": "0.55276346", "text": "async function showCupcakesHTML() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n \n for (let cupcake of response.data.cupcakes) {\n let $newCupcake = $(generateDIV(cupcake));\n $(\"#cupcakes-list\").append($newCupcake);\n }\n console.log(response.data)\n}", "title": "" }, { "docid": "b2fad626020ed919850e07f233f4a27d", "score": "0.5526728", "text": "function populateDOM(single_pokemon) {\n let pokeScene = document.createElement('div')\n let pokeDiv = document.createElement('div')\n let pokeCard = document.createElement('div')\n let pokeFront = document.createElement('div')\n let pokeBack = document.createElement('div')\n /* //\n //let height = document.createElement('p')*/\n\n fillCardFront(pokeFront, single_pokemon)\n fillCardBack(pokeBack, single_pokemon)\n\n pokeScene.setAttribute('class', 'scene')\n pokeCard.setAttribute('class', 'card')\n /*//pokeDiv.setAttribute('class', 'CharDivs')*/\n\n pokeCard.appendChild(pokeFront)\n pokeCard.appendChild(pokeBack)\n pokeScene.appendChild(pokeCard)\n\n mainArea.appendChild(pokeScene)\n /*//pokeDiv.appendChild(height)*/\n\n //making the card flip and do its thing\n pokeCard.addEventListener('click', function() {\n pokeCard.classList.toggle('is-flipped')\n });\n}", "title": "" }, { "docid": "60756ab9ce58d0662266144d9c1fdbaa", "score": "0.5524057", "text": "showElement(child) {\n console.log(\"lets render\", child)\n document.title = child.text\n\n // Clear the previous content\n App.elements.content.innerHTML = \"\"\n App.elements.content.style.border = \"none\"\n\n switch (child.text) {\n case \"Button\":\n App.controllers.createButtonContent()\n break\n\n case \"Accordion\":\n App.controllers.createAccordionContent()\n break\n\n case \"Input\":\n App.controllers.createInputContent()\n break\n\n default:\n break\n }\n }", "title": "" }, { "docid": "2a494a8e260db50524a453cc9dc4952c", "score": "0.5521224", "text": "function buildCardNode() {\n\t\tvar node = document.createElement('div');\n\t\tnode.draggable = true;\n\t\tnode.innerHTML =\n\t\t\t'<div class=\"card-title\"></div>' +\n\t\t\t'<div class=\"for-card-edit\"><input class=\"card-edit-box\" type=\"text\"/>' +\n\t\t\t'<button class=\"card-update\">Save</button>' +\n\t\t\t'<button class=\"card-edit-delete\">X</button>' +\n\t\t\t'</div>';\n\t\treturn node;\n\t}", "title": "" }, { "docid": "147f4d1d07ea4d9f148bc96cdedd0662", "score": "0.55083746", "text": "function renderPokemon(pokeData){\n let allPokemonsC = document.getElementById('poke-container');\n let pokeContainer = document.createElement(\"div\") \n pokeContainer.classList.add('card');\n\n createPokeImage(pokeData.id, pokeContainer);\n\n let pokeName = document.createElement('h4') \n pokeName.innerText = pokeData.name\n\n let pokeNumber = document.createElement('p')\n pokeNumber.innerText = `#${pokeData.id}`\n \n let pokeTypes = document.createElement('ul')\n\n createTypes(pokeData.types, pokeTypes) \n\n pokeContainer.append(pokeName, pokeNumber, pokeTypes);\n allPokemonsC.appendChild(pokeContainer);\n}", "title": "" }, { "docid": "79a435f39fa2f562867ffaccd1e10ae2", "score": "0.5498233", "text": "async enterIntoCollectionField(){\n let css = await FIELDS.COLLECTION.cssTag;\n let collectionField = await new CCDCollectionField(css);\n await collectionField.enterTextData(3);\n return collectionField;\n }", "title": "" }, { "docid": "3ce685e5003eec0854eabe36950ff244", "score": "0.5498222", "text": "createElt() {\n const elt = this.domCreation(`${this.alt}, closeup view`);\n elt.setAttribute(\"role\", \"button\");\n\n return elt;\n }", "title": "" }, { "docid": "636c377f5bbb25b69947802f2b68aa7c", "score": "0.549437", "text": "render() {\n return html`\n \n\n `;\n }", "title": "" }, { "docid": "c86be1cbd01f5df1c35606a20ab408e7", "score": "0.54939467", "text": "createDom() {\n this.input_ = this.getDomHelper().createDom(TagName.INPUT, {\n name: this.fieldName_,\n type: InputType.TEXT,\n autocomplete: 'off'\n });\n this.button_ = this.getDomHelper().createDom(\n TagName.SPAN, google.getCssName('goog-combobox-button'));\n this.setElementInternal(\n this.getDomHelper().createDom(\n TagName.SPAN, google.getCssName('goog-combobox'), this.input_,\n this.button_));\n if (this.useDropdownArrow_) {\n googdom.setTextContent(this.button_, '\\u25BC');\n style.setUnselectable(this.button_, true /* unselectable */);\n }\n this.input_.setAttribute('label', this.defaultText_);\n this.labelInput_.decorate(this.input_);\n this.menu_.setFocusable(false);\n if (!this.menu_.isInDocument()) {\n this.addChild(this.menu_, true);\n }\n }", "title": "" }, { "docid": "e0299f4368cdcee88da7d749fc0e3dd4", "score": "0.54908746", "text": "function _render(element) {\n let specs = element.getElementsByClassName('lang-vis')\n let num = specs.length;\n for (var i=0; i < num; i++) {\n let el = \"#vis-\" + i;\n let jsonSpec = YAML.parse(specs[i].textContent)\n console.log(jsonSpec)\n //console.log(vl.compile(jsonVis).spec == undefined)\n htmlString = \"<div class='vega-embed' id='vis-\" + i + \"'></div>\"\n specs[i].parentNode.insertAdjacentHTML('beforebegin', htmlString);\n specs[i].parentNode.style.display = 'none';\n vegaEmbed(el, jsonSpec, opts);\n };\n}", "title": "" }, { "docid": "f5304e3c4ccafbcc6651afe6e2ea2372", "score": "0.5490793", "text": "_render() {\n render(\n html` <style>\n .applet {\n background-color: #fff;\n display: inline-block;\n min-width: 450px;\n margin-bottom: 25px;\n }\n ul {\n list-style-type: none;\n padding: 0;\n margin: 0;\n }\n .todo-list {\n padding: 0 12px;\n margin-bottom: 20px;\n }\n </style>\n <section class=\"applet\">\n <todo-input @submit=${this.addTodo}></todo-input>\n <ul class=\"todo-list\">\n ${this.todos.map(\n (item, index) =>\n html`<todo-item\n task=${item.task}\n completed=${item.completed}\n index=${index}\n @toggle=${this.toggleCompleted}\n @delete=${this.removeTodo}\n ></todo-item>`\n )}\n </ul>\n </section>`,\n this.shadowRoot\n );\n }", "title": "" }, { "docid": "ba3387503b5d807119200e73c87cec06", "score": "0.54817533", "text": "displayProduit() {\n return `<div class=\"produit\">\n <img src=${this.imageUrl}>\n <div class=\"description-produit\">\n <h4 class=\"produit_title\">${this.name}</h4>\n <p class=\"produit_description\">${this.description}</p>\n <p class=\"produit_prix\">${this.price / 100}.00 €</p>\n <form id=\"form-produit\">\n <fieldset>\n <legend>Veuillez choisir la couleur parmit : ${this.colors}</legend>\n <div id=\"color\">\n ${this.displayColor(true)}\n </div>\n <div class=\"button\" style=\"margin:2%\">\n <button type=\"submit\" id=\"btn_envoyer\" class=\"bouton panier\">Ajouter au panier</button>\n </fieldset>\n </form>\n </div>\n </div>\n </div>`;\n }", "title": "" }, { "docid": "53742cf25cadc24fb57d63ab18fcbf39", "score": "0.54760647", "text": "createNodeBuilder( renderObject ) { }", "title": "" }, { "docid": "3753e31445636e37fbb90f04460c54b6", "score": "0.54687744", "text": "function renderPokemonByName(pokeData){\n let allPokemonsC = document.getElementById('poke-container');\n let pokeContainer = document.createElement(\"div\") \n pokeContainer.classList.add('card');\n\n createPokeImage(pokeData.id, pokeContainer);\n\n let pokeName = document.createElement('h4') \n pokeName.innerText = pokeData.name\n\n let pokeNumber = document.createElement('p')\n pokeNumber.innerText = `#${pokeData.id}`\n \n let pokeTypes = document.createElement('ul')\n createTypes(pokeData.types, pokeTypes) \n\n let pokeAbilities = document.createElement('ul')\n createAbilitiesByName(pokeData.abilities, pokeAbilities) \n\n pokeContainer.append(pokeName, pokeNumber, pokeTypes, pokeAbilities);\n allPokemonsC.appendChild(pokeContainer);\n}", "title": "" }, { "docid": "33642c87fe11e326c094047cf8812e8c", "score": "0.54685426", "text": "function _construct(){\n var html =\n '<div id=\"' + g.options.jukeboxOptions.id + '_container\" class=\"jp-jukebox\" style=\"visibility:hidden\" role=\"application\" aria-label=\"media player\">'\n + '<div id=\"' + g.options.jukeboxOptions.id + '_player\" class=\"jp-jplayer\"></div>'\n + '<div class=\"jp-gui jp-gui-bg\">'\n + ' <div class=\"jp-gui-texture\"></div>'\n + ' <div class=\"jp-gui-gradient\"></div>'\n + ' <div class=\"jp-interface\">'\n\t\t\t+ ' <h3 class=\"title\">Smell Like Teen Spirit</h3>'\n\t\t\t+ ' <span class=\"sub-title\">Smell Like Teen Spirit</span>'\n\t\t\t+ ' <div class=\"jp_column-mid\">'\n\t\t\t+ ' \t<div class=\"jp_container-bar-s\">'\n\t\t\t+ ' \t<div class=\"jp-details\">'\n + ' \t<div class=\"jp-cover\" aria-label=\"cover art\"><div class=\"jp-cover-default\"><img src=\"js/jplayer/default.jpg\" alt=\"\"></div></div>'\n + ' \t<div class=\"jp-title\" aria-label=\"title\"></div>'\n + ' \t</div>'\n\t\t\t+ ' \t<div class=\"jp-progress\">'\n + ' \t<div class=\"jp-seek-bar\">'\n + ' \t<div class=\"jp-play-bar\"></div>'\n + ' \t</div>'\n + ' \t</div>'\n\t\t\t+ ' \t</div>'\n\t\t\t+ ' </div>'\n\t\t\t+ ' <div class=\"jp_column-left\">'\n\t\t\t+ ' <div class=\"jp-controls\">'\n + ' <button class=\"jp-previous\" role=\"button\" tabindex=\"0\" title=\"Previous track\">previous</button>'\n + ' <button class=\"jp-play\" role=\"button\" tabindex=\"0\" title=\"Play\">play</button>'\n + ' <button class=\"jp-stop\" role=\"button\" tabindex=\"0\">stop</button>'\n + ' <button class=\"jp-next\" role=\"button\" tabindex=\"0\" title=\"Next track\">next</button>'\n + ' </div>'\n\t\t\t+ ' </div>'\n\t\t\t\n\t\t\t+ ' <div class=\"jp_column-right\">'\n + ' <div class=\"jp_column-right-inner\">'\n\t\t\t+ ' <div class=\"jp-volume-controls\">'\n + ' <button class=\"jp-mute\" role=\"button\" tabindex=\"0\" title=\"Mute\">mute</button>'\n + ' <button class=\"jp-volume-max\" role=\"button\" tabindex=\"0\" title=\"Max volume\">max volume</button>'\n + ' <div class=\"jp-volume-bar\">'\n + ' <div class=\"jp-volume-bar-value\"></div>'\n + ' </div>'\n + ' </div>'\n\t\t\t+ ' <div class=\"jp-controls-holder\">'\n + ' <div class=\"jp-toggles\">'\n + ' <button class=\"jp-shuffle\" role=\"button\" tabindex=\"0\" title=\"Shuffle\">shuffle</button>'\n + ' <button class=\"jp-repeat\" role=\"button\" tabindex=\"0\" title=\"Repeat all\">repeat</button>'\n + ' <button class=\"jp-show-playlist\" role=\"button\" tabindex=\"0\" title=\"Playlist\">playlist</button>'\n + ' </div>'\n + ' </div>'\n + ' <div class=\"jp_column-mid\">'\n + ' <div class=\"jp_container-bar-s\">'\n + ' <div class=\"jp-current-time\" role=\"timer\" aria-label=\"time\"></div>'\n + ' <div class=\"jp-duration\" role=\"timer\" aria-label=\"duration\"></div>'\n + ' </div>'\n + ' </div>'\n\t\t\t+ ' </div>'\n + ' </div>'\n + ' <div class=\"jp-viewstate-control jp-gui-bg\"><div class=\"jp-gui-texture\"></div><div class=\"jp-gui-gradient\"></div><button class=\"jp-viewstate-toggle\" role=\"button\" tabindex=\"0\">&times;</button></div>'\n + ' </div>'\n + '</div>'\n\t\t\t+ '<div class=\"jp-playlist-container\"><div class=\"jp-playlist jp-gui-bg\"><div class=\"jp-gui-texture\"></div><ul class=\"mCustomScrollbar\"><li></li></ul></div></div>'\n + '<div class=\"jp-no-solution\">'\n + ' <span>Update Required</span>'\n + ' To play the media you will need to either update your browser to a recent version or update your <a href=\"http://get.adobe.com/flashplayer/\" target=\"_blank\">Flash plugin</a>.'\n + '</div>'\n + '</div>';\n\n var $container = $('#' + g.options.jukeboxOptions.id);\n if(!$container.length){\n $container = $('<div></div>', { 'id': g.options.jukeboxOptions.id });\n $('body').append($container);\n }\n\n $container.append(html);\n }", "title": "" }, { "docid": "845e848e9bfc8ba3e3fe694a820eeaa3", "score": "0.54613554", "text": "function renderPokemon(pokemon){\n let ctn = document.createElement('div');\n let name = document.createElement('h2');\n name.textContent = `${pokemon.name} #${pokemon.id}`;\n let img = document.createElement('img');\n img.setAttribute('src', pokemon.sprites.front_default);\n ctn.appendChild(name);\n ctn.appendChild(img);\n pokeCtn.appendChild(ctn);\n}", "title": "" }, { "docid": "59ded30221389d7865989a96686a8cbd", "score": "0.5460901", "text": "render() {\n return `\n <article class=\"media\" id=\"result-${this._id}\">\n <div class=\"media-left cover\">\n <figure class=\"image cover__image\">\n ${this.image\n ? `<img src='${this.image}' alt='${this.name}'>`\n : `<img src='http://via.placeholder.com/40x50'>`\n }\n </figure>\n </div> \n <div class=\"media-content\">\n <p><strong>${this.name}</strong> <small>(${this.channel})</small></p>\n ${this.genres.map(genre => `<span class=\"tag\">${genre}</span>`)}\n </div>\n <div class=\"media-right\" id=\"save-${this._id}\">\n <a class=\"button is-success is-outlined\" id=\"btnSave-${this._id}\" style=\"visibility: ${this.isFav ? 'hidden' : 'visible'}\">\n <span>Save</span>\n <span class=\"icon is-small\"><i class=\"fa fa-heart\"></i></span>\n </a>\n </div>\n </article>`;\n }", "title": "" }, { "docid": "38d952f148faec26016b5df6e83f6156", "score": "0.54556805", "text": "static makeElement () {\n return $(\"<div id='animationDiv'></div>\").appendTo ($ (QUESTION_MAIN));\n }", "title": "" }, { "docid": "dbd4588c73f8e359778ec9474d0a3003", "score": "0.5451338", "text": "function createElement(test) {\n return window.customElements.whenDefined('changelist-controls-sk').then(() => {\n container.innerHTML = `<changelist-controls-sk></changelist-controls-sk>`;\n expect(container.firstElementChild).to.not.be.null;\n test(container.firstElementChild);\n });\n }", "title": "" }, { "docid": "b34f62a98588192272268cc7a82ea480", "score": "0.5441187", "text": "function createManageAssetFormForAdd() {\n htmlContent = '';\n htmlContent += TypeNameTextInput + PrefixTextInput + LifeTimeTextInput;\n //create static elements for attributes division\n htmlContent += '<div class=\"clearfix\">' + '<label class=\"groupleft\">Attributes</label>';\n\n var createdCheckboxDivision = createCheckboxDivision();\n htmlContent += createdCheckboxDivision + '</div>' + '</div>' + '</div>';\n return htmlContent;\n\n }", "title": "" }, { "docid": "4b4ab5bb3b4c2f3be3c4bb0f97a9f74e", "score": "0.543937", "text": "buildUI() {\n this.node.innerHTML = '\\\n <div class=\"fw-fileuploadfield-action\">\\\n <input type=\"file\"></input>\\\n <div tabIndex=\"0\" class=\"fw-fileuploadfield-choice\"></div>\\\n </div>\\\n <div class=\"fw-fileuploadfield-view\">\\\n <table><tbody></tbody></table>\\\n </div>';\n this.choiceNode = this.node.getElementsByClassName('fw-fileuploadfield-choice')[0];\n this.inputNode = this.node.getElementsByTagName('input')[0];\n this.bodyNode = this.node.getElementsByTagName('tbody')[0];\n this.viewNode = this.node.getElementsByClassName('fw-fileuploadfield-view')[0];\n this.setMultiple(this.multiple);\n this.setFocusableNode(this.choiceNode);\n }", "title": "" }, { "docid": "930f4c69ee4eb8c401610f5e2d957c1d", "score": "0.54332304", "text": "function renderCoffee(coffee) {\n\n var html = '<div class=\"coffee col-xs-6\">';\n // html += '<td>' + coffee.id + '</td>';\n html += '<span><h2><span>' + coffee.name + '</span></h2></span>';\n html += '<span><p><span> ' + coffee.roast + '</span></p></span>';\n html += '</div>';\n return html;\n\n}", "title": "" }, { "docid": "329a76dca01b5749c14a755c77b7626b", "score": "0.5431907", "text": "function updateElement () {\n if (localStorage && localStorage.coockiless) return\n\n element = INSTALL.createElement({selector: 'body', method: 'append'}, element)\n\n // Set the app attribute to your app's dash-delimited alias.\n element.setAttribute('app', 'cookiless')\n element.style.zIndex = getMaxZIndex() + 1\n\n var ckElement = document.createElement('cookiless-div')\n\n ckElement.className = 'ckcontent'\n ckElement.style.opacity = options.opacity / 100\n\n var ckPolicyText = document.createElement('policy-text')\n ckPolicyText.textContent = options.policyText\n\n var ckAcceptButton = document.createElement('a')\n ckAcceptButton.className = 'iAccept'\n ckAcceptButton.textContent = options.acceptButton\n\n ckElement.appendChild(ckPolicyText)\n ckElement.appendChild(ckAcceptButton)\n\n element.appendChild(ckElement)\n\n element.querySelectorAll('.iAccept')[0].addEventListener('click', hideAlert)\n }", "title": "" }, { "docid": "b9c76f1a65c815f4ea805d4af0445658", "score": "0.54298973", "text": "createdCallback() {\n\n /***********************Pure Functions*************************/\n\n const shadow = (elem) => (IO.of(elem.createShadowRoot())),\n /*eslint no-param-reassign:0*/\n setInnerHtml = curry((strHtml, elem) => {\n elem.innerHTML = strHtml;\n return elem;\n }),\n strComponent = this.getTemplateHtml() + this.getTemplateStyle();\n\n /**********************Impure Functions*************************/\n\n const impure = compose(map(setInnerHtml(strComponent)), shadow);\n impure(this).runIO();\n\n // content\n this.textContent = 'Viadinho';\n }", "title": "" }, { "docid": "09cfb9ca99563666e6e2557df53ca8da", "score": "0.5428227", "text": "function createTrainerCard(trainer){\n const div = document.createElement('div')\n div.className = 'card'\n div.setAttribute(\"data-id\", trainer.id)\n\n const p = document.createElement('p')\n p.innerText = trainer.name\n \n makeAddPokemonButton(trainer)\n\n const ul = document.createElement('ul')\n trainer.pokemons.forEach(pokemon => makePokemon(pokemon, ul))\n \n div.append(p,btn,ul)\n main.append(div)\n}", "title": "" }, { "docid": "a1d376769ae9247637408a877ce1c356", "score": "0.5428038", "text": "initElement() {\n this.element = document.createElement('div');\n document.body.appendChild(this.element);\n }", "title": "" }, { "docid": "9b319e1517cca45a43889b03dee62795", "score": "0.54270214", "text": "function createHolder() {\n let mainHolder = document.createElement(\"div\");\n mainHolder.id = \"repo-detail-holder-id\";\n getElementIdAndAppendContent(\"repository-body-cards\", mainHolder);\n}", "title": "" }, { "docid": "26096c7b6a08105f0bf17d83ce04fe5c", "score": "0.5422742", "text": "function addElement(){\n\tgetInfo();\n\tif(type == \"p\") {\n\t\tcreateTextElement(content);\n\t\tresetForm();\n\t}else if(type == \"img\"){\n\t\tcreateImage(content);\n\t\tresetForm();\n\t}else{\n\t\tdocument.getElementById(\"errorMsg\").style.display = \"inline\";\n\t}\n}", "title": "" }, { "docid": "cc28584ce27d920b1d3232b33ba683d7", "score": "0.5421777", "text": "createMarkup() {\n return {__html: this.state.valoriCorrenti.testo_soluzione};\n }", "title": "" }, { "docid": "5ecd0495839f89047a63afec089f080e", "score": "0.5421511", "text": "function createCallToAction(name) {\n return(\n $( \"<div class='block part' id='callToActionBlock'><div class='goods' id='callToAction'><img src='./img/handpoint-test.png' id='handpoint'></div></div>\" )\n );\n}", "title": "" }, { "docid": "c758641ea980376002118699bf2bfa6a", "score": "0.542102", "text": "function addInnerHtmlToAddHtml(element){\n return '<div class=\"food-item\">' + element.name + ' ' +\n element.calorie + ' ' + element.date.substring(0, 10) +\n '</div> <div class=\"buttons\"> <button class=\"delete\" type=\"button\" id=' +\n 'd' + element.id + '></button> </div>'\n }", "title": "" }, { "docid": "03bbf67f299e6ef4e73eed59633ae0fb", "score": "0.5409329", "text": "render() {\n /**\n * Use JavaScript expressions to include property values in\n * the element template.\n */\n return lit_element_1.html `<style>\n iron-image {\n width: 50px;\n height: 50px;\n background-color: lightgray;\n }\n</style>\n\n<div>\n Brought to you by:\n <a href=\"https://glytoucan.org\"><iron-image sizing=\"cover\" fade src=\"https://test.gtc.glycosmos.org/img/logo_toucan.png\"></iron-image></a>\n</div>\n<div>\n <img src=\"https://test.gtc.glycosmos.org/glycans/${this.accession}/image?style=${this.imagestyle}&format=${this.format}&notation=${this.notation}\" />\n</div>\n<div>\n <a href=\"https://glytoucan.org/Structures/Glycans/${this.accession}/\">${this.accession}</a>\n</div>\n<div>\n <h2>Using sparqlist</h2>\n <div>\n <img src=\"https://test.sparqlist.glycosmos.org/sparqlist/api/gtc_image?accession=${this.accession}&style=${this.imagestyle}&format=${this.format}&notation=${this.notation}\" />\n </div>\n</div>\n`;\n }", "title": "" }, { "docid": "25cab0e0950b99887fc06cd15b2e5d2f", "score": "0.54061496", "text": "createDOM () {\n this.DOMGenerated = true;\n\n var html = '' +\n '<div class=\"wheel-menu--ring\"></div>' +\n '<div class=\"wheel-menu--pointer\"></div>' +\n '<div class=\"wheel-menu--cursor\"></div>';\n\n this.$el = this.doc.createElement('div');\n this.$el.classList.add('wheel-menu-container');\n\n this.$el.innerHTML = html;\n\n this.$ring = this.$el.querySelector('.wheel-menu--ring');\n this.$pointer = this.$el.querySelector('.wheel-menu--pointer');\n this.$cursor = this.$el.querySelector('.wheel-menu--cursor');\n\n this.$ring.style.width = this.opts.size + 'px';\n this.$ring.style.height = this.opts.size + 'px';\n\n this.$body.appendChild( this.$el);\n }", "title": "" }, { "docid": "ef6465ae1d1c25b2d922c5966acfb6f8", "score": "0.5405413", "text": "render() {\n return html `\n <div id=\"box\">\n <div id=\"text\">\n ${this.placeholderHidden() ? this.labelTemplate : this.placeholderTemplate}\n </div>\n <ef-icon icon=\"down\" part=\"icon\"></ef-icon>\n </div>\n ${this.editTemplate}`;\n }", "title": "" }, { "docid": "e403d9fe6ffdb92a6141b36fd82ecfdf", "score": "0.54009956", "text": "function generateHTML([h,v]){\nreturn `<div class=\"item h${h} v${v}\">\n <img src=\"https://source.unsplash.com/random/404x4${randomNumber(9)}${randomNumber(9)}\">\n <div class=\"item-overlay\">\n <button>VIEW</button>\n </div>\n </div>`;\n}", "title": "" }, { "docid": "7d29aa781728dc6a5e2f427a49b7af38", "score": "0.5400934", "text": "render() {\n return html`\n <confetti-container id=\"confetti\">\n ${!this.imgSource && !this.imgKeyword\n ? ``\n : html`\n <flash-card-image-prompt\n img-src=\"${this.imgSource}\"\n img-keyword=\"${this.imgKeyword}\"\n status=\"${this.status}\"\n ></flash-card-image-prompt>\n `}\n <flash-card-answer-box\n @flash-card-status-change=\"${this.statusChanged}\"\n >\n <div slot=\"front\">\n <slot slot=\"front\" name=\"front\"></slot>\n </div>\n <div slot=\"back\">\n <slot slot=\"back\" name=\"back\"></slot>\n </div>\n </flash-card-answer-box>\n </confetti-container>\n `;\n }", "title": "" }, { "docid": "803f9462833d8cf034359d2b8f3cdeeb", "score": "0.54004097", "text": "function createResultsCard(){\n\n resultsDiv.html(\"\");\n //create tag \n \n // attributes\n $(resultsDiv).attr(\"style\", \"margin: auto, width: 50%,padding: 10px\")\n $(resultsCard).attr(\"class\", \"card\");\n $(cardDivider).attr(\"class\",\"card-divider\");\n $(cardSection).attr(\"class\", \"card-section\");\n\n //text for tag \n $(cardDivider).text(\"Winner: Team Name \");\n $(cardSection).text(\"Breakdown of stats winning\");\n //append tag \n $(resultsDiv).append(resultsCard,cardDivider,cardSection);\n\n }", "title": "" }, { "docid": "134aacea351130f06204984468671263", "score": "0.5400392", "text": "function component() {\n const element = document.createElement(\"div\");\n\n // // Lodash, now imported by this script\n // element.innerText = \"Hello webpack\";\n // element.classList.add(\"hello\");\n element.append(createTimeInput(), createButtonElement());\n\n // Add the image to our existing div.\n // const myIcon = new Image();\n // myIcon.src = Icon;\n\n // element.appendChild(myIcon);\n\n return element;\n}", "title": "" }, { "docid": "32214633c1ffad41fb09c6ece77db4d5", "score": "0.53954244", "text": "_create() {\n // Create root DIV\n const rootDiv = document.createElement('div');\n\n // Set class\n rootDiv.setAttribute('class', 'face');\n\n // Get the time now\n const time = new Date();\n\n // Set current time\n this._currentTime = time;\n\n // Add different DIV elements\n this._addHourMarks(rootDiv);\n this._addMinuteMarks(rootDiv);\n this._addNumbers(rootDiv);\n this._addHourHand(time, rootDiv);\n this._addMinuteHand(time, rootDiv);\n this._addSecondHand(time, rootDiv);\n this._addCenterDot(rootDiv);\n\n // Add root DIV to shadow DOM\n this._shadowRoot.appendChild(rootDiv);\n }", "title": "" }, { "docid": "f895ace6581c344c8735598f5d8bda07", "score": "0.5394985", "text": "create() {\n const element = document.createElement(\"div\");\n element.className = this.emojiType + \" emoji\";\n return element;\n }", "title": "" }, { "docid": "29d431ad490cfe163d34e9b4a478a4bc", "score": "0.53895783", "text": "function create(element, className, data, appendElement) {\n\tlet temp = document.createElement(element);\n\ttemp.classList.toggle(className);\n\ttemp.innerHTML = data;\n\tappendElement.appendChild(temp);\n\treturn temp;\n}", "title": "" }, { "docid": "b912d5f6387b26111c099034a0787685", "score": "0.5389266", "text": "function component() {\n // Create element \"div\"\n const element = document.createElement('div');\n // Add the text to our existing div.\n const hello = 'Hello';\n const webpack = 'webpack';\n const values = lodashValues({hello, webpack});\n debug('Values: ', values);\n\n // Get times\n let result = '';\n const times = process.env.TIMES || 5;\n for (let i = 0; i < times; i++){\n result += i + ' ';\n }\n\n element.innerHTML = lodashJoin(values, ' ') + ' - ' + result;\n // Add the class to our existing div.\n element.classList.add('hello');\n // Add the image to our existing div.\n // const myImg = new Image();\n // myImg.src = Icon;\n // element.appendChild(myImg);\n // Show data.xml, data.json\n debug('Xml Data: ', datXml);\n\n debug('Json Data: ', datJson);\n\n return element;\n }", "title": "" }, { "docid": "0f0ad7dfe61716b2d1eed6072264a526", "score": "0.5388966", "text": "function renderFirstPage(){\n let startPage = `<section class='quizContent'>\n <h1>Harry Potter Quiz</h1>\n <button type='button' class='start' aria-label='Start'>Start Game</button>\n</section>`;\n return startPage;\n\n}", "title": "" }, { "docid": "c2aa1e0f550b1e986937f9b945d3a76c", "score": "0.53875244", "text": "function cardHtml(person)\n{\n return `\n <div class=\"scene\">\n <div class=\"card\">\n \n <div class=\"card_face card_face-front\">\n <div id=\"front-info\">\n <img src=\"swimg/${person.id}.jpg\">\n <p>${person.name}</p>\n </div>\n </div>\n\n <div class=\"card_face card_face-back\">\n <div id=\"${person.id}back-info\">\n <div id=\"back-header\">\n <h1 id=\"back-h1\">${person.name}</h1>\n </div>\n <div id=\"backblock\">\n <div id=\"back-left\">\n <p>DOB</p>\n <p>SEX</p>\n <p>HGT</p>\n <p>MASS</p>\n <p>EYES</p>\n <p>HAIR</p>\n </div>\n <div id=\"back-right\">\n <p>${person.dob}</p>\n <p>${person.gender}</p>\n <p>${person.height}</p>\n <p>${person.mass}</p>\n <p>${person.eyes}</p>\n <p>${person.hair}</p>\n </div>\n </div> \n </div>\n </div>\n </div>\n <input id=\"playbutton\" type=\"submit\" value=\"Select and Play\" class=\"play${person.id}\" onclick=\"redirectToGame(${person.id})\">\n </div> `\n}", "title": "" } ]
d2c20e68257152450f5e89a64da08d78
establish a global error handler function, for handling uncaught exceptions
[ { "docid": "de62990f7c196b7144e036c6ae561f48", "score": "0.6426425", "text": "function GlobalErrorHandler (error, type) {\n\t// we'll attempt to output the message and then intentionally idea, hoping to be respawned\n\tconst message = (error instanceof Error) ?\n\t\ttype + `: ${error.message}\\n${error.stack}` :\n\t\tJSON.stringify(error);\n\tif (\n\t\tglobal.ServerObject &&\n\t\ttypeof global.ServerObject.critical === 'function'\n\t) {\n\t\tglobal.ServerObject.critical(message);\n\t}\n\tconsole.error(message); // eslint-disable-line no-console\n\tprocess.exit(1);\n}", "title": "" } ]
[ { "docid": "cbba33e0417e9c5be7994026cdecc8ff", "score": "0.75735134", "text": "function ErrorHandler() {\n }", "title": "" }, { "docid": "9e92456492a44f9fd2b91be926593198", "score": "0.7536138", "text": "errorHandler (error) {\n console.log('Global error handler')\n console.error(error)\n }", "title": "" }, { "docid": "6480f0729e70e6a5c0fbdc921e39d179", "score": "0.75059104", "text": "function installNormalUncaughtErrorHandler () {\n inject(window, 'onerror', function (msg, url, lineNo, columnNo, error) {\n\n // skip ignored exception, which is throw by tryCatchWrapper\n if (error && error.__fm_ignore__) {\n return\n }\n\n // special handling for syntax error\n // syntaxError.stack would have no file, col and col information\n // make one, so this can be parsed as other exceptions\n if (error instanceof SyntaxError) {\n error.stack = `${error.stack}\\n at (${url}:${lineNo}:${columnNo})`\n }\n\n if (!error) {\n error = new Error(msg)\n error.stack = [{\n args: [],\n column: columnNo,\n line: lineNo,\n url,\n func: '?'\n }]\n }\n\n processException(error, false)\n }, tracker)\n}", "title": "" }, { "docid": "c99158edbe726f9bb9f1ef8df9e96e79", "score": "0.7240009", "text": "onerror(handler) {\n this._errors.on('error', handler);\n }", "title": "" }, { "docid": "cf046169e98eb974028b1b431ed77825", "score": "0.71355474", "text": "errorHandler() {\n }", "title": "" }, { "docid": "c49251cde61a27a94b5ef3bd03fe671e", "score": "0.70922077", "text": "_startErrorHandling() {\n\t\twindow.addEventListener( 'error', this._boundErrorHandler );\n\t\twindow.addEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "title": "" }, { "docid": "0f02716b6d49fa2cb240e77e38d73c9b", "score": "0.7020864", "text": "_registerGlobalErrorHandler() {\n const logger = this;\n\n window.onerror = (msg, url, line, column, error) => {\n const string = msg.toLowerCase();\n const substring = \"script error\";\n const payload = {msg, url, line, column, error};\n\n if (string.indexOf(substring) > -1) {\n logger.log('ERROR', 'runtime', {message: 'Unknown Script Error', payload: payload})\n } else {\n logger.log('ERROR', 'runtime', {message: msg, payload: payload})\n }\n\n return true;\n };\n }", "title": "" }, { "docid": "64ec8ec1de6c6677f766b53397a5abbc", "score": "0.7019236", "text": "static setupUncaughtExceptionHandlers() {\n BinSetupHelper.setupNodeConfig();\n\n const NodeConfig = require('config');\n const serviceLocatorFactory = require('../app/services/serviceLocatorFactory').getServiceLocatorSingleton(NodeConfig);\n const logger = serviceLocatorFactory.getLogger();\n\n /**\n * We do this to make sure these errors aren't swallowed up\n * See http://jamesknelson.com/are-es6-promises-swallowing-your-errors/\n * More documentation in Bluebird docs: http://bluebirdjs.com/docs/api/promise.onpossiblyunhandledrejection.html\n * : http://bluebirdjs.com/docs/api/error-management-configuration.html#global-rejection-events\n */\n process.on('unhandledRejection', function(reason, promise) {\n logger.error('Promise.onPossiblyUnhandledRejection', reason);\n //throw reason;\n });\n\n process.on('uncaughtException', function (err) {\n logger.error(err);\n //throw err;\n });\n }", "title": "" }, { "docid": "88b2c787a71e044cd648690eb78ea05f", "score": "0.69417024", "text": "function globalErrorHandler(error) {\n try {\n let titlePath = error.relativePath || error.filename || error.fileName;\n let line = error.line || error.loc.line;\n let message = error.messageOriginal || error.msg || (error.message ? error.message.toString().substr(filename.length + 2) : \"\");\n\n notifier.notify({\n 'title': 'Error ' + titlePath.toString(),\n 'message': 'Line: ' + line.toString() + ' - ' + message.toString()\n });\n } catch(e) {\n notifier.notify('Fatal error, please read the terminal or the log file');\n console.log(error);\n\n } finally {\n this.emit('end');\n }\n}", "title": "" }, { "docid": "710ce69421cb167b7e7d8ffc90bcc8fc", "score": "0.6931179", "text": "function handleUncaughtErrors(runner) {\n for (var i = 0, l = errorQueue.length; i < l; ++i) {\n handleUncaughtError(runner, errorQueue[i]);\n }\n\n window.onerror = function () {\n handleUncaughtError(runner, arguments);\n };\n }", "title": "" }, { "docid": "9c8cb3b2b8661562cbb7c69c5906c06c", "score": "0.690243", "text": "handleError() {\n\n }", "title": "" }, { "docid": "13d194499901a71d30ecb04b97f7a69b", "score": "0.6876391", "text": "function onUncaughtException(err) {\r\n var err = \"uncaught exception: \" + err;\r\n util.serverErr(err);\r\n}", "title": "" }, { "docid": "eefcd043890178fc461b5e3b318d5179", "score": "0.68661076", "text": "function _installGlobalUnhandledRejectionHandler() {\n tracekit_window.onunhandledrejection = _traceKitWindowOnUnhandledRejection;\n }", "title": "" }, { "docid": "883b6b6a5e960c5dccbbce9dda3ac506", "score": "0.67854005", "text": "function _installGlobalUnhandledRejectionHandler() {\n\t window$1.onunhandledrejection = _traceKitWindowOnUnhandledRejection;\n\t }", "title": "" }, { "docid": "dd6d3b3a6f1311a8e1296fb8f4a77696", "score": "0.6748861", "text": "function _installGlobalHandler() {\n\t if (_onErrorHandlerInstalled === true) {\n\t return;\n\t }\n\t _oldOnerrorHandler = window$1.onerror;\n\t window$1.onerror = _traceKitWindowOnError;\n\t _onErrorHandlerInstalled = true;\n\t }", "title": "" }, { "docid": "85dd151f2b781b8ed89976fd4c327174", "score": "0.6682706", "text": "function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n _oldOnerrorHandler = window$1.onerror;\n window$1.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }", "title": "" }, { "docid": "08ef30f1aca05e9f1a274cd40d82ddcf", "score": "0.66695523", "text": "function addErrorHandler(win, handler){\n win.onerror = handler;\n for(var i=0;i<win.frames.length;i++){\n addErrorHandler(win.frames[i], handler)\n }\n }", "title": "" }, { "docid": "358d0db31b784657fe9c03c83afd90f9", "score": "0.6638622", "text": "function setOnError(f) {\n var _onerror = window.onerror\n // msg, url, line, col, err\n window.onerror = function() {\n f.apply(tracker, arguments)\n if (typeof _onerror === 'function') {\n _onerror.apply(window, arguments)\n }\n }\n }", "title": "" }, { "docid": "7c4e018b69606946759cef45e2906443", "score": "0.6622557", "text": "function installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = window.onerror;\n window.onerror = traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }", "title": "" }, { "docid": "a32a2093cbbafd06694f04cb432b7f3e", "score": "0.6589717", "text": "registerRejectionHandler() {\n const errType = 'unhandledRejection';\n process.on(errType, (err) => {\n utils.consoleAlertError(`${errType}:`, err);\n this.captureError(err, errType);\n });\n }", "title": "" }, { "docid": "9e6674ad5b7740a002f93d7f5a86f5c9", "score": "0.6587436", "text": "function _installGlobalHandler() {\n if (_onErrorHandlerInstalled === true) {\n return;\n }\n\n _oldOnerrorHandler = tracekit_window.onerror;\n tracekit_window.onerror = _traceKitWindowOnError;\n _onErrorHandlerInstalled = true;\n }", "title": "" }, { "docid": "fde63f40d80fb2472499f8954b520abd", "score": "0.6586335", "text": "function installGlobalUnhandledRejectionHandler() {\n if (_onUnhandledRejectionHandlerInstalled === true) {\n return;\n }\n _oldOnunhandledrejectionHandler = window$1.onunhandledrejection;\n window$1.onunhandledrejection = traceKitWindowOnUnhandledRejection;\n _onUnhandledRejectionHandlerInstalled = true;\n }", "title": "" }, { "docid": "1acc85fa97563bd76f33f2274620da16", "score": "0.6567491", "text": "function handleUncaughtError(runner, args) {\n if (args.length >= 3) {\n var message = args[0];\n var url = args[1];\n var line = args[2];\n\n var cp = B.env.contextPath || window.location;\n var index = (url || \"\").indexOf(cp);\n if (index >= 0) {\n url = \".\" + url.slice(index + cp.length);\n }\n\n if (line === 1 && message === \"Error loading script\") {\n message = \"Unable to load script \" + url;\n } else if (url) {\n message = url + \":\" + line + \" \" + message;\n } else {\n message = message.replace(\"uncaught exception: \", \"\");\n }\n }\n\n runner.emit(\"uncaughtException\", {\n name: \"UncaughtError\",\n message: message,\n runtime: runner.runtime\n });\n\n return true;\n }", "title": "" }, { "docid": "ffeef9bbd4c9f4668eb85959fa678f9d", "score": "0.6549914", "text": "function handleUncaughtError(runner, args) {\n if (args.length >= 3) {\n var message = args[0];\n var url = args[1];\n var line = args[2];\n\n var cp = B.env.contextPath || window.location;\n var index = (url || \"\").indexOf(cp);\n if (index >= 0) {\n url = \".\" + url.slice(index + cp.length);\n }\n\n if (line === 1 && message === \"Error loading script\") {\n message = \"Unable to load script \" + url;\n } else if (url) {\n message = url + \":\" + line + \" \" + message;\n } else {\n message = message.replace(\"uncaught exception: \", \"\");\n }\n }\n\n runner.emit(\"uncaughtException\", {\n name: \"UncaughtError\",\n message: message\n });\n\n return true;\n }", "title": "" }, { "docid": "5af4f5dd2865e815ba41d8b4825abd37", "score": "0.65472496", "text": "function defaultErrorHandler(error) {\n throw error;\n }", "title": "" }, { "docid": "672dcd02feb0c3eaa76f6b73afe829c7", "score": "0.6528454", "text": "function errorHandler(e) {\n var msg = '';\n\n\n switch (e.code) {\n case 1:\n msg = 'NOT_FOUND_ERR';\n break;\n case 2:\n msg = 'SECURITY_ERR';\n break;\n case 3:\n msg = 'ABORT_ERR';\n break;\n case 4:\n msg = 'NOT_READABLE_ERR';\n break;\n case 5:\n msg = 'ENCODING_ERR';\n break;\n case 6:\n msg = 'NO_MODIFICATION_ALLOWED_ERR';\n break;\n case 7:\n msg = 'INVALID_STATE_ERR';\n break;\n case 8:\n msg = 'SYNTAX_ERR';\n break;\n case 9:\n msg = 'INVALID_MODIFICATION_ERR';\n break;\n case 10:\n msg = 'QUOTA_EXCEEDED_ERR';\n break;\n case 11:\n msg = 'TYPE_MISMATCH_ERR';\n break;\n case 12:\n msg = 'PATH_EXISTS_ERR';\n break;\n default:\n msg = 'Unknown Error. Code ==' + e.code;\n break;\n }\n\n alert('Error: ' + msg);\n}", "title": "" }, { "docid": "b05152b75f8d61207feae5944898fc6d", "score": "0.64597917", "text": "function errorHandle(error) {\n throw error;\n}", "title": "" }, { "docid": "f329d6ec90b706dfad8c8225d4f2c421", "score": "0.6455426", "text": "function errHandler(string) {\n console.error(string);\n process.exit(-1);\n}", "title": "" }, { "docid": "25fb05b73f01d0d6bbcb3bc5b42aef7b", "score": "0.64533544", "text": "function uninstallGlobalHandler() {\n if (_onErrorHandlerInstalled) {\n window$1.onerror = _oldOnerrorHandler;\n _onErrorHandlerInstalled = false;\n }\n }", "title": "" }, { "docid": "2c55b5b64fdcf33a33146e419687bf28", "score": "0.6451277", "text": "function defaultErrorHandler(err) {\n (0, _logError2.default)(err);\n throw err;\n}", "title": "" }, { "docid": "203b235cf3e07c48bbf8793da98f8920", "score": "0.64309394", "text": "function errorHandler(err) {\n throw new Error(err);\n}", "title": "" }, { "docid": "1c320cfcdbe4656b62cd77ea0e058293", "score": "0.64262253", "text": "function handleError(message, filename, lineno) {\n // don't double-log, if this is thrown from \"handleException\"\n if (lastThrownExceptionMessage &&\n message.indexOf(lastThrownExceptionMessage) !== -1) {\n lastThrownExceptionMessage = null;\n return;\n }\n\n // default category...\n var category = 'ads_power_editor_uncaught_exception';\n\n var message_from_flow = getMessageFromFlow();\n var category_from_flow = getCategoryFromFlow();\n if (message_from_flow) {\n message = message_from_flow + message;\n }\n if (category_from_flow) {\n category = category_from_flow;\n }\n\n report(message, category, lineno);\n if (oldHandler) { return oldHandler(); }\n}", "title": "" }, { "docid": "3bb8a8cfd141575795672ad4e587fd77", "score": "0.63928175", "text": "function OnError(errorThrown) {\n\n}", "title": "" }, { "docid": "324ee83944700e37354ed9a433ebcee0", "score": "0.6391759", "text": "function optliveHandleUncaughtExceptionFunc(trace) {\n if (trace.length == 1 && trace[0].line) {\n var errorLineNo = trace[0].line - 1; /* CodeMirror lines are zero-indexed */\n if (errorLineNo !== undefined && errorLineNo != NaN) {\n removeAllGutterDecorations();\n\n if (myVisualizer) {\n toggleSyntaxError(true);\n myVisualizer.redrawConnectors();\n }\n\n var s = pyInputAceEditor.getSession();\n s.setAnnotations([{row: errorLineNo,\n type: 'error',\n text: trace[0].exception_msg}]);\n }\n }\n}", "title": "" }, { "docid": "58b411aac6214ea0e726f124b05b05d4", "score": "0.63760203", "text": "function error() {\n\n }", "title": "" }, { "docid": "716ae66fe712fea16e06b333189fe73c", "score": "0.63674", "text": "function MyError() {}", "title": "" }, { "docid": "2ff862526bec4385bed2f9d1f5ead981", "score": "0.636046", "text": "function errorHandler(err) { cb(err) }", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.6353725", "text": "function CustomError() {}", "title": "" }, { "docid": "c858e5d68bcc6ea0d31ebcb426caad32", "score": "0.6353725", "text": "function CustomError() {}", "title": "" }, { "docid": "a1157d809953bb5e7b4a70868bbdfead", "score": "0.6350684", "text": "function error_handler ( callback ) {\n return function failure ( err ) {\n callback(err.toString(), null);\n }\n }", "title": "" }, { "docid": "eaf03c617819a37fce262fc7aae6e818", "score": "0.63448113", "text": "function defaultErrorHandler(e) {\n console.warn('Unhandled rejection: ' + (e.stack || e));\n }", "title": "" }, { "docid": "ee50b61c5b410327d6902248c7810cc8", "score": "0.6339723", "text": "onerror(t) {\n this.emitReserved(\"error\", t);\n }", "title": "" }, { "docid": "a2886783082b4e94a9765ab3c5715c03", "score": "0.6328568", "text": "_onerror(err) {\n if (this.listeners(\"error\").length) {\n this.emitReserved(\"error\", err);\n }\n else {\n console.error(\"Missing error handler on `socket`.\");\n console.error(err.stack);\n }\n }", "title": "" }, { "docid": "cf804044338010ca4099d2dc878d060c", "score": "0.6322631", "text": "defaultExceptionHandler(err, exit) {\n console.log(err.message, err.stack);\n exit();\n }", "title": "" }, { "docid": "641aec4596a3550749ddb2fe03b0a3bf", "score": "0.62971", "text": "constructor(options = {}) {OnUncaughtException.prototype.__init.call(this);OnUncaughtException.prototype.__init2.call(this);\n this._options = {\n exitEvenIfOtherHandlersAreRegistered: true,\n ...options,\n };\n }", "title": "" }, { "docid": "f0607f0719dc203e1accc20d872476b1", "score": "0.6289936", "text": "function handleError() {\n printTraceback(lastExceptionTraceback);\n print(lastException);\n}", "title": "" }, { "docid": "d0c9c7e5ff558c8842839f28cd60a2be", "score": "0.62870294", "text": "onerror(err) {\n void err\n }", "title": "" }, { "docid": "44871dd575f41f754e98602a665f331f", "score": "0.6285473", "text": "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "title": "" }, { "docid": "44871dd575f41f754e98602a665f331f", "score": "0.6285473", "text": "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "title": "" }, { "docid": "eb1169f578cecf7aad1287811b45c5d8", "score": "0.6276206", "text": "function handleError() {\n if (onFailure instanceof Function) {\n onFailure();\n }\n }", "title": "" }, { "docid": "31876b0bede8e4e71a8b0e614d63e8c5", "score": "0.6266919", "text": "function defaultErrorHandler(e) {\n console.warn('Unhandled rejection: ' + (e.stack || e));\n}", "title": "" }, { "docid": "86b896a5c45db5ecdb293688a6476988", "score": "0.6256575", "text": "function onError() {\r\n\r\n if (error.syscall !== 'listen') {\r\n logger.captureerror(error.coded + 'not equal listen', 'serverOnErrorHandler', 10)\r\n throw error\r\n }\r\n\r\n // handle specific listen errors with friendly messages\r\n switch (error.code) {\r\n case 'EACCES':\r\n logger.captureerror(error.coded + ':elevated privileges required', 'serverOnErrorHandler', 10)\r\n process.exit(1)\r\n break\r\n\r\n case 'EADDRINUSE':\r\n logger.captureerror(error.coded + ':port is already in use', 'serverOnErrorHandler', 10)\r\n process.exit(1)\r\n break\r\n\r\n default:\r\n logger.captureerror(error.coded + ':some unknown error', 'serverOnErrorHandler', 10)\r\n throw error\r\n }\r\n}", "title": "" }, { "docid": "167f13cc682e470feeacb9db05da05eb", "score": "0.6251132", "text": "onerror(err) {\n this.emitReserved(\"error\", err);\n }", "title": "" }, { "docid": "54066c4501db1a7278a44a941e46f01d", "score": "0.6247897", "text": "function handleUncaughtExceptions(error) {\n if (!error || !error.stack) {\n console.log('Uncaught exception:', error);\n } else {\n var source = getErrorSource(error);\n if (source !== null) console.log(source);\n console.log(error.stack);\n }\n process.exit(1);\n}", "title": "" }, { "docid": "d1a304a3c351d8abd0484eabc9d54e2d", "score": "0.62406105", "text": "handleError(error) {\n throw new Error(error);\n }", "title": "" }, { "docid": "ae214ea7f47180bf724cf18a515ced8f", "score": "0.62314314", "text": "error(err) {}", "title": "" }, { "docid": "c992a3c406a8a23df61f89770d4766f6", "score": "0.6221916", "text": "function handleError( message ) {\n handleProblem(message, \"error\");\n}", "title": "" }, { "docid": "baf13d2af79b1f1cf966518e5a47edeb", "score": "0.6220526", "text": "function handleError(err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info)\n } else {\n if (inBrowser && typeof console !== \"undefined\") {\n console.error(err)\n } else {\n throw err\n }\n }\n }", "title": "" }, { "docid": "baf13d2af79b1f1cf966518e5a47edeb", "score": "0.6220526", "text": "function handleError(err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info)\n } else {\n if (inBrowser && typeof console !== \"undefined\") {\n console.error(err)\n } else {\n throw err\n }\n }\n }", "title": "" }, { "docid": "baf13d2af79b1f1cf966518e5a47edeb", "score": "0.6220526", "text": "function handleError(err, vm, info) {\n if (config.errorHandler) {\n config.errorHandler.call(null, err, vm, info)\n } else {\n if (inBrowser && typeof console !== \"undefined\") {\n console.error(err)\n } else {\n throw err\n }\n }\n }", "title": "" }, { "docid": "c3d4f3a8961aa7eef01de67b5213da59", "score": "0.6217644", "text": "function errorHandler(error) {\n console.log('error = ' + error);\n}", "title": "" }, { "docid": "c963aa7e54367babc2389a638239371f", "score": "0.62147105", "text": "function _error_handler(err) {\n if (err) {\n if (Array.isArray(err) && err.length === 0) {\n return;\n }\n console.error(\"An error occured: \", err);\n }\n}", "title": "" }, { "docid": "73a4f3764c53a49475b35dd8972763ad", "score": "0.62073094", "text": "function handleError(e) {\n console.error(e);\n}", "title": "" }, { "docid": "73a4f3764c53a49475b35dd8972763ad", "score": "0.62073094", "text": "function handleError(e) {\n console.error(e);\n}", "title": "" }, { "docid": "0d5840f70294f7a3ed601bb34def4f7b", "score": "0.62021875", "text": "function defaultErrorHandler(error, request, response, next) {\n console.error(error.name, ': ', error.message);\n response.sendStatus(500).end();\n next(error);\n}", "title": "" }, { "docid": "dae59780a2c2bd809d52287a314ea808", "score": "0.6200693", "text": "function onerror(e) {\n console.error(e);\n }", "title": "" }, { "docid": "161745b3773b641b4abb59cc92069f65", "score": "0.61999786", "text": "function errorHandling(error)\n{\n console.log(\"Error\"+error);\n alert(\"Something went wrong!.Please try again later.\")\n}", "title": "" }, { "docid": "2d85644bc7b984e0f533f0276099f72d", "score": "0.61886716", "text": "function trackGlobalErrors() {\n if (isSwizzled) return\n swizzledOnError = window.onerror\n window.onerror = windowOnError\n isSwizzled = true\n }", "title": "" }, { "docid": "03b0ea95d89e21f05650510aef8f8c79", "score": "0.6175921", "text": "function errorHandler(error){\n console.error(error);\n }", "title": "" }, { "docid": "be178d9fe198d0e2d14828faadaa1c86", "score": "0.61664253", "text": "function errors() {}", "title": "" }, { "docid": "56c867c952b1a17e82cc8bee7875b0c6", "score": "0.6164943", "text": "function initError() {\n try {\n if (document.querySelector(\"#error\") !== undefined && document.querySelector(\"#error\") !== null) {\n if (!errorDisplayed) {\n document.querySelector(\"#error\").classList.remove(\"inactive\");\n document.querySelector(\"#error\").classList.add(\"active\");\n errorDisplayed = true;\n }\n }\n } catch (error) {\n console.log(\"ERROR FATAL\");\n console.log(\"initError\");\n console.log(error);\n alert(\"Ha ocurrido un error fatal en el proceso de inicio de la pantalla de error. No podrá seguir funcionando el sistema. Intente reiniciar la página con la tecla F5. Si el error es continuo, contacte con el administrador del sistema. Más detalles sobre el error: abrir la consola del navegador.\");\n working = false;\n }\n}", "title": "" }, { "docid": "97331ffa648ad5d306bee3a63f077a25", "score": "0.616014", "text": "function errorHandler(error)\n{\n alert(\"Something is wrong: \" + error);\n}", "title": "" }, { "docid": "c737f16a5fbd8785856fb326ddac0368", "score": "0.615963", "text": "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)errorOrDestroy(dest,er);}// Make sure our error handler is attached before userland ones.", "title": "" }, { "docid": "23378c7ffc859027fdc94780e6afb0f8", "score": "0.6152481", "text": "_errorHandler(error) {\n console.log(error.message);\n }", "title": "" }, { "docid": "e5802848733c91bfb7a568356252e5f6", "score": "0.6146386", "text": "_stopErrorHandling() {\n\t\twindow.removeEventListener( 'error', this._boundErrorHandler );\n\t\twindow.removeEventListener( 'unhandledrejection', this._boundErrorHandler );\n\t}", "title": "" }, { "docid": "94e80ae4664f6ca6774ace6088ecb352", "score": "0.6145892", "text": "function _error_handler(err) {\n if (err) {\n if (_.isArray(err) && err.length === 0) {\n return;\n }\n console.error(\"An error occured: \", err);\n }\n}", "title": "" }, { "docid": "70320a8f5504b8453cbdb4bf7de9a84d", "score": "0.61444575", "text": "defaultErrorHandler (data, altErrorText, onclose) {\n //regular JS error inside a REST promise handler (.then() or .catch) is not shown at all without this line because its like try-catch\n if (data instanceof Error) { \n //console.error('Error in the Client side error popup:', data);\n let title = '<i class=\"fas fa-times-circle red-text\"></i>&nbsp; Client side error';\n let text = '<p>Please reload this page and try again.<p><br /><p><a onclick=\"var trace = document.getElementById(\\'jsErrorTrace\\'); trace.style.display = trace.style.display === \\'block\\' ? \\'none\\' : \\'block\\'\" class=\"toggler-closed small\">Technical info</a></p><code class=\"pre-wrap\" id=\"jsErrorTrace\" style=\"display:none\">'+data.stack+'</code>';\n //fakeWindows.alert(text, title, onclose);\n window.alert(text);\n }\n else if (!data || !data.canceledConfirmationByUser && !data.redirectedToLogin) { //-1 and 401 handled globally\n let icon = 'fa-exclamation-triangle orange-text';\n if (data && data.status === 500) { icon = 'fa-times-circle red-text'; }\n if (data && data.error) { altErrorText = data.error; }\n altErrorText = (altErrorText||'').split('\\n').join('<br />');\n //fakeWindows.alert(altErrorText, '<i class=\"fas '+icon+'\"></i>&nbsp; Problem', onclose);\n window.alert(altErrorText);\n }\n }", "title": "" }, { "docid": "7e1c852be3aeb38ba8e41e940c14034b", "score": "0.6141555", "text": "function listenForErrors() {\n\t window.addEventListener('error', function (event) { return exports.globalErrors.push(event.error); });\n\t // Also, we treat `console.error` as a test failure. Unless you prefer not.\n\t var origConsole = console;\n\t var origError = console.error;\n\t console.error = function wctShimmedError() {\n\t origError.apply(origConsole, arguments);\n\t if (config.get('trackConsoleError')) {\n\t throw 'console.error: ' + Array.prototype.join.call(arguments, ' ');\n\t }\n\t };\n\t}", "title": "" }, { "docid": "e5a47dbc95968c1eea6919d40ee25b20", "score": "0.6129462", "text": "function safeCallUnhandledRejection(event) {\n try {\n cons.unhandledRejection(event);\n } catch (e) {\n //console.log('Promise.unhandledRejection failed:', e);\n }\n }", "title": "" }, { "docid": "658e3b9d68a9524b9f901e43899e68f1", "score": "0.6127209", "text": "function errorHandler(evt) {\n\t\t\t//console.log('ERROR', evt);\n\t\t}", "title": "" }, { "docid": "4e3b1b83a184717bd2883cd18be4a35f", "score": "0.6124977", "text": "static registerErrorMessageHandler(errorFunc) {\n Form.globalErrorMessageHandler = errorFunc;\n }", "title": "" }, { "docid": "8bbc7820bad7195a3bc78c6d1a62e93f", "score": "0.61208063", "text": "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "title": "" }, { "docid": "8bbc7820bad7195a3bc78c6d1a62e93f", "score": "0.61208063", "text": "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "title": "" }, { "docid": "6fafd81c9ebc71bb4f1a010e57d12d46", "score": "0.61155117", "text": "error (callback) {\n this.errorHandlers.push(callback)\n }", "title": "" }, { "docid": "9b97e93cc444f8f719553c7cce5e18d6", "score": "0.6115262", "text": "function errorHandle(process){ //try-catch 함수\r\n return function(){\r\n try{\r\n return process.apply(this, arguments);\r\n }catch(e){\r\n console.log(e);\r\n }\r\n };\r\n}", "title": "" }, { "docid": "f96f950c4766c84ba6e96defee6aa52d", "score": "0.6114945", "text": "function _errorHandler(err) {\n if(err.response && err.response.data && err.response.data.error) {\n const error = err.response.data.error\n console.error(`error code ${error.code} - ${error.title}`)\n console.error(`${error.message}`)\n }\n else if(err.response && err.response.data) {\n console.error(err.response.data)\n }\n else {\n console.error(`error ${err}`)\n }\n}", "title": "" }, { "docid": "6074c16c173fa95e0ccd668ad69c5b28", "score": "0.61147946", "text": "function uninstallGlobalUnhandledRejectionHandler() {\n if (_onUnhandledRejectionHandlerInstalled) {\n window$1.onunhandledrejection = _oldOnunhandledrejectionHandler;\n _onUnhandledRejectionHandlerInstalled = false;\n }\n }", "title": "" }, { "docid": "44033fbec4d6273196c4c0c11997c6fb", "score": "0.61098224", "text": "function errorHandler(err) {\n console.log(err);\n }", "title": "" }, { "docid": "4945b18ce48122189cb1ad8846eface3", "score": "0.6102308", "text": "function installUnhandledPromiseErrorHandler() {\n window.addEventListener('unhandledrejection', function (event) {\n if (event.reason) {\n report('Unhandled Promise rejection', event.reason);\n }\n });\n}", "title": "" }, { "docid": "24c6f1f49391fa7ec325306cb87116a5", "score": "0.609852", "text": "errorHandling() {\n // raise unhandled exceptions\n process.on(\"unhandledRejection\", r => console.log(r));\n process.on(\"exit\", (code) => {\n this.microplum.close();\n console.log(`About to exit with code: ${code}`);\n });\n }", "title": "" }, { "docid": "655244a868cf211ab8cfc1ee449f8214", "score": "0.60967594", "text": "function exceptionHandler(event) {\n\t\t\talert(\"Exception: \" + event.code + \"::\" + event.message);\n\t\t}", "title": "" }, { "docid": "c05378079fa5bff468a0f1c3c9bfa5b7", "score": "0.6092377", "text": "function onErr(err) {\n throw err;\n}", "title": "" }, { "docid": "5278082e0ef029bd4893dde2b3297efe", "score": "0.6092004", "text": "function errorHandler() {\n return new ErrorHandler();\n }", "title": "" }, { "docid": "11d2f928b3207f66da44903b8f7c9682", "score": "0.6078438", "text": "function catchErrors(req, res, next) {\n var d = domain.create();\n d.on('error', next);\n d.run(next);\n}", "title": "" }, { "docid": "f211c653d8beae15ea3a7765ec5a931e", "score": "0.6057649", "text": "function handleError(err) {\n\t console.log(\"ERROR: \", err);\n\t}", "title": "" }, { "docid": "17117aef49f2ed3f7067dc0e3757872e", "score": "0.60367054", "text": "function defaultHandleError (err) {\n\tconsole.error('\\x1b[31m Error:', err, '\\x1b[0m');\n}", "title": "" }, { "docid": "17117aef49f2ed3f7067dc0e3757872e", "score": "0.60367054", "text": "function defaultHandleError (err) {\n\tconsole.error('\\x1b[31m Error:', err, '\\x1b[0m');\n}", "title": "" }, { "docid": "18916db7ddad31db932c471ccbd7ad99", "score": "0.6017292", "text": "__init2() {this._installFunc = {\n onerror: _installGlobalOnErrorHandler,\n onunhandledrejection: _installGlobalOnUnhandledRejectionHandler,\n };}", "title": "" }, { "docid": "918d0c1ddd0b2bd11d14031bec7bef9d", "score": "0.60172135", "text": "function windowOnError(msg, file, line, col, error) {\n // resolve the stack trace\n StackTrace.fromError(error, { offline: config.offline })\n // then try to send it up to the server\n .then(stackFrames => reactotron.error(msg, stackFrames))\n // can't resolve, well, let the user know, but still upload something sane\n .catch(resolvingError =>\n reactotron.error({\n message: CANNOT_RESOLVE_ERROR,\n original: { msg, file, line, col, error },\n resolvingError,\n })\n )\n\n // call back the previous window.onerror if we have one\n if (swizzledOnError) {\n swizzledOnError(msg, file, line, col, error)\n }\n }", "title": "" }, { "docid": "8f654d7b15e3c2524f26cef64fc42fe3", "score": "0.6013513", "text": "function handleException(){\n\ttry{\n\t\tconsole.log(123/0);\n\t\tthrow \"Error in the function\"//what U throw is what U catch...\n\t}catch(err){\n\t\tconsole.log(\"catch:\" + err)\n\t}finally{\n\t\tconsole.log(\"finally:clean up\")\n\t}\n}", "title": "" } ]
a495dc84cf8fa6bb59e760fa1b52f813
Update notification to display offline error messaging
[ { "docid": "2a18ae6b739fedd92b928d89cef4b237", "score": "0.6099452", "text": "notifyOnline() {\n this.handleNotification({ message: 'notices.online', level: 'success' });\n }", "title": "" } ]
[ { "docid": "dec5d935093ad04761532bd2a7c3bd42", "score": "0.7429149", "text": "notifyOffline() {\n this.handleNotification({ message: 'notices.offline', level: 'warning' });\n }", "title": "" }, { "docid": "211d4b2e500dcf3b41a3d4f0e0fe98e8", "score": "0.6694179", "text": "_failGetResponse() {\n let args, notification, state;\n state = store.getState();\n args = {\n text: `Возникла ошибка на сервере<br />Пожалуйста, перезагрузите страницу`,\n icon: '<i class=\"fas fa-sync-alt\"></i>'\n }\n notification = new Notification(state.general.notificationContainer, args)\n notification.init(10000);\n }", "title": "" }, { "docid": "21130d048a93b1dde425f03ee5c42f20", "score": "0.6597687", "text": "function onOffline()\n {\n onlineStatus = '<b>offline</b>';\n }", "title": "" }, { "docid": "0ab72609a48051e26b7940799f1610fa", "score": "0.65695465", "text": "function updateConnectivityStatus() {\n let offlineNotificationToShow = false\n let offlineNotificationIcon = ''\n let offlineNotificationType = ''\n let offlineNotificationMessage = ''\n let offlineNotificationElement = window.document.getElementById(\n 'offline-notification',\n )\n\n if (typeof navigator.onLine !== 'undefined') {\n if (!navigator.onLine) {\n // add 'offline' class to the body, for any CSS adjustment\n document.body.classList.add('offline')\n\n offlineNotificationToShow = true\n offlineNotificationIcon = 'offline'\n if ('serviceWorker' in navigator) {\n // If the browser supports Service Workers and the Cache API,\n // getting offline should be less stressful. Use a \"warning\"\n // message instead of an \"error and provide a link to content\n // available in cache.\n offlineNotificationType = 'warning'\n offlineNotificationMessage =\n 'Désolé, <strong>vous ne semblez plus être connecté</strong>. Vous pouvez continuer à lire cette page, ou <a href=\"/offline.html\">voir ce qui est dans votre cache</a>.'\n } else {\n offlineNotificationType = 'error'\n offlineNotificationMessage =\n 'Désolé, <strong>vous ne semblez plus être connecté</strong>. Vous pouvez continuer à lire cette page en attendant le retour de la connexion.'\n }\n } else {\n // remove 'offline' class from the body\n document.body.classList.remove('offline')\n\n offlineNotificationIcon = 'online'\n if (offlineNotificationElement) {\n offlineNotificationToShow = true\n offlineNotificationType = 'success'\n offlineNotificationMessage =\n '<strong>Vous être de nouveau connecté</strong> ! Vous pouvez reprendre une navigation normale sur le site.'\n }\n }\n\n if (\n offlineNotificationToShow &&\n !window.document.getElementById('offline-notification-static')\n ) {\n // https://stackoverflow.com/a/25214113/717195\n let newOfflineNotificationElement = document.createRange()\n .createContextualFragment(`<div class=\"wrap\" id=\"offline-notification\">\n <div class=\"alert alert-${offlineNotificationType}\">\n <p class=\"alert__icon\"><svg class=\"icon\"><use xlink:href=\"#symbol-${offlineNotificationIcon}\" /></svg></p>\n <p class=\"alert__message\">${offlineNotificationMessage}</p>\n </div>\n </div>`)\n\n if (offlineNotificationElement) {\n offlineNotificationElement.parentNode.replaceChild(\n offlineNotificationElement,\n newOfflineNotificationElement,\n )\n } else {\n let mainElement = document.querySelector('main')\n mainElement.parentNode.insertBefore(\n newOfflineNotificationElement,\n mainElement,\n )\n }\n }\n }\n}", "title": "" }, { "docid": "7d7a0c32c80559ed753d5ad1aec51e0a", "score": "0.62260056", "text": "function showIndicator() {\n offlineNotification.innerHTML = 'You are currently offline.';\n offlineNotification.className = 'showOfflineNotification';\n}", "title": "" }, { "docid": "4daa772894084b18537c06f24263b9e5", "score": "0.6211136", "text": "onClientDisconnected() {\n NotificationManager.error(\n \"Connection Lost from server please check your connection.\",\n \"Error!\"\n );\n }", "title": "" }, { "docid": "0bd246621c74fda24595c168d2a21cb2", "score": "0.6180249", "text": "function checkForOfflineUsers() {\n\t\t$.ajax({\n\t\t\turl: \"https://wind-bow.gomix.me/twitch-api/channels/\" + user,\n\t\t\tdataType: \"jsonp\",\n\t\t\tsuccess: function (data) {\n if (data.status === 422 || data.status === 404) {\n if (data.message.length > 0) {\n status = data.message;\n logo = \"../images/error-icon-25266.png\";\n } else {\n status = \"Information about '\" + user + \"' was not found\";\n logo = \"../images/error-icon-25266.png\";\n }\n updateHTML();\n } else {\n\t\t\t\t status = \"Channel <a href='\" + data.url + \"' target=_blank>\" + data.display_name + \"</a> is currently offline\";\n\t\t\t\t if (data.logo !== null) {\n\t\t\t\t logo = data.logo;\n\t\t\t\t } else {\n\t\t\t\t logo = \"../images/error-icon-25242.png\";\n\t\t\t\t }\n\t\t\t\t updateHTML();\n }\n }\n });\n\t}", "title": "" }, { "docid": "d488b09de2edecd83b7fb3bae31957bd", "score": "0.6161345", "text": "function showError(error){\n notificationElement.innerHTML = `<p>${error.message}</p>`;\n}", "title": "" }, { "docid": "b5d2eb6eaadec98cb3d517a769c72eea", "score": "0.6124691", "text": "function initOfflinePage() {\n //display the offline notice when offline\n $(document).on('offline', function() {\n $('#offline-notice').fadeIn('fast');\n });\n //hide the offline notice when online\n $(document).on('online', function() {\n $('#offline-notice').fadeOut('fast');\n });\n}", "title": "" }, { "docid": "f95e6e2a3a57d3e5964c23d8752873d3", "score": "0.6120098", "text": "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "title": "" }, { "docid": "04eff4bebc2d2c60a56ce945297900df", "score": "0.6097918", "text": "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p>${error.message} </p>`;\n}", "title": "" }, { "docid": "3b0301804f4904b3460e25680bf155da", "score": "0.6094435", "text": "function showError(error){\r\n notificationDOM.style.display = \"block\";\r\n notificationDOM.innerHTML = `<span>${error.message}</span>`\r\n }", "title": "" }, { "docid": "f16bafb53a9f1aa3676f15d81758b5d8", "score": "0.6094406", "text": "function showError(error){\r\n notificationElement.style.display = \"block\";\r\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\r\n}", "title": "" }, { "docid": "15f75ee055c6d7a07ae3c2a5f26c2d68", "score": "0.6081423", "text": "function onOffline() {\n state.offline = true;\n f7.alert('Bạn chưa kết nối Internet! Ứng dụng chuyển sang chế độ ngoại tuyến (OFFLINE) !');\n document.addEventListener(\"online\", onOnline, false);\n }", "title": "" }, { "docid": "15f75ee055c6d7a07ae3c2a5f26c2d68", "score": "0.6081423", "text": "function onOffline() {\n state.offline = true;\n f7.alert('Bạn chưa kết nối Internet! Ứng dụng chuyển sang chế độ ngoại tuyến (OFFLINE) !');\n document.addEventListener(\"online\", onOnline, false);\n }", "title": "" }, { "docid": "5a960b7e00cdd087827f3658a6a06a9d", "score": "0.6075374", "text": "function updateAndDisplayNotifications(callback) {\n chrome.extension.sendRequest({action : 'updateNotifications'}, function(response) {\n\t\tdisplayNotifications(response);\n if(callback) callback(response);\n });\n}", "title": "" }, { "docid": "4db38ac7047e6fd65e2bfcc114883f53", "score": "0.6073936", "text": "function fetchError (message, error) {\n\t\t\tself.success = null;\n\t\t\tself.waitingForUpdate = false;\n\t\t\tself.error = message + ':' + getErrorMessage(error);\n\t\t}", "title": "" }, { "docid": "1d6d01851ac3584ec8cfd8ead8d28b14", "score": "0.60629576", "text": "function showError(error) {\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message}</p>`;\n}", "title": "" }, { "docid": "6499088ce1e33aed93155f89aeec427d", "score": "0.60621595", "text": "function showError(error) {\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "2530611cbf2a0c35eff107b1dfefdfde", "score": "0.60516846", "text": "function showError(error){\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p> ${error.message} </p>`;\n}", "title": "" }, { "docid": "4a9bb547d8547e931ae6dee7fbe85aff", "score": "0.60487926", "text": "function showError(error) {\n notificationElement.style.display = \"block\";\n notificationElement.innerHTML = `<p>${error.message}</p>`;\n}", "title": "" }, { "docid": "3fc5ccaab47b840c784c5e9308b3b82f", "score": "0.60291666", "text": "function showOfflineAlert(button) {\n const offlineAlert = d.cE('div'),\n paragraphAlert = d.cE('p');\n\n offlineAlert.id = 'offline-alert';\n offlineAlert.setAttribute('role', 'alert');\n paragraphAlert.innerHTML = '⚠ You are offline, map is not available.';\n offlineAlert.appendChild(paragraphAlert);\n\n if (button) { // Add close button if requested.\n const p = d.cE('p'),\n close = d.cE('button');\n\n close.type = 'button';\n close.innerHTML = 'CLOSE';\n p.appendChild(close);\n offlineAlert.appendChild(p);\n\n addListenerTo(close, () => {\n offlineAlert.remove();\n staticMap.removeAttribute('class');\n addListenerToStaticMap();\n });\n }\n\n staticMap.className = 'offline';\n staticMap.style.opacity = 1;\n staticMap.appendChild(offlineAlert);\n staticMap.style.cursor = 'default';\n}", "title": "" }, { "docid": "21f128f631b8801ee2234dfc48ff0f4d", "score": "0.5983295", "text": "function onOnline() {\n state.offline = false;\n f7.alert('Bạn đã kết nối Internet!, dữ liệu của bạn sẽ được đồng bộ!');\n }", "title": "" }, { "docid": "21f128f631b8801ee2234dfc48ff0f4d", "score": "0.5983295", "text": "function onOnline() {\n state.offline = false;\n f7.alert('Bạn đã kết nối Internet!, dữ liệu của bạn sẽ được đồng bộ!');\n }", "title": "" }, { "docid": "7c8024575a9717d2df23e80cf73a8b25", "score": "0.5946023", "text": "_onOffline() {\n // this._connection.disconnect(\"gone_offline\");\n this._connection._doDisconnect();\n }", "title": "" }, { "docid": "19cc210ec2cf16e469e100f9263355fd", "score": "0.59139585", "text": "function notify (msg) {\n\t\tnotification.innerHTML = msg;\n\t}", "title": "" }, { "docid": "d2dc2f76622a354b449ada1ef1c427fd", "score": "0.5866324", "text": "function onOffline() {\n alert(\"Offline\");\n // Handle the offline event\n}", "title": "" }, { "docid": "d3c1ceb893e105a35c20c14dc7ceac4d", "score": "0.58417755", "text": "function notify(message) {\n $('#error-message').html(message);\n}", "title": "" }, { "docid": "0f46f3a541d492ff52511e4fba8cc8af", "score": "0.58295286", "text": "function show_notif_update() {\n\t\tif ($(\"div.submit-container > span.notif\").length) return;\n\t\t$(\"div.submit-container\").append('<span class=\"notif text-red\">Tidak ada data yang berubah (tidak perlu save)</span>');\n\t\tsetTimeout(() => $(\"div.submit-container > span.notif\").remove(), 2500);\n\t}", "title": "" }, { "docid": "969aa40a711762e8e4db77c969943cb3", "score": "0.5823453", "text": "function afficheUneNotification() {\n $(pseudoError).fadeIn();\n \n }", "title": "" }, { "docid": "87c2422051c159fd03c39f561c6858df", "score": "0.5791892", "text": "forceOffline() {\n this.internal.offlineForced = true;\n this.broadcast();\n }", "title": "" }, { "docid": "fe7c2e0374bc3145edff1d7d5b75e7cd", "score": "0.5790778", "text": "function statusUpdate(icon, text) {\n Office.context.mailbox.item.notificationMessages.replaceAsync(\"status\", {\n type: \"informationalMessage\",\n icon: icon,\n message: text,\n persistent: false\n });\n}", "title": "" }, { "docid": "d64c129f859631371b59fd6fa0b96113", "score": "0.57561976", "text": "_update()\n{\n let numErrors = this.length();\n\n // XXX: should badge show count of errors or count of known Fcommands or\n // be configurable for either (or none)?\n browser.browserAction.setBadgeText({\n text: numErrors > 0 ? numErrors.toString() : \"\"\n });\n\n // If there are any error page tabs open, reload them (they'll pick up\n // information from this error manager automatically).\n this._reloadErrorPages();\n}", "title": "" }, { "docid": "e237ed507b7982a2ddac4dfac85f6078", "score": "0.5749738", "text": "function showError(error){\n const notificationElement1= document.getElementById = \"error-message\";\n notificationElement1.innerHTML = `${error.message}`;\n}", "title": "" }, { "docid": "9d392a0a0731d98fc138f92aaa094387", "score": "0.5718066", "text": "function updateNotifications() {\n console.log('MenuController.updateNotifications()');\n NotificationService.getNotificationStatus()\n .then(function(notifications) {\n console.log('MenuController.updateNotifications(), notifications: ', notifications);\n vm.notifications.total = notifications.total || 0;\n vm.notifications.messages = notifications.messages || 0;\n vm.notifications.donations = notifications.donations || 0;\n vm.notifications.friendRequests = notifications.friendRequests || 0;\n vm.notifications.deliveryRequests = notifications.deliveryRequests || 0;\n });\n }", "title": "" }, { "docid": "cc4a0e724323140badbf4b76ffd11fde", "score": "0.57161176", "text": "notify() {\n // Dashboard notification\n this.refs.notificationAlert.notificationAlert({\n place: \"br\",\n message: (\n <div>\n <div>\n Welcome to <b>Caliper GUI</b> - An Intuitive Visualization Tool for Hyperledger Caliper.\n </div>\n </div>\n ),\n type: \"warning\",\n icon: \"now-ui-icons ui-1_bell-53\",\n autoDismiss: 7\n });\n }", "title": "" }, { "docid": "eede0e445cd29a90f87f50d9a0a759ab", "score": "0.57068133", "text": "function showErrorMessage(message, name){\n jQuery.notify({\n icon: 'fa fa-ban',\n title: \"<b>AMZ LogBook > </b>\",\n message: message,\n },{\n element: 'body',\n position: null,\n type: 'danger',\n allow_dismiss: true,\n newest_on_top: true,\n showProgressbar: false,\n placement: {\n from: \"top\",\n align: \"right\"\n },\n offset: 20,\n spacing: 10,\n z_index: 1031,\n delay: 5000,\n timer: 1000,\n url_target: '_blank',\n mouse_over: null,\n animate: {\n enter: 'animated fadeInDown',\n exit: 'animated fadeOutUp'\n }\n }); \n}", "title": "" }, { "docid": "1c9766b378c4ae634b40b810fc1207da", "score": "0.57039666", "text": "function updateWidgetError(error) {\n if (error.data && error.data.message) {\n vm.error = error.data.message;\n } else {\n vm.error = \"Unable to update the widget. Please try again later.\";\n }\n }", "title": "" }, { "docid": "8d68f5d86e72cd9e4a7ae242737dbdab", "score": "0.5693068", "text": "updateNotification(newMessage) {\n const {summary, notifications} = this.state;\n\n const notification = notifications.filter((notification) => {\n return (notification.id === newMessage.id);\n })[0];\n\n if (!notification) {\n // console.error('Cannot update message, not found: ' + newMessage.id, newMessage);\n // return;\n return false;\n }\n\n if (notification.type !== newMessage.type) {\n summary[notification.type] -= 1;\n summary[newMessage.type] += 1;\n }\n\n notification.type = newMessage.type;\n notification.message = newMessage.message;\n notification.autodismiss = newMessage.autodismiss;\n if (newMessage.autodismiss) {\n notification.autodismissStartedAt = new Date().getTime();\n }\n\n this.setState({\n notifications, summary\n }, () => {\n this.autoDismisser.run();\n });\n\n return true;\n }", "title": "" }, { "docid": "b08b0773be350727df758f3ede9335e4", "score": "0.5689839", "text": "function PostErrorNotification(data) {\n if (errorsArray.includes(data)) {\n $.notify(data, 'error');\n } else if (lastError === null) {\n $.notify('There has been a problem with your Json file', 'error');\n lastError = 'There has been a problem with your Json file';\n setTimeout(() => { lastError = null; }, 1000);\n }\n}", "title": "" }, { "docid": "fa2f040f6dfd35d6cfc248169f524e07", "score": "0.5689426", "text": "function onLinkedInError(error) {\n //alert(error);\n SmallNotification('Error occurred.', -1);\n}", "title": "" }, { "docid": "e12f1393571ca2461f5779606486ec56", "score": "0.5687992", "text": "function onAppsRetrievalRejected(error, err, e) {\n $scope.status.error = {};\n $scope.status.error.message = \"Not available\";\n $scope.status.error.code = \"0\";\n }", "title": "" }, { "docid": "42baa8e11e005b4d4422766d6f2cb93a", "score": "0.56873727", "text": "function updateNotificationBadge() {\n utils.updateNotificationBadge(notifications.length);\n}", "title": "" }, { "docid": "8fc5b49674058005917331c4b6e7829a", "score": "0.5681183", "text": "static displayBackupNotification() {\n return Database.get('Ids', 'backupNotification')\n .then(backupNotification => {\n let overrides = {\n // Don't persist our backup notification; users should ideally not see them\n persistNotification: false,\n data: { __isOneSignalBackupNotification: true }\n };\n if (backupNotification) {\n return ServiceWorker.displayNotification(backupNotification, overrides);\n }\n else {\n return ServiceWorker.displayNotification({\n content: 'You have new updates.'\n }, overrides);\n }\n });\n }", "title": "" }, { "docid": "dc91d8da46ff3ff4017610efd270641e", "score": "0.5678348", "text": "function notify(message){\n notifications.notify({\n title: \"Datawake Notice\",\n text: message,\n iconURL: self.data.url(\"images/waveicon38.png\")\n });\n}", "title": "" }, { "docid": "102a6e9a7db79db348d20db508f85540", "score": "0.5675209", "text": "function showError(){\r\n document.querySelector(\".notificationblock\").style.display = \"block\";\r\n document.querySelector(\".inner-notificationblock\").innerHTML = \r\n `\r\n <h2> Geen locatie gevonden! </h2>\r\n <br>\r\n <h3>Als je de IchthusWeerApp wilt gebruiken, zul je je locatie moeten delen!</h3> \r\n <h4>(Refresh de pagina als je locatie delen hebt toegestaan)</h4>\r\n <h4>Dat doe je zo:</h4>\r\n <img src=\"./img/Weatherapp-location.png\" alt=\"Weatherapp-tutorial\">\r\n `;\r\n}", "title": "" }, { "docid": "cbb79746cecc587795b61ad681f92c30", "score": "0.5664317", "text": "function updateOfflineUsers(username) {\n\t// console\t.log(\"Offline user: \" + username);\n\tvar url = user_url + username;\n\t// console.log(url);\n\tgetData(\"GET\", url, function(data){\n\t\t// console.log(data);\n\t\tif(data.status === 404){\n\t\t\ttwitch.insertAdjacentHTML('beforeEnd', \"<div class='element inexistent'><p>\"+ username + \" was not found </p> </div>\");\n\t\t}\n\t\telse{\n html = \"<div class='element offline'><p>\" + username + \" is currently offline</p></div>\";\n twitch.insertAdjacentHTML(\"beforeEnd\", html);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f68a5e7ed40bc5ec0ad0b6fc2f04f3ee", "score": "0.56596094", "text": "onOffline_() {\n this.online_ = false;\n }", "title": "" }, { "docid": "8b36035e0a276b14346c2600da00ddca", "score": "0.5653663", "text": "function displayNotification(){\r\n\r\n \r\n\r\n //log in the console the status of our permission whether its granted or denied\r\n Notification.requestPermission(status => {\r\n console.log('notification permission status: ', status);\r\n });\r\n\r\n\r\n\r\n if(Notification.permission === 'granted'){\r\n navigator.serviceWorker.getRegistration()\r\n .then(reg => {\r\n reg.showNotification('Hello World!', options);\r\n unreadCount++;\r\n });\r\n }\r\n navigator.setAppBadge(unreadCount).catch((error) => {\r\n //Do something with the error.\r\n console.log(error);\r\n });\r\n }", "title": "" }, { "docid": "7f28aa89b4056c75b1d6ac6b9db82653", "score": "0.5631157", "text": "function updateNotifications(){\r\n\tif(notifications != 0){\r\n\t\tdocument.getElementById(\"notifs\").innerHTML = notifications;\r\n\t}else{\r\n\t\tdocument.getElementById(\"notifs\").innerHTML = '';\r\n\t}\r\n}", "title": "" }, { "docid": "300abcb5fbf44da9aafe01753f50c2cc", "score": "0.56279683", "text": "function showUpdatePrompt(waitingServiceWorker) {\n var t = M.toast({\n html: \"<span>An update has been downloaded. You can apply it now by reloading, or wait until \" +\n \"your next visit.</span><div><a id='updateprompt-reload' class='btn-flat toast-action'>Reload</a><br>\" +\n \"<a id='updateprompt-dismiss' class='btn-flat toast-action'>Not Now</a></div>\", displayLength: 60000\n });\n $(\"#updateprompt-reload\", t.el).click(function () {\n // instead of just reloading, make the service worker skip waiting to make sure it's activated\n waitingServiceWorker.postMessage({action: \"doUpdateRefresh\"});\n // then wait for the controller change event to do the reload\n navigator.serviceWorker.addEventListener(\"controllerchange\", function handler() {\n navigator.serviceWorker.removeEventListener(\"controllerchange\", handler);\n window.location.reload();\n });\n });\n $(\"#updateprompt-dismiss\", t.el).click(function () {\n t.dismiss();\n });\n}", "title": "" }, { "docid": "9d26fbdde06696fa20535da85b07c1a3", "score": "0.56240726", "text": "function _notifyError( message, request ) {\n\tlet error = `Menus failed to load. The endpoint returned: ${message}: ${request.responseJSON.message}`;\n\tif ( 'rest_no_route' === request.responseJSON.code ) {\n\t\terror += '. Please enable the `wp-api-menus` plugin to enable this endpoint.';\n\t}\n\tconsole.warn( error );\n}", "title": "" }, { "docid": "a9ba3b9f0cd936bf8927fefdc3f244c9", "score": "0.5621831", "text": "function sendroidNotify(error, body, showUserPref) {\r\n\tnotifications.notify({\r\n\t\ttitle: APP_NAME + \" : \" + error,\r\n\t\ttext: body,\r\n\t\ticonURL: APP_ICON_64,\r\n\t\tonClick: function() {\r\n\t\t\tif (showUserPref) {\r\n\t\t\t\tshowUserPrefsPanel();\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "1651d91bf6302ac2aa236da22defeab3", "score": "0.5612401", "text": "handleUpgradeNotification(notification) {\n let message = Ember.get(notification, 'message');\n Ember.set(this, 'message', Ember.String.htmlSafe(message));\n }", "title": "" }, { "docid": "c3cf4ee671014aa464ef28b5ba198464", "score": "0.5611826", "text": "async function setUpdateStatusFailed() {\n updateStatus.failed = true;\n updateStatus.timestamp = new Date().toLocaleString();\n updateStatus.error = execError;\n updateStatus.inProgress = false;\n await sendUpdateStatus();\n}", "title": "" }, { "docid": "13af7393a5b2fd3779df40f5357bcba0", "score": "0.5610145", "text": "function displayNotification(id) {\n\t\tmessage = i18next.t(id);\n\t\tconsole.log(message);\n\t\tnoty({\n\t\t\tlayout: 'top',\n\t\t\ttheme: 'defaultTheme',\n\t\t\ttype: 'warning',\n\t\t\ttimeout: 2000,\n\t\t\tcloseWith: ['click'],\n\t\t\ttext: '<h3 class=\"notification\">' + message + '</h3>'\n\t\t});\n\t}", "title": "" }, { "docid": "dffd211d58721bc74466a3d5c7ab3b22", "score": "0.55874574", "text": "function showWarningMessage(message, name){\n jQuery.notify({\n icon: 'fa fa-warning',\n title: \"<b>AMZ LogBook > </b>\",\n message: message,\n },{\n element: 'body',\n position: null,\n type: 'warning',\n allow_dismiss: true,\n newest_on_top: true,\n showProgressbar: false,\n placement: {\n from: \"top\",\n align: \"right\"\n },\n offset: 20,\n spacing: 10,\n z_index: 1031,\n delay: 5000,\n timer: 1000,\n url_target: '_blank',\n mouse_over: null,\n animate: {\n enter: 'animated fadeInDown',\n exit: 'animated fadeOutUp'\n }\n }); \n}", "title": "" }, { "docid": "4617fb4229cdb9b910e850819930c7fb", "score": "0.5579094", "text": "function handleGetOfflineMessagesEvent(msg) {\n //paint all offline messages into dialogs\n for (var i = 0; i < msg.messages.length; i++) {\n handleIncomingMessageEvent(msg.messages[i]);\n }\n\n //clear all offline messages\n var mb = { eventType: EVENT_TYPE_CLEAR_OFFLINE_MESSAGES };\n cometd.publish(USERNAME, mb);\n}", "title": "" }, { "docid": "90481894b08b9a2c8291c7f2f549024c", "score": "0.55688035", "text": "connectionOffline () {\n this.element.querySelector('.connection').classList.add('chat-offline')\n let connection = this.element.querySelector('.connection')\n connection.textContent = 'Not connected'\n }", "title": "" }, { "docid": "bda16da05c32d6dd1e5b7c32d7e2f34a", "score": "0.5564575", "text": "function notify(message) {\n\tvar notifications = document.querySelector('#notifications');\n\tnotifications.innerHTML = message;\n}", "title": "" }, { "docid": "894dff14ba7bb73d055cdb03038bccf0", "score": "0.5553909", "text": "function showError(message, title)\n {\n log.warn(\n 'showError: Deprecated function call.' +\n 'Use TYPO3/CMS/FrontendEditing/Notification instead.',\n );\n Notification.error(message, title);\n }", "title": "" }, { "docid": "80167ad538852a03ae07f6f136b93370", "score": "0.5551258", "text": "function notify () {\n var counters = Ext.log.counters,\n supports = Ext.supports,\n hasOnError = supports && supports.WindowOnError; // TODO - timing\n\n // Put log counters to the status bar (for most browsers):\n if (counters && (counters.error + counters.warn + counters.info + counters.log)) {\n msg = [ 'Logged Errors:',counters.error, 'Warnings:',counters.warn,\n 'Info:',counters.info, 'Log:',counters.log].join(' ');\n if (errors) {\n msg = '*** Errors: ' + errors + ' - ' + msg;\n } else if (counters.error) {\n msg = '*** ' + msg;\n }\n win.status = msg;\n }\n\n // Display an alert on the first error:\n if (!Ext.isDefined(Ext.Error.notify)) {\n Ext.Error.notify = Ext.isIE6 || Ext.isIE7; // TODO - timing\n }\n if (Ext.Error.notify && (hasOnError ? errors : (counters && counters.error))) {\n Ext.Error.notify = false;\n\n if (timer) {\n win.clearInterval(timer); // ticks can queue up so stop...\n timer = null;\n }\n\n alert('Unhandled error on page: See console or log');\n poll();\n }\n }", "title": "" }, { "docid": "c00fe8aefd849c8449d9812cd35c113f", "score": "0.5551193", "text": "function updateNotifications() {\n let notifications_html = '';\n\n for (let i = 0; i < notification_list.length; i++) {\n if (notification_list[i].active) {\n notifications_html\n += '<p class=\"notification-message\">'\n + notification_list[i].text + '</p>';\n }\n }\n\n $('#notification-box').html(notifications_html);\n\n if (notifications_html) {\n $('#notification-box').show();\n } else {\n $('#notification-box').hide();\n }\n }", "title": "" }, { "docid": "094635bac86ecf2c2c7294cf21739837", "score": "0.5550029", "text": "onNotificationsOpen() {}", "title": "" }, { "docid": "62580e3d3ce2c830d82dfc13ff6f9fa6", "score": "0.5546809", "text": "function offlineDefault(){\n\n //Log disconnect\n console.log( \"System lost connection at: \" + Date() );\n\n window.location.replace( \"offlineDefault.html\" );\n\n}", "title": "" }, { "docid": "bd80355b4edbdaac36b7ec073b8bcfd7", "score": "0.5530417", "text": "function notify(data) {\n var text = 'Default message',\n color;\n var datatables = [\n '#table-instances',\n '#table-admin-instances',\n '#table-admin-database'\n ];\n try {\n text = data.instance.name;\n if (typeof text === \"undefined\") {\n text = data.instance.id;\n }\n } catch(err) {\n text = data.message;\n }\n if (data.status == \"success\") {\n color = \"teal\";\n } else {\n color = \"red\";\n }\n for (let datatable=0; datatable < datatables.length; datatable++) {\n if ($(datatables[datatable]).length) {\n $(datatables[datatable]).DataTable().ajax.reload();\n }\n }\n Materialize.toast(text, 2000, color);\n}", "title": "" }, { "docid": "052956cadcb0121efc771ee492e7d450", "score": "0.5529592", "text": "async function showNotification (type, message){\n const timer = 2000\n if (type === \"error\"){\n NotificationManager.error(message, \"\", timer);\n }\n else if (type === \"success\"){\n NotificationManager.success(message, \"\", timer);\n }\n else if (type === \"warning\"){\n NotificationManager.warning(message, \"\", timer);\n }\n}", "title": "" }, { "docid": "471af8f9f2e9c6c480df2bc5534869fd", "score": "0.55283976", "text": "function offline(data) {\n\n\t// if the streamer does not exsist, display his name. I'll comment out this section because i don't like the idea of displaying a channel that does not exsist, \n\t// it ruins the project in my opinion, if you would like to see if it works, just remove the comments and add \"comster404\" to the array of streamers\n\n\n\t// START COMMENT OUT SECTION\n\n\t// if(data.status === 404){\n\t// \tvar messages = data.message;\n\t// \tvar displayNotExsistingData = '<div class=\"col-xs-3 col-md-8\" id=\"pm\">' + messages + '</div>';\n\t// \t$('.offline-display').append(messages);\n\t// } else {\n\n\n\n\n\t// getting data from the API\n\tvar status = data.status;\n\tvar name = data.display_name;\n\tvar logo = data.logo;\n\tvar url = data.url;\n\tvar game = \"Offline\";\n\tvar description = data.description;\n\tvar message = \"This channel does not exsist\";\n\t// displaying data\n\tvar displayOfflineData = '<div class=\"row ' + \n status + '\"><div class=\"col-xs-2 col-md-1\"><img src=\"' + \n logo + '\" class=\"img-responsive\"></div><div class=\"col-xs-7 col-md-3\" id=\"name\"><a href=\"' + \n url + '\" target=\"_blank\">' + \n name + '</a></div><div class=\"col-xs-3 col-md-8\">'+ \n game + '</div></div>';\n \t$('.offline-display').append(displayOfflineData);\n\t//console.log(data);\n\n\n\n// } END COMMENT OUT SECTION\n\n\n}", "title": "" }, { "docid": "f9db0833b43309d41566d383afb947c8", "score": "0.5522398", "text": "function load_unseen_notification(){\n\t\tif (window.localStorage.notif == 0) {\n\t\t\tonline_notification();\n\t\t\tcaller_notification();\n\t\t}if (window.localStorage.notif == 1) {\n\t\t\tonline_notification();\n\t\t\treceive_notification();\n\t\t}if (window.localStorage.notif == 2) {\n\t\t\tonline_notification();\n\t\t\treceive_notification();\n\t\t}if (window.localStorage.notif == 3) {\n\t\t\tonline_notification();\n\t\t\tcancel_notification();\n\t\t}\n\t}", "title": "" }, { "docid": "c32cd64ddab7756a64d547da805c03bf", "score": "0.5520289", "text": "function checkNotifications() {\r\n\r\n var error = $(\".js-error-message\").text();\r\n var warning = $(\".js-warning-message\").text();\r\n var success = $(\".js-success-message\").text();\r\n\r\n if (error !== \"\") {\r\n $(\".js-error\").show();\r\n showOverlay();\r\n }\r\n\r\n else if (warning !== \"\") {\r\n $(\".js-warning\").show();\r\n showOverlay();\r\n }\r\n\r\n else if (success !== \"\") {\r\n $(\".js-success\").show();\r\n showOverlay();\r\n }\r\n}", "title": "" }, { "docid": "20f5e79e01fb07180391ed9374662e7e", "score": "0.5519101", "text": "notifyUpdate() {\n if (this.hasUpdate)\n // Already notified.\n return;\n\n // There was an update. Notify the frontend.\n this.hasUpdate = true;\n this.sendNotifyUpdate();\n }", "title": "" }, { "docid": "dc70cd4481ac18898170278524eaffdd", "score": "0.55072206", "text": "function updateVisualNotification() {\n var unreadMsgElement = document.getElementById('unreadMessages');\n\n if (unreadMessages) {\n unreadMsgElement.innerHTML = unreadMessages.toString();\n\n _ToolbarToggler2.default.dockToolbar(true);\n\n var chatButtonElement = document.getElementById('toolbar_button_chat');\n var leftIndent = (_UIUtil2.default.getTextWidth(chatButtonElement) - _UIUtil2.default.getTextWidth(unreadMsgElement)) / 2;\n var topIndent = (_UIUtil2.default.getTextHeight(chatButtonElement) - _UIUtil2.default.getTextHeight(unreadMsgElement)) / 2 - 5;\n\n unreadMsgElement.setAttribute('style', 'top:' + topIndent + '; left:' + leftIndent + ';');\n } else {\n unreadMsgElement.innerHTML = '';\n }\n\n $(unreadMsgElement).parent()[unreadMessages > 0 ? 'show' : 'hide']();\n}", "title": "" }, { "docid": "af1f5423a68563243a251f88450f483b", "score": "0.5503548", "text": "function showError(error) {\n alert('Is your network down? ' + error.message);\n }", "title": "" }, { "docid": "36253a2aad8a4fe854ff633381c45ef6", "score": "0.5492662", "text": "function showOffline () {\n const offlineNote = document.createElement('p')\n const footer = document.getElementById('info')\n\n /**\n * wait until footer was rendered by Angular\n */\n if (!footer) {\n return setTimeout(showOffline, 100)\n }\n\n const newNoteInput = document.querySelector('#new-todo')\n newNoteInput.disabled = 'disabled'\n\n offlineNote.innerHTML = '(Offline Version)'\n footer.insertBefore(offlineNote, footer.childNodes[0])\n }", "title": "" }, { "docid": "a85aeca274ae87639621c16f60bee3c9", "score": "0.5480652", "text": "function check_messages() {\n\t$.getJSON('/fetch_updates?cid=' + channel_id, {}, function(r) {\n\t\tif (r != 'None') {\n\t\t\t$('div#notf').css(\"display\", \"block\");\n\t\t\t$.each(r, function (key, val) {\n\t\t\t\t$('div#notf').append('<a href=\"/question/' + val.q_id + '\" class=\"notf__message\">You have a new answer!</a>');\n\t\t\t})\n\t\t}\n\t\tsetTimeout(check_messages, 700);\n\t});\n}", "title": "" }, { "docid": "8c431e356937cc6b42f7752e8383622a", "score": "0.5479481", "text": "function onFailure(errorMessage) {\n warningText.innerHTML = ''\n errorText.innerHTML = errorMessage\n }", "title": "" }, { "docid": "4c374d43586b585a9902a8d13eee1667", "score": "0.54787076", "text": "function BrowserNotification() {\n var m='Your browser version is not supported anymore. The image gallery cannot be displayed. <br><br>Please update to a more recent one. Download:<br>';\n m+='&nbsp;&nbsp;&nbsp; <a href=\"http://www.google.com/chrome/\">Chrome</a><br>';\n m+='&nbsp;&nbsp;&nbsp; <a href=\"http://www.mozilla.com/firefox/\">Firefox</a><br>';\n m+='&nbsp;&nbsp;&nbsp; <a href=\"http://www.microsoft.com/windows/internet-explorer/default.aspx\">Internet Explorer</a><br>';\n m+='&nbsp;&nbsp;&nbsp; <a href=\"http://www.apple.com/safari/download/\">Safari</a>';\n nanoAlert(m, false);\n }", "title": "" }, { "docid": "9f187250706c1454a4f532b31af5a827", "score": "0.5477699", "text": "updateNotification_() {\n if (this.notificationCount_) {\n if (this.getCount() === 0) {\n this.countSvgText_.textContent = '!';\n this.countSvg_.setAttribute('opacity', '1');\n } else {\n this.countSvgText_.textContent = this.notificationCount_ > 99 ?\n '99+' : this.notificationCount_.toString();\n }\n this.countSvg_.setAttribute('opacity', '1');\n } else {\n this.countSvg_.setAttribute('opacity', '0');\n }\n }", "title": "" }, { "docid": "39c71b18f37cfd0b4c87d82d31b2f602", "score": "0.547276", "text": "setNotification(message) {\n this.cache.notification.textContent = message;\n this.cache.notification.classList.add('chat__notification--show');\n\n setTimeout(() => this.cache.notification.classList.remove('chat__notification--show'), 3000);\n }", "title": "" }, { "docid": "f30f157afdd4fc454f4738019cfbff1f", "score": "0.54671776", "text": "function notifyRequestError(error, message, showError)\n{\n\tif (!error)\n\t\treturn;\n\tconsole.error(error);\n\tif (showError && message && message.member)\n\t{\n\t\tmessage.member.send('An error occurred while processing your request: ' + message.content + \"\\n\" + error.toString())\n\t\t\t.catch(console.error);\n\t}\n}", "title": "" }, { "docid": "6cd25e2c6b0eeecf586ce26c922f698b", "score": "0.5453027", "text": "showDisabledMobileSyncNotification() {\n this.showingDisabledMobileSyncNotification_ = true;\n }", "title": "" }, { "docid": "586e8d4f4d185abb463860436f3764df", "score": "0.54513013", "text": "function addErrorMsg() {\n const errMsg = document.createElement('p');\n errMsg.classList.add('errMsg');\n errMsg.innerText = \"Connection lost. Please check the internet\";\n outgoing.appendChild(errMsg);\n }", "title": "" }, { "docid": "51832a0fb103f8ce3e22341eed15947f", "score": "0.5449201", "text": "function notifyUpdateMessages() {\n io.sockets.emit('/message/all', messages);\n }", "title": "" }, { "docid": "6f51fb1eac3827e498451ace39c7d0b8", "score": "0.54429364", "text": "function addNotificationInLocalDataset(n){\n try {\n n.icon_url = $scope.providers[n.provider].icon_url;\n n.provider_dname = $scope.providers[n.provider].display_name;\n } catch(e){\n n.icon_url = \"#\";\n n.provider_dname = \"\";\n }\n $scope.notifications[n.id] = n;\n }", "title": "" }, { "docid": "1c89b141908d95dbb56108b021232d3d", "score": "0.54418623", "text": "function _updateNotifierIcon() {\n $('#brackets-console-panel .toolbar .warn small em').first().text((warnsCount));\n $('#brackets-console-panel .toolbar .error small em').first().text((errorsCount));\n $('#brackets-console-panel .toolbar .debug small em').first().text((logsCount - (errorsCount + warnsCount)));\n var $input = $appButton.find('.counts').first();\n $input.toggle(errorsCount > 0);\n $input.find('em').first().text(errorsCount);\n }", "title": "" }, { "docid": "64fb41a98db60c74cfd60c2bfad49486", "score": "0.54341346", "text": "function fetchEventsError(msg){\n\n\n\n}", "title": "" }, { "docid": "888eec0b9300774fb922f8ff5cbed866", "score": "0.5425112", "text": "function showErrorNotification(texto){\n\tvar notificationBox = document.getElementById('editBoxNotification');\n\tvar notification = document.getElementById('notificationText');\n\n\tnotificationBox.classList.remove('hidden');\n\tnotificationBox.classList.add('show');\n\n\tnotification.innerHTML=texto;\n\n}", "title": "" }, { "docid": "53484fbba1b86c0344e020f737260bc7", "score": "0.5415768", "text": "function Notification(){}", "title": "" }, { "docid": "9b8b8c767c70912854e85c2fa824fd1b", "score": "0.540574", "text": "function erro(msg) {\n\t$.notify({\n \tmessage: msg\n\n },{\n type: 'danger',\n timer: 1000\n });\n}", "title": "" }, { "docid": "19c909a2a9565976d2725054171f98f3", "score": "0.53974324", "text": "function notification (msg, notificationId) {\n var responseIdEl = document.getElementById(notificationId);\n responseIdEl.classList.remove(\"visible-hidden\");\n responseIdEl.classList.add(\"show-response\");\n responseIdEl.innerHTML = msg;\n setTimeout(function() {\n\n responseIdEl.classList.remove(\"show-response\");\n responseIdEl.classList.add(\"visible-hidden\");\n }, 6000);\n }", "title": "" }, { "docid": "831f05265f8aecdbe215f3d16ecc916e", "score": "0.53879213", "text": "function showError() {\r\n\t\tvar notification = 'ERROR_POPUP_CLOSE';\r\n\t\tlet notificationStatus = \"error\";\r\n\t\tif(dataObject.error.status != undefined){\r\n\t\t\tnotificationStatus = dataObject.error.status;\r\n\t\t}\r\n\t\t//var errorCode = (dataObject.responseJSON == undefined)?0:dataObject.responseJSON.error.code;\r\n\t\t//var notificationStatus = (dataObject.responseJSON == undefined)?dataObject.status:dataObject.responseJSON.status;\r\n\r\n\t\tvar errorAlert;\r\n\t\tif(dataObject.notification_name !== undefined){\r\n\t\t\tnotification = dataObject.notification_name;\r\n\t\t}\r\n\r\n if(dataObject.notification_name === undefined){\r\n e.subscribe(gamma.notifications.ERROR_POPUP_CLOSE,onErrorPopupClose);\r\n }\r\n\r\n e.notify(gamma.notifications.RENDERING_COMPLETE);\r\n showAlert();\r\n\r\n var errorStr = \"\";\r\n errorStr = dataObject.error.message;\r\n if(errorStr == \"\" || errorStr == undefined){\r\n errorStr=\"No data available\";\r\n }\r\n\r\n\t\tfunction onErrorPopupClose() {\r\n\t\t\tif (errorAlert != undefined) {\r\n\t\t\t\terrorAlert.clearMemory();\r\n\t\t\t\terrorAlert = null;\r\n\t\t\t}\r\n\t\t\te.unSubscribe('ERROR_POPUP_CLOSE');\r\n\t\t}\r\n\r\n\t\tfunction showAlert() {\r\n\t\t\terrorAlert = new e.popup({ width: 500, height: 'auto', default_state: 1, style: { popup_content: { 'padding': 28 } }, focusIn: false, notify: { onPopupClose: notification } });\r\n\t\t\t//=============== get received data ==================\r\n\t\t\tvar errText = notificationStatus;\r\n\t\t\tvar msgText = (dataObject.responseJSON == undefined) ? dataObject.error.message : dataObject.responseJSON.error.message;\r\n if (msgText == \"\" || msgText == undefined) {\r\n msgText = \"Something went wrong. Please try again after some time.\";\r\n }\r\n var msgTextMore = (dataObject.responseJSON == undefined) ? dataObject.error.details : dataObject.responseJSON.error.details;\r\n var popupTitleData = $('<div/>', { class: 'popup_title_data confirm_popup_title float_left h2 semibold text_transform_capitalize' });\r\n var errColorClass = '';\r\n\t\t\tlet errorTitle;\r\n\t\t\tlet statusType = '';\r\n\t\t\tif (errText == 'info'){\r\n\t\t\t\terrColorClass = 'color_info';\r\n\t\t\t\tstatusType = 'ic-info';\r\n\t\t\t}else if (errText == 'success'){\r\n\t\t\t\terrColorClass = 'color_good';\r\n\t\t\t\tstatusType = 'ic-success';\r\n\t\t\t}else if (errText == 'warning'){\r\n\t\t\t\terrColorClass = 'color_warning';\r\n\t\t\t\tstatusType = 'ic-alert';\r\n\t\t\t}else if (errText == 'error'){\r\n\t\t\t\terrColorClass = 'color_bad';\r\n\t\t\t\tstatusType = 'ic-alert';\r\n\t\t\t}\r\n\t\t\tvar errorIcon = $('<div/>', { class: errColorClass + ' error_icon float_left ' + statusType});\r\n\t\t\t// e.renderIcon(errorIcon, errText);\r\n\t\t\terrorTitle = $('<div/>', { class: 'error_title float_left language_text ' + errColorClass }).html(g.print(errText));\r\n\t\t\terrorTitle.attr('data-language_id', errText);\r\n\t\t\tpopupTitleData.append(errorIcon, errorTitle);\r\n\r\n\t\t\tvar popupData = $('<div/>', { class: 'popup_data explore_error float_left' });\r\n\t\t\tvar errorMessage = $('<div/>', { class: 'error_message float_left' });\r\n\t\t\tvar messageText = $('<div/>', { class: 'error_message_text float_left h4' }).html(msgText);//.html(gamma.errors[error_code]);\r\n\t\t\terrorMessage.append(messageText);\r\n\t\t\tif (msgTextMore && msgTextMore !== '') {\r\n\t\t\t\tvar moreInfo = $('<div/>', { class: 'more_info float_left hand_cursor margin_top_20' });\r\n\t\t\t\tvar more_info_text = $('<div/>', { class: 'more_info_text float_left text_transform p semibold' }).html('More');\r\n\t\t\t\tvar moreInfoIcon = $('<div/>', { class: 'more_info_icon float_left margin_left_5' });\r\n\t\t\t\te.renderIcon(moreInfoIcon, 'triangle');\r\n\t\t\t\tmoreInfo.append(more_info_text, moreInfoIcon);\r\n\t\t\t\tvar messageInfo = $('<div/>', { class: 'error_message_info float_left hide p' }).html(msgTextMore);\r\n\t\t\t\terrorMessage.append(moreInfo, messageInfo);\r\n\t\t\t}\r\n\t\t\tvar closeButton = $('<button/>', { type: 'submit', class: 'error_close_button float_right button_small transition_bcolor' }).html('ok');\r\n\t\t\tpopupData.append(errorMessage, closeButton);\r\n\t\t\terrorAlert.addTitle(popupTitleData);\r\n\t\t\terrorAlert.addContent(popupData);\r\n\t\t\terrorAlert.openPopup();\r\n\r\n\t\t\t$('.more_info').on('click', function () {\r\n\t\t\t\tif ($('.error_message_info').hasClass('hide')) {\r\n\t\t\t\t\t$(this).find('.more_info_icon').children().children().attr({ 'transform': 'rotate(90, 16, 16)' });\r\n\t\t\t\t\t$('.error_message_info').slideDown(300, function () {\r\n\t\t\t\t\t\t$(this).removeClass('hide');\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$(this).find('.more_info_icon').children().children().attr({ 'transform': 'rotate(0, 6, 6)' });\r\n\t\t\t\t\t$('.error_message_info').slideUp(300, function () {\r\n\t\t\t\t\t\t$(this).addClass('hide');\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\t$('.error_close_button').on('click', function () {\r\n\t\t\t\tif(errorAlert === null){\r\n\t\t\t\t\tg.forceClosePopup($(this).parents('.popup_container'));\r\n\t\t\t\t}else{\r\n\t\t\t\t\terrorAlert.closePopup();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "1a08ed74c6e32b0aac1c218a2d914106", "score": "0.5386126", "text": "function notify(message) { \n $(\"#notifications-area\").append(message + \"\\n\");\n return;\n }", "title": "" }, { "docid": "1995a3a25219a3cb068c04bf757f0cc9", "score": "0.53854793", "text": "function erro(msg) {\n\t$.notify({\n \tmessage: msg\n },{\n type: 'danger',\n timer: 1000 \n });\n}", "title": "" }, { "docid": "8f104c0b14fd2ca9cd8524ec7f1b01c9", "score": "0.53824157", "text": "function failureFn(error) {\n if (app.lastId) {\n updateStatus({\n id: app.lastId,\n msg: ['Oops &mdash; there was a server error.<br/>',\n 'Try reloading the page, or contact support@phylotastic.org'].join(''),\n status: 'running'\n });\n }\n}", "title": "" }, { "docid": "8690bef429acb1e8d7ae9e1ae99ffcc4", "score": "0.5378469", "text": "function notify(msg, type, progress) {\n logf();\n if (type == \"error\") {\n chrome.notifications.create(\"\", {\n type: \"basic\",\n iconUrl: chrome.runtime.getManifest().icons[\"128\"],\n title: \"WhatsApp Bot\",\n message: \"Error: \" + msg,\n isClickable: false\n });\n } else {\n chrome.notifications.create(\"\", {\n type: \"basic\",\n iconUrl: chrome.runtime.getManifest().icons[\"128\"],\n title: \"WhatsApp Bot\",\n message: msg,\n isClickable: false\n });\n }\n}", "title": "" }, { "docid": "5ccf6a3c2f04f34d07ae5f08a61aaaff", "score": "0.53779376", "text": "function updateOnlineStatus(event) {\n if (navigator.onLine) {\n // handle online status\n // re-try api calls\n console.log('device is now online');\n console.log('Sending Posts to Server');\n // alert('youre back online');\n event.waitUntil(sendPostsToServer()\n .then(res => {\n console.log(res)\n })\n .catch(e => {\n console.log(e)\n })\n );\n } else {\n // handle offline status\n console.log('device is now offline');\n }\n }", "title": "" }, { "docid": "2ae00992c65cab031cc057a5bbaaf33e", "score": "0.5373495", "text": "function erro(msg) {\n\t\n\n\t$.notify({\n \tmessage: msg\n\n },{\n type: 'danger',\n timer: 1000\n \n });\n}", "title": "" }, { "docid": "5c9e5ea4b255ec62a9760b4cc7f6c98e", "score": "0.53696615", "text": "updateOnlineStatus() {\n const online = typeof window.navigator.onLine !== 'undefined' ? window.navigator.onLine : true;\n\n if (!online) {\n this.emit('is-offline');\n this.info(this.i18n('noInternetConnection'), 'error', 0);\n this.wasOffline = true;\n } else {\n this.emit('is-online');\n\n if (this.wasOffline) {\n this.emit('back-online');\n this.info(this.i18n('connectedToInternet'), 'success', 3000);\n this.wasOffline = false;\n }\n }\n }", "title": "" }, { "docid": "a9f591cc455cb1fc2f3f9e6d06948631", "score": "0.53622985", "text": "function alertStatusChangeFailed(response) {\r\n $mdDialog.show({\r\n controller: function ($scope, $mdDialog, error) {\r\n $scope.error = error;\r\n\r\n $scope.cancel = function () {\r\n $mdDialog.hide();\r\n };\r\n },\r\n scope: $scope,\r\n preserveScope: true,\r\n templateUrl: 'templates/exception.tmpl.html',\r\n parent: angular.element(document.body),\r\n targetEvent: event,\r\n locals: {\r\n 'error': response.data\r\n }\r\n })\r\n }", "title": "" }, { "docid": "e060d1c8d6c5f00cd4e721a89216a6ec", "score": "0.53525007", "text": "function Offline(htmlEscapeFunction, elementId0, elementId1) {\n\n var self = this;\n\n // Private variables for the reason we are offline.\n // Status 0 was used in the flash as the offline reason for things like the license has expired,\n // status1 is used for dayparts.\n var _status = \"\";\n var _reason = \"\";\n var _htmlEscapeFunction = htmlEscapeFunction;\n\n\n // When the kiosk is offline, it is often the practice to show the reason\n // in the top-right corner, and/or the dayparts information at the bottom\n // if they are offline because of dayparts.\n\n // PUBLIC METHOD\n\n // Update the messages and refresh the display.\n self.update = function (message0, message1) {\n\n _status = (message0 !== undefined) ? window.htmlEscape(message0) : \"\";\n _reason = (message1 !== undefined) ? window.htmlEscape(message1) : \"\";\n\n self.updateDisplay();\n };\n\n // Clear out the statuses and update the display.\n self.clearReason = function () {\n _status = \"\";\n _reason = \"\";\n self.updateDisplay();\n };\n\n // Update the display.\n self.updateDisplay = function () {\n\n var offline = $(\"#__offline\");\n var status0 = offline.find(\"#txtStatus0\");\n var status1 = offline.find(\"#txtStatus1\");\n var closeBg = offline.find(\"#closeBg\");\n\n offline.css(\"display\", \"\");\n status0.empty();\n status1.empty();\n\n _status = _status.replace(\"{0}\", _reason);\n \n var visibility = \"none\";\n if ((_reason.length > 0) &&\n (_nex.manager.currentStatus === _nex.manager.statusType.OFFLINE) &&\n _nex.manager.connectedToTM) {\n\n if((_reason.toLowerCase().indexOf(\" am\", 0) >= 0) || (_reason.toLowerCase().indexOf(\" pm\", 0) >= 0)) {\n visibility = \"\";\n status1.append(_status);\n }\n }\n else\n {\n if (status0.length === 0) {\n console.log(\"#txtStatus0 not found\");\n }\n status0.append(_status);\n }\n \n closeBg.css(\"display\", visibility);\n };\n\n self.hide = function () {\n $(\"#__offline\").empty();\n $(\"#__offline\").css(\"display\", \"none\");\n };\n}", "title": "" } ]
1949dd3ac2d176b7239e7f9313b40168
Exit a parse tree produced by DE6Parserscript.
[ { "docid": "2b5e9524a07644e09b71368fd822e810", "score": "0.50488806", "text": "exitScript(ctx) {\n\t}", "title": "" } ]
[ { "docid": "e011e6bb34873c9f6c64129b0b93827a", "score": "0.6539948", "text": "exit() {\n const [testNode] = this.getChildNodes();\n\n testNode.Traces.addDefaultTrace(testNode.path);\n const testTrace = testNode.traceCfg;\n\n // this.logger.debug(`[exit] ${this.debugTag}, ${!!testTrace}, ${this.isControlGroupMergedWithParent()}`);\n\n // const { path } = this;\n if (testTrace) {\n const { BranchStatement } = this;\n if (this.isControlGroupMergedWithParent()) {\n // merged if statement\n BranchStatement.setDecisionTrace(testTrace);\n }\n else {\n // root if statement\n BranchStatement.setDecisionAndPushTrace(testTrace);\n BranchStatement.insertPopTraceBehind();\n }\n }\n }", "title": "" }, { "docid": "af45ce664e814d7705cc3a0b2bb1c2be", "score": "0.64630944", "text": "exitCompilationUnit(ctx) {\n\t}", "title": "" }, { "docid": "51869a5385a9f52dc526614cd3ca9017", "score": "0.6265773", "text": "visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "d445d5a82200574089f466a4ea82933f", "score": "0.62493473", "text": "'*:exit'(node) {\n // For nodes we care about, skip the default handling, because it just marks the node as ignored...\n if (!KNOWN_NODES.has(node.type)) {\n rules['*:exit'](node);\n }\n }", "title": "" }, { "docid": "ef488eca86302250c31b073c82b59a80", "score": "0.6053353", "text": "\"ClassBody:exit\"() {\n stack.pop();\n }", "title": "" }, { "docid": "dc3900bac58239b9b6b6b7dfa30c488d", "score": "0.5905595", "text": "exitDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "ca61ee196c257315a6052a722298d65a", "score": "0.5839509", "text": "exitExpressionStatement(ctx) {\n\t}", "title": "" }, { "docid": "540587d97e4f009924e03be023614fdd", "score": "0.58184874", "text": "exitStatementExpression(ctx) {\n\t}", "title": "" }, { "docid": "ce683055989a7c16fc4da0357b6f2552", "score": "0.5714149", "text": "exitForExpression(ctx) {\n\t}", "title": "" }, { "docid": "50e9a6a6ed03c7f78c848ae8e322efe1", "score": "0.5698129", "text": "exitJumpExpression(ctx) {\n\t}", "title": "" }, { "docid": "345a096d22fb84e38e0f0f4b62f621c6", "score": "0.5689386", "text": "exitExpression(ctx) {\n\t}", "title": "" }, { "docid": "345a096d22fb84e38e0f0f4b62f621c6", "score": "0.5689386", "text": "exitExpression(ctx) {\n\t}", "title": "" }, { "docid": "8c2ab9231d60d305e26775e1ca2b04fa", "score": "0.5657246", "text": "exitStatementWithoutTrailingSubstatement(ctx) {\n\t}", "title": "" }, { "docid": "e589da65b6a57f94bf38344ade9e0cfa", "score": "0.5614463", "text": "exit1() {\n // this.logger.debug(`[exit1] ${this.debugTag} ${!!testTrace} ${this.isControlGroupRoot()}`);\n if (!this.isControlGroupMergedWithParent()) {\n // new if statement\n const { BranchStatement } = this;\n BranchStatement.createBranchStaticTrace(SyntaxType.If);\n }\n }", "title": "" }, { "docid": "4419065b33d95978e77233c6cb0150fb", "score": "0.5612904", "text": "exitStatement(ctx) {\n\t}", "title": "" }, { "docid": "4419065b33d95978e77233c6cb0150fb", "score": "0.5612904", "text": "exitStatement(ctx) {\n\t}", "title": "" }, { "docid": "4419065b33d95978e77233c6cb0150fb", "score": "0.5612904", "text": "exitStatement(ctx) {\n\t}", "title": "" }, { "docid": "435dff42a009907a1a97402f830912db", "score": "0.55943096", "text": "exitMultiVariableDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "ad15e202a5b100f60bcc2763101dd287", "score": "0.5581323", "text": "exitVariableDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "571e04144bebbfebd16430aa0a0e7e0f", "score": "0.55770683", "text": "function parseEnding(parseState, world) {\n\tvar i = parseState.index;\n\tvar lines = parseState.lines;\n\n\treturn parseScript(lines, i, world.end);\n}", "title": "" }, { "docid": "27c30105d5974041495033b15a3f3953", "score": "0.5560386", "text": "exitPackageDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "456355e8f21272403e080ddc5533ffda", "score": "0.5557352", "text": "function BotteryExit(rawExit) {\n\n\tthis.raw = rawExit;\n\n\tfunction parseTarget(target) {\n\t\treturn target.sections[0];\n\t}\n\tconsole.log(rawExit)\n\n\tlet parsed = parse(languages.bottery.contextMap, \"exit\", rawExit)\n\n\tif (parsed.splitter === \"->\") {\n\t\tthis.conditions = parseConditions(parsed.sections[0]);\n\t\tif (parsed.sections[1].splitter === \" \") {\n\t\t\tthis.target = parseTarget(parsed.sections[1].sections[0]);\n\t\t\tthis.actions = parseActions(parsed.sections[1].sections.slice(1));\n\t\t\tconsole.log(this.actions);\n\t\t} else {\n\t\t\tthis.target = parseTarget(parsed.sections[1]);\n\t\t\tthis.actions = [];\n\t\t}\n\n\t} else {\n\t\tconsole.warn(\"Unknown exit format \" + inQuotes(rawExit));\n\t}\n\n\tif (this.target === undefined) {\n\t\tconsole.warn(rawExit)\n\t}\n}", "title": "" }, { "docid": "a71ec9fe620ca7e7d0314ed1ac3291e9", "score": "0.5543904", "text": "exitBlockLevelExpression(ctx) {\n\t}", "title": "" }, { "docid": "b40184fa9293f09974fd9a804d089c1e", "score": "0.553398", "text": "exitOrdinaryCompilation(ctx) {\n\t}", "title": "" }, { "docid": "3d7d58aad56b9926f2b7eba105be01eb", "score": "0.54980505", "text": "function endBranch() {\r\n\t// stop execution of the current std choice\r\n\tstopBranch = true;\r\n\t}", "title": "" }, { "docid": "0bd5cc29436de8428e8ecfb1baee1b95", "score": "0.545959", "text": "exitParenthesizedExpression(ctx) {\n\t}", "title": "" }, { "docid": "1b1c7c00ada49640b0e09326bd16458b", "score": "0.5424237", "text": "exitElement(ctx) {\n\t}", "title": "" }, { "docid": "c3b6b2c1ceb879e8326f9bc281abaf0b", "score": "0.54241526", "text": "exitForStatement(ctx) {\n\t}", "title": "" }, { "docid": "ac5985b1b732aa74b243d1ba90b867e6", "score": "0.5416199", "text": "exitPostfixExpression(ctx) {\n\t}", "title": "" }, { "docid": "f84e5d7a74c5b42e4bb91494f62703db", "score": "0.5400662", "text": "exitRelationalExpression(ctx) {\n\t}", "title": "" }, { "docid": "480b71d1d53292810ff7092bc83ebeee", "score": "0.53892606", "text": "exitClassBodyDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "1d96484834611dcd5dd0346f1c7b8456", "score": "0.537256", "text": "triggerExitRuleEvent() {\r\n // reverse order walk of listeners\r\n for (let i = this._parseListeners.length - 1; i >= 0; i--) {\r\n let listener = this._parseListeners[i];\r\n this._ctx.exitRule(listener);\r\n if (listener.exitEveryRule) {\r\n listener.exitEveryRule(this._ctx);\r\n }\r\n }\r\n }", "title": "" }, { "docid": "9ce4bf0dfde7f6c6c74b2a1527c33391", "score": "0.53512436", "text": "exitUnaryExpression(ctx) {\n\t}", "title": "" }, { "docid": "306a317b8acf900f4839c9e2b13d0e04", "score": "0.5350295", "text": "function exitNode() {\n clearUnvisitedDOM(currentParent, getNextNode(), null);\n currentNode = currentParent;\n currentParent = currentParent.parentNode;\n}", "title": "" }, { "docid": "5f2fa214660753985b0f080ee302950d", "score": "0.53378886", "text": "exitReturnStatement(ctx) {\n\t}", "title": "" }, { "docid": "63cbd5da59726bd217b943476f9d0ed9", "score": "0.53371185", "text": "exitLabeledStatement(ctx) {\n\t}", "title": "" }, { "docid": "0010b6198163ef6d804e2c9460ff9a05", "score": "0.5327231", "text": "exitElvisExpression(ctx) {\n\t}", "title": "" }, { "docid": "430a7598257f9ed46a38bbf0cf99c046", "score": "0.5315722", "text": "exitStatements(ctx) {\n\t}", "title": "" }, { "docid": "6590b7154895a1e1acda5cd3b327a70b", "score": "0.5271121", "text": "finishIncompleteTree() {\n var leaves = Parser.getLeaves(this.tree);\n if (this.tree.root !== this.config[\"rootRule\"]) {\n this.tree = Parser.createNode(0, this.tree.right, this.config[\"rootRule\"], null, this.tree);\n }\n var startNewSentence = null;\n if (leaves.length == 0 || !this.containsSentence()) {\n startNewSentence = true;\n }\n else {\n startNewSentence = this.isSentenceFinished(leaves[leaves.length - 1]);\n }\n var sentence = null;\n if (startNewSentence) {\n sentence = Parser.createNode(this.tree.right, this.tokenizer.tokens.length, this.config[\"sentenceRule\"][0], this.tree, null);\n this.tree.subtrees.push(sentence);\n }\n else {\n var lastLeaf = leaves[leaves.length - 1];\n while (!this.config[\"sentenceRule\"].includes(lastLeaf.root)) {\n lastLeaf = Parser.findParent(this.tree, lastLeaf.parent.left, lastLeaf.parent.right, lastLeaf.parent.root);\n if (lastLeaf.root === this.config[\"rootRule\"]) {\n break;\n }\n }\n sentence = lastLeaf;\n }\n for (var i = leaves.length; i < this.tokenizer.tokens.length; i++) {\n var HelperNode = Parser.createNode(i, i+1, \"Helper\", sentence, null);\n var newNode = Parser.createNode(i, i+1, this.tokenizer.tokens[i], HelperNode, null);\n\n sentence.subtrees.push(HelperNode);\n HelperNode.subtrees.push(newNode);\n }\n while (sentence.root !== this.config[\"rootRule\"]) {\n sentence.right = this.tokenizer.tokens.length;\n var right = sentence.parent.right;\n sentence.parent.right = this.tokenizer.tokens.length;\n sentence = Parser.findParent(this.tree, sentence.parent.left, right, sentence.parent.root)\n }\n sentence.right = this.tokenizer.tokens.length;\n }", "title": "" }, { "docid": "e5bd72feccc93ff04087d45d3362e580", "score": "0.5254332", "text": "exitDoStatement(ctx) {\n\t}", "title": "" }, { "docid": "53226af092f739cc690e2086b79f53cc", "score": "0.5244949", "text": "exitBlockStatement(ctx) {\n\t}", "title": "" }, { "docid": "6624eb54266d49b4db4586583d1f7861", "score": "0.5244054", "text": "exitClassDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "6624eb54266d49b4db4586583d1f7861", "score": "0.5244054", "text": "exitClassDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "a98bf5e850bede69b35415cee9be6072", "score": "0.524028", "text": "exitNormalClassDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "70e55cdca39a2cb2083daa7020d5337b", "score": "0.52387804", "text": "function exit(node) {\n\t\tif(isElement(node)) {\n\t\t\tif(!stack.isEmpty() && node === stack.top) stack.pop();\n\t\t\telse if(!stack.isEmpty() && (isHeadingContentElement(stack.top) || isHidden(stack.top))) {\n\t\t\t\t/* Do nothing */\n\t\t\t} else if(!stack.isEmpty() && isSectioningContentElement(node)) {\n\t\t\t\tif(hasNoHeading(currentSection)) createImpliedHeading(currentSection);\n\t\t\t\tcurrentOutlinee = stack.pop();\n\t\t\t\tcurrentSection = currentOutlinee.lastSection;\n\t\t\t\tfor(var i = 0; i < node.sectionList.length; i++) {\n\t\t\t\t\tcurrentSection.appendChild(node.sectionList[i]);\n\t\t\t\t}\n\t\t\t} else if(!stack.isEmpty() && isSectioningRootElement(node)) {\n\t\t\t\tif(hasNoHeading(currentSection)) createImpliedHeading(currentSection);\n\t\t\t\tcurrentSection = currentOutlinee.parentSection;\n\t\t\t\tcurrentOutlinee = stack.pop();\n\t\t\t} else if(isSectioningContentElement(node) || isSectioningRootElement(node)) {\n\t\t\t\tif(hasNoHeading(currentSection)) createImpliedHeading(currentSection);\n\t\t\t\t/* If the root is a sectioning element, the walk ends here */\n\t\t\t\t/* If not, we reset the algorithm for subsequent top-level sectioning elements */\n\t\t\t\tcurrentOutlinee = null;\n\t\t\t\tcurrentSection = null;\n\t\t\t} /* else { */\n\t\t\t\t/* Do nothing */\n\t\t\t/* } */\n\t\t}\n\t\tif(node.associatedSection === null && currentSection !== null) associateNodeWithSection(node, currentSection);\n\t}", "title": "" }, { "docid": "06443fcb5202bf64ee7d4822c9e703b7", "score": "0.52372175", "text": "exitIfExpression(ctx) {\n\t}", "title": "" }, { "docid": "871939e77e95810638b571e1184a59da", "score": "0.52309", "text": "function endNode() {\n if (parent.children) {\n mergeChildren(parent.children);\n sortChildren(parent.children);\n }\n parent = parentsStack.pop();\n }", "title": "" }, { "docid": "bed026d08be4d86b9f768489e8f6e718", "score": "0.52294534", "text": "exitPreprocessorParenthesis(ctx) {\n\t}", "title": "" }, { "docid": "65c675c4fd2cdc9673c9151840ed7767", "score": "0.52268493", "text": "exitConditionalOrExpression(ctx) {\n\t}", "title": "" }, { "docid": "76f793cfde5df80124b953666788fb3f", "score": "0.52062255", "text": "exitLoopExpression(ctx) {\n\t}", "title": "" }, { "docid": "d1af8b75305de855aa8023974bcfbaa1", "score": "0.52018386", "text": "exitSuperExpression(ctx) {\n\t}", "title": "" }, { "docid": "b9fc68e74f7114a387f85046424dbcb7", "score": "0.51978713", "text": "exitAndExpression(ctx) {\n\t}", "title": "" }, { "docid": "e12f9b981c37d3e6ff1c8c09d2e5f458", "score": "0.51968956", "text": "exitPostfixUnaryExpression(ctx) {\n\t}", "title": "" }, { "docid": "6e1c26153aae774533aa3b268f066ffd", "score": "0.51936203", "text": "exitModuleDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "1b8173c6e1cff7f922317af8f3a0319e", "score": "0.5189448", "text": "function Return() {\n \t\t\tdebugMsg(\"ProgramParser : Return\");\n \t\t\tvar line=lexer.current.line;\n \t\t\t\n \t\t\tlexer.next();\n \t\t\t\n \t\t\tvar expr=Expr();\n \t\t\tvar ast=new ASTUnaryNode(\"return\",expr);\n \t\t\tast.line=line;\n \t\t\treturn ast;\n \t\t}", "title": "" }, { "docid": "8611f43712502fde33b846aaa80e05a6", "score": "0.5162282", "text": "exitVariableDeclarator(ctx) {\n\t}", "title": "" }, { "docid": "668b08c0410c65272d44f1f747da874f", "score": "0.5161103", "text": "function selection_exit() {\n return this._exit || (this._exit = emptyOf(this));\n }", "title": "" }, { "docid": "e48a9097f337b9d18e65ba084f7b6125", "score": "0.5148588", "text": "exitTypeDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "ad2e18c7f9a5da98b78bbbb96f76e0c7", "score": "0.51467776", "text": "exitThisExpression(ctx) {\n\t}", "title": "" }, { "docid": "2a42a15c3a8bd59fd5381084e99a85c9", "score": "0.5132609", "text": "exitFunctionDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "fbb19726946a8c9e0a3625b13464b3e2", "score": "0.5132506", "text": "endGroup() {\n this.macros.endGroup();\n }", "title": "" }, { "docid": "0eef2c9d17c84808518fbd2cba022c26", "score": "0.5129736", "text": "exitModularCompilation(ctx) {\n\t}", "title": "" }, { "docid": "c9071a1a9bc455a7696ea1ac2ab18771", "score": "0.5129625", "text": "exitTryExpression(ctx) {\n\t}", "title": "" }, { "docid": "bad80342fd4cda365be6c9c573604d5c", "score": "0.5125465", "text": "exitControlStructureBody(ctx) {\n\t}", "title": "" }, { "docid": "1d01ffc3ab262274e43bf272a537ae2d", "score": "0.5118664", "text": "endIf() {\n return this._endBlockNode(If, Else);\n }", "title": "" }, { "docid": "1d01ffc3ab262274e43bf272a537ae2d", "score": "0.5118664", "text": "endIf() {\n return this._endBlockNode(If, Else);\n }", "title": "" }, { "docid": "746f633ac9b778128877f779cf35105e", "score": "0.510396", "text": "exit() {}", "title": "" }, { "docid": "1a80bd17be22f296c82644f4c09139e8", "score": "0.5102377", "text": "endIf() {\n return this._endBlockNode(If, Else)\n }", "title": "" }, { "docid": "f5f407ed335f3e713a0ec4cff854c3b4", "score": "0.50882685", "text": "endGroup() {\n this.macros.endGroup();\n }", "title": "" }, { "docid": "86080cd0f4654397ac9aa1cc9b63761e", "score": "0.50832576", "text": "exitElementWord(ctx) {\n\t}", "title": "" }, { "docid": "cfe2ddf3f32e6ffd20096da756f4c23e", "score": "0.5078665", "text": "exitSwitchBlockStatementGroup(ctx) {\n\t}", "title": "" }, { "docid": "86df4c725335dcc421604a2d07fe1551", "score": "0.5070927", "text": "exitStatementExpressionList(ctx) {\n\t}", "title": "" }, { "docid": "9243f3f92effaf9411cf38e87c991ea2", "score": "0.5068553", "text": "exitLiteral(ctx) {\n\t}", "title": "" }, { "docid": "101a88d5b4e99998212d7e484c84335d", "score": "0.5062533", "text": "exitInOperator(ctx) {\n\t}", "title": "" }, { "docid": "ca068e80186d7635028d5eafa0ecd8ba", "score": "0.5061799", "text": "exitObjectDeclaration(ctx) {\n\t}", "title": "" }, { "docid": "59ab005bf7f953a8b66754f9ec726f78", "score": "0.5052195", "text": "function end() {\n module.exports = Object.freeze({\n parse\n });\n}", "title": "" }, { "docid": "59ab005bf7f953a8b66754f9ec726f78", "score": "0.5052195", "text": "function end() {\n module.exports = Object.freeze({\n parse\n });\n}", "title": "" }, { "docid": "9e4c9d391b83c11ed2f8c0d14dd54297", "score": "0.5052049", "text": "exitBlock(ctx) {\n\t}", "title": "" }, { "docid": "9e4c9d391b83c11ed2f8c0d14dd54297", "score": "0.5052049", "text": "exitBlock(ctx) {\n\t}", "title": "" }, { "docid": "5e02ce300afd70f5e9d65a411b8dc8c7", "score": "0.50462466", "text": "endBlock() {\n this.ident -= 1;\n this.writeLine('}');\n }", "title": "" }, { "docid": "bf1ea48acc8f94ca6c4eb9632c8e6f7b", "score": "0.50462264", "text": "exitSeq_element(ctx) {\n\t}", "title": "" }, { "docid": "628b7ad97fd1c83156f4ee57642090aa", "score": "0.50450796", "text": "exitConditionalExpression(ctx) {\n\t}", "title": "" }, { "docid": "628b7ad97fd1c83156f4ee57642090aa", "score": "0.50450796", "text": "exitConditionalExpression(ctx) {\n\t}", "title": "" }, { "docid": "3c901b47b42c9257b89a53575dc3947d", "score": "0.5041103", "text": "exitCatchClause(ctx) {\n\t}", "title": "" }, { "docid": "2992c9f3798f13ac252f2524a4105009", "score": "0.5040106", "text": "exitBlockStatements(ctx) {\n\t}", "title": "" }, { "docid": "5639051bc96ec3feb8684022eb306daa", "score": "0.5036905", "text": "exitExpressionName(ctx) {\n\t}", "title": "" }, { "docid": "1b639d795df20c373a28e9f4eec2188f", "score": "0.5036782", "text": "exitSwitchStatement(ctx) {\n\t}", "title": "" }, { "docid": "7391b6ea6aca8077fafbd5e1a2a52a62", "score": "0.5024707", "text": "exitAssignmentExpression(ctx) {\n\t}", "title": "" }, { "docid": "a4feabe9e069290e804d59eb40fd6167", "score": "0.50210005", "text": "exitComparisonOperator(ctx) {\n\t}", "title": "" }, { "docid": "b5928c8ba10e8af8fe82f6bb1eb30fd3", "score": "0.5020602", "text": "exitBreakStatement(ctx) {\n\t}", "title": "" }, { "docid": "a127c143fba5771e077dedbefcae8f1d", "score": "0.5018319", "text": "function parse_Program(){\n\tdocument.getElementById(\"tree\").value += \"PARSER: parse_Program()\" + '\\n';\n\t\n\n\tCSTREE.addNode('program', 'branch');\n\n\t\n\t\n\tparse_Block();\n\t\n\t\n\t/*\n\t{\n\t}\n\t$\n\t*/\n \t\n\tmatchSpecChars('$',parseCounter); // match EOP symbol after\n\t\n\tCSTREE.endChildren();\n\t\n\tparseCounter = parseCounter + 1;\n\n\t\n\tdocument.getElementById(\"tree\").value += \"PARSER: Parsing complete\" + '\\n' + '\\n';\n\t\n\t\n\tdocument.getElementById(\"tree\").value += CSTREE.toString();\n\t\n\tif (tokenstreamCOPY[parseCounter] != undefined){\n\t\t tokenID = 0;\n\t\t CSTREE = new Tree();\n\t\t parser();\n\t\t\n\t}\n\telse{\n\t\tdocument.getElementById(\"tree\").value += '\\n';\n\t\tdocument.getElementById(\"tree\").value += 'PARSER: done parsing programs';\n\t\tparseCounter =0;\n\t\tlookAhead = parseCounter + 1;\n\t\tparentCounter = 0;\n\t\ttokenID = 0;\n\t\tCSTREE = new Tree();\n\t\tASTparseStart();\n\t}\n\t\n\t//print out cst\n\t\n\t\n\t\n}", "title": "" }, { "docid": "1a457aa46d657a17c2b41e84dfd85c0d", "score": "0.501422", "text": "exitClassBody(ctx) {\n\t}", "title": "" }, { "docid": "1a457aa46d657a17c2b41e84dfd85c0d", "score": "0.501422", "text": "exitClassBody(ctx) {\n\t}", "title": "" }, { "docid": "92968d18dd32a146556277cfa967e11e", "score": "0.5009146", "text": "exitRoot(ctx) {\n\t}", "title": "" }, { "docid": "aed5e7b356836dc08550a6537f20aff2", "score": "0.5001448", "text": "exitFunctionBody(ctx) {\n\t}", "title": "" }, { "docid": "6b76baa9c4d5141aee9d6985d5b4bf97", "score": "0.49978438", "text": "function close() {\n exitNode();\n return currentNode;\n}", "title": "" }, { "docid": "cbbab0ace46f9e3472286a7ec148a933", "score": "0.49891555", "text": "exitWhileExpression(ctx) {\n\t}", "title": "" }, { "docid": "d0e3cdf1d0d1dd4b1db417ffd844375d", "score": "0.4980118", "text": "exitUnaryExpressionNotPlusMinus(ctx) {\n\t}", "title": "" }, { "docid": "caafc861348f63e18e0d613bf28b8bce", "score": "0.49772146", "text": "endGroup() {\n if (this.undefStack.length === 0) {\n throw new ParseError(\"Unbalanced namespace destruction: attempt \" + \"to pop global namespace; please report this as a bug\");\n }\n\n const undefs = this.undefStack.pop();\n\n for (const undef in undefs) {\n if (undefs.hasOwnProperty(undef)) {\n if (undefs[undef] === undefined) {\n delete this.current[undef];\n } else {\n this.current[undef] = undefs[undef];\n }\n }\n }\n }", "title": "" } ]
af5262b5749c23787f91ffb981974169
description figures out the the exact move for the computer to make, having already figured out the type of play the computer will make paramaters: simplifiedMatches (object) an object created from the "simplifyMatches" method typeOfPlay (string) the type of play the computer is looking to make (see method searchForPlay's constant "logicalPlays" for reference)
[ { "docid": "06ac2732a6951e22576fd03c1428d887", "score": "0.6264438", "text": "function determineExactPlay(simplifiedMatches, typeOfPlay)\n{\n //combines horizontal, vertical, and diagonal matches, and splits the\n //resulting string into an array\n simplifiedMatches = simplifiedMatches.horizontal + simplifiedMatches.vertical + simplifiedMatches.diagonal;\n simplifiedMatches = simplifiedMatches.split('/');\n\n //iterates through matches and finds all instances of given \"typeOfPlay\"\n indexesAvailable = simplifiedMatches.reduce((indexesAvailable, match, index) =>\n {\n if(match + '/' === typeOfPlay)\n {\n indexesAvailable.push(index);\n }\n return indexesAvailable;\n }, []);\n\n //takes the result of \"indexesAvailable\" and returns something at random\n return indexesAvailable[Math.floor( Math.random() * (indexesAvailable.length - 1))];\n}", "title": "" } ]
[ { "docid": "93b3b20023878c24f3e45424683070d3", "score": "0.58293504", "text": "function searchForPlay(plays)\n{\n //all possible win combinations\n let matches = getPossibleMatches(plays);\n //a dumbed down version of possible win combinations (Basically, a count\n //of numbers of x's, o's, and blanks of each win combination on the board)\n let simplifiedMatches = simplifyMatches(matches);\n //the indexes for win combinations, based on a board like this: 0 1 2\n // 3 4 5\n // 6 7 8\n const matchIndexes = '012/345/678/036/147/258/048/246/';\n // the number of x's and o's respectively in a match possibility\n const typeOfPlays = [\n '02/', //checks if there is a play for a win\n '20/', //checks if the opponent needs to be blocked from a win\n '01/', //checks for possibility of two o tiles and a blank spot\n '00/' //checks for possibility of one o tile in a line of blank spots\n ];\n //the index for the variable 'matchIndexes' to chose\n let matchIndex = -1;\n\n //iterates through 'typeOfPlays' in respective order, and determines an\n //exact 'typeOfPlay' once the best option is found\n typeOfPlays.forEach(typeOfPlay =>\n {\n //checks the possiblility of given 'typeOfPlay'\n let isPlay = ((simplifiedMatches.horizontal.includes(typeOfPlay)) || (simplifiedMatches.vertical.includes(typeOfPlay)) || (simplifiedMatches.diagonal.includes(typeOfPlay)));\n\n //if a typeOfPlay has not yet been determined and a typeOfPlay has now\n //been determined than an exact 'matchIndex' is determined\n if(isPlay && matchIndex === -1)\n {\n matchIndex = determineExactPlay(simplifiedMatches, typeOfPlay);\n }\n });\n\n //checks if a play was found\n if(matchIndex > -1)\n {\n //finds match\n let indexesForMatch = matchIndexes.split('/')[matchIndex].split('');\n\n //iterates through the three spots of the match to find the blank spot\n //to play an 'o'\n for(let i = 0; i < indexesForMatch.length; i++)\n {\n if(plays[indexesForMatch[i]] === '_')\n {\n return indexesForMatch[i];\n }\n }\n }\n\n //if a logical play is not found an 'o' is placed anywhere that is blank\n return plays.indexOf('_');\n}", "title": "" }, { "docid": "636148a777e1f04ab2955bcdd1a8ecb6", "score": "0.5565373", "text": "function compPlay() {\n if (board.gameOver) {\n return;\n }\n // allow computer opponent to play its move and render result\n var eval = board.negamax(board.maxDepth);\n board.doMove(board.bestMove);\n renderMove(board.bestMove, -board.sideToMove);\n}", "title": "" }, { "docid": "13e99191d6aad315aff2e0121469e805", "score": "0.5455287", "text": "move(newTile){\n\t\tlet move = this.focusedTile.designation; \n\t\tlet isTransforming = this.focusedTile.figure.move(newTile.indX, newTile.indY);\n\t\tnewTile.figure = this.focusedTile.figure;\n\t\tnewTile.sprite = this.focusedTile.sprite;\n\t\tthis.focusedTile.sprite = null;\n\t\tthis.focusedTile.figure = null;\n\t\tthis.defocus();\n\t\tif(isTransforming){\n\t\t\tnewTile.figure.transform();\n\t\t\t//TODO: Dialog to give the player the choice of a new type for the figure\n\t\t}\n\t\tdocument.getElementById(\"moveList\").innerHTML += \"<li>Player \" + this.turn + \":\\n\" + newTile.figure.type + \" \" + move + \"→\" + newTile.designation + \"</li>\";\n\t\tthis.changePlayerTurn();\n\t}", "title": "" }, { "docid": "d0f1eb37a4e7bb89d2daefc19ecb82e2", "score": "0.5345788", "text": "onPlayerMove(move) {\n let turn = resolveTurn(move);\n this.displayResults(turn);\n }", "title": "" }, { "docid": "810279668eec19ad59a99ba45b919e9f", "score": "0.531807", "text": "function respond() {\r\n let best = minimax(board.slice(0), \"O\");\r\n if (best.move > -1) {\r\n applyMove(best.move);\r\n }\r\n }", "title": "" }, { "docid": "2e026beba508d0e0698f6002b4ca475f", "score": "0.53038305", "text": "function computerPlays(move) {\n\t\t$(\"#\" + move).html(computerSymbol);\n\t\t$(\"#\" + move).addClass(\"claimed\");\n\t\tupdateBoard(move, computer);\n\t}", "title": "" }, { "docid": "d1be53e3206282deedeb68185c374360", "score": "0.52796656", "text": "function play()\n{\n if(!engine.in_checkmate() && engine.turn() === 'w')\n {\n //Getting all HTML elements using DOMs\n var move = document.getElementById('move');\n var searched = document.getElementById('movessearched');\n var player = document.getElementById('player');\n \n //Variables to keep track of number of moves searched\n totalmoves = 0;\n totalmovesk = 0;\n movessearched = 1;\n\n //Finding all possible moves\n var moves = engine.moves();\n \n //Finding best move\n var bestmove;\n var temp = findbest(treedepth , true, -100000, 100000);\n bestmove = temp;\n\n //Displaying number of moves searched\n searched.innerHTML = movessearched;\n \n //Displaing the move \n move.innerHTML = temp.move;\n\n //Displaying player turn\n player.innerHTML = \"Black to play\";\n\n //Checking if in checkmate\n if(engine.in_checkmate())\n {\n player.innerHTML = 'Checkmate';\n }\n\n //Checking if in stalemate\n else if(engine.in_draw())\n {\n player.innerHTML = 'Stalemate';\n }\n\n //Checks if in 3 fold repetetion\n else if(engine.in_threefold_repetition())\n {\n player.innerHTML = 'Stalemate due to 3 fold repetition';\n }\n\n //Checking if in check\n else if(engine.in_check())\n {\n player.innerHTML = 'In check';\n }\n\n //Updating the engine\n engine.move(bestmove.move);\n\n //Checking if the player can do anymore moves or has he lost\n let player_moves = engine.moves();\n let player_lose = true;\n for(let i = 0; i < player_moves.length; ++i)\n {\n if(engine.move(player_moves[i]))\n {\n //Un-doing the move\n engine.undo();\n player_lose = false;\n break;\n }\n }\n\n //If he can't do anymoves, then evaluating his position\n if(player_lose === true)\n {\n //If he is checkmated\n if(engine.in_checkmate())\n {\n player.innerHTML = 'You lose bruh!! Get wrecked!!';\n }\n //If player has drawn\n else if(engine.in_draw())\n {\n player.innerHTML = \"It's a draw but I'll get you next time bugger\";\n }\n else if(engine.in_threefold_repetition())\n {\n player.innerHTML = \"You're scared of me, aren't you! It's a draw this time but I'll get you in the next one\";\n }\n }\n\n //Updating the rendering of the board\n config.position = getfen(engine.fen());\n board = ChessBoard('board', config);\n }\n\n else if(engine.in_checkmate() === true)\n {\n console.log('Game Over');\n }\n}", "title": "" }, { "docid": "80ead4789cd9b59eb21118db730fd350", "score": "0.527623", "text": "function playSmartMove(){\n var choice, filter, victories = [], shortest;\n filter = new RegExp(\"^\" + g);\n for(var i in games){\n \tif(games[i].match(filter)){\n if(games[i].length % 2 == 0 ){\n victories.push(games[i]);\n }\n }\n }\n /* if the game was recorded play a choice, if not, play a random one */\n if(victories.length > 0){\n /* Get the shortest of the games that were won, not of all the games FIXED */\n shortest = victories.reduce(function (a, b) { \n return ( a.length <= b.length && a.length > g.length ) ? a : b; \n });\n choice = shortest[ g.length ];\n play(choice, false);\n }else{\n \tplayValidMove(g);\n }\n return(g);\n}", "title": "" }, { "docid": "42ddff93203da8c84426071a4a43aa4c", "score": "0.5269878", "text": "function movementLogic()\n{\nswitch(spots[posx][posy])\n\t{\n\tcase \"C1\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 1\";\n\t\tgenericChallenge(C1,heroine);\n\t\tbreak;\n\t}\n\tcase \"C2\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 2\";\n\t\tgenericChallenge(C2,heroine);\n\t\tbreak;\n\t} \n\tcase \"C3\":\n\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 3\";\n\t\tgenericChallenge(C3, heroine);\n\t\tbreak;\n\t} \n\tcase \"C4\":\n\t\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY]=\"+\";\n\t\tgameMoveText+=\"<br>you passed through challenge 4\";\n\t\tgenericChallenge(C4,heroine);\n\t\tbreak;\n\t} \n\tcase \"P1\":\n\t\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through a prize! you get a lollipop\";\n\t\tpcount = pcount+1;\n\t\theroine.items[pcount] = \"lollipop\";\n\t\tbreak;\n\t} \n\tcase \"P2\":\n\t\t{\n\t\t\tspots[posx][posy] = \"S\";\n\t\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you passed through a prize! You get a kazoo\";\n\t\tpcount = pcount +1;\n\t\theroine.items[pcount] = \"kazoo\";\n\t\tbreak;\n\t} \n\tcase \"W\":\n\t{\n\t\tposy = prevY;\n\t\tposx = prevX;\n\t\tgameMoveText+=\"<br>You hit a wall, try again\";\n\t\tbreak;\n\t}\n\tcase \"G\":\n\t{\n\t\tif(pcount == 2)\n\t\t{\n\t\t\tgameMoveText+=\"Lucina carefully places the \" + heroine.items[0] + \"and \" +heroine.items[1]+\"into the box. you wont believe what happens next. The end.\";\n\t\t\twincondition = 1;\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\tposy = prevY;\n\t\tposx = prevX;\n\t\tgameMoveText+=\"<br>cant finish game yet, get more prizes then try again\" + \"current prizes:\"+ pcount;\n\t\t}\n\t\tbreak;\n\t} \n\tcase \"+\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] =\"+\";\n\t\tgameMoveText+=\"<br>you already passed through here\";\n\t\tbreak;\n\t} \n\tcase \"---\":\n\t{\n\t\tspots[posx][posy] = \"S\";\n\t\tspots[prevX][prevY] = \"+\";\n\t\tgameMoveText+=\"<br> empty space\";\n\t\tbreak;\n\t}\n\tcase \"S\":\n\t{\n\t\tgameMoveText+=\"<br> printed map\";\n\t\tbreak;\n\t}\n\tdefault:\n\t\t{\n\t\t\tgameMoveText+=\"<br>something went wrong\";\n\t\t\tbreak;\n\t\t}\n\t}\n\nvar cStatus = \"<br>current location: y: \" + posx + \"x: \" + posy;\n cStatus += \"<br> Lucina - HP: \" + heroine.HP + \"prizes: \"+heroine.items[0] +\", \"+heroine.items[1] + \"<br>\";\ndocument.getElementById(\"gametext\").innerHTML = gameMoveText;\ndocument.getElementById(\"status\").innerHTML = cStatus;\n\nprintMap();\n}", "title": "" }, { "docid": "2d8ee0b9e4928e1069e71899fc6b9475", "score": "0.5267963", "text": "function playerMove(playerMoveChosen) {\n var computerMoveChoice = computerMove();\n var gameResult = determiningWinner(playerMoveChosen, computerMoveChoice);\n displayResult(playerWins, computerWins);\n roundsPlayed++;\n if (playerWins === roundsNumber) {\n displayText(\n \"YOU WON THE ENTIRE GAME!!! Round \" +\n roundsPlayed +\n \": <strong>\" +\n gameResult +\n \"</strong> won. You played <strong>\" +\n playerMoveChosen +\n \"</strong>, computer played <strong>\" +\n computerMoveChoice +\n \"</strong> \"\n );\n gameActive = false;\n } else if (computerWins === roundsNumber) {\n displayText(\n \"COMPUTER WON THE ENTIRE GAME!!! Round \" +\n roundsPlayed +\n \": <strong>\" +\n gameResult +\n \"</strong> won. You played <strong>\" +\n playerMoveChosen +\n \"</strong>, computer played <strong>\" +\n computerMoveChoice +\n \"</strong> \"\n );\n gameActive = false;\n } else {\n displayText(\n \"Round \" +\n roundsPlayed +\n \": <strong>\" +\n gameResult +\n \"</strong> won. You played <strong>\" +\n playerMoveChosen +\n \"</strong>, computer played <strong>\" +\n computerMoveChoice +\n \"</strong>\"\n );\n }\n}", "title": "" }, { "docid": "1ee0149b95942b99a857647f25fc0a7e", "score": "0.5238275", "text": "function simplifyMatches(matches)\n{\n let simplifiedMatches =\n {\n horizontal: '', vertical: '', diagonal: ''\n };\n\n //turns strings into arrays\n let horizontalArray = matches.horizontal.split('');\n let verticalArray = matches.vertical.split('');\n let diagonalArray = matches.diagonal.split('');\n\n //used in conjuction with the function 'simplify' bellow\n let xBuffer = 0;\n let oBuffer = 0;\n\n /* description - turns match into simplified match\n paramaters: result - (string) the value to add onto\n character - (character) the current character to evaluate\n returns: result;\n */ function simplify(result, character)\n {\n // a '/' indicates a new possible match needs to be evaluated, and the\n //previous match data is stored into the result variable and clears\n //the buffers\n if(character === '/')\n {\n result += `${xBuffer}${oBuffer}/`;\n xBuffer = 0;\n oBuffer = 0;\n }\n //checks if tile contains an x or an o and then increases the respective\n //buffer\n else if(character === 'x')\n {\n xBuffer++;\n }\n else if(character === 'o')\n {\n oBuffer++;\n }\n return result;\n }\n\n //simplifies horizontal, vertical, and diagonal matches by iterating\n //over the character arrays and storing the result in the\n //'simplifiedMatches' properties\n simplifiedMatches.horizontal = horizontalArray.reduce(simplify, '');\n simplifiedMatches.vertical = verticalArray.reduce(simplify, '');\n simplifiedMatches.diagonal = diagonalArray.reduce(simplify, '');\n\n return simplifiedMatches;\n}", "title": "" }, { "docid": "f7ea52ae861c0120f7d12bdf2b960295", "score": "0.52159834", "text": "function matchMove(){\n matched ++;\n let didMatch = document.getElementById('points');\n didMatch.textContent = `Matched: ${matched}`;\n moves --;\n let displayMoves = document.getElementById('moves');\n displayMoves.textContent = `Move(s): ${moves}`;\n}", "title": "" }, { "docid": "53fb85c99063ec259a142c539781a0fa", "score": "0.5211159", "text": "function get_playType(player, board, x, y){\n let opponent\n if (x < 0 || x > 7 || y < 0 || y > 7)\n return \"INVALID\"\n switch(player){\n case \"white\":\n opponent = \"black\"\n break\n case \"black\":\n opponent = \"white\"\n break\n default:\n }\n if (board[x][y].army === opponent)\n return \"PRISE\"\n else if (board[x][y].army === \"empty\")\n return \"MOVE\"\n else\n return \"INVALID\"\n}", "title": "" }, { "docid": "d0ee343a38fa2c34283668b450190251", "score": "0.51883554", "text": "function humanPlay(square) {\n // if player clicks square when game is over\n if (board.gameOver) {\n alert(\"Game already over!\");\n return false;\n }\n\n // if player clicks square when not his turn\n if (board.sideToMove === -1) {\n alert(\"Not your turn!\");\n return false;\n }\n\n /*\n * move corresponding to square based on id location\n * e.g., parses id string \"10\" into ints 1, 0\n */\n var loc = new Location(parseInt(square.id.substring(0, 1), 10),\n parseInt(square.id.substring(1, 2), 10));\n var move = new Move(loc);\n\n // if desired move is not legal\n if (!board.isLegal(move)) {\n alert(\"Illegal move!\");\n return false;\n }\n\n // play the move and render result\n board.doMove(move);\n renderMove(move, -board.sideToMove);\n\n // move successful!\n return true;\n}", "title": "" }, { "docid": "6e2c00b3f8c6d00efb8dd96771411f33", "score": "0.5182616", "text": "play() {\n const boardCopy = this.board.copy();\n // Update the Display.\n if(this.display) {\n this.display.draw(this.board);\n }\n\n // Ask the player to make a move.\n if(this.board.player === RED) {\n this.status.innerText = \"Player 1 to move\";\n this.player1.getMove(boardCopy, move => this.doMove(move));\n } else {\n this.status.innerText = \"Player 2 to move\";\n this.player2.getMove(boardCopy, move => this.doMove(move));\n }\n }", "title": "" }, { "docid": "9f95bbff93f87cc4c21b70ffdc5a86b0", "score": "0.5160416", "text": "function getPossibleMatches(plays)\n{\n //an object that represents all the possible win outcomes by box index\n let matches =\n {\n horizontal: '012/345/678/', vertical: '036/147/258/', diagonal: '048/246/'\n };\n\n //replaces 'matches' indexes with the respective value from 'plays'\n matches = plays.reduce((matches, play, index) =>\n {\n matches.horizontal = matches.horizontal.replace(`${index}`, play);\n matches.vertical = matches.vertical.replace(`${index}`, play);\n matches.diagonal = matches.diagonal.replace(`${index}`, play);\n matches.diagonal = matches.diagonal.replace(`${index}`, play);\n\n return matches;\n\n }, matches);\n\n return matches;\n}", "title": "" }, { "docid": "926860b070f5db09e2db424e6a3ecaab", "score": "0.51603717", "text": "function makeWinningMove(board){\n var boardString = mapSymbolToPatterns(board);\n for(var i = 0;i < winningMovePatterns.length;i++){\n if (boardString.match(winningMovePatterns[i][0])){\n console.log('make winning move');\n return winningMovePatterns[i][1];\n };\n }\n return -1;\n }", "title": "" }, { "docid": "e5dcd2a1219205734d48dcef1ab4c534", "score": "0.51585287", "text": "function checkForWin(plays)\n{\n let matches = getPossibleMatches(plays);\n\n //scans the object for any instances of 'xxx/' or 'ooo/' which indicates a\n //win\n const winner = Object.values(matches).reduce((result, direction) =>\n {\n if(result !== '_')\n {\n return result;\n }\n if(direction.includes('xxx/'))\n {\n return 'x';\n }\n if(direction.includes('ooo/'))\n {\n return 'o';\n }\n return '_';\n }, '_');\n\n //checks for a tie\n if(plays.indexOf('_') === -1 && winner === '_')\n {\n return 't';\n }\n\n return winner;\n}", "title": "" }, { "docid": "ee3639c9d0ddbc6b27f4283b1cb4c727", "score": "0.5154749", "text": "function playRound(playerSelection, computerSelection) {\n\n //predetermined results of game played and what beats what\n const objOfMatchResults = {\n //played values - Winning value\n 'Rock Scissor' : 'Rock',\n 'Scissor Rock' : 'Rock',\n 'Paper Rock' : 'Paper',\n 'Rock Paper' : 'Paper',\n 'Scissor Paper': 'Scissor',\n 'Paper Scissor': 'Scissor'\n };\n\n if(playerSelection === computerSelection) {\n \n return {\n message :`It's a Draw! You both drew ${computerSelection}.`, \n result : 'draw'\n };\n }else if(objOfMatchResults[playerSelection + \" \" + computerSelection] === playerSelection) {\n \n return {\n message :`You Won! ${playerSelection} beats ${computerSelection}.`,\n result : 'won'\n };\n }else if(objOfMatchResults[playerSelection + \" \" + computerSelection] === computerSelection) {\n \n return {\n message : `You Lose! ${computerSelection} beats ${playerSelection}.`,\n result : 'lose'\n };\n }\n}", "title": "" }, { "docid": "047a5bfc44f8fd02029b55c11791f835", "score": "0.51361334", "text": "function Player(color,board){\n this.color=color;\n this.lastMoveRow=0;\n this.columnLabel=null;\n this.makeAMove=function(column){\n //max sure the board does not go past 6 rows high; let the player know if they cannot play a piece in that column\n\n //semantics with naming of columns\n this.lastMoveColumn=column;\n if(gameBoard.columns[column].length<6){\n //if a valid move push color to the array representing the board\n gameBoard.columns[column].push(color);\n this.lastMoveRow=gameBoard.columns[column].length-1;\n this.columnLabel=parseInt(column);\n gameBoard.setLastMove([gameBoard.columns[column].length-1,parseInt(column)]);\n this.renderPiece();//ln 522 438\n gameBoard.moves++;\n //once 7 moves have been played there is a possibility for a winner;check for it\n } else {\n //cannot play anymore pieces to this column; invalid move\n alert('please choose another move; there is no more room in that column! :D');\n }\n // console.log('after player1 move the board state is:',board);\n };//end of playMove\n\n this.renderPiece=function(){\n //reintialize all matching varialbes to null\n gameBoard.matchDown=0;\n gameBoard.matchLeft=0;\n gameBoard.matchRight=0;\n gameBoard.matchDiagUpLeft=0;\n gameBoard.matchDiagUpRigh=0;\n gameBoard.matchDiagDownLeft=0;\n gameBoard.matchDiagDownRight=0;\n\n\n var col=this.columnLabel;\n var row=this.lastMoveRow.toString();\n gameBoard.lastMove=[col,parseInt(row)];\n //colors a particular square color depend which played played the move. color is an argument in the constructor function 463 464\n $('#row'+row+'> div.space.col-'+col).css('background-color',color);\n if(board.moves>5){\n board.checkForWinner();\n }\n };//end of renderPiece function\n\n}", "title": "" }, { "docid": "424a891ff770e46234769bac10c2ad6a", "score": "0.5109879", "text": "function testMove(id,size) {\n let moves = []; // we'll return this if it's got anything in it\n const matched = twoSquareMatch(id,size); // gets any two-square matches relating to this square\n const nextSquares = getNextSquares(id);\n // note: we're only running anything with this function after all matches have been cleared, so we'll never have three-way matches\n // we should probably double-check there's no three-way matches just for code hygiene/resuability or something, but that's FOR LATER\n if (matched) { // if our passed-in square has any two-way matches\n const matchedKeys = Object.keys(matched); // keys of our matched object\n for (let i = 0; i < matchedKeys.length; i++) {\n let thisMatchedKey = matchedKeys[i];\n let thisMatchedOpp = opposite(thisMatchedKey);\n let thisNextSquare = nextSquares[thisMatchedOpp]; // this is the unmatching square in the same direction as the match\n if (thisNextSquare) {\n let thisNextNext = getNextSquares(thisNextSquare); // the squares next door to this unmatching square\n let thisNextNextKeys = Object.keys(thisNextNext);\n for (let j = 0; j < thisNextNextKeys.length; j++) { // now we iterate over the squares next to this matched square to look for matches\n let thisMoveKey = thisNextNextKeys[j];\n if (thisMoveKey != thisMatchedKey) { // we're not matching in the same direction as our match\n if (isMatch([id,thisNextNext[thisMoveKey]])) { // if the two squares we're checking match\n let thisMove = numericSort([thisNextSquare,thisNextNext[thisMoveKey]]);\n if (moves.length > 0) {\n moves = noDupeNest(moves,thisMove);\n } else {\n moves.push(thisMove);\n }\n }\n }\n }\n }\n }\n } else {\n const nextNextSquares = nextAdjacentSquares(id,size);\n const nextNextKeys = Object.keys(nextNextSquares);\n for (let k = 0; k < nextNextKeys.length; k++) {\n let thisDirection = nextNextKeys[k];\n let thisOpposite = opposite(thisDirection);\n let thisSquare = nextNextSquares[thisDirection];\n if (isMatch([id,thisSquare])) {\n let middleSquare = nextSquares[thisDirection];\n let middleSquareNext = getNextSquares(middleSquare);\n let middleSquareNextKeys = Object.keys(middleSquareNext);\n for (let l = 0; l < middleSquareNextKeys.length; l++) {\n let thisMiddleDirection = middleSquareNextKeys[l];\n if (thisMiddleDirection != thisDirection && thisMiddleDirection != thisOpposite) {\n if (isMatch([id,middleSquareNext[thisMiddleDirection]])) {\n let thisMove = numericSort([middleSquare,middleSquareNext[thisMiddleDirection]]);\n if (moves.length > 0) {\n noDupeNest(moves,thisMove);\n } else {\n moves.push(thisMove);\n }\n }\n }\n }\n }\n }\n }\n if (moves.length > 0) {\n return moves;\n } else {\n return null;\n }\n}", "title": "" }, { "docid": "68b11aa05e47fedbef9ff235b7177c58", "score": "0.50946844", "text": "askPlayAIEasy(board, aiList, validMoves,number) {\n let rep = function(data) {\n\n this.scene.pieces = data[0];\n\n if (number == 1) {\n this.scene.listP1 = data[1];\n }\n else if(number == 2) {\n this.scene.listP2 = data[1];\n }\n\n console.log(\"MOVE: \" + [data[2], data[3]]);\n //X = data[2];\n\n //Y = data[3];\n\n\n this.gameSequence.addMove(new MyMove(data[2], data[3], data[4])); //ADICIONA A SEQUENCIA DO JOGO\n\n\n for (var s = 0; s < this.scene.piecesBoard.length; s++) {\n if(this.scene.piecesBoard[s].getCoordX() == data[2] && \n this.scene.piecesBoard[s].getCoordZ() == data[3])\n this.PiecesAnimations.push(new MyPiecesAnimations(this.scene.piecesBoard[s],[0,3,0],4));\n }\n\n //REMOVER O APONTADOR PARA O TILE DA PEÇA\n };\n\n var movesString = '[';\n\n for (var i = 0; i < validMoves.length; i++) {\n if (i == 0) {\n\n }\n else {movesString += ',';}\n\n movesString += ( '[' + validMoves[i] + ']');\n }\n\n movesString += ']';\n\n var aiListS = '[';\n\n for (var l = 0; l < aiList.length; l++) {\n if (l == 0) {\n\n }\n else {aiListS += ',';}\n\n aiListS += aiList[l];\n }\n\n aiListS += ']'\n\n let requestString = 'makePlayAIEasy([' +'[' + board[0] + ']' + ',' + '[' + board[1] + ']' + ',' + \n '[' + board[2] + ']' + ',' + '[' + board[3] + ']' + ',' + '[' + board[4] + ']' + ',' + '[' + board[5] + ']' + ',' + '[' + board[6] + ']' + ',' + \n '[' + board[7] + ']' + '],' + aiListS + ',' + movesString + ')';\n\n return this.prolog.getPrologRequest(requestString, rep.bind(this));\n\n\n }", "title": "" }, { "docid": "aa2480f1c647f757d976e77cf06fc971", "score": "0.50936675", "text": "function findComputerMove(move) {\r\n return createComputerMove(move, \r\n // at most 1 second for the AI to choose a move (but might be much quicker)\r\n { millisecondsLimit: 1000 });\r\n }", "title": "" }, { "docid": "d6f9235cfd8c31524494771c1c811f49", "score": "0.50845385", "text": "play(I) {\n\n // Only move if the game isn't over\n if (this.over) return false;\n\n // Clear previous game messages\n displayMessage(undefined);\n\n // Attempt to play piece\n let played = this.add(I, PLAYERS[this.toPlay]);\n\n if (played) {\n\n // Check for win\n let win = this.win(played);\n if (win) {\n displayMessage(`<strong>Player ${PLAYERS[this.toPlay]}</strong> Wins!`);\n this.over = true;\n // Highlight winning sequence\n win.forEach(cell => cell.highlight = true);\n }\n\n // Check for draw (no win and no more valid moves)\n else if (this.el_list.filter(cell => !cell.val).length == 0) {\n displayMessage('<strong>DRAW!</strong> Game Over!');\n this.over = true;\n }\n\n // Otherwise, next player's turn\n else {\n this.toPlay++;\n this.toPlay %= PLAYERS.length;\n setTurn(PLAYERS[this.toPlay]);\n }\n\n }\n else {\n // Noto a valid move (column is full)\n // displayMessage('You can\\'t play there...Try again!');\n }\n }", "title": "" }, { "docid": "b1a13becb69a2a4175ebf696f40fdbaf", "score": "0.50798255", "text": "function playMove(e) {\n\t// for (i = 0; i < allAreas.length; i++) {\n\tif (playCount % 2 == 0 && e.target.innerText == \"\") {\n\t\te.target.innerText = \"X\";\n\t\tplayCount++;\n\t\tcurrentPlayer.innerText = \"Player Two\";\n\t} else if (playCount % 2 != 0 && e.target.innerText == \"\") {\n\t\te.target.innerText = \"O\";\n\t\tplayCount++;\n\t\tcurrentPlayer.innerText = \"Player One\";\n\t}\n\twinCondition();\n\tshowWinner();\n}", "title": "" }, { "docid": "39826036c891ff18a8cfe86e2e3e3934", "score": "0.5079094", "text": "function drop(source, target, piece, orientation)\n{\n //Getting all HTML tags as DOM elements\n var moved = document.getElementById('move');\n var player = document.getElementById('player');\n\n //Creating the move object\n var move = \n {\n from: source,\n to: target,\n promotion: 'q'\n }\n\n //Check if the move is legal\n var legal = engine.move(move);\n\n //If our move is illegal\n if(legal === null)\n {\n moved.innerHTML = 'Illegal move';\n return 'snapback';\n }\n\n //If our move is legal\n else\n {\n\n //For 1 player\n if(noplayers === 1)\n {\n //If we play for white which is the pc\n if(legal.color === 'w')\n {\n moved.innerHTML = \"It is black's turn to play\";\n engine.undo();\n return 'snapback';\n }\n\n else\n {\n //Writing last move\n moved.innerHTML = 'From: ' + move.from + ', To: ' + move.to;\n player.innerHTML = \"White to play\";\n\n //Checking if in check\n if(engine.in_check())\n {\n player.innerHTML = 'In check';\n }\n\n setTimeout(play, 200);\n }\n\n }\n\n //For 2 players\n else if(noplayers === 2)\n {\n //If it's white's turn to play\n if(legal.color === 'w')\n {\n moved.innerHTML = 'From: ' + move.from + ', To: ' + move.to;\n player.innerHTML = \"Black to play\";\n\n //Checking if in checkmate\n if(engine.in_checkmate())\n {\n player.innerHTML = 'Checkmate';\n }\n\n //Checking if in stalemate\n else if(engine.in_draw())\n {\n player.innerHTML = 'Draw Game';\n }\n\n //Checks if in 3 fold repetetion\n else if(engine.in_threefold_repetition())\n {\n player.innerHTML = 'In 3 fold repetition';\n }\n\n //Checking if in check\n else if(engine.in_check())\n {\n player.innerHTML = 'Check!';\n }\n }\n\n //If it's black's turn to play\n else\n {\n moved.innerHTML = 'From: ' + move.from + ', To: ' + move.to;\n player.innerHTML = \"White to play\";\n\n \n //Checking if in checkmate\n if(engine.in_checkmate())\n {\n player.innerHTML = 'Checkmate!';\n }\n\n //Checking if in stalemate\n else if(engine.in_draw())\n {\n player.innerHTML = 'Draw Game';\n }\n\n //Checks if in 3 fold repetetion\n else if(engine.in_threefold_repetition())\n {\n player.innerHTML = 'In 3 fold repetition';\n }\n\n //Checking if in check\n else if(engine.in_check())\n {\n player.innerHTML = 'In check';\n }\n }\n }\n }\n}", "title": "" }, { "docid": "bedc68bea48789a8c58aa9b6ac3b5b2f", "score": "0.50771445", "text": "function soldiersMove(fromSquare, toSquare, type) {\n if (areAdjacent(fromSquare, toSquare)) {\n if (type == \"all\") {\n var numberOfSoldiersToMove = numberOfActiveSoldiers(fromSquare);\n } else if (type == \"half\") {\n var numberOfSoldiersToMove = Math.floor(numberOfActiveSoldiers(fromSquare) / 2);\n } else if (type == \"single\") {\n if (fromSquare.contents.length > 0) {\n var numberOfSoldiersToMove = 1;\n } else {\n var numberOfSoldiersToMove = 0;\n }\n }\n moveSoldiers(numberOfSoldiersToMove, fromSquare, toSquare)\n }\n}", "title": "" }, { "docid": "68a4f0e5fa07ff77e2fea4a29d9a887b", "score": "0.5062421", "text": "function move() { \n\t\n\t\n\t\n\t//Increment the click counter\n\tclicks++;\n\t\n\t//If the board is solved, go to the end state\n\tif (isSolved())\n\t\tend();\n}", "title": "" }, { "docid": "d2c10df46965932ba7ccbda50eebecda", "score": "0.5058333", "text": "doSimpleMove(r0, c0, r, c) {\n\t//alert(\"Executing move = (\" + r0 + \", \" + c0 + \") - (\" + r + \", \" + c + \")\");\n\t//\n\t// Quick'nd dirty approach = stuff piece from origin square into\n // destination square and clear origin square\n\t//\n\tvar s0 = this.rc2i(r0, c0);\n\tvar s1 = this.rc2i(r, c);\n\tif(s0 != s1) {\n\t //\n\t // Only do something when a piece was moved from one square to\n // another = do nothing if source and destination squares are the same.\n\t //\n\t var mv;\n\t if((mv = this.board.isValidMove(s0, s1)) != null) {\n\t\tif(mv.promotedTo != C.EMPTY) {\n\t\t //\n\t\t // Pawn promotion move\n\t\t //\n\t\t if(this.promotion_piece == C.EMPTY) {\n\t\t\t//\n\t\t\t// No promotion piece selected yet\n\t\t\t//\n\t\t\tthis.move_r0 = r0;\n\t\t\tthis.move_r = r;\n\t\t\tthis.move_c = c;\n\t\t\tthis.move_c0 = c0;\n\t\t\tshow_promotions();\n\t\t\treturn;\n\t\t }\n\t\t //\n\t\t // Selected a promotion piece: stuff in move object (note that\n // the list of generated valid moves does not store the color info\n // of the promoted piece)\n\t\t //\n\t\t mv = this.board.findValidMove(s0, s1, this.promotion_piece);\n\t\t //\n\t\t // Force correct color for promoted piece\n\t\t //\n\t\t var pce = mv.getPromotedTo();\n\t\t if(this.plys.length % 2) {\n\t\t\tpce = (pce & C.PIECEMASK) | C.BLACK;\n\t\t } else {\n\t\t\tpce = (pce & C.PIECEMASK) | C.WHITE;\n\t\t }\n\t\t mv.setPromotedTo(pce);\n\t\t}\n\t\tthis.doMove(mv);\t// Do move on internal board representation\n\t }\n\t}\n }", "title": "" }, { "docid": "70449b0b38f0c665fbe245102fe6f20d", "score": "0.5037138", "text": "function findSimplyComputerMove(move) {\r\n var possibleMove = null;\r\n // find a better move\r\n for (var i = 1; i < gameLogic.ROWS - 1; i++) {\r\n for (var j = 1; j < gameLogic.COLS - 1; j++) {\r\n var moves = new Array();\r\n try {\r\n moves.push({ row: i - 1, col: j });\r\n moves.push({ row: i, col: j + 1 });\r\n moves.push({ row: i + 1, col: j });\r\n moves.push({ row: i, col: j - 1 });\r\n moves.push({ row: i - 1, col: j });\r\n possibleMove = gameLogic.createMove(move.stateAfterMove, moves, move.turnIndexAfterMove);\r\n return possibleMove;\r\n }\r\n catch (e) {\r\n }\r\n }\r\n }\r\n for (var i = 0; i < gameLogic.ROWS; i++) {\r\n for (var j = 1; j < gameLogic.COLS; j++) {\r\n for (var k = 0; k <= 3; k++) {\r\n try {\r\n var moves = new Array();\r\n moves.push({ row: i, col: j - 1 });\r\n moves.push({ row: i, col: j });\r\n switch (k) {\r\n case 0:\r\n moves.push({ row: i - 1, col: j - 1 });\r\n break;\r\n case 1:\r\n moves.push({ row: i - 1, col: j });\r\n break;\r\n case 2:\r\n moves.push({ row: i + 1, col: j });\r\n break;\r\n case 3:\r\n moves.push({ row: i + 1, col: j - 1 });\r\n break;\r\n }\r\n moves.push({ row: i, col: j - 1 });\r\n possibleMove = gameLogic.createMove(move.stateAfterMove, moves, move.turnIndexAfterMove);\r\n return possibleMove;\r\n }\r\n catch (e) {\r\n }\r\n }\r\n }\r\n }\r\n return possibleMove;\r\n }", "title": "" }, { "docid": "ea1dd43e4944bf99e6252a3d1ec1d40c", "score": "0.50298274", "text": "function playRound(playerSelection, computerSelection) {\n playerSelection = playerSelection.toLowerCase();\n \n if (playerSelection === 'bear') {\n return (computerSelection === 'hunter') ? 'L'\n : (computerSelection === 'ninja') ? 'W'\n : 'D'; \n }\n\n if (playerSelection === 'hunter') {\n return (computerSelection === 'ninja') ? 'L'\n : (computerSelection === 'bear') ? 'W'\n : 'D'; \n }\n\n if (playerSelection === 'ninja') {\n return (computerSelection === 'bear') ? 'L'\n : (computerSelection === 'hunter') ? 'W'\n : 'D'; \n }\n}", "title": "" }, { "docid": "f6ef7c17c8a3fd8c86b89a3238bd56dc", "score": "0.5016892", "text": "function playRound(playerSelection, computerSelection) {\n // output the message \"You lose/ You win! X beats Y\" depending on the move comparison\n let result;\n round++;\n roundNumber.innerHTML = `Round ${round}`;\n\n // Compares the two variables\n // it's a tie\n if (playerSelection === computerSelection) {\n results.innerHTML = \"It's a draw, try again.\";\n result = 'tie';\n }\n\n // rock beats scissors but loses to paper\n else if (playerSelection === moves[0]) {\n if (computerSelection === moves[2]) {\n playerScore += 1;\n results.innerHTML = 'You win this round!';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'win';\n } else if (computerSelection === moves[1]) {\n computerScore += 1;\n results.innerHTML = 'You lose this round.';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'lose';\n }\n }\n\n // paper beats rock, but loses to scissors\n else if (playerSelection === moves[1]) {\n if (computerSelection === moves[0]) {\n playerScore += 1;\n results.innerHTML = 'You win this round!';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'win';\n } else if (computerSelection === moves[2]) {\n computerScore += 1;\n results.innerHTML = 'You lose this round.';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'lose';\n }\n }\n\n // scissors beats paper, but loses to rock\n else if (playerSelection === moves[2]) {\n if (computerSelection === moves[1]) {\n playerScore += 1;\n results.innerHTML = 'You win this round!';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'win';\n } else if (computerSelection === moves[0]) {\n computerScore += 1;\n results.innerHTML = 'You lose this round.';\n roundTotal.innerHTML = `${playerScore} - ${computerScore}`;\n result = 'lose';\n }\n }\n isMatchOver();\n return result;\n}", "title": "" }, { "docid": "5d4ea0661ef8a7c38caa0211c5990244", "score": "0.500741", "text": "getBasicMove([sx, sy], [ex, ey], tr) {\n const initColor = this.getColor(sx, sy);\n const initPiece = this.board[sx][sy].charAt(1);\n let mv = new Move({\n appear: [\n new PiPo({\n x: ex,\n y: ey,\n c: tr ? tr.c : initColor,\n p: tr ? tr.p : initPiece\n })\n ],\n vanish: [\n new PiPo({\n x: sx,\n y: sy,\n c: initColor,\n p: initPiece\n })\n ]\n });\n\n // Fix \"ball holding\" indication in case of promotions:\n if (!!tr && Object.keys(V.HAS_BALL_DECODE).includes(initPiece))\n mv.appear[0].p = V.HAS_BALL_CODE[tr.p];\n\n // The opponent piece disappears if we take it\n if (this.board[ex][ey] != V.EMPTY) {\n mv.vanish.push(\n new PiPo({\n x: ex,\n y: ey,\n c: this.getColor(ex, ey),\n p: this.board[ex][ey].charAt(1)\n })\n );\n }\n\n // Post-processing: maybe the ball was taken, or a piece + ball,\n // or maybe a pass (ball <--> piece)\n if (mv.vanish.length == 2) {\n if (\n // Take the ball?\n mv.vanish[1].c == 'a' ||\n // Capture a ball-holding piece? If friendly one, then adjust\n Object.keys(V.HAS_BALL_DECODE).includes(mv.vanish[1].p)\n ) {\n mv.appear[0].p = V.HAS_BALL_CODE[mv.appear[0].p];\n if (mv.vanish[1].c == mv.vanish[0].c) {\n // \"Capturing\" self => pass\n mv.appear[0].x = mv.start.x;\n mv.appear[0].y = mv.start.y;\n mv.appear.push(\n new PiPo({\n x: mv.end.x,\n y: mv.end.y,\n p: V.HAS_BALL_DECODE[mv.vanish[1].p],\n c: mv.vanish[0].c\n })\n );\n }\n }\n else if (mv.vanish[1].c == mv.vanish[0].c) {\n // Pass the ball: the passing unit does not disappear\n mv.appear.push(JSON.parse(JSON.stringify(mv.vanish[0])));\n mv.appear[0].p = V.HAS_BALL_CODE[mv.vanish[1].p];\n mv.appear[1].p = V.HAS_BALL_DECODE[mv.appear[1].p];\n }\n // Else: standard capture\n }\n\n return mv;\n }", "title": "" }, { "docid": "f5d6407213cff7ad1727804d5b8dfbc2", "score": "0.50068104", "text": "function get_disambiguator(move, sloppy) {\nvar moves = generate_moves({legal: !sloppy});\n\nvar from = move.from;\nvar to = move.to;\nvar piece = move.piece;\n\nvar ambiguities = 0;\nvar same_rank = 0;\nvar same_file = 0;\n\nfor (var i = 0, len = moves.length; i < len; i++) {\nvar ambig_from = moves[i].from;\nvar ambig_to = moves[i].to;\nvar ambig_piece = moves[i].piece;\n\n/* if a move of the same piece type ends on the same to square, we'll\n * need to add a disambiguator to the algebraic notation\n */\nif (piece === ambig_piece && from !== ambig_from && to === ambig_to) {\n ambiguities++;\n\n if (rank(from) === rank(ambig_from)) {\n same_rank++;\n }\n\n if (file(from) === file(ambig_from)) {\n same_file++;\n }\n}\n}\n\nif (ambiguities > 0) {\n/* if there exists a similar moving piece on the same rank and file as\n * the move in question, use the square as the disambiguator\n */\nif (same_rank > 0 && same_file > 0) {\n return algebraic(from);\n}\n/* if the moving piece rests on the same file, use the rank symbol as the\n * disambiguator\n */\nelse if (same_file > 0) {\n return algebraic(from).charAt(1);\n}\n/* else use the file symbol */\nelse {\n return algebraic(from).charAt(0);\n}\n}\n\nreturn '';\n}", "title": "" }, { "docid": "df8276ce1609894719afcb0ae9fb4214", "score": "0.5001458", "text": "chooseMoveRequest() {\n let gameState = this.gameboard.toString()\n this.prolog.chooseMove(gameState, this.currentPlayer, this.getPlayerDifficulty())\n }", "title": "" }, { "docid": "ef486dad5e38b4ae31ae1aae172ed4d3", "score": "0.5000368", "text": "function randomMove() {\n\t\tvar availTiles = emptyTiles(board);\n\t\trandom = Math.floor( Math.random() * availTiles.length );\n\t\tmove = availTiles[random];\n\t\tcomputerPlays(move);\n \t}", "title": "" }, { "docid": "e1845ec169a0c170a9f87840dde9ddfc", "score": "0.4997157", "text": "function getComputerMove(move) {\n return move || randomPlay();\n}", "title": "" }, { "docid": "757fcb687639d6a08260cbd98f2149ef", "score": "0.49925974", "text": "function minimax(newBoard, player) {\n\n var availableSpots = emptyIndexes(newBoard);\n\n if (winning(newBoard, humanPlayer)) {\n // Min wins (human)\n return { score: -10 };\n } else if (winning(newBoard, aiPlayer)) {\n // Max wins (AI)\n return { score: 10 };\n } else if (availableSpots.length === 0) {\n // No more room to play, tie\n return { score: 0 }\n }\n // an array to collect all the objects\n var moves = [];\n\n // loop through available spots\n for (var i = 0; i < availableSpots.length; i++) {\n //create an object for each and store the index of that spot \n var move = {};\n move.index = newBoard[availableSpots[i]];\n\n // set the empty spot to the current player\n newBoard[availableSpots[i]] = player;\n\n /*collect the score resulted from calling minimax \n on the opponent of the current player*/\n if (player == aiPlayer) {\n var result = minimax(newBoard, humanPlayer);\n move.score = result.score;\n }\n else {\n var result = minimax(newBoard, aiPlayer);\n move.score = result.score;\n }\n\n // reset the spot to empty\n newBoard[availableSpots[i]] = move.index;\n\n // push the object to the array\n moves.push(move);\n }\n // if it is the computer's turn loop over the moves and choose the move with the highest score\n var bestMove;\n if (player === aiPlayer) {\n var bestScore = -10000;\n for (var i = 0; i < moves.length; i++) {\n if (moves[i].score > bestScore) {\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n } else {\n\n // else loop over the moves and choose the move with the lowest score\n var bestScore = 10000;\n for (var i = 0; i < moves.length; i++) {\n if (moves[i].score < bestScore) {\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n\n // return the chosen move (object) from the moves array\n return moves[bestMove];\n}", "title": "" }, { "docid": "671998998b7cde10a177d973500e15e5", "score": "0.49756652", "text": "function playRound(playerSelection, compSelection) {\n //three possible solutions [Win, Lose, Tie]\n // 0 = win; lose = 1; 2 = tie;\n\n //player selection == Rock\n if (playerSelection == \"ROCK\" && compSelection == \"ROCK\") {\n description.textContent = 'Tie! Rock and Rock.';\n return 2;\n }\n else if (playerSelection == \"ROCK\" && compSelection == \"PAPER\") {\n description.textContent = 'You Lose! Paper beats Rock.';\n return 1;\n }\n else if (playerSelection == \"ROCK\" && compSelection == \"SCISSORS\") {\n description.textContent = 'You Win! Rock beats Scissors.';\n return 0;\n }\n\n //player selection == Paper\n else if (playerSelection == \"PAPER\" && compSelection == \"ROCK\") {\n description.textContent = 'You Win! Paper beats Rock.';\n return 0;\n }\n else if (playerSelection == \"PAPER\" && compSelection == \"PAPER\") {\n description.textContent = 'Tie! Paper & Paper.';\n return 2;\n }\n else if (playerSelection == \"PAPER\" && compSelection == \"SCISSORS\") {\n description.textContent = 'You Lose! Scissors beats Paper.';\n return 1;\n }\n\n //player selection == Scissors\n else if (playerSelection == \"SCISSORS\" && compSelection == \"ROCK\") {\n description.textContent = 'You Lose! Rock beats Scissors.';\n return 1;\n }\n else if (playerSelection == \"SCISSORS\" && compSelection == \"PAPER\") {\n description.textContent = 'You Win! Scissors beats Paper.';\n return 0;\n }\n else if (playerSelection == \"SCISSORS\" && compSelection == \"SCISSORS\") {\n description.textContent = 'Tie! Scissors and Scissors';\n return 2;\n }\n}", "title": "" }, { "docid": "2a6e22e62b38ac451ac6ca4f7fd0506f", "score": "0.49658975", "text": "function computer_move(state) {\n // sends the state to the alphabeta() function to look 4 moves ahead and\n // determine the best move to make\n var moves = alphabeta(state, 4, 'red', Number.MIN_VALUE, Number.MAX_VALUE);\n var max_score = undefined;\n var move = undefined;\n // loops over all of the moves, identifying the move with the highest score,\n // which would be the best to play\n for (var idx = 0; idx < moves.length; idx++) {\n if (max_score === undefined || moves[idx].score > max_score) {\n max_score = moves[idx].score;\n move = {\n x: moves[idx].x,\n y: moves[idx].y\n };\n }\n }\n return move;\n }", "title": "" }, { "docid": "6b9d5f789ff40ab5baaba3d8ff7c6e92", "score": "0.49530217", "text": "nextMove() {\n if (this.state === WarGame.READY) {\n this.stateReady();\n } else if (this.state === WarGame.CARDS_ON_TABLE) {\n this.stateCardsOnTable();\n } else if (this.state === WarGame.FINISHED) {\n this.startGame();\n }\n this.inform();\n }", "title": "" }, { "docid": "50cf69a14db95a1ca515e999f237e9df", "score": "0.49487436", "text": "function whoPlays() {\n if (lastMove === \"circle\") {\n document.getElementById(\"whoPlays\").innerText = \"Au tour des croix...\";\n } else {\n document.getElementById(\"whoPlays\").innerText = \"Au tour des ronds...\";\n }\n}", "title": "" }, { "docid": "3b2456c8d734485504170d03e4470607", "score": "0.49437124", "text": "function playRound(playerSelection, computerSelection) {\n // First clear previous selections (refresh what's shown on screen):\n playerSelectionText.textContent = '';\n computerSelectionText.textContent = '';\n computerImage.setAttribute('src', 'question-mark.png');\n roundResult.textContent = '';\n\n // Get new selections\n let player=playerSelection; // no longer passing in a function with the GUI, only a string\n \n // I like how it looks with a a slight delay here to indicate a new round (in case the same selection is picked twice especially)\n setTimeout(function() {\n playerSelectionText.textContent = player;\n }, delayPlayer); // just lets the selection stay blank for a while\n\n // Run computer selection function, which has its own delay\n let computer=computerSelection();\n \n // Decide who wins the round and return it. But add the delay so the results don't come first\n switch(true) {\n // cases where player wins\n case (player=='ROCK' && computer=='Scissors'):\n case (player=='SCISSORS' && computer=='Paper'):\n case (player=='PAPER' && computer=='Rock'):\n return ('Player Wins!');\n //cases where computer wins\n case (computer=='Rock' && player=='SCISSORS'):\n case (computer=='Scissors' && player=='PAPER'):\n case (computer=='Paper' && player=='ROCK'):\n return ('Computer Wins!');\n // Ties\n case (player=='ROCK' && computer=='Rock'):\n case (player=='SCISSORS' && computer =='Scissors'):\n case (player=='PAPER' && computer=='Paper'):\n return(\"It's a tie!\");\n // player cancels play\n case (player==undefined):\n return ('Round cancelled');\n // default value for when the player types something weird (only applied to non-DOM version of game)\n default:\n // alert(\"The only acceptable plays are rock, paper, or scissors (case-insentive). Please type one of those options or esc to quit.\");\n // return ('No winner; player did not play an acceptable move');\n }\n}", "title": "" }, { "docid": "c30474beb126fc6ce9d20678d688fd63", "score": "0.49325022", "text": "function AIPlayer(){\n\n\t/**\n\t* Basic makeMove that is called from the outside. Standard for Player subclasses.\n\t*\n\t* @method makeMove\n\t* @param {GameBoard} board The current board state.\n\t* @param {PlayerTurnManager} playerTurnManager Needed so the AI can maintain proper order of player movement.\n\t* @return {{move: m, win: w}} A tuple that represents the move we make and the win state we expect.\n\t*/\n\tthis.makeMove = function(board, playerTurnManager){\n\n\t\t//Decide if we are going to make a mistake. If we are going to make one.\n\t\tif(Math.random() < this.difficulty.value){\n\t\t\treturn this.makeMistake(board);\n\t\t}\n\t\t//Else return an intelligent pick.\n\t\treturn this.computerPick(board.copyBoard(), playerTurnManager.copyPTM(), board.emptyCount());\n\t};\n\n\t/**\n\t* Called when the computer decides to make a mistake.\n\t*\n\t* @method makeMistake\n\t* @param {GameBoard} board The board state so we don't try to make a move on a invalid space.\n\t* @return {{move: m, win: w}} A tuple that represents the move we make and the win state we expect.\n\t*/\n\tthis.makeMistake = function(board){\n\t\tvar m = Math.floor(Math.random() * board.getBoardSize());\n\t\n\t\t//While the space we have chosen is taken choose a different one.\n\t\twhile(board.isTaken(m)){\n\t\t\tm = Math.floor(Math.random() * board.getBoardSize());\n\t\t}\n\t\treturn {move: m, win: board.getNeutralValue()};\n\t}\n\n\t/**\n\t* Recursive function that actually decides wher to move.\n\t*\n\t* @method computerPick\n\t* @param {GameBoard} board The current copy of the board we are using.\n\t* @param {PlayerTurnManager} playerTurnManager So we can keep proper order when making moves.\n\t* @param {int} depth Used as one stop case for recursion when it is 0.\n\t*/\n\tthis.computerPick = function(board, playerTurnManager, depth){\n\n\t\t//Check for a winner. If there is one do nothing.\n\t\tvar w = board.checkWin();\n\n\t\tif(w != board.getNeutralValue() || depth < 1){\n\t\t\treturn {move: null, win: w};\n\t\t}\n\n\t\t//Object to calog wins.\n\t\t//TODO: Change to accommodate more than two players.\n\t\tvar wins = {'-1': [], '0': [], '1': []};\n\n\t\t//For each cell test to see if we can move there.\n\t\tfor(var i = 0; i < board.getBoardSize(); i++){\n\n\t\t\tif(!board.isTaken(i)){\n\t\t\t\t//If we can move there make a copy of the board and PTM and do so.\n\t\t\t\tvar copy = board.copyBoard();\n\t\t\t\tvar ptmCopy = playerTurnManager.copyPTM();\n\t\t\t\tcopy.makeMove(ptmCopy.getCurrentPlayer(), i);\n\t\t\t\tptmCopy.nextPlayer();\n\t\t\t\t\n\t\t\t\t//Make recursive call. Switch player. Reduce depth.\n\t\t\t\tvar t = this.computerPick(copy, ptmCopy, depth - 1);\n\t\t\t\t\n\t\t\t\t//Catalog the list of wins.\n\t\t\t\twins[t.win].push({move: i, win: t.win});\n\t\t\t}\n\t\t}\n\n\t\t//Assemble a list of preferences. This player > tie > all other players.\n\t\tvar ptm = playerTurnManager.copyPTM();\n\t\tvar preference = [];\n\t\tvar currPlayer = ptm.getCurrentPlayer();\n\t\tvar count = 0;\n\n\t\tdo{\n\t\t\t//Insert a tie at the first iteration.\n\t\t\tif(count == 1){\n\t\t\t\tpreference.push(board.neutralValue);\n\t\t\t}\n\n\t\t\t//Append next player.\n\t\t\tpreference.push(currPlayer.getPlayerValue());\n\n\t\t\tcurrPlayer = ptm.nextPlayer();\n\t\t\tcount++;\n\t\t}while(currPlayer.toString() != this.toString());\n\t\t\n\t\t//Pick our preference. If there is none pick a random.\n\t\tfor(var i = 0; i < preference.length; i++){\n\t\t\tif(wins[preference[i]].length){\n\t\t\t\treturn this.pickRandom(wins[preference[i]]);\n\t\t\t}\n\t\t}\n\n\t\t//If there is no valid move return nothing.\n\t\treturn {move: null, win: board.neutralValue};\n\t};\n\n\t/**\n\t* Picks a random move from a list of preferences.\n\t*\n\t* @method pickRandom\n\t* @param {int[]} a A list of acceptable moves.\n\t* @return {int} The chosen space to move.\n\t*/\n\tthis.pickRandom = function(a){\n\t\treturn a[Math.floor(Math.random() * a.length)];\n\t};\n}", "title": "" }, { "docid": "b1248d6a89ed491971f347eec4187202", "score": "0.49318027", "text": "function computerMove() {\n var board;\n var theMove;\n var bestMove;\n\n if (document.victor != \" \"){//checks if we already have a winner\n return;\n }\n board = getBoard(999, \"O\");\n theMove = miniMax(board);\n bestMove = getBestMove(document.moveOptions, theMove.rank); //selects the best move from the available options\n\tif (bestMove === 0) {//checks if there are any further empty squares\n setMessage(\"The game ended in a draw!\");\n }\n else {\n move(bestMove);\n switchTurn();\n }\n}", "title": "" }, { "docid": "5ea497c04f95bc96e7f6adb89e5f1faf", "score": "0.49290395", "text": "function minimax(squares, player, depth) {\n\n// available spots\n const availSpots = emptyIndexies(squares);\n\n //\n const result = calcScores(squares, availSpots, depth);\n\n if (result) {\n return result; // terminate\n }\n\n const scores = [];\n // loop through available spots\n // fill moves and scores\n const moves = availSpots.map((val, idx) => {\n\n const nextPlayer = (player === human) ? computer : human;\n \n //move to test with current player\n squares[val] = player; // e.g. set \"X\" at the idx place\n //recursive with depth+1\n \n const score = minimax(squares, nextPlayer, depth + 1);\n scores.push(score);\n //reverse move\n squares[val] = null;\t\t\t\n return val; // moves.push move\n });\n \n let scoreIndex = 0;\n if (player === playerToHelp) {\n // playerToHelp has to maximize its points: max calc\n scoreIndex = scores.reduce(\n (iMax, x, i, arr) => x > arr[iMax] ? i : iMax, 0);\n } else {\n // opponents wants to minimize playerToHelp points: min calc\n scoreIndex = scores.reduce(\n (iMin, x, i, arr) => x < arr[iMin] ? i : iMin, 0);\t\t\t\n }\n \n if (depth === 0) {\n return moves[scoreIndex]; // best move\n }\n return scores[scoreIndex];\n}", "title": "" }, { "docid": "efceecb08b736b47f8fa21729d61d7ef", "score": "0.49197122", "text": "function makeMove(board, player, start, finish)\n{\n // make copy of the present board\n var boardTemp = copyBoard(board);\n // check that move is legal\n // moving checker piece from prev square to new square\n // set temp to original value at start position\n var temp = boardTemp[start[0]][start[1]];\n // set boardTemp at start position to empty space (0)\n boardTemp[start[0]][start[1]] = 0;\n // set boardTemp at finish position to new value\n boardTemp[finish[0]][finish[1]] = temp;\n \n // if its a capture, must set intervening square to 0\n // if a hop (more than one diagonal move)\n if (Math.abs(start[0]-finish[0]) != 1)\n {\n // set intervening cell to 0 since capture\n boardTemp[(start[0]+finish[0])/2][(start[1]+finish[1])/2] = 0;\n }\n \n // checking to see if move made a king for either team\n // temp is value of piece we started the move with (recall)\n // for player 1\n if (finish[0] == boardTemp.length - 1 && temp == 1)\n {\n // make king for player 1\n boardTemp[finish[0]][finish[1]] = 2;\n }\n // for other player\n else if (finish[0] == 0 && temp == 3)\n {\n // make king for other player\n boardTemp[finish[0]][finish[1]] = 4;\n }\n // and we're done\n \n // sets one second timeout\n setTimeout(function(){ }, 1000);\n \n return boardTemp;\n}", "title": "" }, { "docid": "daaf9d6147cbd37aad3dc6023480b6c3", "score": "0.49170515", "text": "make_move(move) {\n this.current_player = (this.current_player == WHITE ? BLACK : WHITE);\n this.moves_played += 1;\n\n // Make an array of the actual piece movements. May be more than one\n // movement when castling!\n let movements = [move];\n if (move.castle_move) {\n movements.push(move.castle_move);\n }\n for (let i=0; i<movements.length; i++) {\n let src = movements[i].src;\n let dest = movements[i].dest;\n let src_coords = Cell.coords_from_notation(src);\n let dest_coords = Cell.coords_from_notation(dest);\n let src_cell = this.cells[src_coords[0]][src_coords[1]];\n let dest_cell = this.cells[dest_coords[0]][dest_coords[1]];\n\n dest_cell.set_piece(src_cell.piece);\n src_cell.clear_piece();\n\n // Update table\n src_cell.update_element();\n dest_cell.update_element();\n }\n\n if (this.moves_played == this.opening.moves.length) {\n this.finished = true;\n var self = this;\n // Wait the CPU move time to display message\n setTimeout(function() {\n self.message_handler.message(\"You did it!\");\n }, CPU_MOVE_DELAY);\n }\n }", "title": "" }, { "docid": "65c90e1c9d284d9e93d974460d5d7097", "score": "0.49164164", "text": "function computePlayerOptions() {\n const state = store.getState();\n const pileCard = selectTopCardFromPile(state);\n if (pileCard.rank === '2') {\n const curDraw = getDraw(state);\n const newDraw = curDraw === 1 ? curDraw + 1 : curDraw + 2;\n store.dispatch([\n setComputerMove(`Computer played a '2'.`),\n setGuide(`Play a '2' or draw ${newDraw} cards.`),\n setDraw(newDraw),\n setExpected({ rank: ['2'], suit: null })\n ]);\n } else if (pileCard.rank === '8') {\n const computerHand = getComputerHand(state);\n const nextSuit = chooseNextSuit(computerHand);\n store.dispatch([\n setComputerMove(`Computer played an '8'. Computer selects ${nextSuit} as the next suit.`),\n setGuide(`Play an '8' or ${nextSuit}.`),\n setExpected({ rank: ['8'], suit: nextSuit })\n ]);\n } else if (pileCard.rank === 'queen') {\n const { rank, suit } = pileCard;\n store.dispatch([\n setLock(),\n setComputerMove(`Computer played a ${cardToString(pileCard)}.`),\n setGuide('Computer gets to play again.'),\n setExpected({ rank: ['8', rank], suit })\n ]);\n } else {\n const { rank, suit } = pileCard;\n store.dispatch([\n setComputerMove(`Computer played a ${cardToString(pileCard)}.`),\n setGuide(`Play a '${rank}', a ${suit}, or an '8'.`),\n setExpected({ rank: ['8', rank], suit })\n ]);\n }\n}", "title": "" }, { "docid": "259a1d1c8df68a120eeb4b813c36886a", "score": "0.49128038", "text": "function Model() {\n this.score = 0;\n this.matches = 0;\n this.fails = 0;\n \n //takes in a board state and the pieces acted upon by the player and sends the info to the evaluation portion\n this.receiveStateSendState = function(piece1, piece2, board) {\n this.evaluateMove(piece1, board);\n var finalBoard = this.evaluateMove(piece2, board);\n if (piece1.tile !== null && piece2.tile !== null) {\n this.fails += 1;\n model.display_stats();\n var p1tile = piece1.tile;\n var p2tile = piece2.tile;\n var first_id = piece1.id;\n var second_id = piece2.id;\n piece2.tile = p1tile;\n piece1.tile = p2tile;\n $(\"[id='\" + first_id + \"']\").attr(\"tile\", p2tile);\n $(\"[id='\" + second_id + \"']\").attr(\"tile\", p1tile);\n }\n return finalBoard;\n };\n \n //takes in a piece and the board, evaluates the move made and then returns the augmented board\n this.evaluateMove = function(piece, board) {\n \n \n var matchArrayXAxis = [];\n var matchArrayYAxis = [];\n matchArrayXAxis.push(piece);\n matchArrayYAxis.push(piece);\n //checks the position of the piece on the x coordinate plane and runs the check function that's appropriate\n switch (piece.x) {\n case 0:\n checkDown(piece);\n break;\n case 7:\n checkUp(piece);\n break;\n default:\n checkDown(piece);\n checkUp(piece);\n break;\n }\n //checks the position of the piece on the y coordinate plane and runs the check function that's appropriate\n switch (piece.y) {\n case 0:\n checkRight(piece);\n break;\n case 7:\n checkLeft(piece);\n break;\n default:\n checkRight(piece);\n checkLeft(piece);\n break;\n }\n //checks for matches below the initial piece\n function checkDown(piece) {\n if (\n board[piece.x + 1] !== undefined &&\n piece.tile === board[piece.x + 1][piece.y].tile\n ) {\n matchArrayXAxis.push(board[piece.x + 1][piece.y]);\n checkDown(board[piece.x + 1][piece.y]);\n }\n }\n \n //checks for matches above the initial piece\n function checkUp(piece) {\n if (\n board[piece.x - 1] !== undefined &&\n piece.tile === board[piece.x - 1][piece.y].tile\n ) {\n matchArrayXAxis.push(board[piece.x - 1][piece.y]);\n checkUp(board[piece.x - 1][piece.y]);\n }\n }\n \n //checks for matches to the right the initial piece\n function checkRight(piece) {\n if (\n board[piece.x][piece.y + 1] !== undefined &&\n piece.tile === board[piece.x][piece.y + 1].tile\n ) {\n matchArrayYAxis.push(board[piece.x][piece.y + 1]);\n checkRight(board[piece.x][piece.y + 1]);\n }\n }\n \n //checks for matches to the left the initial piece\n function checkLeft(piece) {\n if (\n board[piece.x][piece.y - 1] !== undefined &&\n piece.tile === board[piece.x][piece.y - 1].tile\n ) {\n matchArrayYAxis.push(board[piece.x][piece.y - 1]);\n checkLeft(board[piece.y - 1][piece.x]);\n }\n }\n //INCREMENT MATCH COUNTER\n if (matchArrayYAxis.length > 2 || matchArrayXAxis.length > 2) {\n model.matches += 1;\n }\n //checks to see if the recorded matches align with the required amount of matches and if so destroys the pieces by setting\n //their defining value to null\n if (matchArrayYAxis.length > 2) {\n for (var i = 0; i < matchArrayYAxis.length; i++) {\n model.score += 1;\n var match_id = matchArrayYAxis[i].id;\n board[matchArrayYAxis[i].x][matchArrayYAxis[i].y].tile = null;\n $(\"[id='\" + match_id + \"']\").attr(\"tile\", \"empty\");\n }\n }\n //checks to see if the recorded matches align with the required amount of matches and if so destroys the pieces by setting\n //their defining value to null\n if (matchArrayXAxis.length > 2) {\n for (var i = 0; i < matchArrayXAxis.length; i++) {\n model.score += 1;\n var match_id = matchArrayXAxis[i].id;\n board[matchArrayXAxis[i].x][matchArrayXAxis[i].y].tile = null;\n $(\"[id='\" + match_id + \"']\").attr(\"tile\", \"empty\");\n }\n }\n \n //returns augmented board\n return board;\n };\n \n this.display_stats = function() {\n if (model.score > localStorage.personalBest) {\n localStorage.personalBest = model.score;\n }\n $(\"#personal_best_value\").text(localStorage.personalBest);\n $(\"#score_value\").text(model.score);\n $(\"#stats_value\").text(model.matches + \"/\" + model.fails);\n };\n \n this.handleResetClick = function(){\n console.log(\"GET\")\n this.matches = 0;\n this.fails = 0;\n this.score = 0;\n \n }\n }", "title": "" }, { "docid": "8791ed6691aaa5bf3174e429e2f7fb38", "score": "0.491027", "text": "function playRound(e) {\n const playerSelectionText = e.target.innerText;\n const computerSelectionText = computerplay();\n\n playerSelection.innerText = 'Player Selection: ' + playerSelectionText;\n computerSelection.innerText = 'Computer Selection: ' + computerSelectionText;\n\n const resultText = findResult(computerSelectionText, playerSelectionText);\n displayResult(resultText);\n updateScores(resultText);\n}", "title": "" }, { "docid": "698b99fc7fa4adf049b5a33d4f381c84", "score": "0.4908739", "text": "function play( choice ) {\n var choice2 = generateChoice();\n var matchup = choice + choice2\n console.log(matchup);\n\n switch( matchup ){\n case \"rr\":\n case \"pp\":\n case \"ss\":\n resultH2.innerHTML = \"It's a DRAW\";\n break;\n case \"rs\":\n case \"pr\":\n case \"sp\":\n resultH2.innerHTML = \"You WON this round\";\n userScore++;\n break;\n case \"rp\":\n case \"ps\":\n case \"sr\":\n resultH2.innerHTML = \"You LOST this round\";\n compScore++;\n break;\n \n }\n updateScore();\n updateColor();\n}", "title": "" }, { "docid": "b6ca724d38e25c2f2d5c47ac400c8c5d", "score": "0.4906598", "text": "function MCTS(game, board){\n this.real_game = game;\n this.board = board;\n\n //Dictionary of move stats. Each entry in the dictionary holds:\n // 0. number of games white won\n // 1. number of games drawn\n // 2. number of games black won\n this.move_stats = {};\n //dictionary that maps the game result to the appropriate entry in move_stats\n this.stat_idx = {\"w\":0, \"d\":1, \"b\":2};\n this.max_calculation_time = 30*1000; //in milliseconds\n this.max_moves = 1000\n this.exploration = 1.4\n\n //Updates the AI's game\n //the AI can't see what the other player plays if you don't update it\n this.update_game = function(game){\n this.real_game = game;\n };\n\n this.is_fen_in_stats = function(fen){\n return (fen in this.move_stats);\n }\n\n //calculates the best move\n this.get_best_move = function(){\n\n var possible_moves = this.real_game.moves();\n var player = this.real_game.turn();\n var simulated_game = new Chess(this.real_game.fen());\n\n //If there's no legal moves, or only one, return early\n if (possible_moves.length == 0){\n return 0;\n }\n if (possible_moves.length == 1){\n return possible_moves[0];\n }\n\n //get FENs for all possible moves\n var possible_fens = possible_moves.map(function(m) {\n simulated_game.move(m);\n var fen = simulated_game.fen();\n simulated_game.undo();\n return fen;\n });\n\n var num_simulations = 0;\n //run simulation for this.max_calculation_time\n start_calc_time = Date.now();\n while (Date.now() - start_calc_time < this.max_calculation_time){\n this.simulate_game();\n num_simulations++;\n }\n\n //get winrates for moves\n var win_rates = new Array(possible_fens.length);\n for (var fen_idx = 0; fen_idx < possible_fens.length; fen_idx++){\n if (!(possible_fens[fen_idx] in this.move_stats)){\n this.move_stats[possible_fens[fen_idx]] = [0,0,0];\n }\n var wins = this.move_stats[possible_fens[fen_idx]][this.stat_idx[player]];\n var num_games = this.move_stats[possible_fens[fen_idx]][0];\n num_games += this.move_stats[possible_fens[fen_idx]][1];\n num_games += this.move_stats[possible_fens[fen_idx]][2];\n\n if(num_games){\n win_rates[fen_idx] = wins/num_games;\n }\n else {\n win_rates[fen_idx] = 0;\n }\n }\n\n //find move with best winrates\n var max_win_rate_idx = Math.floor(Math.random() * possible_moves.length);\n for (var j = 0; j < win_rates.length; j++){\n if (win_rates[j] > win_rates[max_win_rate_idx]){\n max_win_rate_idx = j;\n }\n }\n\n return possible_moves[max_win_rate_idx];\n };\n\n //runs sumulations on the possible moves from current board state\n this.simulate_game = function(){\n var visited = new Set();\n var simulated_game = new Chess(this.real_game.fen());\n var current_player = simulated_game.turn();\n\n for (var i = 0; i < this.max_moves; i++){\n var possible_moves = simulated_game.moves();\n\n //gen FENs for all possible_moves\n var possible_fens = possible_moves.map(function(m) {\n simulated_game.move(m);\n var fen = simulated_game.fen();\n simulated_game.undo();\n return fen;\n });\n\n //check if all of the moves are in this.move_stats\n var all_fens_have_stats = possible_fens.every(this.is_fen_in_stats.bind(this));\n\n //if all moves/fens have stats\n if (all_fens_have_stats){\n //choose by UCT\n //sum of all simulated games of the possible FENs\n var sum_all_games = possible_fens.reduce(function(sum, fen){\n sum += this.move_stats[fen][0];\n sum += this.move_stats[fen][1];\n sum += this.move_stats[fen][2];\n return sum;\n }.bind(this));\n\t\n //calculate UCT values\n\tvar ucts = possible_fens.map(function(fen){\n\t var num_wins = this.move_stats[fen][this.stat_idx[current_player]];\n\t var num_games = this.move_stats[fen][0];\n\t num_games += this.move_stats[fen][1];\n\t num_games += this.move_stats[fen][2];\n\t var uct = num_wins/num_games;\n\t uct += this.exploration*(Math.sqrt(Math.log(sum_all_games)/num_games));\n\t return uct;\n\t}, this);\n\n //find best move (highest UCT value)\n var max_uct_idx = 0;\n for (var j = 0; j < ucts.length; j++){\n if (ucts[j] > ucts[max_uct_idx]){\n max_uct_idx = j;\n }\n }\n\n var move_to_play = possible_moves[max_uct_idx];\n\n } else {\n //play random move\n var random_move_idx = Math.floor(Math.random() * possible_moves.length);\n var move_to_play = possible_moves[random_move_idx];\n }\n simulated_game.move(move_to_play);\n visited.add(simulated_game.fen());\n\n\n //If game is over, get winner (white, black or draw)\n //TODO: what if game is not over in this.max_moves ???\n if (simulated_game.game_over()){\n if (simulated_game.in_checkmate()){\n if (simulated_game.turn() == 'w'){\n var winner = 'b';\n } else {\n var winner = 'w';\n }\n } else {\n var winner = 'd';\n }\n break;\n }\n\n }\n //update move_states with all of the visited moves\n for (let fen of visited){\n if (!(fen in this.move_stats)){\n this.move_stats[fen] = [0,0,0];\n }\n this.move_stats[fen][this.stat_idx[winner]]++;\n }\n }\n\n}", "title": "" }, { "docid": "a4f71b2fa237cd940be84ade102f426f", "score": "0.4903943", "text": "function Game(params) \n{\n // pending/ongoing/defeat/forfeit\n this.status = 'pending';\n\n this.activePlayer = null;\n\n this.players = [\n {color: null, name: null, joined: false, isSetup: false, inCheck: false, hasCommander: true, hasMoveablePieces: true, forfeited: false},\n {color: null, name: null, joined: false, isSetup: false, inCheck: false, hasCommander: true, hasMoveablePieces: true, forfeited: false}\n ];\n\n this.board = {\n a12: 'r10_', b12: 'r11_', c12: 'r10_', d12: 'r0_', e12: 'r0_', \n a11: 'r9_', b11: 'r10_', c11: 'r9_', d11: 'r2_', e11: 'r9_', \n a10: 'r6_', b10: null, c10: 'r6_', d10: null, e10: 'r5_', \n a9: 'r1_', b9: 'r3_', c9: null, d9: 'r3_', e9: 'r5_', \n a8: 'r8_', b8: null, c8: 'r8_', d8: null, e8: 'r8_', \n a7: 'r7_', b7: 'r7_', c7: 'r7_', d7: 'r4_', e7: 'r4_', \n a6: 'b7_', b6: 'b2_', c6: 'b7_', d6: 'b3_', e6: 'b7_', \n a5: 'b4_', b5: null, c5: 'b5_', d5: null, e5: 'b4_', \n a4: 'b8_', b4: 'b3_', c4: null, d4: 'b1_', e4: 'b8_', \n a3: 'b6_', b3: null, c3: 'b8_', d3: null, e3: 'b5_', \n a2: 'b9_', b2: 'b10_', c2: 'b10_', d2: 'b9_', e2: 'b9_', \n a1: 'b0_', b1: 'b11_', c1: 'b10_', d1: 'b0_', e1: 'b6_', \n };\n\n this.capturedPieces = [];\n\n this.validMoves = getMovesForPlayer('blue', this.board, null);\n \n this.validSwap = getSwapForAll(this.board, null);\n\n this.lastMove = null;\n\n this.modifiedOn = Date.now();\n\n // Set player colors\n // params.playerColor is the color of the player who created the game\n if (params.playerColor === 'red') \n {\n this.players[0].color = 'red';\n this.players[1].color = 'blue';\n }\n else if (params.playerColor === 'blue')\n {\n this.players[0].color = 'blue';\n this.players[1].color = 'red';\n }\n}", "title": "" }, { "docid": "8f43ef6936057f991da3869cb05aa611", "score": "0.48991695", "text": "randomPlay(ai_diff, valid_squares) {\n this.turnCount += 1;\n var chosen = null;\n var tmpSquares = Array.from(valid_squares).map(x => [(parseInt(x)-(parseInt(x)%8))/8, parseInt(x)%8]);\n\n if (Math.random()>ai_diff) {\n chosen = tmpSquares[Math.floor(Math.random() * tmpSquares.length)];\n } else {\n var score = -100;\n\n tmpSquares.forEach( (piece) => {\n var validSquares2 = [];\n this.aiPieces[piece[0]][piece[1]] = true;\n for (var y=0; y<8; y++) {\n for (var x=0;x<8;x++) {\n if (!this.aiPieces[y][x] && !this.playerPieces[y][x] && (y===0 || !this.playerPieces[y-1][x]) &&\n (y===7 || !this.playerPieces[y+1][x]) && (x===0 || !this.playerPieces[y][x-1]) && (x===7 || !this.playerPieces[y][x+1])) {\n validSquares2.push([y,x]);\n }\n }\n }\n var newScore = this.minimax(validSquares2, 1+ Math.floor(this.turnCount/5), -100, 100, false);\n if (newScore > score) {\n chosen = piece;\n score = newScore;\n }\n\n this.aiPieces[piece[0]][piece[1]] = false;\n });\n }\n\n return chosen[0]*8+chosen[1];\n }", "title": "" }, { "docid": "6cc85ebca42eeb0bcb855d10303ab394", "score": "0.48973185", "text": "function playRound(playerSelection, computerSelection) {\n let correctedPlayerSelection = playerSelection.toLowerCase();\n //returns result of round\n if (correctedPlayerSelection === \"rock\") {\n if (computerSelection === \"rock\") {\n para.textContent = \"It's a tie! Is this some sort if sign?\"\n return \"tie\"\n }\n if (computerSelection === \"paper\") {\n para.textContent = \"You lose this round! Paper beats rock! Maybe its our destiny to lose.\"\n return \"lose\"\n }\n if (computerSelection === \"scissors\") {\n para.textContent = \"You win this round! Rock beats scissors! The Heavens are on our side.\"\n return \"win\"\n }\n }\n if (correctedPlayerSelection === \"paper\") {\n if (computerSelection === \"rock\") {\n para.textContent = \"You win this round! Paper beats rock! Victory is near\"\n return \"win\"\n }\n if (computerSelection === \"paper\") {\n para.textContent = \"It's a tie! Things are looking up.\"\n return \"tie\"\n }\n if (computerSelection === \"scissors\") {\n para.textContent = \"You lose this round! Scissors beats paper! Curse those infidels!\"\n return \"lose\"\n }\n }\n if (correctedPlayerSelection === \"scissors\") {\n if (computerSelection === \"paper\") {\n para.textContent = \"You win this round! Scissors beats paper! Victory is our divine right\"\n return \"win\"\n }\n if (computerSelection === \"scissors\") {\n para.textContent = \"It's a tie! The stars are clearly not aligned in our favour\"\n return \"tie\"\n }\n if (computerSelection === \"rock\") {\n para.textContent = \"You lose this round! Rock beats scissors! All is lost\"\n return \"lose\"\n }\n }\n }", "title": "" }, { "docid": "65c68cc7e4e4ead24c4a74f990a7d842", "score": "0.48922032", "text": "function sameMoveTypeWinnerRoundOne() {\n if (playerOneMoveOneValue > playerTwoMoveOneType) {\n return 'Player One';\n } else if (playerOneMoveOneValue < playerTwoMoveOneValue) {\n return 'Player Two';\n } else {\n return 'Tie';\n }\n}", "title": "" }, { "docid": "ecdd26668ed3fb40b319ed7c084e5d9c", "score": "0.4889172", "text": "function findComputerMove(move, state) {\r\n aiService.originalState = move.stateAfterMove;\r\n var tmpMove = {\r\n endMatchScores: move.endMatchScores,\r\n turnIndexAfterMove: move.turnIndexAfterMove,\r\n stateAfterMove: { board: angular.copy(state.board), delta: null } // {board: originalState.board, delta: null} haven't rolled dices yet!!!\r\n };\r\n return createComputerMove(tmpMove);\r\n }", "title": "" }, { "docid": "fdf37f6707a19c5113a02ca58003be13", "score": "0.48825997", "text": "doMove(mv) {\n var move_text = V.text2pic(mv.to_move(this.board));\t\t// externalized move text\n\tvar changed_squares = this.board.doMove(mv);\t// Do move on internal board representation\n\tthis.plys.push(mv);\t// Store all (half) moves that we executed\n\t//\n\t// Reset work variables for handling promotion modal dialog\n\t//\n\tthis.promotion_piece = C.EMPTY;\n\tthis.move_r0 = 0;\n\tthis.move_r = 0;\n\tthis.move_c = 0;\n\tthis.move_c0 = 0;\n\t//\n\t// Now move piece(s) on screen as well\n\t//\n\tfor(var j = 0; j < changed_squares.length; ++j) {\n\t var row = this.i2row(changed_squares[j]);\n\t var col = this.i2col(changed_squares[j]);\n\t var thecell = document.getElementById(this.cell2id(row, col));\n\t thecell.innerHTML = this.cell2piece(this.board.cell(changed_squares[j]));\n\t}\n\t//\n\t// Update side to move marker\n\t//\n\tthis.mark_side2move();\n //\n // Refresh variations list\n //\n set_variations();\n\t//\n\t// Update moves notation list\n\t//\n\tvar mvnr = (this.plys.length + 1) >> 1;\n\t//\n\t// Replace English piece name by figurine unicode character\n\t//\n\tvar ext = V.text2pic(mv.text);\n\tif((this.plys.length % 2) == 0) {\n\t //\n\t // Black move = only fill in notation for black on last table row\n\t //\n\t var tr = notation_element.lastChild;\n\t var td = tr.lastChild;\n\t //td.innerHTML = \"\" + ext;\n td.innerHTML = \"\" + move_text;\n\t} else {\n\t //\n\t // White move = append whole new table row\n\t //\n\t var tr = document.createElement(\"tr\");\n\t var td = document.createElement(\"td\");\n td.style.textAlign = \"right\";\n\t td.innerHTML = \"\" + mvnr;\n\t tr.appendChild(td);\n\t td = document.createElement(\"td\");\n td.style.textAlign = \"right\";\n\t //td.innerHTML = \"\" + ext;\n\t td.innerHTML = \"\" + move_text;\n\t tr.appendChild(td);\n\t td = document.createElement(\"td\");\n td.style.textAlign = \"right\";\n\t td.innerHTML = \"...\";\n\t tr.appendChild(td);\n\t //\n\t // Append table row\n\t //\n\t notation_element.appendChild(tr);\n\t}\n //\n // Scroll to last line\n //\n var div = document.getElementById(\"notation_list\");\n div.scrollTop = div.scrollHeight - div.clientHeight;\n\n }", "title": "" }, { "docid": "64af498b88e501af921831da3364403d", "score": "0.48774093", "text": "function playRound(playerSelection, computerSelection) {\n const playerPickLowerCase = playerSelection.toLowerCase();\n switch (playerPickLowerCase) {\n case \"rock\":\n switch (computerSelection) {\n case \"rock\":\n return \"Tie! Rock vs rock\";\n break;\n case \"paper\":\n return \"You lose! Paper beats rock\";\n break;\n case \"scissors\":\n return \"You win! Scissors beat rock\";\n default:\n break;\n }\n break;\n case \"paper\":\n switch (computerSelection) {\n case \"rock\":\n return \"You win! Paper beats rock\";\n break;\n case \"paper\":\n return \"Tie! Paper vs paper\";\n break;\n case \"scissors\":\n return \"You lose! Scissors beats paper\";\n default:\n break;\n }\n break;\n case \"scissors\":\n switch (computerSelection) {\n case \"rock\":\n return \"You lose! Rock beats scissors\";\n break;\n case \"paper\":\n return \"You win! Scissors beats paper\";\n break;\n case \"scissors\":\n return \"Tie! Scissors vs scissors\";\n default:\n break;\n }\n break;\n\n default:\n return \"invalid\"\n break;\n }\n}", "title": "" }, { "docid": "b829cf5647e32b6e23dbec1d6c432c85", "score": "0.48763233", "text": "function moveFun(){\n if(music){\n matchingCards.play();\n }\n move++;\n if(move==1){\n startingTime();\n }\n moveCards.innerHTML = \"Moves: \" + move;\n }", "title": "" }, { "docid": "c287e0ffc122d1e6051a3dbd3390c86e", "score": "0.48730564", "text": "function chooseMove() {\n // should check if player clicks on a canMoveTo highlighted piece\n if ($(this).hasClass('canMoveTo')) {\n // Switching turns\n if (currentPlayer === 'orange') {\n switchTurns(this, 'green');\n } else {\n switchTurns(this, 'orange');\n }\n }\n }", "title": "" }, { "docid": "0b7a765a1ad82618ced0ae8fee97ade5", "score": "0.48726183", "text": "resolveSynchroneMove(move) {\n let m1 = this.whiteMove;\n let m2 = move;\n const movingLikeCapture = (m) => {\n const shift = (m.vanish[0].c == 'w' ? -1 : 1);\n return (\n m.start.x + shift == m.end.x &&\n Math.abs(m.end.y - m.start.y) == 1\n );\n };\n const isPossible = (m, other) => {\n return (\n (\n m.vanish[0].p == V.KNIGHT &&\n (\n m.vanish.length == 1 ||\n m.vanish[1].c != m.vanish[0].c ||\n // Self-capture attempt\n (\n !other.end.illegal &&\n other.end.x == m.end.x &&\n other.end.y == m.end.y\n )\n )\n )\n ||\n (\n m.vanish[0].p == V.PAWN &&\n !other.end.illegal &&\n (\n (\n // Promotion attempt\n m.end.x == (m.vanish[0].c == \"w\" ? 0 : V.size.x - 1) &&\n other.vanish.length == 2 &&\n other.vanish[1].p == V.KNIGHT &&\n other.vanish[1].c == m.vanish[0].c\n )\n ||\n (\n // Moving attempt\n !movingLikeCapture(m) &&\n other.start.x == m.end.x &&\n other.start.y == m.end.y\n )\n ||\n (\n // Capture attempt\n movingLikeCapture(m) &&\n other.end.x == m.end.x &&\n other.end.y == m.end.y\n )\n )\n )\n );\n };\n if (!!m1.end.illegal && !isPossible(m1, m2)) {\n // Either an anticipated capture of something which didn't move\n // (or not to the right square), or a push through blocus.\n // ==> Just discard the move, and add a penalty point\n this.penaltyFlags[m1.vanish[0].c]++;\n m1.isNull = true;\n }\n if (!!m2.end.illegal && !isPossible(m2, m1)) {\n this.penaltyFlags[m2.vanish[0].c]++;\n m2.isNull = true;\n }\n if (!!m1.isNull) m1 = null;\n if (!!m2.isNull) m2 = null;\n // If one move is illegal, just execute the other\n if (!m1 && !!m2) return m2;\n if (!m2 && !!m1) return m1;\n // For PlayOnBoard (no need for start / end, irrelevant)\n let smove = {\n appear: [],\n vanish: []\n };\n if (!m1 && !m2) return smove;\n // Both moves are now legal or at least possible:\n smove.vanish.push(m1.vanish[0]);\n smove.vanish.push(m2.vanish[0]);\n if ((m1.end.x != m2.end.x) || (m1.end.y != m2.end.y)) {\n // Easy case: two independant moves\n smove.appear.push(m1.appear[0]);\n smove.appear.push(m2.appear[0]);\n // \"Captured\" pieces may have moved:\n if (\n m1.vanish.length == 2 &&\n (\n m1.vanish[1].x != m2.start.x ||\n m1.vanish[1].y != m2.start.y\n )\n ) {\n smove.vanish.push(m1.vanish[1]);\n }\n if (\n m2.vanish.length == 2 &&\n (\n m2.vanish[1].x != m1.start.x ||\n m2.vanish[1].y != m1.start.y\n )\n ) {\n smove.vanish.push(m2.vanish[1]);\n }\n } else {\n // Collision: priority to the anticipated capture, if any.\n // If ex-aequo: knight wins (higher risk), or both disappears.\n // Then, priority to the knight vs pawn: remains.\n // Finally: both disappears.\n let remain = null;\n const p1 = m1.vanish[0].p;\n const p2 = m2.vanish[0].p;\n if (!!m1.end.illegal && !m2.end.illegal) remain = { c: 'w', p: p1 };\n else if (!!m2.end.illegal && !m1.end.illegal) remain = { c: 'b', p: p2 };\n if (!remain) {\n // Either both are illegal or both are legal\n if (p1 == V.KNIGHT && p2 == V.PAWN) remain = { c: 'w', p: p1 };\n else if (p2 == V.KNIGHT && p1 == V.PAWN) remain = { c: 'b', p: p2 };\n // If remain is still null: same type same risk, both disappear\n }\n if (!!remain) {\n smove.appear.push({\n x: m1.end.x,\n y: m1.end.y,\n p: remain.p,\n c: remain.c\n });\n }\n }\n return smove;\n }", "title": "" }, { "docid": "880e350d6ad1650fb3bfd7241e58d25a", "score": "0.4871718", "text": "function parse_move(raw) {\n let ptr = 0;\n\n let sp1 = SUPERPHYSICAL_REGEXP.exec(raw);\n if (!sp1) {\n sp1 = [\"\", \"0\", \"0\"];\n }\n ptr += sp1[0].length;\n let sp2 = sp1 = [parse_timeline(sp1[1]), +sp1[2] - 1];\n\n let piece;\n let p1 = [];\n let p2 = [];\n let takes = false;\n let jumps = false;\n let branches = false;\n let moves_present = false;\n let check = false;\n let checkmate = false;\n let softmate = false;\n let promotion = null;\n\n let match;\n\n if (match = PIECES_REGEXP.exec(raw.slice(ptr))) { // Normal move\n piece = raw.slice(ptr, ptr += match[0].length);\n if (match = /^([a-w])(\\d+)(>>?)(x)?/.exec(raw.slice(ptr))) {\n // Jump/time travel\n ptr += match[0].length;\n jumps = true;\n branches = match[3].length == 2;\n takes = !!match[4];\n p1 = [letter_to_index(match[1]), +match[2]];\n\n sp2 = SUPERPHYSICAL_REGEXP.exec(raw.slice(ptr));\n if (!sp2) throw new Error(\"Invalid move: expected super-physical coordinates after the jump operator\");\n ptr += sp2[0].length;\n sp2 = [parse_timeline(sp2[1]), +sp2[2] - 1];\n\n if (!(match = /^([a-w])(\\d+)/.exec(raw.slice(ptr)))) throw new Error(\"Invalid move: expected target coordinates in a piece jump\");\n ptr += match[0].length;\n p2 = [letter_to_index(match[1]), +match[2]];\n\n if (raw.slice(ptr).startsWith(\"+\")) {\n ptr++;\n check = true;\n } else if (raw.slice(ptr).startsWith(\"#\")) {\n ptr++;\n checkmate = true;\n } else if (raw.slice(ptr).startsWith(\"*\")) {\n ptr++;\n softmate = true;\n }\n if (raw.slice(ptr).startsWith(\"~\")) {\n ptr++;\n moves_present = true;\n }\n } else if (match = /^([a-w])?(\\d+)?(x)?([a-w])(\\d)/.exec(raw.slice(ptr))) {\n // Physical move/capture\n ptr += match[0].length;\n p1 = [letter_to_index(match[1])];\n if (match[2]) p1.push(+match[2]);\n p2 = [letter_to_index(match[4]), +match[5]];\n takes = !!match[3];\n\n if (raw.slice(ptr).startsWith(\"+\")) {\n ptr++;\n check = true;\n } else if (raw.slice(ptr).startsWith(\"#\")) {\n ptr++;\n checkmate = true;\n } else if (raw.slice(ptr).startsWith(\"*\")) {\n ptr++;\n softmate = true;\n }\n } else throw new Error(\"Invalid move: unrecognized move\");\n } else if (match = /^[O0]-[O0](-[O0])?/.exec(raw.slice(ptr))) {\n // Castling\n ptr += match[0].length;\n\n if (raw.slice(ptr).startsWith(\"+\")) {\n ptr++;\n check = true;\n } else if (raw.slice(ptr).startsWith(\"#\")) {\n ptr++;\n checkmate = true;\n } else if (raw.slice(ptr).startsWith(\"*\")) {\n ptr++;\n softmate = true;\n }\n\n return [{\n type: \"castle\",\n check,\n checkmate,\n softmate,\n raw: raw.slice(0, ptr),\n from: sp1,\n long: !!match[1],\n }, raw.slice(ptr).trimLeft()];\n } else {\n // Pawn move\n piece = \"P\";\n let match;\n if (match = /^([a-w])x([a-w])(\\d+)/.exec(raw.slice(ptr))) {\n ptr += match[0].length;\n p2 = [letter_to_index(match[2]), +match[3]];\n p1 = [letter_to_index(match[1])];\n } else if (match = /^([a-w])(\\d+)/.exec(raw.slice(ptr))) {\n ptr += match[0].length;\n p2 = [letter_to_index(match[1]), +match[2]];\n p1 = [letter_to_index(match[1])];\n takes = true;\n } else throw new Error(\"Invalid move: invalid pawn move or missing/wrong piece name: \" + raw.slice(ptr, 10) + \"...\");\n\n if (match = /^=([RBUDQSNC])?/.exec(raw.slice(ptr))) {\n promotion = match[1] || \"Q\";\n ptr += match[0].length;\n }\n\n if (raw.slice(ptr).startsWith(\"+\")) {\n ptr++;\n check = true;\n } else if (raw.slice(ptr).startsWith(\"#\")) {\n ptr++;\n checkmate = true;\n } else if (raw.slice(ptr).startsWith(\"*\")) {\n ptr++;\n softmate = true;\n }\n }\n\n if (p1.length === 2) p1[1]--;\n if (p2.length === 2) p2[1]--;\n\n return [{\n type: \"move\",\n from: [...sp1, ...p1],\n to: [...sp2, ...p2],\n src_piece_raw: piece,\n takes,\n jumps,\n check,\n checkmate,\n softmate,\n raw: raw.slice(0, ptr),\n ...(jumps ? {branches} : {}),\n ...(branches ? {moves_present} : {}),\n ...(promotion ? {promotion} : {}),\n }, raw.slice(ptr).trimLeft()];\n}", "title": "" }, { "docid": "b8e8d0d362d193c287f51a6c443a051f", "score": "0.48705906", "text": "function playRound(playerSelection, computerSelection) {\n \nlet concaten = computerSelection.concat(playerSelection) ;\nlet result = \"\" ;\nlet WLD = \" \" ;\n\nlet weWin = `You lose! Our ${computerSelection} beats your ${playerSelection}`;\nlet youWin = `We lose! Your ${playerSelection} beats our ${computerSelection}`;\nlet draw = `It's a draw! ; We both chose ${computerSelection}` ;\n\n\n// Below CW = computer wins ; PW = player wins ; NW = nobody wins (ie it's a draw)\nswitch(concaten) {\n case \"PaperRock\":\n result = weWin ;\n WLD = \"CW\" ;\n break;\n case \"PaperScissors\":\n result = youWin ;\n WLD = \"PW\" ;\n break; \n case \"RockPaper\":\n result = youWin ;\n WLD = \"PW\" ;\n break;\n case \"RockScissors\":\n result = weWin ;\n WLD = \"CW\" ;\n break;\n case \"ScissorsPaper\":\n result = weWin ;\n WLD = \"CW\" ;\n break; \n case \"ScissorsRock\":\n result = youWin ;\n WLD = \"PW\" ;\n break; \n case \"RockRock\" :\n result = draw ;\n WLD = \"NW\" ;\n break; \n case \"PaperPaper\" :\n result = draw ;\n WLD = \"NW\" ;\n break; \n case \"ScissorsScissors\" :\n result = draw ;\n WLD = \"NW\" ;\n break; \n default: \n result = null ;\n WLD = `concaten has value ${concaten}` \n } // end switch\n\nreturn [result, WLD] ;\n\n } // end playRound", "title": "" }, { "docid": "a98131f1f197b4511968040f3f92a7a0", "score": "0.4865247", "text": "askPlayAIHard(board, aiList, validMoves) {\n let rep = function(data) {\n\n this.scene.pieces = data[0];\n\n this.scene.listP2 = data[1];\n\n console.log(\"MOVE: \" + [data[2], data[3]]);\n\n\n //Peca = data[4]\n\n this.gameSequence.addMove(new MyMove(data[2], data[3], data[4])); //ADICIONA A SEQUENCIA DO JOGO\n\n\n for (var s = 0; s < this.scene.piecesBoard.length; s++) {\n if(this.scene.piecesBoard[s].getCoordX() == data[2] && \n this.scene.piecesBoard[s].getCoordZ() == data[3])\n this.PiecesAnimations.push(new MyPiecesAnimations(this.scene.piecesBoard[s],[0,3,0],4));\n }\n\n\n //REMOVER O APONTADOR PARA O TILE DA PEÇA\n\n };\n\n var movesString = '[';\n\n for (var i = 0; i < validMoves.length; i++) {\n if (i == 0) {\n\n }\n else {movesString += ',';}\n\n movesString += ( '[' + validMoves[i] + ']');\n }\n\n movesString += ']';\n\n var aiListS = '[';\n\n for (var l = 0; l < aiList.length; l++) {\n if (l == 0) {\n\n }\n else {aiListS += ',';}\n\n aiListS += aiList[l];\n }\n\n aiListS += ']'\n\n \n\n let requestString = 'makePlayAIHard([' +'[' + board[0] + ']' + ',' + '[' + board[1] + ']' + ',' + \n '[' + board[2] + ']' + ',' + '[' + board[3] + ']' + ',' + '[' + board[4] + ']' + ',' + '[' + board[5] + ']' + ',' + '[' + board[6] + ']' + ',' + \n '[' + board[7] + ']' + '],' + aiListS + ',' + movesString + ')';\n\n return this.prolog.getPrologRequest(requestString, rep.bind(this));\n\n\n }", "title": "" }, { "docid": "4fe45ecde7dd8fc8bf85450086854db0", "score": "0.48625988", "text": "function makeComputerMove(){\n\t\tif(gameOver(board)==0&&boardNotFilled(board)==1){\n\t\t\tvar move = getMove();\n\t\n\t\t\tboard[move] = 1;\n\t\t\t$(\"#sq\"+(move+1)).attr(\"src\", \"o.png\");\n\n\t\t\tif(gameOver(board)==1){\n\t\t\t\t$(\"#message-to-user\").text(\"Game Over: I Win!\");\n\t\t\t\t$(\"#message-to-user\").css(\"visibility\", \"visible\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\t//now that everything's done, we can allow a move again\n\t\t\t\t$(\".board-square\").click(makePlayerMove);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tif(gameOver(board)==-1){\n\t\t\t\t$(\"#message-to-user\").text(\"Game Over: You Win!\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(\"#message-to-user\").text(\"Game Over: Draw!\");\n\t\t\t}\n\t\t\t$(\"#message-to-user\").css(\"visibility\", \"visible\");\n\t\t\t//we don't return control back if the game is over\n\t\t}\n\t}", "title": "" }, { "docid": "c18d8ce6b286fbb13a08256183517bd7", "score": "0.48596644", "text": "function minimax(newBoard, player) {\n //add one to function calls\n fc++;\n \n //available spots\n let availSpots = emptyIndexies(newBoard);\n\n // checks for the terminal states such as win, lose, and tie and returning a value accordingly\n if (winning(newBoard, game.player1.mark)) {\n return {score: -10};\n } else if (winning(newBoard, game.player2.mark)) {\n return {score: 10};\n } else if (availSpots.length === 0) {\n return {score: 0};\n }\n\n // an array to collect all the objects\n let moves = [];\n\n // loop through available spots\n for (let i = 0; i < availSpots.length; i++) {\n //create an object for each and store the index of that spot that was stored as a number in the object's index key\n let move = {};\n move.index = newBoard[availSpots[i]];\n\n // set the empty spot to the current player\n newBoard[availSpots[i]] = player;\n\n //if collect the score resulted from calling minimax on the opponent of the current player\n if (player == game.player2.mark) {\n let result = minimax(newBoard, game.player1.mark);\n move.score = result.score;\n } else {\n let result = minimax(newBoard, game.player2.mark);\n move.score = result.score;\n }\n\n //reset the spot to empty\n newBoard[availSpots[i]] = move.index;\n\n // push the object to the array\n moves.push(move);\n }\n\n // if it is the computer's turn loop over the moves and choose the move with the highest score\n let bestMove;\n if( player === game.player2.mark) {\n let bestScore = -10000;\n for(let i = 0; i < moves.length; i++) {\n if(moves[i].score > bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n } else {\n // else loop over the moves and choose the move with the lowest score\n let bestScore = 10000;\n for(let i = 0; i < moves.length; i++) {\n if(moves[i].score < bestScore) {\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n\n // return the chosen move (object) from the array to the higher depth\n return moves[bestMove];\n }", "title": "" }, { "docid": "0befefc1d737d999ca585a0073976ce8", "score": "0.485692", "text": "sendReplaySimonPattern() {\n this._dispatch(SimonGameActionCreator.REPLAY_SIMON_PATTERN);\n }", "title": "" }, { "docid": "b8d0bae78d4bb5be214d3789ca1c02a9", "score": "0.4854143", "text": "function playRound (playerSelection, computerSelection) {\n\n let gameMessage;\n\n let p = toSentenceCase(playerSelection);\n let c = toSentenceCase(computerSelection);\n\n console.log(\"Player: \" + p);\n console.log(\"Computer: \" + c);\n\n if (p === c) {\n gameMessage = \"tie\";\n } else if (firstPlayerWins(p,c) === true) {\n gameMessage = \"player\";\n } else {\n gameMessage = \"computer\";\n }\n\n return gameMessage;\n}", "title": "" }, { "docid": "8254b2f5814ac93ca9a269c3bb545a90", "score": "0.48488575", "text": "function move_from_san(move, sloppy) {\n// strip off any move decorations: e.g Nf3+?!\nvar clean_move = stripped_san(move);\n\n// if we're using the sloppy parser run a regex to grab piece, to, and from\n// this should parse invalid SAN like: Pe2-e4, Rc1c4, Qf3xf7\nif (sloppy) {\nvar matches = clean_move.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/);\nif (matches) {\n var piece = matches[1];\n var from = matches[2];\n var to = matches[3];\n var promotion = matches[4];\n}\n}\n\nvar moves = generate_moves();\nfor (var i = 0, len = moves.length; i < len; i++) {\n// try the strict parser first, then the sloppy parser if requested\n// by the user\nif ((clean_move === stripped_san(move_to_san(moves[i]))) ||\n (sloppy && clean_move === stripped_san(move_to_san(moves[i], true)))) {\n return moves[i];\n} else {\n if (matches &&\n (!piece || piece.toLowerCase() == moves[i].piece) &&\n SQUARES[from] == moves[i].from &&\n SQUARES[to] == moves[i].to &&\n (!promotion || promotion.toLowerCase() == moves[i].promotion)) {\n return moves[i];\n }\n}\n}\n\nreturn null;\n}", "title": "" }, { "docid": "63ab503c69e2ec8a906ae254dd069de0", "score": "0.48455647", "text": "function makeMove(move) {\n // update plies\n searchPly++;\n gamePly++;\n \n // update repetition table\n repetitionTable[gamePly] = hashKey;\n \n // moveStack board state variables\n moveStack.push({\n move: move,\n hashKey: hashKey,\n sixty: sixty\n });\n \n // parse move\n let sourceSquare = getSourceSquare(move);\n let targetSquare = getTargetSquare(move);\n let sourcePiece = getSourcePiece(move);\n let targetPiece = getTargetPiece(move);\n let captureFlag = getCaptureFlag(move);\n\n // move piece\n board[targetSquare] = sourcePiece;\n board[sourceSquare] = EMPTY;\n \n // hash piece\n hashKey ^= pieceKeys[sourcePiece * board.length + sourceSquare];\n hashKey ^= pieceKeys[sourcePiece * board.length + targetSquare];\n \n if (captureFlag) {\n sixty = 0;\n hashKey ^= pieceKeys[targetPiece * board.length + targetSquare];\n }\n else sixty++;\n\n // update king square\n if (board[targetSquare] == RED_KING || board[targetSquare] == BLACK_KING)\n kingSquare[side] = targetSquare;\n \n // switch side to move\n side ^= 1;\n hashKey ^= sideKey;\n\n // return illegal move if king is left in check \n if (isSquareAttacked(kingSquare[side ^ 1], side)) {\n takeBack();\n return 0;\n } else return 1;\n }", "title": "" }, { "docid": "f7367abb2fca748824103c213df5c52b", "score": "0.48452467", "text": "function ai2() {\n let backupBoard = copyBoard(board);\n let backupTurn = turn;\n\n let places = {};\n\n\n // Get all of the playable areas\n let playable = getPlayables();\n\n // List of analyzed squares\n let analyzedQuads = [];\n\n /**\n * Initial setup of places\n */\n // Loop through the playables\n let i = 0;\n for (i = 0; i < playable.length; i++) {\n let quadIndex = getQuadIndexFromBoardCoord(playable[i]);\n\n // If we havent analyzed the quadrant where the playable place is\n if (!analyzedQuads.includes(quadIndex)) {\n let quadX = Math.floor(Math.floor(playable[i] / 9) / 3);\n let quadY = Math.floor(Math.floor(playable[i] % 9) / 3);\n\n // Determine the placements in that quadrant\n let newPlaces = fullEvaluation(quadX, quadY, getSubBoard(quadX, quadY));\n\n places = {...places, ...newPlaces};\n }\n }\n\n Object.keys(places).forEach(function(place) {\n board = null;\n board = copyBoard(backupBoard);\n turn = backupTurn;\n\n let value = places[place];\n\n // Sets the values to the place on the board for the made move\n let x = Math.floor(place / boardSize);\n let y = Math.floor(place % boardSize);\n let boardPlace = getPlace(x, y);\n boardPlace.playable = false;\n boardPlace.player = 1;\n boardPlace.turn = turn;\n\n turn++;\n\n // Updates which spots are playable on the board\n preparePlayables(x, y);\n\n for (i = 0; i < lookAhead; i++) {\n // When playerTurn is 0, its the humans turn, when its 1, its the AI's turn\n let playerTurn = turn % 2;\n let coefficient = 1;\n if (playerTurn === 0) {\n coefficient = -1;\n }\n\n // Sets the values to the place on the board for the made move\n let nextMoves = ai1Evaluation();\n let lookAheadPlace = null;\n if(nextMoves.places.length === 0)\n {\n lookAheadPlace = ai0Evaluation();\n } else {\n lookAheadPlace = nextMoves.places[Math.floor(Math.random() * nextMoves.places.length)];\n }\n\n let x = Math.floor(lookAheadPlace / boardSize);\n let y = Math.floor(lookAheadPlace % boardSize);\n let boardPlace = getPlace(x, y);\n boardPlace.playable = false;\n boardPlace.player = playerTurn;\n boardPlace.turn = turn;\n turn++;\n\n // Updates which spots are playable on the board\n preparePlayables(x, y);\n\n let weight = 1.8 / (i + 2);\n places[place] = value + (coefficient * weight * nextMoves.value);\n\n turn += 1;\n }\n });\n\n /**\n * Finds the best places\n */\n let bestPlaces = [];\n let bestValue = -1000;\n Object.keys(places).forEach(function(place) {\n let value = places[place];\n if(value > bestValue)\n {\n bestPlaces = [place];\n bestValue = value;\n } else if(value === bestValue)\n {\n bestPlaces.push(place);\n }\n });\n\n\n // Resetting board and turn state to make a move\n board = null;\n board = copyBoard(backupBoard);\n backupBoard = null;\n turn = backupTurn;\n\n console.log(places);\n console.log(bestPlaces);\n // If no good placements were found\n if (places.length === 0) {\n ai0();\n } else {\n\n // If a good placement was found\n let bestMove = bestPlaces[Math.floor(Math.random() * bestPlaces.length)];\n makeMove(Math.floor(bestMove / boardSize), Math.floor(bestMove % boardSize))\n }\n\n}", "title": "" }, { "docid": "7e32d0fdeeee47215df083edcaa33736", "score": "0.48450744", "text": "function decideNextMove() {\n // establish who's who\n var myPieces = GLOBAL.nextPlayerTurn;\n var rivalPieces =\n myPieces === PLAYERS.PLAYER_ONE\n ? PLAYERS.PLAYER_TWO\n : PLAYERS.PLAYER_ONE;\n\n if (GLOBAL.boardState.includes(PLAYERS.EMPTY)) {\n var bestMove = getBestMove(GLOBAL.boardState, myPieces, rivalPieces)\n makeMove(GLOBAL.boardState, bestMove)\n } else {\n return console.log(\"Game is over!\")\n }\n}", "title": "" }, { "docid": "8e9e7fd9ff97dbf722686553bb8ba116", "score": "0.48443055", "text": "function playRound(player1, computerSelection) {\r\n\tlet player1Choice = player1.toUpperCase();\r\n\tlet outcome = \"\";\r\n\tlet message = \"\";\r\n\t\r\n\tswitch (player1Choice) {\r\n\t\tcase \"ROCK\":\r\n\t\t\tif (computerSelection === \"ROCK\"){\r\n\t\t\t\toutcome = \"DRAW\";\r\n\t\t\t} else if (computerSelection === \"SCISSORS\"){\r\n\t\t\t\toutcome = \"WIN\";\r\n\t\t\t} else if (computerSelection === \"PAPER\"){\r\n\t\t\t\toutcome = \"LOSE\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase \"SCISSORS\":\r\n\t\t\tif (computerSelection === \"ROCK\"){\r\n\t\t\t\toutcome = \"LOSE\";\r\n\t\t\t} else if (computerSelection === \"SCISSORS\"){\r\n\t\t\t\toutcome = \"DRAW\";\r\n\t\t\t} else if (computerSelection === \"PAPER\"){\r\n\t\t\t\toutcome = \"WIN\";\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\r\n\t\tcase \"PAPER\":\r\n\t\t\tif (computerSelection === \"ROCK\"){\r\n\t\t\t\toutcome = \"WIN\";\r\n\t\t\t} else if (computerSelection === \"SCISSORS\"){\r\n\t\t\t\toutcome = \"LOSE\";\r\n\t\t\t} else if (computerSelection === \"PAPER\"){\r\n\t\t\t\toutcome = \"DRAW\";\r\n\t\t\t}\r\n\t\t\tbreak;\t\r\n\t}\r\n\t\r\n\tif (outcome === \"WIN\"){\r\n\t\tmessage = `You won! ${player1Choice} beats ${computerSelection}.`;\r\n\t} else if (outcome === \"LOSE\"){\r\n\t\tmessage = `You lost! ${computerSelection} beats ${player1Choice}.`;\r\n\t} else if (outcome === \"DRAW\"){\r\n\t\tmessage = \"It was a draw!\";\r\n\t}\r\n\r\n\treturn message;\r\n\r\n}", "title": "" }, { "docid": "ca070188a35eeda7d6d214c455388d94", "score": "0.4841165", "text": "function get_disambiguator(move, moves) {\n var from = move.from;\n var to = move.to;\n var piece = move.piece;\n\n var ambiguities = 0;\n var same_rank = 0;\n var same_file = 0;\n\n for (var i = 0, len = moves.length; i < len; i++) {\n var ambig_from = moves[i].from;\n var ambig_to = moves[i].to;\n var ambig_piece = moves[i].piece;\n\n /* if a move of the same piece type ends on the same to square, we'll\n * need to add a disambiguator to the algebraic notation\n */\n if (piece === ambig_piece && from !== ambig_from && to === ambig_to) {\n ambiguities++;\n\n if (rank(from) === rank(ambig_from)) {\n same_rank++;\n }\n\n if (file(from) === file(ambig_from)) {\n same_file++;\n }\n }\n }\n\n if (ambiguities > 0) {\n /* if there exists a similar moving piece on the same rank and file as\n * the move in question, use the square as the disambiguator\n */\n if (same_rank > 0 && same_file > 0) {\n return algebraic(from)\n } else if (same_file > 0) {\n /* if the moving piece rests on the same file, use the rank symbol as the\n * disambiguator\n */\n return algebraic(from).charAt(1)\n } else {\n /* else use the file symbol */\n return algebraic(from).charAt(0)\n }\n }\n\n return ''\n }", "title": "" }, { "docid": "f0f4e695c3314f0439303b39b66c5635", "score": "0.48360524", "text": "function PlayerCard(props) {\n _classCallCheck(this, PlayerCard);\n\n var _this8 = _possibleConstructorReturn(this, (PlayerCard.__proto__ || Object.getPrototypeOf(PlayerCard)).call(this, props));\n\n _this8.matchRoleToPosition = function (role) {\n var position = \"\";\n if (role === \"G\") {\n position = \"P01\";\n } else if (role === \"DC\") {\n position = \"P04\";\n } else if (role === \"DG\") {\n position = \"P03\";\n } else if (role === \"DLG\") {\n position = \"P03\";\n } else if (role === \"DD\") {\n position = \"P02\";\n } else if (role === \"DLD\") {\n position = \"P02\";\n } else if (role === \"MDC\") {\n position = \"P06\";\n } else if (role === \"MC\") {\n position = \"P06\";\n } else if (role === \"MG\") {\n position = \"P11\";\n } else if (role === \"MD\") {\n position = \"P07\";\n } else if (role === \"MOC\") {\n position = \"P10\";\n } else if (role === \"AD\") {\n position = \"P07\";\n // position.push(\"10\")\n } else if (role === \"AG\") {\n position = \"P11\";\n } else if (role === \"ATT\") {\n position = \"P10\";\n } else if (role === \"BU\") {\n position = \"P09\";\n }\n // console.log(role, position)\n return position;\n };\n\n _this8.findClosestPosition = function (preferredPosition) {\n var positionIndex = -1;\n var keys = Object.keys(_this8.props.tactic);\n // regola ordine di ricerca da attaccanti a difensori\n keys.sort(function (a, b) {\n return b - a;\n });\n // console.log(keys)\n // Find index of preferred position\n for (var i = 0; i < keys.length; i++) {\n if (preferredPosition === keys[i]) {\n positionIndex = i;\n }\n }\n // Find closest match\n var closestPosition = -1;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var position = _step.value;\n\n if (closestPosition === -1 || Math.abs(keys.indexOf(position) - positionIndex) < Math.abs(keys.indexOf(position) - closestPosition)) {\n var isAvailable = true;\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = _this8.props.occupiedPositions[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var occupied = _step2.value;\n\n if (occupied === position) {\n isAvailable = false;\n }\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n if (isAvailable) {\n closestPosition = keys.indexOf(position);\n }\n }\n }\n // Add player to pitch\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n _this8.props.positionPlayer(keys[closestPosition], \"Player\" + _this8.props.player.id);\n };\n\n _this8.dragStart = function (x, y) {\n _this8.setState({\n isDragging: true,\n originX: x,\n originY: y,\n previousMoveX: _this8.state.previousMoveX,\n previousMoveY: _this8.state.previousMoveY\n });\n if (_this8.state.previousMoveX === undefined) {\n _this8.setState({ previousMoveX: 0 });\n }\n if (_this8.state.previousMoveY === undefined) {\n _this8.setState({ previousMoveY: 0 });\n }\n ReactDOM.findDOMNode(_this8).style.zIndex = \"400\";\n };\n\n _this8.dragMove = function (x, y) {\n var currentPos = ReactDOM.findDOMNode(_this8).getBoundingClientRect();\n // console.log(currentPos)\n // console.log(this.props.parentFrame)\n // Prevent dragging outside of Pitch\n // verifica se lo spostamento fa restare il giocatore dentro il campo\n if (currentPos.left >= _this8.props.parentFrame.left && currentPos.right <= _this8.props.parentFrame.right &&\n // Si conta da upper-left corner\n currentPos.top >= _this8.props.parentFrame.top && currentPos.bottom <= _this8.props.parentFrame.bottom)\n // IF TRUE: PalyerCard è dentro Pitch\n {\n // Update data\n _this8.setState({\n differenceX: _this8.state.previousMoveX + x - _this8.state.originX,\n differenceY: _this8.state.previousMoveY + y - _this8.state.originY\n });\n // Move player card visually\n ReactDOM.findDOMNode(_this8).style.transform = \"\\n translateX(\" + _this8.state.differenceX + \"px)\\n translateY(\" + _this8.state.differenceY + \"px)\\n \";\n // Get card center relatively to Pitch\n // Trova la posizione del centro della Card\n var cardCenterPos = {};\n cardCenterPos.x = 100 * (currentPos.left + currentPos.width / 2 - _this8.props.parentFrame.left) / _this8.props.parentFrame.width;\n cardCenterPos.y = 100 * (currentPos.top + currentPos.height / 2 - _this8.props.parentFrame.top) / _this8.props.parentFrame.height;\n\n // Snap to position if dragged next to position indicator\n // Confronta centro della card con ogni centoroide \"indicator\" nella tattica\n var _iteratorNormalCompletion3 = true;\n var _didIteratorError3 = false;\n var _iteratorError3 = undefined;\n\n try {\n for (var _iterator3 = Object.keys(_this8.props.tactic)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n var indicator = _step3.value;\n\n if (indicator !== ReactDOM.findDOMNode(_this8).dataset.activePosition && _this8.getDistance(_this8.props.tactic[indicator].x, _this8.props.tactic[indicator].y, cardCenterPos.x, cardCenterPos.y) < 8 // sono pixel?\n ) {\n // IF TRUE: se la distanza è minore di 8 pixel\n var isAvailable = true;\n var _iteratorNormalCompletion4 = true;\n var _didIteratorError4 = false;\n var _iteratorError4 = undefined;\n\n try {\n for (var _iterator4 = _this8.props.occupiedPositions[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {\n var occupied = _step4.value;\n\n if (occupied === indicator) {\n isAvailable = false;\n }\n }\n } catch (err) {\n _didIteratorError4 = true;\n _iteratorError4 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion4 && _iterator4.return) {\n _iterator4.return();\n }\n } finally {\n if (_didIteratorError4) {\n throw _iteratorError4;\n }\n }\n }\n\n if (_this8.props.playersList.length === 11) {\n isAvailable = false;\n }\n var activePosition = ReactDOM.findDOMNode(_this8).dataset.activePosition;\n\n // Swap players if position is occupied\n if (!isAvailable) {\n // Do the reverse travel with the other player\n _this8.props.unoccupyPosition(indicator);\n var cardToMove = document.querySelector(\"[data-active-position='\" + indicator + \"']\");\n _this8.props.positionPlayer(activePosition, cardToMove.classList[1]);\n } else {\n // Prepare next drag\n _this8.props.unoccupyPosition(activePosition);\n _this8.props.unoccupyPosition(indicator);\n }\n _this8.setState({\n differenceX: 0,\n differenceY: 0\n });\n _this8.dragEnd();\n _this8.props.positionPlayer(indicator, \"Player\" + _this8.props.player.id);\n }\n // else {\n // // FIX: MANCA FALSE E QUINDI CONSENTE DI LASCIAR IL GIOCATORE IN MEZZO A DUE POSITION\n // // Update data\n // this.setState({\n // // differenceX: this.state.previousMoveX + x - this.state.originX,\n // // differenceY: this.state.previousMoveY + y - this.state.originY\n // differenceX: - this.state.previousMoveX - x + this.state.originX,\n // differenceY: - this.state.previousMoveY - y + this.state.originY\n // })\n // // Move player card visually\n // ReactDOM.findDOMNode(this).style.transform = `\n // translateX(${this.state.differenceX}px)\n // translateY(${this.state.differenceY}px)\n // `\n // }\n }\n // IF FALSE: giocatore fuori dal Pitch\n // elimina il giocatore quando viene trascinato fuori dal campo\n } catch (err) {\n _didIteratorError3 = true;\n _iteratorError3 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion3 && _iterator3.return) {\n _iterator3.return();\n }\n } finally {\n if (_didIteratorError3) {\n throw _iteratorError3;\n }\n }\n }\n } else {\n // Prevent further dragging\n _this8.dragEnd();\n ReactDOM.findDOMNode(_this8).style.opacity = \"0\";\n var _activePosition = ReactDOM.findDOMNode(_this8).dataset.activePosition;\n // Delete player after animation end\n window.setTimeout(function () {\n _this8.props.unselectPlayer(_this8.props.player);\n }, 30);\n // Reset position indicator\n _this8.props.unoccupyPosition(_activePosition);\n // Prevent direct downloads\n // this.props.markDownloadAsObsolete()\n\n // Post player and position to server when removed\n // make JSON\n var appo = JSON.stringify({\n id: _this8.props.player.id,\n position: _activePosition\n });\n\n // send data to APIs\n fetch('/teams/lineup/api/rm-player', {\n method: 'POST',\n mode: \"same-origin\", // no-cors, cors, *same-origin\n headers: {\n // 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: appo\n });\n }\n };\n\n _this8.dragEnd = function () {\n _this8.setState({\n isDragging: false,\n previousMoveX: _this8.state.differenceX,\n previousMoveY: _this8.state.differenceY\n });\n ReactDOM.findDOMNode(_this8).style.zIndex = \"300\";\n // FORSE QUESTO SERVE...?\n // const card = document.querySelector(\".PlayerCard.Selected\")\n // card.classList.remove(\"Selected\")\n };\n\n _this8.getDistance = function (x0, y0, x1, y1) {\n // Using Pythagore\n var differenceX = x0 - x1;\n var differenceY = y0 - y1;\n return Math.sqrt(Math.pow(differenceX, 2) + Math.pow(differenceY, 2));\n };\n\n _this8.state = {\n isDragging: false,\n differenceX: 0,\n differenceY: 0,\n originX: 0,\n originY: 0,\n lastTouch: { x: 0, y: 0 },\n // picture: this.props.portraitPlaceholder,\n pictureBackup: _this8.props.player.photo\n // TODO: invertire picture e pictureBackup?\n };\n return _this8;\n }", "title": "" }, { "docid": "9a88b5a763b073129c58a46104a2dd57", "score": "0.48335543", "text": "function secondMove(ticTacToeBoard){\n\n let board = ticTacToeBoard;\n \n if(board === \"ox..x....\"){\n return \"ox..x..o.\";\n }else if(board === \"o.x.x....\"){\n return \"o.x.x.o..\";\n }else if(board === \"o..xx....\"){\n return \"o..xxo...\";\n }else if(board === \"o...xx...\"){\n return \"o..oxx...\"; \n }else if(board === \"o...x.x..\"){\n return \"o.o.x.x..\"; \n }else if(board === \"o...x..x.\"){\n return \"oo..x..x.\";\n }else if(board === \"o...x...x\"){\n return \"o...x.o.x\";\n }else if(board === \"xx..o....\"){\n return \"xxo.o....\";\n }else if(board === \"x.x.o....\"){\n return \"xox.o....\";\n }else if(board === \"x..xo....\"){\n return \"x..xo.o..\";\n }else if(board === \"x...ox...\"){\n return \"x.o.ox...\";\n }else if(board === \"x...o.x..\"){\n return \"x..oo.x..\";\n }else if(board === \"x...o..x.\"){\n return \"x...o.ox.\";\n }else if(board === \"x...o...x\"){\n return \"x..oo...x\";\n }else if(board === \".xx.o....\"){\n return \"oxx.o....\";\n }else if(board === \".x.xo....\"){\n return \"ox.xo....\";\n }else if(board === \".x..ox...\"){\n return \".xo.ox...\"\n }else if(board === \".x..o.x..\"){\n return \"ox..o.x..\";\n }else if(board === \".x..o..x.\"){\n return \"ox..o..x.\";\n }else if(board === \".x..o...x\"){\n return \".xo.o...x\";\n }else if(board === \"..xxo....\"){\n return \"o.xxo....\";\n }else if(board === \"..x.ox...\"){\n return \"..x.ox..o\";\n }else if(board === \"..x.o.x..\"){\n return \".ox.o.x..\";\n }else if(board === \"..x.o..x.\"){\n return \"..x.o..xo\";\n }else if(board === \"..x.o...x\"){\n return \"..x.oo..x\";\n }else if(board === \"...xox...\"){\n return \"...xoxo..\";\n }else if(board === \"...xo.x..\"){\n return \"o..xo.x..\";\n }else if(board === \"...xo..x.\"){\n return \"...xo.ox.\";\n }else if(board === \"...xo...x\"){\n return \"...xo.o.x\";\n }else if(board === \"....oxx..\"){\n return \"....oxx.o\";\n }else if(board === \"....ox.x.\"){\n return \"....ox.xo\";\n }else if(board === \"....ox..x\"){\n return \"..o.ox..x\";\n }else if(board === \"....o.xx.\"){\n return \"....o.xxo\";\n }else if(board === \"....o.x.x\"){\n return \"....o.xox\";\n }else if(board === \"....o..xx\"){\n return \"....o.oxx\"; \n }\n\n}", "title": "" }, { "docid": "5110cd2c11942d1ef87f7b454450544c", "score": "0.48288894", "text": "function minimax(newBoard, player) {\n\n\t//Empty Squares \n\tvar availSpots = emptySquares(newBoard);\n\n\n\t//Terminal States\n\tif (checkWin(newBoard, huPlayer)) //If '0' wins\n\t{\n\t\treturn {score: -10};\n\t} \n\telse if (checkWin(newBoard, aiPlayer)) //If 'X' win\n\t{\n\t\treturn {score: 10};\n\t} \n\telse if (availSpots.length === 0) //No room to play, game is a tie\n\t{\n\t\treturn {score: 0};\n\t}\n\n\n\t//Collect scores of each empty spot to eval(), basically looping through every single space to determine the best move\n\tvar moves = [];\n\tfor (var i = 0; i < availSpots.length; i++) {\n\t\tvar move = {};\n\t\t//Set old index to new index.property\n\t\tmove.index = newBoard[availSpots[i]];\n\t\tnewBoard[availSpots[i]] = player;\n\n\t\t/*\n\t\t*\n\t\t*\t\tRecursion method - calls itself with different boards\n\t\t*\n\t\t*/\n\n\t\t//Set empty spot to new player\n\t\tif (player == aiPlayer) \n\t\t{\n\t\t\tvar result = minimax(newBoard, huPlayer);\n\t\t\tmove.score = result.score;\n\t\t} \n\t\telse \t\t//Keeps going deeper into recursion until found a state\n\t\t{\n\t\t\tvar result = minimax(newBoard, aiPlayer);\n\t\t\tmove.score = result.score;\n\t\t}\n\n\t\t//Pushes move and resets board to previous board\n\t\tnewBoard[availSpots[i]] = move.index;\n\t\tmoves.push(move);\n\n\t}\n\n\t//Finds the highest score when AI is player, lowest when Human is player\n\tvar bestMove;\n\tif(player === aiPlayer) \n\t{\n\t\tvar bestScore = -10000;\n\t\tfor(var i = 0; i < moves.length; i++) \n\t\t{\n\t\t\tif (moves[i].score > bestScore) \n\t\t\t{\n\t\t\t\tbestScore = moves[i].score;\n\t\t\t\tbestMove = i;\n\t\t\t}\n\t\t}\n\t} \n\telse \n\t{\n\t\tvar bestScore = 10000;\n\t\tfor(var i = 0; i < moves.length; i++) \n\t\t{\n\t\t\tif (moves[i].score < bestScore)\n\t\t\t{\n\t\t\t\tbestScore = moves[i].score;\n\t\t\t\tbestMove = i;\n\t\t\t}\n\t\t}\n\t}\n\n\t//Returns best object\n\treturn moves[bestMove];\n}", "title": "" }, { "docid": "083a9846bff7e2a445f1cbfac0f2942c", "score": "0.48242414", "text": "makeMovePRT(shape, sounds) {\n if (!(shape === \"alpha\" || shape === \"beta\" || shape === \"gamma\")) {\n console.log(\"Invalid PRT Move!\")\n return;\n }\n\n //Play specific Heli sound\n SM.userInit();\n SM.playSound(\n sounds[shape].url,\n 127,\n 0.9\n );\n\n //Make manoeuvre\n this.setState(\"MAKING-MOVE\");\n let curvePath;\n let displayPath;\n switch (shape) {\n\n case \"alpha\":\n curvePath = fetchFullCurvePath(\"PRT\", \"PETALS\");\n this.currentMove = \"PETALS\"\n console.log(\"PETALS\");\n break;\n case \"beta\":\n curvePath = fetchFullCurvePath(\"PRT\", \"RAINBOW\");\n this.currentMove = \"RAINBOW\";\n console.log(\"RAINBOW\");\n break;\n case \"gamma\":\n curvePath = fetchFullCurvePath(\"PRT\", \"TORNADO\");\n this.currentMove = \"TORNADO\";\n console.log(\"TORNADO\");\n break;\n }\n // console.log(\"Reached upto monoeuvre\");\n this.replayMessage = \"Your Move:\" + this.currentMove + \" \" + gestureMAP[this.currentMove];\n this.updateGUI();\n \n setupManoeuvre(this, scene, this.sceneKeeper, curvePath);\n //execute manoeuvre with clock-tick\n this.loop.updatables.push(heliCopter);\n }", "title": "" }, { "docid": "af32c0d1ef21e131728ee12c21d56544", "score": "0.48221615", "text": "function playRound(computerSelection, playerSelection){\n if (playerSelection === computerSelection){\n Result.textContent= \"Tie\";\n } else if (playerSelection === \"SCISSORS\" && computerSelection === \"PAPER\"){\n playerScore++;\n Result.textContent=\"You are the Winner for this Round!\"\n } else if (playerSelection === \"SCISSORS\" && computerSelection === \"ROCK\"){\n computerScore++;\n Result.textContent=\"Computer is the Winner for this Round!\"\n } else if (playerSelection === \"ROCK\" && computerSelection === \"PAPER\"){\n computerScore++;\n Result.textContent=\"Computer is the Winner for this Round!\"\n } else if (playerSelection === \"ROCK\" && computerSelection === \"SCISSORS\"){\n playerScore++;\n Result.textContent=\"You are the Winner for this Round!\"\n } else if (playerSelection === \"PAPER\" && computerSelection === \"SCISSORS\"){\n computerScore++;\n Result.textContent=\"Computer is the Winner for this Round!\"\n } else if (playerSelection === \"PAPER\" && computerSelection === \"ROCK\"){\n playerScore++;\n Result.textContent=\"You are the Winner for this Round!\"\n }\n playerPoint.textContent=`Player Score: ${playerScore}`;\n computerPoint.textContent=`Computer Score: ${computerScore}`;\n round++\n Rounds.textContent=`${round}`;\n makeWinner();\n}", "title": "" }, { "docid": "47eca2a12fda8d649a2b8040c6b2ce28", "score": "0.4821328", "text": "function evaluateBoard (move, prevSum, color) \n{\n var from = [8 - parseInt(move.from[1]), move.from.charCodeAt(0) - 'a'.charCodeAt(0)];\n var to = [8 - parseInt(move.to[1]), move.to.charCodeAt(0) - 'a'.charCodeAt(0)];\n\n // Change endgame behavior for kings\n if (prevSum < -1500)\n {\n if (move.piece === 'k') {move.piece = 'k_e'}\n else if (move.captured === 'k') {move.captured = 'k_e'}\n }\n\n if ('captured' in move)\n {\n // Opponent piece was captured (good for us)\n if (move.color === color)\n {\n prevSum += (weights[move.captured] + pstOpponent[move.color][move.captured][to[0]][to[1]]);\n }\n // Our piece was captured (bad for us)\n else\n {\n prevSum -= (weights[move.captured] + pstSelf[move.color][move.captured][to[0]][to[1]]);\n }\n }\n\n if ('c_promoted' in move) {\n // Our prince was promoted (good for us)\n if (move.color === color) {\n prevSum += pstSelf[move.color]['c'][to[0]][to[1]];\n }\n // Opponent prince was promoted (bad for us)\n else {\n prevSum -= pstSelf[move.color]['c'][to[0]][to[1]];\n }\n }\n else if (move.flags.includes('p'))\n {\n // NOTE: promote to queen for simplicity\n move.promotion = 'q';\n\n // Our piece was promoted (good for us)\n if (move.color === color)\n {\n prevSum -= (weights[move.piece] + pstSelf[move.color][move.piece][from[0]][from[1]]);\n prevSum += (weights[move.promotion] + pstSelf[move.color][move.promotion][to[0]][to[1]]);\n }\n // Opponent piece was promoted (bad for us)\n else\n {\n prevSum += (weights[move.piece] + pstSelf[move.color][move.piece][from[0]][from[1]]);\n prevSum -= (weights[move.promotion] + pstSelf[move.color][move.promotion][to[0]][to[1]]);\n }\n }\n else\n {\n // The moved piece still exists on the updated board, so we only need to update the position value\n if (move.color !== color)\n {\n prevSum += pstSelf[move.color][move.piece][from[0]][from[1]];\n prevSum -= pstSelf[move.color][move.piece][to[0]][to[1]];\n }\n else\n {\n prevSum -= pstSelf[move.color][move.piece][from[0]][from[1]];\n prevSum += pstSelf[move.color][move.piece][to[0]][to[1]];\n }\n }\n \n return prevSum;\n}", "title": "" }, { "docid": "2a6678a467c7da934c9d48b2d5feface", "score": "0.48203728", "text": "function makeMove() {\n // Temporary variable for the player moving.\n let currentPlayer;\n let nextPlayer;\n // Record the space's row and column.\n const spaceValue = {\n row: this.dataset.space[0],\n col: this.dataset.space[1],\n };\n\n // Increment the turn one higher.\n turn += 1;\n\n // Update the instructions area.\n updateIntro(turn);\n\n // Check which player has played based on number of turns.\n if ((turn % 2) !== 0) {\n currentPlayer = player1;\n nextPlayer = player2;\n } else {\n currentPlayer = player2;\n nextPlayer = player1;\n }\n\n // Add the space played to the player's moves array.\n currentPlayer.moves.push(spaceValue);\n\n // Add the player's symbol to the space played.\n this.textContent = currentPlayer.symbol.toUpperCase();\n\n // Disable the space once played.\n this.setAttribute('disabled', 'true');\n\n // Check if the player has won.\n winCheck(currentPlayer, currentPlayer.moves);\n\n if (turn === spaces.length && !winner) {\n // If the player has not won and all spaces are filled, declare game over\n // and hide the turn message.\n gameOver();\n } else if (!winner) {\n // If the player has not won, set the turn message to the next player.\n turnMsg.textContent = `Player ${nextPlayer.name} (${nextPlayer.symbol}), it's your turn.`;\n }\n}", "title": "" }, { "docid": "f40ea189af1528cb4de3d043b443596d", "score": "0.4819929", "text": "function Game(aName, aDate, aOver, aMyTurn, aBoard, aBlockedWords, aTst) {\n // private variables\n var name = aName;\n var date = aDate;\n var over = aOver;\n var myTurn = aMyTurn;\n var board = aBoard;\n var blockedWords = aBlockedWords;\n var tst = aTst;\n var currMovesList;\n var bestMoves = null;\n var bestMoveValues = null;\n // block initial words in TST\n for (var i = 0; i < blockedWords.length; i++) {\n tst.block(blockedWords[i]);\n }\n // generate move list\n var start = new Date();\n var alphaPool = mapTileLocations();\n var move = new Array(25);\n for (var i = 0; i < 25; i++) {\n move[i] = -1;\n }\n currMovesList = findMoves(tst.getRoot(), alphaPool, move, 0);\n var end = new Date();\n console.log('currMovesList.length: ' + String(currMovesList.length));\n console.log('currMovesList generation took: ' + String(end - start));\n\n // Getters\n this.getName = function() {\n return name;\n }\n this.getOver = function() {\n return over;\n }\n this.isMyTurn = function() {\n return myTurn;\n }\n this.getBoard = function() {\n return board;\n }\n this.getBestMoves = function() {\n return bestMoves;\n }\n // word-checker\n this.hasBeenPlayed = function(word) {\n return blockedWords.indexOf(word) != -1;\n }\n // privileged methods\n\n // produces a string of this Game's essential data to be saved\n this.saveString = function() {\n return JSON.stringify({name: name, date: date, over: over, myTurn: myTurn, board: board, blocked: blockedWords});\n }\n\n /* Plays the move on this game, effecting the necessary board changes.\n */\n this.play = function(move) {\n var state = new GameState(myTurn, board, []);\n state.playMove(move);\n board = state.board; // update board\n myTurn = !myTurn; // change turns\n over = state.over; // update over\n removeCurrMoves(state.playedWords[0]); // remove word from move list\n blockedWords.push(state.playedWords[0]); // add to blocked list\n }\n\n /* Find and set the bestMoves\n * REQUIRES: lookahead is the desired lookahead (min 1); timeLimit is a\n * time limit in seconds (min 1); listLen is the desired length of final list\n * ENSURES: finds and sets the bestMoves using minimax with alpha-beta\n * pruning up to lookahead plies, or as far as it can get within at most\n * timeLimit seconds\n */\n this.findBestMoves = function(lookahead, timeLimit, listLen) {\n var movesList = currMovesList; // set initial moves list\n var fullListLen = movesList.length; // remember full list length\n var endTime = new Date().getTime() + 1000*timeLimit;\n var layerMaxTime;\n // use IDDFS\n for (var depth = 0; depth < lookahead; depth++) {\n if (depth > 0 && new Date().getTime() > endTime - layerMaxTime) {\n break;\n }\n var bestMovesLen = Math.max(Math.floor(Math.pow(fullListLen, (1 / (depth+2)))), 100); // keep the move list at least 100 long, to avoid shortsightedness\n bestMoves = new Array(bestMovesLen);\n bestMovesValue = new Array(bestMovesLen);\n for (var i = 0; i < bestMovesLen; i++) {\n bestMovesValue[i] = BOARD_MIN;\n }\n var startState = new GameState(myTurn, board, []);\n var lastIndex = -1;\n var count = 0;\n var modulus = depth == 0 ? 1000 : 10;\n for (var i = 0; i < movesList.length; i++) {\n if (count % modulus == 0 && new Date().getTime() > endTime) {\n break;\n }\n var move = movesList[i];\n // use lowest best move value as alpha\n var moveValue = startState.valueMove(move, movesList, depth, bestMovesValue[bestMovesLen-1], BOARD_MAX);\n // insert into best list if needed, and update lastIndex\n lastIndex = binInsert(move, moveValue, lastIndex);\n count++;\n }\n movesList = bestMoves; // use bestMoves as movesList for next layer\n // recalculate layer timeout threshold\n layerMaxTime = listLen * Math.pow(movesList.length, depth+1) / 80;\n // 80 is approximately how many heuristic evals can be done per ms\n }\n // trim to desired length\n bestMoves.length = listLen;\n for (var i = 0; i < bestMoves.length; i++) {\n console.log(bestMoves[i]);\n }\n }\n\n // private helper methods for findBestMoves\n\n /* REQUIRES: move is a move with value moveValue, (bestMoves is sorted in\n * descending order by move values,) and lastIndex is the index of the last\n * (worst) move in bestMoves\n * ENSURES: Inserts the move into bestMoves at the appropriate spot\n * according to its value, and returns the updated lastIndex\n */\n function binInsert(move, moveValue, lastIndex) {\n if (lastIndex == -1) { // no moves yet\n bestMoves[0] = move;\n bestMovesValue[0] = moveValue;\n return ++lastIndex;\n }\n else if (moveValue <= bestMovesValue[lastIndex]) { // can't beat bottom move\n if (lastIndex + 1 < bestMoves.length) { // if empty spaces left\n bestMoves[lastIndex+1] = move;\n bestMovesValue[lastIndex+1] = moveValue;\n return ++lastIndex;\n }\n else { // don't insert; return same index\n return lastIndex;\n }\n }\n else { // beats move at lastIndex; use bin search to find index to insert\n var maxIndex = 0; // lowest index this move could be inserted at\n var minIndex = lastIndex; // highest index || ...\n while (maxIndex < minIndex) {\n var mid = Math.floor((maxIndex + minIndex) / 2);\n if (moveValue <= bestMovesValue[mid]) {\n maxIndex = mid+1;\n }\n else { // moveValue > bestMovesValue[mid]\n minIndex = mid;\n }\n }\n // now maxIndex == minIndex\n bestMoves.splice(maxIndex, 0, move);\n bestMovesValue.splice(maxIndex, 0, moveValue);\n bestMoves.length--; // reset length\n return ++lastIndex;\n }\n }\n\n /*\n * Removes all occurrences of this word and its prefixeds from the movesList\n */\n function removeCurrMoves(word) {\n var state = new GameState(myTurn, board, []);\n for (var i = 0; i < currMovesList.length; i++) {\n if (word.indexOf(state.convertToWord(currMovesList[i])) != -1) {\n currMovesList.splice(i, 1); // remove this word\n }\n }\n }\n\n /* REQUIRES: tstNode is the desired starting node, alphaPool is a pool\n * of letters mapped to positions by mapTileLocations, move is the move\n * constructed so far (represented as a 25-array, initially filled with\n * -1's), and letterNum is the next index to add a letter position in\n * move (i.e. the number (position) of the next letter in the\n * constructed word.\n * ENSURES: Find and returns an array of possible moves, including all\n * positional combinations of each word!\n */\n function findMoves(tstNode, alphaPool, move, letterNum) {\n var moveList = [];\n // get the index for this node's letter\n var alphaIndex = tstNode.letter.charCodeAt(0)-97;\n var alphaNum = alphaPool[alphaIndex].length; // number of letter in pool\n if (alphaNum > 0) { // if pool contains this letter\n var next = tstNode.next;\n // use cascading combo theorem\n for (var alphaNum; alphaNum > 0; alphaNum--) { \n var alphaPoolCopy = new Array(26); // clone the pool\n for (var j = 0; j < 26; j++) {\n alphaPoolCopy[j] = alphaPool[j].slice(0);\n }\n var moveCopy = move.slice(0); // clone the move\n // truncate this letter's pool to length alphaNum\n alphaPoolCopy[alphaIndex].length = alphaNum;\n // remove the ith from the end and add it to the move\n moveCopy[letterNum] = alphaPoolCopy[alphaIndex].pop();\n // if next exists, add moves from further down the TST\n if (next != null) {\n moveList = moveList.concat(findMoves(next, alphaPoolCopy, moveCopy, letterNum+1));\n }\n // if this node ends a word, add the (new) move\n if (tstNode.endsWord) {\n moveList.push(moveCopy);\n }\n }\n }\n // if left exists, add moves from the left node\n var left = tstNode.left;\n if (left != null) {\n moveList = moveList.concat(findMoves(left, alphaPool, move, letterNum));\n }\n // if right exists, add moves from the right node\n var right = tstNode.right;\n if (right != null) {\n moveList = moveList.concat(findMoves(right, alphaPool, move, letterNum));\n }\n // finally, return the whole list\n return moveList;\n }\n\n /* REQUIRES: true\n * ENSURES: returns a 26-array representing the alphabet. Each element\n * is an array of indices of that letter in the board (possibly empty).\n */\n function mapTileLocations() {\n var locs = new Array(26);\n for (var i = 0; i < 26; i++) {\n locs[i] = [];\n }\n for (var i = 0; i < 25; i++) {\n locs[board[i][0].charCodeAt(0) - 97].push(i);\n }\n return locs;\n }\n\n}", "title": "" }, { "docid": "8c931e29bab6f4269ea94e3aaf952673", "score": "0.48138168", "text": "function predictNextPlay(trialOneSequence, winLossTie) {\n var str = collectTrialSequence(2);\n var analyzeWinLossTie = false;\n\n if (winLossTie.length >= trialOneSequence.length / 2) {\n str = predictHelper(str, winLossTie);\n analyzeWinLossTie = true;\n }\n\n if (str.length == 0) {\n return computerRandomMove(); // Can't predict anything from an empty string!\n }\n\n var maxBack = 20 < str.length ? 20 : str.length; // Maximum distance we'll go when creating substring \n var choices = [];\n\n var possibleEntries = [1, 2, 3]; // [Rock, Paper, Scissors]\n var nPossibleEntries = 3;\n var alphaLevel = 1 / nPossibleEntries;\n\n for (var k = 1; k <= maxBack; k++) {\n var re = new RegExp(str.substr(-k), 'g'); // Creates regexp to help search for substring of length k at end of string\n var m;\n var matches = [];\n\n do {\n m = re.exec(str.substr(0, str.length - 1));\n if (m) {\n matches.push(m.index + 1);\n } else {\n break;\n }\n } while (m);\n\n if (matches.length == 0) {\n break;\n }\n\n var entry;\n var rks = ppr = scs = 0;\n for (entry in matches) {\n if (!analyzeWinLossTie) {\n x = parseInt(str.charAt(matches[entry] + k - 1));\n if (x == 1) rks++;\n if (x == 2) ppr++;\n if (x == 3) scs++;\n } else {\n x = parseInt(str.charAt(matches[entry] + k - 1));\n if (x == 1 || x == 2 || x == 3) rks++;\n if (x == 4 || x == 5 || x == 6) ppr++;\n if (x == 7 || x == 9 || x == 9) scs++;\n }\n }\n choices.push([rks, ppr, scs]);\n }\n\n var pVals = [];\n var mins;\n var choice;\n var X, N, P;\n var bcf;\n for (var i = 0; i < choices.length; i++) {\n choice = choices[i];\n X = Math.max(...choice) - 1;\n N = choice[0] + choice[1] + choice[2];\n P = 1 / nPossibleEntries;\n bcf = compute(X, N, P);\n pVals[i] = 1 - bcf;\n }\n\n var predictConfidence = Math.min(...pVals);\n if (predictConfidence >= alphaLevel) {\n return (Math.floor(Math.random() * 3) + 1);\n } else {\n var ind = pVals.indexOf(predictConfidence);\n var i = choices[ind].indexOf(Math.max(...choices[ind]));\n var nextItem = possibleEntries[i];\n }\n\n return nextItem;\n}", "title": "" }, { "docid": "8b4ef4722ff8f0a196273f18ebc6c54b", "score": "0.48127398", "text": "function minimax(newBoard, player){ // The value of origBoard get copied in newBoard\n var availSpots = emptySquares(newBoard); // the argument newBoard will get copied in the origBoard\n\n // returns a value if the terminal state is found (+10, 0, -10)\n if(checkWin(newBoard, huPlayer)){\n return {score: -10}; // If it founds a terminal point at some value with huPlayer it will return an Object with a score property that has value equal to -10\n }\n else if(checkWin(newBoard, aiPlayer)){\n return {score: 10};\n }else if(availSpots.length === 0){ // or it can also happen that their remains no any empty cells \n return {score: 0};\n }\n\n // we'll traverse to each empty spots in the board and call the minimax at each spot\n var moves = [];\n for(var i=0; i<availSpots.length; i++){\n var move = {};\n move.index = newBoard[availSpots[i]]; // newBoard is actual array with the current situation of the board\n newBoard[availSpots[i]] = player; \n if(player == aiPlayer){\n var result = minimax(newBoard, huPlayer);\n move.score = result.score;\n }else{\n var result = minimax(newBoard, aiPlayer);\n move.score = result.score;\n }\n\n newBoard[availSpots[i]] = move.index;\n moves.push(move);\n }\n\n var bestMove;\n\n if(player === aiPlayer){\n var bestScore = -10000;\n for(var i = 0; i<moves.length;i++){\n if(moves[i].score> bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }else{\n var bestScore = 10000;\n for(var i=0; i<moves.length;i++){\n if(moves[i].score< bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n\n return moves[bestMove];\n}", "title": "" }, { "docid": "6fa811df9575e3799fed61e56811dbbf", "score": "0.48064563", "text": "function determiningWinner(playerMoveChosen, computerMoveChoice) {\n if (playerMoveChosen === computerMoveChoice) {\n return \"Noone\";\n } else if (\n (playerMoveChosen === \"paper\" && computerMoveChoice === \"rock\") ||\n (playerMoveChosen === \"rock\" && computerMoveChoice === \"scissors\") ||\n (playerMoveChosen === \"scissors\" && computerMoveChoice === \"paper\")\n ) {\n playerWins++;\n return \"You\";\n } else {\n computerWins++;\n return \"Computer\";\n }\n}", "title": "" }, { "docid": "f9af84fdddb0e682387621790431e91c", "score": "0.48031572", "text": "function gamePlay(playerSelection,computerSelection) {\n let result;\n switch(playerSelection) {\n case \"rock\":\n if (computerSelection===\"paper\") {\n result = \"Paper covers Rock. You Loose!!\";\n } else if (computerSelection===\"rock\") {\n result = \"Tie Game!!\";\n } else {\n result = \"Rock smashes scissors. You Win!!\";\n }\n break;\n case \"paper\":\n if (computerSelection===\"rock\") {\n result = \"Paper covers Rock. You Win!!\";\n } else if (computerSelection===\"paper\") {\n result = \"Tie Game!!\";\n } else {\n result = \"Scissors cuts paper. You Loose!!\";\n }\n break;\n case \"scissors\":\n if (computerSelection===\"paper\") {\n result = \"Scissors cuts paper. You Win!!\";\n } else if (computerSelection===\"scissors\") {\n result = \"Tie Game!!\";\n } else {\n result = \"Rock smashes scissors. You Loose!!\";\n }\n break;\n default:\n result = \"Please check your input\";\n }\n let report=\"Computer has chosen \"+computerSelection+\"<br><br>\" + result;\n report=report.concat(\"<br><br>\");\n if(result.search(\"Win\") >= 0) {\n playerPoints++;\n report=report.concat(\"<br>Your Score : \"+playerPoints+\"<br>Computer's Score : \"+computerPoints);\n } else if (result.search(\"Loose\") >= 0) {\n computerPoints++;\n report=report.concat(\"<br>Your Score : \"+playerPoints+\"<br>Computer's Score : \"+computerPoints);\n } else {\n report=report.concat(\"<br>Your Score : \"+playerPoints+\"<br>Computer's Score : \"+computerPoints);\n }\n if(playerPoints === 5) {\n report=report.concat(\"<br><br>Congratulations. You won the battle.<br><br>\");\n } else if (computerPoints === 5) {\n report=report.concat(\"<br><br>Sorry, you lost this battle. But the war isn't over.<br><br>\");\n }\n computerInfo.innerHTML = report;\n if(playerPoints === 5 || computerPoints === 5) {\n endGame(); \n }\n return result;\n}", "title": "" }, { "docid": "5a0986be2a1cde0c6a04e493d61e182b", "score": "0.48011974", "text": "function makeNextMove() {\n //increment number of moves taken\n movesTaken++;\n //if its over the limit of moves\n if (movesTaken > moveLimit) {\n //update this genomes fitness value using the game score\n genomes[currentGenome].fitness = clone(score);\n //and evaluates the next genome\n evaluateNextGenome();\n } else {\n //time to make a move\n \n //we're going to re-draw, so lets store the old drawing\n var oldDraw = clone(draw);\n draw = false;\n //get all the possible moves\n var possibleMoves = getAllPossibleMoves();\n //lets store the current state since we will update it\n var lastState = getState();\n //whats the next shape to play\n nextShape();\n //for each possible move \n for (var i = 0; i < possibleMoves.length; i++) {\n //get the best move. so were checking all the possible moves, for each possible move. moveception.\n var nextMove = getHighestRatedMove(getAllPossibleMoves());\n //add that rating to an array of highest rates moves\n possibleMoves[i].rating += nextMove.rating;\n }\n //load current state\n loadState(lastState);\n //get the highest rated move ever\n var move = getHighestRatedMove(possibleMoves);\n //then rotate the shape as it says too\n for (var rotations = 0; rotations < move.rotations; rotations++) {\n rotateShape();\n }\n //and move left as it says\n if (move.translation < 0) {\n for (var lefts = 0; lefts < Math.abs(move.translation); lefts++) {\n moveLeft();\n }\n //and right as it says\n } else if (move.translation > 0) {\n for (var rights = 0; rights < move.translation; rights++) {\n moveRight();\n }\n }\n //update our move algorithm\n if (inspectMoveSelection) {\n moveAlgorithm = move.algorithm;\n }\n //and set the old drawing to the current\n draw = oldDraw;\n //output the state to the screen\n output();\n //and update the score\n updateScore();\n }\n }", "title": "" }, { "docid": "36c3e1e1e23825751533747a491c44ff", "score": "0.47983468", "text": "function AIPlayerMove() {\n let PlayLocations = [];\n let PlayLocation = { row: null, col: null };\n\n // Strategy\n let NextPlayer = gameState.Next;\n\n // 1. Check the next move for a win location.\n // Test all empty locations to see if the player can win using it.\n let TestRow = 0;\n let TestCol = 0;\n gameState.board.map(ColArray => {\n TestCol = 0;\n ColArray.map(cell => {\n if (cell === \"\") {\n gameState.board[TestRow][TestCol] = NextPlayer;\n let test = TestForWin(gameState.board);\n if (test === NextPlayer) {\n // add the winning location to the array of choices\n PlayLocations.push({ row: TestRow, col: TestCol });\n }\n gameState.board[TestRow][TestCol] = \"\";\n };\n TestCol++;\n });\n TestRow++;\n });\n\n // 2. Check for a block of the other user, next location\n if (PlayLocations.length === 0) {\n let LastPlayer = gameState.Next === \"X\" ? \"O\" : \"X\";\n TestRow = 0;\n gameState.board.map(ColArray => {\n TestCol = 0;\n ColArray.map(cell => {\n if (cell === \"\") {\n gameState.board[TestRow][TestCol] = LastPlayer;\n let test = TestForWin(gameState.board);\n if (test === LastPlayer) {\n // add the Blocking location to the array of choices\n PlayLocations.push({ row: TestRow, col: TestCol });\n }\n gameState.board[TestRow][TestCol] = \"\";\n };\n TestCol++;\n });\n TestRow++;\n });\n };\n\n // 3. If the center location is available, choose it.\n if (PlayLocations.length === 0 && gameState.board[1][1] === \"\") {\n PlayLocations.push({ row: 1, col: 1 });\n };\n\n // 4. TODO: Setup for a double potential win.\n\n // 5. random select empty cell\n if (PlayLocations.length === 0) {\n TestRow = 0;\n gameState.board.map(ColArray => {\n TestCol = 0;\n ColArray.map(cell => {\n if (cell === \"\") {\n // add the empty location to the array of choices\n PlayLocations.push({ row: TestRow, col: TestCol });\n };\n TestCol++;\n });\n TestRow++;\n });\n };\n \n if (PlayLocations.length > 0) {\n // randomly choose a location from your choices\n let index = Math.floor(Math.random() * PlayLocations.length);\n PlayLocation = { row: PlayLocations[index].row, col: PlayLocations[index].col };\n };\n\n // asign the ai location\n gameState.board[PlayLocation.row][PlayLocation.col] = NextPlayer;\n // change the next X or O\n gameState.Next = gameState.Next === \"X\" ? \"O\" : \"X\";\n // remove the event from the grid so there is no new event\n document.getElementById(`${PlayLocation.row}${PlayLocation.col}`).removeEventListener('click', MainGameLogic);\n // Check to see if we have a winner\n if (CheckForWinner()) {\n // After we have a winner remove the events for remaining squares so they don't fire.\n for (let row = 0; row <= 2; row++) {\n for (let col = 0; col <= 2; col++) {\n if (gameState.board[row][col] === \"\") {\n document.getElementById(`${row}${col}`).removeEventListener('click', MainGameLogic);\n }\n }\n }\n };\n UpdateScreenState();\n}", "title": "" }, { "docid": "e480156c9e430fd5f60322be71dba127", "score": "0.47950095", "text": "function minimax(board, player){\n //available spots\n var available = emptyIndexies(board);\n\n // checks for the terminal states such as win, lose, and tie and returning a value accordingly\n if (winning(board, oPlayer)){\n return {score:-10};\n }\n\telse if (winning(board, xPlayer)){\n return {score:10};\n\t}\n else if (available.length === 0){\n \treturn {score:0};\n }\n\n// an array to collect all the objects\n var moves = [];\n\n // loop through available spots\n for (var i = 0; i < available.length; i++){\n //create an object for each and store the index of that spot that was stored as a number in the object's index key\n var move = {};\n \tmove.index = board[available[i]];\n\n // set the empty spot to the current player\n board[available[i]] = player;\n\n //if collect the score resulted from calling minimax on the opponent of the current player\n if (player == xPlayer){\n var result = minimax(board, oPlayer);\n move.score = result.score;\n }\n else{\n var result = minimax(board, xPlayer);\n move.score = result.score;\n }\n\n //reset the spot to empty\n board[available[i]] = move.index;\n\n // push the object to the array\n moves.push(move);\n }\n\n// if it is the computer's turn loop over the moves and choose the move with the highest score\n var bestMove;\n if(player === xPlayer){\n var bestScore = -10000;\n for(var i = 0; i < moves.length; i++){\n if(moves[i].score > bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }else{\n\n// else loop over the moves and choose the move with the lowest score\n var bestScore = 10000;\n for(var i = 0; i < moves.length; i++){\n if(moves[i].score < bestScore){\n bestScore = moves[i].score;\n bestMove = i;\n }\n }\n }\n\n// return the chosen move (object) from the array to the higher depth\n return moves[bestMove];\n}", "title": "" }, { "docid": "4a62bac03a09446dd02f8e91160d051b", "score": "0.47932583", "text": "PrMove(move) {\n var MvStr;\n var ff = this.def.FilesBrd[this.def.FROMSQ(move)];\n var rf = this.def.RanksBrd[this.def.FROMSQ(move)];\n var ft = this.def.FilesBrd[this.def.TOSQ(move)];\n var rt = this.def.RanksBrd[this.def.TOSQ(move)];\n MvStr = this.def.FileChar[ff] + this.def.RankChar[rf] + this.def.FileChar[ft] + this.def.RankChar[rt];\n var promoted = this.def.PROMOTED(move);\n if (promoted != this.def.piece.EMPTY) {\n var pchar = 'q';\n if (this.def.PieceKnight[promoted] == this.def.BOOL.TRUE) {\n pchar = 'n';\n }\n else if (this.def.PieceRookQueen[promoted] == this.def.BOOL.TRUE && this.def.PieceBishopQueen[promoted] == this.def.BOOL.FALSE) {\n pchar = 'r';\n }\n else if (this.def.PieceRookQueen[promoted] == this.def.BOOL.FALSE && this.def.PieceBishopQueen[promoted] == this.def.BOOL.TRUE) {\n pchar = 'b';\n }\n MvStr += pchar;\n }\n return MvStr;\n }", "title": "" }, { "docid": "539a5962275ff6cb5d3c216cf325a21e", "score": "0.4791777", "text": "function minimax(newBoard, player){\n //console.log(\"newBoard: \",newBoard)\n\t \n\t //available spots\n\t var availSpots = emptyIndexes(newBoard);\n\n\t // checks for the terminal states such as win, lose, and tie \n\t //and returning a value accordingly\n\t if (winning(newBoard, huPlayer)){\n\t\t return {score:-10};\n\t }\n\t\telse if (winning(newBoard, aiPlayer)){\n\t\treturn {score:10};\n\t\t}\n\t else if (availSpots.length === 0){\n\t\treturn {score:0};\n\t }\n\t \n // an array to collect all the objects\n\t var moves = [];\n\n\t // loop through available spots\n\t for (var i = 0; i < availSpots.length; i++){\n\t\t//create an object for each and store the index of that spot \n\t\tvar move = {};\n\t\tmove.index = newBoard[availSpots[i]];\n\n\t\t// set the empty spot to the current player\n\t\tnewBoard[availSpots[i]] = player;\n\n\t\t/*collect the score resulted from calling minimax \n\t\t on the opponent of the current player*/\n\t\tif (player == aiPlayer){\n\t\t var result = minimax(newBoard, huPlayer);\n\t\t move.score = result.score;\n\t\t}\n\t\telse{\n\t\t var result = minimax(newBoard, aiPlayer);\n\t\t move.score = result.score;\n\t\t}\n\n\t\t// reset the spot to empty\n\t\tnewBoard[availSpots[i]] = move.index;\n\n\t\t// push the object to the array\n\t\tmoves.push(move);\n\t }\n\n\t // if it is the computer's turn loop over the moves and choose the move with the highest score\n\t var bestMove;\n\t if(player === aiPlayer){\n\t\tvar bestScore = -10000;\n\t\tfor(var i = 0; i < moves.length; i++){\n\t\t if(moves[i].score > bestScore){\n\t\t\tbestScore = moves[i].score;\n\t\t\tbestMove = i;\n\t\t }\n\t\t}\n\t }else{\n\t // else loop over the moves and choose the move with the lowest score\n\t\tvar bestScore = 10000;\n\t\tfor(var i = 0; i < moves.length; i++){\n\t\t if(moves[i].score < bestScore){\n\t\t\tbestScore = moves[i].score;\n\t\t\tbestMove = i;\n\t\t }\n\t\t}\n\t }\n\n\t // return the chosen move (object) from the moves array\n\t return moves[bestMove];\n\t}", "title": "" }, { "docid": "b989fb38cb283661bf5376118f7b619b", "score": "0.4784437", "text": "function win_senario(playerWin)\n{\n\ttextSize(32);\n\t// the color of the player used for the text\n\tif (playerWin == 2)\n\t{\n\t\tfill(211, 2, 41);\n\t\tstroke(211, 2, 41);\n\t}\n\telse // if second player win\n\t{\n\t\tfill(0, 93, 80);\n\t\tstroke(0, 93, 80);\n\t}\n\t// record move for later use \n\tactionRowHTML(\"Player \" + playerWin + \" win the Game\");\n\t// show wining text\n\ttext(\"player \" + playerWin + \" win!\", GAME_WIDTH / 2, GAME_HEIGHT / 2);\n\t// download game history for train later\n\tgameHistory.add_win(playerWin);\n\t\n\t// if Q-learning ai, update policy\n\tif (aiPlayerName == \"hard\")\n\t{\n\t\taiPlayer.online_learn_policy(gameHistory);\n\t}\n\t// download the results of the game for AI learning offline \n\tgameHistory.download();\n\n\t// stop draw loop for a bit\n\tnoLoop();\n\t// wait a bit for drama and re-start the game\n\tsetTimeout(function (){\n\t\tnew_game();\n\t\tloop();\n\t}, 2000);\n}", "title": "" }, { "docid": "4eb326258e253e481f18a74389f88ab0", "score": "0.47799325", "text": "function playRound(playerChoice) {\n\tlet computerChoice = computerPlay();\n\tlet winner = getRoundWinner(playerChoice, computerChoice);\n\n\tif (winner=='player') playerWinCount++;\n\telse if (winner=='computer') compWinCount++;\n\n\tprintMssgs(playerChoice, computerChoice, winner);\n\n\tif (round > 5) addPlayAgainButton();\n}", "title": "" }, { "docid": "055e26486321b440e27c509146b89195", "score": "0.47758546", "text": "function matchResults() {\n\n\n\n if(opponent.value == 1 /*psg*/){\n goalsLiverpoolTrue = 3;\n goalsOpponentTrue = 2;\n goalMinuteTrue = 30;\n yellowsTrue = 2;\n firstGoalscorerTrue = 8;\n RedTrue = 0;\n\n lineupTrue = [4, 25, 16, 26, 5, 12, 15, 13, 18, 7, 23];\n\n }\n else if(opponent.value == 2 /*everton*/){\n goalsLiverpoolTrue = 0;\n goalsOpponentTrue = 0;\n goalMinuteTrue = 100;\n yellowsTrue = 0;\n firstGoalscorerTrue = 1;\n RedTrue = 0;\n\n lineupTrue = [4, 25, 16, 26, 5, 12, 15, 13, 18, 7, 23];\n\n }\n\n else if(opponent.value == 3 /*burnley*/){\n goalsLiverpoolTrue = 2;\n goalsOpponentTrue = 1;\n goalMinuteTrue = 61;\n yellowsTrue = 0;\n firstGoalscorerTrue = 24;\n RedTrue = 0;\n\n lineupTrue = [24, 25, 8, 26, 5, 12, 15, 13, 3, 10, 23];\n\n }\n\n else if(opponent.value == 4 /*leicester*/){\n goalsLiverpoolTrue = 2;\n goalsOpponentTrue = 1;\n goalMinuteTrue = 10;\n yellowsTrue = 5;\n firstGoalscorerTrue = 24;\n RedTrue = 0;\n\n lineupTrue = [4, 25, 16, 26, 5, 12, 15, 13, 18, 22, 23];\n\n }\n\n else if(opponent.value == 5 /*southampton*/){\n goalsLiverpoolTrue = 3;\n goalsOpponentTrue = 0;\n goalMinuteTrue = 10;\n yellowsTrue = 2;\n firstGoalscorerTrue = 29;\n RedTrue = 0;\n\n lineupTrue = [4, 25, 14, 26, 5, 12, 27, 13, 18, 7, 23];\n\n }\n}", "title": "" }, { "docid": "9724a1bcbac8270a6d2bd0b8b5662c7c", "score": "0.47755742", "text": "perform(board){\n\n\t\tvar p = board.at(this.from);\n\n\n\t\tif(this.type === Type.None){\n\t\t\t// Simple pick and (re)place\n\t\t\t// Handled by the code outside the if statements\n\t\t}\n\t\telse if((this.type & Type.Promotion) !== 0){\n\t\t\t// Promote piece\n\t\t\tvar promoType = this.type % Type.Promotion;\n\t\t\tp = new Piece(promoType, p.color, true);\n\t\t}\n\t\telse if(this.type === Type.EnPassant){\n\t\t\t// Capture\n\t\t\tboard.at(new Position(this.to.x, this.from.y), null);\n\t\t}\n\t\telse if(this.type === Type.Castling){\n\n\t\t\tvar rank = this.from.y;\n\t\t\tvar dir = this.to.x - this.from.x;\n\n\t\t\tvar castleFrom, castleTo;\n\n\t\t\tif(dir < 0){\n\t\t\t\tcastleFrom = new Position(0, rank);\n\t\t\t\tcastleTo = new Position(this.to.x + 1, rank);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcastleFrom = new Position(7, rank);\n\t\t\t\tcastleTo = new Position(this.to.x - 1, rank);\n\t\t\t}\n\n\n\t\t\tvar castle = board.at(castleFrom);\n\t\t\tcastle.moved = true;\n\t\t\tboard.at(castleFrom, null);\n\t\t\tboard.at(castleTo, castle);\n\t\t}\n\t\telse{\n\t\t\t// Throw error?\n\t\t}\n\n\n\t\t// Move the main piece\n\t\tp.moved = true;\n\t\tboard.at(this.from, null);\n\t\tboard.at(this.to, p);\n\t}", "title": "" }, { "docid": "466776e34b4484a535431d15840120c3", "score": "0.47744262", "text": "function train( state, move ) {\n\tlet player = state.currentPlayer;\n\t// Make sure move is an object with unit class\n\tif ( typeof move != \"object\" ) {\n\t\tstate.players[player].errors++;\n\t\treturn state;\n\t}\n\tif ( typeof move.class != \"string\" ) {\n\t\tstate.players[player].errors++;\n\t\treturn state;\n\t}\n\n\t// Check that there is enough food to train unit\n\tvar cost, unit;\n\tswitch( move.class ) {\n\t\tcase \"farmer\":\n\t\t\t// Only allow one farmer per player at a time\n\t\t\tfor ( var i = 0; i < state.players[player].units.length; i++ ) {\n\t\t\t\tif ( state.players[player].units[i].class == \"farmer\" ) {\n\t\t\t\t\tstate.players[player].errors++;\n\t\t\t\t\treturn state;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcost = 400;\n\t\t\tunit = {\n\t\t\t\tclass: \"farmer\", hp: 40, attack: 0, range: 0, hasFood: false, canMove: true,\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"soldier\":\n\t\t\tcost = 450;\n\t\t\tunit = {\n\t\t\t\tclass: \"soldier\", hp: 60, attack: 15, range: 1, canMove: true,\n\t\t\t};\n\t\t\tbreak;\n\t\tcase \"archer\":\n\t\t\tcost = 500;\n\t\t\tunit = {\n\t\t\t\tclass: \"archer\", hp: 50, attack: 10, range: 2, canMove: true,\n\t\t\t};\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate.players[player].errors++;\n\t\t\treturn state;\n\t}\n\tif ( state.players[player].food < cost ) {\n\t\tstate.players[player].errors++;\n\t\treturn state;\n\t}\n\n\t// Check for an open space around the keep\n\tvar keepX, keepY;\n\tfor ( var row = 0; row < MAP_SIZE; row++ ) {\n\t\tfor ( var col = 0; col < MAP_SIZE; col++ ) {\n\t\t\tif ( state.map[row][col].type == \"keep\" &&\n\t\t\t\t state.map[row][col].style == player ) {\n\t\t\t\tkeepX = col; keepY = row;\n\t\t\t\trow = col = MAP_SIZE;\n\t\t\t}\n\t\t}\n\t}\n\tvar space = freeAround( state, keepX, keepY );\n\tif ( space == false ) {\n\t\tstate.players[player].errors++;\n\t\treturn state;\n\t}\n\tunit.x = space.x;\n\tunit.y = space.y;\n\n\t// Create unit\n\tstate.players[player].units.push( unit );\n\tstate.players[player].food -= cost;\n\n\treturn state;\n}", "title": "" }, { "docid": "1f429fbb7298c78e287003a180b2d896", "score": "0.47711244", "text": "function MoveSummary () {\n this.moves = [];\n this.sources = {};\n}", "title": "" }, { "docid": "5d5136d6c986f20859d027ebc14f18f1", "score": "0.47702527", "text": "function makeMatches(){\n//\tWave in progress\n\tif (!canPlaceTower){\n\t\ttowerArr.forEach(function(tower){\n//\t\t\tGet sprites in the towers quad\n\t\t\tbool = false;\n\t\t\tspriteArr.forEach(function(sprite){\n//\t\t\t\tSprite is in range of the tower and it has gone through its reload period\n\t\t\t\tif (tower.canAttack(sprite)){\n\t\t\t\t\ttower.spriteChooseMethod(sprite);\n\t\t\t\t\tbool = true;\n\t\t\t\t}\n\t\t\t});\n//\t\t\tif a target has been assigned then attack it\t\t\t\n\t\t\tif (bool) tower.attackSprite();\n\t\t});\n\t}\n}", "title": "" } ]
9a9ea01da357cfd6d75e1af4d5336299
Retrieve a function object by hardware id, updating the indexes on the fly if needed
[ { "docid": "014d5f91a08bf347ab662321f57d64cf", "score": "0.0", "text": "function YAPI_setFunction(str_className, str_func, obj_func)\n {\n if(this._fnByType[str_className] == undefined)\n this._fnByType[str_className] = new YFunctionType(str_className);\n return this._fnByType[str_className].setFunction(str_func, obj_func);\n }", "title": "" } ]
[ { "docid": "33f93ea4926265ad4b8b10cd513ed76b", "score": "0.6064808", "text": "function YFunction_nextFunction()\n { var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) return null;\n var next_hwid = YAPI.getNextHardwareId(this._className, resolve.result);\n if(next_hwid == null) return null;\n return YFunction.FindFunction(next_hwid);\n }", "title": "" }, { "docid": "aafc09a5c971501865545adffa4186f1", "score": "0.5909594", "text": "function YDevice_functionId(int_idx)\n {\n if(int_idx < this._functions.length) {\n return this._functions[int_idx][0];\n }\n return \"\";\n }", "title": "" }, { "docid": "81d66195ce1a08d6613207a7a2b3be49", "score": "0.5745416", "text": "function get_function(id) {\n var proto;\n var func = function_map[id];\n if (func === undefined) {\n proto = proto_map[id];\n if (proto === undefined)\n throw new Error('dispatch: unknown Glk function: ' + id);\n func = build_function(proto);\n function_map[id] = func;\n }\n return func;\n}", "title": "" }, { "docid": "bd59ebf53bcc335e6588f4b93f0ce9f4", "score": "0.5632992", "text": "function YFunctionType_resolve(str_func)\n {\n var dotpos = str_func.indexOf(\".\");\n var res;\n if(dotpos < 0) {\n // First case: str_func is the logicalname of a function\n res = this._hwIdByName[str_func];\n if(res != undefined) {\n return {errorType:YAPI_SUCCESS, \n errorMsg:\"no error\", \n result:String(res)};\n }\n\n // fallback to assuming that str_func is a logicalname or serial number of a module\n // with an implicit function name (like serial.module for instance)\n dotpos = str_func.length;\n str_func += \".\"+this._className.substr(0,1).toLowerCase()+this._className.substr(1);\n }\n\n // Second case: str_func is in the form: device_id.function_id\n\n // quick lookup for a known pure hardware id\n if(this._valueByHwId[str_func] != undefined) {\n return {errorType:YAPI_SUCCESS, \n errorMsg:\"no error\", \n result:String(str_func)};\n }\n if(dotpos>0) {\n\n // either the device id is a logical name, or the function is unknown\n var devid = str_func.substr(0,dotpos);\n var funcid = str_func.substr(dotpos+1);\n var dev = YAPI.getDevice(devid);\n if(!dev) {\n return {errorType:YAPI_DEVICE_NOT_FOUND, \n errorMsg:\"Device [\"+devid+\"] not online\",\n result:null};\n }\n var serial = dev.getSerialNumber();\n res = serial+\".\"+funcid;\n if(this._valueByHwId[res] != undefined) {\n return {errorType:YAPI_SUCCESS, \n errorMsg:\"no error\", \n result:String(res)};\n }\n\n // not found neither, may be funcid is a function logicalname\n var i, nfun = dev.functionCount();\n for(i = 0; i < nfun; i++) {\n res = serial+\".\"+dev.functionId(i);\n var name = this._nameByHwId[res];\n if(name != undefined && name == funcid) {\n return {errorType:YAPI_SUCCESS, \n errorMsg:\"no error\", \n result:String(res)};\n }\n }\n } else {\n funcid = str_func.substr(1);\n for (var hwid_str in this._connectedFns){\n var pos = hwid_str.indexOf(\".\");\n var str_function = hwid_str.substr(pos+1);\n if(str_function == funcid) {\n return {errorType:YAPI_SUCCESS, \n errorMsg:\"no error\", \n result:String(hwid_str)};\n }\n }\n }\n return {errorType:YAPI_DEVICE_NOT_FOUND, \n errorMsg:\"No function [\"+funcid+\"] found on device [\"+serial+\"]\",\n result:null};\n }", "title": "" }, { "docid": "03f4fdc8be7f66a6cf24401e54b62c06", "score": "0.5549642", "text": "imm_getFunctionValue(str_hwid) {\n var classname = this.imm_functionClass(str_hwid);\n return this._fnByType[classname].imm_getFunctionValue(str_hwid);\n }", "title": "" }, { "docid": "a9438f0760b583d871749cb56122f142", "score": "0.5521044", "text": "function find(id, callback) {\n core.api('GET', '/functions/' + id, {}, callback);\n }", "title": "" }, { "docid": "6bfc44a3fda4f3c2e4d580bbeb562da4", "score": "0.55149543", "text": "imm_getNextHardwareId(str_className, str_hwid) {\n if (Y_BASETYPES[str_className] == undefined) {\n // enumeration of a regular function type\n return this._fnByType[str_className].imm_getNextHardwareId(str_hwid);\n }\n // enumeration of an abstract class\n var baseType = Y_BASETYPES[str_className];\n var prevclass = this.imm_functionClass(str_hwid);\n var res = this._fnByType[prevclass].imm_getNextHardwareId(str_hwid);\n if (res != undefined) return res;\n for (str_className in this._fnByType) {\n if (prevclass != '') {\n if (str_className != prevclass) continue;\n prevclass = '';\n continue;\n }\n if (this._fnByType[str_className].imm_getBaseType() == baseType) {\n res = this._fnByType[str_className].imm_getFirstHardwareId();\n if (res != undefined) return res;\n }\n }\n return null;\n }", "title": "" }, { "docid": "b28217daf8a601b3f5432de5a4c3492e", "score": "0.5507195", "text": "getHardware(targetIndex) {\n const target = this.getTarget(targetIndex);\n const item = this.data.find((v) => v.provider == target.provider && v.instance == target.instance);\n\n return item;\n }", "title": "" }, { "docid": "e701ae7d90dc8b5e08cf8207e610d9dc", "score": "0.5400162", "text": "function getIDFunction(id) {\n getID(id)\n }", "title": "" }, { "docid": "dd61531dbc85c27c00584bd93c47730d", "score": "0.5367579", "text": "function YSensor_FindSensor(func) // class method\n {\n var obj; // YSensor;\n obj = YFunction._FindFromCache(\"Sensor\", func);\n if (obj == null) {\n obj = new YSensor(func);\n YFunction._AddToCache(\"Sensor\", func, obj);\n }\n return obj;\n }", "title": "" }, { "docid": "94e768d33bc61cc38dadbfbc143eeba2", "score": "0.53601795", "text": "function YFunction_get_functionDescriptor()\n {\n // try to resolve the function name to a device id without query\n if(this._hwId != \"\") {\n return this._hwId;\n }\n var hwid = this._func;\n if(hwid.indexOf(\".\") < 0) {\n var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) hwid = resolve.result;\n }\n var dotidx = hwid.indexOf(\".\");\n if(dotidx >= 0) {\n return hwid;\n }\n return Y_FUNCTIONDESCRIPTOR_INVALID;\n }", "title": "" }, { "docid": "35203636fca8ae94fa53b69914e2e469", "score": "0.5295073", "text": "function YAPI_getFunctionValue(str_hwid)\n {\n var classname = this.functionClass(str_hwid);\n return this._fnByType[classname].getFunctionValue(str_hwid);\n }", "title": "" }, { "docid": "e8e325be8c010a52c9a7757c4830dbd2", "score": "0.52883595", "text": "function YFunction_FirstFunction()\n {\n var next_hwid = YAPI.getFirstHardwareId('Function');\n if(next_hwid == null) return null;\n return YFunction.FindFunction(next_hwid);\n }", "title": "" }, { "docid": "c315e570993b457fb9d972c2ebf5df75", "score": "0.5280448", "text": "function YDevice_updateFromYP(obj_ypRecs)\n {\n var funidx = 0;\n for(var categ in obj_ypRecs) {\n for(var key in obj_ypRecs[categ]) {\n var rec = obj_ypRecs[categ][key];\n var hwid = rec[\"hardwareId\"];\n var dotpos = hwid.indexOf(\".\");\n if(hwid.substr(0,dotpos) == this._serialNumber) {\n var funydx = rec[\"index\"];\n if(funydx == undefined) funydx = funidx;\n this._functions[funydx] = [hwid.substr(dotpos+1), rec[\"logicalName\"]];\n funidx++;\n }\n }\n } \n }", "title": "" }, { "docid": "30286e7ad3d7937c6acd91be7e95ed88", "score": "0.52658254", "text": "function getFunction(ptr) {\n return wrapFunction(table.get(ptr), setargc);\n }", "title": "" }, { "docid": "95939f3b5815f222ffe29d67e63bde8a", "score": "0.52451396", "text": "function getSelector(func) {\n\tconst abiInterface = new ethers.utils.Interface([func]);\n\treturn abiInterface.getSighash(ethers.utils.Fragment.from(func));\n}", "title": "" }, { "docid": "bb1f24d4ea653d170f52126291ebf37d", "score": "0.5242855", "text": "function getIndex(data, id) {}", "title": "" }, { "docid": "11b8520b68792c39898165fbeb282cd6", "score": "0.5217782", "text": "function getFunctionOfUserByIdInDB(id) {\n let query = 'select distinct functions.* from users, roles, roles_func, functions where users.role_id = roles.id and roles.id = roles_func.role_id and roles_func.func_id = functions.id and users.id = $1'\n return new Promise((resolve, reject) => {\n db.query(query, [id], (error, results) => {\n if (error) {\n reject(error);\n }\n resolve(results.rows)\n })\n });\n}", "title": "" }, { "docid": "a4d96d84175f14bbeeb8205c7b1926f1", "score": "0.5195255", "text": "fromIdentifier(id) {\n if (this.index.hasOwnProperty(id)) {\n return this.index[id];\n } else {\n throw new Error(`No stability with id \"${id}\"`);\n }\n }", "title": "" }, { "docid": "135078da4910985547ff01b98386c265", "score": "0.5183756", "text": "function YAPI_getNextHardwareId(str_className, str_hwid)\n { \n if(Y_BASETYPES[str_className] == undefined) {\n // enumeration of a regular function type\n return this._fnByType[str_className].getNextHardwareId(str_hwid);\n }\n // enumeration of an abstract class\n var baseType = Y_BASETYPES[str_className];\n var prevclass = this.functionClass(str_hwid);\n var res = this._fnByType[prevclass].getNextHardwareId(str_hwid);\n if(res != undefined) return res;\n for(str_className in this._fnByType) {\n if(prevclass != \"\") {\n if(str_className != prevclass) continue;\n prevclass = \"\";\n continue;\n }\n if(this._fnByType[str_className].getBaseType() == baseType) {\n res = this._fnByType[str_className].getFirstHardwareId();\n if(res != undefined) return res;\n }\n }\n return null;\n }", "title": "" }, { "docid": "727cbb6f7b0591c5156f59373c368fcf", "score": "0.5157426", "text": "function YFunction_get_hardwareId()\n {\n if(this._hwId != \"\") {\n return this._hwId;\n }\n var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) {\n this.isOnline();\n resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) {\n return this._throw(resolve.errorType, resolve.errorMsg, Y_HARDWAREID_INVALID);\n }\n }\n return resolve.result;\n }", "title": "" }, { "docid": "150bb6146498b1c6dabd282d1fac21cc", "score": "0.5156025", "text": "function YFunctionType_getFirstHardwareId()\n {\n var res = null;\n for(res in this._valueByHwId) break;\n return res;\n }", "title": "" }, { "docid": "911c64771643164495b2aa347f2c97b6", "score": "0.5127286", "text": "function YFunctionType_getFunctionValue(str_hwid)\n {\n return this._valueByHwId[str_hwid];\n }", "title": "" }, { "docid": "5fb9caae7a0b7f6df1e068e39172f7ab", "score": "0.51041603", "text": "getDeviceAPI(name) {\n if (name == \"deviceAllocDataSpace\") {\n return (nbytes) => {\n return this.deviceAllocDataSpace(nbytes);\n };\n }\n else if (name == \"deviceFreeDataSpace\") {\n return (ptr) => {\n return this.deviceFreeDataSpace(ptr);\n };\n }\n else if (name == \"deviceCopyToGPU\") {\n return (from, to, toOffset, nbytes) => {\n this.deviceCopyToGPU(from, to, toOffset, nbytes);\n };\n }\n else if (name == \"deviceCopyFromGPU\") {\n return (from, fromOffset, to, nbytes) => {\n this.deviceCopyFromGPU(from, fromOffset, to, nbytes);\n };\n }\n else if (name == \"deviceCopyWithinGPU\") {\n return (from, fromOffset, to, toOffset, nbytes) => {\n this.deviceCopyWithinGPU(from, fromOffset, to, toOffset, nbytes);\n };\n }\n else {\n throw new Error(\"Unknown DeviceAPI function \" + name);\n }\n }", "title": "" }, { "docid": "793ead148d20ff8f9488ca54b3204ee9", "score": "0.509292", "text": "function yFindSensor(func)\n{\n return YSensor.FindSensor(func);\n}", "title": "" }, { "docid": "37b1b5dae43b49e0bf1d997a840f8e35", "score": "0.5085198", "text": "imm_reindexDevice(obj_dev) {\n var rootUrl = obj_dev.imm_getRootUrl();\n var serial = obj_dev.imm_getSerialNumber();\n var lname = obj_dev.imm_getLogicalName();\n this._devs[serial] = obj_dev;\n this._snByUrl[rootUrl] = serial;\n if (lname != '') this._snByName[lname] = serial;\n this._fnByType['Module'].imm_reindexFunction(serial + '.module', lname, null, null);\n var i,\n count = obj_dev.imm_functionCount();\n for (i = 0; i < count; i++) {\n var funcid = obj_dev.imm_functionId(i);\n if (funcid != '') {\n var funcname = obj_dev.imm_functionName(i);\n var classname = this.imm_functionClass(funcid);\n this._fnByType[classname].imm_reindexFunction(serial + '.' + funcid, funcname, null, null);\n }\n }\n }", "title": "" }, { "docid": "c1e8ba4eac6055dd10159ae434c47181", "score": "0.5081906", "text": "function getIdIndex(id) {\n var index = config.devices.findIndex( (ele) => {\n return ele.devid == id;\n });\n \n return index\n}", "title": "" }, { "docid": "e3462f47ccee435a24733430f4e5d8f1", "score": "0.5054857", "text": "function YFunction_get_module()\n {\n // try to resolve the function name to a device id without query\n if(this._serial != \"\") {\n return yFindModule(this._serial + \".module\"); \n }\n var hwid = this._func;\n var resolve;\n if(hwid.indexOf(\".\") < 0) {\n resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType == YAPI_SUCCESS) hwid = resolve.result;\n }\n var dotidx = hwid.indexOf(\".\");\n if(dotidx >= 0) {\n // resolution worked\n return yFindModule(hwid.substr(0, dotidx) + \".module\");\n }\n\n // device not resolved for now, force a communication for a last chance resolution\n if(this.load(YAPI.defaultCacheValidity) == YAPI_SUCCESS) {\n resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.result != undefined) hwid = resolve.result;\n }\n dotidx = hwid.indexOf(\".\");\n if(dotidx >= 0) {\n // resolution worked\n return yFindModule(hwid.substr(0, dotidx) + \".module\");\n }\n // return a true yFindModule object even if it is not a module valid for communicating\n return yFindModule(\"module_of_\"+this.className+\"_\"+this._func);\n }", "title": "" }, { "docid": "7f41582d38bff8f5aaae4bf5e5e5876e", "score": "0.5041534", "text": "function YDevice_functionName(int_idx)\n {\n if(int_idx < this._functions.length) {\n return this._functions[int_idx][1];\n }\n return \"\";\n }", "title": "" }, { "docid": "3eb5d39f2fbf15bb45fde0b879ebc056", "score": "0.50034034", "text": "function YFunctionType_getFunction(str_func)\n {\n var funres = this.resolve(str_func);\n if(funres.errorType == YAPI_SUCCESS) {\n // the function has been located on a device\n var conn_fn = this._connectedFns[funres.result];\n if(conn_fn != undefined) return conn_fn;\n\n var req_fn = this._requestedFns[str_func];\n if(req_fn != undefined) {\n this._connectedFns[funres.result] = req_fn;\n delete this._requestedFns[str_func];\n }\n return req_fn;\n } else {\n // the function is still abstract\n return this._requestedFns[str_func];\n }\n }", "title": "" }, { "docid": "f58ac6a3368829d7994d8db2c2efbfa4", "score": "0.49920884", "text": "function YFunction_FindFunction(func) // class method\n {\n var obj; // YFunction;\n obj = YFunction._FindFromCache(\"Function\", func);\n if (obj == null) {\n obj = new YFunction(func);\n YFunction._AddToCache(\"Function\", func, obj);\n }\n return obj;\n }", "title": "" }, { "docid": "406165ac106f735fd09a9d5a28cf8ca0", "score": "0.49821514", "text": "generateFunctionMap() {\n return {\n //DRIVER\n DriverCreated: {\n fn: DriverES.handleDriverCreated$,\n obj: DriverES\n },\n DriverGeneralInfoUpdated: {\n fn: DriverES.handleDriverGeneralInfoUpdated$,\n obj: DriverES\n },\n DriverStateUpdated: {\n fn: DriverES.handleDriverStateUpdated$,\n obj: DriverES\n },\n DriverAuthCreated: {\n fn: DriverES.handleDriverAuthCreated$,\n obj: DriverES\n },\n DriverAuthDeleted: {\n fn: DriverES.handleDriverAuthDeleted$,\n obj: DriverES\n },\n VehicleAssigned: {\n fn: DriverES.handleVehicleAssigned$,\n obj: DriverES\n },\n VehicleUnassigned: {\n fn: DriverES.handleVehicleUnassigned$,\n obj: DriverES\n },\n DriverBlockAdded: {\n fn: DriverES.handleDriverBlockAdded$,\n obj: DriverES\n },\n DriverBlockRemoved: {\n fn: DriverES.handleDriverBlockRemoved$,\n obj: DriverES\n },\n //VEHICLE\n VehicleCreated: {\n fn: VehicleES.handleVehicleCreated$,\n obj: VehicleES\n },\n VehicleGeneralInfoUpdated: {\n fn: VehicleES.handleVehicleGeneralInfoUpdated$,\n obj: VehicleES\n },\n VehicleStateUpdated: {\n fn: VehicleES.handleVehicleStateUpdated$,\n obj: VehicleES\n },\n VehicleFeaturesUpdated: {\n fn: VehicleES.handleVehicleFeaturesUpdated$,\n obj: VehicleES\n },\n VehicleBlockRemoved: {\n fn: VehicleES.handleVehicleBlockRemoved$,\n obj: VehicleES\n },\n VehicleBlockAdded: {\n fn: VehicleES.handleVehicleBlockAdded$,\n obj: VehicleES\n },\n VehicleSubscriptionTypeUpdated: {\n fn: VehicleES.handleVehicleSubscriptionTypeUpdated$,\n obj: VehicleES\n },\n\n //CLIENT\n ClientSatelliteEnabled: {\n fn: ClientES.handleClientSatelliteEnabled$,\n obj: ClientES\n },\n EndClientCreated: {\n fn: ClientES.handleEndClientCreated$,\n obj: ClientES\n },\n ClientCreated: {\n fn: ClientES.handleEndClientCreated$,\n obj: ClientES\n },\n ClientSatelliteIdUpdated: {\n fn: ClientES.handleClientSatelliteIdUpdated$,\n obj: ClientES\n },\n ClientSatelliteInfoUpdated: {\n fn: ClientES.handleClientSatelliteInfoUpdated$,\n obj: ClientES\n },\n DriverAssociatedToClient: {\n fn: ClientES.handleDriverAssociatedToClient$,\n obj: ClientES\n },\n ClientGeneralInfoUpdated: {\n fn: ClientES.handleClientGeneralInfoUpdated$,\n obj: ClientES\n },\n\n //SERVICE\n ServiceRequested: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceAssigned: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServicePickUpETAReported: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceLocationReported: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceArrived: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServicePassengerBoarded: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceCompleted: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceDropOffETAReported: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceCancelledByDriver: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceCancelledByClient: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceCancelledByOperator: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n ServiceClosed: { fn: ServiceES.handleServiceEvents$, obj: ServiceES },\n // SHIFT\n ShiftLocationReported: { fn: ServiceES.handleShiftEvents$, obj: ServiceES },\n // CRONJOB\n PeriodicOneMinute: {\n fn: CronJobES.handlePeriodicOneMinute$,\n obj: CronJobES\n },\n PeriodicFiveMinutes: {\n fn: CronJobES.handlePeriodicFiveMinutes$,\n obj: CronJobES\n },\n PeriodicFifteenMinutes: {\n fn: CronJobES.handlePeriodicFifteenMinutes$,\n obj: CronJobES\n },\n PeriodicMonthly: {\n fn: CronJobES.handlePeriodicMonthly$,\n obj: CronJobES\n },\n // // WALLET\n // WalletUpdated: {\n // fn: WalletES.handleWalletUpdated$,\n // obj: WalletES\n // }\n // BUSINESS\n BusinessGeneralInfoUpdated: {\n fn: BusinessES.handleBusinessGeneralInfoUpdated$,\n obj: BusinessES\n },\n\n };\n }", "title": "" }, { "docid": "74567d3273b795785e2f3a722d9fd729", "score": "0.4982075", "text": "imm_getFirstHardwareId(str_className) {\n if (Y_BASETYPES[str_className] == undefined) {\n // enumeration of a regular function type\n if (this._fnByType[str_className] == undefined) this._fnByType[str_className] = new YFunctionType(this, str_className);\n return this._fnByType[str_className].imm_getFirstHardwareId();\n }\n // enumeration of an abstract class\n var baseType = Y_BASETYPES[str_className];\n var res;\n for (str_className in this._fnByType) {\n if (this._fnByType[str_className].imm_getBaseType() == baseType) {\n res = this._fnByType[str_className].imm_getFirstHardwareId();\n if (res != undefined) return res;\n }\n }\n return null;\n }", "title": "" }, { "docid": "b9f17e99319bb0de47fc749b017546e0", "score": "0.49784148", "text": "function YMotor_FindMotor(func) // class method\n {\n var obj; // YMotor;\n obj = YFunction._FindFromCache(\"Motor\", func);\n if (obj == null) {\n obj = new YMotor(func);\n YFunction._AddToCache(\"Motor\", func, obj);\n }\n return obj;\n }", "title": "" }, { "docid": "e94915c3d8149e2c1f6eccbb4c1d428b", "score": "0.4970779", "text": "function getKeyFunc(trace) {\n if (trace.ids) {\n return keyFunc;\n }\n }", "title": "" }, { "docid": "8c255db519138d8443da970ea1654f14", "score": "0.49637", "text": "function get(id){\n var pos = _map.indexOf(id);\n return pos >= 0 ? _stack[pos].obj : null;\n }", "title": "" }, { "docid": "8bfb6780dba0ee2a107c5ba8bf997ae5", "score": "0.4941845", "text": "function YDevice_functionValue(int_idx)\n {\n if(int_idx < this._functions.length) {\n return YAPI.getFunctionValue(this._serialNumber+\".\"+this._functions[int_idx][0]);\n }\n return \"\";\n }", "title": "" }, { "docid": "95dc7bef00e6f3c04c8c96a7ca1f1dd7", "score": "0.49180448", "text": "function funId(x) { return x }", "title": "" }, { "docid": "4e3234bd045deb90c03501618c14a8f3", "score": "0.49091512", "text": "function YFunctionType_getNextHardwareId(str_hwid)\n {\n for(var iter_hwid in this._valueByHwId) {\n if(str_hwid == \"!\")\n return iter_hwid;\n if(str_hwid == iter_hwid)\n str_hwid = \"!\";\n }\n return null; // no more instance found\n }", "title": "" }, { "docid": "73901d152b2aa1da1aa5e72f00da1074", "score": "0.49022236", "text": "generateFunctionMap() {\n return {\n 'DeviceGeneralInformationReported': { fn: deviceGeneralInformation.handleDeviceGeneralInformationReportedEvent$, obj: deviceGeneralInformation },\n 'EvalDisconnectedDevicesJobTriggered': { fn: evalDisconnectedDevicesJob.handleEvalDisconnectedDevicesJobTriggeredEvent$, obj: evalDisconnectedDevicesJob },\n };\n }", "title": "" }, { "docid": "7de0dea12e1f1e117b62984863212969", "score": "0.48988366", "text": "function getKeyFunc(trace) {\n\t if(trace.ids) {\n\t return keyFunc;\n\t }\n\t }", "title": "" }, { "docid": "544f994c0e7b62f94925c8b47f1392e2", "score": "0.48909798", "text": "function getFuncByOrder(order) {\n\tfor (var i = 0; i < NUM_FUNCTIONS; i++)\n\t\tif(functionArr[i].order == order) return functionArr[i];\n}", "title": "" }, { "docid": "599f21247a077105f5f87c81b6d425ad", "score": "0.48875463", "text": "static getByID(id){\n\t\treturn new Promise((next) => {\n\t\t\tdb.query('SELECT * FROM open_space WHERE id = ?', [id])\n\t\t\t\t.then((result) => {\n\t\t\t\t\tif(result[0] != undefined)\n\t\t\t\t\t\tnext(result[0])\n\t\t\t\t\telse\n\t\t\t\t\t\tnext(new Error(config.errors.unknownID))\n\t\t\t\t})\n\t\t\t\t.catch((err) => reject(err))\n\t\t})\n\t}", "title": "" }, { "docid": "9fd0d8b60faeb8d7b65b39c8511a82fc", "score": "0.48856923", "text": "function YFunctionType_reindexFunction(str_hwid, str_name, str_val, int_basetype)\n {\n var currname = this._nameByHwId[str_hwid];\n var res = false;\n if(currname == undefined || currname == \"\") {\n if(str_name != \"\") {\n this._nameByHwId[str_hwid] = str_name;\n res = true;\n }\n } else if(currname != str_name) {\n if(this._hwIdByName[currname] == str_hwid)\n delete this._hwIdByName[currname];\n if(str_name != \"\") {\n this._nameByHwId[str_hwid] = str_name;\n } else {\n delete this._nameByHwId[str_hwid];\n }\n res = true;\n }\n if(str_name != \"\") {\n this._hwIdByName[str_name] = str_hwid;\n }\n if(str_val != undefined) {\n this._valueByHwId[str_hwid] = str_val;\n } else {\n if(this._valueByHwId[str_hwid] == undefined) {\n this._valueByHwId[str_hwid] = \"\";\n }\n }\n if(int_basetype != undefined) {\n if(this._baseType == 0) {\n this._baseType = int_basetype;\n }\n }\n return res;\n }", "title": "" }, { "docid": "cedfb5a4fd95790d3df3c00166b3dc5a", "score": "0.48830605", "text": "getColumnIndexById(id){\n var idFilter = (element) => element.id == id;\n return this.columns.findIndex(idFilter);\n }", "title": "" }, { "docid": "81ab6b8ccbaea6491541561141b1a5b7", "score": "0.4882186", "text": "imm_resolveFunction(str_className, str_func) {\n if (Y_BASETYPES[str_className] == undefined) {\n // using a regular function type\n if (this._fnByType[str_className] == undefined) this._fnByType[str_className] = new YFunctionType(this, str_className);\n return this._fnByType[str_className].imm_resolve(str_func);\n }\n // using an abstract baseType\n var baseType = Y_BASETYPES[str_className];\n var res;\n for (str_className in this._fnByType) {\n if (this._fnByType[str_className].imm_getBaseType() == baseType) {\n res = this._fnByType[str_className].imm_resolve(str_func);\n if (res.errorType == YAPI_SUCCESS) return res;\n }\n }\n return { errorType: YAPI_DEVICE_NOT_FOUND,\n errorMsg: 'No ' + str_className + ' [' + str_func + '] found (old firmware?)',\n result: null };\n }", "title": "" }, { "docid": "cf743d9d69167b4d4cfcda826c3a693d", "score": "0.48641807", "text": "function yFindMotor(func)\n{\n return YMotor.FindMotor(func);\n}", "title": "" }, { "docid": "2752028e8f817cdca724bbfbfeb48691", "score": "0.4830487", "text": "function rememberFunction (id) {\n\t\tallFunctions.push(id);\n\t}", "title": "" }, { "docid": "ed119430bea0d91cd5ffa4a68343dcac", "score": "0.48277998", "text": "function byId() {\n return byKey('id');\n}", "title": "" }, { "docid": "d5d7910409a37e745db0151728bc67ef", "score": "0.47802138", "text": "function getNode(id) {\n \tvar node, index;\n\n \tfor (var k in $scope.inodes) {\n \t\tif (k == \"route\") break;\n \t\tif ($scope.inodes[k]._id == id) {\n \t\t\tnode = $scope.inodes[k];\n \t\t\tindex = k;\n \t\t\tbreak;\n \t\t}\n \t}\n\n \treturn {\n \t\tindex: index,\n \t\tnode: node\n \t};\n }", "title": "" }, { "docid": "3dc1fa08006e01f9a3029a64a04786c2", "score": "0.4772813", "text": "static find(obj, func) {\r\n return this.findValue(obj, func);\r\n }", "title": "" }, { "docid": "05293c25bdd7ef1a832dc69974892158", "score": "0.47702634", "text": "function YDataSet_get_hardwareId()\n {\n var mo; // YModule;\n if (!(this._hardwareId == \"\")) {\n return this._hardwareId;\n }\n mo = this._parent.get_module();\n this._hardwareId = \"\"+mo.get_serialNumber()+\".\"+this.get_functionId();\n return this._hardwareId;\n }", "title": "" }, { "docid": "3197256fb46a6b8d141e91932b02922d", "score": "0.4766628", "text": "lookup(id) {\n return this.map[id];\n }", "title": "" }, { "docid": "cc2c810b186b767bb4497aba08f2b6e0", "score": "0.47657645", "text": "function getHandle(id) {\n console.log(myHandles);\n for (i in myHandles) {\n if (myHandles[i].ID == id)\n return myHandles[i];\n }\n return null;\n}", "title": "" }, { "docid": "7c86dad2554baaabc1151eea5e7b3c7c", "score": "0.47613838", "text": "function element16(arr, fn) {\n return function() {\n return arr[fn()];\n };\n}", "title": "" }, { "docid": "5648ae8327d5f82465e2f5863509b36c", "score": "0.47572422", "text": "function newFunction(fn) {\n if (typeof fn.original === \"function\") fn = fn.original;\n var index = table.length;\n table.grow(1);\n table.set(index, fn);\n return index;\n }", "title": "" }, { "docid": "753cdaa335073c4d9ccc0a2a2f225ee6", "score": "0.4750254", "text": "function getMachine(id) {\n if (id.charAt(0) == 'R') {\n for (var i = 0; i < robots.length; i++) {\n if (robots[i].id == id) {\n return robots[i];\n }\n }\n\n console.log('Robot with id ' + id + ' not found!!');\n\n } else {\n for (var i = 0; i < cars.length; i++) {\n if (cars[i].id == id) {\n return cars[i];\n }\n }\n\n console.log('Car with id ' + id + ' not found!!');\n }\n}", "title": "" }, { "docid": "cf094e2570acb144533759b1089f50fd", "score": "0.4741558", "text": "function getElement(func) {\n if (typeof func !== 'function') return null;\n return func();\n}", "title": "" }, { "docid": "cf094e2570acb144533759b1089f50fd", "score": "0.4741558", "text": "function getElement(func) {\n if (typeof func !== 'function') return null;\n return func();\n}", "title": "" }, { "docid": "cec2d8bbea9eda41fd00ebcd4ea76eea", "score": "0.474046", "text": "function YFunctionType_setFunction(str_func, obj_func)\n {\n var funres = this.resolve(str_func);\n if(funres.result != undefined) {\n // the function has been located on a device\n this._connectedFns[funres.result] = obj_func;\n } else {\n // the function is still abstract\n this._requestedFns[str_func] = obj_func;\n }\n }", "title": "" }, { "docid": "690c0dfacd555c73e46fa3b039985850", "score": "0.47389075", "text": "function YAPI_reindexDevice(obj_dev)\n {\n var rootUrl = obj_dev.getRootUrl();\n var serial = obj_dev.getSerialNumber();\n var lname = obj_dev.getLogicalName();\n this._devs[serial] = obj_dev;\n this._snByUrl[rootUrl] = serial;\n if(lname != \"\") this._snByName[lname] = serial;\n this._fnByType[\"Module\"].reindexFunction(serial+\".module\", lname, null, null);\n var i, count = obj_dev.functionCount();\n for(i = 0; i < count; i++) {\n var funcid = obj_dev.functionId(i);\n var funcname = obj_dev.functionName(i);\n var classname = this.functionClass(funcid);\n this._fnByType[classname].reindexFunction(serial+\".\"+funcid, funcname, null, null);\n }\n }", "title": "" }, { "docid": "250183256bc989c5a3165ebd73a45184", "score": "0.4736927", "text": "function YAPI_getFirstHardwareId(str_className)\n {\n if(Y_BASETYPES[str_className] == undefined) {\n // enumeration of a regular function type\n if(this._fnByType[str_className] == undefined)\n this._fnByType[str_className] = new YFunctionType(str_className);\n return this._fnByType[str_className].getFirstHardwareId();\n }\n // enumeration of an abstract class\n var baseType = Y_BASETYPES[str_className];\n var res;\n for(str_className in this._fnByType) {\n if(this._fnByType[str_className].getBaseType() == baseType) {\n res = this._fnByType[str_className].getFirstHardwareId();\n if(res != undefined) return res;\n }\n }\n return null;\n }", "title": "" }, { "docid": "d2702c51c2a58e46b04db1dbdf9be631", "score": "0.47274932", "text": "idToFunc(id){\n switch(id){\n case ID_FUNC_DISPOSER_DISPOSE: return this.dispose;\n default: return null;\n }\n }", "title": "" }, { "docid": "c5f69d10162db0bc5695c83d76e2aaf5", "score": "0.47220343", "text": "function yFindLed(str_func)\n{\n return YLed.FindLed(str_func);\n}", "title": "" }, { "docid": "d64b4115e7a2739d6ac8878237fb2d02", "score": "0.4713689", "text": "function findNode(id){\n return nodes[id];\n}", "title": "" }, { "docid": "82861b7b10a4ee0eefd618400dd5aab3", "score": "0.46992937", "text": "get this[int]() {}", "title": "" }, { "docid": "129f7d4998ee693ac9be6d61323ea16d", "score": "0.46946216", "text": "function findIndexById(id){\n\tfor (let i = 0; i < catalog.length; i++) {\n\t\tif (catalog[i].id == id) return i;\n\t}\n\t//return i = catalog.findIndex(function(e){if (e.id == id) return e;});\n}", "title": "" }, { "docid": "0743c73daa69314011bf5335bce5c8a0", "score": "0.46812218", "text": "function run_function(mod, function_idx, params) {\n if (DEBUG) {\n console.log(\"EXECUTING: \");\n for (let pp = 0; pp < mod.funcs[function_idx].code.length; pp++) {\n console.log(pp + \": 0x\" + mod.funcs[function_idx].code[pp].toString(16));\n }\n }\n let old_func = mod.funcs[function_idx];\n\n // Validate parameters\n if (old_func.type.params.length != params.length) {\n console.log(\"mismatching number of params for function \" + function_idx);\n return -1;\n }\n\n for (let i = 0; i < params.length; i++) {\n if (params[i].type != old_func.type.params[i]) {\n console.log(\"Invalid parameter type for function \" + function_idx + \". expected: \"\n + old_func.type.params[i] + \". Got: \" + params[i].type + \".\");\n return -1;\n }\n }\n\n\n let new_type = new FunctionType(old_func.type.params, old_func.type.returns);\n let new_locs = params;\n for (let lcl = 0; lcl < old_func.locals.length; lcl++) {\n let new_lcl = new Variable(old_func.locals[lcl].type, 0);\n new_locs.push(new_lcl);\n }\n let func = new FunctionInstance(new_type, new_locs, old_func.code);\n\n // push the function frame onto the stack\n mod.stack.push(new Variable(frame_type, 0));\n\n let frame_ptr = mod.stack.ptr();\n\n // push the params onto the stack and locals\n params.forEach((el) => {\n mod.stack.push(el);\n });\n\n\n let labels = [];\n\n // execute the code\n let code_ptr = 0;\n let type;\n let label;\n let ret_val;\n let idx;\n let top_val;\n let val1;\n let val2;\n let popped;\n let popped_val;\n let offset;\n let align;\n let mem;\n let opt;\n let opts;\n let buf;\n let ea;\n let i;\n let c;\n let nb_lz;\n let nb_tz;\n let nb_nzb;\n let c1;\n let c2;\n let res;\n let N;\n let k;\n let sz;\n let b;\n let dataview;\n let call_params;\n let rets;\n let ret_type;\n let new_var;\n let next_taint = {};\n let new_taint;\n while (code_ptr < func.code.length) {\n op_code = func.code[code_ptr];\n if (DEBUG) {\n console.log(\"---------------------------------------------------------------\");\n mod.stack.print();\n console.log(\"\");\n mod.memories[0].print();\n console.log(\"\\nLABLES:\");\n for (let as = 0; as < labels.length; as++) {\n console.log(\"lbl \" + as + \": type: \" + labels[as].block_type +\" taint: \" + JSON.stringify(labels[as].taint));\n }\n console.log(\"\");\n console.log(\"evaluating opcode: 0x\" +op_code.toString(16) + \" at: \" + code_ptr)\n console.log(\"\");\n }\n switch (op_code) {\n\n // control instruction op codes\n case unreachable_op_code:\n return TRAP_CODE;\n case nop_op_code:\n // Do nothing\n code_ptr++;\n break;\n case block_op_code:\n // get block type\n code_ptr++;\n type = func.code[code_ptr];\n code_ptr++;\n if (labels.length > 0 && TRACK_TAINT) {\n new_taint = add_label_taint({}, labels[0]);\n } else {\n new_taint = {};\n }\n labels.unshift(\n {\n block_type: block_op_code,\n ret_type: type,\n start: code_ptr-2,\n taint: new_taint\n }\n );\n mod.stack.push(new Variable(label_type, 0));\n break;\n case loop_op_code:\n // get block type\n code_ptr++;\n type = func.code[code_ptr];\n code_ptr++;\n if (labels.length > 0 && TRACK_TAINT) {\n new_taint = add_label_taint({}, labels[0]);\n } else {\n new_taint = {};\n }\n labels.unshift(\n {\n block_type: loop_op_code,\n ret_type: type,\n start: code_ptr-2,\n taint: add_label_taint(new_taint, {taint: next_taint})\n }\n );\n next_taint = {};\n mod.stack.push(new Variable(label_type, 0));\n break;\n case if_op_code:\n code_ptr++;\n let test_val = mod.stack.pop();\n if (test_val.type != int32_type) {\n console.log(\"invalid test type at the top of the stack\");\n return -1;\n }\n\n type = func.code[code_ptr];\n if (labels.length > 0 && TRACK_TAINT) {\n new_taint = add_label_taint({}, labels[0]);\n } else {\n new_taint = {};\n }\n if (test_val.value != 0) {\n // get block type\n code_ptr++;\n labels.unshift(\n {\n block_type: if_op_code,\n ret_type: type,\n start: code_ptr-2,\n taint: add_label_taint(new_taint, test_val)\n }\n );\n mod.stack.push(new Variable(label_type, 0));\n } else {\n // skip to either end or else\n let to_skip = 1;\n while (to_skip > 0) {\n code_ptr++;\n if (func.code[code_ptr] == if_op_code || func.code[code_ptr] == block_op_code || func.code[code_ptr] == loop_op_code) {\n to_skip++;\n }\n else if (func.code[code_ptr] == expression_end_code) {\n to_skip--;\n }\n if (func.code[code_ptr] == else_op_code && to_skip == 1) {\n to_skip--;\n }\n }\n if (func.code[code_ptr] == else_op_code) {\n // get block type\n labels.unshift(\n {\n block_type: if_op_code,\n ret_type: type,\n start: code_ptr-2,\n taint: add_label_taint(new_taint, test_val)\n }\n );\n mod.stack.push(new Variable(label_type, 0));\n }\n code_ptr++;\n }\n break;\n case else_op_code:\n // skip until end\n while (func.code[code_ptr] != expression_end_code) {\n code_ptr++;\n }\n break;\n case expression_end_code:\n // if end of function\n if (code_ptr == func.code.length -1) {\n if (mod.stack.len() < func.type.returns.length + 1) {\n console.log(\"not enough values on stack when returning\");\n return -1;\n }\n\n // get return values\n rets = [];\n for (popped = 0; popped < func.type.returns.length; popped++) {\n rets.push(mod.stack.pop());\n if (rets[0].type != func.type.returns[popped]) {\n console.log(\"invalid value popped from the stack during a return\");\n return -1;\n }\n }\n\n // clear function frame from stack\n popped_val = mod.stack.pop();\n while (popped_val.type != frame_type) {\n popped_val = mod.stack.pop();\n }\n\n // push results back onto the frame\n rets.forEach((ret_val) => {\n mod.stack.push(ret_val);\n });\n\n return rets;\n }\n label = labels.shift();\n ret_val = null;\n if (label.ret_type != empty_result_type) {\n if (mod.stack.len() <= 0) {\n console.log(\"stack is empty at label end\");\n return -1;\n }\n ret_val = mod.stack.pop();\n if (ret_val.type != label.ret_type) {\n console.log(\"invalid value on top of stack at the end of an expression\");\n return -1;\n }\n }\n if (mod.stack.len() <= 0) {\n console.log(\"stack is empty at label end\");\n return -1;\n }\n let stack_label = mod.stack.pop();\n if (stack_label.type != label_type) {\n console.log(\"stack_label missing at the end of expression\");\n return -1;\n }\n if (ret_val != null) {\n mod.stack.push(ret_val);\n }\n code_ptr++;\n\n break;\n case br_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (labels.length < idx) {\n console.log(\"invalid break. label index is wrong\");\n return -1;\n }\n label = labels[idx];\n ret_val = null;\n if (label.ret_type != empty_result_type) {\n if (mod.stack.len() <= 0) {\n console.log(\"stack is empty at label end\");\n return -1;\n }\n ret_val = mod.stack.pop();\n if (ret_val.type != label.ret_type) {\n console.log(\"invalid value on top of stack at the end of an expression\");\n return -1;\n }\n }\n popped = 0;\n while (popped < idx+1) {\n if (mod.stack.len() <= 0) {\n console.log(\"not enough labels on stack\");\n return -1;\n }\n let stack_label = mod.stack.pop();\n if (stack_label.type == label_type) {\n popped++;\n }\n }\n if (ret_val != null) {\n mod.stack.push(ret_val);\n }\n\n // remove old labels\n for (let lbl = 0; lbl <= idx; lbl++) {\n labels.shift();\n }\n\n if (label.block_type == loop_op_code) {\n code_ptr = label.start;\n }\n // go to the end of the block\n else {\n code_ptr = skip_to_end(func.code, code_ptr, popped);\n }\n\n break;\n case br_if_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (labels.length < idx) {\n console.log(\"invalid break. label index is wrong\");\n return -1;\n }\n\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -2;\n }\n\n top_val = mod.stack.pop();\n if (top_val.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n if (top_val.value != 0) {\n label = labels[idx];\n ret_val = null;\n if (label.ret_type != empty_result_type) {\n if (mod.stack.len() <= 0) {\n console.log(\"stack is empty at label end\");\n return -1;\n }\n ret_val = mod.stack.pop();\n if (ret_val.type != label.ret_type) {\n console.log(\"invalid value on top of stack at the end of an expression\");\n return -1;\n }\n }\n popped = 0;\n while (popped < idx+1) {\n if (mod.stack.len() <= 0) {\n console.log(\"not enough labels on stack\");\n return -1;\n }\n let stack_label = mod.stack.pop();\n if (stack_label.type == label_type) {\n popped++;\n }\n }\n if (ret_val != null) {\n mod.stack.push(ret_val);\n }\n\n // remove old labels\n for (let lbl = 0; lbl <= idx; lbl++) {\n labels.shift();\n }\n\n if (label.block_type == loop_op_code) {\n code_ptr = label.start;\n next_taint = label.taint;\n } else {\n // go to the end of the block\n code_ptr = skip_to_end(func.code, code_ptr, popped);\n }\n } else {\n if (TRACK_TAINT) {\n labels[idx].taint = add_label_taint(labels[idx].taint, top_val);\n }\n }\n break;\n case br_table_op_code:\n code_ptr++;\n // get labels\n let op_labels = [];\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n let num_labels = decode.value;\n for (k = 0; k < num_labels; k++) {\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n let lbl = decode.value;\n op_labels.push(lbl);\n }\n\n // get default index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (labels.length < idx) {\n console.log(\"invalid break. label index is wrong\");\n return -1;\n }\n\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -2;\n }\n\n top_val = mod.stack.pop();\n if (top_val.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n if (top_val.value < op_labels.length) {\n idx = op_labels[top_val.value];\n }\n\n label = labels[idx];\n ret_val = null;\n if (label[ret_type] != empty_result_type) {\n if (mod.stack.len() <= 0) {\n console.log(\"stack is empty at label end\");\n return -1;\n }\n ret_val = mod.stack.pop();\n if (ret_val.type != label[ret_type]) {\n console.log(\"invalid value on top of stack at the end of an expression\");\n return -1;\n }\n }\n popped = 0;\n while (popped < idx+1) {\n if (mod.stack.len() <= 0) {\n console.log(\"not enough labels on stack\");\n return -1;\n }\n let stack_label = mod.stack.pop();\n if (stack_label.type == label_type) {\n popped++;\n }\n }\n if (ret_val != null) {\n mod.stack.push(ret_val);\n }\n\n // remove old labels\n for (let lbl = 0; lbl <= idx; lbl++) {\n labels.shift();\n }\n\n\n if (label.block_type == loop_op_code) {\n code_ptr = label.start;\n next_taint = label.taint;\n }\n // go to the end of the block\n else {\n code_ptr = skip_to_end(func.code, code_ptr, popped);\n }\n break;\n case return_op_code:\n if (mod.stack.len() < func.type.returns.length + 1) {\n console.log(\"not enough values on stack when returning\");\n return -1;\n }\n\n // get return values\n rets = [];\n for (popped = 0; popped < func.type.returns.length; popped++) {\n rets.push(mod.stack.pop());\n if (rets[0].type != func.type.returns[popped]) {\n console.log(\"invalid value popped from the stack during a return\");\n return -1;\n }\n }\n\n // clear function frame from stack\n popped_val = mod.stack.pop();\n while (popped_val.type != frame_type) {\n popped_val = mod.stack.pop();\n }\n\n // push results back onto the frame\n rets.forEach((ret_val) => {\n mod.stack.push(ret_val);\n });\n\n return rets;\n case call_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (idx >= mod.funcs.length) {\n console.log(\"Invalid function index in call operations\");\n return -1;\n }\n\n // get params\n if (mod.stack.len() < mod.funcs[idx].type.params.length) {\n console.log(\"not enough values on stack when calling a function\");\n return -1;\n }\n\n call_params = [];\n for (popped = 0; popped < mod.funcs[idx].type.params.length; popped++) {\n call_params.unshift(mod.stack.pop());\n if (call_params[0].type != mod.funcs[idx].type.params[popped]) {\n console.log(\"invalid value popped from the stack during a function call\");\n return -1;\n }\n }\n\n rets = run_function(mod, idx, call_params);\n if (rets == -1) {\n console.log(\"function call failed\");\n return -1;\n }\n\n break;\n case call_indirect_op_code:\n code_ptr++;\n if (mod.tables.length < 1) {\n console.log(\"tried to do an indirect function call without tables\");\n return -1;\n }\n\n // get type_idx\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (idx >= mod.funcs.length) {\n console.log(\"invalid function index in call indirect\");\n return -1;\n }\n\n // sanity check\n if (func.code[code_ptr] != 0x00) {\n console.log(\"malformed call indirect code\");\n return -1;\n }\n code_ptr++;\n\n let table_idx = mod.stack.pop();\n if (table_idx.type != int32_type) {\n console.log(\"invalid table index on top of stack in call indirect\");\n return -1;\n }\n\n if (mod.tables[0].elements[table_index] == undefined) {\n console.log(\"hit an uninitialzed table element in call indirect\");\n return -1;\n }\n\n if (mod.tables[0].elements[table_index] != idx) {\n console.log(\"malformed call indirect\");\n return -1;\n }\n\n if (idx >= mod.funcs.length) {\n console.log(\"Invalid function index in call operations\");\n return -1;\n }\n\n // get params\n if (mod.stack.len() < mod.funcs[idx].type.params.length) {\n console.log(\"not enough values on stack when calling a function\");\n return -1;\n }\n\n call_params = [];\n for (popped = 0; popped < mod.funcs[idx].type.params.length; popped++) {\n call_params.unshift(mod.stack.pop());\n if (call_params[0].type != mod.funcs[idx].type.params[popped]) {\n console.log(\"invalid value popped from the stack during a function call\");\n return -1;\n }\n }\n\n rets = run_function(mod, idx, call_params);\n if (rets == -1) {\n console.log(\"function call failed\");\n return -1;\n }\n\n break;\n\n // parametric op codes\n case drop_op_code:\n if (mod.stack.len() <= 0) {\n console.log(\"tried to drop from an empty stack\");\n return -1;\n }\n mod.stack.pop();\n code_ptr++;\n break;\n case select_op_code:\n if (mod.stack.len() < 3) {\n console.log(\"tried to select from a too-empty stack\");\n return -1;\n }\n let cond = mod.stack.pop();\n let var2 = mod.stack.pop();\n let var1 = mod.stack.pop();\n if (cond.type != int32_type) {\n console.log(\"invalid condition variable in select operation\");\n return -1;\n }\n if (var1.type != var2.type) {\n console.log(\"mismatching value types in select operation\");\n return -1;\n }\n if (cond.value == 0) {\n if (TRACK_TAINT) {\n var2.transfer_indirect_taint(cond);\n transfer_block_taint(labels, var2);\n }\n mod.stack.push(var2);\n } else {\n if (TRACK_TAINT) {\n var1.transfer_indirect_taint(cond);\n transfer_block_taint(labels, var1);\n }\n mod.stack.push(var1);\n }\n code_ptr++;\n break;\n\n // variable op codes\n case get_local_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (func.locals.length <= idx) {\n console.log(\"Invalid local index. locals len is: \" + func.locals.length + \". idx is: \" + idx);\n return -1;\n }\n mod.stack.push(mod.stack.get(idx + frame_ptr + 1));\n break;\n case set_local_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (func.locals.length <= idx) {\n console.log(\"Invalid local index. locals len is: \" + func.locals.length + \". idx is: \" + idx);\n return -1;\n }\n\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in set local\");\n return -1;\n }\n\n mod.stack.set(idx + frame_ptr + 1, mod.stack.pop());\n break;\n case tee_local_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (func.locals.length <= idx) {\n console.log(\"Invalid local index. locals len is: \" + func.locals.length + \". idx is: \" + idx);\n return -1;\n }\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in tee local\");\n return -1;\n }\n let popped_value = mod.stack.pop();\n mod.stack.set(idx + frame_ptr + 1, popped_value);\n mod.stack.push(popped_value);\n break;\n case get_global_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (mod.globals.length <= idx) {\n console.log(\"Invalid global index. locals len is: \" + mod.globals.length + \". idx is: \" + idx);\n return -1;\n }\n new_var = new Variable(mod.globals[idx].type, mod.globals[idx].value, mod.globals[idx].taint);\n mod.stack.push(new_var);\n break;\n case set_global_op_code:\n code_ptr++;\n // get index\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n idx = decode.value;\n if (mod.globals.length <= idx) {\n console.log(\"Invalid global index. locals len is: \" + mod.globals.length + \". idx is: \" + idx);\n return -1;\n }\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in set global\");\n return -1;\n }\n if (!mod.globals[idx].mutable) {\n console.log(\"trying to set unmutable global\");\n return -1;\n }\n popped_val = mod.stack.pop()\n mod.globals[idx].value = popped_val.value;\n if (TRACK_TAINT) {\n mod.globals[idx].taint = popped_val.taint;\n }\n break;\n\n // memory instruction op codes\n case i32_load_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 32;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n // read buffer with little endian storage\n dataView = new DataView(buf.buffer);\n c = dataView.getUint32(0, true);\n if (c > Math.pow(2, N-1)) {\n c -= Math.pow(2, N);\n }\n // push loaded value to the stack\n new_var = new Variable(int32_type, c);\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 64;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n // read buffer with little endian storage\n opt = {\n endian : 'little',\n size : 8\n };\n c = Bignum.fromBuffer(buf, opt);\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, c);\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case f32_load_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_load_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_load8_s_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 8;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint8(0, true);\n if (c > Math.pow(2, N-1)) {\n c -= Math.pow(2, N);\n }\n\n // push loaded value to the stack\n new_var = new Variable(int32_type, c);\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i32_load8_u_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 8;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint8(0, true);\n\n // push loaded value to the stack\n new_var = new Variable(int32_type, c);\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i32_load16_s_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 16;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint16(0, true);\n if (c > Math.pow(2, N-1)) {\n c -= Math.pow(2, N);\n }\n // push loaded value to the stack\n new_var = new Variable(int32_type, c);\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i32_load16_u_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 16;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint16(0, true);\n\n // push loaded value to the stack\n new_var = new Variable(int32_type, c);\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load8_s_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 8;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint8(0, true);\n if (c > Math.pow(2, N-1)) {\n c -= Math.pow(2, N);\n }\n\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, Bignum.bignum(c));\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load8_u_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 8;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint8(0, true);\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, Bignum.bignum(c));\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load16_s_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 16;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint16(0, true);\n if (c > Math.pow(2, N-1)) {\n c -= Math.pow(2, N);\n }\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, Bignum.bignum(c));\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load16_u_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 16;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint16(0, true);\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, Bignum.bignum(c));\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load32_s_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 32;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint32(0, true);\n if (c > Math.pow(2, N-1)) {\n c -= Math.pow(2, N);\n }\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, Bignum.bignum(c));\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i64_load32_u_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in load op\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during load\");\n return -1;\n }\n ea = i.value + offset;\n N = 32;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // read memory\n buf = mem.slice(ea, ea + N/8);\n dataView = new DataView(buf.buffer);\n c = dataView.getUint32(0, true);\n\n // push loaded value to the stack\n new_var = new Variable(int64_type, Bignum.bignum(c));\n // transfer taint from memory to the new variable and from the index\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(i);\n for (let j = 0; j < N/8; j++) {\n let taint = mod.memories[0].getTaint(ea + j);\n new_var.transfer_from_taint(taint);\n }\n }\n mod.stack.push(new_var);\n break;\n\n case i32_store_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 32;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // write buffer\n buf = new Uint8Array(N/8);\n dataView = new DataView(buf.buffer);\n dataView.setUint32(0, c.value, true);\n // store buffer to memory\n mem.set(buf, ea);\n if (TRACK_TAINT) {\n // propagate taint to the memory dict for the right index\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n case i64_store_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n if (!Bignum.isBigNum(c.value)) {\n console.log(\"expecting bignum on stack in store 64\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 64;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n // write buffer\n opt = {\n endian : 'little',\n size : 8\n };\n buf = c.value.toBuffer(opt);\n // store buffer to memory\n mem.set(buf, ea);\n if (TRACK_TAINT) {\n // propagate taint to the memory dict for the right index\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n case f32_store_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_store_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_store8_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 8;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n n = c.value % Math.pow(2, N);\n // write buffer\n buf = new Uint8Array(N/8);\n dataView = new DataView(buf.buffer);\n dataView.setUint8(0, n, true);\n\n // store buffer to memory\n mem.set(buf, ea);\n if (TRACK_TAINT) {\n // propagate taint to the memory dict for the right index\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n\n case i32_store16_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 16;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n n = c.value % Math.pow(2, N);\n // write buffer\n buf = new Uint8Array(N/8);\n dataView = new DataView(buf.buffer);\n dataView.setUint16(0, n, true);\n\n // store buffer to memory\n mem.set(buf, ea);\n if (TRACK_TAINT) {\n // propagate taint to the memory dict for the right index\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n\n case i64_store8_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n if (!Bignum.isBigNum(c.value)) {\n console.log(\"expecting bignum on stack in store 64\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 8;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n n = c.value.mod(Math.pow(2, N)).toNumber();\n // write buffer\n buf = new Uint8Array(N/8);\n dataView = new DataView(buf.buffer);\n dataView.setUint8(0, n, true);\n\n // store buffer to memory\n mem.set(buf, ea);\n if (TRACK_TAINT) {\n // propagate taint to the memory dict for the right index\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n\n case i64_store16_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n if (!Bignum.isBigNum(c.value)) {\n console.log(\"expecting bignum on stack in store 64\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 16;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n n = c.value.mod(Math.pow(2, N)).toNumber();\n // write buffer\n buf = new Uint8Array(N/8);\n dataView = new DataView(buf.buffer);\n dataView.setUint16(0, n, true);\n\n // store buffer to memory\n mem.set(buf, ea);\n if (TRACK_TAINT) {\n // propagate taint to the memory dict for the right index\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n\n case i64_store32_op_code:\n code_ptr++;\n // get memarg, start with align\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n align = decode.value;\n // then get offset\n decode = Leb.decodeUInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n offset = decode.value;\n\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n if (mod.stack.len() <= 1) {\n console.log(\"Empty stack in store op\");\n return -1;\n }\n // get value to be stored from stack\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n if (!Bignum.isBigNum(c.value)) {\n console.log(\"expecting bignum on stack in store 64\");\n return -1;\n }\n // get mem idx from stack\n i = mod.stack.pop();\n if (i.type != int32_type) {\n console.log(\"mismatching type in stack variable during store\");\n return -1;\n }\n ea = i.value + offset;\n N = 32;\n if (ea + N/8 > mem.length) {\n console.log(\"trying to read unset memory addr during store\");\n return -1;\n }\n if (ea < 0) {\n ea += mem.length;\n }\n n = c.value.mod(Math.pow(2,N)).toNumber();\n // write buffer\n buf = new Uint8Array(N/8);\n dataView = new DataView(buf.buffer);\n dataView.setUint32(0, n, true);\n\n // store buffer to memory\n mem.set(buf, ea);\n // propagate taint to the memory dict for the right index\n if (TRACK_TAINT) {\n for (let j = 0; j < N/8; j++) {\n mod.memories[0].taintInit(ea + j);\n mod.memories[0].receive_taint_variable(c, ea + j);\n mod.memories[0].receive_indirect_taint_variable(i, ea + j);\n }\n }\n break;\n\n case current_memory_op_code:\n code_ptr++;\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n\n sz = mem.length / MemoryInstance.page_size; // defined in memory instancce\n\n // push size to the stack\n new_var = new Variable(int32_type, sz);\n mod.stack.push(new_var);\n break;\n\n case grow_memory_op_code:\n code_ptr++;\n // get memory instance\n if (!mod.memories[0]) {\n console.log(\"trying to read unset memory instace\");\n return -1;\n }\n mem = mod.memories[0].bytes;\n sz = mem.length / MemoryInstance.page_size; // defined in memory instancce\n\n if (mod.stack.len() <= 0) {\n console.log(\"Empty stack in grow mem op\");\n return -1;\n }\n // get size of memory growth from stack\n n = mod.stack.pop();\n if (n.type != int32_type) {\n console.log(\"mismatching type in stack variable during grow mem\");\n return -1;\n }\n // extend the memory\n mem.length += n * MemoryInstance.page_size;\n\n // TODO check if the operation was successful above, for the moment we assume ok\n\n // push size to the stack\n new_var = new Variable(int32_type, sz);\n mod.stack.push(new_var);\n\n break;\n\n // numeric op codes\n case const_i32_op_code:\n code_ptr++;\n decode = Leb.decodeInt32(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n new_var = new Variable(int32_type, decode.value);\n if (labels.length > 0 && TRACK_TAINT) {\n new_var.transfer_indirect_taint(labels[0]);\n }\n mod.stack.push(new_var);\n break;\n case const_i64_op_code:\n code_ptr++;\n decode = Leb.decodeInt64(func.code, code_ptr);\n code_ptr = decode.nextIndex;\n new_var = new Variable(int64_type, Bignum(decode.value));\n if (labels.length > 0 && TRACK_TAINT) {\n new_var.transfer_indirect_taint(labels[0]);\n }\n mod.stack.push(new_var);\n break;\n case const_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case const_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_eqz_op_code:\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n top_val = mod.stack.pop();\n if (top_val.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n if (top_val.value == 0) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(top_val);\n transfer_block_taint(labels, top_val);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(top_val);\n transfer_block_taint(labels, top_val);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_eq_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (val1.value == val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_ne_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type +\". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (val1.value != val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_lt_s_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val2.value >= Math.pow(2, 31)) {\n val2.value -= Math.pow(2, 31);\n }\n if (val1.value >= Math.pow(2, 31)) {\n val1.value -= Math.pow(2, 31);\n }\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (val1.value < val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n\n case i32_lt_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n\n if (val1.value < val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_gt_s_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val2.value >= Math.pow(2, 31)) {\n val2.value -= Math.pow(2, 31);\n }\n if (val1.value >= Math.pow(2, 31)) {\n val1.value -= Math.pow(2, 31);\n }\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n\n if (val1.value > val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_gt_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n\n if (val1.value > val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_le_s_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val2.value >= Math.pow(2, 31)) {\n val2.value -= Math.pow(2, 31);\n }\n if (val1.value >= Math.pow(2, 31)) {\n val1.value -= Math.pow(2, 31);\n }\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n\n if (val1.value <= val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n\n case i32_le_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n\n if (val1.value <= val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i32_ge_s_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val2.value >= Math.pow(2, 31)) {\n val2.value -= Math.pow(2, 31);\n }\n if (val1.value >= Math.pow(2, 31)) {\n val1.value -= Math.pow(2, 31);\n }\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (val1.value >= val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n\n case i32_ge_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int32_type || val2.type != int32_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int32_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n\n if (val1.value >= val2.value) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n\n case i64_eqz_op_code:\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n top_val = mod.stack.pop();\n if (top_val.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n if (!Bignum.isBigNum(top_val.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (top_val.value.eq(0)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i64_eq_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int64_type || val2.type != int64_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int64_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (!Bignum.isBigNum(val1.value) || !Bignum.isBigNum(val2.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (val1.value.eq(val2.value)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i64_ne_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int64_type || val2.type != int64_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int64_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (!Bignum.isBigNum(val1.value) || !Bignum.isBigNum(val2.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (!val1.value.eq(val2.value)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i64_lt_s_op_code:\n case i64_lt_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int64_type || val2.type != int64_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int64_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (!Bignum.isBigNum(val1.value) || !Bignum.isBigNum(val2.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (val1.value.lt(val2.value)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i64_gt_s_op_code:\n case i64_gt_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int64_type || val2.type != int64_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int64_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (!Bignum.isBigNum(val1.value) || !Bignum.isBigNum(val2.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (val1.value.gt(val2.value)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i64_le_s_op_code:\n case i64_le_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int64_type || val2.type != int64_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int64_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (!Bignum.isBigNum(val1.value) || !Bignum.isBigNum(val2.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (val1.value.le(val2.value)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n case i64_ge_s_op_code:\n case i64_ge_u_op_code:\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n\n val2 = mod.stack.pop();\n val1 = mod.stack.pop();\n if (val1.type != int64_type || val2.type != int64_type) {\n console.log(\"values of invalid types on top of stack. expected: \" + int64_type + \". got:\" + val1.type + \", \" + val2.type);\n return -1;\n }\n\n if (!Bignum.isBigNum(val1.value) || !Bignum.isBigNum(val2.value)) {\n console.log(\"expected bignum, but didn't get one.\");\n }\n\n if (val1.value.ge(val2.value)) {\n new_var = new Variable(int32_type, 1);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n } else {\n new_var = new Variable(int32_type, 0);\n if (TRACK_TAINT) {\n new_var.transfer_indirect_taint(val1);\n new_var.transfer_indirect_taint(val2);\n transfer_block_taint(labels, val1);\n transfer_block_taint(labels, val2);\n }\n mod.stack.push(new_var);\n }\n\n code_ptr++;\n break;\n\n case f32_eq_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_ne_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_lt_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_gt_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_le_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_ge_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n\n case f64_eq_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_ne_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_lt_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_gt_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_le_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_ge_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n\n code_ptr++;\n case i32_clz_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c = mod.stack.pop();\n if (c.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n // get number of leading zeros in c\n nb_lz = 32;\n if (c.value < 0) {\n nb_lz = 0;\n }\n else if (c.value > 0) {\n nb_lz -= Math.floor(Math.log2(c.value))\n }\n new_var = new Variable(int32_type, nb_lz)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c);\n transfer_block_taint(labels, c);\n }\n mod.stack.push(new_var);\n break;\n case i32_ctz_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c = mod.stack.pop();\n if (c.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n // get number of trailing zeros in c\n nb_tz = 0;\n if (c.value <= Math.pow(2, 32)) {\n c.value += Math.pow(2, 32);\n }\n while (c.value >= 1) {\n if (c.value % 2 == 0) {\n nb_tz += 1;\n c.value /= 2;\n }\n else {\n break;\n }\n }\n new_var = new Variable(int32_type, nb_tz)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c);\n transfer_block_taint(labels, c);\n }\n mod.stack.push(new_var);\n break;\n case i32_popcnt_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c = mod.stack.pop();\n if (c.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n nb_nzb = 0;\n // count the number of non zero bits in c\n for (let i = 0; i < 32; i++) {\n if (c.value % 2 == 1) {\n nb_nzb++;\n c.value = (c.value - 1) / 2;\n }\n }\n new_var = new Variable(int32_type, nb_nzb)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c);\n transfer_block_taint(labels, c);\n }\n mod.stack.push(new_var);\n break;\n case i32_add_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = (c1.value + c2.value) % Math.pow(2, 32);\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_sub_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n //res = (c1.value - c2.value + Math.pow(2, 32)) % Math.pow(2, 32);\n res = (c1.value - c2.value);\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_mul_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n console.log(\" got: \" + c1.type +\" , \" + c2.type + \". expected: \" + int32_type);\n return -1;\n }\n res = (c1.value * c2.value) % Math.pow(2, 32);\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_div_s_op_code:\n case i32_div_u_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n if (c2.value == 0) {\n new_var = new Variable(int32_type, 0)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n }\n else {\n res = Math.trunc((c1.value / c2.value));\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n }\n break;\n case i32_rem_s_op_code:\n case i32_rem_u_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n if (c2.value == 0) {\n new_var = new Variable(int32_type, 0)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n }\n else {\n res = c1.value % c2.value;\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n }\n break;\n case i32_and_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value & c2.value;\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_or_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value | c2.value;\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_xor_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value ^ c2.value;\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_shl_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n k = c2.value % 32;\n res = (c1.value << k) % Math.pow(2, 32);\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_shr_s_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n k = c2.value % 32;\n res = c1.value >> k;\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_shr_u_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n k = c2.value % 32;\n res = c1.value >>> k;\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_rotl_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n res = BitwiseRotation.rolInt32(c1.value, c2.value % 32);\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i32_rotr_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int32_type || c2.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n\n res = BitwiseRotation.rorInt32(c1.value, c2.value % 32);\n new_var = new Variable(int32_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n\n case i64_clz_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n // get number of leading zeros in c\n lnb_lz = 64;\n if (c.value.lt(0)) {\n nb_lz = 0;\n }\n else if (c.value.gt(0)) {\n nb_lz -= Math.floor(Math.log2(c.value))\n }\n new_var = new Variable(int32_type, nb_lz)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c);\n transfer_block_taint(labels, c);\n }\n mod.stack.push(new_var);\n break;\n case i64_ctz_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n // get number of trailing zeros in c\n nb_tz = 0;\n if (c.value.ge(Bignum.pow(2,64))) {\n c.value.add(Bignum.pow(2,64));\n }\n while (c.value.ge(1)) {\n if (c.value.mod(2).eq(0)) {\n nb_tz += 1;\n c.value.div(2);\n }\n else {\n break;\n }\n }\n new_var = new Variable(int32_type, nb_tz)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c);\n transfer_block_taint(labels, c);\n }\n mod.stack.push(new_var);\n break;\n case i64_popcnt_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c = mod.stack.pop();\n if (c.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n nb_nzb = 0;\n // count the number of non zero bits in c\n for (let i = 0; i < 64; i++) {\n if (c.value.mod(2).eq(1)) {\n nb_nzb++;\n c.value = c.value.sub(1).div(2);\n }\n }\n new_var = new Variable(int32_type, nb_nzb)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c);\n transfer_block_taint(labels, c);\n }\n mod.stack.push(new_var);\n break;\n case i64_add_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = (c1.value.add(c2.value)).mod(Bignum.pow(2, 64));\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_sub_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = (c1.value.sub(c2.value).add(Bignum.pow(2, 64))).mod(Bignum.pow(2, 64));\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_mul_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = (c1.value.mul(c2.value)).mod(Bignum.pow(2, 64));\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_div_s_op_code:\n case i64_div_u_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n if (c2.value.eq(0)) {\n mod.stack.push(new Variable(int64_type, Bignum(0)));\n new_var = new Variable(int64_type, Bignum(0))\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n }\n else {\n res = c1.value.div(c2.value);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n }\n break;\n case i64_rem_s_op_code:\n case i64_rem_u_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n if (c2.value.eq(0)) {\n new_var = new Variable(int64_type, Bignum(0))\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n }\n else {\n res = c1.value.mod(c2.value);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n }\n break;\n case i64_and_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value.and(c2.value);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_or_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value.or(c2.value);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_xor_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value.xor(c2.value);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_shl_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n k = c2.value.mod(64);\n res = c1.value.shiftLeft(k);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_shr_s_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n k = c2.value.mod(64);\n res = c1.value.shiftRight(k);\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_shr_u_op_code:\n code_ptr++;\n if (mod.stack.len() <= 1) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c2 = mod.stack.pop();\n c1 = mod.stack.pop();\n if (c1.type != int64_type || c2.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n k = c2.value.mod(64).toNumber();\n res = c1.value.div(Math.pow(2, k));\n new_var = new Variable(int64_type, res)\n if (TRACK_TAINT) {\n new_var.transfer_direct_taint(c1);\n new_var.transfer_direct_taint(c2);\n transfer_block_taint(labels, c1);\n transfer_block_taint(labels, c2);\n }\n mod.stack.push(new_var);\n break;\n case i64_rotl_op_code:\n console.log(\"64 bit rotations are not supported\");\n return -1;\n case i64_rotr_op_code:\n console.log(\"64 bit rotations are not supported\");\n return -1;\n case f32_abs_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_neg_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_ceil_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_floor_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_trunc_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_nearest_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_sqrt_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_add_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_sub_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_mul_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_dic_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_min_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_max_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_copysign_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n\n case f64_abs_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_neg_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_ceil_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_floor_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_trunc_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_nearest_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_sqrt_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_add_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_sub_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_mul_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_dic_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_min_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_max_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_copysign_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n\n case i32_wrap_i64_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c1 = mod.stack.pop();\n if (c1.type != int64_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = c1.value.mod(Math.pow(2, 32)).toNumber();\n new_var = new Variable(int32_type, res)\n new_var.transfer_direct_taint(c1);\n transfer_block_taint(labels, c1);\n mod.stack.push(new_var);\n break;\n case i32_trunc_s_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_trunc_u_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_trunc_s_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_trunc_u_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i64_extend_s_i32_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c1 = mod.stack.pop();\n if (c1.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n res = Bignum(c1.value);\n new_var = new Variable(int64_type, res)\n new_var.transfer_direct_taint(c1);\n transfer_block_taint(labels, c1);\n mod.stack.push(new_var);\n break;\n case i64_extend_u_i32_op_code:\n code_ptr++;\n if (mod.stack.len() <= 0) {\n console.log(\"Stack does not contain enough elements\");\n return -1;\n }\n c1 = mod.stack.pop();\n if (c1.type != int32_type) {\n console.log(\"value of invalid type on top of stack\");\n return -1;\n }\n opts = {\n endian : 'little',\n size : 8\n };\n buf = Uint8Array(8);\n dataView = DataView(b);\n dataView.setUint32(0, c1.value, true);\n res = Bignum.fromBuffer(b, opts);\n new_var = new Variable(int64_type, res)\n new_var.transfer_direct_taint(c1);\n transfer_block_taint(labels, c1);\n mod.stack.push(new_var);\n break;\n case i64_trunc_s_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i64_trunc_u_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i64_trunc_s_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i64_trunc_u_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_convert_s_i32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_convert_u_i32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_convert_s_i64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_convert_u_i64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_denote_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_convert_s_i32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_convert_u_i32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_convert_s_i64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_convert_u_i64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_promote_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i32_reinterpret_f32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case i64_reinterpret_f64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f32_reinterpret_i32_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n case f64_reinterpret_i64_op_code:\n console.log(\"floating point operations are not supported\");\n return -1;\n }\n }\n\n console.log(\"Reached end of function code without a return\");\n return -1;\n}", "title": "" }, { "docid": "398b698ca9a09cc9972d42fdae1e8d68", "score": "0.46736655", "text": "function find(id) {\n return data[id];\n}", "title": "" }, { "docid": "f419d1cfb51823fef319cda768a8ca1d", "score": "0.46643066", "text": "function List_GetElementIdByIndex(strDataID, intIndex) {\r\n return Web_GetWebId(strDataID + \"_\" + intIndex, true);\r\n}", "title": "" }, { "docid": "28a07159067b909e7014ea8b6b7e516b", "score": "0.46628207", "text": "function update(id, params, callback) {\n core.api('PUT', '/functions/' + id, params, callback);\n }", "title": "" }, { "docid": "e3960386c9ae8f59ca09af0f74d05699", "score": "0.4656928", "text": "funcToId(func){\n switch(func){\n case this.dispose: return ID_FUNC_DISPOSER_DISPOSE;\n default: return null;\n }\n }", "title": "" }, { "docid": "cca442b43c4e97080e1298936c0d57a8", "score": "0.46421894", "text": "function S_get(id) {\n return document.getElementById(id);\n}", "title": "" }, { "docid": "084dd26f2acc22bd6ae07bc4fcfc72ea", "score": "0.46416485", "text": "function byId(id) {\r\n return document.getElementById(id);\r\n}", "title": "" }, { "docid": "122b2ccccdb95f63cc3f2865bdaaa6ec", "score": "0.46380836", "text": "function getFunc(func) {\n\tvar fp = new FuncParser(func);\n\tvar fu = fp.getFunc();\n\tif (fu==\"inc\") {\n\t\tapp.dump(\"inc\");\n\t\tif (fp.getParamCount() == 3) {\n\t\t\treturn new Increaser(fp.getParam(1), fp.getParam(2), fp.getParam(3));\n\t\t}\n\t\treturn null;\n\t} else if (fu==\"set\") {\n\t\tapp.dump(\"set\");\n\t\tif (fp.getParamCount() > 0) {\n\t\t\tvar set = new Array();\n\t\t\tfor (var i=1; i<=fp.getParamCount(); i++) {\n\t\t\t\tset.push(fp.getParam(i));\n\t\t\t}\n\t\t\treturn new Set(set);\n\t\t}\n\t\treturn null;\n\t} else if (fu==\"own\"){\n\t\tapp.dump(\"own\");\n\t\tif (fp.getParamCount()==1) return new Own(fp.getParam(1));\n\t\telse return null;\n\t} else {\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "1c6b7c1bb564465851140be9b11aafac", "score": "0.46251327", "text": "get(id) {}", "title": "" }, { "docid": "a00180af0a62fc0982e8b7bbb2371ece", "score": "0.46209693", "text": "function getRowWithIndex (id){\n\treturn $(\"#row\" + id);\n}", "title": "" }, { "docid": "d0886322990fb18433be77836fcf7f0f", "score": "0.4610721", "text": "function getOCLstr4Func(mO, f) {\r\n\r\n var fO = mO.allFuncs[f];\r\n \r\n // This is the GID_function id of current function corresponding to \r\n // TypesAllFuncs and NamesAllFuncs.\r\n var gID_f = 0;\r\n \r\n // Initialize current step numbering for current function to zero.\r\n CurStep = 0;\r\n \r\n // Initialize GridsInFuncOCL.\r\n GridsInFuncOCL = new Array();\r\n Loop_var_per_dim = new Array();\r\n Index_end_per_dim = new Array();\r\n OCL_steps_dataTran = new Array();\r\n CLMEMSinFunc = new Array();\r\n\r\n\r\n if (var2OCL(fO.funcCallExpr.str) == \"ft_Main\") {\r\n\t \r\n // Add an INTEGER as main's return value (TypesAllFuncs[0])\r\n TypesAllFuncs.push(\"int\");\r\n //gID_f = 1;\t//NEXT one\r\n GID_function = 1; //NEXT one\r\n\r\n } else {\r\n \r\n for (var i = 0; i < TypesAllFuncs.length; i++) {\r\n\r\n if (NamesAllFuncs[i] == var2OCL(fO.funcCallExpr.str)) {\r\n \r\n\t\t//alert(\"FOUND in i=\" + i + \"Callee=\"+NamesAllFuncs[i] + \r\n //\"type=\"+TypesAllFuncs[i]);\r\n //TODO: (check) Add a dummy type entry for function \r\n //return value. Will be updated later \r\n //(TypesAllFuncs[gID])\r\n TypesAllFuncs.push(TypesAllFuncs[i]);\r\n gID_f = i; //Set, so it can be used to assign the \r\n //required type to temp return value.\r\n \r\n\t }\r\n\r\n }\r\n\r\n }\r\n\r\n // Used for recording functions once (and then recording\r\n // their types and names to be used in other places of\r\n // code generation. \r\n // Initialize to blank at the start of each new function\r\n Func_decl = \"\";\r\n\r\n // See their declaration (global scope) for details on below:\r\n Row_col_decl = \"\";\r\n Index_end_decl = \"\";\r\n Grids_new_decl = \"\";\r\n TitleDefs_decl = \"\";\r\n AllocFreePerFunc = \"\";\r\n\r\n // Create function header (function type plus name). Arguments to be\r\n // added in subsequent steps.\r\n // TODO:C: Commented out.\r\n var func_name = var2OCL(fO.funcCallExpr.str);\r\n\t\r\n\r\n var func_head = \"(\";\r\n\r\n // Head part for OCL device inline (auxiliary functions (where pointers \r\n // will be __global).\r\n var func_head_OCL_dev = \"(\";\r\n\t\t\t\t\r\n // In func_vars we declare the type and name of any grids that were passed\r\n // as parameters in the current function for which we are generating code.\r\n var func_vars = \"\";\r\n\r\n var func_val_init = \"\";\r\n\r\n var arr_dynValues = new Array();\r\n\t\r\n // Add argument list to function header. To do that, go through ALL grids \r\n // in the function and add those who are incoming args.\r\n for (var g = 0; g < fO.allGrids.length; g++) {\r\n\r\n var gO = fO.allGrids[g]; \r\n\r\n // TODO: If a grid with specific indices e.g. array[3][1] treat as \r\n // passed by value!\r\n if (gO.inArgNum >= 0) { // This grid is an incoming arg.\r\n\r\n\r\n if (gO.numDims > 1 && gO.typesInDim != -1) {\r\n\r\n\t\tif (gO.inArgNum > 0) {\r\n\r\n\t\t func_head += \", \"; // arg separator\r\n\t\t func_head_OCL_dev += \", \"; // arg separator\r\n\r\n\t \t}\r\n\r\n\t\tif (!Soa) func_head += getDataTypeString_OCL(gO) + \" *\";\r\n\r\n //TODO: CAUTION: This is for the case of TYPE variable\r\n //\tpassed using its name (i.e., no specific element).\r\n func_head += expandStruct(gO, 1); //\"typvar_\" + gO.caption;\r\n\t\tfunc_head_OCL_dev += expandStruct(gO, 2);\r\n\r\n\r\n } else {\r\n\r\n\t\tif (gO.numDims >= 1) { \r\n\t\t \r\n\t\t if (gO.inArgNum > 0) {\r\n\r\n\t\t\tfunc_head += \", \"; // arg separator\r\n\t\t\tfunc_head_OCL_dev += \", \"; // arg separator\r\n\r\n\t \t }\r\n\r\n\t\t // If called function contains at least a parallel step, we\r\n\t\t // will need a cl_mem pointer that will be used if need be.\r\n\t\t // TODO: Can be optimized in case this variable is NOT used\r\n\t\t // in the parallel step of called function (i.e., not pass).\r\n\t\t if (DataTran == 1) {\r\n\r\n\t\t if (funcContainsParStep(mO,f) && \r\n\t\t\t func_name != \"ft_Main\") {\r\n\t\t \r\n\t\t func_head += \"cl_mem *\" + var2OCL(gO.caption) + \r\n\t\t\t\t \"_dev, \";\r\n\t\t \t CLMEMSinFunc.push(gO.caption);\r\n\r\n\t\t } \r\n\r\n\t\t }\r\n\r\n func_head += getDataTypeString_OCL(gO) + \" \";\r\n\r\n\t\t func_head += \"*\" + var2OCL(gO.caption);\r\n\r\n\t\t func_head_OCL_dev += \"__global \" + \r\n\t\t\t getDataTypeString_OCL(gO) + \r\n\t\t\t\t\t \"* \" + var2OCL(gO.caption); \r\n\t\t // Grid caption as arg name \r\n\r\n\t \t} else {\r\n\r\n\t\t // Ensure has not been implicitly declared via a\r\n\t\t // dynamically sized non-scalar grid (see below).\r\n\t\t var regex = new RegExp(var2OCL(gO.caption + \"[, )]\")); \r\n\t\t if (func_head.search(regex) == -1) {\r\n\r\n\t\t\tif (gO.inArgNum > 0) {\r\n\r\n\t\t func_head += \", \"; // arg separator\r\n\t\t\t func_head_OCL_dev += \", \"; // arg separator\r\n\r\n\t \t\t} \r\n\r\n\t\t \tfunc_head += getDataTypeString_OCL(gO) + \" \" + \r\n\t\t\t var2OCL(gO.caption);\r\n\t\t func_head_OCL_dev += getDataTypeString_OCL(gO) + \" \" + \r\n\t\t\t\t\t var2OCL(gO.caption);\r\n\r\n\t\t }\r\n\t\t // else do not declare at all.\r\n\r\n\t\t}\r\n\r\n }\r\n\r\n\t if (gO.numDims >=1) {\r\n \r\n\t\t// Given we dynamically allocate all non-scalar grids, we\r\n\t\t// need to pass dimensions that are variables (the constant\r\n\t\t// dimensions are auto-generated as numbers in resulting\r\n\t\t// code). They are also needed to be used in loops (in \r\n\t\t// Fortran we could get this info using SIZE(), but in C\r\n\t\t// there is nothing similar).\r\n\t\tvar dynVals = \", \";\r\n\t\tfor (var i = 0; i < gO.dimActSize.length; i++) {\r\n\r\n\t\t var t_sz = gO.dimDynSize[i];\r\n\t\t if (t_sz != null) {\r\n\r\n\t\t\t// The second check takes care of scalars that may have\r\n\t\t\t// been passed as parameters (i.e., explicitly), while\r\n\t\t\t// the first is for implicit passing (scalar grids used\r\n\t\t\t// for dynamic size of non-scalar grids).\r\n\t\t if(arr_dynValues.indexOf(var2OCL(t_sz))==-1 &&\r\n\t\t\t func_head.indexOf(var2OCL(t_sz))==-1) {\r\n\t\t\t \r\n\t\t\t arr_dynValues.push(var2OCL(t_sz));\r\n\t\t\t dynVals += \"int \"+var2OCL(t_sz) + \",\";\r\n\t\t \r\n\t\t\t}\r\n\t\t\t \r\n\t\t }\r\n\r\n\t\t}\r\n\t \r\n \t\tif (dynVals != \", \") {\r\n\r\n\t\t func_head += dynVals.replace(/,+$/, \"\");\r\n\t\t func_head_OCL_dev += dynVals.replace(/,+$/, \"\");\r\n\t\t \r\n\t\t}\r\n\r\n\t } else {\r\n\t\t\r\n\t\t// For scalar-grids, we have to copy the src value into a temp\r\n\t \t// variable called fun_<src_var_name>. \r\n\t\t// TODO: Can fuse with earlier similar loop for function \r\n\t\t// header. \r\n\t\tfunc_vars += addIndentation(0) + getDataTypeString_OCL(gO,\r\n null) + \" fun_\" + gO.caption + \";\\n\";\r\n\r\n func_val_init += addIndentation(0) + \"fun_\" + gO.caption +\r\n \" = \" + var2OCL(gO.caption) + \";\\n\";\r\n\r\n\t }\r\n\r\n }\r\n\r\n }\r\n \r\n func_head += \")\";\r\n\r\n Func_prototypes.push(func_name + func_head + \";\\n\");\r\n\r\n func_head += \" {\\n\";\r\n\r\n var func_ret_type = getDataTypeString_OCL(fO.allGrids[0], null);\r\n \r\n // TODO: Only add if called from a __kernel function in the .cl file.\r\n DeviceAuxPrototypes.push(func_ret_type + \" \" + func_name + \"_device\" + \r\n\t\t func_head_OCL_dev + \");\");\r\n\r\n func_head_OCL_dev += \") {\\n\";\r\n\r\n // At this point we have completed in func_head the function header\r\n // that contains the type of function, the function name, and its\r\n // arguments contained in parentheses.\r\n\r\n // Used for declaration of the ret value declaration within the func.\r\n // This is always in position 0 in fO.allGrids[].\r\n func_vars += addIndentation(0) + getDataTypeString_OCL(fO.allGrids[0],\r\n null) + \" \" + var2OCL(fO.allGrids[0].caption) + \";\\n\";\r\n\r\n // STEP: Code for each step in the function.\r\n // Two positions ([0] is serial for __device, [1] is for parallel).\r\n var step_code = new Array();\r\n step_code[0] = \"\";\r\n step_code[1] = \"\";\r\n \r\n var stepStart = 1; // Note: Function prototype at step 0. \r\n \r\n for (var s = stepStart; s < fO.allSteps.length; s++) {\r\n\r\n\tOCL_steps_dataTran.push(new OCL_step_grids_info());\r\n \r\n var step_code_tmp = getOCLstr4Step(fO, fO.allSteps[s], mO);\r\n\tstep_code[0] += step_code_tmp[0]; // Serial (_device).\r\n\tstep_code[1] += step_code_tmp[1]; // Parallel (if available).\r\n\t\r\n\t// For CPU/GPU/MIC (i.e., except FPGA) we need to add SVM calls for \r\n\t// Map/Unmap where necessary)\r\n\tif (Device_type != DevT.FPGA && DataTran == 0) {\r\n\r\n\t step_code[1] = addSVMcalls(fO, s, step_code[1]);\r\n\t \r\n\t} else if (DataTran == 1) {\r\n\t \r\n\t // Check if there is a need for D2H transfers for non-scalar\r\n\t // grids that were previously altered in a device step.\r\n\t // Check if there is a need for H2D transfer for non-scalar\r\n\t // grids that were previously altered in a host step.\r\n\t step_code[1] = addDataTranCalls(fO, s, step_code[1]);\r\n\t\r\n\t} else {\r\n\t step_code[1] = step_code[1].replace(\"__SVM__\", \"\");\r\n\t}\r\n }\r\n\r\n\r\n //printOCL_steps_dataTran(); // For debugging purposes.\r\n\r\n if (AllocFreePerFunc != \"\") {\r\n\r\n\tAllocFreePerFunc = \"\\n\" + addIndentation(0) + \r\n\t\t \"//Freeing up memory buffers.\\n\" + \r\n\t\t\t AllocFreePerFunc;\r\n\r\n }\r\n\r\n // Construct the final function string that contains:\r\n // a) the function header (type + name + arguments).\r\n // b) arguments' declaration (type + name).\r\n // c) temp scalar variables (to keep 'pass by value' semantics for\r\n // scalar arguments).\r\n // d) row, col, indX (loop indices) - no redefinition across steps. \r\n // e) end0, end1, etc. (loop end variables) - no redefinition across steps\r\n // f) title definitions.\r\n // g) new grid declarations (i.e., not passed as arguments).\r\n // h) Initialization of scalar variables that store scalar function\r\n // arguments (fun_<scalar_arg_name>).\r\n // i) computation code for all steps of this function.\r\n // j) return value assignment to function name\r\n // k) end function statement\r\n var function_string = new Array();\r\n \r\n function_string[0] = func_ret_type + \" \" + func_name + \"_device\" + \r\n\t \t\t func_head_OCL_dev;\r\n\r\n function_string[1] = func_name + func_head;\r\n \r\n function_string[0] += func_vars + Row_col_decl + Index_end_decl + \r\n\t \t\t TitleDefs_decl + Grids_new_decl + func_val_init + \r\n\t\t\t step_code[0] + AllocFreePerFunc;\r\n\r\n function_string[1] += func_vars + Row_col_decl + Index_end_decl + \r\n\t \t\t TitleDefs_decl + Grids_new_decl + func_val_init + \r\n\t\t\t addIndentation(0) + \"int dev_alloc_size;\\n\" +\r\n \t\t step_code[1] + AllocFreePerFunc;\r\n\r\n // If no return statement added (e.g., when \"void\"), we return 1 (since \r\n // ALL Grid Language functions need a return type).\r\n //if (function_string.indexOf(\"return\") == -1) {\r\n\r\n //\tfunction_string += addIndentation(0) + \"return 1;\\n\";\r\n\r\n //}\r\n\r\n\r\n // TODO: CAUTION: Copy back to host anything written on device and\r\n // not yet updated on host.\r\n \r\n function_string[0] += \"}\\n\\n\";\r\n function_string[1] += \"}\\n\\n\";\r\n\r\n function_string[1] = replaceClArgsInFuncCall(func_head, function_string[1]);\r\n\r\n return function_string;\r\n\r\n}", "title": "" }, { "docid": "dd42c6f5b1fc68398ff841154f05ff65", "score": "0.46063414", "text": "getHashTableById(id) {\n return this.hashTableMap[id];\n }", "title": "" }, { "docid": "9ee2c441225f8d5aa7615b63b9993517", "score": "0.4603496", "text": "function sc(id) {\n if (ms[id] || df[id]) return id;\n if (al[id]) return al[id];\n var tmp = id+'/index';\n return (ms[tmp] || df[tmp]) ? tmp : id;\n }", "title": "" }, { "docid": "f92f30dae3b46760bb18f82106a3dbc4", "score": "0.4602836", "text": "setFunctionValue(str_hwid, str_pubval) {\n var _this178 = this;\n\n return _asyncToGenerator(function* () {\n let classname = _this178.imm_functionClass(str_hwid);\n if (_this178._fnByType[classname].imm_setFunctionValue(str_hwid, str_pubval)) {\n let receivers = _this178._ValueCallbackList;\n for (let i = 0; i < receivers.length; i++) {\n let fun = receivers[i];\n if (!fun._hwId) continue;\n if (fun._hwId == str_hwid) {\n yield fun._invokeValueCallback(str_pubval);\n }\n }\n }\n })();\n }", "title": "" }, { "docid": "5bb8d9ea621aeeb8ae84bf98ddf0fa58", "score": "0.45883167", "text": "function getByID(elementID) {\n return document.getElementById(elementID);\n}", "title": "" }, { "docid": "facdf9083e9ce444e71809f647363244", "score": "0.45868444", "text": "function getById(id){return document.getElementById(id);}", "title": "" }, { "docid": "dd21edfd5f72c27b1a50b42b68a63251", "score": "0.4584542", "text": "function YAPI_resolveFunction(str_className, str_func)\n {\n if(Y_BASETYPES[str_className] == undefined) {\n // using a regular function type\n if(this._fnByType[str_className] == undefined)\n this._fnByType[str_className] = new YFunctionType(str_className);\n return this._fnByType[str_className].resolve(str_func);\n }\n // using an abstract baseType\n var baseType = Y_BASETYPES[str_className];\n var res;\n for(str_className in this._fnByType) {\n if(this._fnByType[str_className].getBaseType() == baseType) {\n res = this._fnByType[str_className].resolve(str_func);\n if(res.errorType == YAPI_SUCCESS) return res;\n }\n }\n return {errorType:YAPI_DEVICE_NOT_FOUND, \n errorMsg:\"No \"+str_className+\" [\"+str_func+\"] found (old firmware?)\",\n result:null};\n }", "title": "" }, { "docid": "6a927bec295b8000de41763d739f7ef5", "score": "0.45812246", "text": "function getFunction() {\n var randIndex = getRandomInt(0, 3) // random number between 0 and 2\n var functions = [\n 'fun makeGreen (p:{color:string}) = p.color = \"green\"',\n 'val distToOrigin:(p{x:real, y:real}) = Math.sqrt(p.x * p.x + p.y * p.y)', // complete def\n 'fun setX (p:{x:real}) = x = 4.0',\n 'fun setY (p:{y:real}) = y = 4.0'\n ];\n return functions[randIndex];\n}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.4577389", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "8fcc83393fb0e7709b477ae081e7e33b", "score": "0.4577389", "text": "function TrackByFunction() {}", "title": "" }, { "docid": "3a50f60c05600000929795567995ab54", "score": "0.45771694", "text": "function getElement(id){\r\n\t//just shortens code\r\n\treturn document.getElementById(id);\r\n}", "title": "" }, { "docid": "8f80f3d71066e6b90ec4389c51406569", "score": "0.45762992", "text": "function goInsideFn(object,id,charac) {\n return(object[id][charac]);\n}", "title": "" }, { "docid": "837081cc6249f9a27c9628e2272f7299", "score": "0.4574433", "text": "getFunction(nameOrSignatureOrSighash) {\n if ((0, _bytes.isHexString)(nameOrSignatureOrSighash)) {\n for (const name in this.functions) {\n if (nameOrSignatureOrSighash === this.getSighash(name)) {\n return this.functions[name];\n }\n }\n\n logger.throwArgumentError(\"no matching function\", \"sighash\", nameOrSignatureOrSighash);\n } // It is a bare name, look up the function (will return null if ambiguous)\n\n\n if (nameOrSignatureOrSighash.indexOf(\"(\") === -1) {\n const name = nameOrSignatureOrSighash.trim();\n const matching = Object.keys(this.functions).filter(f => f.split(\"(\"\n /* fix:) */\n )[0] === name);\n\n if (matching.length === 0) {\n logger.throwArgumentError(\"no matching function\", \"name\", name);\n } else if (matching.length > 1) {\n logger.throwArgumentError(\"multiple matching functions\", \"name\", name);\n }\n\n return this.functions[matching[0]];\n } // Normlize the signature and lookup the function\n\n\n const result = this.functions[_fragments.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];\n\n if (!result) {\n logger.throwArgumentError(\"no matching function\", \"signature\", nameOrSignatureOrSighash);\n }\n\n return result;\n }", "title": "" }, { "docid": "7e87ad657a674e88633d7af8e8a0d397", "score": "0.45715836", "text": "function YLed_FindLed(str_func)\n {\n if(str_func == undefined) return null;\n var obj_func = YAPI.getFunction('Led', str_func);\n if(obj_func) return obj_func;\n return new YLed(str_func);\n }", "title": "" }, { "docid": "ced63b2f9fbe227f5f43d39f74a0674d", "score": "0.4555014", "text": "function getDeviceByName(db, devName) {\n\t\t\tvar transaction = db.transaction([\"devices\"], \"readonly\");\n\t\t\tvar objectStore = transaction.objectStore(\"devices\");\n\t\t\tvar index = objectStore.index(\"name\");\n\n\t\t\tindex.get(devName).onsuccess = function(event) {\n\t\t\t\tconsole.log(devName + \" ID is: \" + event.target.result.deviceID);\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "e513ad0a49938c25854478de190755a4", "score": "0.45526773", "text": "function YFunction_get_functionId()\n {\n if(this._funId != \"\") {\n return this._funId;\n }\n var resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) {\n this.isOnline();\n resolve = YAPI.resolveFunction(this._className, this._func);\n if(resolve.errorType != YAPI_SUCCESS) {\n return this._throw(resolve.errorType, resolve.errorMsg, Y_FUNCTIONID_INVALID);\n }\n }\n var pos =resolve.result.indexOf(\".\");\n return resolve.result.substr(pos+1);\n }", "title": "" }, { "docid": "72b9a9db1bcf8fa852f5777a1b9d059a", "score": "0.45457363", "text": "callAirtable(functionName) {\n return this._airtableModel[functionName]();\n }", "title": "" }, { "docid": "de81ef4ede2c83da8a523c5c841fbced", "score": "0.4540586", "text": "function byId(id) {\n\treturn document.getElementById(id);\n}", "title": "" }, { "docid": "6401d928cec14b0919dd6a4e1782d6ef", "score": "0.45401734", "text": "function TrackByFunction(){}", "title": "" }, { "docid": "12e71ce7259f892715d88a9f37a469ad", "score": "0.45394316", "text": "function miniDom_getElementById( id )\n{ \n return document.getElementById(id); \n}", "title": "" }, { "docid": "d0660551ed96886b3a378754f0265ee4", "score": "0.45363787", "text": "function getByID(ID)\r\n{\r\n return document.getElementById(ID);\r\n}", "title": "" }, { "docid": "3bb944efa8cbbc09486627a4e8c8bfa3", "score": "0.4532659", "text": "function addFunctionWasm(func, sig) {\n var table = wasmTable;\n\n // Check if the function is already in the table, to ensure each function\n // gets a unique index. First, create the map if this is the first use.\n if (!functionsInTableMap) {\n functionsInTableMap = new WeakMap();\n for (var i = 0; i < table.length; i++) {\n var item = table.get(i);\n // Ignore null values.\n if (item) {\n functionsInTableMap.set(item, i);\n }\n }\n }\n if (functionsInTableMap.has(func)) {\n return functionsInTableMap.get(func);\n }\n\n // It's not in the table, add it now.\n\n\n var ret;\n // Reuse a free index if there is one, otherwise grow.\n if (freeTableIndexes.length) {\n ret = freeTableIndexes.pop();\n } else {\n ret = table.length;\n // Grow the table\n try {\n table.grow(1);\n } catch (err) {\n if (!(err instanceof RangeError)) {\n throw err;\n }\n throw 'Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.';\n }\n }\n\n // Set the new value.\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n table.set(ret, func);\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n var wrapped = convertJsFunctionToWasm(func, sig);\n table.set(ret, wrapped);\n }\n\n functionsInTableMap.set(func, ret);\n\n return ret;\n}", "title": "" }, { "docid": "3bb944efa8cbbc09486627a4e8c8bfa3", "score": "0.4532659", "text": "function addFunctionWasm(func, sig) {\n var table = wasmTable;\n\n // Check if the function is already in the table, to ensure each function\n // gets a unique index. First, create the map if this is the first use.\n if (!functionsInTableMap) {\n functionsInTableMap = new WeakMap();\n for (var i = 0; i < table.length; i++) {\n var item = table.get(i);\n // Ignore null values.\n if (item) {\n functionsInTableMap.set(item, i);\n }\n }\n }\n if (functionsInTableMap.has(func)) {\n return functionsInTableMap.get(func);\n }\n\n // It's not in the table, add it now.\n\n\n var ret;\n // Reuse a free index if there is one, otherwise grow.\n if (freeTableIndexes.length) {\n ret = freeTableIndexes.pop();\n } else {\n ret = table.length;\n // Grow the table\n try {\n table.grow(1);\n } catch (err) {\n if (!(err instanceof RangeError)) {\n throw err;\n }\n throw 'Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.';\n }\n }\n\n // Set the new value.\n try {\n // Attempting to call this with JS function will cause of table.set() to fail\n table.set(ret, func);\n } catch (err) {\n if (!(err instanceof TypeError)) {\n throw err;\n }\n var wrapped = convertJsFunctionToWasm(func, sig);\n table.set(ret, wrapped);\n }\n\n functionsInTableMap.set(func, ret);\n\n return ret;\n}", "title": "" }, { "docid": "c9a15bfb5b883da7abcb9e0df6d83a68", "score": "0.45288566", "text": "function F_index () {\n\treturn mission_Index;\n}", "title": "" } ]
7957128e6d44892200f0568222f5efb4
Creates a new Uint8Array based on two different ArrayBuffers
[ { "docid": "ec29ef640d85bc21891d47ce1f4d1521", "score": "0.6984923", "text": "function appendBuffer(buffer1, buffer2) {\n var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n tmp.set(new Uint8Array(buffer1), 0);\n tmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n return tmp.buffer;\n}", "title": "" } ]
[ { "docid": "97b1f6761e2ad256ce197f91dbcda1e0", "score": "0.77124184", "text": "function appendArrayBuffers(buffer1, buffer2) {\n let tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n tmp.set(new Uint8Array(buffer1), 0);\n tmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n return tmp.buffer;\n}", "title": "" }, { "docid": "1cc17ad713b14ea88c0992178af98990", "score": "0.7449781", "text": "concat(buffer1, buffer2) {\n var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n tmp.set(new Uint8Array(buffer1), 0);\n tmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n return tmp.buffer;\n }", "title": "" }, { "docid": "2be90966c69c9daf7ae2bb84aca8492a", "score": "0.6833724", "text": "function concatenateArrayBuffers(buffers) {\n if (buffers.length === 1) {\n return buffers[0];\n }\n let totalByteLength = 0;\n buffers.forEach((buffer) => {\n totalByteLength += buffer.byteLength;\n });\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n }", "title": "" }, { "docid": "7bffa2d7eef2add320094804ac7163eb", "score": "0.681924", "text": "function concatenateArrayBuffers(buffers) {\n var totalByteLength = 0;\n buffers.forEach(function (buffer) {\n totalByteLength += buffer.byteLength;\n });\n var temp = new Uint8Array(totalByteLength);\n var offset = 0;\n buffers.forEach(function (buffer) {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}", "title": "" }, { "docid": "7bffa2d7eef2add320094804ac7163eb", "score": "0.681924", "text": "function concatenateArrayBuffers(buffers) {\n var totalByteLength = 0;\n buffers.forEach(function (buffer) {\n totalByteLength += buffer.byteLength;\n });\n var temp = new Uint8Array(totalByteLength);\n var offset = 0;\n buffers.forEach(function (buffer) {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}", "title": "" }, { "docid": "3cf146542a320702b8c770e6e9d4e361", "score": "0.6810346", "text": "function UTIL_concat(a, b) {\n var c = new Uint8Array(a.length + b.length);\n var i, n = 0;\n for (i = 0; i < a.length; i++, n++) c[n] = a[i];\n for (i = 0; i < b.length; i++, n++) c[n] = b[i];\n return c;\n}", "title": "" }, { "docid": "38d60bccaf6d63c4efb1ec128a18fc0c", "score": "0.67530155", "text": "function concatenateArrayBuffers(buffers) {\n if (buffers.length === 1) {\n return buffers[0];\n }\n let totalByteLength = 0;\n buffers.forEach((buffer) => {\n totalByteLength += buffer.byteLength;\n });\n const temp = new Uint8Array(totalByteLength);\n let offset = 0;\n buffers.forEach((buffer) => {\n temp.set(new Uint8Array(buffer), offset);\n offset += buffer.byteLength;\n });\n return temp.buffer;\n}", "title": "" }, { "docid": "6078c63422ed38ca7eb016633a27cbd3", "score": "0.6512535", "text": "function concatArrays(arrays) {\n\n let len = 0;\n arrays.forEach(function (a) {\n len += a.length;\n });\n\n let offset = 0;\n const newArray = new Uint8Array(len);\n arrays.forEach(function (a) {\n newArray.set(a, offset);\n offset += a.length;\n });\n\n return newArray;\n\n }", "title": "" }, { "docid": "f56654abc3c18a74910ce877b7ec66a5", "score": "0.6495949", "text": "function concatenate_array_buffers(buffers) {\n return buffers.reduce((accumulator, bytes) => {\n const buffer = new Uint8Array(accumulator.byteLength + bytes.byteLength);\n buffer.set(accumulator, 0);\n buffer.set(bytes, accumulator.byteLength);\n return buffer;\n });\n}", "title": "" }, { "docid": "4968ade8e3a1c1008a32a378e06ae50e", "score": "0.64780325", "text": "function buildUint8Array()\n{\n\t// Sum up length\n\tvar length = 0;\n\tfor (var i = 0; i < arguments.length; i++) {\n\t var obj = arguments[i];\n\t if (obj instanceof Array || obj instanceof Uint8Array) {\n\t \tlength += obj.length;\n\t } else {\n\t \tlength++;\n\t }\n \t}\n\n \t// Create and fill typed array\n \tvar arr = new Uint8Array(length);\n \tvar offset = 0;\n\tfor (var i = 0; i < arguments.length; i++) {\n\t var obj = arguments[i];\n\t if (obj instanceof Array || obj instanceof Uint8Array)\n\t {\n\t \tarr.set(obj, offset);\n\t \toffset += obj.length;\n\t }\n\t else \n\t {\n\t \tarr.set([obj], offset);\n\t \toffset++;\n\t }\n \t}\n \treturn arr;\n}", "title": "" }, { "docid": "67d44e3ca2ad06167b375719bf0c4c9e", "score": "0.64713496", "text": "function concatArrays(arrays) {\n\n let len = 0;\n arrays.forEach(function (a) {\n len += a.length;\n });\n\n let offset = 0;\n const newArray = new Uint8Array(len);\n arrays.forEach(function (a) {\n newArray.set(a, offset);\n offset += a.length;\n });\n\n return newArray;\n\n}", "title": "" }, { "docid": "821cdbef779e5a090a1eee897d1f9973", "score": "0.61851907", "text": "function concat(...buffers) {\n const result = new Uint8Array(buffers.reduce((acc, curr) => acc + curr.byteLength, 0));\n let index = 0;\n for (const b of buffers) {\n result.set(new Uint8Array(b), index);\n index += b.byteLength;\n }\n return result.buffer;\n}", "title": "" }, { "docid": "383ec68e3d91d43d3cf1ee0d2e6c1020", "score": "0.6166668", "text": "function test() {\n var plain = Uint8Array.plainOf(new Uint8Array(10));\n print(Object.prototype.toString.call(plain));\n print(isPlainBuffer(plain));\n print(plain.length);\n\n // Plain buffers inherit from Uint8Array.prototype and their .buffer\n // is an inherited getter which creates an ArrayBuffer instance with\n // the same backing as the plain buffer.\n\n var a1 = plain.buffer;\n print(Object.prototype.toString.call(a1));\n print(a1.length);\n print(a1.byteLength);\n\n // However, because there's no place to store/cache the ArrayBuffer,\n // each access creates a new ArrayBuffer instance. They all share the\n // same backing however.\n\n var a2 = plain.buffer;\n print(Object.prototype.toString.call(a1));\n print(a1.length);\n print(a1.byteLength);\n print(a1 === a2);\n\n // Views sharing the plain buffer can be constructed over the ArrayBuffers.\n\n var u16 = new Uint16Array(a2);\n plain[4] = 0xff;\n u16[1] = 0x1111;\n\n print(Duktape.enc('jx', plain));\n print(Duktape.enc('jx', a1));\n print(Duktape.enc('jx', a2));\n print(Duktape.enc('jx', u16));\n}", "title": "" }, { "docid": "cef039b8dd317d336af1f02624524ac0", "score": "0.615408", "text": "function equalBuffers(r1, r2) {\n const s1 = new Uint8Array(r1),\n s2 = new Uint8Array(r2)\n if (s1.length !== s2.length) {return false}\n for (let i = 0, n = s1.length; i < n; i++) {\n if (s1[i] !== s2[i]) {return false}\n }\n return true\n}", "title": "" }, { "docid": "1bb48c68edb37157f0267f6a089599ff", "score": "0.61519915", "text": "function concatBytes(...arrays) {\n const r = new Uint8Array(arrays.reduce((sum, a) => sum + a.length, 0));\n let pad = 0; // walk through each item, ensure they have proper type\n arrays.forEach((a) => {\n if (!u8a(a))\n throw new Error('Uint8Array expected');\n r.set(a, pad);\n pad += a.length;\n });\n return r;\n}", "title": "" }, { "docid": "b139f502d67bc396de182c66190a782a", "score": "0.5975174", "text": "getTypedArrayForBufferView(bufferView) {\n bufferView = this.getBufferView(bufferView);\n const bufferIndex = bufferView.buffer;\n\n // Get hold of the arrayBuffer\n // const buffer = this.getBuffer(bufferIndex);\n const binChunk = this.gltf.buffers[bufferIndex];\n assert(binChunk);\n\n const byteOffset = bufferView.byteOffset || 0 + binChunk.byteOffset;\n return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);\n }", "title": "" }, { "docid": "ff861fd0a80041c0d3dbfad6df98ee0a", "score": "0.59654844", "text": "function equalBuffers(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n var aBytes = new Uint8Array(a);\n var bBytes = new Uint8Array(b);\n\n for (var i=0; i<a.byteLength; i++) {\n if (aBytes[i] !== bBytes[i]) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "ff861fd0a80041c0d3dbfad6df98ee0a", "score": "0.59654844", "text": "function equalBuffers(a, b) {\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n var aBytes = new Uint8Array(a);\n var bBytes = new Uint8Array(b);\n\n for (var i=0; i<a.byteLength; i++) {\n if (aBytes[i] !== bBytes[i]) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "eb30a86551ffb1dc147eb04d42d2da7d", "score": "0.5927089", "text": "getTypedArrayForBufferView(bufferView) {\n bufferView = this.getBufferView(bufferView);\n const bufferIndex = bufferView.buffer;\n\n // Get hold of the arrayBuffer\n // const buffer = this.getBuffer(bufferIndex);\n const binChunk = this.gltf.buffers[bufferIndex];\n Object(_utils_assert__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(binChunk);\n\n const byteOffset = bufferView.byteOffset || 0 + binChunk.byteOffset;\n return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);\n }", "title": "" }, { "docid": "bfaa0b32984d90888091dc066e5007d6", "score": "0.5895723", "text": "function concatTypedArrays(a, b) { // a, b TypedArray of same type\n var c = new (a.constructor)(a.length + b.length);\n c.set(a, 0);\n c.set(b, a.length);\n return c;\n}", "title": "" }, { "docid": "58ea41abc6c124ed1adda68468bf6a25", "score": "0.5884962", "text": "convBuffer(chunk) {\n // does array copy\n const uint8_view = new Uint8Array(chunk, 0, chunk.length);\n // var dataView = new DataView(uint8_view.buffer);\n\n let uint32_view = new Uint32Array(uint8_view.buffer);\n\n // let thebuffer = new ArrayBuffer(thisRun*8*2); // in bytes\n // let float64_view = new Float64Array(thebuffer);\n return uint32_view;\n }", "title": "" }, { "docid": "67e8eb2431486f336420181eebb8dacb", "score": "0.5853318", "text": "function assert_equals_typed_array(array1, array2) {\n const [view1, view2] = [array1, array2].map((array) => {\n if (array instanceof ArrayBuffer) {\n return new DataView(array);\n } else {\n assert_true(array.buffer instanceof ArrayBuffer,\n 'Expect buffer to be instance of ArrayBuffer');\n return new DataView(array.buffer, array.byteOffset, array.byteLength);\n }\n });\n\n assert_equals(view1.byteLength, view2.byteLength,\n 'Expect both arrays to be of the same byte length');\n\n const byteLength = view1.byteLength;\n\n for (let i = 0; i < byteLength; ++i) {\n assert_equals(view1.getUint8(i), view2.getUint8(i),\n `Expect byte at buffer position ${i} to be equal`);\n }\n}", "title": "" }, { "docid": "71ad6db97c003deb53254b363810b076", "score": "0.5852816", "text": "function buffer2Uint8array(buff) {\n if (buff instanceof Uint8Array) {\n // BFS & Node v4.0 buffers *are* Uint8Arrays.\n return buff;\n } else {\n // Uint8Arrays can be constructed from arrayish numbers.\n // At this point, we assume this isn't a BFS array.\n return new Uint8Array(buff);\n }\n}", "title": "" }, { "docid": "0e6b244551e426435950452a2e99667d", "score": "0.58385146", "text": "function concat(a, b) {\n var c = new Array(),\n i;\n for (i = 0; i < a.length; i += 1) {\n c.push(a[i]);\n }\n for (i = 0; i < b.length; i += 1) {\n c.push(b[i]);\n }\n return new Int8Array(c);\n}", "title": "" }, { "docid": "760a4d42c2fe41dc1f27c89dc9d187af", "score": "0.58362025", "text": "function _toArrayBuffer (buffer) {\n\tvar \n\tab = new ArrayBuffer(buffer.length),\n\tview = new Uint8Array(ab);\n\t\n\tfor (var i = 0; i < buffer.length; ++i) {\n\t\tview[i] = buffer[i];\n\t}\n\treturn ab;\n}", "title": "" }, { "docid": "0639ed1e6843775a342c3a164c00ecd3", "score": "0.57774115", "text": "function isArrayBufferEqual(a, b) {\r\n if (a == null || b == null) {\r\n return false;\r\n }\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a.byteLength !== b.byteLength) {\r\n return false;\r\n }\r\n var viewA = new DataView(a);\r\n var viewB = new DataView(b);\r\n for (var i = 0; i < a.byteLength; i++) {\r\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "9d73928b4d8dec168a831acb885236ad", "score": "0.576209", "text": "function isArrayBufferEqual(a, b) {\n if (a == null || b == null) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n var viewA = new DataView(a);\n var viewB = new DataView(b);\n for (var i = 0; i < a.byteLength; i++) {\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "9d73928b4d8dec168a831acb885236ad", "score": "0.576209", "text": "function isArrayBufferEqual(a, b) {\n if (a == null || b == null) {\n return false;\n }\n if (a === b) {\n return true;\n }\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n var viewA = new DataView(a);\n var viewB = new DataView(b);\n for (var i = 0; i < a.byteLength; i++) {\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "0f9a2325f4bba54f1a54ab530551cef1", "score": "0.57529104", "text": "function isArrayBufferEqual(a, b) {\n if (a == null || b == null) {\n return false;\n }\n\n if (a === b) {\n return true;\n }\n\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n var viewA = new DataView(a);\n var viewB = new DataView(b);\n\n for (var i = 0; i < a.byteLength; i++) {\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "0f9a2325f4bba54f1a54ab530551cef1", "score": "0.57529104", "text": "function isArrayBufferEqual(a, b) {\n if (a == null || b == null) {\n return false;\n }\n\n if (a === b) {\n return true;\n }\n\n if (a.byteLength !== b.byteLength) {\n return false;\n }\n\n var viewA = new DataView(a);\n var viewB = new DataView(b);\n\n for (var i = 0; i < a.byteLength; i++) {\n if (viewA.getUint8(i) !== viewB.getUint8(i)) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "46b7ba719febe08a3278dcfa00453224", "score": "0.5741881", "text": "arrayToBuffer (array, ArrayType = Float64Array) {\n if (array.constructor === Array) array = new ArrayType(array)\n return new Uint8Array(array.buffer)\n }", "title": "" }, { "docid": "bcf8bb2f49cf4d121ee8303c9b635046", "score": "0.5741065", "text": "function int8ToUint8ClampedTest() {\n var b1, b2;\n var v1, v2;\n\n // Simple case.\n\n b1 = new ArrayBuffer(5);\n b2 = new ArrayBuffer(5);\n v1 = new Uint8ClampedArray(b1);\n v2 = new Int8Array(b2);\n\n v2.set([1, -40, 2, -128, 127]);\n print(Duktape.enc('jx', b1), Duktape.enc('jx', b2));\n v1.set(v2);\n print(Duktape.enc('jx', b1), Duktape.enc('jx', b2));\n\n // Overlap case 1\n\n b1 = new ArrayBuffer(7);\n v1 = new Uint8ClampedArray(b1, 0, 5);\n v2 = new Int8Array(b1, 2, 5);\n\n v2.set([1, -40, 2, -128, 127]);\n print(Duktape.enc('jx', b1));\n v1.set(v2);\n print(Duktape.enc('jx', b1));\n\n // Overlap case 2\n\n b1 = new ArrayBuffer(7);\n v1 = new Uint8ClampedArray(b1, 2, 5);\n v2 = new Int8Array(b1, 0, 5);\n\n v2.set([1, -40, 2, -128, 127]);\n print(Duktape.enc('jx', b1));\n v1.set(v2);\n print(Duktape.enc('jx', b1));\n}", "title": "" }, { "docid": "847f1290ff8f1b6ffdd2cf6ad5b0f0c7", "score": "0.57302904", "text": "function copyBuffer(sourceBuffer) {\n var source = new Uint8Array(sourceBuffer);\n var copy = new Uint8Array(sourceBuffer.byteLength)\n\n for (var i=0; i<source.byteLength; i++) {\n copy[i] = source[i];\n }\n\n return copy;\n }", "title": "" }, { "docid": "ceb3f3ac350b73b3c1d752ae28bc3640", "score": "0.5679013", "text": "function toNewUint8Array(buf) {\n const arrayBuffer = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n return new Uint8Array(arrayBuffer);\n}", "title": "" }, { "docid": "a7bdf178176a09a698162279d5a475e2", "score": "0.56676406", "text": "ensureAvailable() {\n let byteLength = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n\n if (!this.available(byteLength)) {\n const lengthNeeded = this.offset + byteLength;\n const newLength = lengthNeeded * 2;\n const newArray = new Uint8Array(newLength);\n newArray.set(new Uint8Array(this.buffer));\n this.buffer = newArray.buffer;\n this.length = this.byteLength = newLength;\n this._data = new DataView(this.buffer);\n }\n\n return this;\n }", "title": "" }, { "docid": "ee0cfd13b79deaabc40c738e4e65ab80", "score": "0.5667493", "text": "function bufferFromArrayBuffer(arrayBuffer) {\n const buffer = Buffer.alloc(arrayBuffer.byteLength);\n const view = new Uint8Array(arrayBuffer);\n\n for (let i = 0; i < buffer.length; ++i) {\n buffer[i] = view[i];\n }\n\n return buffer;\n}", "title": "" }, { "docid": "c9e505e927c354a5544bc65cbfe3df98", "score": "0.56621575", "text": "function copyBuffer(sourceBuffer) {\n var source = new Uint8Array(sourceBuffer);\n var copy = new Uint8Array(sourceBuffer.byteLength)\n\n for (var i=0; i<source.byteLength; i++) {\n copy[i] = source[i];\n }\n\n return copy;\n }", "title": "" }, { "docid": "cd99cd9276ddff744dd5d0b81112204e", "score": "0.5615279", "text": "function diffImageBuffers(buffer1, buffer2) {\n const png1 = pngjs_1.PNG.sync.read(buffer1);\n const png2 = pngjs_1.PNG.sync.read(buffer2);\n var diff = new pngjs_1.PNG({ width: png1.width, height: png1.height });\n var diffs = pixelmatch_1.default(png1.data, png2.data, diff.data, diff.width, diff.height);\n return [diffs, diff];\n}", "title": "" }, { "docid": "e103f55d04bec173a21f6d24dd1453a0", "score": "0.55897605", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n }", "title": "" }, { "docid": "6ae185151028fe95a6e15ecce161a037", "score": "0.5581866", "text": "function concatenate(arrays) {\n let totalLength = 0;\n for (const arr of arrays) {\n totalLength += arr.length;\n }\n const result = new Int8Array(totalLength);\n let offset = 0;\n for (const arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n }", "title": "" }, { "docid": "2915372129cd98a24610c7f30aaa9d1a", "score": "0.5557202", "text": "asUint8Array() {\n return new Uint8Array(this.array.buffer, this.array.byteOffset, this.length);\n }", "title": "" }, { "docid": "e5680166f64d23df920f07e53d72556a", "score": "0.55511934", "text": "toArray() {\n return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);\n }", "title": "" }, { "docid": "a6463b6b3f642f3956f0945246176afb", "score": "0.55397844", "text": "function Buffer(subject, encoding, offset) {\n // The actual buffer that will become 'this'.\n var buf;\n var type;\n\n // Are we slicing?\n if (typeof offset === 'number') {\n // create a sub-view\n buf = subject.subarray(offset, coerce(encoding) + offset);\n } else {\n // Find the length\n switch (type = typeof subject) {\n case 'number':\n buf = new Uint8Array(coerce(subject));\n break;\n\n case 'string':\n buf = encode(subject, encoding);\n break;\n\n case 'object': // Assume object is an array\n // only use it verbatim if it's a buffer and we see it as such (aka\n // it's from our compartment)\n if (buf instanceof Uint8Array)\n buf = subject;\n else\n buf = new Uint8Array(subject);\n break;\n\n default:\n throw new Error('First argument needs to be a number, ' +\n 'array or string.');\n }\n }\n\n // Return the mixed-in Uint8Array to be our 'this'!\n return buf;\n}", "title": "" }, { "docid": "ae4729b223411952783628fb85b28cba", "score": "0.55274945", "text": "function arrayBufferCopy(src, dst, dstByteOffset, numBytes) {\n var i;\n var dst32Offset = dstByteOffset / 4;\n var tail = (numBytes % 4);\n var src32 = new Uint32Array(src.buffer, 0, (numBytes - tail) / 4);\n var dst32 = new Uint32Array(dst.buffer);\n for (i = 0; i < src32.length; i++) {\n dst32[dst32Offset + i] = src32[i];\n }\n for (i = numBytes - tail; i < numBytes; i++) {\n dst[dstByteOffset + i] = src[i];\n }\n }", "title": "" }, { "docid": "ae4729b223411952783628fb85b28cba", "score": "0.55274945", "text": "function arrayBufferCopy(src, dst, dstByteOffset, numBytes) {\n var i;\n var dst32Offset = dstByteOffset / 4;\n var tail = (numBytes % 4);\n var src32 = new Uint32Array(src.buffer, 0, (numBytes - tail) / 4);\n var dst32 = new Uint32Array(dst.buffer);\n for (i = 0; i < src32.length; i++) {\n dst32[dst32Offset + i] = src32[i];\n }\n for (i = numBytes - tail; i < numBytes; i++) {\n dst[dstByteOffset + i] = src[i];\n }\n }", "title": "" }, { "docid": "c9c37983d68e1ba320f24263a9f3f8bb", "score": "0.5494179", "text": "function newByteArr(n) {\n return new ByteArray(new ArrayBuffer(n));\n}", "title": "" }, { "docid": "c9c37983d68e1ba320f24263a9f3f8bb", "score": "0.5494179", "text": "function newByteArr(n) {\n return new ByteArray(new ArrayBuffer(n));\n}", "title": "" }, { "docid": "8ae0879c30e4a66d21290b5f1658b5c4", "score": "0.54876053", "text": "createBinaryChunk() {\n // Already packed\n if (this.arrayBuffer) {\n return;\n }\n\n // Allocate total array\n const totalByteLength = this.byteLength;\n const arrayBuffer = new ArrayBuffer(totalByteLength);\n const targetArray = new Uint8Array(arrayBuffer);\n\n // Copy each array into\n let dstByteOffset = 0;\n for (let i = 0; i < this.sourceBuffers.length; i++) {\n const sourceBuffer = this.sourceBuffers[i];\n dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);\n }\n\n // Update the glTF BIN CHUNK byte length\n this.json.buffers[0].byteLength = totalByteLength;\n\n // Save generated arrayBuffer\n this.arrayBuffer = arrayBuffer;\n\n // Clear out sourceBuffers\n this.sourceBuffers = [];\n }", "title": "" }, { "docid": "0d8d1930e7165fa6e58082d0e7568ad4", "score": "0.54657775", "text": "function testExtBufferArray(type) {\n function content(j) {\n var x = j * type;\n return Buffer([x & 0x7F, (x + 1) & 0x7F]);\n }\n // fixarray len 10\n var arrayHeader = new Buffer([0x9a]);\n var fullBuffer = arrayHeader;\n for (var j = 0; j < 10; j++) {\n // fixext 2 -- 0xd5\n var header = new Buffer([0xd5, type]);\n fullBuffer = Buffer.concat([fullBuffer, header, content(j)]);\n }\n var decoded = msgpack.decode(fullBuffer);\n assert.equal(true, decoded instanceof Array);\n assert.equal(decoded.length, 10);\n for (j = 0; j < 10; j++) {\n assert.equal(decoded[j].type, type);\n assert.equal(decoded[j].buffer.length, 2);\n assert.deepEqual(decoded[j].buffer, content(j));\n }\n var encoded = msgpack.encode(decoded);\n assert.deepEqual(encoded, fullBuffer);\n }", "title": "" }, { "docid": "58039bfc7ba9588b704052ee479d505d", "score": "0.54627705", "text": "function arrayToBuffer(array) {\r\n const uints = new Uint8Array(array);\r\n return uints.buffer;\r\n}", "title": "" }, { "docid": "f080c68445213fa46bc7c1c9f5bc643d", "score": "0.546148", "text": "function compareArrayBuffer(value1, value2) {\n 'use strict';\n var arr1 = new Uint8ClampedArray(value1),\n arr2 = new Uint8ClampedArray(value2),\n diff = 0,\n i;\n if (arr1.length !== arr2.length) {\n return 0;\n }\n for (i = 0; i < arr1.length; i += 1) {\n diff += Math.abs(arr1[i] - arr2[i]);\n }\n diff /= arr1.length;\n return 1 / Math.max(1, diff);\n}", "title": "" }, { "docid": "a9272841df3bb7fd8ecd8956ebfda63c", "score": "0.54422927", "text": "sendArrayBuffer(ab) {\n\n //is it just me or are arraybuffers a nightmare without the 100 polyfills otherwise available in npm\n function chunkArray(array, chunkSize){\n var chunks = [];\n for (let i = 0; i < array.length; i += chunkSize) {\n chunks.push(array.slice(i, i + chunkSize));\n }\n return chunks;\n }\n\n //http://2ality.com/2015/10/concatenating-typed-arrays.html\n function concatenate(resultConstructor, ...arrays) {\n let totalLength = 0;\n for (let arr of arrays) {\n totalLength += arr.length;\n }\n let result = new resultConstructor(totalLength);\n let offset = 0;\n for (let arr of arrays) {\n result.set(arr, offset);\n offset += arr.length;\n }\n return result;\n }\n\n //https://gist.github.com/tokland/71c483c89903da417d7062af009da571\n function promiseMap(items, mapper) {\n const reducer = (promise, item) => \n promise.then(mappedItems => mapper(item).then(res => mappedItems.concat([res])));\n return items.reduce(reducer, Promise.resolve([]));\n }\n\n var packetCount = Math.ceil((ab.byteLength + 1) / 20);\n var frame = concatenate(Uint8Array, Uint8Array.of(packetCount), new Uint8Array(ab));\n const chunks = chunkArray(frame, 20);\n\n return promiseMap(chunks, this._writeCharacteristicValue.bind(this, JS_TX_CHAR_UUID))\n .then(function(result){\n // we never get here except on success, result is [undefined] or an array of [,,]\n // instead of just return undefined as characteristic.writeValue does, return the chunked data we sent\n return chunks;\n });\n }", "title": "" }, { "docid": "7b394087b8bfa8f58cb753ec48dbd517", "score": "0.54366946", "text": "alloc(length, fill = 0 /*, enc*/ ) {\n return SeaArray.from(new Uint8Array(Array.from({ length: length }, () => fill)))\n }", "title": "" }, { "docid": "28662041d213a79372e3bc49e4700ecf", "score": "0.5435251", "text": "ensureAvailable(byteLength = 1) {\n if (!this.available(byteLength)) {\n const lengthNeeded = this.offset + byteLength;\n const newLength = lengthNeeded * 2;\n const newArray = new Uint8Array(newLength);\n newArray.set(new Uint8Array(this.buffer));\n this.buffer = newArray.buffer;\n this.length = this.byteLength = newLength;\n this._data = new DataView(this.buffer);\n }\n return this;\n }", "title": "" }, { "docid": "1ff9b608d227997b64f7f75bc3f71570", "score": "0.5434469", "text": "concatArrays (array1, array2) {\n const Type = array1.constructor\n if (Type === Array)\n return array1.concat(this.convertArray(array2, Array))\n const array = new Type(array1.length + array2.length)\n // NOTE: typedArray.set() allows any Array or TypedArray arg\n array.set(array1); array.set(array2, array1.length)\n return array\n }", "title": "" }, { "docid": "a31b9a4ceb082692ff6b7f1aadf49a23", "score": "0.5432322", "text": "static initializeBuffers() {\n this.displayBuffer = new Array(this.width);\n this.drawBuffer = new Array(this.width);\n this.depthBuffer = new Array(this.width);\n for (let i = 0; i < this.width; i++) {\n this.displayBuffer[i] = new Array(this.height);\n this.drawBuffer[i] = new Array(this.height);\n this.depthBuffer[i] = new Array(this.height);\n }\n }", "title": "" }, { "docid": "d068c447b068630c875e83bd1f73e606", "score": "0.54313356", "text": "function uint8Array2Buffer(u8) {\n if (u8 instanceof Buffer) {\n return u8;\n } else if (u8.byteOffset === 0 && u8.byteLength === u8.buffer.byteLength) {\n return arrayBuffer2Buffer(u8.buffer);\n } else {\n return Buffer.from(u8.buffer, u8.byteOffset, u8.byteLength);\n }\n}", "title": "" }, { "docid": "93c7dbf36ee6d2b2afe62ecc4098ee5e", "score": "0.54262996", "text": "toArray() {\n return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);\n }", "title": "" }, { "docid": "408247aa2334bb5fb4c9f447eb6703d1", "score": "0.5417719", "text": "function fromTypedArray (that, array) { // 170\n var length = checked(array.length) | 0 // 171\n that = allocate(that, length) // 172\n // Truncating the elements is probably not what people expect from typed // 173\n // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior // 174\n // of the old Buffer constructor. // 175\n for (var i = 0; i < length; i += 1) { // 176\n that[i] = array[i] & 255 // 177\n } // 178\n return that // 179\n} // 180", "title": "" }, { "docid": "27466614b839e5adb885de66be708fa7", "score": "0.5413855", "text": "allocUnsafe(length) {\n return SeaArray.from(new Uint8Array(Array.from({ length : length })))\n }", "title": "" }, { "docid": "2d3a415a383d57406436f59000f0fc8a", "score": "0.5413837", "text": "getUint8Array()\n {\n let arr = new Uint8Array(this.width * this.height * 4);\n\n let counter = 0;\n\n for(let i = 0; i < this.height; i++)\n {\n for(let j = 0; j < this.width; j++)\n {\n arr[counter++] = this.data[i][j][0];\n arr[counter++] = this.data[i][j][1];\n arr[counter++] = this.data[i][j][2];\n arr[counter++] = this.data[i][j][3];\n }\n }\n\n return arr;\n }", "title": "" }, { "docid": "736efac271f0712f7b77313d5c33a4e8", "score": "0.53996897", "text": "initBuffers(params) {\n\n return {...createPositionAndIndexBuffers(params),\n ...createNormalBuffers(params),\n ...createTextureCoordsBuffers(params),\n texture : params.texture,\n }\n }", "title": "" }, { "docid": "ca3f224a2a1974b569a0707ce474aff3", "score": "0.5399337", "text": "function xor(buffer1, buffer2) {\n var length = Math.min(buffer1.length, buffer2.length);\n var retBuffer = new Buffer(length);\n for (var i = 0; i < length; i++) {\n retBuffer[i] = buffer1[i] ^ buffer2[i];\n }\n return retBuffer;\n}", "title": "" }, { "docid": "99c55156894a00fbd93ed30e6f1539c9", "score": "0.5395298", "text": "function getArrayBufferAtOffset(arrayBuffer, byteOffset) {\n const length = arrayBuffer.byteLength - byteOffset;\n const binaryBuffer = new ArrayBuffer(length);\n const sourceArray = new Uint8Array(arrayBuffer);\n const binaryArray = new Uint8Array(binaryBuffer);\n for (let i = 0; i < length; i++) {\n binaryArray[i] = sourceArray[byteOffset + i];\n }\n return binaryBuffer;\n}", "title": "" }, { "docid": "6823217aa7e4247cdb205f20b0166530", "score": "0.53859776", "text": "function getBlobDataAtOnce() {\n byteNumbers = new Array(byteCharacters.length);\n\n for (var i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n\n byteArray = new Uint8Array(byteNumbers);\n\n return [byteArray];\n }", "title": "" }, { "docid": "1f5ed5944221b6995f48660db459b30f", "score": "0.5381208", "text": "function TypedArray_copy(ptr, num) {\n // TODO: optimize this!\n var arr = new Uint8Array(num);\n for (var i = 0; i < num; ++i) {\n arr[i] = HEAP8[(ptr+i)];\n }\n return arr.buffer;\n}", "title": "" }, { "docid": "1f5ed5944221b6995f48660db459b30f", "score": "0.5381208", "text": "function TypedArray_copy(ptr, num) {\n // TODO: optimize this!\n var arr = new Uint8Array(num);\n for (var i = 0; i < num; ++i) {\n arr[i] = HEAP8[(ptr+i)];\n }\n return arr.buffer;\n}", "title": "" }, { "docid": "b7de624ab325d26d77563de09c499f74", "score": "0.5379138", "text": "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "title": "" }, { "docid": "b7de624ab325d26d77563de09c499f74", "score": "0.5379138", "text": "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "title": "" }, { "docid": "b7de624ab325d26d77563de09c499f74", "score": "0.5379138", "text": "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "title": "" }, { "docid": "b7de624ab325d26d77563de09c499f74", "score": "0.5379138", "text": "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "title": "" }, { "docid": "b7de624ab325d26d77563de09c499f74", "score": "0.5379138", "text": "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "title": "" }, { "docid": "b7de624ab325d26d77563de09c499f74", "score": "0.5379138", "text": "function wrapByteArr(buffer) {\n var diff = buffer.byteLength % 8;\n if(diff != 0) {\n var buffer = buffer.slice(0, buffer.byteLength-diff);\n }\n return new ByteArray(buffer);\n}", "title": "" }, { "docid": "41f07f7fabd8f17118629cfae0bf65c2", "score": "0.53773266", "text": "function augment (arr) {\n arr._isBuffer = true\n\n // save reference to original Uint8Array get/set methods before overwriting\n arr._get = arr.get\n arr._set = arr.set\n\n // deprecated, will be removed in node 0.13+\n arr.get = BP.get\n arr.set = BP.set\n\n arr.write = BP.write\n arr.toString = BP.toString\n arr.toLocaleString = BP.toString\n arr.toJSON = BP.toJSON\n arr.copy = BP.copy\n arr.slice = BP.slice\n arr.readUInt8 = BP.readUInt8\n arr.readUInt16LE = BP.readUInt16LE\n arr.readUInt16BE = BP.readUInt16BE\n arr.readUInt32LE = BP.readUInt32LE\n arr.readUInt32BE = BP.readUInt32BE\n arr.readInt8 = BP.readInt8\n arr.readInt16LE = BP.readInt16LE\n arr.readInt16BE = BP.readInt16BE\n arr.readInt32LE = BP.readInt32LE\n arr.readInt32BE = BP.readInt32BE\n arr.readFloatLE = BP.readFloatLE\n arr.readFloatBE = BP.readFloatBE\n arr.readDoubleLE = BP.readDoubleLE\n arr.readDoubleBE = BP.readDoubleBE\n arr.writeUInt8 = BP.writeUInt8\n arr.writeUInt16LE = BP.writeUInt16LE\n arr.writeUInt16BE = BP.writeUInt16BE\n arr.writeUInt32LE = BP.writeUInt32LE\n arr.writeUInt32BE = BP.writeUInt32BE\n arr.writeInt8 = BP.writeInt8\n arr.writeInt16LE = BP.writeInt16LE\n arr.writeInt16BE = BP.writeInt16BE\n arr.writeInt32LE = BP.writeInt32LE\n arr.writeInt32BE = BP.writeInt32BE\n arr.writeFloatLE = BP.writeFloatLE\n arr.writeFloatBE = BP.writeFloatBE\n arr.writeDoubleLE = BP.writeDoubleLE\n arr.writeDoubleBE = BP.writeDoubleBE\n arr.fill = BP.fill\n arr.inspect = BP.inspect\n arr.toArrayBuffer = BP.toArrayBuffer\n\n return arr\n}", "title": "" }, { "docid": "41f07f7fabd8f17118629cfae0bf65c2", "score": "0.53773266", "text": "function augment (arr) {\n arr._isBuffer = true\n\n // save reference to original Uint8Array get/set methods before overwriting\n arr._get = arr.get\n arr._set = arr.set\n\n // deprecated, will be removed in node 0.13+\n arr.get = BP.get\n arr.set = BP.set\n\n arr.write = BP.write\n arr.toString = BP.toString\n arr.toLocaleString = BP.toString\n arr.toJSON = BP.toJSON\n arr.copy = BP.copy\n arr.slice = BP.slice\n arr.readUInt8 = BP.readUInt8\n arr.readUInt16LE = BP.readUInt16LE\n arr.readUInt16BE = BP.readUInt16BE\n arr.readUInt32LE = BP.readUInt32LE\n arr.readUInt32BE = BP.readUInt32BE\n arr.readInt8 = BP.readInt8\n arr.readInt16LE = BP.readInt16LE\n arr.readInt16BE = BP.readInt16BE\n arr.readInt32LE = BP.readInt32LE\n arr.readInt32BE = BP.readInt32BE\n arr.readFloatLE = BP.readFloatLE\n arr.readFloatBE = BP.readFloatBE\n arr.readDoubleLE = BP.readDoubleLE\n arr.readDoubleBE = BP.readDoubleBE\n arr.writeUInt8 = BP.writeUInt8\n arr.writeUInt16LE = BP.writeUInt16LE\n arr.writeUInt16BE = BP.writeUInt16BE\n arr.writeUInt32LE = BP.writeUInt32LE\n arr.writeUInt32BE = BP.writeUInt32BE\n arr.writeInt8 = BP.writeInt8\n arr.writeInt16LE = BP.writeInt16LE\n arr.writeInt16BE = BP.writeInt16BE\n arr.writeInt32LE = BP.writeInt32LE\n arr.writeInt32BE = BP.writeInt32BE\n arr.writeFloatLE = BP.writeFloatLE\n arr.writeFloatBE = BP.writeFloatBE\n arr.writeDoubleLE = BP.writeDoubleLE\n arr.writeDoubleBE = BP.writeDoubleBE\n arr.fill = BP.fill\n arr.inspect = BP.inspect\n arr.toArrayBuffer = BP.toArrayBuffer\n\n return arr\n}", "title": "" }, { "docid": "41f07f7fabd8f17118629cfae0bf65c2", "score": "0.53773266", "text": "function augment (arr) {\n arr._isBuffer = true\n\n // save reference to original Uint8Array get/set methods before overwriting\n arr._get = arr.get\n arr._set = arr.set\n\n // deprecated, will be removed in node 0.13+\n arr.get = BP.get\n arr.set = BP.set\n\n arr.write = BP.write\n arr.toString = BP.toString\n arr.toLocaleString = BP.toString\n arr.toJSON = BP.toJSON\n arr.copy = BP.copy\n arr.slice = BP.slice\n arr.readUInt8 = BP.readUInt8\n arr.readUInt16LE = BP.readUInt16LE\n arr.readUInt16BE = BP.readUInt16BE\n arr.readUInt32LE = BP.readUInt32LE\n arr.readUInt32BE = BP.readUInt32BE\n arr.readInt8 = BP.readInt8\n arr.readInt16LE = BP.readInt16LE\n arr.readInt16BE = BP.readInt16BE\n arr.readInt32LE = BP.readInt32LE\n arr.readInt32BE = BP.readInt32BE\n arr.readFloatLE = BP.readFloatLE\n arr.readFloatBE = BP.readFloatBE\n arr.readDoubleLE = BP.readDoubleLE\n arr.readDoubleBE = BP.readDoubleBE\n arr.writeUInt8 = BP.writeUInt8\n arr.writeUInt16LE = BP.writeUInt16LE\n arr.writeUInt16BE = BP.writeUInt16BE\n arr.writeUInt32LE = BP.writeUInt32LE\n arr.writeUInt32BE = BP.writeUInt32BE\n arr.writeInt8 = BP.writeInt8\n arr.writeInt16LE = BP.writeInt16LE\n arr.writeInt16BE = BP.writeInt16BE\n arr.writeInt32LE = BP.writeInt32LE\n arr.writeInt32BE = BP.writeInt32BE\n arr.writeFloatLE = BP.writeFloatLE\n arr.writeFloatBE = BP.writeFloatBE\n arr.writeDoubleLE = BP.writeDoubleLE\n arr.writeDoubleBE = BP.writeDoubleBE\n arr.fill = BP.fill\n arr.inspect = BP.inspect\n arr.toArrayBuffer = BP.toArrayBuffer\n\n return arr\n}", "title": "" }, { "docid": "ace7dc422ca31bd1c06e888ea21328cd", "score": "0.5365656", "text": "function fromTypedArray(that, array) {\n var length = checked(array.length) | 0\n that = allocate(that, length)\n // Truncating the elements is probably not what people expect from typed\n // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior\n // of the old Buffer constructor.\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n }", "title": "" }, { "docid": "477c9fe1a57b91fae1e3df33ec610901", "score": "0.53595793", "text": "alloc(length, fill = 0 /*, enc*/ ) {\n return SeaArray.from(new Uint8Array(Array.from({ length: length }, () => fill)))\n }", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "99b9de6d8421ec10d1f972fef2fd9546", "score": "0.5359331", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "21ee6fa3a6e5f6afe705936e9c17c0ee", "score": "0.5343797", "text": "function toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n getByteLength(bufferSource)\n );\n}", "title": "" }, { "docid": "22b070a5ced31905c10507159b1a5612", "score": "0.53398055", "text": "function fromTypedArray(that, array) {\n var length = checked(array.length) | 0\n that = allocate(that, length)\n // Truncating the elements is probably not what people expect from typed\n // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior\n // of the old Buffer constructor.\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n }", "title": "" }, { "docid": "f6cd21782b5557182c0596fbf10d566d", "score": "0.53336066", "text": "concat(arr) { // octet array\n if (!Array.isArray(arr)) {\n throw new TypeError('First argument must be Array containing ArrayBuffer or Uint8Array instances.')\n }\n return SeaArray.from(arr.reduce((ret, item) => ret.concat(Array.from(item)), []))\n }", "title": "" }, { "docid": "dcb3802c9b3b85650f084ce61f670437", "score": "0.5327066", "text": "createBinaryChunk() {\n // Already packed\n if (this.arrayBuffer) {\n return;\n }\n\n // Allocate total array\n const totalByteLength = this.byteLength;\n const arrayBuffer = new ArrayBuffer(totalByteLength);\n const targetArray = new Uint8Array(arrayBuffer);\n\n // Copy each array into\n let dstByteOffset = 0;\n for (let i = 0; i < this.sourceBuffers.length; i++) {\n const sourceBuffer = this.sourceBuffers[i];\n dstByteOffset = Object(_loaders_gl_loader_utils__WEBPACK_IMPORTED_MODULE_1__[\"copyToArray\"])(sourceBuffer, targetArray, dstByteOffset);\n }\n\n // Update the glTF BIN CHUNK byte length\n this.json.buffers[0].byteLength = totalByteLength;\n\n // Save generated arrayBuffer\n this.arrayBuffer = arrayBuffer;\n\n // Clear out sourceBuffers\n this.sourceBuffers = [];\n }", "title": "" }, { "docid": "d03858395a0f25d731f9db15ac0829d0", "score": "0.5326814", "text": "function offsetTest() {\n var b1 = new ArrayBuffer(32);\n var v1 = new Uint32Array(b1);\n\n var b2 = new ArrayBuffer(16);\n var v2a = new Uint32Array(b2, 0, 4);\n var v2b = new Int16Array(b2, 0, 4);\n var v2c = new Uint8Array(b2, 0, 4);\n\n function initBuffers() {\n var i;\n var v;\n\n // Ensure values include both positive/negative values\n // for integer views.\n v = new Uint8Array(b1);\n for (i = 0; i < v.length; i++) {\n v[i] = i * 0x11;\n }\n v = new Uint8Array(b2);\n for (i = 0; i < v.length; i++) {\n v[i] = (i + 5) * 0x13;\n }\n }\n\n [ v1 ].forEach(function (thisValue, idx1) {\n [ v2a, v2b, v2c ].forEach(function (argValue, idx2) {\n [ 0, 1, 2, 3, 4 ].forEach(function (offset, idx3) {\n try {\n initBuffers();\n thisValue.set(argValue, offset);\n print(idx1, idx2, idx3, offset, printableBuffer(b1), printableBuffer(b2));\n } catch (e) {\n print(idx1, idx2, idx3, offset, e.name, printableBuffer(b1), printableBuffer(b2));\n }\n });\n });\n });\n}", "title": "" }, { "docid": "32b016784ceadd5800966a42ec82f821", "score": "0.5320321", "text": "function combineRequests(requests) {\n const buf = new SerialBuffer;\n buf.pushVaruint32(requests.length);\n for (let request of requests)\n buf.pushBytes(request);\n return buf.asUint8Array();\n }", "title": "" }, { "docid": "4b9b48afb551cbc65f92eb86a71115dd", "score": "0.53059196", "text": "function newByteArr(n) {\n // Pad the thing to multiples of 8.\n var padding = 8 - n % 8;\n if(padding < 8) {\n n += padding;\n }\n var arr = {};\n var buffer = new ArrayBuffer(n);\n var views = {};\n views['i8'] = new Int8Array(buffer);\n views['i16'] = new Int16Array(buffer);\n views['i32'] = new Int32Array(buffer);\n views['w8'] = new Uint8Array(buffer);\n views['w16'] = new Uint16Array(buffer);\n views['w32'] = new Uint32Array(buffer);\n views['f32'] = new Float32Array(buffer);\n views['f64'] = new Float64Array(buffer);\n arr['b'] = buffer;\n arr['v'] = views;\n // ByteArray and Addr are the same thing, so keep an offset if we get\n // casted.\n arr['off'] = 0;\n return arr;\n}", "title": "" }, { "docid": "b0a8d78aa95442e6a14d33bcca26bfc3", "score": "0.5304849", "text": "allocUnsafe(length) {\n return SeaArray.from(new Uint8Array(Array.from({ length : length })))\n }", "title": "" }, { "docid": "ba9543b28dcc1f0ea721f0b466ac4f41", "score": "0.53016156", "text": "getTypedArrayForImageData(image) {\n image = this.getAccessor(image);\n const bufferView = this.getBuffer(image.bufferView);\n const buffer = this.getBuffer(bufferView.buffer);\n const arrayBuffer = buffer.data;\n\n const byteOffset = bufferView.byteOffset || 0;\n return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);\n }", "title": "" }, { "docid": "ba9543b28dcc1f0ea721f0b466ac4f41", "score": "0.53016156", "text": "getTypedArrayForImageData(image) {\n image = this.getAccessor(image);\n const bufferView = this.getBuffer(image.bufferView);\n const buffer = this.getBuffer(bufferView.buffer);\n const arrayBuffer = buffer.data;\n\n const byteOffset = bufferView.byteOffset || 0;\n return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);\n }", "title": "" }, { "docid": "817e5f9a2cad61d81bdaec9eb3e2d486", "score": "0.5300067", "text": "updateDownloadData(){\n \n var data = new Uint8Array(this.SequenceCounter * 2);\n for(var i = 0 ; i < this.SequenceCounter ; i++){\n \n var split1 = (this.Sequence[i].getOpcode() & 0xFF00) >> 8;\n var split2 = (this.Sequence[i].getOpcode() & 0x00FF);\n \n var e = i * 2;\n\n data[e] = split1;\n data[e+1] = split2;\n }\n return data;\n }", "title": "" }, { "docid": "daa45dce67da19eace3469ea8b671a7c", "score": "0.5290372", "text": "init_FrameBuffer()\n {\n let width = this.game.canvas.width\n let height = this.game.canvas.height\n\n/* this.FrameBuffer = (new Array(width).fill(0)).map((item) => {\n return new Array(height).fill(this.DEFAULT_FRAMEBUFFER_COLOR)\n })*/\n //this.FrameBuffer = new Array(width * height * 4).fill(0)\n this.FrameBuffer = new Uint8ClampedArray(width * height * 4).fill(0)\n }", "title": "" }, { "docid": "392c13972a698722862a1049ca867634", "score": "0.5264479", "text": "function ensureBytesEqual(a, b) {\n if (a.length !== b.length) {\n throw new Error(`Different lengths ${a.length} vs ${b.length}`);\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n throw new Error(`Arrays differ at index ${i}: ${a[i]} vs ${b[i]}`);\n }\n }\n}", "title": "" } ]
51347e619e18f4c990d8f6b9cede72ab
Get a valid SAS for blob
[ { "docid": "3149c0de16b4ea361ba3ee751e432cb2", "score": "0.7142454", "text": "async getValidSASForBlob(blobURL) {\n if (this.sasCache[blobURL] && this.isSasStillValidInNext2Mins(this.sasCache[blobURL])) {\n return this.sasCache[blobURL];\n } else {\n return (this.sasCache[blobURL] = await this.getNewSasForBlob(blobURL));\n }\n }", "title": "" } ]
[ { "docid": "5d23f5bf9d3bda6ad62211c9df96f42e", "score": "0.7099312", "text": "function fetchSAS(filename) {\n return fetch('/sas', {\n method: 'POST',\n body: JSON.stringify({\n filename: filename\n }),\n headers: {\n 'Content-Type': 'application/json',\n }\n }).then(res => res.json())\n .then(res => {\n if (!filename) {\n return AzureStorage.Blob.createBlobServiceWithSas(\n res.uri, \n res.params\n )\n } else {\n return `${res.uri}?${res.params}`\n }\n })\n}", "title": "" }, { "docid": "efb0fd8bef3db443329436ecec74bb4a", "score": "0.6762684", "text": "async getNewSasForBlob(blobURL) {\n // TODO: You need to implement this\n return \"?newSAS\";\n }", "title": "" }, { "docid": "7056f439b3e5be2d6ebacd3dd520e31a", "score": "0.5905822", "text": "function isSASCredential(credential) {\n return (isObjectWithProperties(credential, [\"signature\"]) && typeof credential.signature === \"string\");\n}", "title": "" }, { "docid": "f381da4f4a51284edb0e531be0ac7319", "score": "0.5720758", "text": "function generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n if (!blobSASSignatureValues.identifier &&\n !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n blobSASSignatureValues.identifier,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : \"\",\n blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : \"\",\n blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : \"\",\n blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : \"\",\n blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : \"\",\n ].join(\"\\n\");\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType);\n}", "title": "" }, { "docid": "9ee771890aae921f2d855a3451f91999", "score": "0.5693784", "text": "function generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n if (!blobSASSignatureValues.identifier &&\n !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.\");\n }\n let resource = \"c\";\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n blobSASSignatureValues.identifier,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : \"\",\n blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : \"\",\n blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : \"\",\n blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : \"\",\n blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : \"\",\n ].join(\"\\n\");\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType);\n}", "title": "" }, { "docid": "33e41e6227c1a16725fe09f3c0e61b9c", "score": "0.56509787", "text": "function generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n if (!blobSASSignatureValues.identifier &&\n !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n blobSASSignatureValues.identifier,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.encryptionScope,\n blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : \"\",\n blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : \"\",\n blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : \"\",\n blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : \"\",\n blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : \"\",\n ].join(\"\\n\");\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope);\n}", "title": "" }, { "docid": "507573e9c8dd46822146be18cef88eee", "score": "0.5421289", "text": "function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) {\n const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;\n const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential\n ? sharedKeyCredentialOrUserDelegationKey\n : undefined;\n let userDelegationKeyCredential;\n if (sharedKeyCredential === undefined && accountName !== undefined) {\n userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey);\n }\n if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {\n throw TypeError(\"Invalid sharedKeyCredential, userDelegationKey or accountName.\");\n }\n // Version 2020-12-06 adds support for encryptionscope in SAS.\n if (version >= \"2020-12-06\") {\n if (sharedKeyCredential !== undefined) {\n return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);\n }\n else {\n return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);\n }\n }\n // Version 2019-12-12 adds support for the blob tags permission.\n // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string\n if (version >= \"2018-11-09\") {\n if (sharedKeyCredential !== undefined) {\n return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential);\n }\n else {\n // Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId.\n if (version >= \"2020-02-10\") {\n return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential);\n }\n else {\n return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);\n }\n }\n }\n if (version >= \"2015-04-05\") {\n if (sharedKeyCredential !== undefined) {\n return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential);\n }\n else {\n throw new RangeError(\"'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.\");\n }\n }\n throw new RangeError(\"'version' must be >= '2015-04-05'.\");\n}", "title": "" }, { "docid": "46fafc151c2310e20efb218bae4d99ed", "score": "0.54107517", "text": "function generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n // Stored access policies are not supported for a user delegation SAS.\n if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n userDelegationKeyCredential.userDelegationKey.signedObjectId,\n userDelegationKeyCredential.userDelegationKey.signedTenantId,\n userDelegationKeyCredential.userDelegationKey.signedStartsOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedExpiresOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedService,\n userDelegationKeyCredential.userDelegationKey.signedVersion,\n blobSASSignatureValues.preauthorizedAgentObjectId,\n undefined,\n blobSASSignatureValues.correlationId,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.cacheControl,\n blobSASSignatureValues.contentDisposition,\n blobSASSignatureValues.contentEncoding,\n blobSASSignatureValues.contentLanguage,\n blobSASSignatureValues.contentType,\n ].join(\"\\n\");\n const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId);\n}", "title": "" }, { "docid": "0cc036663099f74d5d69e44792823bb7", "score": "0.53453404", "text": "blobId(containerName, blobName) {\n return Buffer.from(`A${containerName}${blobName}`, \"utf8\").toString(\n \"base64\"\n );\n }", "title": "" }, { "docid": "b94a2d4b4e5674608e3fa668f9d1a7f1", "score": "0.5332828", "text": "function generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n // Stored access policies are not supported for a user delegation SAS.\n if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n userDelegationKeyCredential.userDelegationKey.signedObjectId,\n userDelegationKeyCredential.userDelegationKey.signedTenantId,\n userDelegationKeyCredential.userDelegationKey.signedStartsOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedExpiresOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedService,\n userDelegationKeyCredential.userDelegationKey.signedVersion,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.cacheControl,\n blobSASSignatureValues.contentDisposition,\n blobSASSignatureValues.contentEncoding,\n blobSASSignatureValues.contentLanguage,\n blobSASSignatureValues.contentType,\n ].join(\"\\n\");\n const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey);\n}", "title": "" }, { "docid": "3563e396b4e59c95d1bd7a35555ad203", "score": "0.53302056", "text": "generateSasUrl(options) {\n return new Promise((resolve) => {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw new RangeError(\"Can only generate the SAS when the client is initialized with a shared key credential\");\n }\n const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString();\n resolve(appendToURLQuery(this.url, sas));\n });\n }", "title": "" }, { "docid": "337ea06ecc186983918959c8f4cd336e", "score": "0.5295669", "text": "function generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n // Stored access policies are not supported for a user delegation SAS.\n if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n userDelegationKeyCredential.userDelegationKey.signedObjectId,\n userDelegationKeyCredential.userDelegationKey.signedTenantId,\n userDelegationKeyCredential.userDelegationKey.signedStartsOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedExpiresOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedService,\n userDelegationKeyCredential.userDelegationKey.signedVersion,\n blobSASSignatureValues.preauthorizedAgentObjectId,\n undefined,\n blobSASSignatureValues.correlationId,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.encryptionScope,\n blobSASSignatureValues.cacheControl,\n blobSASSignatureValues.contentDisposition,\n blobSASSignatureValues.contentEncoding,\n blobSASSignatureValues.contentLanguage,\n blobSASSignatureValues.contentType,\n ].join(\"\\n\");\n const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope);\n}", "title": "" }, { "docid": "fe8f7c6a7f1e9bf6a1b1d8defb7216bd", "score": "0.5268724", "text": "generateSasUrl(options) {\n return new Promise((resolve) => {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw new RangeError(\"Can only generate the SAS when the client is initialized with a shared key credential\");\n }\n const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString();\n resolve(appendToURLQuery(this.url, sas));\n });\n }", "title": "" }, { "docid": "b03b3e3c368e131eba575a6ac2c0a130", "score": "0.5164574", "text": "function start() {\n fetchSAS()\n .then(service => {\n service.listBlobsSegmented(containerName, null, function (error, results) {\n if (error) {\n console.error(error)\n } else {\n generateFileCards(results.entries)\n }\n })\n })\n .catch(e => console.error(e))\n}", "title": "" }, { "docid": "fe67720997247063b122fea60921c86b", "score": "0.5132307", "text": "async $getSegmentFromFileSystem(stream, track, iSegment) {\n let t = this;\n if (stream==null || track==null || iSegment==null) return;\n let fileRoute;\n if (iSegment==0) fileRoute = `${__dirname}/../dist_public/media/${stream.name}.dash.${track.id}..mp4`;\n else fileRoute = `${__dirname}/../dist_public/media/${stream.name}.dash.${track.id}.${iSegment}.m4s`;\n let buffer = await fs.$readFile(fileRoute); // It returns a Uint8Array. You may check this running: Object.prototype.toString.call(buffer) --> [object Uint8Array]\n //console.log('fileRoute:'+fileRoute);\n //console.log('bufferNull?'+(buffer==null)+' Type:'+Object.prototype.toString.call(buffer)+' byteLength:'+buffer.byteLength);\n return buffer;\n }", "title": "" }, { "docid": "f813a2cbaf0cb646ee3956e24009d1b8", "score": "0.50880665", "text": "function fileUpload() {\n const file = document.querySelector('#fileInput').files[0]\n \n openModal(true)\n document.getElementById('modalFileName').innerText = file.name\n\n fetchSAS()\n .then(service => {\n const summary = service.createBlockBlobFromBrowserFile(\n containerName,\n file.name,\n file,\n (error) => {\n if(error) {\n console.error(error)\n } else {\n location.reload()\n }\n })\n\n\n summary.on('progress', () => {\n document.getElementById('modalPercentageProgress').innerText = summary.getCompletePercent()\n document.querySelector('.determinate').style.width = parseInt(summary.getCompletePercent()) + '%'\n })\n })\n .catch(e => console.error(e))\n}", "title": "" }, { "docid": "4e592edcea5d3f54dd808c224d498fb8", "score": "0.5037108", "text": "getBlob() {\n return this.clone(File, \"$value\", false).usingParser(new _pnp_odata__WEBPACK_IMPORTED_MODULE_2__[\"BlobParser\"]())(Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_2__[\"headers\"])({ \"binaryStringResponseBody\": \"true\" }));\n }", "title": "" }, { "docid": "1a2d43b2dd5b136c6398b3f16b5ab42e", "score": "0.4985556", "text": "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n }", "title": "" }, { "docid": "54e6cc0fcd2c162a2575db1f15f574e4", "score": "0.49813104", "text": "async parseSsnd(start) {\n return this.fileBuffer.read({ start, length: 16 }).then((data) => {\n const { buffer } = data;\n const { SSND } = this.chunks;\n\n SSND.start = start;\n SSND.size = buffer.readInt32BE(4);\n SSND.offset = buffer.readUInt32BE(8);\n SSND.blockSize = buffer.readUInt32BE(12);\n\n if (SSND.offset !== 0) {\n throw new Error('Cannot read AIFFs with non-zero offset');\n }\n\n if (SSND.blockSize !== 0) {\n throw new Error('Cannot read AIFFs with non-zero blockSize');\n }\n });\n }", "title": "" }, { "docid": "632c4a48e10d57cbf6d13af561316eb9", "score": "0.4948272", "text": "getBlob() {\n return this.getParsed(new _pnp_odata__WEBPACK_IMPORTED_MODULE_4__[\"BlobParser\"]());\n }", "title": "" }, { "docid": "c01a5c9a35a150ff993329010904d8b6", "score": "0.49282494", "text": "function Blob(name) {\n this.name = name;\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.4926357", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.4926357", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.4926357", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.4926357", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "f68f6d7066fdc4b1aec2de445e058fde", "score": "0.4926357", "text": "function parse_PtgSxName(blob) {\n\tblob.l += 2;\n\treturn [blob.read_shift(4)];\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "c56f486798054f9e6407d876cc633296", "score": "0.4846403", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}", "title": "" }, { "docid": "9e312fe4cbd59334c9f6f0449e45d419", "score": "0.48435414", "text": "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "title": "" }, { "docid": "9e312fe4cbd59334c9f6f0449e45d419", "score": "0.48435414", "text": "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "title": "" }, { "docid": "9e312fe4cbd59334c9f6f0449e45d419", "score": "0.48435414", "text": "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "title": "" }, { "docid": "9e312fe4cbd59334c9f6f0449e45d419", "score": "0.48435414", "text": "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "title": "" }, { "docid": "9e312fe4cbd59334c9f6f0449e45d419", "score": "0.48435414", "text": "function isBlob(value) {\n return typeof Blob !== 'undefined' && value instanceof Blob;\n}", "title": "" }, { "docid": "1efbdbafb1d385b3cdf2d889bb7f6714", "score": "0.48370728", "text": "function parse_PtgSxName(blob) {\n blob.l += 2;\n return [blob.read_shift(4)];\n }", "title": "" }, { "docid": "ca1d9b860a60ad2cee0dba9fa5f06644", "score": "0.4825672", "text": "function _isEncodedBlob(value) {\n\t return value && value.__local_forage_encoded_blob;\n\t }", "title": "" }, { "docid": "0817a68e97867a6a8e86bcbcce2b03ad", "score": "0.48029277", "text": "function Blob(){\n}", "title": "" }, { "docid": "294099e7abd64ada5f481f9fc886fe52", "score": "0.47814426", "text": "static getBlobURL(blob) {\n if (android.Module) {\n return `content://${android.Module.authorities}/blob/${blob.data.blobId}?offset=${blob.data.offset}&size=${blob.data.size}&type=${blob.data.type}`;\n }\n else {\n return URL.createObjectURL(blob);\n }\n }", "title": "" }, { "docid": "3233a6a0efb4df05075701fece8edd51", "score": "0.47411072", "text": "function _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n }", "title": "" }, { "docid": "f0d0a51ad2af586431292c2dff02cc3c", "score": "0.47393614", "text": "getRecordingFile() {\n\t\tif(this.theblob !== null) {\n\t\t\treturn this.theblob;\n\t\t}\n\t\treturn null;\n\t}", "title": "" }, { "docid": "bc90897832efbda31b8dd887bd35dcbd", "score": "0.4660696", "text": "function blobToDataUri(blob) {\n return new Promise(function (resolve, reject) {\n // TODO handle abort ?\n var f = new FileReader();\n f.onload = function (e) { resolve(f.result); };\n f.onerror = function (e) { reject(e); };\n f.readAsDataURL(blob);\n });\n}", "title": "" }, { "docid": "d6046cc61ef9775591f202e13f1c6197", "score": "0.46405813", "text": "async blob() {\n\t\tconst ct = (this.headers && this.headers.get('content-type')) || (this[INTERNALS$2].body && this[INTERNALS$2].body.type) || '';\n\t\tconst buf = await this.buffer();\n\n\t\treturn new Blob([buf], {\n\t\t\ttype: ct\n\t\t});\n\t}", "title": "" }, { "docid": "cfc59835393cc1c9ae7953f0f8065320", "score": "0.4633152", "text": "getBlob() {\n return this.getParsed(new BlobParser());\n }", "title": "" }, { "docid": "bcd6b555f8a1d15ccaeafef69c16c340", "score": "0.45912462", "text": "static async getBlobHash(blob, algorithm) {\n if (ios.Module) {\n return await ios.Module.getBlobHash(blob.data, algorithm);\n }\n else if (android.Module) {\n return await android.Module.getBlobHash(blob.data, algorithm);\n }\n else {\n throw new Error('platform not supported');\n }\n }", "title": "" }, { "docid": "e8e39340c8c7bc632f83f2a611a0f7a9", "score": "0.45738277", "text": "get blob() {\n return this._blob;\n }", "title": "" }, { "docid": "7f61ee3e5e0519ce72bd6123b83076be", "score": "0.45736456", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? BERR[v] : v === 0x01;\n}", "title": "" }, { "docid": "069f36d6bfd43f5201958a3bfd9a64ff", "score": "0.45688307", "text": "function readBlob(responseBlob) {\n \n return new Promise((resolve) => {\n\n var fileReader = new FileReader();\n fileReader.onloadend = () => resolve(fileReader);\n fileReader.readAsBinaryString(responseBlob);\n\n });\n}", "title": "" }, { "docid": "940fd6ad2b8f27327305cf7fa55b979a", "score": "0.45601374", "text": "function readBlobAsText(blob) {\n\t return readBlobAs(blob, \"string\");\n\t}", "title": "" }, { "docid": "09566572957af6196ea03bda00922d0e", "score": "0.45526287", "text": "function Si() {\n if (\"undefined\" == typeof atob) throw new D(x.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "title": "" }, { "docid": "8ee1b29695f417ec1ab30df8fae2fdbf", "score": "0.45482108", "text": "function readBlobAs(blob, mode) {\n\t return new Promise(function (resolve, reject) {\n\t var reader = new FileReader();\n\t reader.onload = function (e) {\n\t resolve(e.target.result);\n\t };\n\t switch (mode) {\n\t case \"string\":\n\t reader.readAsText(blob);\n\t break;\n\t case \"buffer\":\n\t reader.readAsArrayBuffer(blob);\n\t break;\n\t }\n\t });\n\t}", "title": "" }, { "docid": "8c83cf6148c3cd86a050e7995bae9736", "score": "0.45421702", "text": "createBlobByText(text) {\n const key = stringHash(text)\n return get(key, this.store).then(val => {\n if (val) {\n return val\n }\n if (this.options.provider === providers.BING) {\n const ssml = xmlbuilder\n .create('speak')\n .att('version', '1.0')\n .att('xml:lang', this.options.providerOptions.language)\n .ele('voice')\n .att('xml:lang', this.options.providerOptions.language)\n .att(\n 'name',\n 'Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)'\n )\n .txt(text)\n .end()\n\n return this.getBingToken()\n .then(token =>\n bingSynthesize({\n ssml,\n token,\n })\n )\n .then(res => res.blob())\n .then(blob => {\n set(key, blob, this.store)\n return blob\n })\n }\n\n if (this.options.provider === providers.POLLY) {\n return pollySynthesize(this.polly, {\n Text: `<speak>${text}</speak>`,\n }).then(blob => {\n set(key, blob, this.store)\n return blob\n })\n }\n\n return Promise.reject('Speech Sythesizer unknown speech provider')\n })\n }", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "dab9003d71e6ed79c738c25e8501aba3", "score": "0.45250654", "text": "function parse_Bes(blob) {\n\tvar v = blob.read_shift(1), t = blob.read_shift(1);\n\treturn t === 0x01 ? v : v === 0x01;\n}", "title": "" }, { "docid": "ac4c7b37d84694d709817895c2d1fdf9", "score": "0.45221367", "text": "function test_reconfigure_add_disk_cold_controller_sas() {}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.451282", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.451282", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.451282", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.451282", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.451282", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "371377af0ae9bd6e847dd01209989028", "score": "0.451282", "text": "function parse_SupBook(blob, length, opts) {\n\tvar end = blob.l + length;\n\tvar ctab = blob.read_shift(2);\n\tvar cch = blob.read_shift(2);\n\tvar virtPath;\n\tif(cch >=0x01 && cch <=0xff) virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n\tvar rgst = blob.read_shift(end - blob.l);\n\topts.sbcch = cch;\n\treturn [cch, ctab, virtPath, rgst];\n}", "title": "" }, { "docid": "86fbffc152eec393527a8ed7eccf9845", "score": "0.45036784", "text": "function uploadBlob(blob) {\n console.log(\"order key in upload function is: \" + current_order_key)\n var formData = new FormData();\n var fileName = make_file_name(current_order_key);\n var fileObject = new File([blob], fileName, {\n type: 'video/webm'\n });\n formData.append('video-blob', fileObject);\n formData.append('video-filename', fileObject.name);\n // send the form to the server\n upload_audio_ajax(formData);\n}", "title": "" }, { "docid": "b62121a4bcbe466d969c6bbc136742b7", "score": "0.4503203", "text": "function readBlobAsText(blob) {\r\n return readBlobAs(blob, \"string\");\r\n}", "title": "" }, { "docid": "bdae91297773feb8d4f7d1a6c3a0b274", "score": "0.4495157", "text": "async function saveBlob(uidList, data) {\n try {\n if (!blobServiceClient && data.evidence.files.length > 0) {\n console.warn(`WARNING: Report ${data.reportId} not able to save files`)\n return\n }\n if (data.evidence.files.length > 0) {\n const containerName = data.reportId.replace('-', '').toLowerCase()\n const containerClient = blobServiceClient.getContainerClient(\n containerName,\n )\n let errorCode = (await containerClient.create()).errorCode\n if (errorCode)\n console.warn(\n `ERROR creating container ${containerName}: error code ${errorCode}`,\n )\n else {\n logger.info({\n message: `Created container ${containerName} successfully`,\n sessionId: data.sessionId,\n reportId: data.reportId,\n })\n }\n\n // Generate service level SAS for a container\n const containerSAS = generateBlobSASQueryParameters(\n {\n containerName,\n permissions: ContainerSASPermissions.parse('r'), // Read Only\n startsOn: new Date(), // Starting today\n expiresOn: new Date(new Date().valueOf() + 86400000 * sasExpiryDays), // Expires in 'sasExpiryDays' days (86400000 = 1 day)\n ipRange: { start: sasIpRangeLower, end: sasIpRangeUpper }, // Restrict the SAS link to requests from this IP range\n protocol: SASProtocol.Https, // Restrict SAS to HTTPS requests only\n },\n sharedKeyCredential,\n ).toString()\n\n data.evidence.files.forEach((file) => {\n if (file.malwareIsClean) {\n // Use SHA1 hash as file name to avoid collisions in blob storage, keep file extension\n let blobName = file.sha1 + '.' + file.name.split('.').pop()\n\n // Add p7m extension if we are encrypting file. Entrust on RCMP computer will recognize p7m as encrypted file\n blobName = uidList.length > 0 ? blobName + '.p7m' : blobName\n\n const blockBlobClient = containerClient.getBlockBlobClient(blobName)\n\n // Create a callback function for use with encryptFile\n let uploadFile = (file, content) => {\n let errorCode = blockBlobClient.upload(content, content.length)\n .errorCode\n if (errorCode)\n console.warn(\n `ERROR: Upload report ${data.reportId} file ${file.name}, blob ${blobName}: error code ${errorCode}`,\n )\n else\n logger.info({\n message: `Uploaded file ${file.name} to blob ${blobName} successfully`,\n sessionId: data.sessionId,\n reportId: data.reportId,\n })\n }\n\n // If running in a test environment with no HRMIS, upload the raw file instead of encrypting\n if (uidList.length > 0) {\n encryptFile(uidList, file, uploadFile)\n } else {\n uploadFile(file, fs.readFileSync(file.path))\n }\n // Add the SAS URL to the file data structure\n file.sasUrl = blockBlobClient.url + '?' + containerSAS.toString()\n } else {\n console.warn(\n `Skipping saving report ${data.reportId} file ${file.name} due to malware.`,\n )\n }\n })\n }\n } catch (error) {\n console.warn(`ERROR in saveBlob: ${error}`)\n }\n}", "title": "" }, { "docid": "059da953d3fc5a4637785e56f9bd4151", "score": "0.4490517", "text": "function parse_Bes(blob) {\n var v = blob.read_shift(1),\n t = blob.read_shift(1);\n return t === 0x01 ? v : v === 0x01;\n }", "title": "" }, { "docid": "40276f1f7cd7b8750492dd6f862f6d06", "score": "0.44853285", "text": "procInitSegment(rawData) {\n const data = JSON.parse(rawData)\n if (data.type === segmentsTypes.MSE_INIT_SEGMENT) {\n if (this.onMediaInfo) {\n this.mediaInfo = data.metadata\n try {\n this.onMediaInfo(data.metadata)\n } catch (e) {\n console.error(mseUtils.errorMsg(e))\n }\n }\n\n // 1.\n if (this.mediaSource && !this.mediaSource.sourceBuffers.length) {\n this.createSourceBuffers(data.tracks)\n\n // TODO: describe cases\n data.tracks.forEach(track => {\n this.maybeAppend(track.id, mseUtils.base64ToArrayBuffer(track.payload))\n })\n\n return\n }\n\n // 2\n if (this.mediaSource && this.mediaSource.sourceBuffers.length) {\n if (this.afterSeekFlag) {\n data.tracks.forEach(track => {\n this.maybeAppend(track.id, mseUtils.base64ToArrayBuffer(track.payload))\n })\n this.afterSeekFlag = false\n return\n }\n\n this.stop().then(() => {\n setTimeout(() => this.play(), 5000)\n })\n }\n // TODO: describe cases\n } else if (data.type === segmentsTypes.MSE_MEDIA_SEGMENT) {\n this.maybeAppend(data.id, mseUtils.base64ToArrayBuffer(data.payload))\n }\n }", "title": "" }, { "docid": "3076438e89dda5b1b376c8f0ddcb87e3", "score": "0.4473612", "text": "function readBlob(blob) {\n return new Promise(function (success, error) {\n var reader = new FileReader();\n reader.onload = function (event) {\n success(reader.result);\n };\n reader.onerror = function (e) {\n error(e);\n };\n reader.readAsText(blob);\n });\n}", "title": "" }, { "docid": "700f211feab24971223371d83629cb48", "score": "0.44735134", "text": "function getBlobObject(){\n var url = document.URL;\n url = url.split('/');\n var i = url.indexOf('blob');\n var authorName = url[i-2];\n\n var blobpath = document.getElementById('blob-path');\n var path = blobpath.textContent.split('/');\n var repoName = path[0].replace(/\\r?\\n|\\r|\\s/g,\"\");\n path.splice(0,1);\n var final = path.join('/');\n final = final.replace(/\\r?\\n|\\r|\\s/g,\"\");\n var regex = new RegExp('(blob\\/)((.)*)\\/'+final);\n var match = regex.exec(document.URL);\n var branch = match[2];\n var obj = {method : \"blob\" ,\n repo : repoName,\n author:authorName,\n branch : branch }\n return obj;\n}", "title": "" }, { "docid": "f0f63627f324b349c19e9936e84fcad3", "score": "0.44604507", "text": "function generateSharedAccessSignature(connectionString, tableName, expiry, // Expiry is mandatory\n start, permissions, startPartitionKey, endPartitionKey, startRowKey, endRowKey) {\n return getTableService(connectionString, \"generateSharedAccessSignature\")\n .then(function (tableService) {\n var deferred = Q.defer();\n try {\n var accessPolicy = {\n Expiry: expiry,\n Permissions: undefined\n };\n // If we add a property to the access policy information with a null value,\n // we will get an authentication error when using the SAS token.\n // Add the properties only when they have a value.\n if (start) {\n accessPolicy.Start = start;\n }\n if (permissions) {\n accessPolicy.Permissions = permissions;\n }\n if (startPartitionKey) {\n accessPolicy.StartPk = startPartitionKey;\n }\n if (endPartitionKey) {\n accessPolicy.EndPk = endPartitionKey;\n }\n if (startRowKey) {\n accessPolicy.StartRk = startRowKey;\n }\n if (endRowKey) {\n accessPolicy.EndRk = endRowKey;\n }\n var sharedAccessPolicy = {\n AccessPolicy: accessPolicy\n };\n var sasToken = tableService.generateSharedAccessSignature(tableName, sharedAccessPolicy);\n var sasUrl = tableService.getUrl(tableName, sasToken);\n var results = {\n sasToken: sasToken,\n sasUrl: sasUrl\n };\n deferred.resolve(results);\n }\n catch (error) {\n deferred.reject(error);\n }\n return deferred.promise;\n });\n}", "title": "" }, { "docid": "bde5c37fa2bc17f8bb256f4cfb883f67", "score": "0.4447272", "text": "blob () {\n let ct = (this.headers && this.headers.get('content-type')) || ''\n return consumeBody.call(this).then(buf => Object.assign(\n // Prevent copying\n new Blob([], {\n type: ct.toLowerCase()\n }),\n {\n [BUFFER]: buf\n }\n ))\n }", "title": "" }, { "docid": "c85e5fbb0e41544af4f9a78ecdf80f2c", "score": "0.44438016", "text": "function parse_EncInfoStd(blob) {\n var flags = blob.read_shift(4);\n if ((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n var sz = blob.read_shift(4); //var tgt = blob.l + sz;\n\n var hdr = parse_EncryptionHeader(blob, sz);\n var verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n return {\n t: \"Std\",\n h: hdr,\n v: verifier\n };\n }", "title": "" }, { "docid": "704d68cd8d95a800973aa4bff24ae4d2", "score": "0.44353828", "text": "get blobType() {\n return this.originalResponse.blobType;\n }", "title": "" }, { "docid": "704d68cd8d95a800973aa4bff24ae4d2", "score": "0.44353828", "text": "get blobType() {\n return this.originalResponse.blobType;\n }", "title": "" }, { "docid": "d5c5e5c8a99fd750a70450f98fbfbee6", "score": "0.44277668", "text": "function getResponseBlob(response) {\n return response.blob();\n}", "title": "" }, { "docid": "8f5f6f447b66a2b67540fda386990c0c", "score": "0.44263923", "text": "async function main() {\n // Environment variables have to be set\n try {\n // DefaultAzureCredential supports different authentication mechanisms and determines the appropriate credential type based of the environment it is executing in.\n // It attempts to use multiple credential types in an order until it finds a working credential.\n // DefaultAzureCredential expects the following three environment variables:\n // - AZURE_TENANT_ID: The tenant ID in Azure Active Directory\n // - AZURE_CLIENT_ID: The application (client) ID registered in the AAD tenant\n // - AZURE_CLIENT_SECRET: The client secret for the registered application\n const credential = new DefaultAzureCredential();\n\n // Create a QuantumJobClient\n const subscriptionId = \"your_subscription_id\";\n const resourceGroupName = \"your_resource_group_name\";\n const workspaceName = \"your_quantum_workspace_name\";\n const storageContainerName = \"mycontainer\";\n const location = \"westus\"; //\"your_location\";\n const endpoint = \"https://\" + location + \".quantum.azure.com\";\n\n const quantumJobClient = new QuantumJobClient(\n credential,\n subscriptionId,\n resourceGroupName,\n workspaceName,\n {\n endpoint: endpoint,\n credentialScopes: \"https://quantum.microsoft.com/.default\"\n }\n );\n\n console.log(`Created QuantumJobClient for:\n SubscriptionId: ${subscriptionId}\n ResourceGroup: ${resourceGroupName}\n WorkspaceName: ${workspaceName}\n Location: ${location}\n`);\n\n console.log(`Getting Container Uri with SAS key...`);\n\n // Get container Uri with SAS key\n const containerUri = (\n await quantumJobClient.storage.sasUri({\n containerName: storageContainerName\n })\n ).sasUri;\n\n console.log(`Container Uri with SAS key:\n ${containerUri}\n`);\n\n console.log(`Creating Container if not exist...`);\n\n // Create container if not exists\n const containerClient = new ContainerClient(containerUri);\n containerClient.createIfNotExists();\n\n console.log(`Uploading data into a blob...`);\n\n // Get input data blob Uri with SAS key\n const blobName = \"myjobinput.bc\";\n const inputDataUri = (\n await quantumJobClient.storage.sasUri({\n containerName: storageContainerName,\n blobName: blobName\n })\n ).sasUri;\n\n // Upload input data to blob\n const blobClient = new BlockBlobClient(inputDataUri);\n const problemFilename = \"BellState.bc\";\n const fileContent = fs.readFileSync(problemFilename, \"utf8\");\n const blobOptions = {\n blobHTTPHeaders: {\n blobContentType: \"qir.v1\",\n },\n };\n await blobClient.upload(fileContent, Buffer.byteLength(fileContent), blobOptions);\n\n console.log(`Input data Uri with SAS key:\n ${inputDataUri}\n`);\n\n console.log(`Creating Quantum job...`);\n\n const randomId = `${Math.floor(Math.random() * 10000 + 1)}`;\n\n // Submit job\n const jobId = `job-${randomId}`;\n const jobName = `jobName-${randomId}`;\n const inputDataFormat = \"qir.v1\";\n const outputDataFormat = \"microsoft.quantum-results.v1\";\n const providerId = \"quantinuum\";\n const target = \"quantinuum.sim.h1-1e\";\n const inputParams = {\n \"entryPoint\": \"ENTRYPOINT__BellState\",\n \"arguments\": [],\n \"targetCapability\": \"AdaptiveExecution\", \n };\n const createJobDetails = {\n containerUri: containerUri,\n inputDataFormat: inputDataFormat,\n providerId: providerId,\n target: target,\n id: jobId,\n inputDataUri: inputDataUri,\n name: jobName,\n outputDataFormat: outputDataFormat,\n inputParams: inputParams\n };\n const createdJob = await quantumJobClient.jobs.create(jobId, createJobDetails);\n\n console.log(`Job created:\n Id: ${createdJob.id}\n Name: ${createdJob.name}\n CreationTime: ${createdJob.creationTime}\n Status: ${createdJob.status}\n`);\n\n console.log(`Getting Quantum job...`);\n\n // Get the job that we've just created based on its jobId\n const myJob = await quantumJobClient.jobs.get(jobId);\n\n console.log(`Job obtained:\n Id: ${myJob.id}\n Name: ${myJob.name}\n CreationTime: ${myJob.creationTime}\n Status: ${myJob.status}\n BeginExecutionTime: ${myJob.beginExecutionTime}\n EndExecutionTime: ${myJob.endExecutionTime}\n CancellationTime: ${myJob.cancellationTime}\n OutputDataFormat: ${myJob.outputDataFormat}\n OutputDataUri: ${myJob.outputDataUri}\n`);\n\n console.log(`Getting list of Quantum jobs...`);\n let jobListResult = await quantumJobClient.jobs.list();\n let listOfJobs = await jobListResult.next();\n while (!listOfJobs.done) {\n let job = listOfJobs.value;\n console.log(` ${job.name}`);\n listOfJobs = await jobListResult.next();\n }\n\n console.log();\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "0241a91e83d20bc2e42179b0de0e54f7", "score": "0.4419007", "text": "function readBlobAs(blob, mode) {\r\n return new Promise((resolve, reject) => {\r\n try {\r\n const reader = new FileReader();\r\n reader.onload = (e) => {\r\n resolve(e.target.result);\r\n };\r\n switch (mode) {\r\n case \"string\":\r\n reader.readAsText(blob);\r\n break;\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(blob);\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "72312b45f3ad332d44b5477dd278b53e", "score": "0.44069102", "text": "function readBlobAs(blob, mode) {\r\n return new Promise(function (resolve, reject) {\r\n try {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n resolve(e.target.result);\r\n };\r\n switch (mode) {\r\n case \"string\":\r\n reader.readAsText(blob);\r\n break;\r\n case \"buffer\":\r\n reader.readAsArrayBuffer(blob);\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "aa6de62370d1c294962283c02e090aaa", "score": "0.4393458", "text": "getBlob() {\n return Photo(this, \"$value\").using(Object(queryable[\"a\" /* BlobParse */])())();\n }", "title": "" }, { "docid": "aefa813c858c6415ea532d7f46e6d25a", "score": "0.43889245", "text": "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "title": "" }, { "docid": "aefa813c858c6415ea532d7f46e6d25a", "score": "0.43889245", "text": "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "title": "" }, { "docid": "aefa813c858c6415ea532d7f46e6d25a", "score": "0.43889245", "text": "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "title": "" }, { "docid": "aefa813c858c6415ea532d7f46e6d25a", "score": "0.43889245", "text": "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "title": "" }, { "docid": "aefa813c858c6415ea532d7f46e6d25a", "score": "0.43889245", "text": "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "title": "" }, { "docid": "5cacef122844a384d1ae68523e5da8e8", "score": "0.43682212", "text": "static async getBlobHmac(blob, algorithm, key) {\n if (typeof key !== 'string') {\n key = base64.encode(key);\n }\n if (ios.Module) {\n return await ios.Module.getBlobHmac(blob.data, algorithm, key);\n }\n else if (android.Module) {\n return await android.Module.getBlobHmac(blob.data, algorithm, key);\n }\n else {\n throw new Error('platform not supported');\n }\n }", "title": "" }, { "docid": "a17c87b96bd67c3eaa9caac28d9e6d2d", "score": "0.43647817", "text": "function normalizeByteString(blob) {\r\n\t if (typeof blob === 'string') {\r\n\t return ByteString.fromBase64String(blob);\r\n\t }\r\n\t else {\r\n\t return ByteString.fromUint8Array(blob);\r\n\t }\r\n\t}", "title": "" }, { "docid": "58d864f5227b6c3848090ba1c23e64f8", "score": "0.43574473", "text": "blob() {\n let ct = this.headers && this.headers.get('content-type') || '';\n return consumeBody.call(this).then(function (buf) {\n return Object.assign( // Prevent copying\n new Blob([], {\n type: ct.toLowerCase()\n }), {\n [BUFFER]: buf\n });\n });\n }", "title": "" }, { "docid": "2f681fd7002fec7e1afc734d9c75f647", "score": "0.43552795", "text": "function parse_SupBook(blob, length, opts) {\n var end = blob.l + length;\n var ctab = blob.read_shift(2);\n var cch = blob.read_shift(2);\n opts.sbcch = cch;\n if (cch == 0x0401 || cch == 0x3A01) return [cch, ctab];\n if (cch < 0x01 || cch > 0xff) throw new Error(\"Unexpected SupBook type: \" + cch);\n var virtPath = parse_XLUnicodeStringNoCch(blob, cch);\n /* TODO: 2.5.277 Virtual Path */\n\n var rgst = [];\n\n while (end > blob.l) {\n rgst.push(parse_XLUnicodeString(blob));\n }\n\n return [cch, ctab, virtPath, rgst];\n }", "title": "" } ]
490190ef4a6ec0f96b108ce4e9f89322
const styles = require('./styles.css')
[ { "docid": "dd97251112ebb0b7e4c8f2325f17cabc", "score": "0.0", "text": "CallExpression (path, { file }) {\n const { callee: { name: calleeName }, arguments: args } = path.node\n\n if (calleeName !== 'require' || !args.length || !t.isStringLiteral(args[0])) {\n return\n }\n\n const [{ value }] = args\n\n if (matchExtensions.test(value)) {\n const requiringFile = file.opts.filename\n const stylesheetPath = resolveStylesheetPath(requiringFile, value)\n const tokens = requireCssFile(stylesheetPath)\n\n const css = STYLES.get(stylesheetPath)\n\n // eslint-disable-next-line no-console\n console.log(`[transform-themeable]: ${basename(dirname(requiringFile))}`)\n\n if (!css) return\n\n if (!t.isExpressionStatement(path.parent)) {\n path.replaceWithSourceString(transformCSSRequire(tokens, css))\n } else {\n path.remove()\n }\n }\n }", "title": "" } ]
[ { "docid": "d2d1c743a46bef28ee7199ff3f011ea9", "score": "0.6922376", "text": "get css() {\n return __webpack_require__(953).parsers.css;\n }", "title": "" }, { "docid": "2fe60b6775baea811d7809e61c7bedd1", "score": "0.6724737", "text": "function load (name) {\n styles = require(name).styles;\n }", "title": "" }, { "docid": "fb7134afaa5e7733b38cae5115afece2", "score": "0.6680092", "text": "function styles() {\n return (\n gulp.src(paths.styles.src)\n .pipe(sourcemaps.init())\n .pipe(wait(200))\n .pipe(sass({\n includePaths: ['./node_modules/purecss-sass/vendor/assets/stylesheets/',\n './node_modules/modularscale-sass/stylesheets/',\n './node_modules/typi/scss/'\n ]\n }))\n .on(\"error\", sass.logError)\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest(paths.styles.dest))\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "1d0d4095325f25bd2ea5d54ba802ad94", "score": "0.6674318", "text": "function css()\n{\n\n // le pasaremos la funncion o un paquete que hayamos importado\nreturn src('src/scss/app.scss')\n.pipe(sass({outputStyle: 'compresed'}))\n.pipe(dest('./build/css'))\n}", "title": "" }, { "docid": "961e7c33a6ad058ea782bf7647ce63da", "score": "0.66716367", "text": "function styles() {\n return gulp.src(paths.styles.src)\n\n .pipe(gulp.dest(paths.styles.dest));\n}", "title": "" }, { "docid": "2ea906eda97fc9fd0913c131b6ec0ef5", "score": "0.66508913", "text": "function styles() {\n\t// 1. Find my css file\n\treturn gulp.src('./app/assets/styles/**/*.css')\n\t// 2. pass the file thru the compiler\n\t.pipe( postcss ([cssImport , mixins , cssvars , nested , hexrgba, autoprefixer ]))\n\t.on('error', function(errorInfo) {\n console.log(errorInfo.toString());\n this.emit('end');\n })\n\t// 3. where do i save the compiled css\n\t.pipe(gulp.dest('./app/temp/styles'))\n\t// 4. stream changes to all browsers\n\t.pipe(browserSync.stream()); \n\n}", "title": "" }, { "docid": "6cac7b40ba91ed6b2cc18488dcbc32ac", "score": "0.66213083", "text": "getClientModules() {\n return [require.resolve('./custom.css')];\n }", "title": "" }, { "docid": "eca66dc60e0cb3e8b4302edacb346811", "score": "0.6565261", "text": "function style() {\n return (\n src(\"./src/sass/style.scss\")\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(concat(\"style.css\"))\n .pipe(dest(\"./src/css\"))\n // Stream changes to all browser\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "f8cb88785a0659c98c11d1f92c20951a", "score": "0.6514732", "text": "function buildStyles() {\n Object.keys(require.cache).forEach(function(key) {\n delete require.cache[key];\n });\n files.forEach(require);\n\n var app = RCSS.getStylesString()\n console.log('Writing public/css/all.css');\n fs.writeFileSync('public/css/all.css', [normalize,base,app].join('\\n'));\n}", "title": "" }, { "docid": "4f057f77220142da6040c504dde57122", "score": "0.64710397", "text": "static get styles() {\n return styles;\n }", "title": "" }, { "docid": "2752432cedd0036ed7a21cc58c1a1001", "score": "0.64381766", "text": "getCSS(){\n return [];\n }", "title": "" }, { "docid": "dbbf6ce97e4fdea7301f5ef535b34c36", "score": "0.6422994", "text": "function styles() {\n return gulp.src('src/styles/ac/main.scss')\n .pipe(sourcemaps.init())\n .pipe(sass().on('error',sass.logError))\n // .pipe(postcss([ autoprefixer(), cssnano() ]))\n //.pipe(concat('ac.css'))\n .pipe(sourcemaps.write('src/styles/'))\n .pipe(gulp.dest('src/styles/'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "c4dabdf36882933caf500680b3637663", "score": "0.64200914", "text": "static get styles() {\n return styles;\n }", "title": "" }, { "docid": "c4dabdf36882933caf500680b3637663", "score": "0.64200914", "text": "static get styles() {\n return styles;\n }", "title": "" }, { "docid": "8ae5c7472b8440d94a6a871dd1854149", "score": "0.6393616", "text": "function styles() {\n const processors = [\n postcssImport({\n load(filename, importOptions) {\n if (filename.match(/node_modules/)) {\n // remove stylelint check for node_modules files.\n importOptions.plugins = []; // eslint-disable-line no-param-reassign\n return loadContent(filename, importOptions);\n }\n\n // set stylelint check for not node_modules files.\n importOptions.plugins = [stylelint]; // eslint-disable-line no-param-reassign\n\n return loadContent(filename, importOptions);\n },\n }),\n precss,\n postcssUrl,\n svgLoad,\n cssnext(),\n quantityQueries,\n postcssBrowserReporter,\n postcssReporter({ clearReportedMessages: true }),\n ];\n\n if ( PRODUCTION ) {\n processors.push( require( 'postcss-sort-media-queries' )( {\n sort: 'desktop-first'\n } ) );\n }\n\n return gulp.src('src/assets/css/styles.pcss')\n .pipe($.postcss(processors, {\n map: !PRODUCTION, // enable source map for development\n }))\n .pipe($.if(PRODUCTION, $.csso()))\n .pipe($.extname('.css'))\n .pipe(gulp.dest(`${PATHS.dist}/css`))\n .pipe(browser.stream())\n .pipe($.if(PRODUCTION, gulp.dest(`${PATHS.markupDist}/css`)));\n}", "title": "" }, { "docid": "c8b730f83154d134d21db49890d9815e", "score": "0.6392732", "text": "function style() {\n return gulp\n .src(paths.styles.src)\n .pipe(postcss([cssnano()]))\n .pipe(concatCss(\"chu_sid_ka_style.css\"))\n .pipe(gulp.dest(paths.styles.dest))\n}", "title": "" }, { "docid": "90ecf56d8e57a303d69bd73a7c44237a", "score": "0.63825065", "text": "function style() {\n // 1.where is my scss file\n return (\n gulp\n .src(\"./scss/**/*.scss\")\n // 2. pass that file through sass compiler\n // .pipe(less())\n .pipe(sass())\n .pipe(gcmq())\n // 3. where do I save the compiled CSS?\n .pipe(concat(\"all.css\"))\n .pipe(gulp.dest(\"./css\"))\n\n // 4. stream changes to all browser\n .pipe(browserSycn.stream())\n );\n}", "title": "" }, { "docid": "aa5fbd200bad6796114dda2218e892d4", "score": "0.63351274", "text": "function style() {\n return gulp\n .src(\"./app/scss/**/*.scss\") // ** any folder *file with extension.scss\n .pipe(sass())\n .pipe(gulp.dest(\"./app/css\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "7aa517fc5a27af0a2bf7251635fdee76", "score": "0.6332607", "text": "function style() {\n var bootstrapSrc = \"./node_modules\" + bootstrap._location + \"/scss\";\n return gulp.src('./sass/**/*.scss')\n .pipe(sass({includePaths: [bootstrapSrc]}).on('error', sass.logError))\n .pipe(gulp.dest('./css'));\n}", "title": "" }, { "docid": "363fdec6558f8503ea2c3c1585dfc033", "score": "0.62809414", "text": "function styles() {\n return gulp\n .src(paths.css.src)\n .pipe(sourcemaps.init())\n .pipe(sass())\n .on('error', sass.logError)\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write())\n .pipe(gulp.dest(paths.css.dest));\n}", "title": "" }, { "docid": "73a2a446391f879607995a44e9644322", "score": "0.6278098", "text": "function style() {\n return gulp.src('assets/scss/*.scss')\n .pipe(sass().on('error',sass.logError))\n .pipe(gulp.dest('assets/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "ec3b66b0eb9ba3deecbb15f611969434", "score": "0.62763256", "text": "function style() {\n // 1. where is my scss File. \n return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss','src/scss/**/*.scss'])\n // 2. Pass that file through sass compiler\n .pipe(sass())\n // 3.Where do I save the compiled CSS?\n .pipe(gulp.dest('./src/css'))\n // 4.Stream changes to all browser\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "b3f81c092384aca4a8e9cce59f23414c", "score": "0.6272393", "text": "function styles() {\n return gulp.src(paths.styles.src)\n .pipe(cleanCSS())\n .pipe(concat('main.min.css'))\n .pipe(gulp.dest(paths.styles.dest));\n}", "title": "" }, { "docid": "c6731389e3d8fb243dfde59150e5eb01", "score": "0.62653995", "text": "static get styles() {\n return css`\n div { height: 70px; width: 100%; background: black; color: white; text-align: center; font-weight: bold; line-height:70px; font-size: 24px; }\n `;\n }", "title": "" }, { "docid": "d641edceec16ab169b30350b1264811e", "score": "0.62440324", "text": "function styles() {\n return gulp.src(paths.styles.src)\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(cleanCSS())\n .pipe(sourcemaps.write())\n .pipe(autoprefixer({ browsers: ['> 10%'] }))\n .pipe(gulp.dest(paths.styles.dest));\n}", "title": "" }, { "docid": "47674933ad0b0b36f4d3e0b3c0e5faa0", "score": "0.62415963", "text": "function injectStyle (ssrContext) {\n __webpack_require__(\"WYln\")\n}", "title": "" }, { "docid": "ad30fd25d24e7695ab248f536f96b51f", "score": "0.62366414", "text": "function buildStyles() {\n return (\n Promise.resolve()\n // Create the dist folder if it doesn't exist\n .then(() => {\n if (!FS.existsSync(Path.join(__dirname, \"dist\"))) {\n return FS.mkdirAsync(Path.join(__dirname, \"dist\"));\n }\n })\n\n // Generate minified stylesheet\n .then(() => {\n let file = Path.join(__dirname, \"source/css/shoelace.css\");\n let css = FS.readFileSync(file, \"utf8\");\n\n return PostCSS([\n AtImport,\n CSSnext({\n features: {\n rem: false\n }\n }),\n CSSnano({\n autoprefixer: false,\n safe: true\n })\n ]).process(css, { from: file });\n })\n\n // Write stylesheet to dist\n .then(result => {\n let file = Path.join(__dirname, \"dist/shoelace.css\");\n\n // Update {{version}} in CSS since it's not processed with Handlebars\n result.css = result.css.replace(/\\{\\{version\\}\\}/g, __version);\n\n // Output a message\n console.log(\n Chalk.green(\"CSS processed: %s! 🦋\"),\n Path.relative(__dirname, file)\n );\n\n // Prettier\n result.css = prettier.format(result.css, {\n parser: \"css\"\n });\n\n // Write output file\n return FS.writeFileAsync(file, result.css, \"utf8\");\n })\n );\n}", "title": "" }, { "docid": "72dd553eb32f2970c4581095f44559d1", "score": "0.6232499", "text": "function styles() {\n return src('./src/sass/**/*.scss')\n .pipe(sourcemaps.init())\n .pipe(sass)\n //Add prefixes\n .pipe(autoprefixer())\n //CSS minification\n .pipe(cleanCSS({\n level: 2\n }))\n .pipe(sourcemaps.write('./'))\n //Output folder for styles\n .pipe(dest('./dist/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "50dbe37a9b4ffe3280d1432b31d5a9ad", "score": "0.62086844", "text": "function style() {\n return gulp.src('./scss/**/*.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('./css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "b919a773006fc13078770f8913ea7b46", "score": "0.6203586", "text": "function styles() {\n return gulp.src('./sass/**/*.scss')\n .pipe(plumber({\n errorHandler: notify.onError(\"Error: <%= error.message %>\")\n }))\n .pipe(sourcemaps.init())\n .pipe(sass())\n .pipe(cleanCSS())\n .pipe(concat('style.css'))\n .pipe(autoprefixer('last 5 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1'))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('./'))\n .pipe(reload({ stream: true }));\n}", "title": "" }, { "docid": "adbb792051fcd693a229698834dfd4ac", "score": "0.6200506", "text": "styles() {\n return gulp.src([path.join(config.paths.sass.src, '/**/*.scss')])\n .pipe(gPlugins.plumber())\n .pipe(gPlugins.sourcemaps.init())\n .pipe(gPlugins.sass(require('./config/nodesass.config')).on('error', gPlugins.sass.logError))\n .pipe(gPlugins.autoprefixer({ browsers: ['last 3 versions', '> 1%'] }))\n .pipe(gPlugins.sourcemaps.write('.'))\n .pipe(gulp.dest(config.paths.sass.dist))\n .pipe(gPlugins.browserSync.stream({ match: '**/*.{css|map}' }));\n }", "title": "" }, { "docid": "f118e861e5200d760048fa57bfac5209", "score": "0.619866", "text": "function style(){\n const autoprefixBrowsers = [\n '> 1%',\n 'last 2 versions',\n 'firefox >= 4',\n 'safari 7',\n 'safari 8',\n 'IE 8', \n 'IE 9',\n 'IE 10',\n 'IE 11'\n ];\n return gulp.src(app_path + '/assets/styles/main.scss')\n .pipe(sourcemaps.init())\n .pipe(sass({\n precision: 10,\n outputStyle: 'compressed'\n }).on('error', sass.logError))\n .pipe(autoprefixer({\n browsers: autoprefixBrowsers,\n cascade: false\n }))\n .pipe(sourcemaps.write('./'))\n .pipe(size({\n title: 'styles',\n showFiles: true\n }))\n .pipe(gulp.dest(app_path + '/dist/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "5db47a366a5328d66db3a2af234cde9e", "score": "0.61889124", "text": "css (file, layout) {\n let links = matchAll(layout, 'css')\n\n links.forEach(link => {\n link = match(link, 'css')\n let regexp = new RegExp(`@css\\\\(${link}\\\\)`)\n\n layout = layout.replace(regexp, file.split('.')[0] === 'index' ? `styles/${link}.css` : `../styles/${link}.css`)\n })\n\n return layout\n }", "title": "" }, { "docid": "265d7f40cbdf330133606258d3a97887", "score": "0.6184498", "text": "function css( ){\n return src(paths.scss)\n .pipe(sourcemaps.init())\n .pipe( sass())\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write('.'))\n .pipe( dest('./build/css') )\n}", "title": "" }, { "docid": "abe8ad1ad95334bb6270b306b642b89f", "score": "0.61780024", "text": "function styles() {\n return gulp.src(paths.styles.srcFrontend)\n .pipe(sass())\n .pipe(minify())\n .pipe(gulp.dest(paths.styles.dest));\n}", "title": "" }, { "docid": "83de175badcbb1d6058f28d7c6f23488", "score": "0.6173883", "text": "function style() {\n //1. where is my scss file -task\n return gulp.src('./scss/**/*.scss')\n //2. pass that file throiougt sass compiler --pass sass\n .pipe(postcss([autoprefixer]))\n .pipe(sass().on('error', sass.logError))\n // 3. where do I save the compiled CSS -- destination\n .pipe(gulp.dest('./css'))\n // 4. stream changes to all browser\n .pipe(browserSync.stream());\n }", "title": "" }, { "docid": "2ce830965166c0ecb2549112d8a91778", "score": "0.6173549", "text": "function styles() {\n return gulp\n .src([ '_sass/*.scss' ])\n .pipe(\n sass({\n includePaths: [ 'scss' ],\n onError: browserSync.notify\n })\n )\n .pipe(prefix([ 'last 3 versions', '> 1%', 'ie 8' ], { cascade: true }))\n .pipe(rename('main.min.css'))\n .pipe(cssnano())\n .pipe(gulp.dest('_site/assets/css/'))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest('assets/css'));\n}", "title": "" }, { "docid": "2246be1d9d2a4af58350fc08026d6c78", "score": "0.615099", "text": "function style(){\n // 1. where is my css file \n return gulp.src('./scss/**/*.scss')\n .pipe(autoprefixer({\n cascade: false\n }))\n // 2. pass file through css compiler\n .pipe(sass().on('error', sass.logError))\n .pipe(sass())\n // 3. where to save the compiled css\n .pipe(gulp.dest('./css'))\n // 4. time to browser sync\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "86c56ef25e381f227e9d5c0c18222198", "score": "0.61392367", "text": "function style(){\n return gulp.src('./src/sass/**/*.sass')\n .pipe(sass())\n .pipe(gulp.dest('./build/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "849354640054e9fe995e0449b1dfd385", "score": "0.6128414", "text": "function style() {\n //Find our scss file\n return gulp.src('./src/scss/**/*.scss')\n //Pass that through our sass copiler and then compile in css\n .pipe(sass())\n .pipe(gulp.dest('./src/css'))\n // Adding our stream changes for all browsers\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "fa91f5524b0539bf95d0f5dcfc767e6e", "score": "0.6107805", "text": "function style() {\n return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'])\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('src/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "e522fe406fcaa3caeef554eb86891860", "score": "0.6107767", "text": "function loadCSS(filename){\n var fileref= document.createElement('link');\n fileref.setAttribute(\"rel\", \"stylesheet\");\n fileref.setAttribute(\"type\", \"text/css\");\n fileref.setAttribute(\"href\", filename);\n if (typeof fileref !== \"undefined\"){\n document.getElementsByTagName(\"head\")[0].appendChild(fileref);\n }\n}", "title": "" }, { "docid": "a77a49d59f2134f96e5c48d56160a5c5", "score": "0.6100667", "text": "function css() {\n return gulp.src(PATHS.css)\n .pipe(gulp.dest(PATHS.dist + '/assets/css'));\n}", "title": "" }, { "docid": "8fa13c27e8cd905b3499fbdba1f81d00", "score": "0.6095873", "text": "function styles() {\n 'use strict';\n return gulp.src(['src/styles/**/*.scss'])\n .pipe(plumber())\n .pipe(sass())\n .pipe(autoprefixer( /*'last 2 versions'*/ ))\n .pipe(gulp.dest('dist/styles/'))\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(minifycss())\n .pipe(gulp.dest('dist/styles/'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "763cce3620bb34aef6d51d071c43ce9d", "score": "0.60946625", "text": "function mainCss() {\n notify('Compiling styles...');\n return gulp.src('src/styl/main.styl')\n .pipe(sourcemaps.init())\n .pipe(stylus({\n use: [koutoSwiss(), prefixer(), jeet(), rupture()],\n compress: true\n }))\n .pipe(rename('styles.min.css'))\n .pipe(plumber())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('_site/assets/css/'))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest('assets/css'));\n}", "title": "" }, { "docid": "83126988e4b1ba2600573c232d312bf3", "score": "0.6090479", "text": "function cssTask() {\n return (\n src(\"./src/scss/*.scss\")\n // .pipe(sass().on('error', sass.logError))\n .pipe(sass({ outputStyle: \"compressed\" }).on(\"error\", sass.logError))\n .pipe(autoprefixer())\n .pipe(dest(\"./docs/css\"))\n .pipe(browserSync.stream())\n )\n}", "title": "" }, { "docid": "6700655c5b6d1c0372cdd6821e631379", "score": "0.6090469", "text": "function style() {\n\tconst src = paths.styles.main ? paths.styles.main : paths.styles.src;\n\treturn (\n\t\tgulp\n\t\t\t.src(src)\n\t\t\t// Initialize sourcemaps before compilation starts\n\t\t\t.pipe(sourcemaps.init())\n\t\t\t.pipe(sass())\n\t\t\t.on('error', sass.logError)\n\t\t\t// Use postcss with autoprefixer and compress the compiled file using cssnano\n\t\t\t.pipe(postcss([autoprefixer(), cssnano()]))\n\t\t\t// Now add/write the sourcemaps\n\t\t\t.pipe(sourcemaps.write())\n\t\t\t.pipe(gulp.dest(paths.styles.dest))\n\t\t\t// Add browsersync stream pipe after compilation\n\t\t\t.pipe(browserSync.stream())\n\t);\n}", "title": "" }, { "docid": "e5c571f28db640b0d55b3c7c8109af3f", "score": "0.60887444", "text": "function styles() {\r\n\treturn gulp.src(cssFiles)\r\n\t.pipe(sourcemaps.init())\r\n\t.pipe(stylus())\r\n\t//объединение фаилов в один\r\n\t.pipe(concat('style.css'))\r\n\t//автопрефиксер\r\n\t.pipe(autoprefixer({\r\n\t\t\toverrideBrowserslist: ['last 2 version'],\r\n cascade: false\r\n }))\r\n\t//минификация фаилов\r\n\t.pipe(cleanCss({ \r\n\t\tlevel: 2\r\n\t}))\r\n\t.pipe(sourcemaps.write('./'))\r\n\t.pipe(rename({\r\n\t\tsuffix: '.min'\r\n\t}))\r\n\t//папка назначения, куда компилить фаилы\r\n\t.pipe(gulp.dest('./build/css/'))\r\n\t.pipe(browserSync.stream());\r\n}", "title": "" }, { "docid": "7160c7b7e2b08482437eaad34ca45c7e", "score": "0.6087918", "text": "function css(){\n return src('src/scss/app.scss')\n .pipe(sourcemaps.init())\n .pipe( sass())\n .pipe(postcss([autoprefixer(), cssnano()]))\n .pipe(sourcemaps.write('.'))\n .pipe( dest('./build/css') )\n}", "title": "" }, { "docid": "325075bd4ba2066bcdd02256993d1894", "score": "0.60808134", "text": "function style(){\n return gulp.src('src/sass/*.scss')\n .pipe(sass())\n .pipe(gulp.dest('dist/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "5e90895dbf6b80ad5dbf9cbe82967443", "score": "0.60745585", "text": "function css () {\n return src('./src/scss/*.scss', { sourcemaps: true })\n .pipe(sass())\n .pipe(csscomb())\n .pipe(postcss())\n .on('error', sass.logError)\n .pipe(dest('./src/css', { sourcemaps: '.' }))\n}", "title": "" }, { "docid": "e668855a902252b2d0704ce352cd5213", "score": "0.6073295", "text": "function style() {\r\n return gulp.src(sassFiles)\r\n .pipe(sass().on('error', sass.logError))\r\n .pipe(gulp.dest(cssDest));\r\n}", "title": "" }, { "docid": "3b3747ba27eae1b906a622f5bb4f6634", "score": "0.60701185", "text": "function injectStyles(styles) {\n styles.forEach(function(cssFile) {\n injectStyle( cssFile )\n })\n}", "title": "" }, { "docid": "db24c04c236ca8fa68e5b4cd4be983cf", "score": "0.6062998", "text": "function style() {\n // where is my scss\n return gulp.src('./scss/**/*.scss')\n // pass that file through sass compiler\n .pipe(sass({\n includePaths: sassPaths,\n outputStyle: 'compressed'\n })\n .on(\"error\", sass.logError))\n //autoprefix things\n .pipe(prefix())\n // where do i save the compiled css\n .pipe(gulp.dest('./dist/css'))\n //minifiy css\n .pipe(cssnano())\n //set destination same as above so it overwrites\n .pipe(gulp.dest('./dist/css'))\n // stream changes to all browsers\n .pipe(browswerSync.stream());\n}", "title": "" }, { "docid": "8c9a204845b4512a5417d9278e9bc03e", "score": "0.60618454", "text": "function css () {\n return gulp.src('./src/css/**/*.css')\n .pipe(gulp.dest('./docs/css/'));\n}", "title": "" }, { "docid": "2dfb1294c15c0b8d45b98dbb69fe9b7c", "score": "0.60557467", "text": "function styl() {\n let output_dir = `./build/${browser}/`;\n return gulp\n .src(\"./src/!(common)/**/*.styl\", { base: \"src\" })\n .pipe(\n stylus({\n compress: true, // 需要压缩\n }).on(\"error\", (error) => log(error))\n )\n .pipe(gulp.dest(output_dir));\n}", "title": "" }, { "docid": "cd231cdce38438d056e08b3837d28d91", "score": "0.60555047", "text": "function css() {\n\treturn (\n\t\tsrc('./sass/**/*.scss')\n\t\t\t.pipe(sourcemaps.init())\n\t\t\t// Stay live and reload on error\n\t\t\t.pipe(\n\t\t\t\tplumber({\n\t\t\t\t\thandleError: function(err) {\n\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\tthis.emit('end');\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t)\n\t\t\t.pipe(\n\t\t\t\tsass({\n\t\t\t\t\t// outputStyle: 'compressed',\n\t\t\t\t}).on('error', function(err) {\n\t\t\t\t\tconsole.log(err.message);\n\t\t\t\t\t// sass.logError\n\t\t\t\t\tthis.emit('end');\n\t\t\t\t})\n\t\t\t)\n\t\t\t//.pipe(minifyCSS())\n\t\t\t.pipe(concat('style.css'))\n\t\t\t.pipe(sourcemaps.write('.'))\n\t\t\t.pipe(dest('./'))\n\t);\n}", "title": "" }, { "docid": "5fac7920586acbe120b4a1a05476d5f5", "score": "0.6029047", "text": "static get styles() {\n const style = css`\n :host {\n display: block;\n }\n\n .header {\n text-align: left;\n padding: 2em;\n background-image:linear-gradient(to bottom left,#1D1D1B,#3E3E3A);\n }\n\n .header>h1 {\n color: var(--pink-color);\n font-size: 2.25em;\n }\n\n .header>.date {\n color: var(--white-color);\n }\n\n .content {\n padding: 1em 2em;\n }\n\n .content>p {\n word-break: break-word;\n }\n\n .footer {\n text-align: center;\n display: flex;\n }\n\n .footer>favourite-talk,\n .footer>directions-talk,\n .footer>share-talk {\n --icon-size: 50px;\n --button-size: 75px;\n }\n\n .footer>favourite-talk {\n margin: auto 0 auto auto;\n }\n\n .footer>share-talk {\n margin: auto auto auto 0;\n }\n `;\n\n return [sharedStyles, style];\n }", "title": "" }, { "docid": "8c9399bd120756a3f67fed7d3943295b", "score": "0.6019707", "text": "function style() {\n return gulp.src(dir.styleSrc)\n .pipe(sass().on('error', sass.logError))\n .pipe(prefix())\n .pipe(gulp.dest(dir.styleDist)) \n .pipe(browserSync.stream()); \n}", "title": "" }, { "docid": "5e0a61503093deaafb5122c9a30ae791", "score": "0.60183626", "text": "function style() {\n // 1. Where is my scss file - look for any folders that have scss files\n // 2. Pass scss file through sass compiler - error logging enabled\n // 3. Save the compiled CSS somewhere\n // 4. Stream changes between all browsers with browser-sync\n return gulp\n .src(\"./src/scss/**/*.scss\")\n .pipe(sass().on(\"error\", sass.logError))\n .pipe(gulp.dest(\"./css\"))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "b81e62d47dc55fca1a63ac3c717fc576", "score": "0.6016595", "text": "function styles() {\n return (\n gulp\n .src( basePaths.css_location + '/sass/*.scss' )\n .pipe( sass( { style: 'compressed' } ).on('error', sass.logError) )\n .pipe( cleanCSS( { debug: true }, (details) =>{\n console.log(details.name + ': ' + (details.stats.originalSize / 1000) + 'KB' );\n console.log(details.name + ': ' + (details.stats.minifiedSize / 1000) + 'KB' );\n } ) )\n .pipe( gulp.dest( basePaths.css_location ) )\n );\n}", "title": "" }, { "docid": "27c50114ecd0ed9090e064ab5de184df", "score": "0.60128343", "text": "function loadCSSFile(filename, id){\r\n let file=document.createElement(\"link\")\r\n file.setAttribute(\"rel\", \"stylesheet\")\r\n file.setAttribute(\"type\", \"text/css\")\r\n file.setAttribute(\"href\", filename)\r\n file.setAttribute(\"id\", id)\r\n if (file && file.id!=\"undefined\"){\r\n document.getElementsByTagName(\"head\")[0].appendChild(file);\r\n }\r\n}", "title": "" }, { "docid": "39bf84be10d4ed17f6779f215812ff66", "score": "0.6006226", "text": "function checkCSS(){\n if(!fs.existsSync(cssPath)){\n writeToFile(cssPath, `.team-heading{\n background-color: forestgreen;\n color: white;\n }\n \n h3.card-title{\n font-size: 20px;\n }\n \n .employee-card{\n border-color: black;\n }\n \n .card-header{\n border-bottom-color: black;\n }\n \n .card-body{\n background-color: rgb(45, 189, 45, .75);\n }`);\n }\n}", "title": "" }, { "docid": "88ce347d0caa62ec0161098d060e13ad", "score": "0.6004518", "text": "function styl() {\n let output_dir = \"./build/\" + browser + \"/\";\n return gulp\n .src(\"./src/!(lib)/**/*.styl\", { base: \"src\" })\n .pipe(\n stylus({\n compress: true // 需要压缩\n }).on(\"error\", error => log(error))\n )\n .pipe(gulp.dest(output_dir));\n}", "title": "" }, { "docid": "731fb3b30adea7b13bc7749545025b85", "score": "0.5998914", "text": "function StyleSheet(props) {\r\n\r\n let className = props.primary ? 'primary' : '';\r\n return (\r\n <div>\r\n <h1 className={`${className} font-xl`}> StyleSheet </h1>\r\n </div>\r\n )\r\n}", "title": "" }, { "docid": "a9d3a168ac0b530abbdb658fd8c060db", "score": "0.59979445", "text": "function loadStyle(name) {\n $('body').append($('<link>', {\n rel: 'stylesheet',\n type: 'text/css',\n href: appOptions.baseUrl + 'css/' + name + '.css'\n }));\n}", "title": "" }, { "docid": "5c2e2026bf2f4b065650ad763183d568", "score": "0.5981655", "text": "async loadCSS() {\n loadCSS(this.relativeURL(this._assets.css.default.url));\n }", "title": "" }, { "docid": "43dfa821c9bab7aefaab646f4797a8eb", "score": "0.59782904", "text": "function map_editor_style() {\r\n\r\n El.Attr(El.create('link', document.head), {\r\n 'rel': 'stylesheet',\r\n 'type': 'text/css',\r\n 'href': 'js/plugins/haya.css'\r\n })\r\n\r\n El.Attr(El.create('link', document.head), {\r\n 'rel': 'stylesheet',\r\n 'type': 'text/css',\r\n 'href': 'js/plugins/haya-map-editor.css'\r\n })\r\n }", "title": "" }, { "docid": "f9c483824001cae0953e9feb4b96fffe", "score": "0.5973976", "text": "function cssBundler() {\n const files = fs.readdirSync(`${process.cwd()}/${program.path}`);\n const writeStream = fs.createWriteStream(`${program.path}/bundle.css`);\n files.forEach((fileName) => {\n const cssFileData = fs.readFileSync(`${process.cwd()}/${program.path}/${fileName}`, \"utf8\"); \n writeStream.write(cssFileData); \n });\n writeStream.end();\n\n https.get('https://epa.ms/nodejs18-hw3-css', function(res){\n res.setEncoding('utf8');\n res.on('data', function(cssData) {\n fs.appendFileSync(`${program.path}/bundle.css`, cssData);\n console.log('CSS content added successfully!');\n }); \n });\n}", "title": "" }, { "docid": "63be5921158b1019ea02090879c1992d", "score": "0.5970283", "text": "function style() {\n \n return gulp.src('src/sass/styles.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest(src + 'css/'))\n .pipe(browserSync.stream())\n .pipe(rename({suffix: '.min'}))\n .pipe(minifycss())\n .pipe(gulp.dest(src + 'css/'))\n // .pipe(notify({message: 'Style task complete'}))\n ;\n}", "title": "" }, { "docid": "a760efdf266be6387d8f6b4de3e4a188", "score": "0.5966106", "text": "function style() {\n // Folder for scss files\n return gulp.src('src/scss/**/*.scss')\n // Run the files via sass compiler + error checking\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('pub/css')) // Store the css file\n .pipe(browserSync.stream()) // Make sure changes shows in browsers\n}", "title": "" }, { "docid": "b63a4ff8e585c4ec35161df9d424f7ef", "score": "0.5956289", "text": "function styles() {\n return gulp.src(config.src + 'scss/*.scss')\n .pipe($.if(config.sourcemaps, $.sourcemaps.init()))\n .pipe(sass({\n precision: 8,\n outputStyle: 'expanded'\n }).on('error', sass.logError))\n .pipe($.postcss([\n autoprefixer()\n ]))\n .pipe($.if(config.sourcemaps, $.sourcemaps.write()))\n .pipe(gulp.dest(config.dest + 'css'))\n .pipe(browserSync.stream())\n .pipe($.if(config.minify, $.cleanCss()))\n .pipe($.if(config.sourcemaps, $.sourcemaps.write()))\n .pipe($.if(config.minify, $.rename({suffix: '.min'})))\n .pipe($.if(config.minify, gulp.dest(config.dest + 'css')))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "6778bb0a2da4fbf4714c1eb0edd856f8", "score": "0.59550726", "text": "function styles() {\n return gulp\n .src([\"_sass/*.scss\"])\n .pipe(\n sass({\n includePaths: [\"scss\"],\n onError: browserSync.notify,\n })\n )\n .pipe(prefix([\"last 3 versions\", \"> 1%\", \"ie 8\"], { cascade: true }))\n .pipe(gulp.dest(\"_site/assets/css/\"))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest(\"assets/css\"));\n}", "title": "" }, { "docid": "d1a3c7e7e2d5f8d2775aa84000508a49", "score": "0.5949548", "text": "function stylesheets(cb) {\n\n async.forEach(config.stylesheets, function (ss, callback) {\n // bench('pre stylus')\n fs.readFile(dir + '/source/resource/css/' + ss + '.styl', 'utf8', function (err, data) {\n if (err) return callback(err)\n stylus(data)\n .set('filename', dir + '/source/resource/css/' + ss + '.styl')\n .set('compress', config.compressCSS)\n .set('linenos', config.stylusLinenos)\n .use(nib())\n .render(function(err, css) {\n if (err) return callback(err)\n async.parallel([\n function (callback) {\n fs.writeFile(dir + '/preview/resource/css/' + ss + '.css', css, callback)\n }\n ],\n function (err) {\n if (!err) {\n console.log((' Rendered ' + ss + '.styl → ' + ss + '.css').blue)\n }\n // bench('post stylus')\n callback(err)\n }\n )\n })\n\n })\n }, cb)\n\n}", "title": "" }, { "docid": "2cb27a6002b16d6cbec1b1a8f9392255", "score": "0.59205663", "text": "loadCssFiles() {\n if (this.css.length != 0) {\n let cssLoader = new CSSLoader();\n for (let i=0; i<this.css.length;i++) {\n cssLoader.addSheet(this.css[i]);\n }\n cssLoader.toExecuteAfter(()=>this.construct());\n \n cssLoader.constructSheets();\n }\n else {\n if (VersionLoader.DEBUG) console.log(\" + No stylesheet need to be loaded\");\n this.construct();\n }\n }", "title": "" }, { "docid": "fb9a02472d2620ef6656503cbce33cc1", "score": "0.58985925", "text": "function styleG() {\n // 1. Find scss file\n return (\n gulp\n .src(\"src/scss/css-grid/**/*.scss\")\n // 2. Pass file through sass compiler\n .pipe(sass().on(\"error\", sass.logError))\n // 3. Where do I save the compiled css?\n .pipe(gulp.dest(\"src/css\"))\n // 4. stream changes to all browsers\n .pipe(browserSync.stream())\n );\n}", "title": "" }, { "docid": "721cf951bd8166b0038e9afcf684de1b", "score": "0.5891594", "text": "function css () {\n\treturn gulp.src('./protected/scss/app.scss')\n\t\t\t.pipe(sourcemaps.init())\n\t\t\t.pipe(sass({outputStyle: 'compressed'}))\n\t\t\t.pipe(postcss([autoprefixer()]))\n\t\t\t.pipe(sourcemaps.write('.'))\n\t\t\t.pipe(gulp.dest('./assets/css'));\n}", "title": "" }, { "docid": "0c102e3c7a5a6c698bb31a5edef302eb", "score": "0.58786696", "text": "function previewCss() {\n notify('Compiling styles...');\n return gulp.src('src/styl/preview.styl')\n .pipe(sourcemaps.init())\n .pipe(stylus({\n use: [koutoSwiss(), prefixer(), jeet(), rupture()],\n compress: true\n }))\n .pipe(rename('preview.min.css'))\n .pipe(plumber())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('_site/assets/css/'))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest('assets/css'));\n}", "title": "" }, { "docid": "b950c459d13c17227c73c55e904e6f2f", "score": "0.5874075", "text": "function buildCss() {\n return gulp\n .src('./src/css/editor.scss')\n .pipe(sass().on('error', sass.logError))\n .pipe(gulp.dest('./build/css/'));\n}", "title": "" }, { "docid": "994ab4591c4097153019465a8df5ab97", "score": "0.5863904", "text": "function css(ripple) {\n log('creating');\n ripple.types['text/css'] = {\n header: 'text/css',\n check: function check(res) {\n return (0, _includes2.default)('.css')(res.name);\n }\n };\n\n return ripple;\n}", "title": "" }, { "docid": "faa65d9f8391c0b0434183104c660e7e", "score": "0.5821914", "text": "function css() {\n// JK-NOTE 2019-06-30: Not currently using sass; prior code follows\n // return gulp.src('sass/**/*.scss')\n return gulp.src('css/**/*.css')\n // JK-NOTE 2019-06-30: Not currently using sass\n // .pipe(sass().on('error', sass.logError))\n .pipe(autoprefixer({}))\n .pipe(gulp.dest('dist/css'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "b3af60d128d9f74b4905efff9da3823a", "score": "0.5821099", "text": "function style() {\n return gulp\n .src(paths.styles.src)\n .pipe( through2.obj( function( file, enc, cb ) {\n let date = new Date();\n file.stat.atime = date;\n file.stat.mtime = date;\n cb( null, file );\n }) )\n // Initialize sourcemaps before compilation starts\n //.pipe(sourcemaps.init())\n .pipe(autoprefixer({\n browsers: ['last 2 versions']\n }))\n .pipe(sass())\n .pipe(rename({\n basename: \"dev\"\n }))\n .pipe(gulp.dest(paths.styles.dest))\n .pipe(browserSync.stream())\n .pipe(sass({\n outputStyle: 'compressed'\n }))\n // Use postcss with autoprefixer and compress the compiled file using cssnano\n //.pipe(postcss([autoprefixer(), cssnano()]))\n // Now add/write the sourcemaps\n //.pipe(sourcemaps.write())\n .pipe(rename({\n basename: \"live\"\n }))\n .pipe(gulp.dest(paths.styles.dest))\n // Add browsersync stream pipe after compilation\n // .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "b7bae3e4f0227f40b637c68d9007ad21", "score": "0.5819032", "text": "function loadCssOffline(file) {\n var link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = file;\n document.getElementsByTagName('head')[0].appendChild(link);\n}", "title": "" }, { "docid": "ea02693d876790f27977f41c799a5ee9", "score": "0.58157355", "text": "static getUserStyles() {\n return userStyles;\n }", "title": "" }, { "docid": "0256f2122d55268ed6558ab219c054d1", "score": "0.5814689", "text": "function getStyleSheet() {\n var cssFiles = document.styleSheets.length;\n console.dir(document.styleSheets);\n for(var i=0; i<cssFiles.length; i++){\n console.log(cssFiles[i]);\n }\n var innerStyle = document.styleSheets[1];\n console.log(innerStyle);\n}", "title": "" }, { "docid": "4d2156bb866dc01d26c9c763efab1c5b", "score": "0.5808268", "text": "function Style(props, context) {\n const { __styles = [] } = context;\n\n return __styles.map((src, index) => <link {...props} rel=\"stylesheet\" href={src} key={`style_${index}`} />);\n}", "title": "" }, { "docid": "54c70e7f11bf7298eb6698de0eda9749", "score": "0.5798304", "text": "static getStyles(){return this.styles}", "title": "" }, { "docid": "0a0342eb00327da5446a76c366b80db6", "score": "0.5793708", "text": "function addMaterialAppStyles(options) {\n return (host) => {\n const workspace = config_1.getWorkspace(host);\n const project = get_project_1.getProjectFromWorkspace(workspace, options.project);\n const styleFilePath = project_style_file_1.getProjectStyleFile(project);\n const buffer = host.read(styleFilePath);\n if (!buffer) {\n return console.warn(`Could not find styles file: \"${styleFilePath}\". Skipping styles ` +\n `generation. Please consider manually adding the \"Roboto\" font and resetting the ` +\n `body margin.`);\n }\n const htmlContent = buffer.toString();\n const insertion = '\\n' +\n `html, body { height: 100%; }\\n` +\n `body { margin: 0; font-family: Roboto, \"Helvetica Neue\", sans-serif; }\\n`;\n if (htmlContent.includes(insertion)) {\n return;\n }\n const recorder = host.beginUpdate(styleFilePath);\n recorder.insertLeft(htmlContent.length, insertion);\n host.commitUpdate(recorder);\n };\n}", "title": "" }, { "docid": "c76d2a88c78e8f40e97e0e1ab2a1a940", "score": "0.5790908", "text": "function createCss () {\n return app + '\\n\\n' + prism + '\\n\\n' + extend + '\\n\\n' + styleguide\n}", "title": "" }, { "docid": "596ddd4104c9337a33879d6b31158d99", "score": "0.5787984", "text": "function loadCSS(url){\n\tvar link = document.createElement(\"link\");\n\tlink.type = \"text/css\";\n\tlink.rel = \"stylesheet\";\n\tlink.href = url;\n\tdocument.getElementsByTagName(\"head\")[0].appendChild(link);\n}", "title": "" }, { "docid": "fc8a0883bf07f2332a6aa4d177b46e24", "score": "0.5780453", "text": "static extractCss() {\n return new ExtractTextPlugin(helpers.isProduction() ? '[name].[contenthash].css' : '[name].css')\n }", "title": "" }, { "docid": "d0a88a0be41205cb925d7bc205fd1c74", "score": "0.5779461", "text": "static get styles() {\n return [\n css`\n :host {\n display: block;\n }\n `,\n ];\n }", "title": "" }, { "docid": "10b2b94c901488060318a0e246a0b227", "score": "0.57776517", "text": "function css(cb) {\n gulp\n .src(devPaths.styles + '/**/*.css')\n .pipe(gulp.dest(webPaths.styles))\n .pipe(browserSync.stream())\n cb()\n}", "title": "" }, { "docid": "cec37b6013842e600ad85a4641ff1cf7", "score": "0.577644", "text": "initializeStylus() {}", "title": "" }, { "docid": "8b16b0b199bc3066b4db745e54976ae6", "score": "0.5774505", "text": "function css() {\n return gulp\n .src(pathCSS.sourceCSS)\n .pipe(concat('stylesheet-quote-app.css'))\n .pipe(autoprefixer({\n browsers: ['last 2 versions'] // config object\n }))\n .pipe(gulp.dest(pathCSS.destCSS));\n}", "title": "" }, { "docid": "7ca9b75c1e0f663f0ae018658d98cdd2", "score": "0.57741433", "text": "static get styles() {\n return [\n css`\n :host {\n display: block;\n }\n `\n ];\n }", "title": "" }, { "docid": "6521d91791efd52f24ad4e641a6a87ca", "score": "0.576627", "text": "function Stylesheet(props){\n //in this styling is applied in myStyles.css with the class primary are are using conditionally that function \n let className=props.primary ? 'primary': ''\nreturn(\n \n <div>\n\n {/* we are using template litrals for multiline strings */}\n <h1 className={`${className} myfont`}>Lakshita</h1>\n </div>\n )\n\n}", "title": "" }, { "docid": "20bb24bdc3503f023a3cf75128e7a2c7", "score": "0.57567894", "text": "function scss() {\n return gulp .src( PATHS .styles .src )\n .pipe( sass( { outputStyle: 'compressed' } ) .on( 'error', sass .logError ) )\n .pipe( sourcemaps .init() )\n .pipe( autoprefixer( { browsers: BROWSERS } ) )\n .pipe( rename( { suffix: '.min' } ) )\n .pipe( sourcemaps .write( './' ) )\n .pipe( gulp .dest( PATHS .styles .dest ) );\n}", "title": "" }, { "docid": "9d3afad765362d44aa9afd9525c47e2b", "score": "0.57527524", "text": "function css () { // done es dar por terminado la funcion, se llama una vez terminado la funcion\n return src(paths.scss)\n .pipe(sourcemaps.init())\n .pipe( sass() )\n .pipe(postcss( [autoPrefixer(), cssnano()] ) )\n .pipe(sourcemaps.write('.'))\n .pipe(dest('./build/css'))\n}", "title": "" }, { "docid": "48031916a153546229bb3062fba58ea0", "score": "0.57524985", "text": "static html_style() {\n\t\treturn this.html_link(this.app_url(\"css/style.css\"));\n\t}", "title": "" }, { "docid": "7758378c234446b2770907bb50fa64a6", "score": "0.5737179", "text": "function copySpriteCSS() {\n return gulp.src('./app/temp/sprite/css/*.css')\n .pipe(rename('_sprite.css'))\n .pipe(gulp.dest('./app/assets/styles/modules/'));\n}", "title": "" } ]
762e1014045bca30cb68c63c658b827a
Reset FORM validation errors
[ { "docid": "bf21c1edeee26d2261325129e40a84cf", "score": "0.0", "text": "function form_ok(myField)\n{\n\tmyField.className = myField.className.replace(/ form_error/,'');\n}", "title": "" } ]
[ { "docid": "ac7e8e1dc492d517d18f302c4b624741", "score": "0.84750265", "text": "function resetErrors() {\n hideError(firstForm);\n border(firstForm, colorGrey);\n\n hideError(lastForm);\n border(lastForm, colorGrey);\n\n hideError(emailForm);\n border(emailForm, colorGrey);\n\n hideError(birthdateForm);\n border(birthdateForm, colorGrey);\n\n hideError(quantityForm);\n border(quantityForm, colorGrey);\n\n hideError(locationForm[1]);\n borderRadio(colorDefault);\n\n hideError(conditionForm);\n border(condiCheckbox, colorDefault);\n}", "title": "" }, { "docid": "8527a7ae980b2c2b889fe0d5be34de07", "score": "0.7875049", "text": "function clearErrors() {\n $(options.formObj).find('[data-validation-for]').each(function () {\n $(this).html('').addClass(options.hideClass);\n $('#' + $(this).attr('data-validation-for')).removeClass('error');\n });\n }", "title": "" }, { "docid": "4340be88c6a888bf88fadda38269bd2c", "score": "0.78187066", "text": "clearFormErrors(){\n this[this.formObject].fields.forEach(val=>{\n // set error message of fields to null\n val.errorMessages = null;\n // set error status of fields to false or clear error status on form input\n val.error = false;\n })\n }", "title": "" }, { "docid": "50cc1475ba02e6ffe8476774d5a016be", "score": "0.7814478", "text": "function resetError() {\n vm.error = false;\n vm.success = false;\n vm.validationError = {};\n }// end of resetError function", "title": "" }, { "docid": "78132c944ba1469681e216dfe57036ec", "score": "0.7652474", "text": "resetErrors() {\n this._errorCollection = new ErrorCollection(\"formobject\");\n this.attributeCollection.forEach((attribute) => attribute.resetErrors());\n }", "title": "" }, { "docid": "ab4b9546afefa69175a2180560a50c02", "score": "0.75759035", "text": "reset () {\n Object.keys(this.errors).forEach((field) => {\n this.errors[field] = []\n })\n }", "title": "" }, { "docid": "dbca124e63b919590ae96e582cb431d5", "score": "0.75526255", "text": "function resetForm() {\n // Reset name form group and name validity flag\n $('#name-form-group').removeClass('has-success');\n $('#name-form-group .form-control-feedback').removeClass('glyphicon-ok');\n $('#name').val(\"\");\n validName = false;\n\n // Reset email form group and email validity flag\n $('#email-form-group').removeClass('has-success');\n $('#email-form-group .form-control-feedback').removeClass('glyphicon-ok');\n $('#email').val(\"\");\n validEmail = false;\n\n // Reset message form group and message validity flag\n $('#message-form-group').removeClass('has-success');\n $('#message-form-group .form-control-feedback').removeClass('glyphicon-ok');\n $('#message').val(\"\");\n validMsg = false;\n}", "title": "" }, { "docid": "967782be3236fadd9b01e11b6c5f375c", "score": "0.75417316", "text": "function reset()\n {\n // Iterate through form elements to remove error messages and error styling\n for (var i = 0; i < inputs.length; i++)\n {\n if (inputs[i].type == \"input\")\n {\n if (inputs[i].getAttribute(\"type\") == \"text\")\n inputs[i].innerHTML = \"\";\n else if (inputs[i].getAttribute(\"type\") == \"checkbox\")\n inputs[i].checked = false;\n }\n else if (inputs[i].type == \"textarea\")\n inputs[i].innerHTML = \"\";\n\n hideError(inputs[i]);\n }\n\n // Remove the success message if it's there\n var success = document.getElementById(\"success\");\n if (success.classList.contains(\"show\"))\n success.classList.remove(\"show\");\n }", "title": "" }, { "docid": "a63a5d2827fe9964883b2fff80415bed", "score": "0.7432927", "text": "function resetValidationError() {\r\n var domCache = privateProps.domCache.get(this);\r\n if (domCache.validationError) {\r\n hide(domCache.validationError);\r\n }\r\n\r\n var input = this.getInput();\r\n if (input) {\r\n input.removeAttribute('aria-invalid');\r\n input.removeAttribute('aria-describedBy');\r\n removeClass(input, swalClasses.inputerror);\r\n }\r\n}", "title": "" }, { "docid": "173739d6bd547b18e043fbc684ab7cb6", "score": "0.74057186", "text": "function resetValidationError() {\n var domCache = privateProps.domCache.get(this);\n if (domCache.validationError) {\n hide(domCache.validationError);\n }\n\n var input = this.getInput();\n if (input) {\n input.removeAttribute('aria-invalid');\n input.removeAttribute('aria-describedBy');\n removeClass(input, swalClasses.inputerror);\n }\n}", "title": "" }, { "docid": "173739d6bd547b18e043fbc684ab7cb6", "score": "0.74057186", "text": "function resetValidationError() {\n var domCache = privateProps.domCache.get(this);\n if (domCache.validationError) {\n hide(domCache.validationError);\n }\n\n var input = this.getInput();\n if (input) {\n input.removeAttribute('aria-invalid');\n input.removeAttribute('aria-describedBy');\n removeClass(input, swalClasses.inputerror);\n }\n}", "title": "" }, { "docid": "173739d6bd547b18e043fbc684ab7cb6", "score": "0.74057186", "text": "function resetValidationError() {\n var domCache = privateProps.domCache.get(this);\n if (domCache.validationError) {\n hide(domCache.validationError);\n }\n\n var input = this.getInput();\n if (input) {\n input.removeAttribute('aria-invalid');\n input.removeAttribute('aria-describedBy');\n removeClass(input, swalClasses.inputerror);\n }\n}", "title": "" }, { "docid": "1060a911d8023553e9ee8b639d8314db", "score": "0.74008274", "text": "function resetErrors() {\n const { ...newFields } = state.fields;\n\n Object.keys(newFields).forEach(field => {\n newFields[field] = updateFieldData(newFields[field], { error: null });\n });\n\n setState({\n fields: newFields,\n });\n }", "title": "" }, { "docid": "fed4554864f3955936e6699540788519", "score": "0.7382905", "text": "function resetFormErrors(jQuery) {\n jQuery(\"#libreAR-email-field\").removeClass('error');\n jQuery(\"#libreAR-name-field\").removeClass('error');\n jQuery(\"#libreAR-iam-field\").removeClass('error');\n jQuery(\"#libreAR-instr-libreNet-field\").removeClass('error');\n jQuery(\"#libreAR-instr-inst-dropdown-field\").removeClass('error');\n jQuery(\"#libreAR-instr-inst-field\").removeClass('error');\n jQuery(\"#libreAR-instr-class-field\").removeClass('error');\n jQuery(\"#libreAR-instr-taught-field\").removeClass('error');\n jQuery(\"#libreAR-instr-students-field\").removeClass('error');\n }", "title": "" }, { "docid": "b3690daa915cd45572946afd3e5104bb", "score": "0.73327214", "text": "function clearErrors() {\n\t$(\".form-group.has-error\").removeClass('has-error');\n\t$(\"label.error-msg, .alert\").remove();\n\n}", "title": "" }, { "docid": "3c40d9aa8c9ecab90a3e7694f2bee565", "score": "0.7328507", "text": "function clearErrors() {\n // Clear all errors\n receiverLabel.removeClass(\"label-danger\");\n receiverLabel.addClass(\"label-primary\");\n receiverLabel.text(\"Receiver name must be unique\");\n\n receiverNameDiv.removeClass(\"has-error\");\n receiverRoomNumberDiv.removeClass(\"has-error\");\n }", "title": "" }, { "docid": "323274065bfa4e3da4c5be3d285d57bb", "score": "0.729422", "text": "function resetErrors() {\n $(\"#not-military-time\").empty();\n $(\"#missing-field\").empty();\n $(\"#not-a-number\").empty();\n $(\"#missing-field\").empty();\n}", "title": "" }, { "docid": "e52ccea9d00c8b5df54a8ef9ea468b10", "score": "0.72666913", "text": "function resetVrnValidation() {\r\n $formField.removeclassName('error');\r\n $formField.find('.err-msgs div, .err-msgs p').hide();\r\n }", "title": "" }, { "docid": "0ded2a5eb6ec1b7f07fd17ad2fb7a6cc", "score": "0.72539634", "text": "function resetForms() {\n for (i = 0; i < formvalues.length; i++) {\n setValue(formvalues[i])\n }\n document.getElementById(\"Business\").checked = false;\n document.getElementById(\"Customer\").checked = true;\n removeAllErrors();\n }", "title": "" }, { "docid": "4f69a0d65cdeeaf738dd022f3d95bba9", "score": "0.72204196", "text": "function clearFormValidationErrors() {\n var error = $(\".form-group.has-error\");\n error.removeClass('has-error');\n error.find('.help-block').remove();\n}", "title": "" }, { "docid": "6fc3131cd56808a3090586c5c9f1bc6f", "score": "0.71433043", "text": "reset() {\n this._resetter.reset();\n this._validationManager.reset();\n }", "title": "" }, { "docid": "e6db02f114cc89528929c7a479421144", "score": "0.7104014", "text": "function resetForm() {\n setInputs(initial);\n }", "title": "" }, { "docid": "1856841643b42cc07f77d006b4aa9247", "score": "0.70914197", "text": "revokeAllInputErrors() {\n if (this.inputContainer.querySelector(\".error\")) {\n this.inputContainer.querySelector(\".error\").remove();\n }\n this.errors = [];\n this.errors = this.errors.filter(Boolean);\n this.incorrect = false;\n this.inputContainer.classList.remove(\"incorrect\");\n }", "title": "" }, { "docid": "66089e08f46a4c4b768c78c9ae5776d0", "score": "0.70879817", "text": "function resetForms(){\n\tvar AformsSel = document.getElementsByTagName('form');\n\n\tfor (var i = 0; i < AformsSel.length; i++) {\n \t\tAformsSel[i].style.display=\"none\";\n \t\tAformsSel[i].reset();\n }\n\n var aClases = document.querySelectorAll(\".is-invalid\");\n\n for(var i=0;i<aClases.length;i++){\n \taClases[i].classList.remove(\"is-invalid\");\n }\n}", "title": "" }, { "docid": "fdcb21e3cac025143fd7c84b565e665a", "score": "0.7074323", "text": "resetFields(resetErrorMessage = true){\n document.getElementById(\"url\").value = \"\"\n document.getElementById(\"title\").value = \"\"\n if(resetErrorMessage){\n document.getElementById(\"errorMsg\").innerHTML = \"\"\n }\n }", "title": "" }, { "docid": "bb7040f888e29e27ed18ea364cb7e447", "score": "0.70720565", "text": "function clearAllErrorMessages() \n{\n clearAllErrors();\n clearAllErrorBorder();\n}", "title": "" }, { "docid": "397b60735ba325fb499c30f0ff751773", "score": "0.7056661", "text": "refreshValidationState() {\n super.refreshValidationState()\n this._errors = {}\n }", "title": "" }, { "docid": "9448192c929036b4085219cf91c6a65f", "score": "0.7053121", "text": "function clearFieldErrorMovieForm() {\n clearFieldErrorMessage(\"title\");\n clearFieldErrorMessage(\"genre\");\n clearFieldErrorMessage(\"duration\");\n clearFieldErrorMessage(\"rating\");\n clearFieldErrorMessage(\"samenvatting\");\n clearFieldErrorMessage(\"kijkwijzer\");\n clearFieldErrorMessage(\"coverImage\");\n clearFieldErrorMessage(\"thumbnailImage\");\n \n}", "title": "" }, { "docid": "0fca7627c63d88435a26b67564ffed44", "score": "0.7050981", "text": "function resetValues() {\n // set all global booleans to false\n aprIsValid = false;\n termIsValid = false;\n amountIsValid = false;\n\n // set focus to APR field\n apr.focus();\n}", "title": "" }, { "docid": "6770f5fba64b5000f421e93c5001c55b", "score": "0.7037574", "text": "function clearFormFieldErrors()\n {\n $(\".form-error\").empty().removeAttr('class').addClass('form-error');\n }", "title": "" }, { "docid": "f9753d93f4a08a2fa37afb8e3d844c9c", "score": "0.702867", "text": "function clearFormErrors(options={}) {\n\n if (options && options.modal) {\n // Remove the individual error messages\n $(options.modal).find('.form-error-message').remove();\n\n $(options.modal).find('.modal-content').removeClass('modal-error');\n\n // Remove the \"has error\" class\n $(options.modal).find('.form-field-error').removeClass('form-field-error');\n\n // Hide the 'non field errors'\n $(options.modal).find('#non-field-errors').html('');\n } else {\n $('.form-error-message').remove();\n $('.form-field-errors').removeClass('form-field-error');\n $('#non-field-errors').html('');\n }\n}", "title": "" }, { "docid": "3a71496c38ee686aeff750615f9673e3", "score": "0.6991716", "text": "reset() {\n // initialize self's field value (in the DOM) to the client\n // supplied `initialValue`, if any (no-op otherwise)\n this.initializeDomFieldValue();\n\n // reset our error state\n this.clearErrMsg();\n this._cachedIsValid = 'UNKNOWN';\n\n // mark self as NOT touched\n this._touched = false;\n }", "title": "" }, { "docid": "37cd5429818692d93cae1d949744fe35", "score": "0.6969414", "text": "function _clearErrors() {\n _minTimeInput.unmarkInvalid();\n _maxTimeInput.unmarkInvalid();\n _errorSpan.textContent = \"\";\n _errorSpan.classList.add(\"hidden\");\n }", "title": "" }, { "docid": "b797e4a4218c15ef919d526c0913c517", "score": "0.6907768", "text": "function resetValidatorsForm() {\n $(\"#q-im-addedit-validator-section-header\").text(\"Add Validator\");\n $(\"#q-im-validator-select\").val(\"default\");\n $(\"#im-val-maxvalue-input\").val(\"\");\n $(\"#im-val-minvalue-input\").val(\"\");\n $(\"#im-val-pattern-input\").val(\"\");\n\n $(\"#im-val-maxvalue-inputgroup\").toggle(false);\n $(\"#im-val-minvalue-inputgroup\").toggle(false);\n $(\"#im-val-pattern-inputgroup\").toggle(false);\n}", "title": "" }, { "docid": "be96ad97cadaa8f37e2795ef646a04a9", "score": "0.6901876", "text": "resetForms() {\n document.forms['user-input-area'].reset();\n }", "title": "" }, { "docid": "677a7db1219beab9c31b746300bcc69a", "score": "0.68962854", "text": "reset () {\n for (let field in this.originalData) {\n this[field] = ''\n }\n this.errors.reset()\n }", "title": "" }, { "docid": "b6456a094bcb4e11a016346a761fd44f", "score": "0.68958586", "text": "function resetFieldError(id){\n //document.getElementById(id).setCustomValidity(\"\");\n var errorLabel=id+\"_err\";\n document.getElementById(errorLabel).style.visibility=\"hidden\"; \n}", "title": "" }, { "docid": "1d2dbabfd9c616c61f139a0164715e82", "score": "0.68938994", "text": "function resetValidation(param) {\n $(param).validator('destroy').validator();\n}", "title": "" }, { "docid": "c5182073d03941be64c1ff6d89234b9a", "score": "0.6852619", "text": "reset() {\n this.errors.clear();\n\n for(let field in this.originalData) {\n this[field] = '';\n }\n }", "title": "" }, { "docid": "68d48e3672110c5baa187dc4ac197d3a", "score": "0.6843732", "text": "cleanErrors() {\n log.debug('App - cleanErrors()');\n\n const activeForm = this.getActiveForm();\n const fields = activeForm === 'loadCharacter'\n ? this.loginFields\n : this.registerFields;\n\n for (let i = 0; i < fields.length; i += 1) {\n fields[i].removeClass('field-error');\n }\n\n $('.validation-error').remove();\n $('.status').remove();\n }", "title": "" }, { "docid": "c6a6e8b43b4e482b73695d42703ee490", "score": "0.68321526", "text": "function resetForms(formName, inputs) {\n formName.reset();\n inputs.forEach(element => element.classList.remove('is-invalid'));\n}", "title": "" }, { "docid": "18b0713e38594bb87a5a643c3eb1cfde", "score": "0.6820633", "text": "clearFormErrorAtField(event){\n this.errors.clear(event.target.name)\n }", "title": "" }, { "docid": "67a23e6873ef1e55df4cda98da8fdf27", "score": "0.6819647", "text": "function resetearFormulario() {\n\tformulario.reset();\n}", "title": "" }, { "docid": "c28058db339590705f4f837af87829e2", "score": "0.68144584", "text": "removeErrors() {\n $('#review-form-error').empty();\n $('#review-form-error').hide();\n }", "title": "" }, { "docid": "7fb50dedac8ee1e0e1d8c06a4789b427", "score": "0.6813541", "text": "function ClearFormValidation() {\n $('[name=\"billingAddress.address1\"]').parents('.form-group').removeClass('has-error');\n $('[name=\"billingAddress.city\"]').parents('.form-group').removeClass('has-error');\n $('[name=\"billingAddress.state\"]').parents('.form-group').removeClass('has-error');\n $('[name=\"billingAddress.zip\"]').parents('.form-group').removeClass('has-error');\n // remove all error messages\n $('.error-msg').html('');\n }", "title": "" }, { "docid": "18205b0120aa1162fb88735d664cdf79", "score": "0.68107325", "text": "formReset () {\n this.form.name.value = '';\n this.form.description.value = '';\n this.form.time.value = '';\n }", "title": "" }, { "docid": "99660328f874fcf15b538c24caa24afb", "score": "0.6801159", "text": "function resetErrors() {\n var invalidDate = document.querySelector(\".date-message\"),\n invalidRover = document.querySelector(\".rover-message\"),\n datePicker = document.querySelector(\"#solDatePicker\");\n\n datePicker.classList.remove(\"invalid\");\n invalidDate.innerHTML = \"\";\n invalidRover.innerHTML = \"\";\n}", "title": "" }, { "docid": "e1823d9a465269e748c75e88cf31a163", "score": "0.67827344", "text": "function resetForm(){\n\n ($( \"#contact-form .alert-danger\" ).length !== 0)&& $(\".alert-danger\").remove();\n ($( \"#contact-form .alert-success\" ).length !== 0)&& $(\".alert-success\").remove();\n $('#name').val(\"\");\n $('#email').val(\"\");\n $('#message').val(\"\");\n \n}", "title": "" }, { "docid": "3e00036668883a0f1693e5706b282c52", "score": "0.678165", "text": "resetData() {\n this.errors = {};\n this.submitting = false;\n this.isValidForm = true;\n this.openModal = false;\n this.editMode = false;\n this.formObject = {};\n }", "title": "" }, { "docid": "090c759b6006cf504073ad09c00942a5", "score": "0.67806333", "text": "function reset() {\n\t\tvm.editConfigFrm.$setPristine();\n\t}", "title": "" }, { "docid": "84a760929397a540b9e114261d0a8b14", "score": "0.66952354", "text": "reset (fields) {\n Object.keys(this.errors).forEach(key => {\n if (!fields || fields.includes(key)) {\n this.errors[key] = []\n }\n })\n }", "title": "" }, { "docid": "8b427c47e342ab3c06004295d7b7990a", "score": "0.6682909", "text": "reset() {\n this._el.reset();\n\n for (let field of this._fields) {\n field.reset();\n }\n\n this._resetErrors(); \n }", "title": "" }, { "docid": "cc1a6948da75a1abf7068796a863dcb5", "score": "0.6680151", "text": "function resetForm()\n {\n // Timeout is required here because we need to\n // let form model to reset before setting the\n // statuses\n $timeout(function ()\n {\n // Reset all the steps\n for ( var x = 0; x < vm.steps.length; x++ )\n {\n vm.steps[x].form.$setPristine();\n vm.steps[x].form.$setUntouched();\n }\n\n // Reset the main form\n vm.mainForm.$setPristine();\n vm.mainForm.$setUntouched();\n\n // Go to first step\n gotoFirstStep();\n });\n }", "title": "" }, { "docid": "0a3db4aba767139dfd0fab7320193281", "score": "0.6673481", "text": "_clearFormErrors() {\n this.setState({ errors: [] });\n }", "title": "" }, { "docid": "0a3db4aba767139dfd0fab7320193281", "score": "0.6673481", "text": "_clearFormErrors() {\n this.setState({ errors: [] });\n }", "title": "" }, { "docid": "c7abf0da1c831e574f1c7adb350a6170", "score": "0.6668229", "text": "reset() {\n let errors = {};\n\n for (let rule in rules) {\n if (rules.hasOwnProperty(rule)) {\n errors[rule] = [];\n }\n }\n\n target_component.setState({\n errors\n });\n }", "title": "" }, { "docid": "5c08198712a50b4e48177730804bd358", "score": "0.66681194", "text": "function clearErrors() {\n\tvar idx = $('.errors span');\n\tfor(i=0; i<idx.length; i++) {\n\t\t$(idx[i]).text(\"\");\n\t\t$(idx[i]).removeClass('error_background');\n\t}\n}", "title": "" }, { "docid": "71ee6b6aebc1713e31f29069c4372519", "score": "0.66679436", "text": "function clearForm(){\n\t\t$('form')[0].reset();\n\t\t$(window).scrollTop(0); //scrolls the browser window to the top of the page after clearing inputs\n\t\t$submit.html(\"Register\");\n\t\t$success.hide();\n\t\tclearErrors();\n\t}", "title": "" }, { "docid": "2991bd33b9fa7599be4923ea6ddeb003", "score": "0.6660634", "text": "resetFormValues() {\n this.setState({\n title: '',\n message: '',\n phone: '',\n city: '',\n formErrors: {\n title: '',\n message: '',\n phone: '',\n city: ''\n },\n inputStatus: {\n title: 'default',\n message: 'default',\n phone: 'default',\n city: 'default'\n }\n });\n }", "title": "" }, { "docid": "0f45b947dfece0873058e0aa19ae86bf", "score": "0.66546303", "text": "function resetAddForm(){\r\n TelephoneField.reset();\r\n FNameField.reset();\r\n LNameField.reset();\r\n TitleField.reset();\r\n MailField.reset();\r\n AddField.reset();\r\n MobileField.reset();\r\n }", "title": "" }, { "docid": "2a1ac2957ec3512620e42e78f47eff51", "score": "0.66372746", "text": "reset(state) {\n if (state && (!state.inputErrors || state.inputErrors)) {\n state = _.set(state, \"inputErrors\", {});\n }\n this.currentComponent.setState(state);\n }", "title": "" }, { "docid": "f462908f9fb27f1cc6486c5352543025", "score": "0.6636875", "text": "function resetValidationStatus(){\n reset('spot-json')\n reset('spot-schema')\n reset('spot-defaults')\n reset('spot-jsonld')\n reset('spot-additional')\n}", "title": "" }, { "docid": "16726da6aa1a87c0737f8489de5a5ca6", "score": "0.663677", "text": "reset () {\n merge(this, this.initial)\n \n this.errors.clear()\n }", "title": "" }, { "docid": "dcd3410c328df29547f85475895d6d15", "score": "0.6634676", "text": "function clearErrorStates() {\n $('.form-group').removeClass('has-error');\n $('.help-block').removeClass('active');\n $('#serverSuccessMessage').hide();\n $('#serverErrorMessage').hide();\n}", "title": "" }, { "docid": "162b74efd519e06eb395f586e4c217b7", "score": "0.6632391", "text": "function clearErrors(){\n\tvar formElements = document.forms[\"contact-form\"].elements;\n\tfor (var loopCounter=0; loopCounter < formElements.length; loopCounter++){\n\t\tif(formElements[loopCounter].parentElement.className.indexOf(\"has-\") != -1){\n\t\t\tformElements[loopCounter].parentElement.className = \"form-group\";\n\t\t}\n\t}\n\t\n}", "title": "" }, { "docid": "47ca12520b8fb2cd698ddeca980d59ef", "score": "0.66316855", "text": "resetErrors() {\n this.setState({\n errors: {\n ...this.state.errors,\n id: 0,\n er_name: '',\n er_email: '',\n er_ci: '',\n er_last_name: '',\n er_username: '',\n er_birth_date: '',\n er_gender: '',\n er_address: '',\n er_province: '',\n er_city: '',\n er_phone: '',\n er_url_image: '',\n er_status: ''\n },\n form: {\n ...this.state.form,\n id: 0,\n name: '',\n email: '',\n ci: '',\n last_name: '',\n username: '',\n birth_date: '',\n gender: 'masculino',\n address: '',\n province: '',\n city: '',\n phone: '',\n url_image: '',\n status: 'activo',\n rol: 1\n }\n })\n }", "title": "" }, { "docid": "3d070a6256dd72c71ac8c79bab914f1c", "score": "0.6625025", "text": "function clearErrorState( ) {\n\t$j('.rate_calc_form #phone_number').removeClass('error');\n\t$j('.error_message').hide();\n}", "title": "" }, { "docid": "c763339597c7844f029857e3ddbbc680", "score": "0.65992856", "text": "function resetNilaiForm(){\n MatkulField.setValue('');\n StatusField.setValue('');\n NilaiField.setValue('');\n }", "title": "" }, { "docid": "81def96fa5fff04d459d064fec738798", "score": "0.6593294", "text": "function resetFormFields() {\n select.selectedIndex = 0;\n title.value = \"\";\n author.value = \"\";\n pageCount.value = \"\";\n select.classList.remove(\"valid\");\n title.classList.remove(\"valid\");\n author.classList.remove(\"valid\");\n pageCount.classList.remove(\"valid\");\n}", "title": "" }, { "docid": "6a6c8f99abb57ef39bda1a6d6b89e53f", "score": "0.65677404", "text": "function resetForm(_form){\n _form.find('input:text, input:password, input:file, select').val('');\n _form.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');\n }", "title": "" }, { "docid": "3e195b01e07dc724499ff4d88f0177df", "score": "0.65587914", "text": "function clearForm() {\r\n // Remove class \"errorBox\" from input elements\r\n var elms = document.querySelectorAll('.errorBox'); // class\r\n for (var i = 0; i < elms.length; i++) {\r\n elms[i].classList.remove(\"errorBox\");\r\n }\r\n \r\n // Remove previous error messages\r\n elms = document.querySelectorAll('[id$=\"Error\"]'); // id ends with Error\r\n for (var i = 0; i < elms.length; i++) {\r\n elms[i].innerHTML = \"\";\r\n }\r\n \r\n // Set initial focus\r\n document.getElementById(\"txtName\").focus();\r\n}", "title": "" }, { "docid": "1f01349fb2a2fe48d14a1779d6ec99b3", "score": "0.65471923", "text": "function resetForm() {\n vm.form.$setPristine();\n vm.form.$setUntouched();\n vm.project = {};\n }", "title": "" }, { "docid": "99ccaa286448b4a47a0eab632bf3824a", "score": "0.65424395", "text": "function resetForm() {\n $('input').each(function() {\n $(this).val(\"\");\n $(this).attr('value', '');\n });\n $('textarea').each(function() {\n $(this).val(\"\");\n $(this).html('');\n });\n }", "title": "" }, { "docid": "7071862b1cc9ddfc024bc979bae34a32", "score": "0.6527421", "text": "function limpiar(){\r\nform.reset(); \r\n\r\n}", "title": "" }, { "docid": "6fddff0155601d74b6587595cf6dd771", "score": "0.6510773", "text": "resetErrorMessage() {\n this.setState({\n errorMessage: '',\n errors: false\n });\n }", "title": "" }, { "docid": "1c7868dccc7a94be2d9cf5b4743aa2cb", "score": "0.6507531", "text": "function resetForm() { // Function to clear the form\n $(\".formMe\")[0].reset();\n }", "title": "" }, { "docid": "754112c3a98b2cf5360dcc415878e29e", "score": "0.6503231", "text": "cleanForm(){\n\t\tthis.firstName.value = '';\n\t\tthis.lastName.value = '';\n\t\tthis.phone.value = '';\n\t}", "title": "" }, { "docid": "90bfe5c44c4779a95f2607b703fab64c", "score": "0.6496807", "text": "function resetInputs() {\n let form = document.getElementById(\"form\");\n form.reset();\n}", "title": "" }, { "docid": "19ca06be31fcbd16e00d5f1b909d682c", "score": "0.6494606", "text": "function resetForms() {\n document.forms['_Commandes'].reset();\n}", "title": "" }, { "docid": "517dd5c99f9d0d6bca6a1db4738fd0f6", "score": "0.6491426", "text": "function resetStatus() {\n isFirstSubmit = true;\n initFormElement = null;\n}", "title": "" }, { "docid": "1ebd1af0cca61930a610a311701ee3c8", "score": "0.64883494", "text": "function _resetAddressForm() {\n console.log(\"reset form\");\n vm.addressFormVisible = false;\n vm.showNewAddressErrors = false;\n vm.newAddress = null;\n vm.addressForm.$setPristine();\n vm.addressForm.$setUntouched()\n }", "title": "" }, { "docid": "a154fda05482f424b1e931884edd18a1", "score": "0.6487637", "text": "function formReset() {\n\t\t\tvar forms = Array.from(document.querySelectorAll(\"form\"));\n\n\t\t\tforms.forEach(function (element) {\n\t\t\t\telement.reset();\n\n\t\t\t\tvar formGroups = Array.from(element.querySelectorAll(\".form-group\"));\n\t\t\t\tformGroups.forEach(function (element) {\n\t\t\t\t\telement.classList = \"form-group\";\n\t\t\t\t});\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "4b86a3377bfea3036f68f3cc1613344a", "score": "0.6479124", "text": "function cleanErrorMessagesEdit() {\n\t\tdocument.forms[\"EditUser\"].getElementsByClassName(\"edit_id_error\")[0].innerHTML = \"\";\n\t\tdocument.forms[\"EditUser\"].getElementsByClassName(\"edit_name_error\")[0].innerHTML = \"\";\n\t\tdocument.forms[\"EditUser\"].getElementsByClassName(\"edit_phone_error\")[0].innerHTML = \"\";\n\t}", "title": "" }, { "docid": "c43c07a4bb1e800481ddf469ef9c8543", "score": "0.6477205", "text": "function reset() {\n\tCHECK_USER_NAME = false;\n\tCHECK_PASSWORD = false;\n\tCHECK_EMAIL = false;\n\tCHECK_BIRTH_DAY = false;\n\tCHECK_DATE = false;\n\t$(\"#idName\").val(\"\");\n\t$(\"#idPass\").val(\"\");\n\t$(\"#idEmail\").val(\"\");\n\t$(\"#out-date\").val(\"\");\n\t$(\"#check-name\").html(\"\");\n\t$(\"#check-date\").html(\"\");\n\t$(\"#check-email\").html(\"\");\n\t$(\"#check-pass\").html(\"\");\n}", "title": "" }, { "docid": "39e447bcc7b038b729b507ff0db4115e", "score": "0.646843", "text": "clearFieldErrors(field, errorMessages) {\n app.elements[field].parent().children(\".error\").html(\"\");\n app.elements[field].removeClass(\"invalid\");\n }", "title": "" }, { "docid": "8f214eb3be774f0fda017f8273694fff", "score": "0.64668554", "text": "function clearForm() {\n form.reset();\n clearError('message');\n var divs = document.getElementsByClassName('hidden');\n for (var i = 0; i < divs.length; i++)\n divs[i].style.display = '';\n}", "title": "" }, { "docid": "8f214eb3be774f0fda017f8273694fff", "score": "0.64668554", "text": "function clearForm() {\n form.reset();\n clearError('message');\n var divs = document.getElementsByClassName('hidden');\n for (var i = 0; i < divs.length; i++)\n divs[i].style.display = '';\n}", "title": "" }, { "docid": "8f214eb3be774f0fda017f8273694fff", "score": "0.64668554", "text": "function clearForm() {\n form.reset();\n clearError('message');\n var divs = document.getElementsByClassName('hidden');\n for (var i = 0; i < divs.length; i++)\n divs[i].style.display = '';\n}", "title": "" }, { "docid": "bb475c660f5f2e4bd5346593a506eca7", "score": "0.6464936", "text": "function resetForm()\n {\n $(\"#form\").reset();\n\n }", "title": "" }, { "docid": "ce86e05e076cdaef96bf1c188c851915", "score": "0.6461766", "text": "function resetForm() {\n form.reset();\n\n startingApp();\n}", "title": "" }, { "docid": "96ff9f82a260bfed59c783b59e116daa", "score": "0.646023", "text": "function clearErrors() {\r\n $scope.noMessageProvided = false;\r\n $scope.isKeyANumber = false; \r\n $scope.isKeyAString = false;\r\n $scope.isKeyAMatrix = false;\r\n }", "title": "" }, { "docid": "0b7fa9d2dea41b9c01972dfbb92950b2", "score": "0.6459077", "text": "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "title": "" }, { "docid": "0b7fa9d2dea41b9c01972dfbb92950b2", "score": "0.6459077", "text": "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "title": "" }, { "docid": "ae8735d0be03c6891c60b0e6ffc4f5a0", "score": "0.6447852", "text": "function validateForm(error) {\n\n // Reset error borders.\n txtEmail.style.border = '';\n txtPassword.style.border = '';\n\n // Reset field values.\n txtEmail.value = '';\n txtPassword.value = '';\n\n // Reset placeholders.\n txtEmail.placeholder = '';\n txtPassword.placeholder = '';\n\n // Visual queue depends on error code.\n switch(error.code) {\n case 'auth/invalid-email':\n txtEmail.style.border = '3px solid #FF6138';\n txtEmail.placeholder = 'Invalid Email';\n break;\n case 'auth/weak-password':\n txtPassword.style.border = '3px solid #FF6138';\n txtPassword.placeholder = 'Weak Password';\n break;\n case 'auth/email-already-in-use':\n txtEmail.style.border = '3px solid #FF6138';\n txtEmail.placeholder = 'Email Already Exists';\n break;\n }\n\n // console.log(error);\n // console.log(error.message);\n}", "title": "" }, { "docid": "283e5b19128a4e5b770213d1824aa3ed", "score": "0.64238", "text": "function clearError() {\n $('#username-group').removeClass('has-error');\n $('#password-group').removeClass('has-error');\n $('#username-error').hide();\n $('#password-error').hide();\n}", "title": "" }, { "docid": "2915a16cb2d54516dbceda5146a5f46f", "score": "0.6422393", "text": "function clearErrorFields() {\n $(\"#loginError\").hide();\n $(\"#passError\").hide();\n $(\"#phoneError\").hide();\n $(\"#inviteError\").hide();\n }", "title": "" }, { "docid": "25a4858542119e3c9fbd8837fe22c964", "score": "0.6418805", "text": "function reset(event) {\n event.preventDefault();\n\n // set form data\n setState({ ...user.subdomainData });\n\n // reset indicators\n setLoading(false);\n setErrorMessage(null);\n setSuccessMessage(null);\n setFormDirty(false);\n }", "title": "" }, { "docid": "95cf958e3d13695a8d728618d85444dd", "score": "0.641819", "text": "function reset_form_add_edit(){\n validator.resetForm();\n $('#protocol').focus(); \n $('#EmailID').val('');\n $('#protocol').val(''); \n $('#smtp_host').val(''); \n $('#smtp_port').val(''); \n $('#smtp_user').val(''); \n $('#smtp_pass').val(''); \n $('html,body').animate({'scrollTop': 0},200);\n load_ajax_out('.form_add_edit');\n }", "title": "" }, { "docid": "0b8e40d91a08e82b4e3017ac0cab96b3", "score": "0.6415736", "text": "function resetForm() {\n\t\tprocessedTags = [];\n\t}", "title": "" }, { "docid": "52e92fc5972d245ea4528348d1e77cfd", "score": "0.6415494", "text": "setErrors (errors) {\n this.submitting = false\n this.errors.set(errors)\n }", "title": "" }, { "docid": "0dd10ba375bdd04673de0def62eadc16", "score": "0.6414109", "text": "_initiateEmptyErrors() {\n const model = this._createModel(this.loginForm);\n const validationResult = model.validate();\n if (!validationResult.ok) {\n displayErrors(this.loginForm, validationResult.errors);\n }\n }", "title": "" } ]
a98827049f4ff339228c62175a8ad7de
add twitter bootstrap classes and color based on how many times tag is used
[ { "docid": "86f08279b33e734d49c4586493480c3c", "score": "0.5714418", "text": "function addTwitterBSClass (thisObj) {\n const title = jQuery(thisObj).attr('title')\n if (title) {\n const titles = title.split(' ')\n if (titles[0]) {\n const num = parseInt(titles[0], 10)\n if (num > 0) {\n jQuery(thisObj).addClass('label label-default')\n }\n if (num === 2) {\n jQuery(thisObj).addClass('label label-info')\n }\n if (num > 2 && num < 4) {\n jQuery(thisObj).addClass('label label-success')\n }\n if (num >= 5 && num < 10) {\n jQuery(thisObj).addClass('label label-warning')\n }\n if (num >= 10) {\n jQuery(thisObj).addClass('label label-important')\n }\n }\n } else {\n jQuery(thisObj).addClass('label')\n }\n return true\n}", "title": "" } ]
[ { "docid": "a0c1f07ea9cfa5b88d5d6bc054109245", "score": "0.6162837", "text": "tagClass(tag) {\n let className = \"tag\";\n if (this.state.tags.indexOf(tag) !== -1) {\n className += \" tag-active\";\n }\n return className;\n }", "title": "" }, { "docid": "32944d4a86b81a421bae760db7c320a9", "score": "0.57704914", "text": "function addColor() {\n var content = $(\"#content\").text().trim();\n\n var occurences = createArray();\n\n // Create spans\n for (var i = 0; i < occurences.length; i++) {\n // Create spans\n var toInsert = \"<span id='s\" + occurences[i].start + \"' class='\" + occurences[i].commonName + \"'>\";\n var start = occurences[i].start;\n var end = occurences[i].end;\n var contentEnd = content;\n var contentStart = contentEnd.slice(0, end) + \"</span>\" + contentEnd.slice(end);\n content = contentStart.slice(0, start) + toInsert + contentStart.slice(start);\n $(\"#content\").html(content);\n $(\"#content span\").addClass(\"sp\");\n }\n\n // Add colors\n for (var a = 0; a < occurences.length; a++) {\n // Random colors\n var randomColor = \"rgb(\" +( Math.floor(Math.random() * 256)) + \",\" + (Math.floor(Math.random() * 256)) + \",\" + (Math.floor(Math.random() * 256)) + \")\";\n\n $(\".tagsButton.\" + occurences[a].commonName + \"\").css(\"background-color\", randomColor);\n $(\"span.\" + occurences[a].commonName + \"\").css(\"background-color\", randomColor).css(\"color\", \"white\");\n\n }\n }", "title": "" }, { "docid": "9b7a5757e8bb7bdab6726d1c165bf59f", "score": "0.5748512", "text": "function addTwitterBSClass(thisObj) {\n var title = jQuery(thisObj).attr('title');\n if (title) {\n var titles = title.split(' ');\n if (titles[0]) {\n var num = parseInt(titles[0]);\n if (num > 0)\n \tjQuery(thisObj).addClass('label label-default');\n if (num == 2)\n jQuery(thisObj).addClass('label label-info');\n if (num > 2 && num < 4)\n jQuery(thisObj).addClass('label label-success');\n if (num >= 5 && num < 10)\n jQuery(thisObj).addClass('label label-warning');\n if (num >=10)\n jQuery(thisObj).addClass('label label-important');\n }\n }\n else\n \tjQuery(thisObj).addClass('label');\n return true;\n}", "title": "" }, { "docid": "553f8a5fed2476a88a5107ce43cdfd8e", "score": "0.57306236", "text": "function addTwitterBSClass(thisObj) {\n var title = $(thisObj).attr('title');\n if (title) {\n var titles = title.split(' ');\n if (titles[0]) {\n var num = parseInt(titles[0]);\n if (num > 0)\n \t$(thisObj).addClass('label');\n if (num == 2)\n $(thisObj).addClass('label label-info');\n if (num > 2 && num < 4)\n $(thisObj).addClass('label label-success');\n if (num >= 5 && num < 10)\n $(thisObj).addClass('label label-warning');\n if (num >=10)\n $(thisObj).addClass('label label-important');\n }\n }\n else\n \t$(thisObj).addClass('label');\n return true;\n}", "title": "" }, { "docid": "0943cb163489429aae75d0f8489048c6", "score": "0.56063336", "text": "function highlightTag() {\n var type = $(this).data('type')\n $('.tag').css('background-color', '#FFF')\n $('.' + type).css('background-color', \"#F00\") \n }", "title": "" }, { "docid": "b1c674186e243887c92eb7d2e8c51166", "score": "0.5511772", "text": "function Tc(a,b){var c=a.getAttribute(\"class\")||\"\";-1==(\" \"+c+\" \").indexOf(\" \"+b+\" \")&&(c&&(c+=\" \"),a.setAttribute(\"class\",c+b))}", "title": "" }, { "docid": "99343c774df0369645ec95b2c1988f62", "score": "0.5504963", "text": "function highlight_theme(...args){\n\targs.forEach(function(item,index) {\n\t\t//dummy class needed in order for clear_map to work\n\t\titem.classList.add(\"filler\");\n\t\tif (index%4===0) {\n\t\t\titem.classList.add(\"filled1\");\n\t\t}\n\t\telse if (index%4===1) {\n\t\t\titem.classList.add(\"filled2\");\n\t\t}\n\t\telse if (index%4===2) {\n\t\t\titem.classList.add(\"filled3\");\n\t\t}\n\t\telse {\n\t\t\titem.classList.add(\"filled4\");\n\t\t}\n\n\t})\n\t\n}", "title": "" }, { "docid": "817df3de0369ae28095dfb5f8d52849e", "score": "0.544533", "text": "function bulbOn(){\n for(let i = 0; i < counter2 ; i++){\n bulbs[i].classList.add(\"bulbOn\");\n }\n}", "title": "" }, { "docid": "1402134a9a0999abd153bef49df4dd3f", "score": "0.54101807", "text": "function _tag_classname_change() {\n app.specimen[app.selectedTagIndex].class = app.specimen[app.selectedTagIndex].class.replace(/ /g, '-');\n\n var blockSelector = app.currentselector;\n var newBlockSelector = app.specimen[app.selectedTagIndex].class;\n\n for (var bp in app.breakpoints) {\n var thisBp = app.breakpoints[bp];\n\n /**\n * Element was assigned an existing class\n */\n if (thisBp.styles[newBlockSelector]) {\n /**\n * Remove previous class if not used elsewhere\n */\n\n if( _isUnusedClass(blockSelector) ) {\n delete thisBp.styles[blockSelector];\n }\n }\n\n /**\n * Element was assigned a new class\n * Clonse previous styles into the new class\n * then, remove the previous class\n */\n else if (thisBp.styles[blockSelector]) {\n thisBp.styles[newBlockSelector] = Object.assign({}, thisBp.styles[blockSelector]);\n\n if( _isUnusedClass(blockSelector) ) {\n delete thisBp.styles[blockSelector];\n }\n }\n }\n\n app.$forceUpdate();\n _tag_select(app.selectedTagIndex);\n}", "title": "" }, { "docid": "25341728404920a9a0e42ae46c50d286", "score": "0.5386236", "text": "function obecnyKolor() {\n \n if( $(theSpan).hasClass('red') ) { return 'red'; }\n if( $(theSpan).hasClass('ora') ) { return 'ora'; }\n return 'gre';\n}", "title": "" }, { "docid": "01d562b0cc68d97888fcd2b7c6859e61", "score": "0.53848124", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n classes += this.props.counter.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "01d562b0cc68d97888fcd2b7c6859e61", "score": "0.53848124", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n classes += this.props.counter.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "1fb66724bf91e59046a7bc43ca0a139a", "score": "0.53824806", "text": "function addCssClasses(){\n $('.blur-container').addClass(\"blur-filter\");\n $('.shelter-contact').addClass('shelter-legibility');\n}", "title": "" }, { "docid": "83232f35ac01db059d5073d3ace51442", "score": "0.5370711", "text": "function ustawNowyKolor( nowy ) {\n console.log(nowy);\n $( theSpan ).removeClass( \"red ora gre\" );\n $( theSpan ).addClass( nowy );\n}", "title": "" }, { "docid": "2c7b8a041bfe9da3a64f3cfdf95d0711", "score": "0.5360207", "text": "function highlightTag(tag) {\n \n tag.classList.add('highlight');\n\n}", "title": "" }, { "docid": "0a34ba2c48d74d59e92eccc2437f1e05", "score": "0.53538126", "text": "function UVindexing(event){\n if (event < 3){\n $(\".cityUV\").addClass(\"btn btn-success cityUVstyle\");\n } else if (event < 6){\n $(\".cityUV\").addClass(\"btn btn-warning cityUVstyle\");\n } else if (event < 8){\n $(\".cityUV\").addClass(\"btn btn-warning orange cityUVstyle\");\n } else if (event < 11){\n $(\".cityUV\").addClass(\"btn btn-danger cityUVstyle\");\n } else if (event > 11){\n $(\".cityUV\").addClass(\"btn btn-danger purple cityUVstyle\");\n }}", "title": "" }, { "docid": "9100b758653c3e29eb2fe7f3f56973fc", "score": "0.53427", "text": "colorBadgeClasses() {\n let color_badge = \"badge m-2 badge-\"; \n color_badge += this.state.count === 0 ? \"warning\" : \"primary\";\n return color_badge;\n }", "title": "" }, { "docid": "0d70a23b53f1715bd74616f20e025891", "score": "0.53295904", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n classes += (this.state.count === 0 ? \"warning\" : \"primary\");\n return classes;\n }", "title": "" }, { "docid": "eb134f5681c699938a67d8b8a60588cf", "score": "0.53226066", "text": "function el(tag){\n var elmt = $(document.createElement(tag));\n for (var i=1; i < arguments.length; i++){\n\telmt.addClass(arguments[i]);\n }\n return elmt;\n}", "title": "" }, { "docid": "d49ea276308baebfd27a85f4fbc5f8ab", "score": "0.53172195", "text": "function colors() {\n for (i = 0; i < timeArray.length; i++) {\n if (hour < timeArray[i]) {\n document.querySelector(\".description\").setAttribute(\"class\", \"future\");\n\n\n } else if (hour > timeArray[i]) {\n document.querySelector(\".description\").setAttribute(\"class\", \"past\");\n\n\n } else if (hour === timeArray[i]) {\n document.querySelector(\".description\").setAttribute(\"class\", \"present\");\n\n\n };\n };\n }", "title": "" }, { "docid": "a1150c9e61194c4eef1a4f9f2f233e8b", "score": "0.5315456", "text": "function highlightTag(tag) {\n tag.classList.add('highlight')\n}", "title": "" }, { "docid": "47933305c3f539ec4d7360cb79cc1c18", "score": "0.5310164", "text": "function tagArrangeType(label)\r{\r\tvar tags = label.find(\".tag\");\r\t\r\t$.each(tags, function(i, e){\r\t\t\r\t\tif( (i == 0) && $(e).hasClass(\"tag-blue\") )\r\t\t{\r\t\t\t$(e).removeClass(\"tag-blue\");\r\t\t\t$(e).addClass(\"tag-orange\");\r\t\t}\r\t\t\r\t\tif( (i != 0) && $(e).hasClass(\"tag-orange\") )\r\t\t{\r\t\t\t$(e).removeClass(\"tag-orange\");\r\t\t\t$(e).addClass(\"tag-blue\");\r\t\t}\r\t\t\r\t});\r}", "title": "" }, { "docid": "63aa2e3ed6495f80ab28296524e34033", "score": "0.53066355", "text": "setTags(tagArr) {\n if (tagArr == null) return false;\n tagArr.forEach((name) => {\n // get the color of this tag\n const colorClass =\n /* ';\n if (name === 'Lecture') colorClass = 'lecture';\n else if (name === 'UCSD') colorClass = 'ucsd';\n else if (name === 'Other') colorClass = 'other';\n else colorClass = */ getCustomTagColor(name);\n\n // create the tag\n // <small class='tag-label UCSD-label'>Lecture</small>\n const ele = document.createElement('small');\n ele.setAttribute('class', `tag-label ${colorClass}-tag`);\n ele.innerText = name;\n\n // add tag to shadow root\n this.shadowRoot\n .querySelector('.tags-container .tags')\n .appendChild(ele);\n });\n return true;\n }", "title": "" }, { "docid": "00434ed8ebeaf3b8f2c7c424389d03a9", "score": "0.5246991", "text": "function addGrayscale(element){\n element.attr(\"class\",\"logo col-1 inactive\");\n}", "title": "" }, { "docid": "ceea628ff5a82205c535705af6ffbb3d", "score": "0.52367675", "text": "function setColors() {\n\tfor (i = 0; i < hourArray.length; i++) {\n\t\tconsole.log(hourArray[i].data(\"val\"));\n\t\tif (hour < hourArray[i].data(\"val\")) {\n\t\t\thourArray[i].attr(\"class\", \"future\");\n\t\t} else if (hour > hourArray[i].data(\"val\")) {\n\t\t\thourArray[i].attr(\"class\", \"past\");\n\t\t} else {\n\t\t\thourArray[i].attr(\"class\", \"present\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2323c0fcdeb60cb9053be427da4e2aa9", "score": "0.5220729", "text": "function changeColor() {\n for (let i = 6; i < 18; i++) {\n\n let hour = '#' + i;\n let currentTime = moment().hours();\n let timeSlot = parseInt($(hour).attr(\"id\"));\n $(hour).removeClass();\n if (\n timeSlot > currentTime) {\n $(hour).attr(\"class\", \"row future\");\n }\n else if (\n timeSlot === currentTime) {\n $(hour).attr(\"class\", \"row present\");\n }\n else if (\n timeSlot < currentTime) {\n $(hour).attr(\"class\", \"row past\");\n }\n\n };\n }", "title": "" }, { "docid": "a9e5317354138b7416865e376a5f179a", "score": "0.52193916", "text": "getBadgeClasses() {\r\n let classes = \"badge m-2 badge-\";\r\n classes += this.state.count === 0 ? \"warning\" : \"primary\";\r\n return classes;\r\n }", "title": "" }, { "docid": "a9e5317354138b7416865e376a5f179a", "score": "0.52193916", "text": "getBadgeClasses() {\r\n let classes = \"badge m-2 badge-\";\r\n classes += this.state.count === 0 ? \"warning\" : \"primary\";\r\n return classes;\r\n }", "title": "" }, { "docid": "aaad2095b0b645ac7a1953d5a8b8b366", "score": "0.5207516", "text": "setCustomClass() {\n if (this.options[\"customClass\"]) {\n this.options[\"customClass\"].split(\" \").forEach((className) => {\n this.renderer.addClass(this.elementRef.nativeElement, className);\n });\n }\n }", "title": "" }, { "docid": "72cd18849dae3aa31c5cf9fc8dd79012", "score": "0.52051395", "text": "function matchNames(){\n $( \".color-title\" ).each(function(index){\n index=index+1;\n $(this).attr('name','color'+index);\n });\n }", "title": "" }, { "docid": "4a09a5aef366506e01df194cc8ed3c8e", "score": "0.5205021", "text": "appliedCssClasss() {\n return this.codePrismLanguage() + this.lineNumberCssClass();\n }", "title": "" }, { "docid": "c01f0b832f6cf6a354e23ebfa36e50ab", "score": "0.51924753", "text": "function Gc(a,b){var c=a.getAttribute(\"class\")||\"\";-1==(\" \"+c+\" \").indexOf(\" \"+b+\" \")&&(c&&(c+=\" \"),a.setAttribute(\"class\",c+b))}", "title": "" }, { "docid": "8cad4504b6533cd7db0e914a16ff1199", "score": "0.51906246", "text": "function timeColor() {\n for(i=0; i < pastHours.length; i++) {\n $(`#${pastHours[i]}`).addClass('past')\n }\n \n $(`#${currentHour}`).addClass('present')\n \n for(i=0; i < futureHours.length; i++) {\n $(`#${futureHours[i]}`).addClass('future')\n } \n}", "title": "" }, { "docid": "027e22f29b1d00be598b33fb03d90133", "score": "0.51896673", "text": "_addStyleNames(width, breakpoints) {\n if (width < breakpoints.smallSize) {\n this.classList.add(CLASSES.SMALL);\n this.classList.remove(CLASSES.MEDIUM);\n this.classList.remove(CLASSES.LARGE);\n } else if (width < breakpoints.mediumSize) {\n this.classList.remove(CLASSES.SMALL);\n this.classList.add(CLASSES.MEDIUM);\n this.classList.remove(CLASSES.LARGE);\n } else {\n this.classList.remove(CLASSES.SMALL);\n this.classList.remove(CLASSES.MEDIUM);\n this.classList.add(CLASSES.LARGE);\n }\n }", "title": "" }, { "docid": "f32b0e0da143b069646b9af18a55f48f", "score": "0.51854527", "text": "function colorCirclesUp() {\n\tstages[count].classList.add(\"active\");\n}", "title": "" }, { "docid": "0acb71f2380534a54285f66ad832b8e7", "score": "0.5171702", "text": "function dtaglinechange (tagidnub,taglength) {\n\t \n\t if (typeof(taglength) == \"undefined\") {\n\t \t\n \t document.getElementById(\"tag\" + tagidnub).className = \"text_sel\"; \n \t document.getElementById(\"icon\" + tagidnub).className = \"arrowwh sw_f\";\n \t } else {\n \t \tfor(t=0; t<taglength; t++) {\n \t \t document.getElementById(\"tag\" + t).className = \"text_unsel\"; \t\n \t \t //console.log(\"2= \" + document.getElementById(\"icon2\").className + \" \" + \"0= \" + document.getElementById(\"icon0\").className);\n \t \t }\t \t \n \t \t document.getElementById(\"tag\" + tagidnub).className = \"text_sel\"; \n \t }\n\t\n \n}", "title": "" }, { "docid": "9c44a063b48a9f77decb850a0eb8861a", "score": "0.5165867", "text": "function colorChange() {\n var currentTime = new Date().getHours();\n for (var i = 9; i < 18; i++) {\n if ($(`#${i}`).data(\"time\") == currentTime) {\n $(`#text${i}`).addClass(\"present\");\n } else if (currentTime < $(`#${i}`).data(\"time\")) {\n $(`#text${i}`).addClass(\"future\");\n\n }\n }\n }", "title": "" }, { "docid": "e6a0d34be81cf56ae434cb90ff6b5b60", "score": "0.514327", "text": "function jqAddClass() {\n $('#runID p').addClass(\"newClass\");\n $('.newClass').css({ 'color': '#005eff' });\n}", "title": "" }, { "docid": "0064e5303bd2050522d9c942876cb030", "score": "0.511776", "text": "function add_class(a, b) {\n \t\t$(a).addClass(b);\n \t}", "title": "" }, { "docid": "abf6a75f7fae598ca051784981aedcf1", "score": "0.5107447", "text": "function add_class(elem, c)\n{\n var k = elem.getAttribute(\"class\") || \"\";\n if (!has_class(elem, c)) {\n elem.setAttribute(\"class\", \"{0}{1}{2}\".fmt(k, k ? \" \" : \"\", c));\n }\n}", "title": "" }, { "docid": "c32979105b747d2b4e7b12eddc1c28ca", "score": "0.51010644", "text": "function addClassOceanRed(el){\r\n\tdocument.getElementById('1Col').classList.add(\"oceanred\");\r\n\r\n}", "title": "" }, { "docid": "640e7de4580dd055b1bcdfdf48612ed9", "score": "0.5096031", "text": "function fontColor() {\n\tguineaPig.classList.add(\"addBlue\");\n}", "title": "" }, { "docid": "caa98eb58d83cae21a9aab5e7d4ad0a1", "score": "0.50815815", "text": "function setTextBoxColor() {\n let count;\n let i;\n let countText;\n let time = new Date().getHours();\n for (i = 9; i <= 12; i++) {\n if (i === 12) {\n count = i.toString() + \"pm\";\n } else {\n count = i.toString() + \"am\";\n }\n countText = count + \"Text\";\n\n if (i < time) {\n $(\"#\" + countText).addClass(\"past\");\n } else if (i === time) {\n $(\"#\" + countText).addClass(\"present\");\n } else {\n $(\"#\" + countText).addClass(\"future\");\n }\n }\n\n for (i = 1; i <= 5; i++) {\n count = i.toString() + \"pm\";\n countText = count + \"Text\";\n\n if (time > 12) {\n time = time - 12;\n }\n if (i < time) {\n $(\"#\" + countText).addClass(\"past\");\n } else if (i === time) {\n $(\"#\" + countText).addClass(\"present\");\n } else {\n $(\"#\" + countText).addClass(\"future\");\n }\n }\n}", "title": "" }, { "docid": "6ca510cd3f49bdab5df273c88a5184bd", "score": "0.5077057", "text": "function addEnhanceClass(){\n\t\tdocElem.className += \" \" + docClasses.join(\" \");\n\t}", "title": "" }, { "docid": "8d6f2639908be71a3cbbc74a6825586a", "score": "0.5073119", "text": "class(elt, val) {\n if (elt.className.indexOf(val) !== -1) {\n elt.className = `${elt.className}' '${val}` ;\n }\n }", "title": "" }, { "docid": "0168dd879dfefd88a5b61648b28225ed", "score": "0.507021", "text": "function adding(el) {\n\n // Started classname\n\t\t\tlet started = el.className,\n\t\t\t\tspaced = started + \" \",\n\t\t\t\tfinal = spaced + className,\n\t\t\t\treplaced = started.replace(' ', ','),\n\t\t\t\tsplited = replaced.split(','),\n\t\t\t\thasClass = false\n\n\t\t\tfor(let i = 0 ; i < splited.length ; i++) {\n\t\t\t\tif(className == splited[i]) {\n\t\t\t\t\thasClass = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(hasClass) {\n\t\t\t\tel.className = started\n\t\t\t}\n\t\t\telse {\n\t\t\t\tel.className = final\n\t\t\t}\n\n\n\t\t}", "title": "" }, { "docid": "4a3e86cb36d0ac8f1566eea339f807ef", "score": "0.50689906", "text": "static get tag() {\n return \"simple-colors-demo-variables\";\n }", "title": "" }, { "docid": "6aad1dd7bd76651acc120dbe1f4622a9", "score": "0.5065099", "text": "function buttonsRed() {\n for (let i = 0; i < all_buttons.length; i++) {\n all_buttons[i].classList.remove(all_buttons[i].classList[1]);\n all_buttons[i].classList.add('btn-danger');\n }\n}", "title": "" }, { "docid": "cd6ae9276394f01081ef1458fe954272", "score": "0.5064726", "text": "function addClass(el){\r\n\tel.classList.add(\"green\");\r\n\r\n}", "title": "" }, { "docid": "47a3f44cceacaa7af2362bfe04ffd868", "score": "0.5061698", "text": "static get tag() {\n return \"learn-two-theme\";\n }", "title": "" }, { "docid": "ff757aac59a5daa8db118e743f6a1e43", "score": "0.5061544", "text": "function calculateTagClass(count, params) {\n const normalizedMax = params.max - params.min;\n const normalizedCount = count - params.min;\n const percentage = normalizedCount / normalizedMax;\n\n // console.log(count, percentage, normalizedCount);\n\n const optCloudClassCount = Math.floor(percentage * 4 + 1);\n const className = optCloudClassPrefix + optCloudClassCount;\n return className;\n}", "title": "" }, { "docid": "1354327b36cf3add44ddce31488762ba", "score": "0.50553185", "text": "function buttonsGreen() {\n for (let i = 0; i < allButtons.length; ++i) {\n allButtons[i].classList.remove(allButtons[i].classList[1]);\n allButtons[i].classList.add(\"btn-success\");\n }\n}", "title": "" }, { "docid": "726c722e1bd20327603c81386022299f", "score": "0.50529313", "text": "setComponentClasses() {\n this._codeblockRender.setAttribute(\"class\", this.codePrismLanguage());\n this._codeblockRenderOuterPreTag.setAttribute(\"class\", this.appliedCssClasss());\n if (this.codeLineNumberStart !== 1) {\n this._codeblockRenderOuterPreTag.style.counterReset = \"linenumber \" + (this.codeLineNumberStart - 1);\n }\n }", "title": "" }, { "docid": "6f8a963095b04116f314a394c5d59bab", "score": "0.504993", "text": "function fairyClass() {\n\tcurrent_step++;\n\tif (current_step%5==0)\n\t{\n\t\tnum_class++;\n\t\tif (num_class>=7) \n\t\t{\n\t\t\tnum_class=4;\n\t\t}\n\t\tfairy.className='';\n\t\tfairy.classList.add('face_'+num_class);\n\t}\n}", "title": "" }, { "docid": "712d1154f603fdf83fa5c3f5fcd2474b", "score": "0.50410783", "text": "function buttonsGreen() {\n for (let i = 0; i < all_buttons.length; i++) {\n all_buttons[i].classList.remove(all_buttons[i].classList[1]);\n all_buttons[i].classList.add('btn-success');\n }\n}", "title": "" }, { "docid": "c0a3a07d6eac1be607f7db5c1d3af95e", "score": "0.50390595", "text": "addClass(className) {\n this.each((e) => {\n e.addClass(className);\n });\n }", "title": "" }, { "docid": "b59777ed61888576357100d4ccd49b86", "score": "0.50337714", "text": "function buttonsRed() {\n for (let i = 0; i < allButtons.length; ++i) {\n allButtons[i].classList.remove(allButtons[i].classList[1]);\n allButtons[i].classList.add(\"btn-danger\");\n }\n}", "title": "" }, { "docid": "a8df65d5de512411754eb2ec76abda57", "score": "0.5016598", "text": "function greenGood(){\n if(a1.innerText === triviaQ[count].c){\n a1.className = \"btn btn-success btn-lg btn-block\";\n }\n else if(a2.innerText === triviaQ[count].c){\n a2.className = \"btn btn-success btn-lg btn-block\";\n }\n else if(a3.innerText === triviaQ[count].c){\n a3.className = \"btn btn-success btn-lg btn-block\";\n }\n else if(a4.innerText === triviaQ[count].c){\n a4.className = \"btn btn-success btn-lg btn-block\";\n }\n\n }", "title": "" }, { "docid": "c568ff6b70fd01d9b1f7445efcd091b7", "score": "0.5012682", "text": "function addCombinedCountElement() {\n $('.path-local-barcode #id_barcode').after(function() {\n return '<span class=\"local-barcode-combined-counts local-barcode-inform-inline\">(' +\n '<span id=\"local_barcode_id_scanned_count\">0</span> / ' +\n '<span id=\"local_barcode_id_submitted_count\">0</span>)' +\n '</span>';\n });\n }", "title": "" }, { "docid": "5612ad55f355b2d5ce049139b996aa8c", "score": "0.50073814", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n if (this.state.val === 0 || this.state.val < 0) {\n classes += \"default\";\n } else {\n classes += \"primary\";\n }\n return classes;\n }", "title": "" }, { "docid": "401b12890daeed905dc008e6c22e021d", "score": "0.4995255", "text": "function initShortenBadgeCounts() {\n\n function findAndShortenBadgeCounts() {\n $('.badgecount').not('[data-shortbadgecounts]').attr('data-shortbadgecounts', '').text((i, v) => v.length <= 3 ? v : v.replace(/\\d{3}$/, 'k'));\n }\n\n findAndShortenBadgeCounts();\n $(document).ajaxStop(findAndShortenBadgeCounts); // on page update\n}", "title": "" }, { "docid": "42b5400e5cf1d3cf55c03889d4ae797c", "score": "0.49937117", "text": "function colorCoded () {\n $(\".form-control\").each(function () {\n var timeDay = parseInt($(this).attr(\"id\"));\n hour = parseInt(hour);\n // console.log(timeDay);\n // console.log(hour);\n\n //use if to be able to use \"this\" to add class\n if (hour > timeDay) {\n $(this).addClass(\"past\");\n } else if (hour < timeDay) {\n $(this).addClass(\"future\");\n } else {\n $(this).addClass(\"present\");\n }\n });\n}", "title": "" }, { "docid": "08929c482a5c50999f8b715b422bd7a3", "score": "0.49931332", "text": "function setColor() {\n var times = $(\".time-block\").toArray();\n\n for (var i = 0; i < times.length; i++) {\n if (checkColor(times[i].textContent) === \"past\") {\n $(times[i]).addClass(\"past\");\n }\n else if (checkColor(times[i].textContent) === \"future\") {\n $(times[i]).addClass(\"future\");\n }\n else {\n $(times[i]).addClass(\"present\");\n }\n }\n}", "title": "" }, { "docid": "94ac12d64b2803a726fa742d8322b273", "score": "0.49918556", "text": "function colorMobile() {\r\n\t$(\"td\").each(function() {\r\n\t\tif ($(this).children(\".mobile-event\").length > 0) {\r\n\t\t\t$(this).children(\".miami-label\").addClass(\"white\");\r\n\t\t}\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "7a76752b5bca57ff61a12691455de5c7", "score": "0.49902594", "text": "function reset_higlight() {\n var parent = document.getElementsByClassName(\"passage-sample\")[0]\n var span1a = parent.getElementsByClassName(\"span1a_high\")\n var span1b = parent.getElementsByClassName(\"span1b_high\")\n var span2a = parent.getElementsByClassName(\"span2a_high\")\n var span2b = parent.getElementsByClassName(\"span2b_high\")\n var span3a = parent.getElementsByClassName(\"span3a_high\")\n var span34b = parent.getElementsByClassName(\"span34b_high\")\n var span3c = parent.getElementsByClassName(\"span3c_high\")\n var span4a = parent.getElementsByClassName(\"span4a_high\")\n var span6a = parent.getElementsByClassName(\"span6a_high\")\n var span6b = parent.getElementsByClassName(\"span6b_high\")\n\n if (span1a != 'null') {\n reset_class(span1a, \"span1a\")\n }\n if (span1b != 'null') {\n reset_class(span1b, \"span1a\")\n }\n if (span2a != 'null') {\n reset_class(span2a, \"span2a\")\n }\n if (span2b != 'null') {\n reset_class(span2b, \"span2b\")\n }\n if (span3a != 'null') {\n reset_class(span3a, \"span3a\")\n }\n if (span34b != 'null') {\n reset_class(span34b, \"span34b\")\n }\n if (span3c != 'null') {\n reset_class(span3c, \"span3c\")\n }\n if (span4a != 'null') {\n reset_class(span4a, \"span4a\")\n }\n if (span6a != 'null') {\n reset_class(span6a, \"span6a\")\n }\n if (span6b != 'null') {\n reset_class(span6b, \"span6b\")\n }\n}", "title": "" }, { "docid": "f14c69c4f95ce23e4b210bdc7875c425", "score": "0.49731988", "text": "function Ib(a,b){var c=a.getAttribute(\"class\")||\"\";-1==(\" \"+c+\" \").indexOf(\" \"+b+\" \")&&(c&&(c+=\" \"),a.setAttribute(\"class\",c+b))}", "title": "" }, { "docid": "771152b52e5541d54d2a104d6e8504fb", "score": "0.4968852", "text": "function hiOn(i) {\n // Set i to get index attribute\n var currentSpan = document.querySelector(\"span[data-index='\"+i+\"']\").getAttribute(\"data-index\");\n // Count i-1 for previous index remove\n var prevRemove = currentSpan-1;\n // Remove highlight class on previous span\n document.querySelector(\"span[data-index='\"+prevRemove+\"']\").classList.remove(\"highlight\");\n // Add highlight class on current span\n document.querySelector(\"span[data-index='\"+currentSpan+\"']\").classList.add(\"highlight\");\n }", "title": "" }, { "docid": "7175641f31b740a5716d3c61223db674", "score": "0.49643144", "text": "function highlight_tags(){\n var bool = false;\n if(!current_buffer){\n bool=true;\n Parse_Reply_Backend(recieved_reply);\n }\n $(\"#tagPrimaryPicker label,#tagSecondaryPicker label\").css(\"font-size\",\"20px\");\n $(\"#tagPrimaryPicker label,#tagSecondaryPicker label\").css(\"text-shadow\",\"0 0 0.0em \"+color_picker[color_picked][2]);\n $(\"#tagPrimaryPicker label,#tagSecondaryPicker label\").css(\"opacity\",\"1\");\n if(IS_PRIMARY_TAG_CHOSEN||IS_SECONDARY_TAG_CHOSEN)\n return;\n if(currentYear){\n if(currentMonth){\n for(var i=0;i<current_buffer.length;i++){\n if(currentMonth==current_buffer[i][\"month\"]&&currentYear==current_buffer[i][\"year\"]&&current_display_block.getAttribute(\"data-meta\")==current_buffer[i][\"day\"]){\n for(var z=0;z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length||z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length;z++){\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]);}\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]);}\n }\n }\n else{\n if(currentMonth==current_buffer[i][\"month\"]&&currentYear==current_buffer[i][\"year\"]&&currentDay==current_buffer[i][\"day\"]){\n $(\"#tagPrimaryPicker label\").css(\"opacity\",\"0.5\");\n $(\"#tagSecondaryPicker label\").css(\"opacity\",\"0.5\");\n for(var z=0;z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length||z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length;z++){\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length){\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]); \n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).css(\"opacity\",\"1\"); \n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).style.fontSize=\"25px\";\n }\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]); \n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).css(\"opacity\",\"1\"); \n }\n }\n }\n }\n }\n }\n else{\n for(var i=0;i<current_buffer.length;i++){\n if(currentYear==current_buffer[i][\"year\"]&&current_display_block.getAttribute(\"data-meta\")==current_buffer[i][\"month\"]){\n for(var z=0;z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length||z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length;z++){\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]);}\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]);}\n }\n }\n }\n }\n }\n else{\n for(var i=0;i<current_buffer.length;i++){\n if(current_display_block.getAttribute(\"data-meta\")==current_buffer[i][\"year\"]){\n for(var z=0;z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length||z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length;z++){\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"primary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]);}\n if(z<recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"].length){\n document.getElementById(\"tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).style.fontSize=\"25px\";\n $(\"#tag\"+recieved_reply[current_buffer[i][\"id\"]][\"secondary_hashtag\"][z]).css(\"text-shadow\",\"0 0 0.4em \"+color_picker[color_picked][2]);}\n }\n }\n }\n }\n if(bool)\n current_buffer=null;\n \n }", "title": "" }, { "docid": "18bcec9ae3a6671ac0a6288f474adb6b", "score": "0.4963244", "text": "function calculateTagClass (count, params) { // calculateTagClass(allTags[tag], tagsParams)\n console.log('23-8) start calculateTagClass func! *** ');\n console.log('23-9) calculateTagClass - count: ', count, 'params: ', params);\n\n /* [NEW 7.3] calculate size form 1 -5 */\n console.log('23-10) calculateTagClass: *** tag-size-' + Math.round((count / params.max) * opts.cloudClassCount) + ', ', Math.round((count / params.max) * opts.cloudClassCount));\n return Math.round((count / params.max) * opts.cloudClassCount);\n\n }", "title": "" }, { "docid": "cb736df87318cc580ed3b834c0ab0ee2", "score": "0.4962039", "text": "function setTagSize(tag, newsize) {\n\tvar classname = tag.parentNode.className;\n\tvar newlevelclass = \"level\" + newsize;\n\tif (classname.match(/level\\d+/)) {\n\t\ttag.parentNode.className = classname.replace(/level\\d+/, newlevelclass);\n\t}\n\telse { \n\t\ttag.parentNode.className = classname + \" \" + newlevelclass;\n\t}\n}", "title": "" }, { "docid": "db535b1dc72c4735ccd100fd9a549c39", "score": "0.49601883", "text": "beforeEnter() {\n bodyTag.classList.add('product')\n }", "title": "" }, { "docid": "7f51a927895849bf1434c81a88895108", "score": "0.4957515", "text": "function timeColor(){\n for(i=9;i<18;i++){\n var hour = \"hour-\"\n var hourId = hour.concat(i)\n // var numberId = parseInt(hourId.slice(5,7)) \n var myId = $(\"#\" + hourId)\n \n if( i < timeNow ){\n myId.children(\".description\").addClass(\"past\")\n }\n else if (i == timeNow){\n myId.children(\".description\").addClass(\"present\")\n }\n else {\n myId.children(\".description\").addClass(\"future\")\n }\n }\n}", "title": "" }, { "docid": "d44dceb5c61487d6b2dbdf1f3f61ea23", "score": "0.4955703", "text": "function c15v1_addCSS(){\n $('#c15v1').addClass(\"border-left border-right border-bottom1 padding-bottom26\");\n}", "title": "" }, { "docid": "e46df4edf8b21408a3a1b302c32de4a8", "score": "0.4954675", "text": "function s06v3_addCSS(){\n $('#s06v3').addClass(\"s06v3-highlights border-bottom\") ; \n}", "title": "" }, { "docid": "252c5aaa7b2ed9839838d2497e1d0790", "score": "0.49530834", "text": "function colorDisplay() {\n for (i = 9; i < 18; i++) {\n if (i < currentHour) {\n $(\".hour-\" + i).addClass(\"past\");\n }\n else if (i === currentHour) {\n $(\".hour-\" + i).addClass(\"present\");\n }\n else if (i > currentHour) {\n $(\".hour-\" + i).addClass(\"future\");\n }\n }\n}", "title": "" }, { "docid": "7a29f4a05387275b42dc066c2cfc2499", "score": "0.49529412", "text": "function detailHandler(){\n\t\tres.setAttribute(\"class\",\"\")\n\t\tconsole.log(\"DetailHandlerBeingCalled\");\n\t\tif (detailCode==\"color odd col\"){\n\t\t\t\tconsole.log(\"odd colors !\");\n\t\t\t\tres.setAttribute(\"class\",\"alt_color\");\n\t\t}\n\t}", "title": "" }, { "docid": "a4e582b2081012a0fff09a3ac52f806b", "score": "0.49489903", "text": "function setClasses() {\n cards[no_of_cards - 1].classList.add(\"prev\");\n cards[0].classList.add(\"current\");\n cards[1].classList.add(\"next\")\n }", "title": "" }, { "docid": "83c1097c20271cfbe288d1a9bbe1c48f", "score": "0.49405438", "text": "function s06v1_addClass(){\n $('#s06v1').addClass(\"border-bottom padding-bottom26\");\n}", "title": "" }, { "docid": "3da49e16b3df850f15d7afb1412c0e70", "score": "0.4940118", "text": "function handleBullts() {\n let bulletsSpans = document.querySelectorAll('.bullets .spans span');\n let bulletsArray = Array.from(bulletsSpans);\n bulletsArray.forEach((span, index) => {\n if(countIndex === index) {\n span.classList.add('on');\n }\n });\n}", "title": "" }, { "docid": "24c032154e30da023b12a23b6fd0da63", "score": "0.4939466", "text": "function randomize_colors(){\n var rand = cycle[Math.floor(Math.random()*cycle.length)];\n s1.className = rand;\n rand = cycle[Math.floor(Math.random()*cycle.length)];\n s2.className = rand;\n rand = cycle[Math.floor(Math.random()*cycle.length)];\n s3.className = rand;\n rand = cycle[Math.floor(Math.random()*cycle.length)];\n s4.className = rand;\n}", "title": "" }, { "docid": "fcd5f0ce54b45e697bdafdd3c3205fc5", "score": "0.49326116", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n classes += this.state.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "38bc09e627499cda175b9ee50645dd09", "score": "0.492681", "text": "function initAddClasses() {\n\tlib.each(lib.queryElementsBySelector('div.div-class'), function(index, item) {\n\t\tnew AddClass({\n\t\t\titem: item,\n\t\t\tclassAdd: 'div-add-class'\n\t\t});\n\t});\n\tlib.each(lib.queryElementsBySelector('a.a-class'), function(index, item) {\n\t\tnew AddClass({\n\t\t\titem: item,\n\t\t\taddToParent: true,\n\t\t\tclassAdd: 'div-parent-add-class'\n\t\t});\n\t});\n}", "title": "" }, { "docid": "edbde6581c918a9c1a3f540708331a4d", "score": "0.49176428", "text": "function s01v1_addCSS(){\n $('#s01v1').addClass(\"s01v1-related clearfix border-bottom\") ; \n}", "title": "" }, { "docid": "f359f783e0125454cf25c023798ed21e", "score": "0.49175632", "text": "function generateCssClass() {\n var classNames = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n classNames[_i] = arguments[_i];\n }\n return classNames\n .filter(function (name) { return typeof name == \"string\"; })\n .join(\" \");\n }", "title": "" }, { "docid": "5f78045c558be90d7f3937d035d9e997", "score": "0.4916817", "text": "function highlight_q6() {\n var parent = document.getElementsByClassName(\"passage-sample\")[0];\n var q_span = parent.getElementsByClassName(\"span6a\");\n reset_class(q_span, \"span6a_high\")\n var q_span = parent.getElementsByClassName(\"span6b\");\n reset_class(q_span, \"span6b_high\")\n}", "title": "" }, { "docid": "e29c57e7ee086c1cd2ebce8c2e6b9b4c", "score": "0.49133813", "text": "function changeColor(){\n\n var color = document.getElementsByTagName('li');\n\n for(var x=0; x < songs.length; x++){\n if(count == x){\n color[x].classList.add(\"active\");\n }else{\n color[x].classList.remove(\"active\");\n }\n }\n}", "title": "" }, { "docid": "3c0a06ec7d52f762ca0abb13236002b0", "score": "0.49131295", "text": "function specRed() {\n let ree = document.getElementsByClassName('red_child')\n for (let i = 0; i < ree.length; i++) {\n ree[i].classList.add('spec')\n }\n}", "title": "" }, { "docid": "052f1dbdfea53579caef8f82edef8d4c", "score": "0.4904113", "text": "function setCssClasses() {\n window.onload = function() {\n // Set CSS classes on HTML for features\n var body = document.body;\n for(var feature in features) {\n if(features[feature]) {\n body.className = (body.className + \" \" + CSS_PREFIX + feature).trim();\n }\n }\n };\n }", "title": "" }, { "docid": "ac07fabd55f0f14ec116ee939e252852", "score": "0.49032313", "text": "function addColorClass(elementIndex) {\n var element, className, arr;\n element = tabButtonLink[elementIndex];\n name = \"linkColor\";\n arr = element.className.split(\" \");\n if (arr.indexOf(name) == -1) {\n element.className += \" \" + name;\n }\n}", "title": "" }, { "docid": "34736c5320468bb42d4634c7fca72e8e", "score": "0.48998603", "text": "buildCSSClass() {\n return 'ntk-marker fa-stack vjs-control';\n }", "title": "" }, { "docid": "8693127f3b86d3bc8e8301f3925033a6", "score": "0.48926684", "text": "function starCounter() {\n if (count >= 17 && count <= 23) {\n document.querySelector(\".stars\").children[2].children[0].className = \"fa fa-star-o\";\n }\n if (count <= 32 && count >= 24) {\n document.querySelector(\".stars\").children[1].children[0].className = \"fa fa-star-o\";\n document.querySelector(\".stars\").children[2].children[0].className = \"fa fa-star-o\";\n }\n}", "title": "" }, { "docid": "82dc9ec8fdfd3ea48f394ee0e371f3f7", "score": "0.48892948", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n classes += this.props.value === 0 ? \"warning\" : \"primary\";\n return classes;\n }", "title": "" }, { "docid": "06bc7367b0ccfbb73e845992416cba3f", "score": "0.48888126", "text": "function specBlue() {\n let bue = document.getElementsByClassName('blue_child')\n for (let i = 0; i < bue.length; i++) {\n bue[i].classList.add('spec')\n }\n}", "title": "" }, { "docid": "3774a6ef42ec409bf7c47e2987489b53", "score": "0.4885908", "text": "function owlDotsBeauty(el_class) {\n let userProfileSliderItems = document.querySelectorAll(el_class + ' .owl-dot').length;\n console.log('userProfileSliderItems', userProfileSliderItems);\n if (userProfileSliderItems > 9 && userProfileSliderItems < 16) {\n document.querySelector(el_class).classList.add('user-profile-slider_many-items1');\n }\n if (userProfileSliderItems > 15) {\n document.querySelector(el_class).classList.add('user-profile-slider_many-items2');\n }\n }", "title": "" }, { "docid": "1502cbd1a3e5303e0dabfbfc468ab1bc", "score": "0.48857158", "text": "function makeBlue (evt) {\n evt.target.classList.remove('green')\n evt.target.classList.remove('invisible')\n evt.target.classList.add('blue')\n updateCounts()\n}", "title": "" }, { "docid": "eb3e082e92bed77be7f84aee3c2de48e", "score": "0.48843232", "text": "addClass(el, className){\n el.addClass(className);\n }", "title": "" }, { "docid": "cc517e2a5c6cf7dd0081173f2fc4d012", "score": "0.48726445", "text": "function indicateSelectedTag(tag) {\n clearSelectedTags();\n tag.classList.add(\"tags-btn__selected\");\n}", "title": "" }, { "docid": "b4bbcceac94e3aeb2b8ae4edfe084df5", "score": "0.4869055", "text": "_addCSSTheme(element, configGroupIndex) {\n switch (this._config.configGroups[configGroupIndex].theme) {\n case 'dark':\n case 'white':\n case 'white-flat':\n case 'white-pill':\n element.className += ' szl-dark';\n break;\n default:\n element.className += ' szl-light';\n break;\n }\n }", "title": "" }, { "docid": "7c31b78f16297eb91ae5ab989e42be42", "score": "0.4866582", "text": "function turnOnRed() {\n red.className = \"levels-select\";\n yellow.className = \"levels\";\n green.className = \"levles\";\n}", "title": "" }, { "docid": "1a0728290b85220470d6370101c7b2b8", "score": "0.48650223", "text": "getBadgeClasses() {\n let classes = \"badge m-2 badge-\";\n if (this.props.product.value.startsWith(\"SALE\") === true) {\n classes += \"success\";\n } else if (\n this.props.product.value.startsWith(\"Price increased\") === true\n ) {\n classes += \"warning\";\n } else {\n classes += \"light\";\n }\n return classes;\n }", "title": "" } ]
8e06de82e8bacf4c5deaaf78d4c668bd
Method responsible to delete a tool
[ { "docid": "d80f6ff03a5e682453d8508f21ff8f42", "score": "0.7371454", "text": "async function deleteTool(id) {\n await api.delete(`/tools/${id}`)\n fetchData()\n }", "title": "" } ]
[ { "docid": "fa402795af2871c148ce8a3c0d5802dc", "score": "0.71555865", "text": "function DeleteTool(context, root) {\n this.context = context;\n this.root = root;\n this.pickManager = g_pickManager;\n this.selectedObject = null;\n}", "title": "" }, { "docid": "25f2e3f1e203ece8449a83aecb60ccbd", "score": "0.6823991", "text": "function deleteTool(toolId) {\n showToolDeleteLinkDiv(toolId);\n\n var newForm = document.createElement('FORM');\n newForm.id = \"delete_tool_form\";\n newForm.name = \"delete_tool_form\";\n newForm.form = \"text/plain\";\n newForm.action = \"ExternalTools?toolId=\" + toolId;\n newForm.method = \"post\";\n\n var newInput = document.createElement('input');\n newInput.name = \"externalToolsAction\";\n newInput.type = \"hidden\";\n newInput.value = \"DeleteTool\";\n newForm.appendChild(newInput);\n\n newInput = document.createElement('input');\n newInput.name = \"toolId\";\n newInput.type = \"hidden\";\n newInput.value = toolId;\n newForm.appendChild(newInput);\n\n document.getElementsByTagName('body').item(0).appendChild(newForm);\n newForm.submit();\n}", "title": "" }, { "docid": "4bd39d622fbfcbec256b0e13e2ff742b", "score": "0.64152414", "text": "destroyMapTool() {\n let mapTool = this.get('_mapTool');\n if (!Ember.isNone(mapTool) && Ember.typeOf(mapTool.destroy) === 'function') {\n mapTool.destroy();\n this.set('_mapTool', null);\n }\n }", "title": "" }, { "docid": "af046cf9eceabccb1b076d08f3749821", "score": "0.6362184", "text": "function performClearSelectedTool(e) {\n //cy.remove(e.cyTarget);\n}", "title": "" }, { "docid": "3f1ff77708c4840cb6fc3be5f85eb971", "score": "0.6048007", "text": "dropTool() {\r\n this.selectedTool = undefined;\r\n this.tool.setTexture('vIcon')\r\n }", "title": "" }, { "docid": "cce7da11771ac1f7884da59c7c69b295", "score": "0.5954362", "text": "function deleteUi(target,story){\n currentUser.deleteMyStory(story)\n target.parent().remove()\n}", "title": "" }, { "docid": "aba713c44256b6a295da40255edba91e", "score": "0.58455926", "text": "async deleteCleaningTool(req, res) {\n const { id } = req.params;\n\n try {\n let rowCount = await cleaningToolModel.deleteCleaningTool(id);\n return res.json(rowCount == 1 ? { message: \"Eliminado exitosamente\", tipo: \"exito\" } : { message: \"No registrado\", tipo: \"error\" });\n \n } catch (err) {\n return res.json({ message: \"Error al tratar de eliminar registro\", tipo: \"error\" });\n }\n }", "title": "" }, { "docid": "ab27683ea7f26d14d04c7f2f342c8931", "score": "0.57814217", "text": "function deleteProgram($event) {\n\n var dialogOptions = $mdDialog.confirm().title(\n \"Delete program?\"\n ).textContent(\n \"This will permanently delete '\" + getProgramName() + \"'.\"\n ).ariaLabel(\n \"Delete program confirmation\"\n ).targetEvent(\n $event\n ).ok(\n \"Delete program\"\n ).cancel(\n \"Cancel\"\n );\n\n $mdDialog.show(\n dialogOptions\n ).then(\n doDelete\n );\n }", "title": "" }, { "docid": "38ffd7611632997951bf3f27abe1df13", "score": "0.57698137", "text": "function _delete() {\n props.delete();\n toggleOptions();\n }", "title": "" }, { "docid": "e500876c088b4674bda38cbd7212ed61", "score": "0.5710081", "text": "setToolName(toolName) {\n if (toolName === 'erase') {\n window.operation.erase = true;\n return\n }\n window.operation = { toolName: toolName, erase: false };\n this.setTabIndexOnToolSelection(toolName);\n }", "title": "" }, { "docid": "a6c9e0f663a081c812199305fc949301", "score": "0.5682945", "text": "function deleteFile(toolId, fileId) {\n showFileDeleteImageDiv(fileId);\n\n var newForm = document.createElement('FORM');\n newForm.id = \"delete_tool_file_form\";\n newForm.name = \"delete_tool_file_form\";\n newForm.form = \"text/plain\";\n newForm.action = \"ExternalTools?toolId=\" + toolId;\n newForm.method = \"post\";\n\n var newInput = document.createElement('input');\n newInput.name = \"externalToolsAction\";\n newInput.type = \"hidden\";\n newInput.value = \"DeleteToolFile\";\n newForm.appendChild(newInput);\n\n newInput = document.createElement('input');\n newInput.name = \"toolId\";\n newInput.type = \"hidden\";\n newInput.value = toolId;\n newForm.appendChild(newInput);\n\n newInput = document.createElement('input');\n newInput.name = \"fileId\";\n newInput.type = \"hidden\";\n newInput.value = fileId;\n newForm.appendChild(newInput);\n\n document.getElementsByTagName('body').item(0).appendChild(newForm);\n newForm.submit();\n}", "title": "" }, { "docid": "4e169043dd8073f8cab6eb1e128fc519", "score": "0.56164706", "text": "system_tool(type) {\n switch (type) {\n case 'Remove':\n if (this.data.selected) {\n this.del(this.data.selected)\n this.remove_trash_icon()\n this.drawing_mode_off()\n this.on_scroll_lock(false)\n }\n break\n }\n }", "title": "" }, { "docid": "ca0cf4cf1ab8930ba499b86f1cb93adc", "score": "0.55789727", "text": "function deletetask_actions(data) {\n\n\tfor (var k=0; k<toolsArray.length; k++) {\n\t\tswitch (toolsArray[k]) {\n\t\t\tcase 'assignmentPlanner':\n\t\t\t\t// in assignmentPlanner.js\n\t\t\t\tnotifyAssignmentPlanner('deletetask'); // notify the Assignment Planner of the deleted task\n\t\t\t\ttaskadd = true;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f0e11078d30a50ba40a2d01db184d9cf", "score": "0.55086565", "text": "function eldel(x){\n\tif(confirm(\"Do you want to delete this layout ?\")){\n\t\tlayoutcanvas.removeChild(x);\n\t\tmultidivcount--;\n\t}\n\t\n}", "title": "" }, { "docid": "76872e4fb7786c7b921a302de0f09f58", "score": "0.5505753", "text": "function deleteTask() {\n\t\t$(this).parent().remove();\n}", "title": "" }, { "docid": "3057cebdd38753504ffc9eb99fa1a0ca", "score": "0.5503672", "text": "function deleteMe() {\n props.deleteReport(props.id)\n }", "title": "" }, { "docid": "810f565eb9aeb7489d3cdf0b8bb8c7bf", "score": "0.54902786", "text": "function deleteTaskOnAside(event) {\n buttonSelectedIndex = event.target.dataset.tasknum\n currentTasks.splice(buttonSelectedIndex, 1)\n displayTaskOnAside()\n}", "title": "" }, { "docid": "b5396a775ac0167d7d4ed70ebd967c94", "score": "0.54692036", "text": "function deleteButtonPressed(firm) {\n db.remove(firm);\n clear_input();\n }", "title": "" }, { "docid": "3854bc59d3da19b75b1a880c9ce1203b", "score": "0.54187995", "text": "function removeTools(){\n removeToolActive();\n $('#PANIcon').removeClass();\n $(\"#ToolsDiv\").removeClass(\"show\");\n $(\"#SizeDiv\").addClass(\"hide\");\n $('#TextDiv').addClass(\"hide\");\n }", "title": "" }, { "docid": "223bf8c720cc45f67da323a1fe0d4251", "score": "0.5411139", "text": "function del_save(){\n\tvar filepath = section;\n\t\n\tobject.AGAdvAstfileeditorEditDel(del_succeed_back, del_error_back, filepath);\n}", "title": "" }, { "docid": "5c33525616ff44530c4155c784872599", "score": "0.539004", "text": "function deletePrompt(event) {\n var trigger = event.target;\n trigger.parentNode.remove();\n }", "title": "" }, { "docid": "81bbf7f775fdeb64e1c35e412d79ca3c", "score": "0.5370644", "text": "deleteTarea({commit}, id){\n commit('eliminar', id)\n }", "title": "" }, { "docid": "f3fbbd57b2edfffe389dac5712bc79c8", "score": "0.53705716", "text": "function deleteAgent() {\r\n agent = undefined;\r\n hasAgent = false;\r\n sendAgentStatus();\r\n console.log('\\033[2J');\r\n try {\r\n Fs.unlink('./' + 'backup001.js', (err) => {\r\n if (err) {\r\n\r\n } else {\r\n if (ShowInformationMessages) console.log('[Middleware.js]successfully deleted');\r\n }\r\n });\r\n } catch(err) {\r\n //console.log('ERROR :' + err);\r\n }\r\n}", "title": "" }, { "docid": "2af33a2f262b4a13e6bbf2e51b76c89e", "score": "0.5364222", "text": "function deleteKitPart(kit, part) {\n part.popover = false;\n let data = {\n kitId: kit.id,\n partNumber: part.number\n }\n dataInteraction.deleteKitPart(data).then(() => {\n vm.receiveKitPart(kit);\n })\n }", "title": "" }, { "docid": "ab4eb70f1aea13cb877d4c45c3731a4f", "score": "0.5348186", "text": "deletItem() {\n if(this.props.tool == \"Marker\") {\n const {markersdata} = this.state\n this.markers.splice(this.props.id, 1) // delete the shapes\n markersdata.splice(this.props.id, 1) // delete the data\n this.setState({markersdata: markersdata}) // update the data array\n // hide data:\n let action = { type: \"shapeBlured\"}\n this.props.dispatch(action)\n }\n else if(this.props.tool == \"Line\") {\n const {polyLinesData, polylines} = this.state\n polylines.splice(this.props.id, 1) // delete the shapes\n polyLinesData.splice(this.props.id, 1) // delete the data\n this.setState({polyLinesData: polyLinesData, polylines: polylines}) // update the data array\n // hide data:\n let action = { type: \"shapeBlured\"}\n this.props.dispatch(action)\n }\n else if(this.props.tool == \"Polygone\") {\n const {polygonsData, polygons} = this.state\n polygons.splice(this.props.id, 1) // delete the shapes\n polygonsData.splice(this.props.id, 1) // delete the data\n this.setState({polygonsData: polygonsData, polygons: polygons}) // update the data array\n // hide data:\n let action = { type: \"shapeBlured\"}\n this.props.dispatch(action)\n }\n }", "title": "" }, { "docid": "79b40bed45755ec25f258f5d6819e678", "score": "0.53442556", "text": "function deleteHotel() {\n var deleteId = this.name;\n console.log(this.name);\n httpAction = \"DELETE\";\n\n if (token) {\n headers.Authorization = \"Bearer \" + token;\n }\n var hoteliUrl = \"http://\" + host + hoteliEndpoint;\n $.ajax({\n \"url\": hoteliUrl + \"?id=\" + deleteId,\n \"type\": httpAction,\n \"headers\": headers\n\n })\n .done(function (data, status) {\n hoteliUrl = \"http://\" + host + hoteliEndpoint;\n $.getJSON(hoteliUrl, setHoteli);\n\n })\n .fail(function (data, status) {\n\n alert(\"Error during your last action!!\")\n })\n\n }", "title": "" }, { "docid": "386f8a170b36ed83f7d367ed2eba7107", "score": "0.5316225", "text": "function editorRemoveProgram (filename) {\n\t\t// Ask the user if they are sure\n\t\tswal({\n\t\t\ttitle: \"Are you sure?\",\n\t\t\ttext: \"This file will be deleted.\",\n\t\t\ttype: \"warning\",\n\t\t\tshowCancelButton: true,\n\t\t\tconfirmButtonColor: \"#DD6B55\",\n\t\t\tconfirmButtonText: \"Yes, delete file!\",\n\t\t\tcloseOnConfirm: false\n\t\t}, () => {\n\t\t\t// Delete the file\n\t\t\tfiles.delete(filename);\n\n\t\t\t// If the deleted file was loaded, clear out editor\n\t\t\tif (filename === currentFilename) {\n\t\t\t\teditor.value = \"\";\n\t\t\t\tcurrentFilename = null;\n\t\t\t}\n\n\t\t\tswal.close();\n\n\t\t\t// Update list\n\t\t\tviews.browse.onEnter();\n\t\t});\n\t}", "title": "" }, { "docid": "8a0231e9923646802d516028bad82fa9", "score": "0.5305857", "text": "async delete() {\n if (this.helpticket && this.helpticket._id) {\n await this.helptickets.deleteHelpticket(this.helpticket._id);\n await this.helptickets.getHelpTickets(this.userObj);\n this.back();\n };\n }", "title": "" }, { "docid": "2e2c77b20caf74b7d00312551177adfb", "score": "0.53044164", "text": "delete() {\n\t\tthis.data.delete();\n\t}", "title": "" }, { "docid": "f6471914dc3058a3c33e7793e034a7de", "score": "0.52968514", "text": "delete() {\n updateSimulationSet(true);\n this.deleted = true;\n this.parent.scope.allNodes.clean(this);\n this.parent.scope.nodes.clean(this);\n\n this.parent.scope.root.nodeList.clean(this); // Hope this works! - Can cause bugs\n\n if (simulationArea.lastSelected == this) simulationArea.lastSelected = undefined;\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].connections.clean(this);\n this.connections[i].checkDeleted();\n }\n wireToBeCheckedSet(1);\n forceResetNodesSet(true);\n scheduleUpdate();\n }", "title": "" }, { "docid": "2be6a201c60303feb550b060a7ed4344", "score": "0.5294793", "text": "deleteDevice(){\n\t\tthis.deviceFactory.deleteDevice(this.row);\n\t}", "title": "" }, { "docid": "e6514430b4b21590652f2713737ef919", "score": "0.52934986", "text": "function deleteDataset(dataset) {\n\tvar confirmed = confirm(\"Warning: This will permanently remove all data in this dataset. This operation cannot be undone. Are you sure you want to delete this dataset?\");\n\tif (!confirmed) {\n\t\treturn;\n\t}\n\tdoDeleteDataset(dataset, false);\n}", "title": "" }, { "docid": "457e52199f1fe361c47879058c4583c8", "score": "0.5293058", "text": "deleteEquipo(equipo) {\n if (confirm(\"Do you really want to delete:?\"+equipo.nombre)) {\n var app = this;\n axios.delete('equipos/' + equipo.id)\n .then(function (resp) {\n\t\t\t\t\t\t\t//app.companies.splice(index, 1);\n\t\t\t\t\t\t\tthis.getEquipos();\n })\n .catch(function (resp) {\n alert(\"Could not delete equipo\");\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t}", "title": "" }, { "docid": "51c6e764387a7d5771333b4747e54632", "score": "0.52879936", "text": "function del() {\n result.innerHTML = result.innerHTML.substr(0, (result.innerHTML.length - 1));\n if (triggerOperation === false) {\n currentOperation = currentOperation.substr(0, (currentOperation.length - 1));\n }\n else {\n currentOperation = currentOperation.substr(0, (currentOperation.length - 2));\n }\n}", "title": "" }, { "docid": "2419f639f8abc8170262c5f7ae323a6c", "score": "0.5285427", "text": "remove() {\n this.controls.forEach((c) => {\n c.deactivate(true);\n });\n if (this.toolbar) {\n this.toolbar.destroy();\n }\n }", "title": "" }, { "docid": "49b89afed094e00ae1a5016eed8cd4ba", "score": "0.5278486", "text": "function removeToolBar(){\n $(\".toolsItem\").html('');\n}", "title": "" }, { "docid": "407a0c29a3666439c20f86333fb95cfa", "score": "0.5278444", "text": "function deletePsychicTechnique(row) {\n var techniquename = row.cells[0].childNodes[0].childNodes[1].innerHTML;\n row.parentNode.removeChild(row);\n charData.techniques.splice(charData.techniques.indexOf(techniquename), 1);\n dataChanged();\n}", "title": "" }, { "docid": "a6b5f8b0556862fd6b72f7c26c1f5823", "score": "0.5260874", "text": "_delete (type, id) {\n let key = this.appPrefix + type + id;\n\n return mflyCommands.deleteKey(key)\n .then((status) => {\n return id;\n });\n }", "title": "" }, { "docid": "1a811822acbf66806906622005602cbe", "score": "0.5253861", "text": "function deleteChart(plotId){\n var tbId = '#toolbar'+plotId;\n $(tbId).remove(); \n var chartId = '#chart'+plotId;\n $(chartId).remove(); \n var chart=charts[plotId];\n chart.clearChart;\n charts[plotId]=null;\n}", "title": "" }, { "docid": "2c5ec1f804ad8b8a958d75e508236ccb", "score": "0.5243027", "text": "function DeleteScenarioDetailePage () {\n\tvar DBFeaso = Ti.Database.open('QwikFeaso'); \n\t//DBFeaso.execute('delete from ScenarioDetailsPageTable');\n\tDBFeaso.execute('DROP TABLE IF EXISTS ScenarioDetailsPageTable');\n DBFeaso.close();\n}", "title": "" }, { "docid": "e3a987f20d5d38694b6b39888924c724", "score": "0.5238317", "text": "deleteSelectedProgram() {\n var confirmed = confirm('Are you sure you want to delete this site?');\n if (confirmed) {\n Api.deleteProgram(this.state.selectedRowId).then(() => {window.location.reload()});\n }\n return;\n }", "title": "" }, { "docid": "5890d8af06a49661c296f4d72b368889", "score": "0.5237946", "text": "function deleteSelected() {\n\tvar itemNums = []; // item numbers on the canvas\n\n\tfor (var i in canvas.getObjects()) {\n\t\tif (canvas.item(i).active === true ) {\n\t\t\tcanvas.item(i).set({ selectable: false, visible: false });\n\t\t\titemNums.push(i);\n\t\t}\n\t}\n\n\tredoHist = [];\n\tundoHist.push({\n\t\t\"action\" : \"remove\",\n\t\t\"itemNums\": itemNums\n\t});\n\tcanvas.deactivateAll();\n\tcanvas.renderAll();\n}", "title": "" }, { "docid": "371460b9919ffe8e7c4fa95771a10084", "score": "0.52334696", "text": "function remove(done){\n return del(config.dev,{ force: true });\n}", "title": "" }, { "docid": "73f6351e81a060578f45d2f8bbf9f0b3", "score": "0.5222946", "text": "get rm() {\n return {\n about: \"rm [name]<br>&nbsp;&nbsp;Delete the file with the specified name in the current directory.\",\n exe: (args) => {\n if(args.length == 1){\n throw new CmdValidationError('rm', \"No filename specified.\");\n }\n if(args.length > 2){\n throw new CmdValidationError('rm', \"Too many parameters supplied.\");\n }\n const { listingUnit, path } = this.terminal.getFsUnit(args);\n if (!listingUnit) {\n throw new CmdValidationError('rm', `${path}: No such file, or directory.`);\n }\n const preparedPath = path.split('/').filter(it => it.length);\n const targetUnit = this.terminal.fs.get(preparedPath);\n\n // TODO: Add flag support here\n if (targetUnit.name === FS_ROOT_NAME) {\n throw new CmdValidationError('rm', `${path}: Unable to remove root catalogue`);\n }\n if (targetUnit.isDir()) {\n throw new CmdValidationError('rm', `${path}: Unable to remove directory.`);\n }\n\n targetUnit\n .parentDir\n .remove(targetUnit)\n\n return \"\";\n }\n };\n }", "title": "" }, { "docid": "3fe449180b5c87530341f74817e3d0ea", "score": "0.52184224", "text": "function removePreviousHighlight() {\n for (let i = 0; i < NUMBER_OF_TOOLS; i++)\n tools.children[i].classList.remove(\"selected-tool\");\n}", "title": "" }, { "docid": "78a95d5693933b88500a96596733a285", "score": "0.52048844", "text": "delete()\n {\n if (!confirm('Are you sure you want to delete the selected milestone?')) {\n return;\n }\n this.node.parentNode.removeChild(this.node);\n\n for (const edgeId in this.neighbours.forward) {\n this.disconnect(edgeId);\n }\n for (const edgeId in this.neighbours.back) {\n this.neighbours.back[edgeId].disconnect(edgeId);\n }\n\n PERT.currentProject.deleteNode(this.id);\n }", "title": "" }, { "docid": "3e075abb341bc5395927f9e51e0a4840", "score": "0.52039987", "text": "function DeleteAddedDwelling (dwellingID) {\n\tvar DBFeaso = Ti.Database.open('QwikFeaso'); \n\tDBFeaso.execute('delete from ScenarioDetailsPageTable where RowID='+dwellingID);\n DBFeaso.close();\n}", "title": "" }, { "docid": "c465ca608549d0a847644e1e65992198", "score": "0.5199913", "text": "function articleDelete() {\n var articleToDelete = $(this).parents(\".panel\").data();\n $.ajax({\n method: \"DELETE\",\n url: \"/api/headlines/\" + articleToDelete._id\n }).then(function(data) {\n if (data.ok) {\n loadPage();\n }\n });\n }", "title": "" }, { "docid": "61c8d544e029eabb30eaf41807bf8951", "score": "0.519936", "text": "destroy() {\n for (let cmd of this.cmds) {\n cmd.destroy();\n }\n }", "title": "" }, { "docid": "37ceafb8cf19b9778ad15589b7826e1d", "score": "0.5196402", "text": "function del(e) {\n function call() {\n console.log(`deleted`)\n }\n dispatch(delDish(call, e.currentTarget.id))\n getter();\n }", "title": "" }, { "docid": "d9d89699b62d0999bf307fd78f4c14c2", "score": "0.5192025", "text": "function deleteExercise(_id) {\n var confirm = $window.confirm('are you sure?');\n if ( confirm ) {\n ExerciseService.deleteExercise(_id)\n .then(function(msg) {\n vm.message = msg;\n getExercises();\n });\n }\n }", "title": "" }, { "docid": "6e5de4a26af45420adde2c05dbb2e048", "score": "0.5191936", "text": "selectTool(tool) {\n EventBus.$emit(\"try-selecting-tool\", tool.name);\n }", "title": "" }, { "docid": "9a84b0d4be4db6a7274142462b5729e2", "score": "0.5184941", "text": "deleteProgramRecord(programRecord){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('programRecordModel').indexOf(programRecord);\n var restemp = this.get('programRecordModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "title": "" }, { "docid": "e62ee85c9e456e638ba039aedfd57a21", "score": "0.51844597", "text": "function deleteItemBtn(id){\n docID = id;\n console.log(docID);\n MODEL.deleteItem(docID);\n}", "title": "" }, { "docid": "caf332ce31d34128b69573bc36465eea", "score": "0.5183826", "text": "function deleteItem(data_id, viewName) {\r\n\tswitch (viewName) {\r\n\t\tcase 'accountmanager':\r\n\t\t\tdeleteAccountManager (data_id);\r\n\t\t\tbreak;\r\n\t\tcase 'device':\r\n\t\t\tdeleteDevice (data_id);\r\n\t\t\tbreak;\r\n\t\tcase 'customer':\r\n\t\t\tdeleteCustomer (data_id);\r\n\t\t\tbreak;\r\n\t}\r\n}", "title": "" }, { "docid": "8432c7c5f6cd1377d3d4066902ef570c", "score": "0.51814854", "text": "function deleteWholeDiagram()\n{\n\tvar yesno = confirm(MultiArray[\"Warning:\\nYou are about to delete this routing script.\\nDo you want to continue\"][lang]);\n\tif(yesno)\n\t{\n\t\tappletObj.deleteRoutingScript(script_dbid);\n\t\tdocument.location.href = \"../defaultpage.htm\";\n\t}\n}", "title": "" }, { "docid": "30e56c44f7f6b5fe7ebf4553090bcaf4", "score": "0.51737994", "text": "delete() {\n this.api.deleteTelegramConnector(this.bot.id,this.connector.token).then(status=>\n {\n this.telegramConnectors.delete(this.connector.token);\n //publishing the deletion event\n this.ea.publish(new ConnectorDeleted(this.connector));\n this.clearform();\n });\n\n }", "title": "" }, { "docid": "d431e8bb1845aeb42b6a611e6bbed5ca", "score": "0.517375", "text": "deleteTab(ix) {\n const tab_id = this.tabIDByIX(ix)\n // collect the IDs of the grids and widgets we need to delete\n const grids = this.tabByID(tab_id).grids\n const widgets = grids.map(g => this.config.grids[g].widgets).flat()\n\n // construct mutation to delete the whole shebang\n this.qMutation(\"delete a tab\", [ // FIXME: add tab title to the message once implemented\n [ `dash/tabs`, this.config.dash.tabs.filter((t,i) => i != ix) ],\n [ `tabs/${tab_id}`, undefined ],\n ...grids.map(g => [ `grids/${g}`, undefined ]),\n ...widgets.map(w => [ `widgets/${w}`, undefined ]),\n ])\n }", "title": "" }, { "docid": "7e21221963c0b740a5248314dabcd912", "score": "0.5160877", "text": "function selectTool(tool) {\n Object.values(tools).forEach((button) => {\n button.classList.remove('tool-item--selected');\n });\n\n selectedTool = tool.id;\n tool.classList.add('tool-item--selected');\n}", "title": "" }, { "docid": "89719912c7c4d5b5b2f2bcb91ea68d7b", "score": "0.516077", "text": "function deleteGame(id){\r\n\r\n\tdeleteVideogame(id);\r\n\tprintLibrary();\r\n}", "title": "" }, { "docid": "cc0ce5300ec66c31b61c3ddea112424e", "score": "0.515961", "text": "'mousedown .js-delete-item, click .js-delete-item'() {\n remove.call({\n todoId: this.todo._id,\n }, displayError);\n }", "title": "" }, { "docid": "4bcb63cbadaceabe77522d1a529b58c5", "score": "0.5152151", "text": "function delTodo(todo){\n\tif (confirm(\"Are you sure you want to delete this todo?\")) todo.remove();\n}", "title": "" }, { "docid": "67e836eb20f5b1051edc046172e72991", "score": "0.5149463", "text": "function deleteMarker(e) {\n console.log(\"remove\" + lastRelatedTarget);\n shopLayerGroup.removeLayer(lastRelatedTarget);\n tempLayer.removeLayer(lastRelatedTarget);\n sources.forEach(function (value, index) {\n if(sources[index]._leaflet_id == lastRelatedTarget._leaflet_id) {\n sources.splice(index, 1);\n return;\n }\n });\n getPolygons();\n}", "title": "" }, { "docid": "c630147c8be47ed39a8e06790e4e4364", "score": "0.5146889", "text": "function deleteItem(ev) {\n\n if (vm.selectedItem != null) {\n var confirm = $mdDialog.confirm()\n\n .textContent('The task \"' + vm.selectedItem.title + '\" will be deleted. Are you sure?')\n .ariaLabel('Delete task')\n .targetEvent(ev)\n .ok('Yes')\n .cancel('No');\n\n $mdDialog.show(confirm).then(function(result) {\n if (result) {\n var index = vm.items.indexOf(vm.selectedItem);\n if (index != -1) {\n vm.items.splice(index, 1);\n storageService.set(vm.items);\n vm.selectedItem = null; //resolved bug in deleteItem\n }\n }\n });\n }\n }", "title": "" }, { "docid": "4a0832d46aa7155b18fae6ff62ed213e", "score": "0.5142876", "text": "function deleteSelected() {\n\n vm.chartViewModel.deleteSelected();\n }", "title": "" }, { "docid": "f0b6c55e17c0064214458be893c47c22", "score": "0.514259", "text": "function setup_delete() {\r\n document.getElementById(\"delete\").onclick = (e) => {\r\n if (e.button === 0 && use === \"select\") {\r\n if (document.getElementById(selected_item) !== null && document.getElementById(selected_item) !== undefined)\r\n document.getElementById(\"svg\").removeChild(document.getElementById(selected_item));\r\n actualizare_storage()\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ebe3668f6f49ff01ed7449ffe70e17ae", "score": "0.5141655", "text": "destroy(){}", "title": "" }, { "docid": "a050470fc16db4bd6c55c9162060fa24", "score": "0.5141233", "text": "function deleteButton_onClick() {\n var listItem = w.findElement('listItem');\n var cs = mainWindow.getSelection();\n\n if (!(listItem.selection)) {\n return;\n }\n\n var text = 'Are you sure you want to delete the selected files?';\n text += '\\n\\nThis cannot be undone.';\n var choice = confirm(\n text,\n true,\n 'Confirm Delete'\n );\n\n if (!(choice)) {\n return;\n }\n\n var file = new File('/c/temp01234.tmp');\n var result;\n var sel = listItem.selection;\n var existingFiles;\n var idx;\n var text = 'Sorry, there was an error deleting the file.';\n\n for (var i = 0; i < sel.length; i++) {\n existingFiles = data.item(index).exists;\n idx = existingFiles.names.indexOf(sel[i].text);\n file.changePath(existingFiles.paths[idx]);\n\n if (!(file.exists)) {\n continue;\n }\n\n result = file.remove();\n\n if (result) {\n sel[i].enabled = false;\n sel[i].text = 'Deleted.';\n } else {\n sel[i].text = text;\n }\n }\n data.setData(cs);\n }", "title": "" }, { "docid": "7f6b60e657c5e800aca16e8f92c01ad8", "score": "0.5139096", "text": "function deleteTask() {\n this.parentNode.parentNode.remove();\n}", "title": "" }, { "docid": "6e5dd47cebf937ffcb093fb74814cd2c", "score": "0.513059", "text": "deleteJobFlow(){}", "title": "" }, { "docid": "5fb0226a3de20929c65278857f736508", "score": "0.5128912", "text": "function deleteTask(e) {\n if (deleteState) {\n e.currentTarget.remove();\n }\n}", "title": "" }, { "docid": "1303a6e32e6c3511ad5afc9c22ec22e4", "score": "0.5125424", "text": "delete(){\n\t\tthis._refs.delete(this);\n\t}", "title": "" }, { "docid": "ec86277715e574ba2e5c7e5573c56fef", "score": "0.5120741", "text": "function del(item){\n section.removeChild(item);\n if(section.getElementsByTagName(\"article\").length >= 1){\n //removeStartButtonInFirstItem();\n resetButtons();\n }\n}", "title": "" }, { "docid": "25feec29e1a5c377dbb596401d65b0e1", "score": "0.51199615", "text": "function deleteExploration() {\n DataExplorerController.exploration.deleteAllGraphs();\n DataExplorerController.exploration = null;\n predictInt = 15;\n canPredict = false;//time range\n }", "title": "" }, { "docid": "9462ac574aded8f89b128c3fa06900b5", "score": "0.51197416", "text": "function destructivelyDeleteFromDriverByKey(driver, key){\ndelete driver.name; //we want to delete actual content of driver ? \nreturn driver;\n}", "title": "" }, { "docid": "812eb6b21e04a1ad8929c382ee0fbe88", "score": "0.51129776", "text": "function BtnDelete(result)\n{\n buildCmdSequence();\n return\n var filetodelete = document.getElementById(\"txtCmdName\").value;\n if (filetodelete == \"\") {\n alert (\"No Command selected to delete, first select one\");\n return;\n }\n filetodelete=filetodelete+\".cmd\";\n var r = confirm(\"Your really want to delete\\n\\n\"+ filetodelete + \"\\n\\nContinue ?\");\n if (r == false) {\n return;\n } \n document.getElementById(\"txtButton\").value =\"BtnDelete\";\n DeleteCMD\n\t(\n document.getElementById(\"txtValue\").value,\n document.getElementById(\"selectedDevice\").value,\n \"\",\n document.getElementById(\"txtCmdName\").value,\n document.getElementById(\"txtApiUrl\").value,\n document.getElementById(\"txtDescription\").value\n\t);\n}", "title": "" }, { "docid": "279bd1f1d556d37d1b500da20a231ec2", "score": "0.51120144", "text": "function deleteDBAgent(tx){\n tx.executeSql('DROP TABLE IF EXISTS AGENT');\n}", "title": "" }, { "docid": "647bc9bb325e5cbfda4044bb0c2c768c", "score": "0.51104873", "text": "function deleteRule (selPropPair) {\n return Shee.deleteRule(this.sheet, createRule.apply(this, selPropPair))\n}", "title": "" }, { "docid": "a2f63d5c64ca344c95de6feec6879cf1", "score": "0.511018", "text": "function deleteRecipeWithID(){\r\n deleteRecipe(id);\r\n}", "title": "" }, { "docid": "49eb54334cb64f3c2e695f7df40b2c3d", "score": "0.5109241", "text": "static deletePlant(e) {\n\t\tconsole.log('hello delete button')\n\t\tlet plantID = e.target.dataset.id\n\t\tlet plantsCard = document.getElementById(\"plants-card-\" + plantID)\t\t\n\t\t\t// // find the exact plant based on the plant ID\n\t\tlet plantToDelete = Plant.all.find(x => x.id === parseInt(plantID))\n\t\t\t// Get the index of the found plant\n\t\tlet index = Plant.all.indexOf(plantToDelete)\n\t\t\t// Remove the plant from the Plant.all array\n\t\tPlant.all.splice(index, 1);\n\t\t\t// empty the deleted plant card\n\t\tplantsCard.innerHTML = \"\";\n\t\t\t// send plant to delete to the adapter and then database\n\t\tplantAdapter.deletePlant(plantID);\n\n\t}", "title": "" }, { "docid": "22b32d73280529fbe6704efee98bd1cc", "score": "0.5103426", "text": "del() { document.getElementById(this.obj).remove(); }", "title": "" }, { "docid": "c18b38cb908567087170a07c665ae0cd", "score": "0.51008976", "text": "function deleteResource(resource) {\n var id = this.deviceId + ':' + this.resourcePath;\n log('deleteResource(' + this.resourcePath + ')');\n\n var resource = switchesFound[id];\n if (resource) {\n\t// Remove listeners associated to the resource to be deleted\n resource.removeListener('update', observeResource);\n resource.removeListener('delete', deleteResource);\n\t// delete resource info\n delete switchesFound[id];\n\n var child = document.getElementById(id);\n var parent = child.parentElement;\n while (parent.id != 'resources')\n child = parent, parent = parent.parentElement;\n if (parent.childElementCount > 1)\n parent.removeChild(child);\n else {\n // remove from layout instead of from DOM\n parent.style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "bfdf50620dae2bd88ca145018e550a9e", "score": "0.50988454", "text": "onDeleteButtonClicked(_) {\n\n this.parentNode.removeChild(this);\n }", "title": "" }, { "docid": "b7f770c5e3b6c0e13a0c4ac1aee554f0", "score": "0.50988305", "text": "function deleting() {\n mode = \"delete\";\n }", "title": "" }, { "docid": "bed379523f34e1f4ea3dcf2d5f9019e2", "score": "0.50930494", "text": "delTask(){\n\t\tconst tempTasks = this.props.project.tasks.filter(t => t.id !== this.props.task.id);\n\t\tthis.props.project.tasks = tempTasks;\n\n\t\tthis.props.refreshDetailedPage(this.props.project.id);\n\t}", "title": "" }, { "docid": "a91e35ee1c4a38e6faa020f236a48325", "score": "0.5087438", "text": "function delInfo(rideID) {\n if (rideID != undefined) {\n idDeleteChoose = rideID;\n }\n}", "title": "" }, { "docid": "3730919d584c33633405c67b2269b604", "score": "0.5083968", "text": "erase() {\n //tira bordinha dos outros e bota na gente\n this._show_border(this.user.erase_btn_id);\n //seta ferramenta atual para bucket_tool\n this.tool = this.bucket_tool;\n\n //apagar é pintar com branco (nao mexe na .paint_color)\n this.user.color = {\n r: 255,\n g: 255,\n b: 255,\n a: 255\n };\n this._show_current_color();\n }", "title": "" }, { "docid": "5cfcc58f737f2b09d794ee828bbd568b", "score": "0.50822836", "text": "function deactAllTools() {\n navToolbar.deactivate();\n drawToolbar.deactivate();\n }", "title": "" }, { "docid": "baa086143c64906b4f98589809193ace", "score": "0.5081508", "text": "deleteSelection() {\n for (let part of this.selected_parts) {\n /* Delete parts from stage, graphics array and part array */\n this.stage.removeChild(part.sprite);\n delete this.current_build[this.current_build.indexOf(part)];\n // this.current_build = this.current_build.filter(p => p.x !== part.x || p.y !== p.y || p.name !== part.id);\n }\n\n this.selected_parts = [];\n this.current_build = this.current_build.filter(x => x !== undefined);\n }", "title": "" }, { "docid": "1850686fbe9daa779cac3c77a624709a", "score": "0.5071913", "text": "function _triggerDelete() {\n\n vm.$helpService.delete(vm.currentFaq.id, _onDeleteSuccess, _onError);\n }", "title": "" }, { "docid": "f9d43d86fa8f3603348a03ee9abdd257", "score": "0.50708514", "text": "function deleteTask(task, backFn, deleteBackFn) {\n E.showPrompt(\"Delete \" + task.text + \"?\")\n .then(shouldDelete => {\n if (shouldDelete) {\n removeTask(task, allTasks);\n deleteBackFn();\n } else {\n backFn();\n }\n });\n}", "title": "" }, { "docid": "a62b93a093c2b658678d3fb93c55e0ae", "score": "0.5061635", "text": "deleteTemplate(template) {\n this.get('dialog').confirm({\n title : this.get('intl').t('form.confirmDelete')\n }).then(()=> {\n template.deleteRecord();\n template.save().then(()=> {\n this.loadTemplates();\n });\n });\n }", "title": "" }, { "docid": "a1f6c94cfc03a779562008c5817aa5e3", "score": "0.5060001", "text": "_deleteMeasure(event, measure) {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n AppDispatcher.dispatch({\n type: Actions.DESELECT_MEASURE,\n measure: measure\n });\n }", "title": "" }, { "docid": "3b4b9d2e73f39699974a0b3d2d5a9fa8", "score": "0.5059417", "text": "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "title": "" }, { "docid": "3bc1afca919fc16235be1f1839c61fc8", "score": "0.5055355", "text": "destroy () {\n this.taskCenter.destroyCallback();\n delete this.listener;\n delete this.nodeMap;\n delete this.taskCenter;\n removeDoc(this.id);\n }", "title": "" }, { "docid": "e25fd4387c2d773d5ee526c348f8e590", "score": "0.50540036", "text": "function deleteWorkOrder() {\n alert(\"Deleting Work Order\");\n\n // TODO: delete Work Order from DB!!!!!\n}", "title": "" }, { "docid": "60e2f4340ea8e8550bde930ccfe4e3d5", "score": "0.50509626", "text": "remove () {\n this.deleteContents()\n }", "title": "" }, { "docid": "f762eae65f564f5e05dd3d2fbd6553b0", "score": "0.50505805", "text": "deleteSource(model){if(typeof model!=='object'){model=this.byId(model);}let type=model.get('type');if(type==='_file'){let fileName=model.get('ref');this.fileDelete(fileName);}else if(type!=='_solo'){_db._remove(model.get('ref'));}return this.remove(model);}", "title": "" }, { "docid": "59db09d9636f5e862b70de90092401b3", "score": "0.5048685", "text": "function removeToolTitle(){\n $(\"#toolHead\").html(\"\");\n}", "title": "" }, { "docid": "0754bde7489216df59476899ec6122b5", "score": "0.504798", "text": "function deleteKundenInfo(btn){\r\n\tvar TabId = Ext.getCmp('tabpanel').getActiveTab().getId();\r\n\tvar selections = Ext.getCmp(TabId+'Info').getSelectionModel().getSelections();\r\n\t//var selections = KundenInfoSelectModel.getSelections();\r\n\tif(btn=='yes'){\r\n\t\t Ext.Ajax.request({ \r\n\t\t\twaitMsg: 'Please Wait',\r\n\t\t\turl: 'index.php?module=Leadseller&type=data', \r\n\t\t\tparams: {\r\n\t\t func: \"delete\",\r\n\t\t\t\t ot: \"KundenInfo\",\r\n\t\t\t\t id: selections[0].json.id\r\n\t\t }, \r\n\t\t\tsuccess: function(response){\r\n\t\t\t var TabId = Ext.getCmp('tabpanel').getActiveTab().getId();\r\n\t\t\t var result=response.responseText;\r\n\t\t\t if(result){\r\n\t\t\t \tExt.MessageBox.alert('Warnung', result);\r\n\t\t\t }\r\n\t\t\t else{\r\n\t\t\t \tExt.getCmp(TabId+'Info').store.reload();\r\n\t\t\t \tvar KundenInfoDetailPanel = Ext.getCmp(TabId+'InfoDetail');\r\n\t\t\t\tKundenInfoTpl.overwrite(KundenInfoDetailPanel.body, '');\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t},\r\n\t\t\tfailure: function(response){\r\n\t\t\t var result=response.responseText;\r\n\t\t\t Ext.MessageBox.alert('error','could not connect to the database. retry later'); \r\n\t\t\t }\r\n\t\t});\r\n\t} \r\n} // eo deleteKundenInfo", "title": "" } ]
b62b3a913fcdfbea94bba6061927f5f8
Guessing Game Functions Generate the Winning Number
[ { "docid": "6e83a895b4e4c71510fd3286d8b8f5e3", "score": "0.7552398", "text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random()*100);\n}", "title": "" } ]
[ { "docid": "d1fad7f9151fda3504242e0cfd42d008", "score": "0.7871035", "text": "function generateWinningNumber(currentGame){\n\tcurrentGame.winningNumber = Math.floor((Math.random() * 100) + 1);\n}", "title": "" }, { "docid": "7c2a1f761577d9784e4a0f692f70298f", "score": "0.7706258", "text": "function generateWinningNumber(){\n \treturn 1 + Math.floor(100*Math.random());\n }", "title": "" }, { "docid": "042b44e75e48239d79ff03b0fe070062", "score": "0.77051514", "text": "function generateWinningNumber(){\n\t// add code here\n\treturn Math.floor(Math.random() * 100) + 1;\n}", "title": "" }, { "docid": "ea12b05bfff083ba5ea2ea318914ee37", "score": "0.76803654", "text": "function generateWinningNumber() {\n return Math.floor(Math.random() * 100) + 1;\n}", "title": "" }, { "docid": "ff7ee689fca9294b60b45ca1486ea5b8", "score": "0.7668754", "text": "function generateWinningNumber() {\n return Math.floor(Math.random() * 100) + 1;\n}", "title": "" }, { "docid": "fdfb809b2b1ec6b20bb930fe30ed9f11", "score": "0.76587635", "text": "function guessingGame(amount) {}", "title": "" }, { "docid": "32df6998deca3bb64211f947f2f87f90", "score": "0.7658293", "text": "function generateWinningNumber(){\n\tvar winNum = Math.floor(Math.random()*100) + 1;\n\treturn winNum\n}", "title": "" }, { "docid": "0ed6b955aeb950cbed22b96685280982", "score": "0.7651378", "text": "function generateWinningNumber() {\n return Math.floor(Math.random() * 100) + 1\n}", "title": "" }, { "docid": "5c61f449cabd25787858443c915efad9", "score": "0.76444435", "text": "function newWinningNumber() {\n\t\twinningNumber = Math.floor(Math.random() * 119) + 1;\n\t\tconsole.log(\"Winning Number: \" + winningNumber);\n\t\t// Print winning number to the random-number-box\n\t\t$(\".random-number-box\").html(winningNumber);\n\n\t\tgamePlay(winningNumber);\n\t\treturn winningNumber;\n\t}", "title": "" }, { "docid": "deb9e7620e6760b51f7629958a842b5d", "score": "0.7635526", "text": "function generateWinningNumber(){\n\tvar winNum = Math.floor(Math.random() * (100)) + 1;\n\treturn winNum;\n}", "title": "" }, { "docid": "72add15000585422083f26988ec8b867", "score": "0.7635407", "text": "function generateWinningNumber(num){\n return Math.floor((Math.random() * num) + 1);\n}", "title": "" }, { "docid": "d354cb4fc233f234896ac422be0db552", "score": "0.7628744", "text": "function generateWinningNumber(){\n\t\treturn Math.floor((Math.random() * 100) + 1);\n\n\t}", "title": "" }, { "docid": "d368850649e9fa9309712f2858c0231b", "score": "0.75972414", "text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random() * 100) + 1;\n}", "title": "" }, { "docid": "d368850649e9fa9309712f2858c0231b", "score": "0.75972414", "text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random() * 100) + 1;\n}", "title": "" }, { "docid": "24f8808e1849c9d743e61a5dadc652bc", "score": "0.7592152", "text": "function winGame() {\n\nsecretNumber = Math.floor(Math.random()*100) + 20;\n $(\"#number-to-guess\").text(secretNumber);\n\n$(\"#wincount\").text(win += 1);\nstartState ();\n\n return;\n\n}", "title": "" }, { "docid": "ff05a738a9c6d245a44f4cd20b1ddba2", "score": "0.7576458", "text": "function generateWinningNumber(){\n\treturn Math.floor(Math.random()*100)\n}", "title": "" }, { "docid": "c98005b91992a2de43d70d9cb54d9c42", "score": "0.75400096", "text": "function generateWinningNumber(){\n\twinningNumber = Math.floor(Math.random() * 100) + 1;// add code here\n}", "title": "" }, { "docid": "335ff5c933aadf9dcaab890b05c30480", "score": "0.75001395", "text": "function generateWinningNumber(){\n var winningNum=Math.random();\n winningNum*=100;\n winningNum=Math.floor(winningNum);\n return winningNum;\n}", "title": "" }, { "docid": "429b2d8f882c906d21c2a4f6e1f35022", "score": "0.74315697", "text": "function generateWinningNumber(){\n\t// add code here\n var min = 1, max =100;\n return winningNumber = getRandom(min,max);\n\n}", "title": "" }, { "docid": "241d801f2aee3323b82c812465002420", "score": "0.7400896", "text": "function generateWinningNumber(){\n\t// add code here\n\tvar max = 100;\n\tvar min = 0;\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "f5fc3646be61f048b81cc87d3c5faeef", "score": "0.73636436", "text": "function checkGuess(playersGuess,winningNumber){\n\t// add code here\n\tif(playersGuess===winningNumber){\n\t\talert(\"You got the answer right in \"+trys+ \" attempts!\");\n\t\talert(\"Resetting mystery number!\");\n\t\tgenerateWinningNumber();\n\n\t}else{\n\t\ttrys++;\n\t};\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.71856886", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.71856886", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.71856886", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "0688763e4fc58f56d8dfb00c312c5ef2", "score": "0.71856886", "text": "function game() {\n//random number generator for picking infinitive\nnumPick = Math.round(Math.random()*41);\n \n//random number generator for picking infinitive\nnumPicker = Math.round(Math.random()*5);\n\n//return values \nreturn numPicker;\nreturn numPick;\n}", "title": "" }, { "docid": "89bf1e973fe2af2323fd040b709f3eb4", "score": "0.7174529", "text": "function matchWinnings() {\n\tconsole.log\n\tvar num_array = getInput();\n\tvar random_array = displayNums();\n\trandom_lucky = random_array[0];\n\tvar new_random_arr = [];\n\tfor (i = 1; i < 6; i++) {\n\t\tnew_random_arr[i - 1] = random_array[i];\n\t}\n\tlucky_num = num_array[0];\n\tvar match_array = [];\n\tfor (i = 1; i < 6; i++) {\n\t\tmatch_array[i - 1] = num_array[i];\n\t}\n\tvar count = 0;\n\tfor (i = 0; i < 5; i++) {\n\t\tfor (j = 0; j < 5; j++) {\n\t\t\tif (new_random_arr[i] == match_array[j])\n\t\t\t\tcount++; \n\t\t}\n\t}\n\tif (random_lucky == lucky_num) {\n\t\tvar lucky_true = 1;\n\t}\n\telse {\n\t\tvar lucky_true = 0\n\t}\n\tif (lucky_true == 1 && count == 0)\n\t\talert(\"You guessed zero of the numbers but you got the lucky ball! You win $4.\");\n\telse if (lucky_true == 1 && count == 1) \n\t\talert(\"You guessed one of the numbers and you got the lucky ball! You win $6.\");\n\telse if (lucky_true == 0 && count == 2)\n\t\talert(\"You guessed two of the numbers and you didn't get the lucky ball! You win $3.\");\n\telse if (lucky_true == 1 && count == 2)\n\t\talert(\"You guessed two of the numbers and you got the lucky ball! You win $25.\");\n\telse if (lucky_true == 0 && count == 3) \n\t\talert(\"You guessed three of the numbers and you didn't get the lucky ball! You win $20.\");\n\telse if (lucky_true == 1 && count == 3)\n\t\talert(\"You guessed three of the numbers and you got the lucky ball! You win $150.\");\n\telse if (lucky_true == 0 && count == 4) \n\t\talert(\"You guessed four of the numbers and you didn't get the lucky ball! You win $200.\");\n\telse if (lucky_true == 1 && count == 4)\n\t\talert(\"You guessed four of the numbers and you got the lucky ball! You win $20.\");\n\telse if (lucky_true == 0 && count == 5)\n\t\talert(\"You guessed five of the numbers and you didn't get the lucky ball! You win $25,000 a YEAR for LIFE.\");\n\telse if (lucky_true == 1 && count == 5)\n\t\talert(\"WOW!! You guessed five of the numbers and you got the lucky ball! You win $7,000 a WEEK for LIFE.\");\n\telse\n\t\talert(\"You guessed no numbers correctly. Please enter the lottery again. :(\")\n}", "title": "" }, { "docid": "958b079ea7a0b38e20948a9cd83b392d", "score": "0.71735054", "text": "function checkWin(){\n if(randomNumGenerated === totalClickedNum){\n wins++\n// Step 4. Display wins\n $(\"#wins\").text(\"Wins: \" + wins);\n startGame();\n }\n else if(totalClickedNum > randomNumGenerated){\n// Step 5. Calculate losses\n losses++\n startGame();\n// Step 6. Display losses\n $(\"#losses\").text(\"Losses: \" + losses);\n }\n}", "title": "" }, { "docid": "81b42a28d8ebd4af08c57b311b013c54", "score": "0.7162895", "text": "function guessing_game(guess) {\n // Get a random integer from 1 to 10 inclusive\n console.log(\"matched or unmatched?\");\n}", "title": "" }, { "docid": "71976968d6a183e46245f779fea27413", "score": "0.7154174", "text": "function checkForWinsAndLossess() {\r\n\t\tif (totalScore == randonNumGenerator){\r\n\t\t\twins++\r\n\t\t\tnewGame();\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif (totalScore > randonNumGenerator){\r\n\t\t\tlosses++;\r\n\t\t\tnewGame();\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "3a04ad3aa3e40911d30767f895e1cc78", "score": "0.7147218", "text": "function guessNumber(){\n\tguessNum = Math.floor(Math.random() * (120 -19) + 19);\n\t\treturn guessNumber\n}", "title": "" }, { "docid": "aea796a0966cd23279ea96d72b301162", "score": "0.7146625", "text": "function determineWinnings() {\n if (blanks == 0) {\n if (grapes == 3) {\n winnings = playerBet * 10;\n }\n else if (bananas == 3) {\n winnings = playerBet * 20;\n }\n else if (oranges == 3) {\n winnings = playerBet * 30;\n }\n else if (cherries == 3) {\n winnings = playerBet * 40;\n }\n else if (bars == 3) {\n winnings = playerBet * 50;\n }\n else if (lemons == 3) {\n winnings = playerBet * 75;\n }\n else if (sevens == 3) {\n winnings = playerBet * 100;\n }\n else if (grapes == 2) {\n winnings = playerBet * 2;\n }\n else if (bananas == 2) {\n winnings = playerBet * 2;\n }\n else if (oranges == 2) {\n winnings = playerBet * 3;\n }\n else if (cherries == 2) {\n winnings = playerBet * 4;\n }\n else if (bars == 2) {\n winnings = playerBet * 5;\n }\n else if (lemons == 2) {\n winnings = playerBet * 10;\n }\n else if (sevens == 2) {\n winnings = playerBet * 20;\n }\n else if (sevens == 1) {\n winnings = playerBet * 5;\n }\n else {\n winnings = playerBet * 1;\n }\n winNumber++;\n showWinMessage();\n }\n else {\n lossNumber++;\n showLossMessage();\n }\n}", "title": "" }, { "docid": "b5cdfced5e8a2d090c3be1c606ad1fca", "score": "0.7142839", "text": "function checkForWin() {\n\n if (playerGuess === gameRandomNumber) {\n alert(\"YOU WON!\");\n wins += 1;\n resetGame();\n\n $(\".win-count\").text(wins);\n\n } else if (playerGuess > gameRandomNumber) {\n alert(\"YOU LOST!\")\n losses += 1;\n resetGame();\n\n $(\".lose-count\").text(losses);\n }\n\n }", "title": "" }, { "docid": "8b3dbd73e6782e888452b0ee8fd6278f", "score": "0.71409756", "text": "function evalGuess() {\n totalGuesses += 1\n gamerGuess = document.querySelector('#guess').value\n\n const feedback = document.querySelector('#feedback')\n console.log(`${gamerGuess}, The correct number is ${correctNumber}, ${totalGuesses}`)\n\n const attempts = document.querySelector(\"#attempts\")\n\n\n if (gamerGuess == correctNumber) {\n feedback.innerText = `Right On! You win!` +`\\n`+ `The corect number was ${correctNumber}`\n //After winning, award a ribbon\n giveAward()\n } else if (gamerGuess > correctNumber && gamerGuess < 16) {\n feedback.innerText = \"Too high, try again\"\n } else if (gamerGuess < correctNumber && gamerGuess > 0) {\n feedback.innerText = \"Too low, try again\"\n } else {\n feedback.innerText = \"Please enter a \" + '\\n' + \"NUMBER between\" + '\\n' + \"1 and 15 and try again\"\n totalGuesses -= 1\n }\n\n\n attempts.innerText = totalGuesses\n}", "title": "" }, { "docid": "494cc91004493f3713b3c17f67ff8489", "score": "0.71333367", "text": "function winning(){\n \t\twins++\n\t\tend=\"You Win!\";\n\t\tdocument.getElementById(\"endElement\").innerHTML=\"You Win!\";\n\t\tdocument.getElementById(\"winsElement\").innerHTML=\"Wins: \"+wins;\t\t\t\t\n\t\tconsole.log(wins);\n\t\tconsole.log(end);\n\t\ttotalScore=0;\n\t\tcrystleNum1=0;\n\t\tcrystleNum2=0;\n\t\tcrystleNum3=0;\n\t\tcrystleNum4=0;\n\t\tcompNum = Math.floor(Math.random() * (120 - 19)) + 19;\n\t\tdocument.getElementById(\"compNumElement\").innerHTML=compNum;\n\t}", "title": "" }, { "docid": "76dddb237dc03de27e4e3a08f72d8889", "score": "0.71158344", "text": "function checkingNum () {\n if (playerCounter === computerNum[0]) {\n wins++;\n $(\"#outcome\").html(\"You won!!\");\n $(\"#wins\").html(\"Wins: \"+ wins);\n console.log(\"You won!!\");\n nextGame();\n }\n \n else if (playerCounter > computerNum[0]) {\n losses++;\n $(\"#outcome\").html(\"You lost!!\");\n $(\"#losses\").html(\"Losses: \" + losses);\n console.log(\"You lost!!\");\n nextGame();\n }\n \n else {\n console.log(\"Keep guessing!\")\n }\n \n }", "title": "" }, { "docid": "583754d9de9821558f0b1c11d6cbd8be", "score": "0.7084976", "text": "function checkGame() {\n if (guessedVal === magicNum) {\n wins++;\n gameSet();\n } else if (guessedVal > magicNum) {\n losses++;\n gameSet();\n }\n}", "title": "" }, { "docid": "3c773f089011e7606d453d6d8755bda9", "score": "0.7072914", "text": "function determineWinnings() {\n // Generate random values for jackpot\n let jackPotTry = Math.floor(Math.random() * 1000);\n let jackPotWin = Math.floor(Math.random() * 1000);\n //console.log(jackPotWin);\n //console.log(jackPotTry);\n // If jackpot won\n if (jackPotTry == jackPotWin) {\n alert(\"You Won the $\" + jackpot + \" Jackpot!!\");\n winnings = jackpot;\n }\n // Normal situation\n else if (blanks == 0) {\n if (grapes == 3) {\n winnings = bet * 10;\n }\n else if (bananas == 3) {\n winnings = bet * 20;\n }\n else if (oranges == 3) {\n winnings = bet * 30;\n }\n else if (cherries == 3) {\n winnings = bet * 40;\n }\n else if (bars == 3) {\n winnings = bet * 50;\n }\n else if (bells == 3) {\n winnings = bet * 75;\n }\n else if (sevens == 3) {\n winnings = bet * 100;\n }\n else if (grapes == 2) {\n winnings = bet * 2;\n }\n else if (bananas == 2) {\n winnings = bet * 2;\n }\n else if (oranges == 2) {\n winnings = bet * 3;\n }\n else if (cherries == 2) {\n winnings = bet * 4;\n }\n else if (bars == 2) {\n winnings = bet * 5;\n }\n else if (bells == 2) {\n winnings = bet * 10;\n }\n else if (sevens == 2) {\n winnings = bet * 20;\n }\n else if (sevens == 1) {\n winnings = bet * 5;\n }\n else {\n winnings = bet * 1;\n }\n }\n }", "title": "" }, { "docid": "69cc029e5524a01fe25da1722669bb67", "score": "0.7072434", "text": "function compareNum(){\n if (result === randomNum){\n //add win to win total\n win++; \n startGame();\n }\n else if (result > randomNum){\n //add loss to loss total\n loss++;\n startGame();\n }\n}", "title": "" }, { "docid": "6f59428864b704892573b6813e85d373", "score": "0.7071277", "text": "function rand (){\n guessedNumber=Math.floor(Math.random( ) * 120) + 19;\n console.log(\"guessed number:\", guessedNumber);\n }", "title": "" }, { "docid": "1c9541afbabd2a788b03e84b5d2b2885", "score": "0.7066777", "text": "function checkWin() {\n if (correctGuesses.indexOf('_') === -1) {\n startGame();\n wins++;\n winsEl.innerHTML = wins;\n\n } else if (guessesRemaining === 0) {\n startGame();\n }\n}", "title": "" }, { "docid": "6cb94f8e22ac8f3d360f3c908456f689", "score": "0.70418626", "text": "function generateWinningNumber(min, max){\n\treturn Math.floor(Math.random() * 101);\n}", "title": "" }, { "docid": "4f32c8678ac24c34cd73bf90ca347274", "score": "0.70255595", "text": "function generateNumber() {\n let randomNumber = Math.floor(Math.random() * squares.length);\n if (squares[randomNumber].innerHTML == 0) {\n squares[randomNumber].innerHTML = 2\n checkForGameOver();\n } else generateNumber();\n }", "title": "" }, { "docid": "9cbaa507c3d0176f6711ea5bec34f28f", "score": "0.7023986", "text": "function evalGuess() {\n totalGuesses += 1 \n gamerGuess = document.querySelector('#guess').value\n\n const feedFront = document.querySelector('#feedFront')\n if (gamerGuess == correctNumber) {\n feedFront.innerText = 'You Win! now Get Off My SHIP!'\n giveAward()\n } else if (gamerGuess > correctNumber && gamerGuess < 21) {\n feedFront.innerText = 'Too High! Walk the Plank!'\n } else if (gamerGuess < correctNumber && gamerGuess > 0) {\n feedFront.innerText = 'Too Low! Release the Kraken!'\n } else {\n feedFront.innerText = 'Please choose a number\\n between 1 and 20 \\n and try again!'\n totalGuesses -= 1\n }\n document.querySelector('#attempts').innerText = totalGuesses \n}", "title": "" }, { "docid": "4c3405e2cc6a9d58c99a7caddc28d7ba", "score": "0.7023212", "text": "function numberGuess() {\n randomNumber = (Math.floor(Math.random() * 102) + 19);\n $(\".target-number\").text(\"Number to guess: \" + randomNumber);\n }", "title": "" }, { "docid": "6dc55f9fa96bbf6f020c54170d0bd1a0", "score": "0.7012449", "text": "function randomNumGuess() {\n computerGuess = (Math.floor((Math.random() * 120) + 19));\n $(numberGuess).text(computerGuess);\n }", "title": "" }, { "docid": "0cedcb2b1fb01ee15c265b5ad847705a", "score": "0.7007203", "text": "function wins(){\n\tif (guessNum === score)\n\t\twins++\n\n}", "title": "" }, { "docid": "77242b561ab410a6e8f0c647a0a1286a", "score": "0.69953173", "text": "function newGame()\n{\n computerNumber=Math.floor(Math.random() *100+1);\n guessAnswer=\"\"\n previousAnswer=\"\";\n guesses=0;\n GuessesStr=\"\";\n lowHigh=\"\";\n numberGuess=\"\";\n low=1;\n high=100;\n updateNow();\n}", "title": "" }, { "docid": "fa33a962083d5df6c585159d927841bc", "score": "0.6975684", "text": "function randomGenerator() {\n compuGenNumb = 0;\n compuGenNumb = (Math.round(Math.random() * 100));\n displayGuessNumber();\n}", "title": "" }, { "docid": "042d901952ec944317e9da997959218b", "score": "0.6956645", "text": "function generateGameScore() {\n\tgameScore = Math.floor((Math.random() * 25) + 1);\n}", "title": "" }, { "docid": "91d54918064a605dc0b9d6fd7f812cfc", "score": "0.6942714", "text": "function winNumber(){\n\t\twinScore = randomNum(27,72);\n\t\tconsole.log(\"Win Score is \"+winScore);\n\t\t$(\"#WinScore\").text(winScore);\n}", "title": "" }, { "docid": "6e49f96c679a19c0477409c03bf16eff", "score": "0.6940558", "text": "function startNewGame() {\n secretNumber = Math.trunc(Math.random() * 20 + 1);\n // console.log(secretNumber);\n score = 20;\n chageScore(20);\n guessNodeEl.value = '';\n changeMessage('Start guessing...');\n changeNumber('?');\n changeStyles('#0b0355', '15rem', \"What's the Number!\");\n}", "title": "" }, { "docid": "6cfb758620e89643ce5c0dd777467392", "score": "0.69299483", "text": "function loseGame(){\n secretNumber = Math.floor(Math.random()*100) + 20;\n $(\"#number-to-guess\").text(secretNumber);\n $(\"#losecount\").text(lose += 1);\n startState();\n return;\n}", "title": "" }, { "docid": "abfeb3ac82f6882d7a9909e6b1a6320d", "score": "0.69194573", "text": "function Game() {\n this.playersGuess = undefined;\n this.pastGuesses = [];\n this.winningNumber = generateWinningNumber(); //winningNumber is a property that is assigned to the return value of generateWinningNumber()\n}", "title": "" }, { "docid": "dae5b0e3823c185ae17d824a2332eef4", "score": "0.6883365", "text": "function genRandom() {\n let number = [58, 84, 99, 120];\n let randomNum = Math.floor(Math.random() * numbers.length);\n let totScore = numbers[ranNumber];\n let wins = 0;\n let losses = 0;\n return totScore;\n }", "title": "" }, { "docid": "bb1bde33fadeb96017b5cc40bb19cfc4", "score": "0.6883256", "text": "function computerGuessGen() {\n\t\t\t\treturn Math.floor(Math.random() * answerArray.length);\n\t\t\t}", "title": "" }, { "docid": "bb1bde33fadeb96017b5cc40bb19cfc4", "score": "0.6883256", "text": "function computerGuessGen() {\n\t\t\t\treturn Math.floor(Math.random() * answerArray.length);\n\t\t\t}", "title": "" }, { "docid": "5b2daa5ad73b48ca955c245541429b71", "score": "0.6853904", "text": "function checkWinLose(){\n // if player totalScore matches the randomNumber\n if (totalScore == randomNumber){\n // player wins the game, increase count of wins by 1, start a new game.\n numOfWins += 1;\n resetGameValues();\n startNewGame();\n }\n\n // if player totalScore exceeds the random Number\n if (totalScore > randomNumber){\n //player loses the game, increase losses count by 1, start a new game.\n numOfLoses += 1;\n resetGameValues();\n startNewGame();\n }\n\n}", "title": "" }, { "docid": "314cc7a421c23431299fbe0ba65d850d", "score": "0.68433183", "text": "function gamePlay() {\n\t\tif (totalScore == winningNumber) {\n\t\t\twins++;\n\t\t\t$(\".result\").html(\"You win!!\");\n\t\t\treset();\n\t\t}\n\t\tconsole.log(totalScore);\n\t\tconsole.log(winningNumber);\n\t\tif (totalScore > winningNumber) {\n\t\t\tlosses++;\n\t\t\t$(\".result\").html(\"You lose..\");\n\t\t\treset();\n\t\t}\n\t}", "title": "" }, { "docid": "9d4534bc877dab0a77fc0f517526cc6e", "score": "0.68418586", "text": "function determineWinnings()\n {\n if(strikes == 3) {\n outs++;\n lossNumber++;\n createjs.Sound.play(\"strike3\");\n showLossMessage();\n }\n else if(popFlies == 3) {\n outs++;\n lossNumber++;\n createjs.Sound.play(\"out\");\n showLossMessage();\n }\n else if (singles == 3) {\n runs++;\n winnings = playerBet * 10;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if(doubles == 3) {\n runs = runs + 2;\n winnings = playerBet * 20;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if (triples == 3) {\n runs = runs + 3;\n winnings = playerBet * 30;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if (homeRuns == 3) {\n runs = runs + 4;\n winnings = playerBet * 100;\n winNumber++;\n createjs.Sound.play(\"cheer\");\n showWinMessage();\n }\n else if(groundRollDoubles == 3){\n runs = runs + 2;\n winnings = playerBet * 20;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if (homeRuns == 1) {\n runs++;\n winnings = playerBet * 10;\n winNumber++;\n createjs.Sound.play(\"cheer\");\n showWinMessage();\n }\n else if (homeRuns == 2) {\n runs = runs + 3;\n winnings = playerBet * 10;\n winNumber++;\n createjs.Sound.play(\"cheer\");\n showWinMessage();\n }\n else {\n lossNumber++;\n jackpot = jackpot + playerBet;\n showLossMessage();\n }\n }", "title": "" }, { "docid": "bc3744cdcf0e1945bd88d9cff7ce99d2", "score": "0.6831776", "text": "function gameResult(score) {\n if (score === randInt) {\n wins++\n if (confirm(\"You won! Play again?\")) {\n newGame()\n } else { alert(\"Your Wins: \" + wins + \" and losses: \" + losses) }\n } else if (score > randInt) {\n losses++\n if (confirm(\"You lost :() Play again?\")) {\n newGame()\n }\n\n }\n}", "title": "" }, { "docid": "3b4e8a285e9d4e06b05e3d5625a3e156", "score": "0.6826125", "text": "function renderGuess() {\n\n // If there the user guesses the right\n if (userGuess == randomLetter) {\n // Increment win total\n winCount++;\n // Reset the game\n alert(\"You win!\")\n resetGame();\n } else {\n alert(\"Guessed Wrong!\");\n // If there the user guesses wrong on the last guess\n if (guessesLeft == 1) {\n // Increment loss total\n lossCount++;\n // Reset the game\n alert(\"You lose!\")\n resetGame();\n } else if (guessesLeft == maxGuesses) {\n // Initialize guesses SoFar to the guessed letter\n guessesSoFar = userGuess;\n // Output guesses so far to screen\n document.querySelector(\"#guessesSoFarText\").innerHTML = \"Your Guesses so far: \" + guessesSoFar;\n // Decrement guesses left\n guessesLeft--;\n // Output guesses left to screen\n document.querySelector(\"#guessesLeftText\").innerHTML = \"GuessesLeft: \" + guessesLeft;\n alert(\"Guesses Left After Wrong First Time: \" + guessesLeft);\n } else if (guessesLeft < maxGuesses && guessesLeft > 0) {\n // Add wrong letter to guesses so far with comma\n guessesSoFar = guessesSoFar + \", \" + userGuess;\n // Output guesses so far to screen\n document.querySelector(\"#guessesSoFarText\").innerHTML = \"Your Guesses so far: \" + guessesSoFar;\n // Decrement guesses left\n guessesLeft--;\n // Output guesses left to screen\n document.querySelector(\"#guessesLeftText\").innerHTML = \"Guesses Left: \" + guessesLeft;\n alert(\"Guesses Left After Wrong Subsequent Time: \" + guessesLeft);\n }\n }\n }", "title": "" }, { "docid": "88a4724325c9d11674e0512fd799fefe", "score": "0.6820717", "text": "function win() {\n wins++;\n resetGame();\n }", "title": "" }, { "docid": "6ccde9621e43a2b4010be61434dea53a", "score": "0.6819595", "text": "function playAgain(){\n\tgenerateWinningNumber();\n}", "title": "" }, { "docid": "5555ec8defb29ff730230c8ca1cc32d8", "score": "0.68174666", "text": "function checkifwon() {\n \n if(score === computerGuess) {\n \n wins++;\n console.log(wins);\n $(\"#winn\").html(\"You Win\");\n $(\"#win\").html(\"win: \" +wins);\n reset();\n} else if (score > computerGuess) {\n \n lost++;\n console.log(lost);\n $(\"#winn\").html(\"You Lost\");\n $(\"#lost\").html(\"Lost: \" + lost);\n reset();\n}\n \n}", "title": "" }, { "docid": "7ac35b7172289910593b4aabea84c4a4", "score": "0.6816107", "text": "function guessingGame(amount) {\n\t var answer = Math.floor(Math.random() * 11)\n\t var guesses = 0;\n\t return function (guess) {\n\t guesses++\n\t if (guesses <= amount) {\n\t if (guess === answer) {\n\t return `You got it, the guessed number is ${answer}, and your input is ${guess}`;\n\t } else if (guess < answer) {\n\t return `You are too low`;\n\t } else {\n\t return `you are too high`;\n\t }\n\t\n\n\t } else {\n\t return `Yor are out of Guesses, The guessed number is ${answer}, and your input is ${guess}`;\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fbe6724b25ac927d0b57d537cc7c6f6c", "score": "0.68149483", "text": "function generateRandomNumber(){\n\t\n\t//get game node string\n\tvar currentGameString = getRangeString(); \n\tvar randomNumber = NaN;\n\t\n\t//use switch statement to generate the random number\n\tif(currentGameString==\"1-10\"){\n\t\trandomNumber = Math.round(Math.random() * (10 - 1) + 1);\n\t}\n\telse if(currentGameString==\"1-100\"){\n\t\trandomNumber =Math.round(Math.random() * (100 - 1) + 1);\n\t}\n\telse{\n\t\trandomNumber = Math.round(Math.random() * (1000 - 1) + 1);\n\t}\n\n\tconsole.log(\"for range: \" + currentGameString + \". The number to guess is: \" + randomNumber);\n\t\n\treturn randomNumber;\n\t\n}", "title": "" }, { "docid": "ce3713da1cfadcd0b2b4979afd559cbc", "score": "0.68144864", "text": "function winLossCounter() { // Win counter incriment\n \n if (guessingArray.toString() == blanks.toString()) { // win counter\n wins++; // wins = wins + 1 \n document.getElementById(\"wins\").innerHTML = \" \" + wins; // adding win to document\n\n \n } else if (guessesRemaining === 0) { // losses counter\n losses++; // losses = losses + 1 \n document.getElementById(\"lose\").innerHTML = \" \" + losses; // printing loss to DOM\n }\n\n document.getElementById(\"tries\").innerHTML = \" \" + guessesRemaining; // tries left (Countdown)\n}", "title": "" }, { "docid": "087999944c2debe7b94cd3afc3bddba2", "score": "0.68007827", "text": "function newRound() {\n guessesLeft = max_guesses;\n\tsolution = getRandomLetter();\n\tlettersUsed = [];\n}", "title": "" }, { "docid": "141101cd81495442177ab0933afa3c07", "score": "0.67894334", "text": "function getRandomNum() {\n randomTarget = Math.floor(Math.random() * 101) + 19;\n $(\"#number-to-guess\").text(randomTarget);\n }", "title": "" }, { "docid": "50ac06506b1d81f1c797dc1f856a8637", "score": "0.67862433", "text": "function checkForWin() {\n\tif (underscoresArray.indexOf(\"_\") === -1) {\n // Alert the user with a message confirning their correctly guessed name.\n alert(\"Congratulations! \" + selectedPupil + \" is present!\");\n // Increase the numerical value inside the numWins variable by +1.\n numWins++;\n // Print the total number of wins to the DOM.\n document.getElementById(\"wins\").innerHTML = numWins;\n // Reset the game setup (reset funtion) for another round.\n\t\treset();\n\t}\n}", "title": "" }, { "docid": "9d88bb20927996b93c97ba1bcd837c09", "score": "0.6784671", "text": "function checkGuess(){\n\tvar totalGuesses = 0;\n\tvar status = \"\";\n\tvar guessesSoFar = [];\n\tif (playersGuess === winningNumber) {\n\t\tvar status = \"Congrats, you win!\";\n\t\tplayAgain();\n\t} else if (totalGuesses === 6) { \n\t\tvar status = \"Unfortunately, you've run out of a guesses.\"\n\t} else if (guessesSoFar.indexOf(playersGuess) === -1) {\n\t\tvar allowedGuesses -= 1;\n\t\tvar status = \"You have \" allowedGuesses \" more attempts.\";\n\t\tvar totalGuesses += 1;\n\t\tguessesSoFar.push(playersGuess); \n\t} else {\n\t\tvar status = \"Duplicate guess - please try again.\";\n\t};\n\tguessMessage();\n}", "title": "" }, { "docid": "21e4ec894ff3d82c0aea5de20cd36e88", "score": "0.67841285", "text": "function checkGuess(playersGuess){\n\t\t// add code here\n\t\tif(playersGuess > 100 || playersGuess < 0){\n\t\t\t$('#message').html('Please choose a number in range');\n\t\t\n\t\t} else if(playersGuess === winningNumber){\n\t\t\t$('#message').html('Your guess is correct!');\n\t\t\t$('#submit_button').prop('disabled', true);\n\t\t\t$('#hint').prop('disabled', true);\n\t\t\t$('body, .header').addClass('winner');\n\t\t\t$('.main-content').append('<img src=\"winner.png\" id= \"winnerImage\" alt=\"winner\">')\n\n\t\t} else {\n\t\t\t\n\t\t\t if(!guessesArray.includes(playersGuess)){\n\t\t\t\tnumberGuesses++;\n\t\t\t\tguessesLeft = 6 - numberGuesses;\n\t\t\t\tguessesArray.push(playersGuess);\n\t\t\t\t$('#message').html(guessMessage(playersGuess));\n\t\t\t\t\tif(numberGuesses > 5){\n\t\t\t\t\t\t$('#message').html(\"Sorry you're out of guesses!\");\n\t\t\t\t\t\t$('#question').prop('disabled', true);\n\t\t\t\t\t\t\n\t\t\t\t\t$('body, .header, .main-content').addClass('loser');\n\t\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t$('#message').html(\"You already guessed that number.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "title": "" }, { "docid": "bca47830bae7fc4b7eee826e088b240b", "score": "0.67818624", "text": "function checkGuess(){\n\tif ( isNaN(playersGuess) || playersGuess > 100 || playersGuess < 1) {\n\t\t$(\"label\").html(\"<h2>Please input a number between 1 and 100</h2>\");\n\t} else if (playersGuess === winningNumber){\n\t\t$(\"label\").html(\"<h2>You won!</h2>\");\n\t } else if(guessArray.includes(playersGuess) === true){ \n\t\t\t $(\"label\").html(\"<h2>You already guessed that, fool. Try again.</h2>\");\n\t\t\t} else if (numGuesses === 4){\n\t\t\t\t$(\"label\").html(\"<h2>You lost!</h2>\");\n\t\t\t\t$('[type=\"submit\"]').hide();\n\t\t\t\t$('[name=\"Button2\"]').hide();\n\t\t\t\t$(\"img\").toggle(\"puff\");\n\t\t\t\t} else {\n\t\t\t\t\t$(\"label\").html(\"<h2>Try again!</h2>\");\n\t\t\t\t\tnumGuesses++;\n\t\t\t\t\tguessArray.push(playersGuess);\n\t\t\t\t\talert(guessMessage());\n\t\t\t \t };\n}", "title": "" }, { "docid": "0d11e59c4a6f37e3806c7d93997e22c2", "score": "0.6781515", "text": "function winCheck() {\n if (blankString === currentChamp) {\n document.getElementById(\"hangman-img\").src = imgPaths[7];\n winCounter++;\n resetGame();\n } else if (badGuessCounter === 6) {\n resetGame();\n }\n}", "title": "" }, { "docid": "cff29a1066e7e3ce91b5e233c32e702a", "score": "0.6780251", "text": "function checkGuess(){\n if (playerGuess === winningNumber) {gameOver(true); return;}\n else if (guessesArray[playerGuess] === true) {\n // this number has already been guessed\n $('.left').find('p:first-child').text(\"You already guessed that!\" + \"\\n\" + \"You still have \"\n + guessesArray[0] + \" guesses left\");\n }\n else {\n // this is a brand new guess\n guessesArray[playerGuess] = true;\n guessesArray[0]--;\n $('.left').find('p').text(\"You have \" + guessesArray[0] + \" guesses left\");\n }\n // if the user has exhausted all of her guesses, the game is over\n if (guessesArray[0] === 0) {gameOver(false);}\n else {\n lowerOrHigher();\n updateTemperature();\n }\n }", "title": "" }, { "docid": "b14118292ea0f45f6319b69d341f1c28", "score": "0.6771631", "text": "function generator() {\n let numberToGuess = ''; // Erstellt eine Variable mit der zu erratenen Zahl\n currentQuestion = 0;\n for (let index = 0; index < mainLevel + 1; index++) {\n // erstellt eine Zufallszahl mit der Anzahl an ziffern der summe des Main Levels + 1\n let random = Math.round(Math.random() * (9 - 0)); // Generiert eine Ziffer zwischen 0 und 9 und wandelt diese in einen String um\n if (numberToGuess == '') {\n numberToGuess = numberToGuess + random; // Hängt die Zufallsziffer und hängt diese hinter den String\n } else {\n numberToGuess = numberToGuess + '+' + random;\n }\n currentQuestion = currentQuestion + random; // Macht die zu erratene zu einer Globalen variable\n }\n document.getElementById('guess').innerHTML = numberToGuess; // Zeigt die zu erratende Zahl in der DOM an\n}", "title": "" }, { "docid": "228d4dda8cba465d7e27349a4bdd42a6", "score": "0.67603993", "text": "function pickNewWinningNumber() {\n guessesRemaining = 9;\n userGuesses = [];\n currentLetter = winningLetters[Math.floor(Math.random() * winningLetters.length)];\n console.log(currentLetter);\n}", "title": "" }, { "docid": "82f6c8d3bc6d7d7894e763e979a5aa5f", "score": "0.675215", "text": "function rNumberPrint() {\n targetNumber = Math.floor(Math.random() * 101) + 19;\n $(\"#number-to-guess\").text(targetNumber);\n winsText.text(\"Wins: \" + wins);\n loseText.text(\"Losses: \" + losses);\n}", "title": "" }, { "docid": "1a6594a868655efe18ee07abb2ebd7f2", "score": "0.6740623", "text": "function checkWin() {\n if (score === goal) {\n wins++;\n $(\"#wins\").text(\"Wins: \" + wins);\n resetGame();\n } else if (score > goal) {\n losses++;\n $(\"#losses\").text(\"Losses: \" + losses);\n resetGame();\n }\n}", "title": "" }, { "docid": "5bdb64599ad70417423935dff968c817", "score": "0.67335886", "text": "function computerGuessGen() {\n\treturn Math.floor(Math.random() * answerArray.length);\n}", "title": "" }, { "docid": "e8fb1f9a7037ea2a179d9382da1061c9", "score": "0.67324615", "text": "function guessingGame() {\n\tvar randomNum = Math.floor(Math.random() * 100);\n\tvar guess = parseInt(prompt(\"Thinking of a number. Can you guess what it is?\"));\n\tif (guess == randomNum) {\n\t\talert(\"You got it! The number was \" + randomNum);\n\t} else {\n\t\twhile (guess > randomNum) {\n\t\t\tguess = parseInt(prompt(\"Too high, try again.\"));\n\t\t}\n\t\twhile (guess < randomNum) {\n\t\t\tguess = parseInt(prompt(\"Too low, try again.\"));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2292d7a95033622b644cfd458a2cf53b", "score": "0.6711333", "text": "function newGame() {\n\t\tisNewGame = false;\n\t\tuserSum = 0;\n\t\t// Generate a random number between 19 and 120.\n\t\t// This is the target number the user will try to equal.\n\t\tuserTargetScore = Math.floor(Math.random() * (120 - 19 + 1)) + 19;\n\t\t\n\t\t$(\"#displayTargetScore\").html(\"Target Score: \" + userTargetScore);\n\t\t$(\"#displayWins\").html(\"Wins: \" + userWins);\n\t\t$(\"#displayLosses\").html(\"Losses: \" + userLosses);\n\t\t$(\"#displayUserSum\").html(\"Total Score: \" + userSum);\n\t\t$(\"#wonLost\").html(\"\");\n\n\t\t//Generate 4 uniqe random numbers between 1 and 12\n\t\tcrystalPointValues = [0, 0, 0, 0];\n\t\tvar i;\n\t\tconsole.log(\"Generate 4 unique random numbers between 1 and 12:\");\n\t\tfor (i = 0; i < crystalPointValues.length; i++) {\n\t\t\tvar temp = 0;\n\t\t\ttemp = Math.floor(Math.random() * (12 - 1 + 1)) + 1;\n\t\t\tconsole.log(\"temp = \" + temp);\n\t\t\t// Eliminate Duplicate Crystal Point Values\n\t\t\tif (temp === crystalPointValues[0] ||\n\t\t\t\t\ttemp === crystalPointValues[1] ||\n\t\t\t\t\ttemp === crystalPointValues[2]) {\n\t\t\t\t\ti--;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcrystalPointValues[i] = temp;\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"crystalPointValues = \" + crystalPointValues);\n\t}", "title": "" }, { "docid": "ccb3f255376e5c0bab56fea44b12b77f", "score": "0.67010677", "text": "function randomWinScore () {\n\t\twinScore = Math.floor(Math.random() * 102) + 19;\n\t}", "title": "" }, { "docid": "d65810fa9da695260d61fdcb8c0a2a8b", "score": "0.6687563", "text": "function guessNumber() {\n let guess = Number(enterGuess.value);//!user guess\n console.log('guess:',guess)\n\n if(guess === randomNumber) {\n\n console.log(\"Congrats, You win\");\n }else if (guessCount ===3){\n console.log(\"Game Over\");\n }else {\n if(guess < randomNumber){\n console.log(\"Too Low\");\n }else if(guess>randomNumber){\n console.log(\"Too High\")\n }\n }\n \n \n \n \n \n // else if (guess < randomNumber) { //if g !== r, then need to go back to guess, while increasing guess count, until 3\n // console.log(\"You are too low\");\n // guessCount++;\n // }else if (guess> randomNumber){\n // console.log(\"You are too High\")\nguessCount++;\nconsole.log('count:',guessCount);\n}", "title": "" }, { "docid": "1a847039e15a0952f2d22ceeb142e039", "score": "0.668651", "text": "function submitGuess() {\n var realPlayerGuess = realNumber(guess);\n console.log(realPlayerGuess);\n console.log(randomNumber);\n if (realPlayerGuess === randomNumber) {\n innerText(feedback, 'You have guessed wisely!');\n disabled(newGameButton, false);\n disabled(guess, true);\n disabled(winText, false);\n disabled(rangeButton, false);\n clearPlace();\n changeRange();\n }\n else if (realPlayerGuess < randomNumber) {\n innerText(feedback, 'Sorry, that guess is too low. Try a higher number.');\n }\n else {\n innerText(feedback, 'Sorry, that guess is too high. Try a lower number.');\n }\n}", "title": "" }, { "docid": "46f445d33262aaa59c42f0e7509e7609", "score": "0.6684821", "text": "function computerGuess() {\n\tlet sumOfComputer = sumComputerInput();\n\tif (sumOfComputer === 0) {\n\t\t// Generate 0 or 5\n\t\tgame.computerGuess = generateNums(0);\n\t} else if (sumOfComputer === 5) {\n\t\t// Generate 5 or 10 \n\t\tgame.computerGuess = generateNums(5);\n\t} else if (sumOfComputer === 10) {\n\t\t// Generate 10 or 15\n\t\tgame.computerGuess = generateNums(10);\n\t} else {\n\t\t// Generate 15 or 20\n\t\tgame.computerGuess = generateNums(15);\n\t}\n}", "title": "" }, { "docid": "6c1eda3cb5b8c9bb785989da0077082e", "score": "0.6681287", "text": "function game(){\n \n playRound();\n\n let leaderboard = console.log(\"The computer has won \" + computerWinCount + \" times.\" + \" The player has won \" + playerWinCount + \" times.\");\n\n while ( computerWinCount < 5 && playerWinCount < 5 ){\n game();\n return leaderboard;\n };\n\n function playRound(playerSelection, computerSelection){\n //Use Math. random() function to get the random number between(0-1, 1 exclusive\n //Multiply it by the array length to get the numbers between(0-arrayLength).\n //Use Math. floor() to get the index ranging from(0 to arrayLength-1).\n \n let computerPlay = () =>{\n return gameChoices[Math.floor(Math.random() * gameChoices.length)];\n }\n computerSelection = computerPlay();\n playerSelection = prompt(\"What is your choice?: \");\n playerSelection = playerSelection.toLowerCase();\n \n if(gameChoices.includes(playerSelection) === true){\n determineWinner();\n } else {\n alert(\"Choose between: Rock, Paper, or Scissors.\")\n };\n\n function determineWinner(){\n if (playerSelection == \"rock\" && computerSelection == \"scissors\" || playerSelection == \"paper\" && computerSelection == \"rock\" || playerSelection == \"scissors\" && computerSelection == \"paper\" ){\n console.log(\"You have won!\");\n return playerWinCount++;\n } else if (playerSelection == \"rock\" && computerSelection == \"rock\" || playerSelection == \"paper\" && computerSelection == \"paper\" || playerSelection == \"scissors\" && computerSelection == \"scissors\" ){\n console.log(\"You have tied!\");\n } else {\n console.log(\"You have lost!\");\n return computerWinCount++;\n }\n };\n }\n}", "title": "" }, { "docid": "4efcbafc82315b85764dc04c6a57c586", "score": "0.66693175", "text": "function roundComplete() {\n\n // First, log an initial status update in the console telling us how many wins, losses, and guesses are left.\n console.log(\"WinCount: \" + wins + \" | LossCount: \" + losses + \" | Number of Guesses: \" + numGuess);\n\n // Update the HTML to reflect the new number of guesses. Also update the correct guesses.\n document.getElementById(\"guess-left\").innerHTML = numGuess;\n // This will print the array of guesses and blanks onto the page.\n document.getElementById(\"magic-word\").innerHTML = blanksNletters.join(\" \");\n // This will print the wrong guesses onto the page.\n document.getElementById(\"bad-word\").innerHTML = wrongGuess.join(\" \");\n\n // If we have gotten all the letters to match the solution...\n if (letterInChosenWord.toString() === blanksNletters.toString()) {\n // ..add to the win counter & give the user an alert.\n wins++;\n alert(\"You win!\");\n\n // Update the win counter in the HTML & restart the game.\n document.getElementById(\"win-counter\").innerHTML = wins;\n startGame();\n }\n\n // If we've run out of guesses..\n else if (numGuess === 0) {\n // Add to the loss counter.\n losses++;\n // Give the user an alert.\n alert(\"You lose\");\n\n // Update the loss counter in the HTML.\n document.getElementById(\"loss-counter\").innerHTML = losses;\n // Restart the game.\n startGame();\n }\n\n}", "title": "" }, { "docid": "6d44e4e79b721a7b2630c9c045dc7a44", "score": "0.6668575", "text": "function guess() {\n var random = Math.random() * 6;\n random = (Math.floor(random));\n return random;\n}", "title": "" }, { "docid": "ec7e5f826164d9e80f912d4bb9156607", "score": "0.66517806", "text": "function didUserWinRound() {\n var didWin = false;\n for (var m = 0; m < randomBowieWordArrayNew.length; m++) {\n if (randomBowieWordArrayNew[m] === \"_\") {\n didWin = false;\n break\n } else {\n didWin = true;\n }\n }\n\n // if user won reset game\n if (didWin === true) {\n // alert(\"won game!\")\n wordText.innerHTML = (\"\");\n randomBowieWordArrayBlank = [];\n startGame();\n wins++;\n winsText.innerHTML = (wins);\n guessesInWord = [];\n lettersGuessed = [];\n lettersGuessedText.innerHTML = (lettersGuessed);\n guessesRemaining = 12;\n guessesRemainingText.innerHTML = guessesRemaining;\n startGameText.innerHTML = (\"You did it!\")\n\n }\n\n }", "title": "" }, { "docid": "da3ab6a43a4701cb4cb3096d1d675521", "score": "0.6648152", "text": "function newGame() {\n clearTable(); // Remove all previous elements from the game table.\n $('#result-msg').html(\"\");\n $('#user-guess').val(\"\");\n\n // Generate a new number and reset all variables.\n secret = pickRandomNumber();\n currentAttempt = 1;\n won = false;\n lost = false;\n}", "title": "" }, { "docid": "f0fe1f54ad6561a91bc68385c5eaf407", "score": "0.66470695", "text": "function blackJack() {\n\n //win\n if (totalScore === randomNumber){\n alert(\"win ;)\");\n winCount++;\n $(\"#win-count\").text(winCount);\n console.log(\"wins\", winCount);\n newSearch();\n resetScore();\n }\n //lose\n else if (totalScore > randomNumber) {\n alert(\"lose :P\");\n lossCount++;\n $(\"#loss-count\").text(lossCount);\n console.log(\"losses\", lossCount);\n newSearch();\n resetScore();\n };\n }", "title": "" }, { "docid": "c35fdbf82405398bd72da900c2827836", "score": "0.664496", "text": "function newNumber(){\n guessNumber = Math.floor(Math.random() * (120 - 19) + 19);\n $(\"#numToMatch\").text(guessNumber);\n console.log(guessNumber);\n}", "title": "" }, { "docid": "32a22c97f36d2d965a03e25c65711e39", "score": "0.66445327", "text": "function playRound() {\r\n currentRound++;\r\n if (!isGameOver()) {\r\n console.log(\"\\n----------\\n Round \" + currentRound + \"\\n----------\\n\");\r\n promptGuess();\r\n } else {\r\n endGame();\r\n }\r\n}", "title": "" }, { "docid": "f0b425a0e50a7b87c642dd4b4cfe5a53", "score": "0.663542", "text": "function outcome() {\n if (rightguess === numBlanks) {\n wins++;\n document.getElementById('win').innerHTML = wins;\n alert('You Win!');\n reset();\n } else if (guesses === 0) {\n lost++;\n document.getElementById('loss').innerHTML = lost;\n alert('You Lost!');\n reset();\n }\n}", "title": "" }, { "docid": "e7972411d49af88e77d6e977a002f205", "score": "0.66307783", "text": "function checkGuess(){\n\t// add code here\n\tif(playersGuess === winningNumber) {\n\t\t$('#notification').text(\"You win!\");\n\t\t$('#notification').css({\n\t\t\t\"font-size\": \"120px\", \n\t\t\t\"font-family\": \"Verdana\",\n\t\t\t\"font-weight\": \"bolder\",\n\t\t\t\"color\": \"#DFDB51\"})\n\t\t$('#trys').css(\"display\", \"none\");\n\t\t$('#playersInput').css(\"display\", \"none\");\n\t\t$('#submitButton').css(\"display\", \"none\");\n\t\t$('#resetButton').css(\"display\", \"none\");\n\t\t$('#hintButton').css(\"display\", \"none\");\n\t\t$('#playAgainButton').css(\"display\", \"block\");\n\t\t$('#mainArea').css(\"background-color\", \"#1E4617\");\n\t\t$('h1').css(\"color\", \"#8F7F55\");\n\t\t$('#playAgainButton').css({\n\t\t\t\"color\": \"#1E4617\",\n\t\t\t\"background-color\": \"#DFDB51\"})\n\t\tblink();\n\t}\n\telse {\n\t\tif (guessArray.indexOf(playersGuess) === -1) {\n\t\t\tguessArray.push(playersGuess);\n\t\t\tguessCount += 1;\n\t\t\t\tif(guessCount === 5) {\n\t\t\t\t\tyouLose();\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$('#notification').text(guessMessage());\n\t\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$('#notification').text(\"Submitted a duplicate guess. Try again.\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a1aa35e0adcfb4c7591ca00ec9842cda", "score": "0.6622647", "text": "function guess()\n\t{\n\t\tvar ans = document.getElementById(\"ans\");\n\t\tvar rnum = Math.ceil(Math.random() * 100);\n\t\tvar unum = parseInt(prompt(\"Pick a num between 1 & 10\"));\n\t\tvar img = document.getElementById('img');\n\t\tvar count = 0;\n\t\t\n\t\twhile(unum!=rnum & count<6)\n\t\t{\n\t\t\tif(isNaN(unum))\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t\tconsole.log(rnum);\n\t\t\t\t\tunum = parseInt(prompt(\"You did not enter a valid number. Try again! - Pick a num between 1 & 100 - You have \"+(6-count)+\" lives left!!\"));\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcount++;\n\t\t\t\t\tconsole.log(rnum);\n\t\t\t\t\tif (unum<rnum)\n\t\t\t\t\t{\n\t\t\t\t\t\tunum = parseInt(prompt(\"Too low :) Try again! - Pick a num between 1 & 100 - You have \"+(6-count)+\" lives left!!\"));\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\tunum = parseInt(prompt(\"Too big ;) Try again! - Pick a num between 1 & 100 - You have \"+(6-count)+\" lives left!!\"));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\tif(unum==rnum)\n\t\t\t{\n\t\t\t\timg.src = \"/Git-Repository-Proj/labSem1/img/happy.gif\";\n\t\t\t\timg.width = \"100\";\n\t\t\t\tconsole.log(img);\n\t\t\t\timg.height = \"100\";\n\t\t\t\tans.innerHTML=\"Good Guess!! The number was \"+rnum;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tans.innerHTML=\"Your six goes are up!! The num was \"+rnum;\n\t\t\t}\n\t}", "title": "" }, { "docid": "8ebf017a34ea828b7bb3cd208339df21", "score": "0.6622093", "text": "function winloss() {\n if (currentNum === randomNum) {\n alert(\"Great Job! You got exactly \" + randomNum + \" !\");\n wins++;\n console.log(\"Wins: \" + wins);\n $(\"#wins\").text(\"Wins: \" + wins);\n alert(\"The Numbers have been reset, Let's play again!\");\n currentNum = 0;\n $(\"#currentNum\").text(currentNum);\n resetNum();\n } \n \n else if (currentNum > randomNum) {\n alert(\"Oh no! You went too high above the target number!\");\n losses++;\n $(\"#losses\").text(\"Losses: \" + losses);\n console.log(\"Losses: \" + losses);\n alert(\"The Numbers have been reset, try again!\");\n currentNum = 0;\n $(\"#currentNum\").text(currentNum);\n resetNum();\n }\n\n //End of winloss Function\n }", "title": "" }, { "docid": "2baa33cf27ce1f5fc2fe96bdcfbabe02", "score": "0.6613741", "text": "function generateHint() {\n if (guessesArray[0] < 3) {\n var h = \"The number is between \";\n h += 10 * Math.floor(winningNumber/10);\n h += \" and \";\n h += 10 * (Math.floor(winningNumber/10)) + 9;\n }\n else {\n var n = Math.floor(Math.random()*10 + 1);\n var divisBool = winningNumber % n === 0;\n var h = \"The number is \";\n h += (divisBool) ? \"\" : \"not\";\n h += \" divisible by \";\n h += n;\n }\n return h;\n }", "title": "" }, { "docid": "9faec5c0aba14795bb1bc9b0becf3ffe", "score": "0.6613012", "text": "function getRandomWinningNumbers() {\n var randomIndex = Math.floor(Math.random() * possUserNumbs.length);\n return possUserNumbs.splice(randomIndex, 1)[0];\n }", "title": "" } ]
16e1c4d4bec82a0ecc9e9abe889b37d6
Expression parsing These nest, from the most general expression type at the top to 'atomic', nondivisible expression types at the bottom. Most of the functions will simply let the function(s) below them parse, and, if the syntactic construct they handle is present, wrap the AST node that the inner parser gave them in another node. Parse a full expression. The arguments are used to forbid comma sequences (in argument lists, array literals, or object literals) or the `in` operator (in for loops initalization expressions).
[ { "docid": "ebc787269c963f90b6095c13c3f09fa1", "score": "0.6219504", "text": "function parseExpression(noComma, noIn) {\n var expr = parseMaybeAssign(noIn);\n if (!noComma && tokType === _comma) {\n var node = startNodeFrom(expr);\n node.expressions = [expr];\n while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn));\n return finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }", "title": "" } ]
[ { "docid": "1c0c0adf408bda60031cdd196860593e", "score": "0.66974956", "text": "parseExpression(inst, ignore_chunks) {\n ignore_chunks = ensureArray(ignore_chunks)\n inst = removeEmptyLines(inst)\n\n if(!inst)\n return false\n\n let exp = false\n\n if(!~ignore_chunks.indexOf('assign'))\n exp = syntax.parseAssign(inst)\n\n if(!exp && !~ignore_chunks.indexOf('math_operation'))\n exp = syntax.parseMathOperation(inst)\n\n if(!exp && !~ignore_chunks.indexOf('func_call'))\n exp = syntax.parseFuncCall(inst)\n\n if(!exp && !~ignore_chunks.indexOf('func_def'))\n exp = syntax.parseFuncDef(inst)\n\n if(!exp && !~ignore_chunks.indexOf('primitive'))\n exp = syntax.parsePrimitive(inst)\n\n if(!exp && !~ignore_chunks.indexOf('variable'))\n exp = syntax.parseVariable(inst)\n\n if(!~ignore_chunks.indexOf('ext'))\n exp = syntax.extendExpression(exp)\n\n if(exp)\n exp.remain = removeEmptyLines(exp.remain)\n\n return exp\n }", "title": "" }, { "docid": "9e0f6af90c3101816c73e429504d34a5", "score": "0.6433523", "text": "function handleExtendedExpressions(ast = false) {\n return init => {\n const processed = flatten(init).filter(v => v !== \"\")\n\n if (ast) {\n const value = processed.map(value =>\n typeof value === \"string\"\n ? operatorsList.includes(value)\n ? { type: \"operator\", value }\n : { type: \"whitespace\", value }\n : value,\n )\n\n return {\n type: \"expression\",\n value,\n }\n }\n\n const [first, ...rest] = processed.filter(\n value => typeof value !== \"string\" || operatorsList.includes(value),\n )\n\n if (rest.length === 0) return first\n\n const grouped = rest.reduce((acc, next, index) => {\n const ind = quotient(index, 2)\n if (!acc[ind]) acc[ind] = []\n acc[ind].push(next)\n return acc\n }, [])\n\n return grouped.reduce(\n (current, [op, val]) => handleExpression([current, op, val]),\n first,\n )\n }\n}", "title": "" }, { "docid": "442aeadcde3a3e8db0997839a585b35f", "score": "0.6428875", "text": "function parseExpression() {\n var expr, startToken = lookahead, expressions;\n\n expr = isolateCoverGrammar(parseAssignmentExpression);\n\n if (match(',')) {\n expressions = [expr];\n\n while (startIndex < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n }\n\n expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n }\n\n return expr;\n }", "title": "" }, { "docid": "442aeadcde3a3e8db0997839a585b35f", "score": "0.6428875", "text": "function parseExpression() {\n var expr, startToken = lookahead, expressions;\n\n expr = isolateCoverGrammar(parseAssignmentExpression);\n\n if (match(',')) {\n expressions = [expr];\n\n while (startIndex < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n }\n\n expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n }\n\n return expr;\n }", "title": "" }, { "docid": "442aeadcde3a3e8db0997839a585b35f", "score": "0.6428875", "text": "function parseExpression() {\n var expr, startToken = lookahead, expressions;\n\n expr = isolateCoverGrammar(parseAssignmentExpression);\n\n if (match(',')) {\n expressions = [expr];\n\n while (startIndex < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n }\n\n expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n }\n\n return expr;\n }", "title": "" }, { "docid": "442aeadcde3a3e8db0997839a585b35f", "score": "0.6428875", "text": "function parseExpression() {\n var expr, startToken = lookahead, expressions;\n\n expr = isolateCoverGrammar(parseAssignmentExpression);\n\n if (match(',')) {\n expressions = [expr];\n\n while (startIndex < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n }\n\n expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n }\n\n return expr;\n }", "title": "" }, { "docid": "442aeadcde3a3e8db0997839a585b35f", "score": "0.6428875", "text": "function parseExpression() {\n var expr, startToken = lookahead, expressions;\n\n expr = isolateCoverGrammar(parseAssignmentExpression);\n\n if (match(',')) {\n expressions = [expr];\n\n while (startIndex < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n }\n\n expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n }\n\n return expr;\n }", "title": "" }, { "docid": "e31f271435bd2cba37425035be2b755e", "score": "0.6369007", "text": "function parseExpression() {\n\t var expr, startToken = lookahead, expressions;\n\n\t expr = isolateCoverGrammar(parseAssignmentExpression);\n\n\t if (match(',')) {\n\t expressions = [expr];\n\n\t while (startIndex < length) {\n\t if (!match(',')) {\n\t break;\n\t }\n\t lex();\n\t expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n\t }\n\n\t expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n\t }\n\n\t return expr;\n\t }", "title": "" }, { "docid": "e31f271435bd2cba37425035be2b755e", "score": "0.6369007", "text": "function parseExpression() {\n\t var expr, startToken = lookahead, expressions;\n\n\t expr = isolateCoverGrammar(parseAssignmentExpression);\n\n\t if (match(',')) {\n\t expressions = [expr];\n\n\t while (startIndex < length) {\n\t if (!match(',')) {\n\t break;\n\t }\n\t lex();\n\t expressions.push(isolateCoverGrammar(parseAssignmentExpression));\n\t }\n\n\t expr = new WrappingNode(startToken).finishSequenceExpression(expressions);\n\t }\n\n\t return expr;\n\t }", "title": "" }, { "docid": "c58ae1fa90c6df20da4ddfad56ac6345", "score": "0.63578695", "text": "function parseExpression(raw) {\n\t\tvar openChars = \"{([#'\\\"\";\n\t\tvar closeChars = \"})]#'\\\"\";\n\t\traw = raw.trim();\n\n\n\t\tvar indices = getUnprotectedIndices(raw, [\" if \", \"==\", \"!=\", \"<=\", \">=\", \"<\", \">\", \"+\", \"-\", \"*\", \"/\", \"%\", \"^\"], openChars, closeChars);\n\n\n\t\t// Create an expression tree\n\t\tif (indices.length > 0) {\n\n\t\t\tvar parsed = createNode(raw, \"expression\");\n\n\n\t\t\tvar priority = 999;\n\t\t\tvar splitter;\n\t\t\tfor (var i = 0; i < indices.length; i++) {\n\t\t\t\tif (indices[i].queryIndex < priority) {\n\t\t\t\t\tsplitter = indices[i];\n\t\t\t\t\tpriority = splitter.queryIndex;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// (bar) if (foo) else if (foo) else if (bar) else (boo);\n\t\t\tif (splitter.query === \" if \") {\n\t\t\t\tvar postIf = raw.substring(splitter.index + splitter.query.length);\n\n\t\t\t\tparsed.expressionType = \"if\";\n\t\t\t\tparsed.trueValue = parseExpression(raw.substring(0, splitter.index));\n\n\t\t\t\tvar elseIndexes = getUnprotectedIndices(postIf, \" else \", openChars, closeChars);\n\t\t\t\tif (elseIndexes.length > 0) {\n\n\t\t\t\t\tvar elseIndex = elseIndexes[0].index;\n\n\t\t\t\t\tvar condRaw = postIf.substring(0, elseIndex);\n\t\t\t\t\tvar elseRaw = postIf.substring(elseIndex + \" else \".length);\n\t\t\t\t\tparsed.condition = parseExpression(condRaw);\n\t\t\t\t\tparsed.elseValue = parseExpression(elseRaw);\n\t\t\t\t} else {\n\t\t\t\t\tparsed.condition = parseExpression(postIf);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// NON-IF expression splitter\n\t\t\t\t// TODO, disambiguate ! and -\n\t\t\t\tparsed.expressionType = \"operator\";\n\t\t\t\tparsed.operator = createNode(splitter.query, \"op\");\n\n\n\n\t\t\t\tvar lhs = raw.substring(0, splitter.index).trim();\n\t\t\t\tvar rhs = raw.substring(splitter.index + splitter.query.length).trim();\n\n\n\t\t\t\tif (parsed.operator.finished === \"-\" && lhs === \"\") {\n\t\t\t\t\tparsed.operator.finished = \"NEG\";\n\t\t\t\t}\n\t\t\t\tparsed.lhs = parseExpression(lhs);\n\t\t\t\tparsed.rhs = parseExpression(rhs);\n\t\t\t}\n\n\n\t\t\treturn parsed;\n\n\n\t\t} else {\n\n\t\t\t// Single expression\n\t\t\tvar sections = splitIntoTopSections(raw, \"|[('\\\"#\", {\n\t\t\t\topenChars: openChars,\n\t\t\t\tcloseChars: closeChars\n\t\t\t});\n\t\t\tif (sections.length === 0) {\n\t\t\t\t//console.warn(\"Empty sections\");\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\t// Function\n\t\t\tif (sections.length > 1) {\n\t\t\t\treturn parseAddress(raw, \"function\");\n\t\t\t} else {\n\t\t\t\tvar c = sections[0].openChar;\n\t\t\t\tvar inner = sections[0].inner;\n\n\t\t\t\tswitch (c) {\n\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\treturn parseRule(inner);\n\n\t\t\t\t\tcase \"\\\"\":\n\t\t\t\t\t\treturn parseRule(inner);\n\n\t\t\t\t\tcase \"#\":\n\t\t\t\t\t\treturn parseTag(inner);\n\n\t\t\t\t\tcase \"[\":\n\t\t\t\t\t\treturn parseRuleGenerator(inner);\n\n\t\t\t\t\tcase \"(\":\n\t\t\t\t\t\treturn parseExpression(inner);\n\n\n\t\t\t\t\tcase undefined:\n\t\t\t\t\t\t// Bare\n\t\t\t\t\t\tvar v = parseFloat(inner);\n\t\t\t\t\t\tif (!isNaN(v)) {\n\t\t\t\t\t\t\treturn v;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Assume a key?\n\t\t\t\t\t\t\treturn parseTag(inner);\n\t\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tconsole.warn(\"Unknown expression type \" + inQuotes(raw));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconsole.warn(\"Unknown expression type \" + inQuotes(raw));\n\t}", "title": "" }, { "docid": "e81beaecb8178f9ee8804636f0dc5904", "score": "0.6240888", "text": "function parse$2(expr) {\n const scanner = typeof expr === 'string' ? new Scanner(expr) : expr;\n let ch;\n let priority = 0;\n let expected = (1 /* Primary */ | 4 /* LParen */ | 16 /* Sign */ );\n const tokens = [];\n while (!scanner.eof()) {\n scanner.eatWhile(isWhiteSpace);\n scanner.start = scanner.pos;\n if (consumeNumber$1(scanner)) {\n if ((expected & 1 /* Primary */ ) === 0) {\n error$2('Unexpected number', scanner);\n }\n tokens.push(number(scanner.current()));\n expected = (2 /* Operator */ | 8 /* RParen */ );\n } else if (isOperator$3(scanner.peek())) {\n ch = scanner.next();\n if (isSign(ch) && (expected & 16 /* Sign */ )) {\n if (isNegativeSign(ch)) {\n tokens.push(op1(ch, priority));\n }\n expected = (1 /* Primary */ | 4 /* LParen */ | 16 /* Sign */ );\n } else {\n if ((expected & 2 /* Operator */ ) === 0) {\n error$2('Unexpected operator', scanner);\n }\n tokens.push(op2(ch, priority));\n expected = (1 /* Primary */ | 4 /* LParen */ | 16 /* Sign */ );\n }\n } else if (scanner.eat(40 /* LeftParenthesis */ )) {\n if ((expected & 4 /* LParen */ ) === 0) {\n error$2('Unexpected \"(\"', scanner);\n }\n priority += 10;\n expected = (1 /* Primary */ | 4 /* LParen */ | 16 /* Sign */ | 32 /* NullaryCall */ );\n } else if (scanner.eat(41 /* RightParenthesis */ )) {\n priority -= 10;\n if (expected & 32 /* NullaryCall */ ) {\n tokens.push(nullary);\n } else if ((expected & 8 /* RParen */ ) === 0) {\n error$2('Unexpected \")\"', scanner);\n }\n expected = (2 /* Operator */ | 8 /* RParen */ | 4 /* LParen */ );\n } else {\n error$2('Unknown character', scanner);\n }\n }\n if (priority < 0 || priority >= 10) {\n error$2('Unmatched \"()\"', scanner);\n }\n const result = orderTokens(tokens);\n if (result === null) {\n error$2('Parity', scanner);\n }\n return result;\n }", "title": "" }, { "docid": "33d251e050f3c72d824a09acd19eb7d5", "score": "0.6206533", "text": "function parse_Expression() {\n var debug = tstart('parse_Expression');\n\n var a = parse_Expression1();\n if (!a) return tend(debug, null);\n\n var b = parse_AssignmentOperator();\n if (!b) return tend(debug, a);\n\n var c = expect(parse_Expression1(),\n 'Expected expression.');\n\n return tend(debug, {\n token: b.type,\n kind: 'assignment',\n location: a, // TODO: rename location to leftHandSide\n new_value: c // TODO: rename new_value to AssignmentExpression\n });\n\n }", "title": "" }, { "docid": "1d7a64e8c2d9714c529ef2c2b8c10d7f", "score": "0.61902016", "text": "function parseExpression(noComma, noIn) {\n var start = storeCurrentPos();\n var expr = parseMaybeAssign(noIn);\n if (!noComma && tokType === _comma) {\n var node = startNodeAt(start);\n node.expressions = [expr];\n while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn));\n return finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }", "title": "" }, { "docid": "1d7a64e8c2d9714c529ef2c2b8c10d7f", "score": "0.61902016", "text": "function parseExpression(noComma, noIn) {\n var start = storeCurrentPos();\n var expr = parseMaybeAssign(noIn);\n if (!noComma && tokType === _comma) {\n var node = startNodeAt(start);\n node.expressions = [expr];\n while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn));\n return finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }", "title": "" }, { "docid": "5d536526e888fafb241d6a2e9ea885ab", "score": "0.61815834", "text": "function next_expr(tokens) {\n var expression = [tokens.shift()];\n var nests = 0;\n while (tokens[0] !== \")\" || nests !== 0) {\n var token = tokens.shift();\n if (tokens.length === 0) {\n throw new SyntaxError(\"unexpected EOF missing )\");\n }\n if (token === \"(\") {\n nests++;\n } else if (token === \")\") {\n nests--;\n }\n expression.push(token);\n }\n expression.push(tokens.shift()); // push last \")\"\n return expression;\n}", "title": "" }, { "docid": "feef374094d4bc82b8f61d9fb5383907", "score": "0.61435765", "text": "function parseExpression(noComma, noIn, isStatement) {\n var start = storeCurrentPos();\n var expr = parseMaybeAssign(noIn, false, isStatement);\n if (!noComma && tokType === _comma) {\n var node = startNodeAt(start);\n node.expressions = [expr];\n while (eat(_comma)) node.expressions.push(parseMaybeAssign(noIn));\n return finishNode(node, \"SequenceExpression\");\n }\n return expr;\n }", "title": "" }, { "docid": "3fd7c5ad134fc962d5cd04651fad1d62", "score": "0.61420846", "text": "function parseExpression(state, noIn) {\n var expr = parseMaybeAssign(state, noIn);\n if (state.tokType === state._comma) {\n var node = new ParserAPI.node.SequenceExpression();\n node.expressions.push(expr);\n while (state.tokType === state._comma) {\n next(state);\n node.expressions.push(parseMaybeAssign(state, noIn));\n }\n return node;\n }\n return expr;\n }", "title": "" }, { "docid": "6a7816042b7e22a5f99b5a6df8bc5ae7", "score": "0.60983676", "text": "function parse(input,options){return new Parser(options,input).parse();}// This function tries to parse a single expression at a given", "title": "" }, { "docid": "d9ca4ba16ca655c7f5ecae8807843874", "score": "0.60761976", "text": "function parseExprTree(env, scope, exprTree) {\n // console.log(JSON.stringify(exprTree));\n var i;\n if (typeof(exprTree) == \"string\") { // initialize variable\n var type = \"undefined\";\n if (!isNaN(exprTree)) type = \"number\";\n else if (exprTree[0] == \"\\\"\") type = \"string\";\n var value = exprTree;\n if (type == \"number\") value = parseFloat(exprTree);\n else if (type == \"undefined\") {\n if (env.data[exprTree] == undefined) value = \"undefined\";\n else {\n value = env.data[exprTree].type;\n type = env.data[exprTree].type;\n }\n }\n var ret = {type: type, value: value};\n if (type == \"undefined\") {\n ret.name = exprTree;\n env.data[exprTree] = ret;\n }\n return ret;\n } else if (typeof(exprTree) == \"object\" && exprTree.length == 1) return parseExprTree(env, scope, exprTree[0]);\n\n for (i = (typeof(exprTree[0]) == \"object\" ? 0 : 1); i < exprTree.length; i++)\n exprTree[i] = parseExprTree(env, scope, exprTree[i]);\n // console.log(\"\\t\" + JSON.stringify(exprTree));\n if (typeof(exprTree[0]) == \"string\") {\n if (env.definitions[exprTree[0]] == undefined) {\n console.warn(\"no definition for keyword: %s\", JSON.stringify(exprTree[0]));\n exprTree.splice(0, 1);\n } else exprTree = env.definitions[exprTree[0]].apply(this, exprTree.slice(1));\n }\n if (typeof(exprTree) == \"object\" && exprTree.length == 1) exprTree = exprTree[0];\n // console.log(\"\\t\\t\" + JSON.stringify(exprTree));\n return exprTree;\n}", "title": "" }, { "docid": "144423f7847d81d5d22e655cbdfa5a77", "score": "0.6035472", "text": "function parseExpression(expression)\n{\n let comp = [];\n let precedenceCount = [0, 0, 0];\n\n let i = 0;\n while(i < expression.length)\n {\n let currChar = expression.charAt(i);\n\n //term is in parentheses, push that whole expression\n if(currChar == \"(\")\n {\n let inParentheses\n = extractOutermostGroup(expression.substring(i), \"(\", \")\");\n comp.push(inParentheses);\n //jump to the index after the expression\n i += (inParentheses.length - 1)\n }\n\n //operator, push and update precedence\n else if(operators.includes(currChar))\n {\n //check for operator with 2 characters\n if(i < expression.length - 1)\n {\n if(expression.substring(i, i+2) === \"**\") { currChar = \"**\"; }\n else if(expression.substring(i, i+2) === \"//\")\n { currChar = \"//\"; }\n }\n //negative number\n if(currChar === \"-\" && comp.length % 2 == 0)\n {\n let iBefore = i;\n i++;\n while(i < expression.length\n && !(expression.charAt(i) === \" \")\n && !(operators.includes(expression.charAt(i)))) { i++; }\n comp.push(expression.substring(iBefore, i));\n continue;\n }\n comp.push(currChar);\n\n //update precedence\n for(let j = 0; j < precedence.length; j++)\n {\n if(precedence[j].includes(currChar))\n {\n precedenceCount[j]++;\n break;\n }\n }\n\n //update index for 2-character operator\n if(currChar.length == 2) { i++; }\n }\n\n //space, do nothing\n else if(currChar === \" \") { }\n\n //beginning of a term, add it to the list\n else\n {\n let startsFrom = expression.substring(i);\n\n let j = 1;\n //look for space or operator\n for(j = 1; j < startsFrom.length; j++)\n {\n if(startsFrom[j] === \"(\") //must be a function call\n {\n j += (extractOutermostGroup(\n startsFrom.substring(j), \"(\", \")\").length - 1);\n }\n //at end of term\n else if(startsFrom[j] === \" \"\n || operators.includes(startsFrom[j]))\n {\n break;\n }\n }\n let termLength = j;\n let term = startsFrom.substring(0, termLength);\n\n comp.push(term); //add term to list\n\n //jump to index after the term\n i += (termLength - 1);\n }\n\n i++;\n }\n\n return [comp, precedenceCount];\n\n}", "title": "" }, { "docid": "03ef9eeb17e8739c67b26e904403f859", "score": "0.5951511", "text": "function parse_expression() {\n\tvar expr = $(\"#expr\").val();\t\n\tvar input = expr.split('');\n\tvar value = [];\n\tvar values = [];\n\tvar ops = [];\n\tfor (var i = 0; i < input.length; i++) {\n\t\tvar c = input[i];\n\t\tif (c == \".\" || jQuery.isNumeric(c)) {\n\t\t\tvalue[value.length] = c;\n\t\t} else if (c == \"*\" || c == \"+\" || c == \"/\") {\n\t\t\tops[ops.length] = c;\n\t\t\tvalues[values.length] = value.join('');\n\t\t\tvalue = [];\n\t\t} else if (c == \"-\" && jQuery.isNumeric(input[i-1])) {\n\t\t\tops[ops.length] = c;\n\t\t\tvalues[values.length] = value.join('');\n\t\t\tvalue = [];\n\t\t} else if (c == \"-\") {\n\t\t\tvalue[value.length] = c;\n\t\t} else {\n\t\t\tthrow new Error(\"can't parse this\");\n\t\t}\n\t}\n\t// add the last value\n\tvalues[values.length] = value.join('');\n\treturn([ops, values]);\t\n\t\n}", "title": "" }, { "docid": "718227955a64f52360c296d95c0a6fe4", "score": "0.59459454", "text": "function toExpression(expr) {\n if (isString(expr))\n return toEntity(expr);\n\n switch (expr.type.toLowerCase()) {\n case 'aggregate':\n return expr.aggregation.toUpperCase() +\n '(' + (expr.distinct ? 'DISTINCT ' : '') + toExpression(expr.expression) +\n (expr.separator ? '; SEPARATOR = ' + toEntity('\"' + expr.separator + '\"') : '') + ')';\n case 'functioncall':\n return toEntity(expr.function) + '(' + mapJoin(expr.args, toExpression, ', ') + ')';\n case 'operation':\n var operator = expr.operator.toUpperCase(), args = expr.args || [], arg = args[0];\n switch (expr.operator.toLowerCase()) {\n // Infix operators\n case '<':\n case '>':\n case '>=':\n case '<=':\n case '&&':\n case '||':\n case '=':\n case '!=':\n case '+':\n case '-':\n case '*':\n case '/':\n return mapJoin(args, function (arg) {\n return isString(arg) ? toEntity(arg) : '(' + toExpression(arg) + ')';\n }, ' ' + operator + ' ');\n // Unary operators\n case '!':\n return '!' + toExpression(arg);\n // IN and NOT IN\n case 'notin':\n operator = 'NOT IN';\n case 'in':\n return toExpression(arg) + ' ' + operator +\n '(' + (isString(arg = args[1]) ? arg : mapJoin(arg, toExpression, ', ')) + ')';\n // EXISTS and NOT EXISTS\n case 'notexists':\n operator = 'NOT EXISTS';\n case 'exists':\n return operator + ' ' + patterns.group(arg, true);\n // Other expressions\n default:\n return operator + '(' + mapJoin(args, toExpression, ', ') + ')';\n }\n default:\n throw new Error('Unknown expression type: ' + expr.type);\n }\n}", "title": "" }, { "docid": "718227955a64f52360c296d95c0a6fe4", "score": "0.59459454", "text": "function toExpression(expr) {\n if (isString(expr))\n return toEntity(expr);\n\n switch (expr.type.toLowerCase()) {\n case 'aggregate':\n return expr.aggregation.toUpperCase() +\n '(' + (expr.distinct ? 'DISTINCT ' : '') + toExpression(expr.expression) +\n (expr.separator ? '; SEPARATOR = ' + toEntity('\"' + expr.separator + '\"') : '') + ')';\n case 'functioncall':\n return toEntity(expr.function) + '(' + mapJoin(expr.args, toExpression, ', ') + ')';\n case 'operation':\n var operator = expr.operator.toUpperCase(), args = expr.args || [], arg = args[0];\n switch (expr.operator.toLowerCase()) {\n // Infix operators\n case '<':\n case '>':\n case '>=':\n case '<=':\n case '&&':\n case '||':\n case '=':\n case '!=':\n case '+':\n case '-':\n case '*':\n case '/':\n return mapJoin(args, function (arg) {\n return isString(arg) ? toEntity(arg) : '(' + toExpression(arg) + ')';\n }, ' ' + operator + ' ');\n // Unary operators\n case '!':\n return '!' + toExpression(arg);\n // IN and NOT IN\n case 'notin':\n operator = 'NOT IN';\n case 'in':\n return toExpression(arg) + ' ' + operator +\n '(' + (isString(arg = args[1]) ? arg : mapJoin(arg, toExpression, ', ')) + ')';\n // EXISTS and NOT EXISTS\n case 'notexists':\n operator = 'NOT EXISTS';\n case 'exists':\n return operator + ' ' + patterns.group(arg, true);\n // Other expressions\n default:\n return operator + '(' + mapJoin(args, toExpression, ', ') + ')';\n }\n default:\n throw new Error('Unknown expression type: ' + expr.type);\n }\n}", "title": "" }, { "docid": "0005fb0ab9304679ae6fccc8d4fff9f8", "score": "0.59417206", "text": "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "title": "" }, { "docid": "0005fb0ab9304679ae6fccc8d4fff9f8", "score": "0.59417206", "text": "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "title": "" }, { "docid": "0005fb0ab9304679ae6fccc8d4fff9f8", "score": "0.59417206", "text": "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "title": "" }, { "docid": "0005fb0ab9304679ae6fccc8d4fff9f8", "score": "0.59417206", "text": "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "title": "" }, { "docid": "0005fb0ab9304679ae6fccc8d4fff9f8", "score": "0.59417206", "text": "function nestExpr(e) { return \"(function() { return \" + code + \"; })()\"; }", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.5940233", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.5940233", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.5940233", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.5940233", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.5940233", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "3e2b9cf233da5821686059a6df6c7515", "score": "0.5940233", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false) {\n {\n if ((true)) {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "6cddc38fa61f069bb17f22b8be6f5a48", "score": "0.5918411", "text": "function parseTopLevel() {\n lastStart = lastEnd = tokPos;\n inFunction = strict = null;\n labels = [];\n readToken();\n return parseExpression();\n }", "title": "" }, { "docid": "6cddc38fa61f069bb17f22b8be6f5a48", "score": "0.5918411", "text": "function parseTopLevel() {\n lastStart = lastEnd = tokPos;\n inFunction = strict = null;\n labels = [];\n readToken();\n return parseExpression();\n }", "title": "" }, { "docid": "52595a4f4d2b96b8a44641bd9a7d94ff", "score": "0.5912952", "text": "function readExpression(parsingInfo) {\n var tokenStream = parsingInfo.tokenStream;\n var syntax = parsingInfo.syntax;\n var token = tokenStream.peek();\n var nextToken;\n if (!token) {\n return null;\n }\n // If it is a lone variable then it will be evaluated.\n if (isIdentifier(token)) {\n if (!isSyntaticKeyword(syntax, token)) {\n tokenStream.advance();\n return ast.createVariable(token.value);\n }\n else {\n raiseSyntaxError(parsingInfo, 'syntax_keywords_as_variables');\n }\n }\n // Checks if it is a self-evaluating expression, e.g. a string literal.\n if (isSelfEvaluating(token)) {\n tokenStream.advance();\n return ast.createLiteral(token.type, token.value);\n }\n // If it is an openning vector parenthesis then reads the whole vector.\n if (token.type === TokenTypes.vectorParen) {\n tokenStream.advance();\n return quote.readVectorDatum(parsingInfo);\n }\n // If it is a quotation then reads the quoted datum.\n if (token.type === TokenTypes.quote) {\n tokenStream.advance();\n return quote.readDatum(parsingInfo);\n }\n // If it is an openning parenthesis\n // then tries to read a specific expression.\n if (token.type === TokenTypes.leftParen) {\n tokenStream.advance();\n nextToken = tokenStream.peek();\n if (!nextToken) {\n raiseSyntaxError(parsingInfo, 'list_end_unexpected');\n }\n if (isIdentifier(nextToken)) {\n var formReader = getFormReader(syntax, nextToken.value);\n if (formReader) {\n tokenStream.advance();\n return formReader(parsingInfo);\n }\n if (nextToken.value === syntax['quote']) {\n tokenStream.advance();\n return quote.readQuote(parsingInfo);\n }\n if (nextToken.value === syntax['define']) {\n raiseSyntaxError(parsingInfo, 'expr_expected_definition_found');\n }\n }\n if (nextToken.type === TokenTypes.leftParen || isVariable(syntax, nextToken)) { \n return readProcedureCall(parsingInfo);\n }\n if (nextToken.type === TokenTypes.boolean\n || nextToken.type === TokenTypes.number\n || nextToken.type === TokenTypes.character\n || nextToken.type === TokenTypes.string) {\n raiseSyntaxError(parsingInfo, 'data_not_procedure');\n }\n raiseSyntaxError(parsingInfo, 'unknown_expr');\n }\n return null;\n}", "title": "" }, { "docid": "54fb0c0b41683b8ece12a9f775daf77a", "score": "0.5912265", "text": "function parseExpression() {\n var start = index;\n while (!eof()) {\n chr = peek();\n if (isStringStart(chr)) {\n parseString();\n } else if (isExpStart(chr)) {\n parseSpecialExp(chr);\n } else if (chr === pipeChr) {\n next();\n chr = peek();\n if (chr === pipeChr) {\n next();\n } else {\n if (state === startState || state === filterArgState) {\n state = filterState;\n }\n break;\n }\n } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n eatSpace();\n break;\n } else {\n if (state === filterState) {\n state = filterNameState;\n }\n next();\n }\n }\n\n return str.slice(start + 1, index) || null;\n}", "title": "" }, { "docid": "280a61277dc215e2f15b957cd19ff739", "score": "0.5904421", "text": "function parse(equation) {\r\n console.log((equation));\r\n if(equation.match(PARENTHESIS_REGEX)) {\r\n const subEquation = equation.match(PARENTHESIS_REGEX).groups.equation;\r\n const result = parse(subEquation);\r\n const newEquation = equation.replace(PARENTHESIS_REGEX, result);\r\n return parse(newEquation);\r\n } else if(equation.match(EXPONENT_REGEX)) {\r\n const result = handleMath(equation.match(EXPONENT_REGEX).groups);\r\n const newEquation = equation.replace(EXPONENT_REGEX, result);\r\n return parse(newEquation);\r\n } else if(equation.match(MULTIPLY_DIVIDE_REGEX)) {\r\n const result = handleMath(equation.match(MULTIPLY_DIVIDE_REGEX).groups);\r\n const newEquation = equation.replace(MULTIPLY_DIVIDE_REGEX, result);\r\n //console.log(newEquation);\r\n return parse(newEquation);\r\n } else if(equation.match(ADD_SUBTRACT_REGEX)){\r\n const result = handleMath(equation.match(ADD_SUBTRACT_REGEX).groups);\r\n const newEquation = equation.replace(ADD_SUBTRACT_REGEX, result);\r\n //console.log(newEquation);\r\n return parse(newEquation);\r\n } else {\r\n return parseFloat(equation);\r\n }\r\n}", "title": "" }, { "docid": "b738ed679c2b7b210aaec62c7a628983", "score": "0.58778757", "text": "function processExpression(node, context, \n// some expressions like v-slot props & v-for aliases should be parsed as\n// function params\nasParams = false, \n// v-on handler values may contain multiple statements\nasRawStatements = false, localVars = Object.create(context.identifiers)) {\n {\n {\n // simple in-browser validation (same logic in 2.x)\n validateBrowserExpression(node, context, asParams, asRawStatements);\n }\n return node;\n }\n}", "title": "" }, { "docid": "4ce1491caf54d5980c552b889879c0c6", "score": "0.58526874", "text": "function parseTopLevel() {\n skipWhitespace();\n peek();\n var expr = parseExpression();\n\n if (expr) {\n if (lookahead.value === ',' || lookahead.value == 'in' && expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } else {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }", "title": "" }, { "docid": "fc90808e8717147ba3afecc792b2c2f3", "score": "0.5832743", "text": "function parseExpression(expr: mixed, context: ParsingContext): ?Expression {\n if (expr === null || typeof expr === 'string' || typeof expr === 'boolean' || typeof expr === 'number') {\n expr = ['literal', expr];\n }\n\n if (Array.isArray(expr)) {\n if (expr.length === 0) {\n return context.error(`Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].`);\n }\n\n const op = expr[0];\n if (typeof op !== 'string') {\n context.error(`Expression name must be a string, but found ${typeof op} instead. If you wanted a literal array, use [\"literal\", [...]].`, 0);\n return null;\n }\n\n const Expr = context.definitions[op];\n if (Expr) {\n let parsed = Expr.parse(expr, context);\n if (!parsed) return null;\n const expected = context.expectedType;\n const actual = parsed.type;\n if (expected) {\n // When we expect a number, string, or boolean but have a\n // Value, wrap it in a refining assertion, and when we expect\n // a Color but have a String or Value, wrap it in \"to-color\"\n // coercion.\n const canAssert = expected.kind === 'String' ||\n expected.kind === 'Number' ||\n expected.kind === 'Boolean';\n\n if (canAssert && actual.kind === 'Value') {\n const Assertion = require('./definitions/assertion');\n parsed = new Assertion(parsed.key, expected, [parsed]);\n } else if (expected.kind === 'Color' && (actual.kind === 'Value' || actual.kind === 'String')) {\n const Coercion = require('./definitions/coercion');\n parsed = new Coercion(parsed.key, expected, [parsed]);\n }\n\n if (context.checkSubtype(expected, parsed.type)) {\n return null;\n }\n }\n\n return parsed;\n }\n\n return context.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n } else if (typeof expr === 'undefined') {\n return context.error(`'undefined' value invalid. Use null instead.`);\n } else if (typeof expr === 'object') {\n return context.error(`Bare objects invalid. Use [\"literal\", {...}] instead.`);\n } else {\n return context.error(`Expected an array, but found ${typeof expr} instead.`);\n }\n}", "title": "" }, { "docid": "5d70618e9a2fe9aae72b38b9fb45aa57", "score": "0.5829279", "text": "function parseExpression() {\n\t var start = index;\n\t while (!eof()) {\n\t chr = peek();\n\t if (isStringStart(chr)) {\n\t parseString();\n\t } else if (isExpStart(chr)) {\n\t parseSpecialExp(chr);\n\t } else if (chr === pipeChr) {\n\t next();\n\t chr = peek();\n\t if (chr === pipeChr) {\n\t next();\n\t } else {\n\t if (state === startState || state === filterArgState) {\n\t state = filterState;\n\t }\n\t break;\n\t }\n\t } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n\t eatSpace();\n\t break;\n\t } else {\n\t if (state === filterState) {\n\t state = filterNameState;\n\t }\n\t next();\n\t }\n\t }\n\t\n\t return str.slice(start + 1, index) || null;\n\t}", "title": "" }, { "docid": "a8b65cf4ef9fa572e7ef71503ccac6b5", "score": "0.5826343", "text": "function evaluate(expression) {\n\twhile (expression.includes('(')) {\n\t\tconst away = parenthesisAway(expression);\n\t\texpression = away[0] + math(away[1]) + away[2];\n\t}\n\treturn math(expression);\n}", "title": "" }, { "docid": "b9b234f265061a61befda06f8061482c", "score": "0.58215773", "text": "function parseTopLevel() {\n skipWhitespace();\n peek();\n\n var expr = parseExpression();\n if (expr) {\n if (lookahead.value === ',' || lookahead.value == 'in' &&\n expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } else {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }", "title": "" }, { "docid": "b9b234f265061a61befda06f8061482c", "score": "0.58215773", "text": "function parseTopLevel() {\n skipWhitespace();\n peek();\n\n var expr = parseExpression();\n if (expr) {\n if (lookahead.value === ',' || lookahead.value == 'in' &&\n expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } else {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }", "title": "" }, { "docid": "b9b234f265061a61befda06f8061482c", "score": "0.58215773", "text": "function parseTopLevel() {\n skipWhitespace();\n peek();\n\n var expr = parseExpression();\n if (expr) {\n if (lookahead.value === ',' || lookahead.value == 'in' &&\n expr.type === Syntax.Identifier) {\n parseInExpression(expr);\n } else {\n parseFilters();\n if (lookahead.value === 'as') {\n parseAsExpression(expr);\n } else {\n delegate.createTopLevel(expr);\n }\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n throwUnexpected(lookahead);\n }\n }", "title": "" }, { "docid": "f0a72145f5a6ea6ef8860d527c18394a", "score": "0.5818361", "text": "function f(){\n// skip over whitespaces\n// space, tab, and newline when inside parameters\nfor(bt=lt.NULL,gt=\"\",mt=\"\";a.isWhitespace(yt,wt);)c();\n// skip comment\nif(\"#\"==yt)for(;\"\\n\"!=yt&&\"\"!=yt;)mt+=yt,c();\n// check for end of expression\nif(\"\"==yt)\n// token is still empty\nreturn void(bt=lt.DELIMITER);\n// check for new line character\nif(\"\\n\"==yt&&!wt)return bt=lt.DELIMITER,gt=yt,void c();\n// check for delimiters consisting of 3 characters\nvar t=yt+p(),e=t+h();if(3==e.length&&pt[e])return bt=lt.DELIMITER,gt=e,c(),c(),void c();\n// check for delimiters consisting of 2 characters\nif(2==t.length&&pt[t])return bt=lt.DELIMITER,gt=t,c(),void c();\n// check for delimiters consisting of 1 character\nif(pt[yt])return bt=lt.DELIMITER,gt=yt,void c();\n// check for a number\nif(!a.isDigitDot(yt)){\n// check for variables, functions, named operators\nif(a.isAlpha(yt,l(),p())){for(;a.isAlpha(yt,l(),p())||a.isDigit(yt);)gt+=yt,c();return void(bt=ht.hasOwnProperty(gt)?lt.DELIMITER:lt.SYMBOL)}for(\n// something unknown is found, wrong characters -> a syntax error\nbt=lt.UNKNOWN;\"\"!=yt;)gt+=yt,c();throw Y('Syntax error in part \"'+gt+'\"')}\n// get number, can have a single dot\nif(bt=lt.NUMBER,\".\"==yt)gt+=yt,c(),a.isDigit(yt)||(\n// this is no number, it is just a dot (can be dot notation)\nbt=lt.DELIMITER);else{for(;a.isDigit(yt);)gt+=yt,c();a.isDecimalMark(yt,p())&&(gt+=yt,c())}for(;a.isDigit(yt);)gt+=yt,c();if(\n// check for exponential notation like \"2.3e-4\", \"1.23e50\" or \"2e+4\"\nt=p(),\"E\"==yt||\"e\"==yt)if(a.isDigit(t)||\"-\"==t||\"+\"==t){\n// Scientific notation MUST be followed by an exponent\nif(gt+=yt,c(),\"+\"!=yt&&\"-\"!=yt||(gt+=yt,c()),!a.isDigit(yt))throw Y('Digit expected, got \"'+yt+'\"');for(;a.isDigit(yt);)gt+=yt,c();if(a.isDecimalMark(yt,p()))throw Y('Digit expected, got \"'+yt+'\"')}else if(\".\"==t)throw c(),Y('Digit expected, got \"'+yt+'\"')}", "title": "" }, { "docid": "98726f96afbd92829d6cc82ecb203a5b", "score": "0.58010304", "text": "function evaluate(expression) {\n //Stack to store values of the expression\n let valueStack = [];\n //stack to store operators\n let operatorStack = [];\n let i = 0;\n while (i < expression.length) {\n if(expression[i]===' '){ // //if current token is a whitespace, skip it\n i=i+1;\n continue;\n }\n else if(expression[i]==='-' && (/^\\d+$/.test(expression[i+1]))){ //if current token is a negative number\n i=i+1;\n let val=0;\n while((i < expression.length) && (/^\\d+$/.test(expression[i]))){\n val = (val*10)+parseInt(expression[i]);\n i=i+1;\n } \n val = val*(-1);\n valueStack.push(val);\n //right now the i points to the character next to the digit, since the for loop also increases\n //the i, we would skip one token position; we need to decrease the value of i by 1 to correct\n //the offset\n i=i-1;\n } \n else if (expression[i] === '{' || expression[i] === '*' || expression[i] === '+' || expression[i] === '-') { //if operator then push on top of the operator stack\n operatorStack.push(expression[i]);\n i = i + 1;\n continue;\n }\n //Check token is a number, push it to stack of Values\n else if (/^\\d+$/.test(expression[i])) { \n let str = \"\";\n //Accumulating each individual token and making a Digit. Takes care of Decimal numbers too\n while (((i < expression.length) && (/^\\d+$/.test(expression[i])) || (i<expression.length)&&(expression[i]==='.'))){\n str = str+expression[i];\n i = i + 1;\n }\n valueStack.push(Number(str));\n //right now the i points to the character next to the digit, since the for loop also increases\n //the i, we would skip one token position; we need to decrease the value of i by 1 to correct\n //the offset\n i = i - 1;\n }\n //Checking if current token is a variable\n else if(expression[i]==='a' || expression[i]==='b' || expression[i]==='c' || expression[i]==='d' || expression[i]==='e'){\n if(expression[i]==='a'){\n valueStack.push(a);\n }\n else if(expression[i]==='b'){\n valueStack.push(b);\n }\n else if(expression[i]==='c'){\n valueStack.push(c);\n }\n else if(expression[i]==='d'){\n valueStack.push(d);\n }\n else if(expression[i]==='e'){\n valueStack.push(e);\n }\n }\n //if closing brace encountered, solve the entire brace\n else if (expression[i] === '}') { \n while(operatorStack.length!==0 && (operatorStack[operatorStack.length-1]!=='{')){\n let var1 = valueStack.pop();\n let var2 = valueStack.pop();\n let operator = operatorStack.pop();\n valueStack.push(performOperation(var1,var2,operator));\n } \n operatorStack.pop(); \n }\n \n i += 1; \n }\n //Entire expression has been parsed at this point, apply remaining operators to the remaining values \n while(operatorStack.length !== 0){\n let val2 = valueStack.pop();\n let val1 = valueStack.pop();\n let operator = operatorStack.pop();\n valueStack.push(performOperation(val1, val2, operator));\n }\n return valueStack[0];\n}", "title": "" }, { "docid": "ef33884ab1ed698e75c009347145dd94", "score": "0.5796988", "text": "function parseExpression(source, element, state) {\n try {\n const parsed = babylon.parse(source);\n let expression;\n traverse_1.default(parsed, {\n enter(path) {\n const isValidNode = path.isProgram() ||\n path.isBlockStatement() ||\n path.isExpressionStatement() ||\n path.isIdentifier() ||\n path.isMemberExpression();\n errors_1.invariant(isValidNode, errors_1.ParserDiagnostics.INVALID_NODE, [path.type]);\n // Ensure expression doesn't contain multiple expressions: {foo;bar}\n const hasMultipleExpressions = path.isBlock() && path.get('body').length !== 1;\n errors_1.invariant(!hasMultipleExpressions, errors_1.ParserDiagnostics.MULTIPLE_EXPRESSIONS);\n // Retrieve the first expression and set it as return value\n if (path.isExpressionStatement() && !expression) {\n expression = path.node.expression;\n }\n },\n MemberExpression: {\n exit(path) {\n const shouldReportComputed = !state.config.experimentalComputedMemberExpression &&\n path.node.computed;\n errors_1.invariant(!shouldReportComputed, errors_1.ParserDiagnostics.COMPUTED_PROPERTY_ACCESS_NOT_ALLOWED);\n const memberExpression = path.node;\n const propertyIdentifier = memberExpression.property;\n const objectIdentifier = memberExpression.object;\n errors_1.invariant(!ir_1.isBoundToIterator(objectIdentifier, element) ||\n propertyIdentifier.name !== ITERATOR_NEXT_KEY, errors_1.ParserDiagnostics.MODIFYING_ITERATORS_NOT_ALLOWED);\n },\n },\n });\n return expression;\n }\n catch (err) {\n err.message = `Invalid expression ${source} - ${err.message}`;\n throw err;\n }\n}", "title": "" }, { "docid": "52007e66daf5344a5751d406fd39e14b", "score": "0.5795324", "text": "function parseExpression(program) {\n program = skipSpace(program);\n let match, expr;\n if ((match = /^\"([^\"]*)\"/.exec(program))) {\n expr = { type: 'value', value: match[1] };\n } else if ((match = /^\\d+\\b/.exec(program))) {\n expr = { type: 'value', value: Number(match[0]) };\n } else if ((match = /^[^\\s(),\"]+/.exec(program))) {\n expr = { type: 'word', name: match[0] };\n } else {\n throw new SyntaxError('Unexpected syntax: ', program);\n }\n\n return parseApply(expr, program.slice(match[0].length));\n}", "title": "" }, { "docid": "34ca3bf9961126f9182b8173146f3f24", "score": "0.5794397", "text": "function parseExpression() {\n\t var start = index;\n\t while (!eof()) {\n\t chr = peek();\n\t if (isStringStart(chr)) {\n\t parseString();\n\t } else if (isExpStart(chr)) {\n\t parseSpecialExp(chr);\n\t } else if (chr === pipeChr) {\n\t next();\n\t chr = peek();\n\t if (chr === pipeChr) {\n\t next();\n\t } else {\n\t if (state === startState || state === filterArgState) {\n\t state = filterState;\n\t }\n\t break;\n\t }\n\t } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n\t eatSpace();\n\t break;\n\t } else {\n\t if (state === filterState) {\n\t state = filterNameState;\n\t }\n\t next();\n\t }\n\t }\n\n\t return str.slice(start + 1, index) || null;\n\t}", "title": "" }, { "docid": "10e7bf32db5d045cdf159315d1f40201", "score": "0.57828426", "text": "function parseArguments() {\n\t var args = [], expr;\n\n\t expect('(');\n\n\t if (!match(')')) {\n\t while (startIndex < length) {\n\t if (match('...')) {\n\t expr = new Node();\n\t lex();\n\t expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n\t } else {\n\t expr = isolateCoverGrammar(parseAssignmentExpression);\n\t }\n\t args.push(expr);\n\t if (match(')')) {\n\t break;\n\t }\n\t expectCommaSeparator();\n\t }\n\t }\n\n\t expect(')');\n\n\t return args;\n\t }", "title": "" }, { "docid": "10e7bf32db5d045cdf159315d1f40201", "score": "0.57828426", "text": "function parseArguments() {\n\t var args = [], expr;\n\n\t expect('(');\n\n\t if (!match(')')) {\n\t while (startIndex < length) {\n\t if (match('...')) {\n\t expr = new Node();\n\t lex();\n\t expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n\t } else {\n\t expr = isolateCoverGrammar(parseAssignmentExpression);\n\t }\n\t args.push(expr);\n\t if (match(')')) {\n\t break;\n\t }\n\t expectCommaSeparator();\n\t }\n\t }\n\n\t expect(')');\n\n\t return args;\n\t }", "title": "" }, { "docid": "9ee523849b924dee39c3ccb41b4e7b49", "score": "0.57763076", "text": "function evaluate(toks, expr, ctx) {\n 'use strict';\n\n var opstk = [],\n opndstk = [],\n nameParts = [],\n tok,\n i = 0;\n\n // Main loop of expression interpreter\n while (i < toks.length) {\n tok = toks[i];\n\n // Collect name or path, get value from context and stack it\n if (tok.type === NAME || (tok.type === DOT)) {\n i = collectName(toks, i, ctx, expr, nameParts);\n opndstk.push(getPathValue(nameParts, ctx));\n nameParts.length = 0;\n continue;\n }\n i++;\n if (tok.type === OP) {\n evalOperator(opstk, opndstk, tok, ctx);\n } else if (tok.type === NUM) {\n opndstk.push(tok.value);\n } else if (tok.type === STR) {\n opndstk.push(tok.value);\n } else if (tok.type === ERR) {\n opstk.length = 0;\n opndstk.length = 0;\n throw tok.value;\n }\n }\n\n // Process the residue, if any, on the operator/operand stacks\n while (opstk.length > 0) {\n tok = opstk[opstk.length - 1];\n // Diagnose leftover operator with no operands\n if (opstk.length >= 1 && opndstk.length === 0) {\n throw 'Invalid expression - too few operands:' + expr;\n }\n if (tok.value === RPARENOP || tok.value === LPARENOP) {\n // if (tok.value === ')' || tok.value === '(') {\n throw 'Unbalanced parentheses: ' + expr;\n }\n if (tok.value === RBRACKOP || tok.value === LBRACKOP) {\n throw 'Unbalanced brackets:' + expr;\n }\n\n // Flush the remaining operator/operands by sending a special end operator\n evalOperator(opstk, opndstk, {\n type: END,\n value: ENDOP,\n priority: -9999\n }, ctx);\n }\n if (opndstk.length > 1) {\n throw \"Invalid expression - excess operands:\" + expr;\n }\n return opndstk.pop();\n }", "title": "" }, { "docid": "4441e778e3d8bd91c63796562392d33b", "score": "0.57530224", "text": "function expresrionPars(node) {\n\n if(node.right==null && node.left==null) {\n return expresionValue(node);\n }\n else if(node.right!=null && node.left!=null) {\n return expresrionPars(node.left)+ node.operator + expresrionPars(node.right);\n }\n\n}", "title": "" }, { "docid": "3c1c077359332c640ac68bdede96a15a", "score": "0.5742907", "text": "function parseExpression () {\n var start = index;\n while (!eof()) {\n chr = peek();\n if (isStringStart(chr)) {\n parseString();\n } else if (isExpStart(chr)) {\n parseSpecialExp(chr);\n } else if (chr === pipeChr) {\n next();\n chr = peek();\n if (chr === pipeChr) {\n next();\n } else {\n if (state === startState || state === filterArgState) {\n state = filterState;\n }\n break;\n }\n } else if (chr === spaceChr && (state === filterNameState || state === filterArgState)) {\n eatSpace();\n break;\n } else {\n if (state === filterState) {\n state = filterNameState;\n }\n next();\n }\n }\n\n return str.slice(start + 1, index) || null;\n }", "title": "" }, { "docid": "32ca16785301f33c5ccdd5aa74220a0b", "score": "0.5738415", "text": "function parseExpression(program) {\n program = skipSpace(program);\n let match, expr;\n if (match = /^\"([^\"]*)\"/.exec(program)) {\n expr = {\n type: \"value\",\n value: match[1]\n };\n }\n else if (match = /^\\d+\\b/.exec(program)) {\n expr = {\n type: \"value\",\n value: Number(match[0])\n };\n }\n else if (match = /^[^\\s(),\"]+/.exec(program)) {\n expr = {\n type: \"word\",\n name: match[0]\n };\n }\n else {\n throw new SyntaxError(\"Unexpected Syntax: \"+program);\n }\n\n return parseApply(expr, program.slice(match[0].length));\n}", "title": "" }, { "docid": "7377e798225b3063e35819c54d046ad4", "score": "0.5736851", "text": "function r_primary( parser ) {\n var c = parser.next_code();\n\n var expr;\n\n if ( c === 34 ) {\n // \"\n expr = r_string( parser );\n\n } else if ( c === 46 || c === 47 ) {\n // ./\n // FIXME: Передать флаг abs сразу?\n expr = r_jpath( parser );\n\n } else if ( c === 40 ) {\n // (\n expr = r_subexpr( parser );\n\n } else if ( c > 47 && c < 58 ) {\n // 0-9\n //\n // К сожалению, нельзя сделать просто `parserFloat( parser.s )`,\n // т.к. мы не знаем, сколько символов нужно потом пропустить.\n //\n var number = t_number( parser );\n parser.move( number.length );\n\n expr = {\n _id: 'number',\n\n // FIXME: Не дешевле ли будет самим считать результат, а не парсить его повторно?\n value: parseFloat( number )\n };\n\n } else if ( c === 38 ) {\n // &\n expr = r_jref( parser );\n\n } else {\n var name = parser.token( 'ID' );\n\n if ( name === 'true' || name === 'false' || name === 'null' || name === 'undefined' ) {\n expr = {\n _id: name\n };\n\n } else {\n if ( parser.next_code() === 40 ) {\n // (\n expr = {\n _id: 'func',\n\n name: name,\n args: r_args( parser )\n };\n\n } else {\n expr = {\n _id: 'var',\n\n name: name\n };\n }\n }\n }\n\n c = parser.next_code();\n // FIXME: Что-то типа ..foo может распарситься.\n // Точка не может быть после self.\n //\n if ( c === 46 || c === 91 || c === 123 ) {\n // .[{\n return {\n _id: 'filter',\n\n expr: expr,\n jpath: r_jpath( parser )\n };\n }\n\n return expr;\n}", "title": "" }, { "docid": "43875a2a24d24f37f93ee9e8273aaa72", "score": "0.5727088", "text": "#parseExpression (e = '') {\n let regex = '';\n let match = null;\n\n try {\n regex = /^(.*)-(eq|ne|lt|gt|le|ge|neq|lte|gte|eqvar|neqvar|ltvar|gtvar|ltevar|gtevar)-(.*)/g;\n match = regex.exec(e);\n } catch (e) {\n // Only accept valid expressions!\n this.valid = false;\n }\n\n // Is the match null?\n if (match == null) {\n // Only accept valid expressions!\n this.valid = false;\n } else {\n // Save the arguments and operator\n this.#quality1 = match[1];\n this.#operator = match[2];\n this.#quality2 = match[3];\n\n // To prevent value coercion, we have to now test for numerics.\n // If the operation is not between two variables, test if numeric.\n // (This does not understand decimal values currently.)\n if (!this.#operator.includes('var')) {\n if (!isNaN(parseFloat(this.#quality2)) && isFinite(this.#quality2)) {\n this.#quality2 = parseInt(this.#quality2, 10);\n }\n }\n\n // Reset validity\n this.valid = true;\n }\n }", "title": "" }, { "docid": "356de385926a566881d343cfe6258217", "score": "0.5721771", "text": "function parseAndExp() {\n\t\t\tvar token, left, right;\n\t\t\tleft = parseUnary();\n\t\t\ttoken = that.tokenizer.peek();\n\t\t\tif (token.isAnd()) {\n\t\t\t\ttoken = that.tokenizer.next();\n\t\t\t\tright = parseAndExp();\n\t\t\t\tif (!right) throw new Expecting('EXPRESSION', token);\n\n\t\t\t\treturn {\n\t\t\t\t\tbinary: {\n\t\t\t\t\t\toperator: token.value,\n\t\t\t\t\t\tleft: left,\n\t\t\t\t\t\tright: right\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (!token.isEnd() && !token.isOperator()) {\n\t\t\t\tthrow new Expecting('OPERATOR', token);\n\t\t\t}\n\t\t\treturn left;\n\t\t}", "title": "" }, { "docid": "6e464556756316173e0d06f24c00e783", "score": "0.57200676", "text": "function parsePrimaryExpression() {\n\t var type, token, expr, node;\n\n\t if (match('(')) {\n\t isBindingElement = false;\n\t return inheritCoverGrammar(parseGroupExpression);\n\t }\n\n\t if (match('[')) {\n\t return inheritCoverGrammar(parseArrayInitializer);\n\t }\n\n\t if (match('{')) {\n\t return inheritCoverGrammar(parseObjectInitializer);\n\t }\n\n\t type = lookahead.type;\n\t node = new Node();\n\n\t if (type === Token.Identifier) {\n\t if (state.sourceType === 'module' && lookahead.value === 'await') {\n\t tolerateUnexpectedToken(lookahead);\n\t }\n\t expr = node.finishIdentifier(lex().value);\n\t } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n\t isAssignmentTarget = isBindingElement = false;\n\t if (strict && lookahead.octal) {\n\t tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n\t }\n\t expr = node.finishLiteral(lex());\n\t } else if (type === Token.Keyword) {\n\t if (!strict && state.allowYield && matchKeyword('yield')) {\n\t return parseNonComputedProperty();\n\t }\n\t if (!strict && matchKeyword('let')) {\n\t return node.finishIdentifier(lex().value);\n\t }\n\t isAssignmentTarget = isBindingElement = false;\n\t if (matchKeyword('function')) {\n\t return parseFunctionExpression();\n\t }\n\t if (matchKeyword('this')) {\n\t lex();\n\t return node.finishThisExpression();\n\t }\n\t if (matchKeyword('class')) {\n\t return parseClassExpression();\n\t }\n\t throwUnexpectedToken(lex());\n\t } else if (type === Token.BooleanLiteral) {\n\t isAssignmentTarget = isBindingElement = false;\n\t token = lex();\n\t token.value = (token.value === 'true');\n\t expr = node.finishLiteral(token);\n\t } else if (type === Token.NullLiteral) {\n\t isAssignmentTarget = isBindingElement = false;\n\t token = lex();\n\t token.value = null;\n\t expr = node.finishLiteral(token);\n\t } else if (match('/') || match('/=')) {\n\t isAssignmentTarget = isBindingElement = false;\n\t index = startIndex;\n\n\t if (typeof extra.tokens !== 'undefined') {\n\t token = collectRegex();\n\t } else {\n\t token = scanRegExp();\n\t }\n\t lex();\n\t expr = node.finishLiteral(token);\n\t } else if (type === Token.Template) {\n\t expr = parseTemplateLiteral();\n\t } else {\n\t throwUnexpectedToken(lex());\n\t }\n\n\t return expr;\n\t }", "title": "" }, { "docid": "6e464556756316173e0d06f24c00e783", "score": "0.57200676", "text": "function parsePrimaryExpression() {\n\t var type, token, expr, node;\n\n\t if (match('(')) {\n\t isBindingElement = false;\n\t return inheritCoverGrammar(parseGroupExpression);\n\t }\n\n\t if (match('[')) {\n\t return inheritCoverGrammar(parseArrayInitializer);\n\t }\n\n\t if (match('{')) {\n\t return inheritCoverGrammar(parseObjectInitializer);\n\t }\n\n\t type = lookahead.type;\n\t node = new Node();\n\n\t if (type === Token.Identifier) {\n\t if (state.sourceType === 'module' && lookahead.value === 'await') {\n\t tolerateUnexpectedToken(lookahead);\n\t }\n\t expr = node.finishIdentifier(lex().value);\n\t } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n\t isAssignmentTarget = isBindingElement = false;\n\t if (strict && lookahead.octal) {\n\t tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n\t }\n\t expr = node.finishLiteral(lex());\n\t } else if (type === Token.Keyword) {\n\t if (!strict && state.allowYield && matchKeyword('yield')) {\n\t return parseNonComputedProperty();\n\t }\n\t if (!strict && matchKeyword('let')) {\n\t return node.finishIdentifier(lex().value);\n\t }\n\t isAssignmentTarget = isBindingElement = false;\n\t if (matchKeyword('function')) {\n\t return parseFunctionExpression();\n\t }\n\t if (matchKeyword('this')) {\n\t lex();\n\t return node.finishThisExpression();\n\t }\n\t if (matchKeyword('class')) {\n\t return parseClassExpression();\n\t }\n\t throwUnexpectedToken(lex());\n\t } else if (type === Token.BooleanLiteral) {\n\t isAssignmentTarget = isBindingElement = false;\n\t token = lex();\n\t token.value = (token.value === 'true');\n\t expr = node.finishLiteral(token);\n\t } else if (type === Token.NullLiteral) {\n\t isAssignmentTarget = isBindingElement = false;\n\t token = lex();\n\t token.value = null;\n\t expr = node.finishLiteral(token);\n\t } else if (match('/') || match('/=')) {\n\t isAssignmentTarget = isBindingElement = false;\n\t index = startIndex;\n\n\t if (typeof extra.tokens !== 'undefined') {\n\t token = collectRegex();\n\t } else {\n\t token = scanRegExp();\n\t }\n\t lex();\n\t expr = node.finishLiteral(token);\n\t } else if (type === Token.Template) {\n\t expr = parseTemplateLiteral();\n\t } else {\n\t throwUnexpectedToken(lex());\n\t }\n\n\t return expr;\n\t }", "title": "" }, { "docid": "6df49c8c0a2f8f35c6a412a54e6c068b", "score": "0.5710388", "text": "function parseExpr() {\n switch(tokenType()) {\n // Production IntExpr\n case T_DIGIT:\n return parseIntExpr();\n break;\n \n // Production CharExpr\n case T_QUOTE:\n return parseStringExpr();\n break;\n \n // Production Id\n case T_CHARACTER:\n return parseId('used');\n break;\n \n case T_PAREN_OPEN:\n case T_TRUE:\n case T_FALSE:\n return parseBooleanExpr();\n break;\n \n default:\n return false;\n }\n \n return false;\n }", "title": "" }, { "docid": "558dfdb9d1c7e2f3626cac29e9bc337b", "score": "0.56971526", "text": "function parse(input, options) {\n return Parser.parse(input, options);\n } // This function tries to parse a single expression at a given", "title": "" }, { "docid": "39d8d1721de3e93144aadddc1f5696fc", "score": "0.5693327", "text": "function parseArguments() {\n var args = [], expr;\n\n expect('(');\n\n if (!match(')')) {\n while (startIndex < length) {\n if (match('...')) {\n expr = new Node();\n lex();\n expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n } else {\n expr = isolateCoverGrammar(parseAssignmentExpression);\n }\n args.push(expr);\n if (match(')')) {\n break;\n }\n expectCommaSeparator();\n }\n }\n\n expect(')');\n\n return args;\n }", "title": "" }, { "docid": "39d8d1721de3e93144aadddc1f5696fc", "score": "0.5693327", "text": "function parseArguments() {\n var args = [], expr;\n\n expect('(');\n\n if (!match(')')) {\n while (startIndex < length) {\n if (match('...')) {\n expr = new Node();\n lex();\n expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n } else {\n expr = isolateCoverGrammar(parseAssignmentExpression);\n }\n args.push(expr);\n if (match(')')) {\n break;\n }\n expectCommaSeparator();\n }\n }\n\n expect(')');\n\n return args;\n }", "title": "" }, { "docid": "39d8d1721de3e93144aadddc1f5696fc", "score": "0.5693327", "text": "function parseArguments() {\n var args = [], expr;\n\n expect('(');\n\n if (!match(')')) {\n while (startIndex < length) {\n if (match('...')) {\n expr = new Node();\n lex();\n expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n } else {\n expr = isolateCoverGrammar(parseAssignmentExpression);\n }\n args.push(expr);\n if (match(')')) {\n break;\n }\n expectCommaSeparator();\n }\n }\n\n expect(')');\n\n return args;\n }", "title": "" }, { "docid": "39d8d1721de3e93144aadddc1f5696fc", "score": "0.5693327", "text": "function parseArguments() {\n var args = [], expr;\n\n expect('(');\n\n if (!match(')')) {\n while (startIndex < length) {\n if (match('...')) {\n expr = new Node();\n lex();\n expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n } else {\n expr = isolateCoverGrammar(parseAssignmentExpression);\n }\n args.push(expr);\n if (match(')')) {\n break;\n }\n expectCommaSeparator();\n }\n }\n\n expect(')');\n\n return args;\n }", "title": "" }, { "docid": "39d8d1721de3e93144aadddc1f5696fc", "score": "0.5693327", "text": "function parseArguments() {\n var args = [], expr;\n\n expect('(');\n\n if (!match(')')) {\n while (startIndex < length) {\n if (match('...')) {\n expr = new Node();\n lex();\n expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));\n } else {\n expr = isolateCoverGrammar(parseAssignmentExpression);\n }\n args.push(expr);\n if (match(')')) {\n break;\n }\n expectCommaSeparator();\n }\n }\n\n expect(')');\n\n return args;\n }", "title": "" }, { "docid": "71395d9d2b56c6b84756d758859452f4", "score": "0.5691746", "text": "function parseExpression(expression, optionalOperators){\n\t// This is done for compatability with Java 8\n\texpression = expression.replaceAll(separator,\"\");\n\tfor (var i=0 ; i<optionalOperators.length ; i++){\n\t\tif (expression.contains(optionalOperators[i])){\n\t\t\tvar temp = expression.split(optionalOperators[i]);\n\t\t\tif (temp.length < 2){\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn [temp[0].trim(),temp[1].trim()];\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "33213bfbcd32b963f82a4f65d21870ee", "score": "0.56775516", "text": "function parseMapExpression(raw, sections) {\n if (!raw) {\n console.warn(\"Non existant expression\");\n return undefined;\n }\n\n raw = raw.trim();\n\n var parsed = {\n raw: raw,\n type: \"expression\",\n };\n\n\n // If no sections provided, parse the raw into a list of operators \n if (sections === undefined) {\n var sections = splitOnUnprotected(raw, expressionOperators, true, openChars, closeChars);\n sections = sections.map(s => isString(s) ? s.trim() : s).filter(s => s !== \"\");\n }\n\n if (sections.length === 0) {\n controls.addError(\"empty expression \" + inQuotes(raw), parsed);\n return parsed;\n }\n\n // No operators: is a number, boolean, string, function, or path\n // Or is in parenthesis\n if (sections.length === 1) {\n // foo, (foo), or foo()\n var parenSections = splitIntoTopSections(raw, \"(\", {\n openChars: openChars,\n closeChars: closeChars\n });\n\n if (parenSections.length > 1) {\n\n if (parenSections.length > 2) {\n controls.addError(\"There's an error in this expression \" + inQuotes(raw) + \", too many parenthesis\", parsed);\n return parsed;\n }\n\n if (parenSections[0].depth === 1) {\n controls.addError(\"There's an error in this expression \" + inQuotes(raw) + \", are your parenthesis closed?\", parsed);\n return parsed;\n }\n\n if (parenSections[1].depth === 0) {\n controls.addError(\"There's an error in this expression \" + inQuotes(raw) + \", are your parenthesis closed?\", parsed);\n return parsed;\n }\n }\n\n // only contains in parenthesis\n if (parenSections[0].depth === 1 && parenSections.length === 1) {\n return parseMapExpression(raw.substring(1, raw.length - 1));\n }\n\n return parseMapValue(raw);\n }\n\n // Operator found!\n // figure out binops and monops (lhs and rhs)\n // eg. foo*-1, foo++, ++foo, bar - -foo\n var hasLHS = false;\n for (var i = 0; i < sections.length; i++) {\n if (sections[i].splitterIndex !== undefined) {\n //console.log(\"test for monop \" + hasLHS + \" \" + sections[i].splitter);\n if (!hasLHS) {\n // left-side monop\n sections[i].isMonop = \"left\";\n //console.log(\"MONOP\");\n sections[i].splitterIndex = 99;\n }\n hasLHS = false;\n } else {\n hasLHS = true;\n }\n }\n\n var bestPriority = 9999;\n var centerIndex;\n\n if (sections.length === 0)\n return null;\n if (sections.length === 1)\n return sections[0];\n\n for (var i = 0; i < sections.length; i++) {\n\n var priority = sections[i].splitterIndex;\n // console.log(bestPriority + \" \" + priority);\n\n if (priority !== undefined && priority < bestPriority) {\n bestPriority = priority;\n //console.log(\"best \" + sections[i].splitter);\n centerIndex = i;\n }\n }\n\n var op = sections[centerIndex];\n var lhs = sections.slice(0, centerIndex);\n var rhs = sections.slice(centerIndex + 1);\n var lhsRaw = expressionSectionsToString(lhs);\n var rhsRaw = expressionSectionsToString(rhs);\n\n parsed.operator = op.splitter;\n parsed.isMonop = op.isMonop;\n if (lhs.length > 0)\n parsed.lhs = parseMapExpression(lhsRaw, lhs);\n\n if (rhs.length > 0)\n parsed.rhs = parseMapExpression(rhsRaw, rhs);\n\n return parsed;\n}", "title": "" }, { "docid": "dc8ab1f369ea4c7e94b7a95e11cbcaee", "score": "0.56729984", "text": "function parseExpression(program) {\n program = skipSpace(program);\n let match, expr;\n if (match = /^\"([^\"]*)\"/.exec(program)) {\n expr = { type: \"value\", value: match[1] };\n } else if (match = /^\\d+\\b/.exec(program)) {\n expr = { type: \"value\", value: Number(match[0]) };\n } else if (match = /^[^\\s(),#\"]+/.exec(program)) {\n expr = { type: \"word\", name: match[0] };\n } else {\n throw new SyntaxError(\"Unexpected syntax: \" + program);\n }\n return parseApply(expr, program.slice(match[0].length));\n}", "title": "" }, { "docid": "fcc2ea1e50e268a96662320727e607ff", "score": "0.5660484", "text": "parseExpression() {\n if (this.expresion.type === \"compOperator\") {\n var left = this.expresion.childs[0];\n var right = this.expresion.childs[1];\n\n if ( (left.type == \"identifier\") && (left.value == \"y\") && (!right.contains(\"y\")) ) {\n this.funExpr = right;\n this.of_y = false;\n this.drawAux = this.drawAuxFun;\n }\n else if ( (right.type == \"identifier\") && (right.value == \"y\") && (!left.contains(\"y\")) ) {\n this.funExpr = left;\n this.of_y = false;\n this.drawAux = this.drawAuxFun;\n }\n else if ( (left.type == \"identifier\") && (left.value == \"x\") && (!right.contains(\"x\")) ) {\n this.funExpr = right;\n this.of_y = true;\n this.drawAux = this.drawAuxFun;\n }\n else if ( (right.type == \"identifier\") && (right.value == \"x\") && (!left.contains(\"x\")) ) {\n this.funExpr = right;\n this.of_y = true;\n this.drawAux = this.drawAuxFun;\n }\n }\n\n this.newt = new descartesJS.R2Newton(this.evaluator, this.expresion);\n }", "title": "" }, { "docid": "e1f8bd2b9ac0c01c68faf3f7e52ab0ea", "score": "0.56538606", "text": "function parseExpression(revToks, expectedEnd) {\n if (expectedEnd !== 0 /* TokenType.END */ &&\n expectedEnd !== 2 /* TokenType.RParen */ &&\n expectedEnd !== 5 /* TokenType.Comma */ &&\n expectedEnd !== 4 /* TokenType.RBracket */) {\n throw new Error('invalid expectedEnd');\n }\n let js = '';\n while (true) {\n // Expression.\n let tok = revToks.pop();\n let next;\n switch (tok.type) {\n case 19 /* TokenType.Ident */:\n next = revToks[revToks.length - 1];\n if (next.type === 1 /* TokenType.LParen */) {\n js += parseFunctionCall(tok.text, revToks);\n }\n else if (next.type === 3 /* TokenType.LBracket */) {\n consume(revToks, 3 /* TokenType.LBracket */);\n const index = parseExpression(revToks, 4 /* TokenType.RBracket */);\n consume(revToks, 4 /* TokenType.RBracket */);\n js += `${tok.text}[${index}]`;\n }\n else {\n js += tok.text;\n }\n break;\n case 20 /* TokenType.Field */:\n js += 'form.' + tok.text.slice('$'.length);\n break;\n case 17 /* TokenType.String */:\n case 18 /* TokenType.Number */:\n js += tok.text;\n break;\n case 6 /* TokenType.Plus */:\n case 7 /* TokenType.Minus */:\n next = revToks[revToks.length - 1];\n if (next.type === 6 /* TokenType.Plus */ || next.type === 7 /* TokenType.Minus */) {\n throw unexpectedTokenError(revToks.pop(), revToks);\n }\n js += tok.text;\n continue;\n case 16 /* TokenType.Not */:\n js += '!';\n continue;\n case 1 /* TokenType.LParen */:\n js += '(' + parseExpression(revToks, 2 /* TokenType.RParen */) + ')';\n consume(revToks, 2 /* TokenType.RParen */);\n break;\n case 3 /* TokenType.LBracket */:\n js += '[' + parseList(revToks, 4 /* TokenType.RBracket */) + ']';\n consume(revToks, 4 /* TokenType.RBracket */);\n break;\n default:\n throw unexpectedTokenError(tok, revToks);\n }\n // Possible end of expression. expectedEnd can be:\n // END,\n // RParen for expressions between parentheses,\n // Comma for function arguments, in which case we also accept RParen,\n // RBracket for array elements, in which case we also accept Comma.\n // Note that we don't consume the end token.\n const type = revToks[revToks.length - 1].type;\n if (type === expectedEnd ||\n (expectedEnd === 5 /* TokenType.Comma */ && type === 2 /* TokenType.RParen */) ||\n (expectedEnd === 4 /* TokenType.RBracket */ && type === 5 /* TokenType.Comma */)) {\n return js;\n }\n // Operator.\n tok = revToks.pop();\n if (tok.type >= 6 /* TokenType.Plus */ && tok.type <= 13 /* TokenType.GreaterOrEq */) {\n js += ' ' + tok.text + ' ';\n continue;\n }\n switch (tok.type) {\n case 19 /* TokenType.Ident */:\n if (tok.text === 'AND') {\n js += ' && ';\n break;\n }\n if (tok.text === 'OR') {\n js += ' || ';\n break;\n }\n throw unexpectedTokenError(tok, revToks);\n case 14 /* TokenType.Equal */:\n js += ' == ';\n break;\n case 15 /* TokenType.NotEqual */:\n js += ' != ';\n break;\n default:\n throw unexpectedTokenError(tok, revToks);\n }\n }\n}", "title": "" }, { "docid": "04b3225d39be60b28fa27b39e78ca88c", "score": "0.5642756", "text": "function evaluateExpressionPart2(expression) {\n // Clean expression of parantheses that hold a single number: (10) -> 10\n const cleanExpression = expression.replace(/\\((?<number>\\d+)\\)/g, '$<number>');\n\n const additionExpression = cleanExpression.match(/(?<match>\\d+ \\+ \\d+)/)?.groups?.match;\n const multiplicationExpression = cleanExpression.match(/(?<match>\\(\\d+( \\* \\d+)+\\))/)?.groups?.match;\n\n // Evaluate additions first, otherwise multiplications surrounded by parantheses\n const expressionToEvaluate = additionExpression || multiplicationExpression;\n if (expressionToEvaluate) {\n const result = evaluateExpression(expressionToEvaluate.split(''));\n const newExpression = cleanExpression.replace(expressionToEvaluate, String(result));\n return evaluateExpressionPart2(newExpression);\n }\n\n // Otherwise we only have multiplications and no parantheses so evaluate like in Part 1\n return evaluateExpression(expression.split(''));\n}", "title": "" }, { "docid": "0a516eb2353cab02b5bd4dda08cccd16", "score": "0.56327695", "text": "function expression(){\n\t\tif(lookahead.id == \"VARID\"){\n\t\t\tvar channel = varid();\n\t\t\tif(lookahead.id == \"READ\"){\n\t\t\t\tmatch(\"READ\");\n\t\t\t\tvar message = varid();\n\t\t\t\treturn new Tree(\"READ\", new Tree(channel), new Tree(message));\n\t\t\t}else{\n\t\t\t\tmatch(\"WRITE\");\n\t\t\t\tvar message = varid();\n\t\t\t\treturn new Tree(\"WRITE\", new Tree(channel), new Tree(message));\n\t\t\t}\n\t\t}else if(lookahead.id == \"PAREN\"){\n\t\t\tmatch(\"PAREN\");\n\t\t\tvar proc = par_statement();\n\t\t\tmatch(\"PAREN\");\n\t\t\treturn proc;\n\t\t}else if(lookahead.id == \"NEW\"){\n\t\t\tmatch(\"NEW\");\n\t\t\tmatch(\"PAREN\");\n\t\t\tvar name = varid();\n\t\t\tmatch(\"PAREN\");\n\t\t\treturn new Tree(\"NEW\", new Tree(name));\n\t\t}else if(lookahead.id == \"PROCID\"){\n\t\t\treturn new Tree(\"PROCID\", new Tree(procid()));\n\t\t}\n\t}", "title": "" }, { "docid": "3ac93fe7b80717e2292bcb1cb1237119", "score": "0.56306916", "text": "function parseExpression(expr, dotDotAllowed, noExpr = true) {\n let match = expr.match(namePattern);\n if (!match) {\n return null;\n }\n\n let [name] = match;\n const parsed = [\n {\n name,\n cacheName: \".\" + name,\n index: 0,\n js: null,\n formCalc: null,\n operator: operators.dot,\n },\n ];\n\n let pos = name.length;\n\n while (pos < expr.length) {\n const spos = pos;\n const char = expr.charAt(pos++);\n if (char === \"[\") {\n match = expr.slice(pos).match(indexPattern);\n if (!match) {\n warn(\"XFA - Invalid index in SOM expression\");\n return null;\n }\n parsed.at(-1).index = parseIndex(match[0]);\n pos += match[0].length + 1;\n continue;\n }\n\n let operator;\n switch (expr.charAt(pos)) {\n case \".\":\n if (!dotDotAllowed) {\n return null;\n }\n pos++;\n operator = operators.dotDot;\n break;\n case \"#\":\n pos++;\n operator = operators.dotHash;\n break;\n case \"[\":\n if (noExpr) {\n warn(\n \"XFA - SOM expression contains a FormCalc subexpression which is not supported for now.\"\n );\n return null;\n }\n // TODO: FormCalc expression so need to use the parser\n operator = operators.dotBracket;\n break;\n case \"(\":\n if (noExpr) {\n warn(\n \"XFA - SOM expression contains a JavaScript subexpression which is not supported for now.\"\n );\n return null;\n }\n // TODO:\n // JavaScript expression: should be a boolean operation with a path\n // so maybe we can have our own parser for that stuff or\n // maybe use the formcalc one.\n operator = operators.dotParen;\n break;\n default:\n operator = operators.dot;\n break;\n }\n\n match = expr.slice(pos).match(namePattern);\n if (!match) {\n break;\n }\n\n [name] = match;\n pos += name.length;\n parsed.push({\n name,\n cacheName: expr.slice(spos, pos),\n operator,\n index: 0,\n js: null,\n formCalc: null,\n });\n }\n return parsed;\n}", "title": "" }, { "docid": "630f6a2ed159a198e12a966ae6794458", "score": "0.5630584", "text": "function evaluate(expr) {\n switch (expr[0]) {\n case \"string\":\n case \"num\":\n return expr[1];\n case \"name\":\n case \"atom\":\n switch (expr[1]) {\n case \"true\": return true;\n case \"false\": return false;\n }\n break;\n case \"unary-prefix\":\n switch (expr[1]) {\n case \"!\": return !evaluate(expr[2]);\n case \"typeof\": return typeof evaluate(expr[2]);\n case \"~\": return ~evaluate(expr[2]);\n case \"-\": return -evaluate(expr[2]);\n case \"+\": return +evaluate(expr[2]);\n }\n break;\n case \"binary\":\n var left = expr[2], right = expr[3];\n switch (expr[1]) {\n case \"&&\" : return evaluate(left) && evaluate(right);\n case \"||\" : return evaluate(left) || evaluate(right);\n case \"|\" : return evaluate(left) | evaluate(right);\n case \"&\" : return evaluate(left) & evaluate(right);\n case \"^\" : return evaluate(left) ^ evaluate(right);\n case \"+\" : return evaluate(left) + evaluate(right);\n case \"*\" : return evaluate(left) * evaluate(right);\n case \"/\" : return evaluate(left) / evaluate(right);\n case \"-\" : return evaluate(left) - evaluate(right);\n case \"<<\" : return evaluate(left) << evaluate(right);\n case \">>\" : return evaluate(left) >> evaluate(right);\n case \">>>\" : return evaluate(left) >>> evaluate(right);\n case \"==\" : return evaluate(left) == evaluate(right);\n case \"===\" : return evaluate(left) === evaluate(right);\n case \"!=\" : return evaluate(left) != evaluate(right);\n case \"!==\" : return evaluate(left) !== evaluate(right);\n case \"<\" : return evaluate(left) < evaluate(right);\n case \"<=\" : return evaluate(left) <= evaluate(right);\n case \">\" : return evaluate(left) > evaluate(right);\n case \">=\" : return evaluate(left) >= evaluate(right);\n case \"in\" : return evaluate(left) in evaluate(right);\n case \"instanceof\" : return evaluate(left) instanceof evaluate(right);\n }\n }\n throw $NOT_CONSTANT;\n }", "title": "" }, { "docid": "4990862c35b399aa63de40a7a165f517", "score": "0.5625282", "text": "function evaluate(expr) {\n switch (expr[0]) {\n case \"string\":\n case \"num\":\n return expr[1];\n case \"name\":\n case \"atom\":\n switch (expr[1]) {\n case \"true\": return true;\n case \"false\": return false;\n case \"null\": return null;\n }\n break;\n case \"unary-prefix\":\n switch (expr[1]) {\n case \"!\": return !evaluate(expr[2]);\n case \"typeof\": return typeof evaluate(expr[2]);\n case \"~\": return ~evaluate(expr[2]);\n case \"-\": return -evaluate(expr[2]);\n case \"+\": return +evaluate(expr[2]);\n }\n break;\n case \"binary\":\n var left = expr[2], right = expr[3];\n switch (expr[1]) {\n case \"&&\" : return evaluate(left) && evaluate(right);\n case \"||\" : return evaluate(left) || evaluate(right);\n case \"|\" : return evaluate(left) | evaluate(right);\n case \"&\" : return evaluate(left) & evaluate(right);\n case \"^\" : return evaluate(left) ^ evaluate(right);\n case \"+\" : return evaluate(left) + evaluate(right);\n case \"*\" : return evaluate(left) * evaluate(right);\n case \"/\" : return evaluate(left) / evaluate(right);\n case \"%\" : return evaluate(left) % evaluate(right);\n case \"-\" : return evaluate(left) - evaluate(right);\n case \"<<\" : return evaluate(left) << evaluate(right);\n case \">>\" : return evaluate(left) >> evaluate(right);\n case \">>>\" : return evaluate(left) >>> evaluate(right);\n case \"==\" : return evaluate(left) == evaluate(right);\n case \"===\" : return evaluate(left) === evaluate(right);\n case \"!=\" : return evaluate(left) != evaluate(right);\n case \"!==\" : return evaluate(left) !== evaluate(right);\n case \"<\" : return evaluate(left) < evaluate(right);\n case \"<=\" : return evaluate(left) <= evaluate(right);\n case \">\" : return evaluate(left) > evaluate(right);\n case \">=\" : return evaluate(left) >= evaluate(right);\n case \"in\" : return evaluate(left) in evaluate(right);\n case \"instanceof\" : return evaluate(left) instanceof evaluate(right);\n }\n }\n throw $NOT_CONSTANT;\n }", "title": "" }, { "docid": "14c69617e5c8f3e232f5bff66fbe7957", "score": "0.5596615", "text": "function parsePrimaryExpression() {\n var type, token, expr, node;\n\n if (match('(')) {\n isBindingElement = false;\n return inheritCoverGrammar(parseGroupExpression);\n }\n\n if (match('[')) {\n return inheritCoverGrammar(parseArrayInitializer);\n }\n\n if (match('{')) {\n return inheritCoverGrammar(parseObjectInitializer);\n }\n\n type = lookahead.type;\n node = new Node();\n\n if (type === Token.Identifier) {\n if (sourceType === 'module' && lookahead.value === 'await') {\n tolerateUnexpectedToken(lookahead);\n }\n expr = node.finishIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n isAssignmentTarget = isBindingElement = false;\n if (strict && lookahead.octal) {\n tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n }\n expr = node.finishLiteral(lex());\n } else if (type === Token.Keyword) {\n if (!strict && state.allowYield && matchKeyword('yield')) {\n return parseNonComputedProperty();\n }\n isAssignmentTarget = isBindingElement = false;\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n return node.finishThisExpression();\n }\n if (matchKeyword('class')) {\n return parseClassExpression();\n }\n throwUnexpectedToken(lex());\n } else if (type === Token.BooleanLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = (token.value === 'true');\n expr = node.finishLiteral(token);\n } else if (type === Token.NullLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = null;\n expr = node.finishLiteral(token);\n } else if (match('/') || match('/=')) {\n isAssignmentTarget = isBindingElement = false;\n index = startIndex;\n\n if (typeof extra.tokens !== 'undefined') {\n token = collectRegex();\n } else {\n token = scanRegExp();\n }\n lex();\n expr = node.finishLiteral(token);\n } else if (type === Token.Template) {\n expr = parseTemplateLiteral();\n } else {\n throwUnexpectedToken(lex());\n }\n\n return expr;\n }", "title": "" }, { "docid": "3ccdead0450216ea620b78d4637cdca1", "score": "0.55805564", "text": "function evaluate(expr) {\n switch (expr[0]) {\n case \"string\":\n case \"num\":\n return expr[1];\n case \"name\":\n case \"atom\":\n switch (expr[1]) {\n case \"true\": return true;\n case \"false\": return false;\n case \"null\": return null;\n }\n break;\n case \"unary-prefix\":\n switch (expr[1]) {\n case \"!\": return !evaluate(expr[2]);\n case \"typeof\": return typeof evaluate(expr[2]);\n case \"~\": return ~evaluate(expr[2]);\n case \"-\": return -evaluate(expr[2]);\n case \"+\": return +evaluate(expr[2]);\n }\n break;\n case \"binary\":\n var left = expr[2], right = expr[3];\n switch (expr[1]) {\n case \"&&\" : return evaluate(left) && evaluate(right);\n case \"||\" : return evaluate(left) || evaluate(right);\n case \"|\" : return evaluate(left) | evaluate(right);\n case \"&\" : return evaluate(left) & evaluate(right);\n case \"^\" : return evaluate(left) ^ evaluate(right);\n case \"+\" : return evaluate(left) + evaluate(right);\n case \"*\" : return evaluate(left) * evaluate(right);\n case \"/\" : return evaluate(left) / evaluate(right);\n case \"%\" : return evaluate(left) % evaluate(right);\n case \"-\" : return evaluate(left) - evaluate(right);\n case \"<<\" : return evaluate(left) << evaluate(right);\n case \">>\" : return evaluate(left) >> evaluate(right);\n case \">>>\" : return evaluate(left) >>> evaluate(right);\n case \"==\" : return evaluate(left) == evaluate(right);\n case \"===\" : return evaluate(left) === evaluate(right);\n case \"!=\" : return evaluate(left) != evaluate(right);\n case \"!==\" : return evaluate(left) !== evaluate(right);\n case \"<\" : return evaluate(left) < evaluate(right);\n case \"<=\" : return evaluate(left) <= evaluate(right);\n case \">\" : return evaluate(left) > evaluate(right);\n case \">=\" : return evaluate(left) >= evaluate(right);\n case \"in\" : return evaluate(left) in evaluate(right);\n case \"instanceof\" : return evaluate(left) instanceof evaluate(right);\n }\n }\n throw $NOT_CONSTANT;\n }", "title": "" }, { "docid": "b5c4b01cd0ed86f4ca603c093bfc218a", "score": "0.55713254", "text": "function astBuilder(lexems) {\n\n function parseOp(lexems, i) { // decides, how to parse this type of operator\n let lexem = lexems[i].toUpperCase()\n switch (lexem) {\n case keywords[0]: // begin\n return parseSeq(lexems, i+1)\n break;\n case keywords[2]: // if\n return parseIf(lexems, i+1)\n break;\n case keywords[5]: // do \n return parseDoWhile(lexems, i+1)\n break;\n case keywords[6]: // while\n return parseWhileDo(lexems, i+1)\n break;\n case keywords[7]: // for\n return parseFor(lexems, i+1);\n break;\n case keywords[10]: // function\n return parseFunction(lexems, i+1)\n break;\n case keywords[8]: // case\n case keywords[1]: // end\n case keywords[3]: // then \n case keywords[4]: // else\n case keywords[9]: // of\n case keywords[11]: // fi\n case keywords[12]: // od\n case keywords[13]: // rof\n case keywords[14]: // esac\n throw \"Unexpected keyword \" + lexem;\n break;\n default: // expr or decl\n // TODO: expecting this is a variable (NOT constant!)\n if (lexems[i+1] == \":\")\n return parseDecl(lexems, i); // parse declaration\n else\n // search for a range to parse expression\n var k = i\n while(k < lexems.length) {\n k++\n if (keywords.indexOf(lexems[k]) != -1\n || types.indexOf(lexems[k]) != -1\n || lexems[k] == delimiter)\n break;\n }\n var res = parseExpr(lexems, i, k - 1) // parse expression\n var ret = {\n node: res, // parse expression\n last_index: k\n }\n res.parent = ret\n return ret\n }\n }\n\n function checkVarname(name) {\n if (allowed_varname_first.indexOf(name[0]) == -1)\n return false\n for (var cv in name)\n if (allowed_varname_chars.indexOf(cv) == -1)\n return false\n return true\n }\n\n function parseConstant(lexem) {\n var len = lexem.length\n var res\n // string constant\n if (lexem[0] == '\\'' && lexem[len-1] == '\\''\n || lexem[0] == '\\\"' && lexem[len-1] == '\\\"') {\n var ret = new leaf_const(null, types[4]) // STRING\n ret.value = lexem.substr(1, lexem.length - 2)\n return ret;\n } else {\n var filterFloat = function (value) {\n if(/^(\\-|\\+)?([0-9]+(\\.[0-9]+)?)$/\n .test(value))\n return Number(value);\n return NaN;\n }\n var filterInt = function (value) {\n if(/^(\\-|\\+)?([0-9]+)$/\n .test(value))\n return parseInt(value);\n return NaN;\n }\n // int constant\n res = filterInt(lexem)\n if (isNaN(res)) {\n // float constant\n res = filterFloat(lexem)\n if (isNaN(res))\n throw \"Constant parse error: \" + lexem;\n var ret = new leaf_const(null, types[3]) // FLOAT\n ret.value = res\n return ret;\n } else {\n var ret = new leaf_const(null, types[2]) // INT\n ret.value = res\n return ret;\n }\n }\n return res\n }\n\n // end -- parse till string passed as a parameter \"end\" (';' by default)\n // type -- expected type of declaration (needed in FOR iterator)\n function parseDecl(lexems, i, end = delimiter, type=null) {\n ret = new decl(null)\n ret.varname = lexems[i] // check it is variable\n if (!checkVarname(ret.varname))\n throw \"Illegal variable name '\" + ret.varname + \"' in declaration.\"\n ret.type = lexems[i + 2].toUpperCase() // check it is type\n var j = i + 3 // next index to check\n if (types.indexOf(ret.type) == -1) {\n if (!type || types.indexOf(type) == -1)\n throw \"Unknown type '\" + ret.type + \"' for variable '\" + ret.varname + \"' in declaration.\"\n ret.type = type; // remember type\n // check there is eq between them\n if (lexems[i + 1] != \"=\")\n throw \"Illegal reduced variable declaration!\"\n else\n j = i + 1\n }\n switch (lexems[j]) {\n case \"=\":\n // TODO make constant evaluation of expression till \";\"!\n // search for a range to parse expression\n var k = j + 1\n while(k < lexems.length) {\n k++\n if (keywords.indexOf(lexems[k]) != -1\n || types.indexOf(lexems[k]) != -1\n || lexems[k] == end)\n break;\n }\n ret.value = parseExpr(lexems, j + 1, k - 1);\n ret.value.parent = ret\n return {\n node: ret,\n last_index: k\n }\n break;\n case end:\n return {\n node: ret,\n last_index: j\n }\n break; \n default:\n throw \"Unexpected token \" + lexems[j];\n break;\n }\n }\n\n function findBalancingBracketIndex(lexems, i, brOpen = brackets[0], brClose = brackets[1]) {\n if (lexems[i] != brOpen)\n return i\n var bracketCount = 1;\n while (bracketCount > 0) {\n i++\n if (i >= lexems.length) return -1; // not found\n switch (lexems[i]) {\n case brOpen:\n bracketCount++\n break\n case brClose:\n bracketCount--\n break\n }\n }\n return i\n }\n\n function parseFuncCall(lexems, i, j) {\n \n let isvar = checkVarname(lexems[i]) // check first lexem to be variable\n if ( lexems [i + 1] != brackets[0] || lexems[j] != brackets[1]) {\n throw \"Function call \" + lexems[i] + \" expected\";\n }\n if (!isvar) {\n throw \"Function name \" + lexems[i] + \" is invalid\"\n }\n\n var ret = new func_call(null);\n ret.func_name = lexems[i];\n var index1 = i + 2\n var index2 = index1\n while (index2 <= j) {\n switch (lexems[index2]) {\n case brackets[0]:\n index2 = findBalancingBracketIndex(lexems, index2);\n break;\n case brackets[1]:\n // check this is the end\n if (index2 != j) // but maybe we can do currying? :)\n throw \"Error parsing function call!\"\n // no break here! let it parse the last arg\n // actually, there can be no arguments in function call\n if (index1 == index2)\n break;\n case \",\":\n var param = parseExpr(lexems, index1, index2 - 1)\n ret.params.push(param)\n param.parent = ret\n index1 = index2 + 1\n break; \n }\n index2++;\n }\n return ret;\n }\n\n // returns node explicitly\n function parseExpr(lexems, i, j) {\n // parsing expression ends with:\n // delimiter ;\n // keyword (ANY keyword)\n var best_op_index = -1\n var best_op_priority = -1\n var tmp = i\n while (tmp <= j) {\n switch (lexems[tmp]) {\n case brackets[0]:\n tmp = findBalancingBracketIndex(lexems, tmp) + 1\n break\n case brackets[1]:\n throw \"Brackets unbalanced in expression\"\n break\n default:\n let opdef = ops.find((val)=>val.op == lexems[tmp])\n if (!opdef) {\n tmp++;\n break;\n }\n let op_prior = opdef.priority\n let op_assoc = opdef.assoc\n if (op_prior >= best_op_priority) {\n if (op_prior > best_op_priority && op_assoc == 2) {\n best_op_index = tmp\n best_op_priority = op_prior\n } else if (op_assoc < 2) {\n best_op_index = tmp\n best_op_priority = op_prior\n }\n }\n tmp++\n }\n }\n if (best_op_priority != -1) { // op found\n // if there is operators with the same priority on the lhs, move earlier\n var idx = best_op_index\n while (idx > i) {\n idx--\n let opdef = ops.find((val)=>val.op == lexems[idx])\n if (!opdef) break; // there is no operators further\n let op_prior = opdef.priority\n let op_assoc = opdef.assoc\n if (op_prior == best_op_priority) {\n best_op_index = idx\n } else break;\n }\n\n var resL = null\n if (best_op_index > i) // not unary operator\n var resL = parseExpr(lexems, i, best_op_index - 1)\n else {\n let opi = ops.findIndex(elm=>elm.op == lexems[best_op_index])\n if (opi == -1 || !ops[opi].unary)\n throw \"Operator \" + lexems[best_op_index] + \" is a binary operator, not unary.\"\n }\n\n var resR = parseExpr(lexems, best_op_index + 1, j)\n var op_type = lexems[best_op_index]\n var ret;\n if (op_type == ops[15].op) { // := assign\n ret = new assign(null)\n ret.varname = resL // maybe error here if not lvalue\n ret.expr = resR\n // parentizing\n resL.parent = ret\n resR.parent = ret\n } else {\n ret = new op(null, lexems[best_op_index])\n ret.lop = resL\n ret.rop = resR\n ret.constant = (resL && resR) ? resL.constant && resR.constant :\n resL ? resL.constant :\n resR ? resR.constant : true\n // parentizing\n if (resL) resL.parent = ret\n if (resR) resR.parent = ret\n }\n return ret\n } else { // op not found\n if (lexems[i] == brackets[0] && lexems[j] == brackets[1]) { // unfold brackets and keep going\n return parseExpr(lexems, i + 1, j - 1)\n }\n // then, there should be function call, const or var expression\n let isvar = checkVarname(lexems[i]) // check first lexem to be variable\n if (i == j) {\n if (isvar) { // if this single lexem is variable, return variable node\n var ret = new leaf_var(null)\n ret.varname = lexems[i]\n return ret\n } else {\n return parseConstant(lexems[i])\n }\n } else if ( lexems [i + 1] == brackets[0] && lexems[j] == brackets[1]) {\n // parse function call here\n return parseFuncCall(lexems, i, j);\n } else {\n throw \"Expression parse error: unexpected lexem \" + lexems[i]\n }\n }\n }\n\n function parseSeq(lexems, i, stop_word = keywords[1]) { // parse begin-end\n var ret = new seq(null)\n\n while (i < lexems.length) {\n let lexem = lexems[i].toUpperCase()\n switch (lexem) {\n case delimiter: // op divider\n i++;\n break;\n case stop_word: // end by default\n // end found, return accumulated node and next index\n if (ret.seq.length != 1)\n return {\n node: ret,\n last_index: i + 1\n }\n else (ret.seq.length == 1) // one operator detected here\n return {\n node: ret.seq[0],\n last_index: i + 1\n }\n default: // parse the operator\n var rs = parseOp(lexems, i)\n i = rs.last_index\n ret.seq.push(rs.node)\n rs.node.parent = ret\n break;\n }\n }\n throw \"Lexem \"+stop_word+\" expected, but not found.\"\n }\n\n // service function to find next keyword from index i\n function findNextKeyword(lexems, i, keyword) {\n while (i < lexems.length) {\n if (lexems[i].toUpperCase() == keyword)\n break\n i++\n }\n return i >= lexems.length ? null : i\n }\n\n // assume begins not from \"IF\"\n function parseIf(lexems, i) {\n var ret = new ite(null)\n // find THEN\n var j = findNextKeyword(lexems, i, keywords[3])\n var rs = parseExpr(lexems, i, j - 1)\n ret.if = rs\n ret.if.parent = ret\n // call parseSeq (even if there is no begin-end)\n // rs = parseOp(lexems, j + 1) // one operator version\n var needsSecondParse = false\n try {\n rs = parseSeq(lexems, j + 1, keywords[1])\n } catch (e) { // mostly occurs if ELSE found earlier, than END\n rs = parseSeq(lexems, j + 1, keywords[4])\n needsSecondParse = true\n }\n ret.then = rs.node\n ret.then.parent = ret\n i = rs.last_index\n // if (lexems[i] == keywords[4]) { // ELSE (one operator version)\n if (needsSecondParse) { // next generation version\n // rs = parseOp(lexems, i + 1) // one operator version\n rs = parseSeq(lexems, i, keywords[11]) // parse till fi\n ret.else = rs.node\n ret.else.parent = ret\n i = rs.last_index\n }\n return {\n node: ret,\n last_index: i\n }\n }\n \n // assume begins not from \"DO\"\n function parseDoWhile(lexems, i) {\n var ret = new dw(null)\n // parse till WHILE\n var res = parseSeq(lexems, i, keywords[6])\n ret.op = res.node\n ret.op.parent = ret\n i = res.last_index\n // find OD\n j = findNextKeyword(lexems, i, keywords[12])\n if (j == null) throw \"No closing '\" + keywords[12] +\"' keyword for DO WHILE statement\"\n ret.condition = parseExpr(lexems, i, j - 1)\n ret.condition.parent = ret\n return {\n node: ret,\n last_index: j + 1 // OD must be ignored!\n }\n }\n\n // assume begins not from \"WHILE\"\n function parseWhileDo(lexems, i) {\n var ret = new dw(null, true)\n // find DO\n var j = findNextKeyword(lexems, i, keywords[5])\n if (j == null) throw \"No '\" + keywords[5] + \"' keyword found after '\" + keywords[6] + \"' statement.\"\n ret.condition = parseExpr(lexems, i, j - 1)\n ret.condition.parent = ret\n i = j + 1\n // parse till OD\n let res = parseSeq(lexems, i, keywords[12])\n ret.op = res.node\n ret.op.parent = ret\n return {\n node: ret,\n last_index: res.last_index\n }\n }\n\n // assume begins not from \"FOR\"\n function parseFor(lexems, i) {\n //throw \"NOT IMPLEMENTED YET\"\n // parse as decl till endword \"TO\"\n let to_idx = findNextKeyword(lexems, i, keywords[15]) // TO\n let downto_idx = findNextKeyword(lexems, i, keywords[16]) // or DOWNTO\n var downto = (downto_idx == null) ? false : (to_idx > downto_idx) ? false : true\n var result; // the declaration parse result\n if (downto) {\n result = parseDecl(lexems, i, keywords[16], types[2]) // parse till DOWNTO\n } else {\n result = parseDecl(lexems, i, keywords[15], types[2]) // parse till TO\n }\n\n var decl = result.node\n var j = result.last_index\n // parse as expr till \"STEP\" (if present)\n var j_step = findNextKeyword(lexems, j, keywords[17])\n var j_do = findNextKeyword(lexems, j, keywords[5])\n if (j_do == null) throw \"Expected \"+keywords[5]+\" expression in \" + keywords[7] + \" expression.\"\n var to_expr = null\n var step_expr = null\n if (j_step != null && j_step < j_do) {\n // parse TO\n to_expr = parseExpr(lexems, j + 1, j_step - 1)\n j = j_step\n // parse STEP\n step_expr = parseExpr(lexems, j + 1, j_do - 1)\n j = j_do\n } else {\n // parse TO\n to_expr = parseExpr(lexems, j + 1, j_do - 1)\n j = j_do\n }\n // from here parse sequence till \"ROF\"\n var result = parseSeq(lexems, j + 1, keywords[13])\n var op_seq = result.node\n j = result.last_index\n // building return result\n\n var ret = new seq()\n ret.seq.push(decl)\n decl.parent = ret\n \n var do_while = new dw(ret, true) // interpret as while-do\n\n // ops[9].op -> \">=\"; ops[10].op -> \"<=\"\n let comparison_op = downto ? ops[9].op : ops[10].op\n do_while.condition = new op(do_while, comparison_op)\n let getIterVar = function(parent) {\n let iter_var = new leaf_var(parent)\n iter_var.varname = decl.varname\n return iter_var\n }\n do_while.condition.lop = getIterVar(do_while.condition)\n do_while.condition.rop = to_expr\n do_while.condition.rop.parent = do_while.condition\n\n if (op_seq instanceof seq) {\n do_while.op = op_seq\n do_while.op.parent = do_while\n } else {\n do_while.op = new seq(do_while)\n do_while.op.seq.push(op_seq)\n }\n\n var ass = new assign(do_while.op)\n ass.varname = getIterVar(ass)\n ass.expr = new op(do_while.op, downto ? ops[4].op : ops[3].op)\n ass.expr.lop = getIterVar(ass.expr)\n if (step_expr) {\n ass.expr.rop = step_expr\n } else {\n ass.expr.rop = new leaf_const(ass.expr, type[2])\n ass.expr.rop.value = 1\n }\n\n do_while.op.seq.push(ass)\n \n ret.seq.push(do_while)\n return {\n node: ret,\n last_index: j\n }\n }\n \n // parsing function call\n // expecting parsing behind \"FUNCTION\" keyword\n function parseFunction(lexems, i) {\n var ret = new func_def(null)\n let isvar = checkVarname(lexems[i]) // check first lexem to be function name\n if (!isvar) {\n throw \"Function name \" + lexems[i] + \" is invalid.\"\n }\n ret.func_name = lexems[i]\n if ( lexems [i + 1] != brackets[0]) {\n throw \"Parameter list in function definition \" + lexems[i] + \" expected!\";\n }\n let right_bracket = findBalancingBracketIndex(lexems, i + 1)\n if (right_bracket == -1)\n throw \"No balancing bracket found for function declaration parameters\"\n i = i + 2;\n var res;\n for (j = i; j <= right_bracket; j++) {\n switch (lexems[j]) {\n case '(': // skip bracketing\n j = findBalancingBracketIndex(lexems, j); // plus one during for!\n break;\n case ',':\n res = parseDecl(lexems, i, ',')\n ret.params.push(res.node)\n res.node.parent = ret\n j = res.last_index // plus one during for!\n i = j + 1\n break;\n case ')':\n res = parseDecl(lexems, i, ')')\n ret.params.push(res.node)\n res.node.parent = ret\n j = res.last_index // plus one during for!\n i = j + 1\n break;\n }\n }\n // check if there is defined return type of function\n ret.type = null\n if (lexems[i] == \":\") {\n let type_id = types.indexOf(lexems[i + 1])\n if (type_id == -1)\n throw \"Unknown return type of function declaration \" + ret.func_name + \"!\"\n ret.type = lexems[i + 1]\n i = i + 2\n }\n // parse function body as usual -- as operator\n res = parseOp(lexems, i)\n ret.op = res.node\n ret.op.parent = ret\n return {\n node: ret,\n last_index: res.last_index\n }\n \n }\n\n // parsing program as a single operator\n return parseOp(lexems, 0) \n}", "title": "" }, { "docid": "e8a87262355976564a30257708f7ff24", "score": "0.5560921", "text": "function parsePrimaryExpression() {\n var type, token, expr, node;\n\n if (match('(')) {\n isBindingElement = false;\n return inheritCoverGrammar(parseGroupExpression);\n }\n\n if (match('[')) {\n return inheritCoverGrammar(parseArrayInitializer);\n }\n\n if (match('{')) {\n return inheritCoverGrammar(parseObjectInitializer);\n }\n\n type = lookahead.type;\n node = new Node();\n\n if (type === Token.Identifier) {\n if (state.sourceType === 'module' && lookahead.value === 'await') {\n tolerateUnexpectedToken(lookahead);\n }\n expr = node.finishIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n isAssignmentTarget = isBindingElement = false;\n if (strict && lookahead.octal) {\n tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n }\n expr = node.finishLiteral(lex());\n } else if (type === Token.Keyword) {\n if (!strict && state.allowYield && matchKeyword('yield')) {\n return parseNonComputedProperty();\n }\n isAssignmentTarget = isBindingElement = false;\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n return node.finishThisExpression();\n }\n if (matchKeyword('class')) {\n return parseClassExpression();\n }\n throwUnexpectedToken(lex());\n } else if (type === Token.BooleanLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = (token.value === 'true');\n expr = node.finishLiteral(token);\n } else if (type === Token.NullLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = null;\n expr = node.finishLiteral(token);\n } else if (match('/') || match('/=')) {\n isAssignmentTarget = isBindingElement = false;\n index = startIndex;\n\n if (typeof extra.tokens !== 'undefined') {\n token = collectRegex();\n } else {\n token = scanRegExp();\n }\n lex();\n expr = node.finishLiteral(token);\n } else if (type === Token.Template) {\n expr = parseTemplateLiteral();\n } else {\n throwUnexpectedToken(lex());\n }\n\n return expr;\n }", "title": "" }, { "docid": "8fdca47a53ef31620caa798d13f44889", "score": "0.5551279", "text": "function parsePrimaryExpression() {\n var type, token, expr, node;\n\n if (match('(')) {\n isBindingElement = false;\n return inheritCoverGrammar(parseGroupExpression);\n }\n\n if (match('[')) {\n return inheritCoverGrammar(parseArrayInitializer);\n }\n\n if (match('{')) {\n return inheritCoverGrammar(parseObjectInitializer);\n }\n\n type = lookahead.type;\n node = new Node();\n\n if (type === Token.Identifier) {\n if (state.sourceType === 'module' && lookahead.value === 'await') {\n tolerateUnexpectedToken(lookahead);\n }\n expr = node.finishIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n isAssignmentTarget = isBindingElement = false;\n if (strict && lookahead.octal) {\n tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n }\n expr = node.finishLiteral(lex());\n } else if (type === Token.Keyword) {\n if (!strict && state.allowYield && matchKeyword('yield')) {\n return parseNonComputedProperty();\n }\n if (!strict && matchKeyword('let')) {\n return node.finishIdentifier(lex().value);\n }\n isAssignmentTarget = isBindingElement = false;\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n return node.finishThisExpression();\n }\n if (matchKeyword('class')) {\n return parseClassExpression();\n }\n throwUnexpectedToken(lex());\n } else if (type === Token.BooleanLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = (token.value === 'true');\n expr = node.finishLiteral(token);\n } else if (type === Token.NullLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = null;\n expr = node.finishLiteral(token);\n } else if (match('/') || match('/=')) {\n isAssignmentTarget = isBindingElement = false;\n index = startIndex;\n\n if (typeof extra.tokens !== 'undefined') {\n token = collectRegex();\n } else {\n token = scanRegExp();\n }\n lex();\n expr = node.finishLiteral(token);\n } else if (type === Token.Template) {\n expr = parseTemplateLiteral();\n } else {\n throwUnexpectedToken(lex());\n }\n\n return expr;\n }", "title": "" }, { "docid": "8fdca47a53ef31620caa798d13f44889", "score": "0.5551279", "text": "function parsePrimaryExpression() {\n var type, token, expr, node;\n\n if (match('(')) {\n isBindingElement = false;\n return inheritCoverGrammar(parseGroupExpression);\n }\n\n if (match('[')) {\n return inheritCoverGrammar(parseArrayInitializer);\n }\n\n if (match('{')) {\n return inheritCoverGrammar(parseObjectInitializer);\n }\n\n type = lookahead.type;\n node = new Node();\n\n if (type === Token.Identifier) {\n if (state.sourceType === 'module' && lookahead.value === 'await') {\n tolerateUnexpectedToken(lookahead);\n }\n expr = node.finishIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n isAssignmentTarget = isBindingElement = false;\n if (strict && lookahead.octal) {\n tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n }\n expr = node.finishLiteral(lex());\n } else if (type === Token.Keyword) {\n if (!strict && state.allowYield && matchKeyword('yield')) {\n return parseNonComputedProperty();\n }\n if (!strict && matchKeyword('let')) {\n return node.finishIdentifier(lex().value);\n }\n isAssignmentTarget = isBindingElement = false;\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n return node.finishThisExpression();\n }\n if (matchKeyword('class')) {\n return parseClassExpression();\n }\n throwUnexpectedToken(lex());\n } else if (type === Token.BooleanLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = (token.value === 'true');\n expr = node.finishLiteral(token);\n } else if (type === Token.NullLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = null;\n expr = node.finishLiteral(token);\n } else if (match('/') || match('/=')) {\n isAssignmentTarget = isBindingElement = false;\n index = startIndex;\n\n if (typeof extra.tokens !== 'undefined') {\n token = collectRegex();\n } else {\n token = scanRegExp();\n }\n lex();\n expr = node.finishLiteral(token);\n } else if (type === Token.Template) {\n expr = parseTemplateLiteral();\n } else {\n throwUnexpectedToken(lex());\n }\n\n return expr;\n }", "title": "" }, { "docid": "8fdca47a53ef31620caa798d13f44889", "score": "0.5551279", "text": "function parsePrimaryExpression() {\n var type, token, expr, node;\n\n if (match('(')) {\n isBindingElement = false;\n return inheritCoverGrammar(parseGroupExpression);\n }\n\n if (match('[')) {\n return inheritCoverGrammar(parseArrayInitializer);\n }\n\n if (match('{')) {\n return inheritCoverGrammar(parseObjectInitializer);\n }\n\n type = lookahead.type;\n node = new Node();\n\n if (type === Token.Identifier) {\n if (state.sourceType === 'module' && lookahead.value === 'await') {\n tolerateUnexpectedToken(lookahead);\n }\n expr = node.finishIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n isAssignmentTarget = isBindingElement = false;\n if (strict && lookahead.octal) {\n tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);\n }\n expr = node.finishLiteral(lex());\n } else if (type === Token.Keyword) {\n if (!strict && state.allowYield && matchKeyword('yield')) {\n return parseNonComputedProperty();\n }\n if (!strict && matchKeyword('let')) {\n return node.finishIdentifier(lex().value);\n }\n isAssignmentTarget = isBindingElement = false;\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n return node.finishThisExpression();\n }\n if (matchKeyword('class')) {\n return parseClassExpression();\n }\n throwUnexpectedToken(lex());\n } else if (type === Token.BooleanLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = (token.value === 'true');\n expr = node.finishLiteral(token);\n } else if (type === Token.NullLiteral) {\n isAssignmentTarget = isBindingElement = false;\n token = lex();\n token.value = null;\n expr = node.finishLiteral(token);\n } else if (match('/') || match('/=')) {\n isAssignmentTarget = isBindingElement = false;\n index = startIndex;\n\n if (typeof extra.tokens !== 'undefined') {\n token = collectRegex();\n } else {\n token = scanRegExp();\n }\n lex();\n expr = node.finishLiteral(token);\n } else if (type === Token.Template) {\n expr = parseTemplateLiteral();\n } else {\n throwUnexpectedToken(lex());\n }\n\n return expr;\n }", "title": "" }, { "docid": "46710278ea396f3b469f364b7e43b1a6", "score": "0.55335903", "text": "function nest(t, x, node, func, end) {\n x.stmtStack.push(node);\n var n = func(t, x);\n x.stmtStack.pop();\n end && t.mustMatch(end);\n return n;\n}", "title": "" }, { "docid": "709f35d76589d29f78032fc4c4262a18", "score": "0.55301386", "text": "function parseExpr() {\n assert(['Identifier', 'LeftBracket']);\n\n if (token.name === 'Identifier') {\n return token;\n }\n\n assert(['LeftBracket']);\n const list = parseList();\n return list;\n }", "title": "" }, { "docid": "97ee8bcc278bc617d565707029d0c353", "score": "0.5526968", "text": "function expression_handler(expr) {\n // check for single-quotes, throw error if there are\n // any, since we use them in the wrap_capture command\n if (expr.indexOf(\"'\") >= 0) {\n throw \"Error: expression cannot contain single-quotes at this time.\\nPlease use double-quotes instead.\";\n }\n if (expr.charAt(0) == \"#\") { // comments\n return expr;\n }\n // first char can only be . or alphanum. second can be ., alpha, _. All subsequent can be ., alphanum, _\n // see variable_name_regexp.txt\n var reg = RegExp(\"^([\\\\.]([\\\\.a-zA-Z_][\\\\.a-zA-Z0-9_]*)?|([a-zA-Z]([\\\\.a-zA-Z0-9_]*)?))$\");\n if (reg.test(expr)) {\n return wrap_variable_access(expr);\n }\n if (expr.substring(0,4) == 'help') {\n return wrap_help_cmd(expr);\n }\n if (expr.substring(0,4) == 'plot') {\n return wrap_plot_cmd(expr);\n } // else\n return wrap_capture(expr);\n}", "title": "" }, { "docid": "bd24ac2692680175c0ffd0232c4261a8", "score": "0.55018735", "text": "function parseExprList(close, allowTrailingComma, allowEmpty) {\n var elts = [], first = true;\n while (!eat(close)) {\n if (!first) {\n expect(_comma);\n if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break;\n } else first = false;\n\n if (allowEmpty && tokType === _comma) elts.push(null);\n else elts.push(parseExpression(true));\n }\n return elts;\n }", "title": "" }, { "docid": "bd24ac2692680175c0ffd0232c4261a8", "score": "0.55018735", "text": "function parseExprList(close, allowTrailingComma, allowEmpty) {\n var elts = [], first = true;\n while (!eat(close)) {\n if (!first) {\n expect(_comma);\n if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break;\n } else first = false;\n\n if (allowEmpty && tokType === _comma) elts.push(null);\n else elts.push(parseExpression(true));\n }\n return elts;\n }", "title": "" }, { "docid": "bd24ac2692680175c0ffd0232c4261a8", "score": "0.55018735", "text": "function parseExprList(close, allowTrailingComma, allowEmpty) {\n var elts = [], first = true;\n while (!eat(close)) {\n if (!first) {\n expect(_comma);\n if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break;\n } else first = false;\n\n if (allowEmpty && tokType === _comma) elts.push(null);\n else elts.push(parseExpression(true));\n }\n return elts;\n }", "title": "" }, { "docid": "bd24ac2692680175c0ffd0232c4261a8", "score": "0.55018735", "text": "function parseExprList(close, allowTrailingComma, allowEmpty) {\n var elts = [], first = true;\n while (!eat(close)) {\n if (!first) {\n expect(_comma);\n if (allowTrailingComma && options.allowTrailingCommas && eat(close)) break;\n } else first = false;\n\n if (allowEmpty && tokType === _comma) elts.push(null);\n else elts.push(parseExpression(true));\n }\n return elts;\n }", "title": "" }, { "docid": "90d3d751986b43ed7f22da57c2dad473", "score": "0.5497599", "text": "function doParse(node) {\n var head;\n if (isArray(node)) {\n if (node.length == 0) {\n throw new SyntaxError(\"syntax error: \" + node);\n } else {\n head = node[0];\n switch(head) {\n case 'seq':\n return parseBlock(node);\n case 'define':\n return parseDefine(node);\n case 'if':\n return parseIf(node);\n case 'lambda':\n return parseLambda(node);\n case 'quote':\n return parseQuote(node);\n case 'cond':\n return parseCond(node);\n default:\n return parseApply(node);\n }\n }\n } else {\n return node;\n }\n}", "title": "" }, { "docid": "6d8cd6a7feacafcd300c97acd098a629", "score": "0.54857194", "text": "function eatExpression() {\n var expr = eatLogicalOrExpression();\n if (moreTokens()) {\n var token = peekToken();\n if (token.getKind() === _TokenKind.TokenKind.ASSIGN) {\n // a=b\n if (expr === null) {\n expr = _NullLiteral.NullLiteral.create(toPosBounds(token.startPos - 1, token.endPos - 1));\n }\n nextToken();\n var assignedValue = eatLogicalOrExpression();\n return _Assign.Assign.create(toPosToken(token), expr, assignedValue);\n }\n\n if (token.getKind() === _TokenKind.TokenKind.ELVIS) {\n // a?:b (a if it isn't null, otherwise b)\n if (expr === null) {\n expr = _NullLiteral.NullLiteral.create(toPosBounds(token.startPos - 1, token.endPos - 2));\n }\n nextToken(); // elvis has left the building\n var valueIfNull = eatExpression();\n if (valueIfNull === null) {\n valueIfNull = _NullLiteral.NullLiteral.create(toPosBounds(token.startPos + 1, token.endPos + 1));\n }\n return _Elvis.Elvis.create(toPosToken(token), expr, valueIfNull);\n }\n\n if (token.getKind() === _TokenKind.TokenKind.QMARK) {\n // a?b:c\n if (expr === null) {\n expr = _NullLiteral.NullLiteral.create(toPosBounds(token.startPos - 1, token.endPos - 1));\n }\n nextToken();\n var ifTrueExprValue = eatExpression();\n eatToken(_TokenKind.TokenKind.COLON);\n var ifFalseExprValue = eatExpression();\n return _Ternary.Ternary.create(toPosToken(token), expr, ifTrueExprValue, ifFalseExprValue);\n }\n }\n return expr;\n }", "title": "" }, { "docid": "2212e8cc6ba157faa4b31cd009fc0193", "score": "0.5480402", "text": "function evaluateAst(tree, context){\n\n var safeFunction = FunctionFactory(context)\n var primitives = Primitives(context)\n\n // block scoped context for catch (ex) and 'let'\n var blockContext = context\n\n return walk(tree)\n\n // recursively walk every node in an array\n function walkAll(nodes){\n var result = undefined\n for (var i=0;i<nodes.length;i++){\n var childNode = nodes[i]\n if (childNode.type === 'EmptyStatement') continue\n result = walk(childNode)\n if (result instanceof ReturnValue){\n return result\n }\n }\n return result\n }\n\n // recursively evalutate the node of an AST\n function walk(node){\n if (!node) return\n switch (node.type) {\n\n case 'Program':\n return walkAll(node.body)\n\n case 'BlockStatement':\n enterBlock()\n var result = walkAll(node.body)\n leaveBlock()\n return result\n\n case 'FunctionDeclaration':\n var params = node.params.map(getName)\n var value = getFunction(node.body, params, blockContext)\n return context[node.id.name] = value\n\n case 'FunctionExpression':\n var params = node.params.map(getName)\n return getFunction(node.body, params, blockContext)\n\n case 'ReturnStatement':\n var value = walk(node.argument)\n return new ReturnValue('return', value)\n\n case 'BreakStatement':\n return new ReturnValue('break')\n\n case 'ContinueStatement':\n return new ReturnValue('continue')\n\n case 'ExpressionStatement':\n return walk(node.expression)\n\n case 'AssignmentExpression':\n return setValue(blockContext, node.left, node.right, node.operator)\n\n case 'UpdateExpression':\n return setValue(blockContext, node.argument, null, node.operator)\n\n case 'VariableDeclaration':\n node.declarations.forEach(function(declaration){\n var target = node.kind === 'let' ? blockContext : context\n if (declaration.init){\n target[declaration.id.name] = walk(declaration.init)\n } else {\n target[declaration.id.name] = undefined\n }\n })\n break\n\n case 'SwitchStatement':\n var defaultHandler = null\n var matched = false\n var value = walk(node.discriminant)\n var result = undefined\n\n enterBlock()\n\n var i = 0\n while (result == null){\n if (i<node.cases.length){\n if (node.cases[i].test){ // check or fall through\n matched = matched || (walk(node.cases[i].test) === value)\n } else if (defaultHandler == null) {\n defaultHandler = i\n }\n if (matched){\n var r = walkAll(node.cases[i].consequent)\n if (r instanceof ReturnValue){ // break out\n if (r.type == 'break') break\n result = r\n }\n }\n i += 1 // continue\n } else if (!matched && defaultHandler != null){\n // go back and do the default handler\n i = defaultHandler\n matched = true\n } else {\n // nothing we can do\n break\n }\n }\n\n leaveBlock()\n return result\n\n case 'IfStatement':\n if (walk(node.test)){\n return walk(node.consequent)\n } else if (node.alternate) {\n return walk(node.alternate)\n }\n\n case 'ForStatement':\n var infinite = InfiniteChecker(maxIterations)\n var result = undefined\n\n enterBlock() // allow lets on delarations\n for (walk(node.init); walk(node.test); walk(node.update)){\n var r = walk(node.body)\n\n // handle early return, continue and break\n if (r instanceof ReturnValue){\n if (r.type == 'continue') continue\n if (r.type == 'break') break\n result = r\n break\n }\n\n infinite.check()\n }\n leaveBlock()\n return result\n\n case 'ForInStatement':\n var infinite = InfiniteChecker(maxIterations)\n var result = undefined\n\n var value = walk(node.right)\n var property = node.left\n\n var target = context\n enterBlock()\n\n if (property.type == 'VariableDeclaration'){\n walk(property)\n property = property.declarations[0].id\n if (property.kind === 'let'){\n target = blockContext\n }\n }\n\n for (var key in value){\n setValue(target, property, {type: 'Literal', value: key})\n var r = walk(node.body)\n\n // handle early return, continue and break\n if (r instanceof ReturnValue){\n if (r.type == 'continue') continue\n if (r.type == 'break') break\n result = r\n break\n }\n\n infinite.check()\n }\n leaveBlock()\n\n return result\n\n case 'WhileStatement':\n var infinite = InfiniteChecker(maxIterations)\n while (walk(node.test)){\n walk(node.body)\n infinite.check()\n }\n break\n\n case 'TryStatement':\n try {\n walk(node.block)\n } catch (error) {\n enterBlock()\n var catchClause = node.handlers[0]\n if (catchClause) {\n blockContext[catchClause.param.name] = error\n walk(catchClause.body)\n }\n leaveBlock()\n } finally {\n if (node.finalizer) {\n walk(node.finalizer)\n }\n }\n break\n\n case 'Literal':\n return node.value\n\n case 'UnaryExpression':\n var val = walk(node.argument)\n switch(node.operator) {\n case '+': return +val\n case '-': return -val\n case '~': return ~val\n case '!': return !val\n case 'typeof': return typeof val\n default: return unsupportedExpression(node)\n }\n\n case 'ArrayExpression':\n var obj = blockContext['Array']()\n for (var i=0;i<node.elements.length;i++){\n obj.push(walk(node.elements[i]))\n }\n return obj\n\n case 'ObjectExpression':\n var obj = blockContext['Object']()\n for (var i = 0; i < node.properties.length; i++) {\n var prop = node.properties[i]\n var value = (prop.value === null) ? prop.value : walk(prop.value)\n obj[prop.key.value || prop.key.name] = value\n }\n return obj\n\n case 'NewExpression':\n var args = node.arguments.map(function(arg){\n return walk(arg)\n })\n var target = walk(node.callee)\n return primitives.applyNew(target, args)\n\n\n case 'BinaryExpression':\n var l = walk(node.left)\n var r = walk(node.right)\n switch(node.operator) {\n case '==': return l === r\n case '===': return l === r\n case '!=': return l != r\n case '!==': return l !== r\n case '+': return l + r\n case '-': return l - r\n case '*': return l * r\n case '/': return l / r\n case '%': return l % r\n case '<': return l < r\n case '<=': return l <= r\n case '>': return l > r\n case '>=': return l >= r\n case '|': return l | r\n case '&': return l & r\n case '^': return l ^ r\n case 'instanceof': return l instanceof r\n default: return unsupportedExpression(node)\n }\n\n case 'LogicalExpression':\n switch(node.operator) {\n case '&&': return walk(node.left) && walk(node.right)\n case '||': return walk(node.left) || walk(node.right)\n default: return unsupportedExpression(node)\n }\n\n case 'ThisExpression':\n return blockContext['this']\n\n case 'Identifier':\n if (node.name === 'undefined'){\n return undefined\n } else if (hasProperty(blockContext, node.name, primitives)){\n return finalValue(blockContext[node.name])\n } else {\n throw new ReferenceError(node.name + ' is not defined')\n }\n\n case 'CallExpression':\n var args = node.arguments.map(function(arg){\n return walk(arg)\n })\n var object = null\n var target = walk(node.callee)\n\n if (node.callee.type === 'MemberExpression'){\n object = walk(node.callee.object)\n }\n return target.apply(object, args)\n\n case 'MemberExpression':\n var obj = walk(node.object)\n if (node.computed){\n var prop = walk(node.property)\n } else {\n var prop = node.property.name\n }\n obj = primitives.getPropertyObject(obj, prop)\n return checkValue(obj[prop]);\n\n case 'ConditionalExpression':\n var val = walk(node.test)\n return val ? walk(node.consequent) : walk(node.alternate)\n\n case 'EmptyStatement':\n return\n\n default:\n return unsupportedExpression(node)\n }\n }\n\n // safely retrieve a value\n function checkValue(value){\n if (value === Function$1){\n value = safeFunction\n }\n return finalValue(value)\n }\n\n // block scope context control\n function enterBlock(){\n blockContext = Object.create(blockContext)\n }\n function leaveBlock(){\n blockContext = Object.getPrototypeOf(blockContext)\n }\n\n // set a value in the specified context if allowed\n function setValue(object, left, right, operator){\n var name = null\n\n if (left.type === 'Identifier'){\n name = left.name\n // handle parent context shadowing\n object = objectForKey(object, name, primitives)\n } else if (left.type === 'MemberExpression'){\n if (left.computed){\n name = walk(left.property)\n } else {\n name = left.property.name\n }\n object = walk(left.object)\n }\n\n // stop built in properties from being able to be changed\n if (canSetProperty(object, name, primitives)){\n switch(operator) {\n case undefined: return object[name] = walk(right)\n case '=': return object[name] = walk(right)\n case '+=': return object[name] += walk(right)\n case '-=': return object[name] -= walk(right)\n case '++': return object[name]++\n case '--': return object[name]--\n }\n }\n\n }\n\n}", "title": "" }, { "docid": "7d7163e352d9c05038fb18877a62a662", "score": "0.5467929", "text": "function doArithmetic(expression)\n{\n expression = expression.trim();\n\n //remove the parentheses first\n if(expression.charAt(0) === \"(\" &&\n expression === extractOutermostGroup(expression, \"(\", \")\"))\n {\n counter++;\n setTimeout(unhighlightParentheses, counter*TIMEINTERVAL, stackFrameIndex);\n expression = expression.substring(1, expression.length-1);\n }\n\n setTimeout(playEvalArithSound, counter * TIMEINTERVAL);\n\n let parseResult = parseExpression(expression);\n let components = parseResult[0];\n let precedenceCount = parseResult[1];\n\n //replace the current line with prettified spacing\n let betterSpacing = components.join(\" \");\n\n if(!(betterSpacing === expression))\n {\n counter++;\n setTimeout(replaceValueOnLine, counter * TIMEINTERVAL,\n expression, betterSpacing, stackFrameIndex);\n }\n\n let originalComponentsLength = components.length;\n\n //execute operations in order of precedence\n for(let i = 0; i < precedenceCount.length; i++)\n {\n while(precedenceCount[i] > 0)\n {\n //look for the first occurence of an operator of this precedence\n let j = 1;\n while(j < components.length)\n {\n if(precedence[i].includes(components[j])) { break; }\n\n j += 2;\n }\n\n let highlightAndReplace = components[j-1] + \" \"\n + components[j] + \" \" + components[j+1];\n\n //highlight this part of the expression, if needed\n if(originalComponentsLength != 3)\n {\n counter++;\n setTimeout(playEvalArithSound, counter * TIMEINTERVAL);\n setTimeout(highlightPortion, counter * TIMEINTERVAL,\n highlightAndReplace, \"line\" + stackFrameIndex, \"\");\n }\n\n let soFar = components.slice(0, j-1).join(\" \");\n\n //do the actual calculation\n let result = calculateExpression(components[j-1],\n components[j], components[j+1], soFar);\n\n let numResult = result[0];\n let currExpr = result[1];\n\n //replace result on line, play snap sound\n counter++;\n setTimeout(playSnapSound, counter * TIMEINTERVAL);\n setTimeout(replaceValueOnLine, counter * TIMEINTERVAL,\n currExpr, pythonize(numResult), stackFrameIndex);\n\n //replace array with the calculated value\n components[j-1] = numResult;\n\n //remove the remainder of this expression\n components.splice(j, 2);\n\n precedenceCount[i] -= 1;\n }\n }\n\n //console.log(components[0]);\n return components[0];\n}", "title": "" } ]
48735c13af45cb4aedf5c9d03bc6936d
fetch already authentciated user
[ { "docid": "d2f6bd32de5c74f7e3b7b5a39fcdc070", "score": "0.0", "text": "function fetchUser() {\n return function (dispatch) {\n dispatch({\n type: _types__WEBPACK_IMPORTED_MODULE_3__[/* FETCH_FIREBASE_USER_STARTED */ \"q\"]\n });\n return Promise.resolve(_firebase_firebase__WEBPACK_IMPORTED_MODULE_1__[/* default */ \"a\"].fetchUser().then(function (request) {\n if (request && !request.errorCode) {\n dispatch({\n type: _types__WEBPACK_IMPORTED_MODULE_3__[/* FETCH_FIREBASE_USER */ \"o\"],\n payload: request\n });\n } else {\n dispatch({\n type: _types__WEBPACK_IMPORTED_MODULE_3__[/* FEEDBACK_DISPLAY_ERROR */ \"m\"],\n error: request\n });\n }\n\n return dispatch({\n type: _types__WEBPACK_IMPORTED_MODULE_3__[/* FETCH_FIREBASE_USER_FINISHED */ \"p\"]\n });\n }));\n };\n}", "title": "" } ]
[ { "docid": "f055454a736f73f806fa1e25f4faa850", "score": "0.69458616", "text": "function getUser () {return user;}", "title": "" }, { "docid": "bf0933110855bb9ed01042952929060b", "score": "0.6836691", "text": "fetchUser() {\n\t\tconst user = _userFromAccessToken(_accessToken);\n\t\treturn _makeRequest('/users/' + user.id, {needsAuth: true})\n\t\t\t.then(responseData => {\n\t\t\t\tif(responseData.success){\n\t\t\t\t\treturn responseData.user;\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\tconsole.error(error);\n\t\t\t});\n\t}", "title": "" }, { "docid": "84b19b2b62626804fea58bb562260250", "score": "0.6822438", "text": "function getAuthUser(){\n var cache = cacheService(\n function(){\n $http.get(window.SERVER+'/backend/user/get-auth').success( function(response){\n if (response.success==false){\n cache.end( null );\n }else{\n cache.end( userService(response) );\n }\n }).error( function(response){\n cache.end( null );\n })\n }, 'user_getAuthUser', 20\n );\n return cache.promise;\n }", "title": "" }, { "docid": "9498169cccb3b3fda4095b3acec02516", "score": "0.66668594", "text": "static async getCurrentUser(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }", "title": "" }, { "docid": "c16ccb36cb1ac61ad7f09df40061e167", "score": "0.6625985", "text": "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.tokenInfo.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t}", "title": "" }, { "docid": "cddfa6b8a884d43dbfe598fda08ab515", "score": "0.66124564", "text": "async getExistingUser () {\n\t\tconst { email } = this.request.body.user;\n\t\tif (!email) {\n\t\t\tthrow this.errorHandler.error('parameterRequired', { info: 'user.email' });\n\t\t}\n\t\tconst users = await this.data.users.getByQuery(\n\t\t\t{\n\t\t\t\tsearchableEmail: decodeURIComponent(email).toLowerCase()\n\t\t\t},\n\t\t\t{\n\t\t\t\thint: UserIndexes.bySearchableEmail\n\t\t\t}\n\t\t);\n\t\tthis.existingUser = users.find(user => {\n\t\t\treturn (\n\t\t\t\t!user.get('deactivated') &&\n\t\t\t\t(user.get('teamIds') || []).length === 0\n\t\t\t);\n\t\t});\n\t}", "title": "" }, { "docid": "b12a642e5dcb459d6c4b0af1c0077f91", "score": "0.6607944", "text": "async loadUser () {\n const token = getLocalStorage('token');\n\n // if (token && !this.token) {\n // this.token = token\n // }\n\n if (token && !this.user) {\n try {\n const user = await this.getUser();\n this.user = user\n } catch (e) {\n console.error(e)\n signout()\n }\n }\n\n // const authSuccess = !!this.user && !!this.token;\n\n return this.user;\n }", "title": "" }, { "docid": "6cd654ee5d95e2fc27b53a1208e45fb3", "score": "0.6569636", "text": "static async getCurrentUser(username) {\n let res = await this.request(`api/users/${username}`);\n return res.user;\n }", "title": "" }, { "docid": "adc5d4212cb3e027887b3e80f059be26", "score": "0.6562295", "text": "getUserDataForLogin(existingUser){\n return fetch(`${remoteURL}/users?name=${existingUser.name}&email=${existingUser.email}`)\n .then(response => response.json())\n }", "title": "" }, { "docid": "0556dc68f5d7965724b7c9700ffe9713", "score": "0.6558111", "text": "getUsers() {\n const { userSession } = this.state;\n\n fetch(\"http://localhost:3000/api/v1/users\")\n .then(res => res.json())\n .then(users => {\n if (userSession.isUserSignedIn()) {\n const userData = userSession.loadUserData();\n\n this.setState({\n userData\n });\n\n let currentUser = users.find(\n user => user.username === userData.username\n );\n\n if (currentUser) {\n this.setState({ users, currentUser });\n } else {\n this.createUser(userData.username);\n }\n }\n });\n }", "title": "" }, { "docid": "62776aa6ee87307d42459cc3b19d7cc8", "score": "0.6545752", "text": "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "62776aa6ee87307d42459cc3b19d7cc8", "score": "0.6545752", "text": "function resolveAuthenticatedUser(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('otp');\n\t\t\t\t//workflow on new user or existing user need to be added here\n\t\t\t\t//api need to return is the user is new or old\n\t\t\t}else{\n\t\t\t\t//wrong otp\n\t\t\t\t//otp authentication failed\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "48115b4cf14b600f12ee99d370279dab", "score": "0.650428", "text": "async profile(_, __, { auth }) {\n try {\n await auth.check();\n const user = await auth.getUser();\n\n return user;\n } catch (error) {\n throw new Error(error);\n }\n }", "title": "" }, { "docid": "58ebb598bde99bf422668acc509b3cef", "score": "0.650139", "text": "function getAuthenticatedUser(ctx) {\n // return UserModel.findOne({ where: { id: 1 } });\n return ctx.user.then(function (user) {\n if (!user) {\n throw new _apolloServer.AuthenticationError('Unauthenticated');\n }\n\n return user;\n });\n}", "title": "" }, { "docid": "a0dc73faa730803a751babf1968a2db1", "score": "0.64858687", "text": "async getSingleUser(_, a, { user }) {\n try {\n if (!user) {\n console.info(\"no user\");\n throw new AuthenticationError(\"User must be logged in\");\n }\n\n const foundUser = await User.findOne({ _id: user._id });\n\n if (!foundUser) {\n throw new AuthenticationError(\"User does not exist\");\n }\n return foundUser;\n } catch (error) {\n console.info(error);\n throw new ApolloError(\"Internal server error. Please try again soon\");\n }\n }", "title": "" }, { "docid": "c37e8486fb508c47916237cb51c81060", "score": "0.6475576", "text": "async user(obj, field, context, info) {\n const user = context.getUser()\n const usersService = context.get(\"users\");\n return await usersService.findOne(field.username, user);\n }", "title": "" }, { "docid": "e5bd9ced3316a453322b5ffb5512207c", "score": "0.6474251", "text": "static fetchUser(userid) {\r\n\t\treturn shen.db.fetchUser(userid).then(users => {\r\n\t\t\tif(users.length == 0) // user doesn't exist\r\n\t\t\t\tthrow new ReferenceError(\"This user does not exist.\");\r\n\t\t\treturn users[0];\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.6473028", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.6473028", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.6473028", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.6473028", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "e278ed22451ff14d3476ebdc97b6a989", "score": "0.6467775", "text": "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.signupToken.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t\telse if (!this.user.get('isRegistered')) {\n\t\t\tthrow this.errorHandler.error('noLoginUnregistered');\n\t\t}\n\t}", "title": "" }, { "docid": "82ab309e9772239aa7c8fac6338a6c64", "score": "0.64502", "text": "async getCurrentUser() {\n const options = this.buildOptions({\n path: `${this.path}/user`,\n method: \"get\",\n body: {},\n });\n\n return this.apiCall(options);\n }", "title": "" }, { "docid": "4179ae9b97a744c9243d68ed139d9bba", "score": "0.6434574", "text": "function getLoggedInUser () {\n\n // If the user is not signed in, don't bother\n if ( ! ( __OMEGA__ && __OMEGA__.user && __OMEGA__.user.id ) ) {\n\n var userCookieValue = docCookies.getItem( \"omega-user-v2\" );\n if ( ! userCookieValue )\n return false;\n\n var userData;\n try {\n userData = JSON.parse( atob( userCookieValue ) );\n if ( ! userData.id ) {\n return false;\n }\n else {\n __OMEGA__ = __OMEGA__ || { };\n __OMEGA__.user = userData;\n return userData;\n }\n } catch ( e ) {\n return false;\n }\n\n }\n else {\n return __OMEGA__.user;\n }\n\n\n}", "title": "" }, { "docid": "e58abfcbdb3fde58fae4002d9b1341a3", "score": "0.6434206", "text": "static async getUser(username, _token) {\n try {\n const res = await this.request(`users/${username}`, { _token });\n return res.user;\n } catch (err) {\n return { errors: err }\n }\n }", "title": "" }, { "docid": "a3845df4d46fb9cca14aa1893944aa93", "score": "0.6429398", "text": "function getCurrentUser($q, $auth){\n var deferred = $q.defer(); // Creates a promise\n var user = $auth.getPayload().user;\n if(user){\n deferred.resolve(user); // sends back a user wrapped with a promise with a status of resolved\n }else{\n console.log(\"USER WAS NOT FOUND!\");\n deferred.reject(); // sends back with status of rejected\n }\n return deferred.promise; \n }", "title": "" }, { "docid": "74e2db44e2587a795b8f63c90f241b2d", "score": "0.64272237", "text": "getCurrentUser() {\n return HTTP.get('users/me')\n .then(response => {\n return response.data\n })\n .catch(err => {\n throw err\n })\n }", "title": "" }, { "docid": "ef62abe5d5918180c1b44faa2e0d2188", "score": "0.64236397", "text": "async getCurrentUser() {\n // Lo que hacemos es detectar los cambios en tiempo real\n return new Promise((resolve, reject) => {\n const unsubscribe = Service.auth.onAuthStateChanged(\n // Si tenemos usuario, resolvemos la promesa y lo retornamos\n (user) => {\n unsubscribe();\n resolve(user);\n },\n // Rechazamos\n () => {\n reject();\n },\n );\n });\n }", "title": "" }, { "docid": "35cf44281bdd250b34b6264c893443a2", "score": "0.64220846", "text": "fetchUser() {\n if (this.state.loggedInUser === null) {\n loggedin()\n .then((response) => {\n this.setState({ loggedInUser: response });\n })\n .catch((err) => {\n this.setState({ loggedInUser: false });\n });\n }\n }", "title": "" }, { "docid": "3cf839044f27fec2d219a46f62656f61", "score": "0.64212024", "text": "get user() {\n return ( async () => this._user || await this.retrieve() )();\n }", "title": "" }, { "docid": "20ab59dafbcba081c7bf3623c5358823", "score": "0.641521", "text": "static async getUser(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }", "title": "" }, { "docid": "a2a2c3f9ed3dff3d410434f82069340b", "score": "0.63979083", "text": "async function fetchUser() {\n try{\n const authInfo = await checkAuthPromise();\n\n const user = await getUserPromise(authInfo);\n\n return user;\n }\n catch(error){\n // ...\n }\n}", "title": "" }, { "docid": "c051e63ddec26aa814d241c2299ab761", "score": "0.6393471", "text": "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "title": "" }, { "docid": "8b6eb8d7c11e41bef59513fa17a7cc58", "score": "0.638585", "text": "check_logged_in() {\n const user = store_get(this.user);\n if (!user || !user.uid) {\n console.warn(\"Not logged in!\");\n throw new Error(\"Not logged in\");\n }\n return user;\n }", "title": "" }, { "docid": "2999824589c8b145b17f8b10480989ba", "score": "0.63714075", "text": "checkIfUserisAuthenticated () {\n return Auth.currentAuthenticatedUser()\n .then(user => {\n logger.debug('User is Authenticated!!', user)\n return user\n })\n .catch(err => {\n logger.debug('User not authenticated!!', err)\n return false\n })\n }", "title": "" }, { "docid": "c346d45437be4a1a948e09ad778b924e", "score": "0.6370253", "text": "getOneUser(username){\n return fetch (`${remoteURL}/users?username=${username}`)\n .then(result => result.json())\n }", "title": "" }, { "docid": "2a2cd20d2037bab3a1f61ed9ec26432d", "score": "0.63687015", "text": "function getUser(){\n\n for (let index = 0; index < result.length; index++) {\n if (username == result[index].email && pass == result[index].pass) {\n const user = result[index];\n \n found = true;\n return user;\n \n } \n } \n \n\n }", "title": "" }, { "docid": "c532eec7d237015d9f7dadb8c32472d5", "score": "0.6358868", "text": "static async userById(id, pw) {\n // lookup user\n const user = await User.get(id);\n if (!user) return null;\n if (user.ApiToken == null) return null;\n\n // api token less than 24 hours old?\n if (Date.now() - Date.parse(user.ApiToken) > 1000*60*60*24) return null;\n\n const token = crypto.createHash('sha1').update(user.ApiToken).digest('hex');\n if (pw !== token) return null;\n\n // validates ok - return user record\n return user;\n }", "title": "" }, { "docid": "7edac61f8cfd9f314a38d5733bd886d2", "score": "0.6358511", "text": "static async user() {\n const user = await App.make('Auth').getUser();\n return user;\n }", "title": "" }, { "docid": "7c36985e9bdfaed23b92e1b8d73e32bc", "score": "0.63561106", "text": "function getCurrentUser(req, res){\n let token = req.headers['x-access-token']\n if(!token) return res.status(401).send({auth: false, message: 'No token provided'})\n verifyToken(token)\n .then((decode)=> User.findOne({id: decoded.id}))\n .then((user)=>{\n if(!user) return res.status(401).send({auth: false, message: 'No user found' })\n res.status(200).send(user)\n })\n .catch((err)=> res.status(500).send({err}))\n}", "title": "" }, { "docid": "44dc3257db98376d2294b32e2e38d1e5", "score": "0.6355808", "text": "function getUser(){\n return user;\n }", "title": "" }, { "docid": "c7bb064566ea7848898ab1860468bc86", "score": "0.63556087", "text": "getUserById(id){\n return this.auth.get(`/user/${id}`,{}).then(({data})=> data);\n }", "title": "" }, { "docid": "d53e2d4ab0cef950f6c295917a6aee95", "score": "0.63507485", "text": "static async loadCurUser() {\n\n var user_result = await APISocket.get(`user/me?populate=teams&extension=true`)\n\n // User is on one team: normalize values that are stored on the TeamUser object\n if (user_result.teams.length === 1) {\n\n // Properties defined on the TeamUser that need to be normalized back into actual user properties\n var team_user = await APISocket.get(`team/${user_result.teams[0].id}/users/${user_result.id}`)\n for (let [key, value] of Object.entries(team_user)) {\n user_result[key] = value;\n }\n\n }\n\n // Rename/remap fields\n user_result.extension_secret = (\" \" + user_result.extensionSecret).slice(1);\n delete user_result.extensionSecret;\n\n return user_result;\n\n }", "title": "" }, { "docid": "ca7fbb8eebdf766ac4eb3f582fabb3dc", "score": "0.6349921", "text": "async function getCurrentUser() {\n // checks to see if there's an Airtable user with the Netlify ID\n let response = await fetch(`https://api.airtable.com/v0/appcEdYdqWTVWe80T/users?filterByFormula=%7BnetlifyID%7D%3D%27${netlifyIdentity.currentUser().id}%27`, {\n method: 'GET',\n headers: {\n 'Authorization': 'Bearer keyV4oqFP1aJ9oo7R',\n 'Content-Type': 'application/json'\n }\n })\n let json = await response.json()\n\n if (json.records.length == 0) {\n // if not, create an Airtable user – createAirtableUser sets currentUser when done\n createAirtableUser()\n } else {\n // if yes, set the currentUser object from the existing data\n let user = netlifyIdentity.currentUser()\n currentUser = {\n netlifyID: user.id,\n airtableID: json.records[0].id,\n email: user.email,\n name: user.user_metadata.full_name\n }\n }\n}", "title": "" }, { "docid": "c0aacc147edfd9e835d83fda23e5294f", "score": "0.6340628", "text": "static async getLoggedInUser(token, username) {\n // if we don't have user info, return null\n if (!token || !username) return null;\n\n // call the API\n const response = await axios.get(`${BASE_URL}/users/${username}`, {\n params: {\n token\n }\n });\n\n // instantiate the user from the API information\n const existingUser = new User(response.data.user);\n\n // attach the token to the newUser instance for convenience\n existingUser.loginToken = token;\n\n // instantiate Story instances for the user's favorites and ownStories\n existingUser.favorites = response.data.user.favorites.map(s => new Story(s));\n existingUser.ownStories = response.data.user.stories.map(s => new Story(s));\n return existingUser;\n }", "title": "" }, { "docid": "c0aacc147edfd9e835d83fda23e5294f", "score": "0.6340628", "text": "static async getLoggedInUser(token, username) {\n // if we don't have user info, return null\n if (!token || !username) return null;\n\n // call the API\n const response = await axios.get(`${BASE_URL}/users/${username}`, {\n params: {\n token\n }\n });\n\n // instantiate the user from the API information\n const existingUser = new User(response.data.user);\n\n // attach the token to the newUser instance for convenience\n existingUser.loginToken = token;\n\n // instantiate Story instances for the user's favorites and ownStories\n existingUser.favorites = response.data.user.favorites.map(s => new Story(s));\n existingUser.ownStories = response.data.user.stories.map(s => new Story(s));\n return existingUser;\n }", "title": "" }, { "docid": "8f55dbc82523a490567477dc4ca81029", "score": "0.63373786", "text": "user(cb) {\n svclib.KVDataStore.get([{\n table: 'email_to_user',\n key: email,\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n const userId = items[0].value.userId;\n svclib.KVDataStore.get([{\n table: 'users',\n key: _.toString(userId),\n }], (err, items) => {\n if (err) return cb(err);\n if (!items[0].exists) {\n return cb(new Error('That user does not exist.'));\n }\n return cb(null, items[0]);\n });\n });\n }", "title": "" }, { "docid": "3933f54a6c2f9104daab6f4601ac813d", "score": "0.6336311", "text": "async getUser () {\n\t\tconst query = {\n\t\t\tsearchableEmail: this.request.body.email.toLowerCase()\n\t\t};\n\t\tconst users = await this.data.users.getByQuery(\n\t\t\tquery,\n\t\t\t{ hint: UserIndexes.bySearchableEmail }\n\t\t);\n\n\t\t// return an already-registered error if there is a matching registered user,\n\t\t// otherwise look for an unregistered user that is not on any teams\n\t\tlet teamlessUser;\n\t\tlet userOnTeams;\n\t\tlet registeredUser;\n\t\tlet userJoiningOrg;\n\t\tusers.find(user => {\n\t\t\tconst teamIds = user.get('teamIds') || [];\n\t\t\tif (user.get('deactivated')) {\n\t\t\t\treturn false;\n\t\t\t} else if (user.get('isRegistered')) {\n\t\t\t\tregisteredUser = user;\n\t\t\t} else if (teamIds.length === 0) {\n\t\t\t\tif (user.get('companyName') || user.get('joinCompanyId')) {\n\t\t\t\t\tuserJoiningOrg = true;\n\t\t\t\t}\n\t\t\t\tteamlessUser = user;\n\t\t\t} else {\n\t\t\t\tuserOnTeams = user;\n\t\t\t}\n\t\t});\n\n\t\t// can't confirm an already-confirmed user\n\t\tif (registeredUser && !userJoiningOrg) {\n\t\t\t// exception: if the user has a company name, they are in the process\n\t\t\t// of creating a new org, so we don't care if they exist, we'll\n\t\t\t// be creating a new user regardless\n\t\t\tthrow this.errorHandler.error('alreadyRegistered');\n\t\t} else if (!teamlessUser) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t} else {\n\t\t\tthis.user = teamlessUser;\n\t\t}\n\t}", "title": "" }, { "docid": "6cac2938d4298d7b873224b5084d4014", "score": "0.6332621", "text": "static async getLoggedInUser(token, username) {\n // if we don't have user info, return null\n if (!token || !username) return null;\n\n // call the API\n const response = await axios.get(`${BASE_URL}/users/${username}`, {\n params: {token}\n });\n\n // instantiate the user from the API information\n const existingUser = new User(response.data.user);\n\n // attach the token to the newUser instance for convenience\n existingUser.loginToken = token;\n\n // instantiate Story instances for the user's favorites and ownStories\n existingUser.favorites = response.data.user.favorites.map(s => new Story(s));\n existingUser.ownStories = response.data.user.stories.map(s => new Story(s));\n\n return existingUser;\n }", "title": "" }, { "docid": "310b8f24c7df2396ce4ed7f54723c0e1", "score": "0.6327224", "text": "tryRetrieveUser(userid) {\n this.userService.getUser(userid).then(reply => {\n this.authModel$.next(reply);\n if (reply.firstName == null && window.location.pathname != \"/register\") {\n this.logger.log(\"new user\", \"\");\n this.router.navigate([\"register\"]);\n }\n else {\n this.isUserAdmin(userid);\n }\n }).catch(err => {\n this.logger.error(\"in checkAuth$\", err);\n this.isAdmin$.next(false);\n });\n }", "title": "" }, { "docid": "75a2d89836c6c45fa7803fc843b8192a", "score": "0.6321951", "text": "function getAuthUser(req,res){\n var email = req.body.emailAddress;\n var userAuth = {};\n \n if(email && email !== '' && email !== undefined) {\n userDbStub.forEach(function(user) {\n if(user.emailAddress === email) {\n userAuth = user;\n } \n }, this);\n }else{\n res.status(401).send('email not defined');\n }\n return userAuth; \n}", "title": "" }, { "docid": "0eb826f5ff81814fed2b823cb9d4dff0", "score": "0.63048667", "text": "static async getLoggedInUser(token, username) {\n // if we don't have user info, return null\n if (!token || !username) return null;\n const response = await axios.get(`${BASE_URL}/users/${username}`, {\n params: {\n token,\n },\n });\n\n // instantiate the user from the API information\n const existingUser = new User(response.data.user);\n // attach the token to the newUser instance for convenience\n existingUser.loginToken = token;\n\n // instantiate Story instances for the user's favorites and ownStories\n existingUser.favorites = response.data.user.favorites.map(\n (s) => new Story(s)\n );\n existingUser.ownStories = response.data.user.stories.map(\n (s) => new Story(s)\n );\n return existingUser;\n }", "title": "" }, { "docid": "064874ecc7cb31c571cd3df0abbb3455", "score": "0.630087", "text": "function getLoginUser() {\n\t\tlet getUserDetails = localStorageService.getLoggedInUserInfo();\n\t\tlet userDetails = JSON.parse(getUserDetails);\n\t\tlet loginUserGroup = userDetails.userGroup;\n\t\tif (loginUserGroup !== 'Administrator') {\n\t\t\tvm.reporter = userDetails.userId;\n\t\t\tvm.reporterList = []; // If User not admin than hide reporter list dropdown\n\t\t} else {\n\t\t\t/* Get reporters list */\n\t\t\tgetUsers();\n\t\t}\n\t}", "title": "" }, { "docid": "ed5335c7cbe727f3f5f862857b4abff6", "score": "0.62915164", "text": "function getUser() {\n return user;\n }", "title": "" }, { "docid": "502d5c3eda7cd7a40166a50ded5c7c6a", "score": "0.62875444", "text": "async getUser (_id) {\n let user = await this.models.users.findOne({_id: _id, deletedAt: null}, {password: 0})\n .populate('tickets');\n if (!user) {\n throw new Error();\n }\n return user;\n }", "title": "" }, { "docid": "ad794c940fbd25545c652f075eef66ad", "score": "0.628374", "text": "function getCurrentLoggedInUserAccount() {\n\t//access to the db\n\t//confirm they have proper credentials\n\treturn \"Kimberly\";\n}", "title": "" }, { "docid": "da55e361137cc47a43b06313c681dae7", "score": "0.6276754", "text": "function getLoggedUser(req, res, next) {\n db\n .any(\"SELECT user_id, username, full_name, email, user_description, user_followers, user_following, images.id AS img_id, img_url, img_likes FROM users JOIN images ON (users.id = images.user_id) WHERE username = ${username}\", req.user)\n .then(function(data) {\n res.status(200).json({\n status: \"success\",\n data: data,\n message: \"Fetched one user\",\n req: req.user,\n });\n })\n .catch(function(err) {\n return next(err);\n });\n}", "title": "" }, { "docid": "d5f4122bdecdc2d4b39afbd2f5724cf6", "score": "0.6250953", "text": "function getHotmailUser() {\r\n\t\t//\t\tvar strGreeting = \"\";\r\n\t\tWL.api(\r\n\t\t{\r\n\t\t\tpath: \"me\",\r\n\t\t\tmethod: \"GET\"\r\n\t\t},\r\n\t\tfunction (resp) {\r\n\t\t\tif (!resp.error) {\r\n\r\n\t\t\t\tWL.logout();\r\n\r\n\t\t\t\t$(document.body).data('oauth_login',{\r\n\t\t\t\t\t'id' : resp.id,\r\n\t\t\t\t\t'email' : resp.emails.preferred,\r\n\t\t\t\t\t'link' : resp.link,\r\n\t\t\t\t\t'type' : 'hotmail'\r\n\t\t\t\t});\r\n\r\n\t\t\t\tcheckOauthAccount($(document.body).data('oauth_login'));\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "fe9bf3c89307d0847999720d554d989f", "score": "0.6242939", "text": "getInitialUserInfo(DB, request, response) {\n\t\tDB.get_initial_user(request.params.auth_id).then((userData) => {\n\t\t\tif (userData[0]) response.status(200).send(userData);\n\t\t\telse response.status(404).send('User Not Found...');\n\t\t});\n\t}", "title": "" }, { "docid": "c389d243326419633a08fb38dfe04e2a", "score": "0.6237575", "text": "async AuthUser(parent, args, {req}) {\n try {\n let user = await UserModel.findOne({_id: req.user.user_id});\n\n if (user) {\n return user;\n }\n return null;\n } catch (err) {\n onError(err);\n }\n }", "title": "" }, { "docid": "b659eb5f0cda5275debeb16a562f1f15", "score": "0.62364024", "text": "static async getUser(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }", "title": "" }, { "docid": "a089ae8d4e7a41ff2dcec35ae24b4ed9", "score": "0.62326235", "text": "function findCurrentUser() {\n return \"stefan\"\n }", "title": "" }, { "docid": "236745446c6461e5447c3f184171dd3f", "score": "0.6231305", "text": "function getCurrentUser () {\n return new Promise((resolve, reject) => {\n var unsubscribe = firebase.auth().onAuthStateChanged((user) => {\n unsubscribe();\n resolve(user);\n }, reject);\n });\n }", "title": "" }, { "docid": "ae7ebf9996a59c6ef308897e1ae6a234", "score": "0.6227017", "text": "async function checkIfUserExist () {\n try {\n const user = await fetch('https://mern-finalproj-api.herokuapp.com/Help4U/user/check', {\n method: 'POST',\n headers: new Headers({\n 'Content-Type': 'application/json; charset=utf-8'\n }),\n mode: 'cors',\n body: JSON.stringify({ google_id: response.googleId })\n\n }).then(user => user.json());\n\n if (user.status === 200 && user.data !== null) {\n // update admin access token - only for admin API requests\n if (user.data.admin == true) {\n updateAdminAccessToken(response);\n }\n\n setSession(response, user.data);\n history.replace('/home');\n }\n\n // user not exist, signup with google account\n if (user.status === 200 && user.data === null) {\n history.replace('/signup');\n }\n if (user.status === 500) {\n history.replace('/error');\n }\n } catch (e) {\n history.replace('/error');\n }\n }", "title": "" }, { "docid": "8aa69698d5509dd7f3d38776a27fd452", "score": "0.6224819", "text": "async getUser(uid) {\n console.log('GET /user/%s', uid)\n return this.server.getUser(uid)\n }", "title": "" }, { "docid": "5f2aeae4f0df124a92762568093a1772", "score": "0.621304", "text": "static async getMe(request, response) {\n const token = request.headers['x-token'];\n if (!token) { return response.status(401).json({ error: 'Unauthorized' }); }\n\n // Retrieve the user based on the token\n const userId = await findUserIdByToken(request);\n if (!userId) return response.status(401).send({ error: 'Unauthorized' });\n\n const user = await findUserById(userId);\n\n if (!user) return response.status(401).send({ error: 'Unauthorized' });\n\n const processedUser = { id: user._id, ...user };\n delete processedUser._id;\n delete processedUser.password;\n // Return the user object (email and id only)\n return response.status(200).send(processedUser);\n }", "title": "" }, { "docid": "83ee9a306ea490f890644042e05503ed", "score": "0.6209228", "text": "function checkIfLoggedIn() {\n if(ls.token && ls.user_id) {\n axios.get(`${process.env.REACT_APP_DB_URL}/users/${ls.user_id}`, {\n headers: {\n authorization: `Bearer ${ls.token}`\n }\n })\n .then((foundUser) => {\n setLoginStatus(true)\n })\n .catch((err) => {\n setLoginStatus(false)\n })\n }\n }", "title": "" }, { "docid": "d361a3b4a9f498536028b0289b82660c", "score": "0.6207762", "text": "authenticatedUser(account) {\n return account;\n }", "title": "" }, { "docid": "e2d012a981ca5eef6579b1b2c14ba624", "score": "0.62075126", "text": "checkCred(cred){\n\t\treturn db.one(`SELECT * FROM user_id WHERE uname=$[uname] AND password=$[password]`, cred)\n\t}", "title": "" }, { "docid": "0ffc19d0c456a7537fbf11cb241e6d86", "score": "0.6206242", "text": "async getUser({ commit, dispatch }) {\n const client = await dispatch(\"gqlClient\", true);\n const data = await client.request(`\n query {\n user {\n id\n name\n email\n default_organization\n }\n }`);\n if (data.user) {\n return data.user;\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "c0c49e3b3c9fdf9b09eb941dc57233d7", "score": "0.62048155", "text": "function userReq () {\n const request = apiHelper.axGet(apiUrls.user, authToken)\n return axios(request)\n }", "title": "" }, { "docid": "bf35b347178081339879c94c5d0c81ad", "score": "0.6204245", "text": "getUser(identifier) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.connector.fetchUser(identifier);\n });\n }", "title": "" }, { "docid": "26313e7fef5fdc93cb6f45db3c19dda9", "score": "0.61995786", "text": "async getUser() {\n // call auth info api with session token\n const response = await this.call(\"GET\", \"/api/auth/info\");\n // parse response\n const userinfo = JSON.parse(response.content);\n return userinfo;\n }", "title": "" }, { "docid": "03377ec2f615c8b7f65cfe0161d02bed", "score": "0.6196429", "text": "autoAuthUser() {\n const authInformation = this.getAuthData();\n if (!authInformation) {\n return;\n }\n const now = new Date();\n const expiresIn = authInformation.expirationDate.getTime() - now.getTime();\n if (expiresIn > 0) {\n this.token = authInformation.token;\n this.isAuth = true;\n this.setAuthTimer(expiresIn / 1000);\n this.authStatusListener.next(true);\n if (authInformation.admin) {\n this.isAdmin = true;\n this.adminStatusListener.next(true);\n }\n }\n }", "title": "" }, { "docid": "e74e7b0601b997ddbd1d291fdeb087a8", "score": "0.61935765", "text": "function authenticate_user(res, mysql, context, us, pw, complete){\n\tvar sql = 'SELECT user_id, email, member_since FROM users WHERE email=? AND password=?'\n\tvar inserts = [us, pw];\n\tmysql.pool.query(sql, inserts, function(err, results, fields){\n\t\t\tif(err){\n\t\t\t\tres.write(JSON.stringify(err));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontext.user = results[0];\n\t\t\tif(typeof context.user === \"undefined\")\n\t\t\t{\n\t\t\t\tcontext.error = 1;\n\t\t\t}\n\t\t\tcomplete();\n\t\t});\n\t}", "title": "" }, { "docid": "686060f0145263d8da08d73fd4601628", "score": "0.6190802", "text": "async fetchUser(endpoint) {\n await this.reset();\n const fetchResult = await this.$api.get('/common/user-info')\n this.$auth.setUser(fetchResult.data)\n }", "title": "" }, { "docid": "79e47513611296c21bdf674e61f0cd35", "score": "0.6183361", "text": "tokenAuth(user_id, auth_token) {\n const query = r.table('users').filter({auth_token: auth_token})\n return this._run(query).then(success => {\n return success ? true : Promise.reject('Authentication failure');\n });\n }", "title": "" }, { "docid": "5e395266166e8bb3c652057b885f0c2c", "score": "0.6178813", "text": "static async getUser() {\n return new Promise((resolve, reject) => {\n axios.get('/auth/user', {\n headers: {'Authorization': `bearer ${Auth.getToken()}`}\n }).then(res => {\n //return res.data.user;\n resolve(res.data.user);\n }).catch(err => {\n //return err.response;\n reject(err);\n });\n });\n }", "title": "" }, { "docid": "586b399868218241e7ebbb22d3a0b3fa", "score": "0.6178701", "text": "function userLoggedInAdvanced (req, res, next) {\n // first check if we have HTTP Basic Auth\n const auth = basicAuth(req)\n // changed var to let because heroku still doesn't support let\n var userEmail, authToken\n if (auth) {\n userEmail = auth.name\n authToken = auth.pass\n } else {\n // else we just look in the http header or body or params\n userEmail = req.get('User-Email') || req.body.user_email || req.query.user_email\n authToken = req.get('Auth-Token') || req.body.auth_token || req.query.auth_token\n }\n\n console.log(auth)\n if (!userEmail || !authToken) return res.status(401).json({error: 'unauthorised'})\n\n User.findOne({email: userEmail, auth_token: authToken}, (err, user) => {\n if (err || !user) return res.status(401).json({error: 'unauthorised'})\n\n req.currentUser = user\n next()\n })\n}", "title": "" }, { "docid": "104f4855454d9870828c57bc95f82b93", "score": "0.6162304", "text": "function fetchUserByToken(token) {\n return fetch({\n method: 'POST',\n url: 'http://localhost:3000/get-current-user',\n headers: new Headers({\n authorization: token,\n }),\n })\n .then(res => res.json())\n .catch(err => err);\n}", "title": "" }, { "docid": "5a5edb08099ad787c952e531d99fad40", "score": "0.6160923", "text": "function getCurrentUser() {\n // SERVER_CALL Get information of user profile from server\n // For now return fake user we created\n user = patientList[0];\n}", "title": "" }, { "docid": "b4548d93f220fc63e7628923d1942eef", "score": "0.6156723", "text": "function getUser() {\n if (promisedUser.data.success) {\n $scope.user = promisedUser.data.user;\n $window.sessionStorage.setItem('currentUser', JSON.stringify($scope.user));\n }\n }", "title": "" }, { "docid": "c4ab804349b8bc8f6b324df268268239", "score": "0.61546266", "text": "function tryGetAuth() {\n\tconst username = sessionStorage.getItem(\"username\");\n\tconst token = sessionStorage.getItem(\"authToken\");\n\n\tif (nonEmpty(token)) {\n\t\treturn { \"username\": username, \"token\": token };\n\t} else {\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "09d89f9f611285b7dbafa87552654525", "score": "0.615158", "text": "async fetchUser ({ commit }) {\n try {\n // TODO: Connect to API to fecth the logged in user\n const { data } = await axios.get(`${process.env.VUE_APP_PROXY_URL}/api/users/me`)\n commit(types.FETCH_USER_SUCCESS, { user: data })\n } catch (e) {\n commit(types.FETCH_USER_FAILURE)\n }\n }", "title": "" }, { "docid": "c71467baa29614f3fd68a49acaca2165", "score": "0.6150468", "text": "async function checkUser() {\n const user = await localStorage.getItem(Current_User);\n return user;\n}", "title": "" }, { "docid": "9f6254f7779c57c5ddcbd40052e16f1a", "score": "0.6147055", "text": "function getCurrentUser() {\n let userId = $('#cu').data(\"cu\");\n user = new User({id: userId});\n return user;\n}", "title": "" }, { "docid": "5201553619a4b487162cccc4ff86a405", "score": "0.6144544", "text": "async fetchSingleUser(id) {\n let loginUser = localStorage.getItem('token');\n try {\n dispatch.breaks.setIsFetchingUser(true);\n let response = await breakURL.get(`/auth/users/${id}`, {\n headers: { Authorization: `Bearer ${loginUser}` },\n });\n dispatch.breaks.setSingleUser(response.data.data);\n dispatch.breaks.setIsFetchingUser(false);\n } catch (err) {\n dispatch.breaks.setIsFetchingUser(false);\n console.log(err);\n }\n }", "title": "" }, { "docid": "6d3771d4939e17f67ce942a74f8e4302", "score": "0.6141547", "text": "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "title": "" }, { "docid": "768b9bcfe69caa6910728e91d4f05967", "score": "0.6140645", "text": "function checkConnectedUser(token) {\n var result = {};\n var response = null;\n \n try {\n var params = {\n \"method\": 'GET',\n \"contentType\": 'application/json;charset=UTF-8',\n \"headers\": {\n \"Authorization\": \"Bearer \" + token\n }\n };\n \n result['response'] = JSON.parse(UrlFetchApp.fetch('https://lumsites.appspot.com/_ah/api/lumsites/v1/user/get', params));\n \n if (result.response.email.indexOf('your.domain.com') != -1) {\n result['status'] = true;\n }\n else {\n result['status'] = false;\n }\n }\n catch (error) {\n result['status'] = false;\n result['error'] = JSON.stringify(error);\n }\n return result;\n}", "title": "" }, { "docid": "845136a85050f1e15dcc0e187cd24a24", "score": "0.61341566", "text": "user() {\n if (this.authenticated) return this.authenticated;\n\n let user = JSON.parse(localStorage.getItem('user'));\n\n if (user) {\n this.authenticated = new User(user.id, user.name, user.email, user.token);\n\n return this.authenticated;\n }\n\n return false;\n }", "title": "" }, { "docid": "6adb3b377ac2a0b09455c1ae9a079149", "score": "0.6133459", "text": "function getOneUser(req, res, next) {\n oneUserDetails(req, res).then((result) => {\n return res.status(200).json(result);\n }).catch((err) => {\n next(err);\n });\n}", "title": "" }, { "docid": "b554c624a1a5ab033cb224b264c66c34", "score": "0.6132305", "text": "static isAuthenticatedAsUser (req, res, next) {\n try {\n const jwtToken = AuthorizationUtil._extractToken(req)\n\n const jwtPayload = AuthorizationUtil.extractJWTInformation(jwtToken)\n // so you can use get user who made the request in the endpoint\n // since it will receive the same req object\n req.user = new User(jwtPayload.userId, jwtPayload.username)\n return next()\n } catch (ignored) {\n return ApiResponse.sendErrorApiResponse(403, 'Not authenticated', res)\n }\n }", "title": "" }, { "docid": "0fa7dae637fdab8c733748e1bdbbbd58", "score": "0.6132094", "text": "async function fetchUser() {\n\treturn 'shock';\n}", "title": "" }, { "docid": "d43ca42e3397e1aa5579c50edb6bb48f", "score": "0.6122971", "text": "fetchUser({\n commit\n }, user) {\n commit('SET_LOGGED_IN', user !== null);\n if (user) {\n commit('SET_USER', {\n userName: user.userName,\n email: user.email\n });\n } else {\n commit('SET_USER', null);\n }\n }", "title": "" }, { "docid": "f4f0ee43eb05af8fd89ec00f2f088061", "score": "0.6122372", "text": "function findUserByCredentials(credentials){\n var username = credentials.username;\n var password = credentials.password;\n var userPresent = null;\n// for(var u in users){\n// if(users[u].username === username && users[u].password === password){\n// console.log(\"user \" + username + \" has logged in successfully\");\n// userPresent = users[u];\n// break;\n// }\n// }\n// \n return userPresent;\n }", "title": "" }, { "docid": "52e9bfd0c5239022e204f607f4d9bbb7", "score": "0.612025", "text": "function findOneUser(extraQuery) {\n var query = {\n id: $state.params.id,\n populates: ['roles']\n };\n angular.extend(query, extraQuery);\n return Users.findOne(query).$promise\n .then(function(user) {\n var photosPromise = Preload.photos(user, 'cloudinary200', false);\n return $q.all([user, photosPromise]);\n })\n .then(function(array) {\n var user = array[0];\n return user;\n });\n }", "title": "" }, { "docid": "647e7c84f760a0a1cf3cd044dee568e6", "score": "0.61171734", "text": "async function getOneUser(credentials) {\n const tableReading = \"SELECT * FROM user WHERE email = '\" + credentials.email + \"' AND password = '\" + credentials.password + \"'\";\n const res = await connM.query(tableReading).catch((err) => {return err;});\n if (res.length !== 0) {\n return res[0];\n } else {\n return {message:\"Error: ER_NO_ENTRY: user not found\"};\n }\n}", "title": "" }, { "docid": "dcb7f64d05a8c75b2623bfbee8c79a2a", "score": "0.6116232", "text": "function getUser(req,res,next) {\n db.one(`\n SELECT *\n FROM users\n WHERE email = lower(trim(from $/email/));\n `, req.body)\n .then( user=>{\n\n if(bcrypt.compareSync(req.body.password, user.password_digest)){\n res.user = user;\n }else{\n res.error = true\n }\n console.log(res.user)\n next()\n\n })\n /* NOTE: NO USERS or all ERRORS*/\n .catch( error=>{\n console.error('Error ', error);\n res.error = error\n next()\n })\n }", "title": "" }, { "docid": "3236ce305009f5acf27c34177d99a42b", "score": "0.6115878", "text": "function grabUser(ses, force) {\n\n _debug(\"grabUser auth token = \" + ses);\n\tif(!ses && isXUL()) {\n\t\tstash = fetchXULStash();\n\t\tses = stash.session.key\n\t\t_debug(\"stash auth token = \" + ses);\n\t}\n\n\tif(!ses) {\n\t\tses = dojo.cookie(COOKIE_SES);\n\t\t/* https cookies don't show up in http servers.. */\n\t\t_debug(\"cookie auth token = \" + ses);\n\t}\n\n\tif(!ses) return false;\n\n\tif(!force) \n\t\tif(G.user && G.user.session == ses)\n\t\t\treturn G.user;\n\n\t/* first make sure the session is valid */\n\tvar request = new Request(FETCH_SESSION, ses);\n\trequest.request.alertEvent = false;\n\trequest.send(true);\n\tvar user = request.result();\n\n\tif(!user || user.textcode == 'NO_SESSION') {\n\n if(isXUL()) {\n dojo.require('openils.XUL');\n dump('getNewSession in opac_utils.js\\n');\n openils.XUL.getNewSession( \n function(success, authtoken) { \n if(success) {\n ses = authtoken;\n var request = new Request(FETCH_SESSION, ses);\n request.request.alertEvent = false;\n request.send(true);\n user = request.result();\n }\n }\n );\n }\n\n\t if(!user || user.textcode == 'NO_SESSION') {\n\t\t doLogout();\n\t\t return false; /* unable to grab the session */\n }\n\t}\n\n\tif( !(typeof user == 'object' && user._isfieldmapper) ) {\n\t\tdoLogout();\n\t\treturn false;\n\t}\n\n\tG.user = user;\n\tG.user.fleshed = false;\n\tG.user.session = ses;\n\tsetSessionCookie(ses);\n\n\tgrabUserPrefs();\n\tif(G.user.prefs['opac.hits_per_page'])\n\t\tCOUNT = parseInt(G.user.prefs['opac.hits_per_page']);\n\n\tif(G.user.prefs[PREF_DEF_FONT]) \n\t\tsetFontSize(G.user.prefs[PREF_DEF_FONT]);\n\n\tvar at = getAuthtime();\n\t//if(isXUL()) at = xulG['authtime'];\n\n\tif(at && !isXUL()) new AuthTimer(at).run(); \n\treturn G.user;\n}", "title": "" }, { "docid": "59fd66b07e4da94c14449e76a593515f", "score": "0.611432", "text": "checkUser(context) {\n\t\t\tfetch(`${process.env.VUE_APP_API_URL}/auth/me`, { method: `GET`, credentials: `include` }) //=> Fetch API\n\t\t\t\t.then(response => !response.ok ? console.log(response) : response.json(response)) //=> Check response\n\t\t\t\t.then(async apiResponse => await context.commit(`USER`, { data: apiResponse })) //=> Commit changes\n\t\t\t\t.catch(apiError => console.log(apiError)) //=> Catch error\n\t\t}", "title": "" }, { "docid": "7983f437e861bd9e4143e25cd3c02516", "score": "0.6113353", "text": "async getUser (req, res) {\n const findOneUserQuery = `\n SELECT avatar, firstname, lastname, email, username, location, bio\n FROM users\n WHERE username = $1\n `;\n\n try {\n\n // A user must be signed in to see edit information\n // Signed in user must also be requesting their own user data.\n if (!req.user || req.user.username !== req.params.username) {\n return res.status(403).send('You\\'re not allowed to edit this profile');\n }\n\n const { rows } = await db.query(findOneUserQuery, [ req.params.username ]);\n const profileUser = rows[0];\n\n // If profile user was not found in database\n if (!profileUser) {\n return res.status(404).send('User not found');\n }\n\n return res.status(200).json({ profileUser });\n } catch (error) {\n return res.status(400).send(error);\n }\n }", "title": "" } ]
0b3720f28920e648578f4df089b92e47
Zip the elements of the iterables passed
[ { "docid": "c3287fcd631a087e6c7c8f6a1400cb6d", "score": "0.72096235", "text": "function iterZip(...iters) {\n let arrayIters = [];\n const iterL = iters.length;\n let result = [];\n let smallestIter;\n\n // convert the iterables to arrays\n for (let i = 0; i < iterL; i++) {\n arrayIters.push([...iters[i]]);\n }\n\n // get the iterable that have the smallest number of elements\n smallestIter = arrayIters.reduce((a, b) => {\n return a.length < b.length ? a : b;\n });\n\n return smallestIter.map((item, index) => {\n return arrayIters.map((arr) => {\n return arr[index];\n });\n });\n}", "title": "" } ]
[ { "docid": "d5e58470487c3102d2cd33c8a295e3c6", "score": "0.6925441", "text": "function zip(arrays) {\n return arrays[0].map(function(_, i) {\n return arrays.map(function(array) {\n return array[i]\n })\n });\n}", "title": "" }, { "docid": "4bc5f0483ae08aedadc02fa0416782ed", "score": "0.6918428", "text": "function zip() {\n var args = [].slice.call(arguments);\n var shortest = args.length==0 ? [] : args.reduce(function(a,b){\n return a.length<b.length ? a : b\n });\n\n return shortest.map(function(_,i){\n return args.map(function(array){return array[i]})\n });\n}", "title": "" }, { "docid": "edc64b7ad6f8275ab18bc20df4f5a24e", "score": "0.6856449", "text": "function zip(arrays) {\n return arrays[0].map(function(_, i) {\n return arrays.map(function(array) { return array[i]; })\n });\n}", "title": "" }, { "docid": "adfdd515aa708194ca2c9ea0c7f3e52a", "score": "0.6819735", "text": "Zip(list, result) {\n return list.Count() < this.Count() ? list.Select((x, y) => result(this.ElementAt(y), x)) :\n this.Select((x, y) => result(x, list.ElementAt(y)));\n }", "title": "" }, { "docid": "1d82fd16d777a03324e7909e35aa9a7e", "score": "0.6664115", "text": "function zip(a){\r\n return a[0].map((_,i) => a.map((x) => x[i]))\r\n }", "title": "" }, { "docid": "d94acc738b25b5139b2e3a73ebb06af7", "score": "0.6582326", "text": "zipWith(f, xs, ys) {\n const ny = ys.length;\n return (xs.length <= ny ? xs : xs.slice(0, ny)).map((x, i) => f(x, ys[i]));\n }", "title": "" }, { "docid": "f95d16b790752771b01e2cff2323d040", "score": "0.64918923", "text": "function zip(a, b) {\n var res = []\n a.forEach(aa => {\n b.forEach(bb => {\n res.push([aa, bb])\n })\n })\n return res\n}", "title": "" }, { "docid": "58215cbf1d7bba2e538b29facdec1edf", "score": "0.6486489", "text": "function zip(a, b) {\n return a.map((x, i) => [x, b[i]]);\n}", "title": "" }, { "docid": "8dde0deb873899d77424c5d91abbfeaa", "score": "0.6395641", "text": "function zip() {\n while (true) {\n let ends = 0;\n let step = []\n for (let i = 0; i < arguments.length; i++) {\n try {\n step.push(arguments[i].next());\n } catch (e if e instanceof StopIteration) {\n ends++;\n }\n }\n if (ends === arguments.length)\n throw StopIteration;\n else if (ends !== 0)\n throw new Error('Zipped iterators have differing lengths!');\n\n yield step;\n }\n}", "title": "" }, { "docid": "53c2ae1e4ad67f1966738e25d216efa6", "score": "0.63404834", "text": "static zip(...arrays) {\n let z = [];\n for (let i = 0, len = arrays[0].length; i < len; i++) {\n let p = [];\n for (let k = 0; k < arrays.length; k++) {\n p.push(arrays[k][i]);\n }\n z.push(p);\n }\n return z;\n }", "title": "" }, { "docid": "8a88acd6bc768556988be44582013962", "score": "0.612631", "text": "function combine(xs) {\n function flatten(x1, x2) {\n return $.map(Array(x1, x2), identity)\n }\n\n var combined = xs[0]\n for (i = 1; i < xs.length; i = i+1) {\n combined = combined.combineLatest(xs[i], flatten)\n }\n return combined\n}", "title": "" }, { "docid": "1d5c6dc8429e50b582ab8a609f5f36a9", "score": "0.6095032", "text": "function zip(){\n var res = [], input = toArray(arguments), maxL = 0;\n pEach(input, function(x){\n if (x.length > maxL) maxL = x.length;\n });\n for (var i = 0; i < maxL; i++){\n res.push([]);\n }\n for (var i = 0; i < input.length; i++){\n for (var j = 0; j < maxL; j++){\n res[j][i] = input[i][j];\n }\n }\n return res;\n}", "title": "" }, { "docid": "507bad1d361a163d2b519c42a2347538", "score": "0.599394", "text": "function zipWith(f, xs, ys) {\n return Array.from({\n length: min(xs.length, ys.length)\n }, function (_, i) {\n return f(xs[i], ys[i]);\n });\n }", "title": "" }, { "docid": "e7a00418fe67cd292e3e2e3e1a433d3d", "score": "0.5937644", "text": "function zip(as, bs) {\n var xs = [];\n for (var i = 0; i < as.length && i < bs.length; ++i) {\n xs.push(tuple(as[i], bs[i]));\n }\n return xs;\n }", "title": "" }, { "docid": "ea52cfbc39fc38e5e9990bdcd265bf31", "score": "0.5887818", "text": "function zip_arrays(arr1, arr2) {\n let combined = arr1.map( (e, i) => {\n return [e, arr2[i]]\n })\n return combined.reduce( (a, b) => {\n return a.concat(b)\n })\n}", "title": "" }, { "docid": "27325792e70d83b4da127ab7455451ac", "score": "0.58444285", "text": "function zip(first, second) {\n var finalOutput = [];\n for (var i = 0; i < first.length && i < second.length; i++) {\n var subArray = [];\n subArray.push(first[i]);\n subArray.push(second[i]);\n finalOutput.push(subArray);\n subArray = [];\n }\n return finalOutput;\n}", "title": "" }, { "docid": "b6110bb501596be157fe81017f56fd0f", "score": "0.580555", "text": "function zip(xs,ys) {\n var doZip = function(x,y) {\n var t = new Array();\n for(var i = 0; (i < x.length) && (i < y.length); i++) {\n t.push(pair(x[i],y[i]));\n }\n return t;\n };\n\n if(xs == undefined)\n return zip;\n if(ys == undefined)\n return function(n){return doZip(xs,n);}\n return doZip(xs,ys);\n}", "title": "" }, { "docid": "b3bc47c93a7acedf75729ddd9de46069", "score": "0.57942474", "text": "function zip( arr1, arr2 ){ \n var ret = [] \n ,len = arr1.length;\n // makes a 2 element array and pushes it into the return array \n for( x = 0; x < len; x++){ \n ret.push( [ arr1[x], arr2[x] ] ); \n } \n return ret; \n}", "title": "" }, { "docid": "1118f4bb369061b4e541af988a1d5836", "score": "0.57294697", "text": "function zip(a, b) {\n var zipped = [];\n for (var i = 0, l = a.length; i < l; i++) {\n zipped.push([a[i], b[i]]);\n }\n return zipped;\n}", "title": "" }, { "docid": "673aa43ac59b4edccca8ee8b25b412c7", "score": "0.57001525", "text": "function zip (firstArray) {\n\treturn zipped = firstArray.map((firstArrayItem, itemIndex) => { \n\t\tlet innerArray = [firstArrayItem];\n\t\tfor (let argIndex=1; argIndex<arguments.length; argIndex++) {\n\t\t\tinnerArray.push(arguments[argIndex][itemIndex]);\n\t\t}\n\t\treturn innerArray;\n\t});\n}", "title": "" }, { "docid": "9065d921a0264d3ec5d68f9508bb5e5e", "score": "0.56604475", "text": "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}", "title": "" }, { "docid": "9154fee1f30b00d94cd0dd5e5d4edd53", "score": "0.5626907", "text": "function zipList(list1, list2) {\n const zippedList = [];\n if (list1.length !== list2.length) {\n return 'Lists are not equal length!';\n }\n for (let i = 0; i < list1.length; i += 1) {\n zippedList.push(list1[i]);\n zippedList.push(list2[i]);\n }\n return zippedList;\n}", "title": "" }, { "docid": "54debdf2795c4dc407915abeabf86873", "score": "0.5603537", "text": "function zip(arg){\n return Object.entries(arg).reduce((acc,[k,arr]) => {\n arr.forEach((v,i)=> (acc[i] = acc[i] || {}) [k] =v);\n return acc;\n }, [])\n}", "title": "" }, { "docid": "9a7f669a963bf7cbeea28f7e2c36da4d", "score": "0.5550347", "text": "function interleaveMap(array1, array2) {\n let result = array1.map((item, index) => {\n return [item, array2[index]];\n }).flat();\n\n return result;\n}", "title": "" }, { "docid": "61d7629a9c2366ed27e4b06db4291009", "score": "0.55173683", "text": "function zip(a, b) {\n var arr = [];\n\n for (var ch in a) {\n arr.push([a[ch], b[ch]]);\n }\n\n return arr;\n}", "title": "" }, { "docid": "1f660466b2060c75f1a6d607cb8cb1b4", "score": "0.53684217", "text": "zip(arr1, arr2, key1, key2) {\n if (arr1.length !== arr2.length) throw new Error('cannot zip arrays with different lengths')\n return arr1.map((v1, i) =>\n key1 && key2\n ? {\n [key1]: v1,\n [key2]: arr2[i],\n }\n : [v1, arr2[i]]\n )\n }", "title": "" }, { "docid": "217f8d6d36cc539b3f5ac9f06dbeed7a", "score": "0.53468275", "text": "function list(...elements) {\n return elements.reduceRight((l, element) => {\n return pair(element, l)\n }, null)\n}", "title": "" }, { "docid": "3d5caa8d6995a7a9752c8ad331d75cb3", "score": "0.5325405", "text": "function zipWith(f, thunk_xs, thunk_ys) {\n return delay(function() {\n let xs = force(thunk_xs);\n let ys = force(thunk_ys);\n return {\n head: f(xs.head, ys.head),\n tail: zipWith(f, xs.tail, ys.tail)\n }; \n });\n}", "title": "" }, { "docid": "1271b09aea371c3027a95576611c4eb0", "score": "0.5319488", "text": "function pairs(numbers) {\n return R.unnest(R.map(x => R.map(y => [ x, y ], numbers), numbers));\n}", "title": "" }, { "docid": "24f263f108b8a198c38901a108753008", "score": "0.52700984", "text": "function combineAllArrays(...args){\n let result = []\n for(arg of args){\n result = [...result, ...arg]\n }\n return result\n}", "title": "" }, { "docid": "b1ecabe0ba78f8b082d07ee71e1fd035", "score": "0.52671534", "text": "function greedyZip (a, b, fn) {\n var out = {}\n , seen = {};\n for (var k in a) {\n seen[k] = true;\n out[k] = fn(a[k], b[k]);\n }\n for (k in b) {\n if (k in seen) continue;\n out[k] = fn(a[k], b[k]);\n }\n return out;\n}", "title": "" }, { "docid": "17757bb7d59ce328f2034430e7df414b", "score": "0.52666324", "text": "function combineArrays2 () {\n const combinedArrays = [];\n function combiner(arr) {\n for (let i = 0; i < arr.length; i++) {\n combinedArrays.push(arr[i])\n }\n }\n\n for (let i = 0; i < arguments.length; i++) {\n combiner(arguments[i]);\n }\n\n return combinedArrays;\n}", "title": "" }, { "docid": "e47faf4fdde4474d50441182db1b127c", "score": "0.5244388", "text": "function zipWith(f,xs,ys) {\n var doZipWith = function(p,x,y) {\n var t = new Array();\n for(var i = 0; (i < x.length) && (i < y.length); i++) {\n t.push(p(x[i],y[i]));\n }\n return t;\n };\n\n if(f == undefined)\n return zipWith;\n if(xs == undefined) {\n var z = function(n,m) {\n if(n == undefined)\n return z;\n if(m == undefined)\n return function(q){return doZipWith(f,n,q);}\n return doZipWith(f,n,m);\n };\n return z;\n }\n if(ys == undefined)\n return function(n){return doZipWith(f,xs,n);}\n return doZipWith(f,xs,ys);\n}", "title": "" }, { "docid": "6ea5d523d7c0c9f2c61e9917478c4ea3", "score": "0.52365047", "text": "function zip(xs, ys, fill) {\n const res = [];\n\n if (xs.length <= ys.length) {\n let i = 0;\n for (; i < xs.length; i++) {\n res[i] = [xs[i], ys[i]];\n }\n for (; i < ys.length; i++) {\n res[i] = [fill, ys[i]];\n }\n\n return res;\n } else {\n let i = 0;\n for (; i < ys.length; i++) {\n res[i] = [xs[i], ys[i]];\n }\n for (; i < xs.length; i++) {\n res[i] = [xs[i], fill];\n }\n\n return res;\n }\n}", "title": "" }, { "docid": "82cf7b9dcb51c57d849ef9f804108daf", "score": "0.52320856", "text": "function zip(arrA, arrB) {\n let newArr = [];\n if (arrA.length !== arrB.length) {\n return undefined;\n } else {\n for (let i = 0; i < arrA.length; i++) {\n newArr.push([arrA[i], arrB[i]])\n }\n }\n console.log(newArr);\n }", "title": "" }, { "docid": "2082c2c229b6121480582d273daea3af", "score": "0.5223726", "text": "function enumerate (iterable) {\n return zip (range (len (iterable)), iterable);\n }", "title": "" }, { "docid": "8f922ed6ecb05e202557beda33619448", "score": "0.5211223", "text": "function flatMap(items, f) {\n const results = [];\n for (const x of items) {\n results.push(...f(x));\n }\n return results;\n }", "title": "" }, { "docid": "4a02122f7ecfd1e68933dce466fd0af0", "score": "0.52054167", "text": "function mapAllToEach(p, q) {\n let arr = []\n for (let i = 0; i < p.length; i++) {\n for (let k = 0; k < q.length; k++) {\n arr.push([p[i], q[k]])\n }\n }\n\n return arr\n }", "title": "" }, { "docid": "5fbfdccfe80d16c029dcfd970a7a3d45", "score": "0.5199925", "text": "function zipIt(women, men) {\n if (women.length === men.length) {\n return women.map((woman, i) => [woman, men[i]]);\n } else {\n console.log(\"sizes don't match\");\n }\n}", "title": "" }, { "docid": "de6a72a712aad91ab88f9d3283afaa63", "score": "0.5136185", "text": "function cartesianProduct(...arrays) {\n\tfunction _inner(...args) {\n\t\tif (arguments.length > 1) {\n\t\t\tconst arr2 = args.pop(); // arr of arrs of elems\n\t\t\tconst arr1 = args.pop(); // arr of elems\n\t\t\treturn _inner(...args,\n\t\t\t\tarr1.map(e1 => arr2.map(e2 => [e1, ...e2]))\n\t\t\t\t .reduce((arr, e) => arr.concat(e), []));\n\t\t}\n\t\t\treturn args[0];\n\t}\n\treturn _inner(...arrays, [[]]);\n}", "title": "" }, { "docid": "07beda9bb9e47892f95118bf14108e59", "score": "0.51223236", "text": "function MergeIterator(iters) {\n this._iters = iters.filter(function(a) {\n try {\n a.peek();\n return true;\n } catch (e) {\n if (!(e instanceof StopIteration)) {\n throw e;\n }\n }\n return false;\n });\n this._q = new Heap(this._iters, function(a, b) {\n return a.peek() - b.peek();\n });\n this._curIter = null;\n if (!this._q.empty()) {\n this._curIter = this._q.pop();\n }\n}", "title": "" }, { "docid": "e6e9b91a95645bcdada9612151ad2df2", "score": "0.5118855", "text": "function union(){\n var result = [];\n var args = Array.prototype.slice.call(arguments);\n debugger;\n args.forEach(function(arg){\n arg.forEach(function(el){\n result.push(el); \n })\n });\n \n return result;\n}", "title": "" }, { "docid": "6a1f2a8b7c58f3c3eea3f38902004ad1", "score": "0.51162887", "text": "function interleave(arr1, arr2) {\n return arr1.reduce(function(array, element, index) {\n array.push(element, arr2[index]);\n return array;\n }, []);\n}", "title": "" }, { "docid": "48f31afa4626269f8dd5b055b91d2046", "score": "0.5108958", "text": "function chain(xs, f) {\n return [].concat.apply([], xs.map(f))\n}", "title": "" }, { "docid": "14d3844adb674a4b5125955c1bb9275d", "score": "0.5070572", "text": "function interleave2(array1, array2) {\n let result = [];\n array1.forEach((item, index) => {\n result.push(item, array2[index]);\n });\n\n return result;\n}", "title": "" }, { "docid": "98904e0e660aa101bd499ad01d1209ee", "score": "0.5063982", "text": "function joinArrays(...args){\n\n \n return args.reduce((acc, next)=> acc.concat(next)\n ,[])\n}", "title": "" }, { "docid": "0cd8af9dd5f295964b8e3e68b4a1fcc3", "score": "0.50057507", "text": "function intertwineArrays(arr1, arr2) {\n var output = [];\n for (var i = 0; i < arr1.length; i++) { //only 1 for loop !!!\n output.push(arr1[i], arr2[i]);\n }\n return output;\n}", "title": "" }, { "docid": "77c89c5280502b5be800257013136ffc", "score": "0.49990505", "text": "function concatMany(...arr) {\r\n let result = [];\r\n arr.map((el) => {\r\n result = result.concat(el)\r\n })\r\n return result\r\n}", "title": "" }, { "docid": "1090a80a2b71194004f1a35418ad7c94", "score": "0.49829695", "text": "function map2([ head, ...tail ], fn) {\n if (head === undefined && !tail.length) return [];\n return tail.length ? [ fn(head), ...(map(tail, fn)) ] : [ fn(head) ];\n}", "title": "" }, { "docid": "6af75a1e94e2945c753f23656ccf5997", "score": "0.4982426", "text": "function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result);});};for(var i=0;i<ary.length;i++){eachWithIndex(i,ary[i],next);}}", "title": "" }, { "docid": "3d73fb7ec171ef939ecbe4a9f6850ba3", "score": "0.49822056", "text": "static combine(a, b, op) {\n let result = [];\n for (let i = 0, len = a.length; i < len; i++) {\n for (let k = 0, lenB = b.length; k < lenB; k++) {\n result.push(op(a[i], b[k]));\n }\n }\n return result;\n }", "title": "" }, { "docid": "4ec4fc2b8d7ce63ffafb8107a04fb967", "score": "0.4969452", "text": "function mapForEach(arr, fn) {\n\n var newArr = [];\n for(var i =0; i< arr1.length ; i++) {\n newArr.push(\n fn(arr1[i])\n );\n };\n\n return newArr\n}", "title": "" }, { "docid": "361a71030eafc8a191943eb9bf24a931", "score": "0.49639043", "text": "function optellen(...numbers) {\n return numbers.reduce(function(prev, current) {\n return prev + current;\n })\n}", "title": "" }, { "docid": "b861dd726f19d74a10f55a9fa3818849", "score": "0.49531448", "text": "function combineLists(list1, list2) {\n const res = [];\n for (let i = 0; i < list1.length; i++) {\n res.push(list1[i]);\n res.push(list2[i]);\n }\n\n return res;\n}", "title": "" }, { "docid": "a4dbbf56cca5e575b9fba0ecd0b24dbb", "score": "0.49501932", "text": "function alternatingElements (array1, array2) {\n var length = array1.length\n var newArray = [];\n for (var i=0; i < length; i ++) {\n newArray.push(array1[i])\n newArray.push(array2[i])\n }\n return newArray\n}", "title": "" }, { "docid": "051c3668e634d5a8fe903229181b3ff6", "score": "0.49423087", "text": "function combineEpics() {\n var epics = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n epics[_i] = arguments[_i];\n }\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return rxjs__WEBPACK_IMPORTED_MODULE_3__[\"merge\"].apply(void 0, epics.map(function (epic) { return epic.apply(void 0, args); }));\n };\n}", "title": "" }, { "docid": "20efea9ffa050613dd42dae157277c4b", "score": "0.4941296", "text": "function mergeArrays() {\n let allArrays = [];\n for (let argument of arguments) {\n for (let item of argument) {\n allArrays.push(item);\n }\n }\n return allArrays\n}", "title": "" }, { "docid": "a9af226e8f81af8d2815fff3a911992a", "score": "0.49151555", "text": "function zipRight_(a, b, __trace) {\n return (0, _core.chain_)(a, () => b, __trace);\n}", "title": "" }, { "docid": "14f4168c66243c6d8b72b5bb5d98fe67", "score": "0.4906562", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\t\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\t\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "14f4168c66243c6d8b72b5bb5d98fe67", "score": "0.4906562", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\t\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\t\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "14f4168c66243c6d8b72b5bb5d98fe67", "score": "0.4906562", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\t\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\t\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "14f4168c66243c6d8b72b5bb5d98fe67", "score": "0.4906562", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\t\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\t\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "cc675e4cc2d0d12c360a596587fb9681", "score": "0.4901674", "text": "*iterator(elements) {\n\t\tfor(let value of elements.values()){\n\t\t\tyield value;\n\t\t}\n\t}", "title": "" }, { "docid": "5a6a94dac6e84d774e2548b04204200c", "score": "0.48994297", "text": "function results(...fns) {\n return function(...args) {\n return fns.map(function(fn) {\n return fn.apply(this, args);\n })\n }\n}", "title": "" }, { "docid": "2e3876be3bb4b561f4c0b532b4b152fe", "score": "0.48989835", "text": "function combos(...many) {\n return new ArrayWrapper(\n function* outputGen() {\n for (const t of internalCombos(...many)) yield [t];\n },\n { debug: false },\n );\n}", "title": "" }, { "docid": "8c96a2828359f0bfbe96f8d0067c5a5b", "score": "0.4897194", "text": "function map(f, xs) {\n return xs.map(f);\n }", "title": "" }, { "docid": "5d0f885d9637b213b5dbc96e9ffbf6ba", "score": "0.48932478", "text": "function interleave(array1, array2) {\n let result = [];\n for (let index = 0; index < array1.length; index += 1) {\n result.push(array1[index], array2[index]);\n }\n\n return result;\n}", "title": "" }, { "docid": "ec39ab572fbef50fab0330b9277c9798", "score": "0.48928502", "text": "function interleave(array1,array2){\n var b = [];\n for (var i = 0; i < array1.length; i++) {\n b.push(array1[i],array2[i]);\n }\n return b;\n}", "title": "" }, { "docid": "9fe39bb1a382c582fe585177d3933953", "score": "0.4891416", "text": "function map(ary,each,done){var result=new Array(ary.length);var next=after(ary.length,done);var eachWithIndex=function eachWithIndex(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result);});};for(var i=0;i<ary.length;i++){eachWithIndex(i,ary[i],next);}}", "title": "" }, { "docid": "c719a9cc62da489b4a3eea585e675160", "score": "0.48898363", "text": "function flatMap(f, xs) { return flatten(map(f, xs)); }", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "e452d8d3305db29e5aeda32c8cdf17a0", "score": "0.48761842", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function(i, el, cb) {\n\t each(el, function(error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "625fad6909f9dc73d7951f1471a209ae", "score": "0.4871964", "text": "function multiConcat (...arrays) {\n\tconst arrayConcatenados = [];\n \n\tarrays.forEach((array) => {\n\t\tarrayConcatenados.push(...array);\n\t});\n \n\treturn arrayConcatenados;\n}", "title": "" }, { "docid": "dbe028196bfbb9d20713133cfea6bcdf", "score": "0.48670012", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after_1(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n }", "title": "" }, { "docid": "ed2add626c24c1d4a5e869b273b85783", "score": "0.4864214", "text": "function ziprange(range) {\n for (var i = 0, z = [], n = range.length - 1; i < n; i += 2) {\n z.push([range[i], range[i + 1]]);\n }\n return z;\n}", "title": "" }, { "docid": "28a29a9e704a7ca9392e2cb086e28773", "score": "0.4861696", "text": "map(fn){\n return this.elements.map(fn)\n }", "title": "" }, { "docid": "470a5cdb8ff390836fc984982cf806ef", "score": "0.48572248", "text": "function map(ary, each, done) {\n\t var result = new Array(ary.length);\n\t var next = after(ary.length, done);\n\n\t var eachWithIndex = function (i, el, cb) {\n\t each(el, function (error, msg) {\n\t result[i] = msg;\n\t cb(error, result);\n\t });\n\t };\n\n\t for (var i = 0; i < ary.length; i++) {\n\t eachWithIndex(i, ary[i], next);\n\t }\n\t}", "title": "" }, { "docid": "d4ff00bf74db3d687664f4c44abb2d46", "score": "0.4852922", "text": "function multiConcat(...params) {\n\treturn params.reduce((acum , el) => [...acum , ...el]);\n}", "title": "" }, { "docid": "b4d895a4fab749e5029c24f3b1d9eadb", "score": "0.48492578", "text": "mapAndTwo(arr) {\n return arr.map(this.addTwo)\n }", "title": "" }, { "docid": "f49d3865832ac496ed1e571f546e03e7", "score": "0.48460716", "text": "function zipWith(eventsLeft, eventsRight, assemble) {\n return (function eventsZippedWith(next) {\n // Create 2 buffer arrays to manage older items.\n var bufferLeft = [];\n var bufferRight = [];\n\n // Assemble will always be called with a `valueLeft` and a `valueRight`\n // argument. If one is missing, the other will be kept buffered until\n // the next event comes in.\n\n eventsLeft(function nextBufferLeft(valueLeft) {\n // If there are any buffered right values, shift off the first one in,\n // and assemble it with left.\n if (bufferRight.length) next(assemble(valueLeft, bufferRight.shift()));\n // Otherwise buffer until its mate comes along.\n else bufferLeft.push(valueLeft);\n });\n\n eventsRight(function nextBufferRight(valueRight) {\n if (bufferLeft.length) next(assemble(bufferLeft.shift(), valueRight));\n else bufferRight.push(valueRight);\n });\n });\n}", "title": "" }, { "docid": "bcfb347259f9198128caad47bd69d883", "score": "0.4844741", "text": "function UnionIterator(iters) {\n this._iter = new MergeIterator(iters);\n this._lastValue = null;\n}", "title": "" }, { "docid": "9d4e825ad4a6bcc196332802daed0887", "score": "0.48376876", "text": "function map(ary,each,done){var result=new Array(ary.length);var next=after_1(ary.length,done);var eachWithIndex=function eachWithIndex(i,el,cb){each(el,function(error,msg){result[i]=msg;cb(error,result);});};for(var i=0;i<ary.length;i++){eachWithIndex(i,ary[i],next);}}", "title": "" }, { "docid": "4a8605d32283468d1efb0450eacdfd23", "score": "0.48320663", "text": "function union(arrs) {\n var results = [];\n var i = -1, len = arguments.length;\n while (++i < len) {\n append(results, arguments[i]);\n }\n \n return unique(results);\n }", "title": "" }, { "docid": "d2540551dee092aaf669d737cf1ddef6", "score": "0.4825809", "text": "function zipLeft_(a, b, __trace) {\n return (0, _core.chain_)(a, r => (0, _as.as_)(b, r));\n}", "title": "" }, { "docid": "022ee4eddfa57b7534732992bbedf119", "score": "0.4817446", "text": "function crossProduct(items) {\n if (items.length === 1) {\n return items[0];\n }\n const first = items[0];\n const rest = items.slice(1);\n const restCrossProduct = crossProduct(rest);\n const result = first\n .map((f) => restCrossProduct.map((r) => f.concat(r)))\n .flat();\n return result;\n }", "title": "" }, { "docid": "147192edb0737e18399e4f9e7d7fdbe7", "score": "0.48016518", "text": "function flatMap2( dst, src, compute ) {\n for (var len = src.length, i = 0; i < len; i++) {\n if (!(i in src)) continue;\n var val = compute(src[i], i, src);\n Array.isArray(val) ? qibl.concat2(dst, val) : dst.push(val);\n }\n return dst;\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" }, { "docid": "187731ea5458191730b2a2115affbbe6", "score": "0.48001412", "text": "function map(ary, each, done) {\n var result = new Array(ary.length);\n var next = after(ary.length, done);\n\n var eachWithIndex = function(i, el, cb) {\n each(el, function(error, msg) {\n result[i] = msg;\n cb(error, result);\n });\n };\n\n for (var i = 0; i < ary.length; i++) {\n eachWithIndex(i, ary[i], next);\n }\n}", "title": "" } ]
9d80091d5ad84d2ec25037a43a3bdf53
Standard/simple iteration through an event's collected dispatches, but stops at the first dispatch execution returning true, and returns that id.
[ { "docid": "65a54c06a9a5bbbd7abe09ecaeb434f3", "score": "0.6410181", "text": "function executeDispatchesInOrderStopAtTrueImpl(event){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\nif(dispatchListeners[i](event,dispatchIDs[i])){return dispatchIDs[i];}}}else if(dispatchListeners){if(dispatchListeners(event,dispatchIDs)){return dispatchIDs;}}return null;}", "title": "" } ]
[ { "docid": "a43372f72464a3fe57df1bf7f4630fd4", "score": "0.6556344", "text": "function executeDispatchesInOrderStopAtTrueImpl(event){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tif(dispatchListeners[i](event,dispatchIDs[i])){return dispatchIDs[i];}}}else if(dispatchListeners){if(dispatchListeners(event,dispatchIDs)){return dispatchIDs;}}return null;}", "title": "" }, { "docid": "f65063441cdd651f903b6bffbddd96a5", "score": "0.6538148", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b127542a2147e5f381320b042892bc0", "score": "0.65188", "text": "function executeDispatchesInOrderStopAtTrue(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "8f2bad4bf9ef42534b3f649a9358aebc", "score": "0.6494704", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8f2bad4bf9ef42534b3f649a9358aebc", "score": "0.6494704", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8f2bad4bf9ef42534b3f649a9358aebc", "score": "0.6494704", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8f2bad4bf9ef42534b3f649a9358aebc", "score": "0.6494704", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8f2bad4bf9ef42534b3f649a9358aebc", "score": "0.6494704", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "8f2bad4bf9ef42534b3f649a9358aebc", "score": "0.6494704", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t if (dispatchListeners[i](event, dispatchIDs[i])) {\n\t return dispatchIDs[i];\n\t }\n\t }\n\t } else if (dispatchListeners) {\n\t if (dispatchListeners(event, dispatchIDs)) {\n\t return dispatchIDs;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "aa004f847c8f081c2370a5143818f22a", "score": "0.6487469", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "c3558422fe1bdbb19e2b1dc1dcdbefd3", "score": "0.647562", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "c3558422fe1bdbb19e2b1dc1dcdbefd3", "score": "0.647562", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "5a8204ad94826f7844c9f78094ebc6f1", "score": "0.647474", "text": "function executeDispatchesInOrderStopAtTrueImpl(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n if (dispatchListeners[i](event, dispatchIDs[i])) {\n return dispatchIDs[i];\n }\n }\n } else if (dispatchListeners) {\n if (dispatchListeners(event, dispatchIDs)) {\n return dispatchIDs;\n }\n }\n return null;\n}", "title": "" }, { "docid": "20e982752013c6da4a6c777135227be8", "score": "0.5792224", "text": "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(true){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i < dispatchListeners.length;i++) {if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\n\tcb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "title": "" }, { "docid": "6ed891b73fb0e47c1046cd51b171571b", "score": "0.57758766", "text": "function nextEventId() {\n\n\t\t\tfunction max(array) {\n\t\t\t\t// keep picking the larger value until it is the largest\n\t\t\t\treturn array.reduce(function (lhs, rhs) {\n\t\t\t\t\treturn rhs > lhs ? rhs : lhs;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// find the next integer after the largest ID in our store\n\t\t\treturn max(events.map(function (evt) {\n\t\t\t\treturn evt.id;\n\t\t\t})) + 1;\n\t\t}", "title": "" }, { "docid": "37632cca86fce9722228a8a16617b829", "score": "0.57618356", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (false) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "37e59c2c950017b73a19fa4b877acb9b", "score": "0.57031107", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (true) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "2c7ac5926eac173f4ba969e51dda8962", "score": "0.56995595", "text": "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "2c7ac5926eac173f4ba969e51dda8962", "score": "0.56995595", "text": "function next() {\n\t\t\t\tif (eventIDs.length) {\n\t\t\t\t\tsetTimeout(process, 1000);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "de2d3d1c2eebb20fc5ebf9d6d003c55b", "score": "0.56632864", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"development\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.5642193", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.5642193", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.5642193", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.5642193", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.5642193", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "2cf4f2158436fa85c8632dfc82f10514", "score": "0.5642193", "text": "function forEachEventDispatch(event, cb) {\n\t var dispatchListeners = event._dispatchListeners;\n\t var dispatchIDs = event._dispatchIDs;\n\t if (\"production\" !== process.env.NODE_ENV) {\n\t validateEventDispatches(event);\n\t }\n\t if (Array.isArray(dispatchListeners)) {\n\t for (var i = 0; i < dispatchListeners.length; i++) {\n\t if (event.isPropagationStopped()) {\n\t break;\n\t }\n\t // Listeners and IDs are two parallel arrays that are always in sync.\n\t cb(event, dispatchListeners[i], dispatchIDs[i]);\n\t }\n\t } else if (dispatchListeners) {\n\t cb(event, dispatchListeners, dispatchIDs);\n\t }\n\t}", "title": "" }, { "docid": "c7475a6375735797c6408a6bba2a433f", "score": "0.5641326", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "c7475a6375735797c6408a6bba2a433f", "score": "0.5641326", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== \"production\") {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "0f646a4317073dac29215987199f105a", "score": "0.56273854", "text": "function forEachEventDispatch(event,cb){var dispatchListeners=event._dispatchListeners;var dispatchIDs=event._dispatchIDs;if(\"production\"!==process.env.NODE_ENV){validateEventDispatches(event);}if(Array.isArray(dispatchListeners)){for(var i=0;i<dispatchListeners.length;i++){if(event.isPropagationStopped()){break;} // Listeners and IDs are two parallel arrays that are always in sync.\ncb(event,dispatchListeners[i],dispatchIDs[i]);}}else if(dispatchListeners){cb(event,dispatchListeners,dispatchIDs);}}", "title": "" }, { "docid": "6c096124e84eef91e76e38a61feabe76", "score": "0.5617337", "text": "function accumulateDispatches(id,ignoredDirection,event){if(event && event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(id,registrationName);if(listener){event._dispatchListeners = accumulateInto(event._dispatchListeners,listener);event._dispatchIDs = accumulateInto(event._dispatchIDs,id);}}}", "title": "" }, { "docid": "9d593aee5a2848b60d39b6786737a096", "score": "0.5559159", "text": "function accumulateDispatches(id,ignoredDirection,event){if(event&&event.dispatchConfig.registrationName){var registrationName=event.dispatchConfig.registrationName;var listener=getListener(id,registrationName);if(listener){event._dispatchListeners=accumulateInto(event._dispatchListeners,listener);event._dispatchIDs=accumulateInto(event._dispatchIDs,id);}}}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "d523a9474c60ae454818c505e4b8617a", "score": "0.5555926", "text": "function forEachEventDispatch(event, cb) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchIDs = event._dispatchIDs;\n if (\"production\" !== process.env.NODE_ENV) {\n validateEventDispatches(event);\n }\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n }\n // Listeners and IDs are two parallel arrays that are always in sync.\n cb(event, dispatchListeners[i], dispatchIDs[i]);\n }\n } else if (dispatchListeners) {\n cb(event, dispatchListeners, dispatchIDs);\n }\n}", "title": "" }, { "docid": "8161fe585c9e83ad93d5f0a68522ca2b", "score": "0.55058473", "text": "enumerate(event, id) {\n\t\tevent.ID = id + 1;\n\n\t\treturn event;\n\t}", "title": "" }, { "docid": "0447ecc0c53487d5c4b683fb83263918", "score": "0.55047613", "text": "function grabEvent(id){\n for(var i in eventList){\n if(eventList[i][\"id\"] === id){\n return eventList[i];\n };\n };\n}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "1979802ca2fe883ebef5324012f467b5", "score": "0.53812534", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners =\n\t accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "fa139e1a4e58393449a312d795808db9", "score": "0.5374895", "text": "function accumulateDispatches(id, ignoredDirection, event) {\n\t if (event && event.dispatchConfig.registrationName) {\n\t var registrationName = event.dispatchConfig.registrationName;\n\t var listener = getListener(id, registrationName);\n\t if (listener) {\n\t event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n\t event._dispatchIDs = accumulateInto(event._dispatchIDs, id);\n\t }\n\t }\n\t}", "title": "" } ]
d7cf1946b05f720d5fad0b1dfd967209
Typedefs.Backend.Typedefs.Backend.Haskell.Haskell, HsType, True implementation of Typedefs.Backend.ASTGen, method generateTermDefs, genHaskell
[ { "docid": "00f25b2b6c0a62a70c5832cc095ff591", "score": "0.6728469", "text": "function Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_58_genHaskell_58_0($_0_arg, $_1_arg, $_2_arg){\n \n const $cg$3 = $_1_arg.$2;\n let $cg$2 = null;\n $cg$2 = $cg$3.$2;\n return new $HC_2_1$Effects__EBind(new $HC_2_3$Effects__LiftP(new $HC_2_1$Effects__InList(new $HC_1_1$Effects__S($HC_0_0$Effects__Z), new $HC_2_1$Effects__InList(new $HC_1_1$Effects__S(new $HC_1_1$Effects__S($HC_0_0$Effects__Z)), $HC_0_0$Effects__SubNil)), Typedefs__Backend__Haskell__dependencies($_1_arg.$1, Typedefs__Backend__Haskell__freshEnv($_1_arg.$1), $cg$2, $_2_arg)), $partial_3_4$$_7044_Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_58_genHaskell_58_0_95_lam($_1_arg.$1, $_1_arg.$2, $_2_arg));\n}", "title": "" } ]
[ { "docid": "4905b88a9d985475070cc546e82b29f7", "score": "0.6306183", "text": "function Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0($_0_arg){\n return Typedefs__Backend__Utils__runMakeDefM(null, null, Typedefs__Backend__Haskell__specialisedMap(), $partial_1_2$Typedefs__Backend___123_Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_95_lam_95_7051_125_($_0_arg));\n}", "title": "" }, { "docid": "2699e656db4058c6866aed9ff1e6ab2f", "score": "0.610341", "text": "function Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_58_genTerms_58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg){\n return new $HC_2_1$Effects__EBind(Typedefs__Backend__Haskell__encodeDef($_0_arg, $_2_arg, $_3_arg), $partial_3_4$$_7046_Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_58_genTerms_58_0_95_lam($_0_arg, $_2_arg, $_3_arg));\n}", "title": "" }, { "docid": "a2c8778f70fa1d4a742ced2aea920509", "score": "0.60106474", "text": "function Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTyDefs_58_0($_0_arg, $_1_arg){\n return Typedefs__Backend__Utils__runMakeDefM(null, null, Typedefs__Backend__Haskell__specialisedMap(), $partial_2_3$Typedefs__Backend___123_Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTyDefs_58_0_95_lam_95_7058_125_($_0_arg, $_1_arg));\n}", "title": "" }, { "docid": "80f8e211ad890697a663a766a1235a3d", "score": "0.59420586", "text": "function haxe(hljs) {\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' + 'for function here if import in inline never new override package private get set ' + 'public return static super switch this throw trace try typedef untyped using var while ' + HAXE_BASIC_TYPES,\n built_in: 'trace this',\n literal: 'true false null _'\n },\n contains: [{\n className: 'string',\n // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [hljs.BACKSLASH_ESCAPE, {\n className: 'subst',\n // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n }, {\n className: 'subst',\n // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }]\n }, hljs.QUOTE_STRING_MODE, hljs.C_LINE_COMMENT_MODE, hljs.C_BLOCK_COMMENT_MODE, hljs.C_NUMBER_MODE, {\n className: 'meta',\n // compiler meta\n begin: '@:',\n end: '$'\n }, {\n className: 'meta',\n // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif end error'\n }\n }, {\n className: 'type',\n // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n }, {\n className: 'type',\n // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n }, {\n className: 'type',\n // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n }, {\n className: 'class',\n // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n }, {\n className: 'class',\n // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [{\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n }, {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n }, {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n }, hljs.TITLE_MODE],\n keywords: {\n keyword: 'abstract from to'\n }\n }, {\n className: 'class',\n // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [{\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [{\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }]\n }, hljs.TITLE_MODE]\n }, {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }],\n illegal: /<\\//\n };\n }", "title": "" }, { "docid": "20347117c18080344b841be2a65087da", "score": "0.589522", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' +\n 'for function here if import in inline never new override package private get set ' +\n 'public return static super switch this throw trace try typedef untyped using var while ' +\n HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n keyword: 'if else elseif end error'\n }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: {\n keyword: 'abstract from to'\n }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "2c9a9e153647f93aae605002540b9b5a", "score": "0.58896327", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' +\n 'for function here if import in inline never new override package private get set ' +\n 'public return static super switch this throw trace try typedef untyped using var while ' +\n HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif end error'\n }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: {\n keyword: 'abstract from to'\n }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "2c9a9e153647f93aae605002540b9b5a", "score": "0.58896327", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' +\n 'for function here if import in inline never new override package private get set ' +\n 'public return static super switch this throw trace try typedef untyped using var while ' +\n HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif end error'\n }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: {\n keyword: 'abstract from to'\n }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "2c9a9e153647f93aae605002540b9b5a", "score": "0.58896327", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' +\n 'for function here if import in inline never new override package private get set ' +\n 'public return static super switch this throw trace try typedef untyped using var while ' +\n HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif end error'\n }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: {\n keyword: 'abstract from to'\n }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "2c9a9e153647f93aae605002540b9b5a", "score": "0.58896327", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' +\n 'for function here if import in inline never new override package private get set ' +\n 'public return static super switch this throw trace try typedef untyped using var while ' +\n HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif end error'\n }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: {\n keyword: 'abstract from to'\n }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "2c9a9e153647f93aae605002540b9b5a", "score": "0.58896327", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: ['hx'],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern ' +\n 'for function here if import in inline never new override package private get set ' +\n 'public return static super switch this throw trace try typedef untyped using var while ' +\n HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: {\n 'meta-keyword': 'if else elseif end error'\n }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [hljs.TITLE_MODE]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: {\n keyword: 'abstract from to'\n }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [hljs.TITLE_MODE]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "846dca9aae3d2d83b1679d6b392770e4", "score": "0.5888041", "text": "function haxe(hljs) {\n\n const HAXE_BASIC_TYPES = 'Int Float String Bool Dynamic Void Array ';\n\n return {\n name: 'Haxe',\n aliases: [ 'hx' ],\n keywords: {\n keyword: 'break case cast catch continue default do dynamic else enum extern '\n + 'for function here if import in inline never new override package private get set '\n + 'public return static super switch this throw trace try typedef untyped using var while '\n + HAXE_BASIC_TYPES,\n built_in:\n 'trace this',\n literal:\n 'true false null _'\n },\n contains: [\n {\n className: 'string', // interpolate-able strings\n begin: '\\'',\n end: '\\'',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n {\n className: 'subst', // interpolation\n begin: '\\\\$\\\\{',\n end: '\\\\}'\n },\n {\n className: 'subst', // interpolation\n begin: '\\\\$',\n end: /\\W\\}/\n }\n ]\n },\n hljs.QUOTE_STRING_MODE,\n hljs.C_LINE_COMMENT_MODE,\n hljs.C_BLOCK_COMMENT_MODE,\n hljs.C_NUMBER_MODE,\n {\n className: 'meta', // compiler meta\n begin: '@:',\n end: '$'\n },\n {\n className: 'meta', // compiler conditionals\n begin: '#',\n end: '$',\n keywords: { keyword: 'if else elseif end error' }\n },\n {\n className: 'type', // function types\n begin: ':[ \\t]*',\n end: '[^A-Za-z0-9_ \\t\\\\->]',\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type', // types\n begin: ':[ \\t]*',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type', // instantiation\n begin: 'new *',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'class', // enums\n beginKeywords: 'enum',\n end: '\\\\{',\n contains: [ hljs.TITLE_MODE ]\n },\n {\n className: 'class', // abstracts\n beginKeywords: 'abstract',\n end: '[\\\\{$]',\n contains: [\n {\n className: 'type',\n begin: '\\\\(',\n end: '\\\\)',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'from +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n {\n className: 'type',\n begin: 'to +',\n end: '\\\\W',\n excludeBegin: true,\n excludeEnd: true\n },\n hljs.TITLE_MODE\n ],\n keywords: { keyword: 'abstract from to' }\n },\n {\n className: 'class', // classes\n begin: '\\\\b(class|interface) +',\n end: '[\\\\{$]',\n excludeEnd: true,\n keywords: 'class interface',\n contains: [\n {\n className: 'keyword',\n begin: '\\\\b(extends|implements) +',\n keywords: 'extends implements',\n contains: [\n {\n className: 'type',\n begin: hljs.IDENT_RE,\n relevance: 0\n }\n ]\n },\n hljs.TITLE_MODE\n ]\n },\n {\n className: 'function',\n beginKeywords: 'function',\n end: '\\\\(',\n excludeEnd: true,\n illegal: '\\\\S',\n contains: [ hljs.TITLE_MODE ]\n }\n ],\n illegal: /<\\//\n };\n}", "title": "" }, { "docid": "026f178fc6cd97573f91f06191a311af", "score": "0.54696393", "text": "function Typedefs__Backend__Typedefs__Backend__ReasonML___64_Typedefs__Backend__ASTGen_36_ReasonML_58_RMLType_58_True_58__33_generateTyDefs_58_0($_0_arg, $_1_arg){\n return Typedefs__Backend__Utils__runMakeDefM(null, null, Typedefs__Backend__Specialisation__Typedefs__Backend__ReasonML___64_Typedefs__Backend__Specialisation__Specialisation_36_RMLType_58__33_specialisedTypes_58_0(), $partial_1_2$Typedefs__Backend___123_Typedefs__Backend__ReasonML___64_Typedefs__Backend__ASTGen_36_ReasonML_58_RMLType_58_True_58__33_generateTyDefs_58_0_95_lam_95_7069_125_($_1_arg));\n}", "title": "" }, { "docid": "03a9da46ef152a177023ed271b399336", "score": "0.5392102", "text": "function Typedefs__Backend__Typedefs__Backend__JSON___64_Typedefs__Backend__ASTGen_36_JSONDef_58_JSON_58_False_58__33_generateTyDefs_58_0($_0_arg, $_1_arg){\n return Typedefs__Backend__Utils__runMakeDefM(null, null, Typedefs__Backend__Specialisation__Typedefs__Backend__JSON___64_Typedefs__Backend__Specialisation__Specialisation_36_JSON_58__33_specialisedTypes_58_0(), $partial_1_2$Typedefs__Backend___123_Typedefs__Backend__JSON___64_Typedefs__Backend__ASTGen_36_JSONDef_58_JSON_58_False_58__33_generateTyDefs_58_0_95_lam_95_7064_125_($_1_arg));\n}", "title": "" }, { "docid": "8413e96591150a3502a3a75fc55929ef", "score": "0.48471308", "text": "function Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_58_generateNext_58_0($_0_arg, $_1_arg, $_2_arg, $_3_arg){\n let $cg$1 = null;\n $cg$1 = $_2_arg.$1;\n return Typedefs__Backend__Utils__ifNotPresent(null, null, $cg$1, $partial_2_3$$_7047_Typedefs__Backend__Typedefs__Backend__Haskell___64_Typedefs__Backend__ASTGen_36_Haskell_58_HsType_58_True_58__33_generateTermDefs_58_0_58_generateNext_58_0_95_lam($_0_arg, $_2_arg), $_3_arg);\n}", "title": "" }, { "docid": "dad41e121b6f434dae14323054a54663", "score": "0.47459134", "text": "function generateHaskellCompilerCommand(path, mainClass) {\n var options = '';\n options = config.getVMCompilationConfig('Haskell-HSpec', path) + 'sh -c \"cd ' + path + '; ghc -o output.out ' + mainClass + ';echo \"\" \"';\n //console.log(options);\n return options;\n}", "title": "" }, { "docid": "acf19258301463f09b0971e7a35bb42f", "score": "0.47057584", "text": "static loadSchemaFromTypescript() {\n const settings = {\n required: true\n };\n const compilerOption = {\n strictNullChecks: true\n };\n const prog = tjs.getProgramFromFiles([path_1.default.resolve(__dirname, './option')], compilerOption);\n return tjs.generateSchema(prog, 'Option', settings);\n }", "title": "" }, { "docid": "e9379cbc0dca86f074ed3381647823f8", "score": "0.46825063", "text": "function buildASTSchema(ast, queryTypeName, mutationTypeName, subscriptionTypeName) {\n\n if ((0, _jsutilsIsNullish2['default'])(ast)) {\n throw new Error('must pass in ast');\n }\n if ((0, _jsutilsIsNullish2['default'])(queryTypeName)) {\n throw new Error('must pass in query type');\n }\n\n var typeDefs = ast.definitions.filter(function (d) {\n switch (d.kind) {\n case _languageKinds.OBJECT_TYPE_DEFINITION:\n case _languageKinds.INTERFACE_TYPE_DEFINITION:\n case _languageKinds.ENUM_TYPE_DEFINITION:\n case _languageKinds.UNION_TYPE_DEFINITION:\n case _languageKinds.SCALAR_TYPE_DEFINITION:\n case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:\n return true;\n }\n });\n\n var astMap = (0, _jsutilsKeyMap2['default'])(typeDefs, function (d) {\n return d.name.value;\n });\n\n if ((0, _jsutilsIsNullish2['default'])(astMap[queryTypeName])) {\n throw new Error('Specified query type ' + queryTypeName + ' not found in document.');\n }\n\n if (!(0, _jsutilsIsNullish2['default'])(mutationTypeName) && (0, _jsutilsIsNullish2['default'])(astMap[mutationTypeName])) {\n throw new Error('Specified mutation type ' + mutationTypeName + ' not found in document.');\n }\n\n if (!(0, _jsutilsIsNullish2['default'])(subscriptionTypeName) && (0, _jsutilsIsNullish2['default'])(astMap[subscriptionTypeName])) {\n throw new Error('Specified subscription type ' + subscriptionTypeName + ' not found in document.');\n }\n\n /**\n * This generates a function that allows you to produce\n * type definitions on demand. We produce the function\n * in order to close over the memoization dictionaries\n * that need to be retained over multiple functions calls.\n **/\n function getTypeDefProducer() {\n\n var innerTypeMap = {\n String: _type.GraphQLString,\n Int: _type.GraphQLInt,\n Float: _type.GraphQLFloat,\n Boolean: _type.GraphQLBoolean,\n ID: _type.GraphQLID\n };\n\n return function (typeAST) {\n var typeName = getInnerTypeName(typeAST);\n if (!(0, _jsutilsIsNullish2['default'])(innerTypeMap[typeName])) {\n return buildWrappedType(innerTypeMap[typeName], typeAST);\n }\n\n if ((0, _jsutilsIsNullish2['default'])(astMap[typeName])) {\n throw new Error('Type ' + typeName + ' not found in document');\n }\n\n var innerTypeDef = makeSchemaDef(astMap[typeName]);\n if ((0, _jsutilsIsNullish2['default'])(innerTypeDef)) {\n throw new Error('Nothing constructed for ' + typeName);\n }\n innerTypeMap[typeName] = innerTypeDef;\n return buildWrappedType(innerTypeDef, typeAST);\n };\n }\n\n var produceTypeDef = getTypeDefProducer(ast);\n\n ast.definitions.forEach(produceTypeDef);\n\n var queryType = produceTypeDef(astMap[queryTypeName]);\n\n var schemaBody = {\n query: queryType\n };\n\n if (!(0, _jsutilsIsNullish2['default'])(mutationTypeName)) {\n schemaBody.mutation = produceTypeDef(astMap[mutationTypeName]);\n }\n\n if (!(0, _jsutilsIsNullish2['default'])(subscriptionTypeName)) {\n schemaBody.subscription = produceTypeDef(astMap[subscriptionTypeName]);\n }\n\n return new _type.GraphQLSchema(schemaBody);\n\n function makeSchemaDef(def) {\n if ((0, _jsutilsIsNullish2['default'])(def)) {\n throw new Error('def must be defined');\n }\n switch (def.kind) {\n case _languageKinds.OBJECT_TYPE_DEFINITION:\n return makeTypeDef(def);\n case _languageKinds.INTERFACE_TYPE_DEFINITION:\n return makeInterfaceDef(def);\n case _languageKinds.ENUM_TYPE_DEFINITION:\n return makeEnumDef(def);\n case _languageKinds.UNION_TYPE_DEFINITION:\n return makeUnionDef(def);\n case _languageKinds.SCALAR_TYPE_DEFINITION:\n return makeScalarDef(def);\n case _languageKinds.INPUT_OBJECT_TYPE_DEFINITION:\n return makeInputObjectDef(def);\n default:\n throw new Error(def.kind + ' not supported');\n }\n }\n\n function makeTypeDef(def) {\n var typeName = def.name.value;\n var config = {\n name: typeName,\n fields: function fields() {\n return makeFieldDefMap(def);\n },\n interfaces: function interfaces() {\n return makeImplementedInterfaces(def);\n }\n };\n return new _type.GraphQLObjectType(config);\n }\n\n function makeFieldDefMap(def) {\n return (0, _jsutilsKeyValMap2['default'])(def.fields, function (field) {\n return field.name.value;\n }, function (field) {\n return {\n type: produceTypeDef(field.type),\n args: makeInputValues(field.arguments)\n };\n });\n }\n\n function makeImplementedInterfaces(def) {\n return def.interfaces.map(function (inter) {\n return produceTypeDef(inter);\n });\n }\n\n function makeInputValues(values) {\n return (0, _jsutilsKeyValMap2['default'])(values, function (value) {\n return value.name.value;\n }, function (value) {\n var type = produceTypeDef(value.type);\n return { type: type, defaultValue: (0, _valueFromAST.valueFromAST)(value.defaultValue, type) };\n });\n }\n\n function makeInterfaceDef(def) {\n var typeName = def.name.value;\n var config = {\n name: typeName,\n resolveType: function resolveType() {\n return null;\n },\n fields: function fields() {\n return makeFieldDefMap(def);\n }\n };\n return new _type.GraphQLInterfaceType(config);\n }\n\n function makeEnumDef(def) {\n var enumType = new _type.GraphQLEnumType({\n name: def.name.value,\n values: (0, _jsutilsKeyValMap2['default'])(def.values, function (v) {\n return v.name.value;\n }, function () {\n return {};\n })\n });\n\n return enumType;\n }\n\n function makeUnionDef(def) {\n return new _type.GraphQLUnionType({\n name: def.name.value,\n resolveType: function resolveType() {\n return null;\n },\n types: def.types.map(function (t) {\n return produceTypeDef(t);\n })\n });\n }\n\n function makeScalarDef(def) {\n return new _type.GraphQLScalarType({\n name: def.name.value,\n serialize: function serialize() {\n return null;\n },\n // Note: validation calls the parse functions to determine if a\n // literal value is correct. Returning null would cause use of custom\n // scalars to always fail validation. Returning false causes them to\n // always pass validation.\n parseValue: function parseValue() {\n return false;\n },\n parseLiteral: function parseLiteral() {\n return false;\n }\n });\n }\n\n function makeInputObjectDef(def) {\n return new _type.GraphQLInputObjectType({\n name: def.name.value,\n fields: function fields() {\n return makeInputValues(def.fields);\n }\n });\n }\n}", "title": "" }, { "docid": "bbb77f148b585fee5131596048814515", "score": "0.46543962", "text": "writeHeader() {\n\t\tconst versionSplit = this.version.split('.');\n\t\tconst majorMinor = `${versionSplit[0]}.${versionSplit[1]}`;\n\t\tthis.output += `// Type definitions for non-npm package Titanium ${majorMinor}\\n`;\n\t\tthis.output += '// Project: https://github.com/appcelerator/titanium_mobile\\n';\n\t\tthis.output += '// Definitions by: Axway Appcelerator <https://github.com/appcelerator>\\n';\n\t\tthis.output += '// Jan Vennemann <https://github.com/janvennemann>\\n';\n\t\tthis.output += '// Sergey Volkov <https://github.com/drauggres>\\n';\n\t\tthis.output += '// Mathias Lorenzen <https://github.com/ffMathy>\\n';\n\t\tthis.output += '// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\\n';\n\t\tthis.output += '// TypeScript Version: 3.0\\n';\n\t\tthis.output += '\\n';\n\t\tthis.output += '// Base definitions that can\\'t be generated yet\\n';\n\t\tthis.output += '/// <reference path=\"base.d.ts\" />\\n';\n\t\tthis.output += '\\n';\n\t\tthis.output += 'type _Omit<T, K extends keyof any | undefined> = Pick<T, Exclude<keyof T, K>>;\\n';\n\t\tthis.output += 'type FunctionPropertyNames<T> = {\\n';\n\t\tthis.output += '\t// tslint:disable-next-line:ban-types\\n';\n\t\tthis.output += '\t[K in keyof T]: T[K] extends Function ? K : never\\n';\n\t\tthis.output += '}[keyof T];\\n';\n\t\tthis.output += 'type Dictionary<T> = Partial<_Omit<T, FunctionPropertyNames<Ti.Proxy>>>;';\n\t\tthis.output += '\\n';\n\t\tthis.output += 'interface ProxyEventMap {}\\n\\n';\n\t}", "title": "" }, { "docid": "dccd6544d370d0cbb02b1ece92429f93", "score": "0.46508625", "text": "function parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "dccd6544d370d0cbb02b1ece92429f93", "score": "0.46508625", "text": "function parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "94db8e09df2b9ed1b52c736de70b8dea", "score": "0.46252465", "text": "function parseDefinition(lexer) {\n if (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return parseTypeSystemDefinition(lexer);\n\n case 'extend':\n return parseTypeSystemExtension(lexer);\n }\n } else if (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "e467b39a3ccf46ed5df17efaad51864b", "score": "0.46217093", "text": "function makeDatatype(tabbing, datatype, sourceDir, extendsFrom) {\n var enumTemplate = getCompiledTemplate(path.resolve(sourceDir, \"templates/Enum.d.ts.ejs\"));\n var interfaceTemplate = getCompiledTemplate(path.resolve(sourceDir, \"templates/Interface.d.ts.ejs\"));\n\n var locals = {\n datatype: datatype,\n tabbing: tabbing\n };\n\n if (datatype.isenum) {\n locals.enumvalues = datatype.enumvalues;\n return enumTemplate(locals);\n } else {\n locals.extendsFrom = extendsFrom;\n locals.properties = datatype.properties;\n locals.generateApiSummary = generateApiSummary;\n locals.getProperty = getProperty;\n return interfaceTemplate(locals);\n }\n}", "title": "" }, { "docid": "0ef161aeeb28671e9a61eb24858a8b8f", "score": "0.46105868", "text": "function create__realType(gScp){\n\t//create dummy type real\n\tvar tmp_real_type = new type(\"real\", OBJ_TYPE.REAL, gScp);\n\t//create symbol 'this'\n\ttmp_real_type.createField(\n\t\t\"this\", \t\t\t\t\t\t\t//variable name\n\t\ttmp_real_type, \t\t\t\t\t\t//variable type\n\t\ttmp_real_type._scope._start\t\t\t//first block in the type's scope\n\t);\n\t//create fundamental functions\n\ttmp_real_type.createReqMethods();\n\t//reset command library to avoid cases when NULL command that initializes fields\n\t//\tof one type, also gets to initialize fields from another type, since it is\n\t//\tfound to be a similar NULL command.\n\tcommand.resetCommandLib();\n\t//create symbol '_value' of type real\n\t//var tmp_int_valSymb = new symbol(\"_value\", tmp_int_type, tmp_int_type._scope);\n\t//add '_value' to the scope\n\t//tmp_int_type._scope.addSymbol(tmp_int_valSymb);\n\t//create default constructor\n\t//var tmp_int_ctorFunc = new functinoid(\n\t//\t\"__create__\",\t\t\t//function name\n\t//\ttmp_int_type._scope,\t//function scope\n\t//\tFUNCTION_TYPE.CTOR,\t\t//type of function is constructor\n\t//\ttmp_int_type\t\t\t//returns create type\n\t//);\n\t//add constructor method to the type definition\n\t//tmp_int_type.addMethod(\"__create__\", tmp_int_ctorFunc);\n}", "title": "" }, { "docid": "99bb9d987765de37293cf595237f0ddc", "score": "0.46096465", "text": "function parseDefinition(lexer) {\n if (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'extend':\n case 'directive':\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n } else if (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n // Note: The schema definition language is an experimental addition.\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "85bb444567f2da49543a7604d6dc8271", "score": "0.46092078", "text": "function parseDefinition(lexer) {\n if (peek(lexer, _lexer.TokenKind.NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return parseTypeSystemDefinition(lexer);\n\n case 'extend':\n return parseTypeSystemExtension(lexer);\n }\n } else if (peek(lexer, _lexer.TokenKind.BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "7bdb1840f1b16e7ff89c7508016437a7", "score": "0.45997137", "text": "function xmlType(statement,outTs,expTs) {\n var typeName = getWord(2,statement);\n// typeName = typeName.toLowerCase();\n xmlOpenElement(\"<type name=\\\"\"+typeName,outTs);\n outTs.WriteLine(\"\\\">\");\n var typeType = getType(statement);\n //debug(\"St:\"+statement);\n //debug(\"tn:\"+typeName);\n //debug(\"tt:\"+typeType);\n \n switch( typeType) {\n case \"SELECT\" :\n\txmlSelect(statement,outTs);\n\tbreak;\n case \"ENUMERATION\" :\n\txmlEnumeration(statement,outTs);\n\tbreak;\n case \"BINARY\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\n case \"BOOLEAN\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\n case \"INTEGER\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\n case \"LOGICAL\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\n case \"NUMBER\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\n case \"REAL\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\n case \"STRING\" :\n\txmlBuiltInType(typeType,statement,outTs);\n\tbreak;\t\n case \"LIST\" :\n\txmlUnderlyingType(statement,outTs);\n\tbreak;\n case \"SET\" :\n\txmlUnderlyingType(statement,outTs);\n\tbreak;\n case \"BAG\" :\n\txmlUnderlyingType(statement,outTs);\n\tbreak;\n case \"ARRAY\" :\n\txmlUnderlyingType(statement,outTs);\n\tbreak;\n\n default :\t\n\txmlOpenElement(\"<typename\",outTs);\n\txmlAttr(\"name\",typeType,outTs);\n\txmlCloseAttr(outTs);\n\tbreak;\n }\n \n //outTs.WriteLine(\"\");\n xmlTypeStructure(outTs,expTs);\n}", "title": "" }, { "docid": "c1f69d15601b19c8c90f10448590251b", "score": "0.4590966", "text": "function generateGraphqlTypes() {\n return run(\n `apollo client:codegen __generated__ --endpoint ${endpoint} --target=typescript --includes ${watchedFiles}`,\n )\n .exec()\n .on('error', gutil.log);\n}", "title": "" }, { "docid": "2dd7015b6f181d50c15c96dc0a9c41cd", "score": "0.45875406", "text": "function parseDefinition(lexer) {\n if (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME)) {\n switch (lexer.token.value) {\n case 'query':\n case 'mutation':\n case 'subscription':\n case 'fragment':\n return parseExecutableDefinition(lexer);\n\n case 'schema':\n case 'scalar':\n case 'type':\n case 'interface':\n case 'union':\n case 'enum':\n case 'input':\n case 'directive':\n return parseTypeSystemDefinition(lexer);\n\n case 'extend':\n return parseTypeSystemExtension(lexer);\n }\n } else if (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].BRACE_L)) {\n return parseExecutableDefinition(lexer);\n } else if (peekDescription(lexer)) {\n return parseTypeSystemDefinition(lexer);\n }\n\n throw unexpected(lexer);\n}", "title": "" }, { "docid": "9bad85cba5dcc35cba6dbbd33ab21626", "score": "0.4565665", "text": "function definition() {\n return {\n // llvmType\n types: [\n 'void', 'half', 'float', 'double', 'x86_fp80', 'fp128', 'ppc_fp128',\n 'label', 'metadata', 'x86_mmx',\n 'type', 'label', 'opaque', 'token'\n ],\n // llvmStatement\n statements: [\n 'add', 'addrspacecast', 'alloca', 'and', 'arcp', 'ashr', 'atomicrmw',\n 'bitcast', 'br', 'catchpad', 'catchswitch', 'catchret', 'call',\n 'cleanuppad', 'cleanupret', 'cmpxchg', 'eq', 'exact', 'extractelement',\n 'extractvalue', 'fadd', 'fast', 'fcmp', 'fdiv', 'fence', 'fmul', 'fpext',\n 'fptosi', 'fptoui', 'fptrunc', 'free', 'frem', 'fsub', 'getelementptr',\n 'icmp', 'inbounds', 'indirectbr', 'insertelement', 'insertvalue',\n 'inttoptr', 'invoke', 'landingpad', 'load', 'lshr', 'malloc', 'max', 'min',\n 'mul', 'nand', 'ne', 'ninf', 'nnan', 'nsw', 'nsz', 'nuw', 'oeq', 'oge', 'ogt', 'ole',\n 'olt', 'one', 'or', 'ord', 'phi', 'ptrtoint', 'resume', 'ret', 'sdiv', 'select',\n 'sext', 'sge', 'sgt', 'shl', 'shufflevector', 'sitofp', 'sle', 'slt', 'srem',\n 'store', 'sub', 'switch', 'trunc', 'udiv', 'ueq', 'uge', 'ugt', 'uitofp', 'ule', 'ult',\n 'umax', 'umin', 'une', 'uno', 'unreachable', 'unwind', 'urem', 'va_arg',\n 'xchg', 'xor', 'zext'\n ],\n // llvmKeyword\n keywords: [\n 'acq_rel', 'acquire', 'addrspace', 'alias', 'align', 'alignstack', 'alwaysinline',\n 'appending', 'argmemonly', 'arm_aapcscc', 'arm_aapcs_vfpcc', 'arm_apcscc', 'asm',\n 'atomic', 'available_externally', 'blockaddress', 'builtin', 'byval', 'c', 'catch',\n 'caller', 'cc', 'ccc', 'cleanup', 'coldcc', 'comdat', 'common', 'constant',\n 'datalayout', 'declare', 'default', 'define', 'deplibs', 'dereferenceable',\n 'distinct', 'dllexport', 'dllimport', 'dso_local', 'dso_preemptable', 'except',\n 'external', 'externally_initialized', 'extern_weak', 'fastcc', 'filter', 'from',\n 'gc', 'global', 'hhvmcc', 'hhvm_ccc', 'hidden', 'initialexec', 'inlinehint',\n 'inreg', 'inteldialect', 'intel_ocl_bicc', 'internal', 'linkonce', 'linkonce_odr',\n 'localdynamic', 'localexec', 'local_unnamed_addr', 'minsize', 'module',\n 'monotonic', 'msp430_intrcc', 'musttail', 'naked', 'nest', 'noalias', 'nobuiltin',\n 'nocapture', 'noimplicitfloat', 'noinline', 'nonlazybind', 'nonnull', 'norecurse',\n 'noredzone', 'noreturn', 'nounwind', 'optnone', 'optsize', 'personality',\n 'private', 'protected', 'ptx_device', 'ptx_kernel', 'readnone', 'readonly',\n 'release', 'returned', 'returns_twice', 'sanitize_address', 'sanitize_memory',\n 'sanitize_thread', 'section', 'seq_cst', 'sideeffect', 'signext', 'syncscope',\n 'source_filename', 'speculatable', 'spir_func', 'spir_kernel', 'sret', 'ssp',\n 'sspreq', 'sspstrong', 'strictfp', 'swiftcc', 'tail', 'target', 'thread_local',\n 'to', 'triple', 'unnamed_addr', 'unordered', 'uselistorder', 'uselistorder_bb',\n 'uwtable', 'volatile', 'weak', 'weak_odr', 'within', 'writeonly', 'x86_64_sysvcc',\n 'win64cc', 'x86_fastcallcc', 'x86_stdcallcc', 'x86_thiscallcc', 'zeroext'\n ],\n\n escapes: /\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,\n\n tokenizer: {\n root: [\n [/[,(){}<>[\\]]/, 'delimiters'],\n [/i\\d+\\**/, 'type'], // llvmType\n\n // Misc syntax.\n [/[%@!]\\d+/, 'variable.name'], // llvmNoName\n [/-?\\d+\\.\\d*(e[+-]\\d+)?/, 'number.float'], // llvmFloat\n [/0[xX][0-9A-Fa-f]+/, 'number.hex'], // llvmFloat\n [/-?\\d+/, 'number'], // llvmNumber\n [/\\b(true|false)\\b/, 'keyword'], // llvmBoolean\n [/\\b(zeroinitializer|undef|null|none)\\b/, 'constant'], // llvmConstant\n [/\"([^\"\\\\]|\\\\.)*$/, 'string.invalid' ], // non-teminated string\n [/\"/, 'string', '@string'], // push to string state\n [/[-a-zA-Z$._][-a-zA-Z$._0-9]*:/, 'tag'], // llvmLabel\n [/[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/, 'variable.name'], // llvmIdentifier\n\n // Named metadata and specialized metadata keywords.\n [/![-a-zA-Z$._][-a-zA-Z$._0-9]*(?=\\s*)$/, 'identifier'], // llvmIdentifier\n [/![-a-zA-Z$._][-a-zA-Z$._0-9]*(?=\\s*[=!])/, 'identifier'], // llvmIdentifier\n [/![A-Za-z]+(?=\\s*\\()/, 'type'], // llvmType\n [/\\bDW_TAG_[a-z_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_ATE_[a-zA-Z_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_OP_[a-zA-Z0-9_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_LANG_[a-zA-Z0-9_]+\\b/, 'constant'], // llvmConstant\n [/\\bDW_VIRTUALITY_[a-z_]+\\b/, 'constant'], // llvmConstant\n [/\\bDIFlag[A-Za-z]+\\b/, 'constant'], // llvmConstant\n\n // Syntax-highlight lit test commands and bug numbers.\n [/;\\s*PR\\d*\\s*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*REQUIRES:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*RUN:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*CHECK:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*CHECK-(?:NEXT|NOT|DAG|SAME|LABEL):.*$/, 'comment.doc'], // llvmSpecialComment\n [/;\\s*XFAIL:.*$/, 'comment.doc'], // llvmSpecialComment\n [/;.*$/, 'comment'],\n [/[*#=!]/, 'operators'],\n [/[a-z_$][\\w$]*/, {\n cases: {\n '@statements': 'operators',\n '@keywords': 'keyword',\n '@types': 'type',\n '@default': 'identifier'\n }\n }],\n [/[ \\t\\r\\n]+/, 'white']\n\n ],\n string: [\n [/[^\\\\\"]+/, 'string'],\n [/@escapes/, 'string.escape'],\n [/\\\\./, 'string.escape.invalid'],\n [/\"/, 'string', '@pop' ]\n ]\n }\n };\n}", "title": "" }, { "docid": "d4e9988f0c34a4cbb6a7ce0863e7f5c1", "score": "0.45619422", "text": "function healSchema(schema) {\n heal(schema);\n return schema;\n function heal(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n var originalTypeMap_1 = type.getTypeMap();\n var actualNamedTypeMap_1 = Object.create(null);\n // If any of the .name properties of the GraphQLNamedType objects in\n // schema.getTypeMap() have changed, the keys of the type map need to\n // be updated accordingly.\n each(originalTypeMap_1, function (namedType, typeName) {\n if (typeName.startsWith('__')) {\n return;\n }\n var actualName = namedType.name;\n if (actualName.startsWith('__')) {\n return;\n }\n if (hasOwn.call(actualNamedTypeMap_1, actualName)) {\n throw new Error(\"Duplicate schema type name \" + actualName);\n }\n actualNamedTypeMap_1[actualName] = namedType;\n // Note: we are deliberately leaving namedType in the schema by its\n // original name (which might be different from actualName), so that\n // references by that name can be healed.\n });\n // Now add back every named type by its actual name.\n each(actualNamedTypeMap_1, function (namedType, typeName) {\n originalTypeMap_1[typeName] = namedType;\n });\n // Directive declaration argument types can refer to named types.\n each(type.getDirectives(), function (decl) {\n if (decl.args) {\n each(decl.args, function (arg) {\n arg.type = healType(arg.type);\n });\n }\n });\n each(originalTypeMap_1, function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n heal(namedType);\n }\n });\n updateEachKey(originalTypeMap_1, function (namedType, typeName) {\n // Dangling references to renamed types should remain in the schema\n // during healing, but must be removed now, so that the following\n // invariant holds for all names: schema.getType(name).name === name\n if (!typeName.startsWith('__') &&\n !hasOwn.call(actualNamedTypeMap_1, typeName)) {\n return null;\n }\n });\n }\n else if (type instanceof graphql_1.GraphQLObjectType) {\n healFields(type);\n each(type.getInterfaces(), function (iface) { return heal(iface); });\n }\n else if (type instanceof graphql_1.GraphQLInterfaceType) {\n healFields(type);\n }\n else if (type instanceof graphql_1.GraphQLInputObjectType) {\n each(type.getFields(), function (field) {\n field.type = healType(field.type);\n });\n }\n else if (type instanceof graphql_1.GraphQLScalarType) {\n // Nothing to do.\n }\n else if (type instanceof graphql_1.GraphQLUnionType) {\n updateEachKey(type.getTypes(), function (t) { return healType(t); });\n }\n else if (type instanceof graphql_1.GraphQLEnumType) {\n // Nothing to do.\n }\n else {\n throw new Error(\"Unexpected schema type: \" + type);\n }\n }\n function healFields(type) {\n each(type.getFields(), function (field) {\n field.type = healType(field.type);\n if (field.args) {\n each(field.args, function (arg) {\n arg.type = healType(arg.type);\n });\n }\n });\n }\n function healType(type) {\n // Unwrap the two known wrapper types\n if (type instanceof graphql_1.GraphQLList) {\n type = new graphql_1.GraphQLList(healType(type.ofType));\n }\n else if (type instanceof graphql_1.GraphQLNonNull) {\n type = new graphql_1.GraphQLNonNull(healType(type.ofType));\n }\n else if (graphql_1.isNamedType(type)) {\n // If a type annotation on a field or an argument or a union member is\n // any `GraphQLNamedType` with a `name`, then it must end up identical\n // to `schema.getType(name)`, since `schema.getTypeMap()` is the source\n // of truth for all named schema types.\n var namedType = type;\n var officialType = schema.getType(namedType.name);\n if (officialType && namedType !== officialType) {\n return officialType;\n }\n }\n return type;\n }\n}", "title": "" }, { "docid": "d4e9988f0c34a4cbb6a7ce0863e7f5c1", "score": "0.45619422", "text": "function healSchema(schema) {\n heal(schema);\n return schema;\n function heal(type) {\n if (type instanceof graphql_1.GraphQLSchema) {\n var originalTypeMap_1 = type.getTypeMap();\n var actualNamedTypeMap_1 = Object.create(null);\n // If any of the .name properties of the GraphQLNamedType objects in\n // schema.getTypeMap() have changed, the keys of the type map need to\n // be updated accordingly.\n each(originalTypeMap_1, function (namedType, typeName) {\n if (typeName.startsWith('__')) {\n return;\n }\n var actualName = namedType.name;\n if (actualName.startsWith('__')) {\n return;\n }\n if (hasOwn.call(actualNamedTypeMap_1, actualName)) {\n throw new Error(\"Duplicate schema type name \" + actualName);\n }\n actualNamedTypeMap_1[actualName] = namedType;\n // Note: we are deliberately leaving namedType in the schema by its\n // original name (which might be different from actualName), so that\n // references by that name can be healed.\n });\n // Now add back every named type by its actual name.\n each(actualNamedTypeMap_1, function (namedType, typeName) {\n originalTypeMap_1[typeName] = namedType;\n });\n // Directive declaration argument types can refer to named types.\n each(type.getDirectives(), function (decl) {\n if (decl.args) {\n each(decl.args, function (arg) {\n arg.type = healType(arg.type);\n });\n }\n });\n each(originalTypeMap_1, function (namedType, typeName) {\n if (!typeName.startsWith('__')) {\n heal(namedType);\n }\n });\n updateEachKey(originalTypeMap_1, function (namedType, typeName) {\n // Dangling references to renamed types should remain in the schema\n // during healing, but must be removed now, so that the following\n // invariant holds for all names: schema.getType(name).name === name\n if (!typeName.startsWith('__') &&\n !hasOwn.call(actualNamedTypeMap_1, typeName)) {\n return null;\n }\n });\n }\n else if (type instanceof graphql_1.GraphQLObjectType) {\n healFields(type);\n each(type.getInterfaces(), function (iface) { return heal(iface); });\n }\n else if (type instanceof graphql_1.GraphQLInterfaceType) {\n healFields(type);\n }\n else if (type instanceof graphql_1.GraphQLInputObjectType) {\n each(type.getFields(), function (field) {\n field.type = healType(field.type);\n });\n }\n else if (type instanceof graphql_1.GraphQLScalarType) {\n // Nothing to do.\n }\n else if (type instanceof graphql_1.GraphQLUnionType) {\n updateEachKey(type.getTypes(), function (t) { return healType(t); });\n }\n else if (type instanceof graphql_1.GraphQLEnumType) {\n // Nothing to do.\n }\n else {\n throw new Error(\"Unexpected schema type: \" + type);\n }\n }\n function healFields(type) {\n each(type.getFields(), function (field) {\n field.type = healType(field.type);\n if (field.args) {\n each(field.args, function (arg) {\n arg.type = healType(arg.type);\n });\n }\n });\n }\n function healType(type) {\n // Unwrap the two known wrapper types\n if (type instanceof graphql_1.GraphQLList) {\n type = new graphql_1.GraphQLList(healType(type.ofType));\n }\n else if (type instanceof graphql_1.GraphQLNonNull) {\n type = new graphql_1.GraphQLNonNull(healType(type.ofType));\n }\n else if (graphql_1.isNamedType(type)) {\n // If a type annotation on a field or an argument or a union member is\n // any `GraphQLNamedType` with a `name`, then it must end up identical\n // to `schema.getType(name)`, since `schema.getTypeMap()` is the source\n // of truth for all named schema types.\n var namedType = type;\n var officialType = schema.getType(namedType.name);\n if (officialType && namedType !== officialType) {\n return officialType;\n }\n }\n return type;\n }\n}", "title": "" }, { "docid": "0a96ecf3ef6e1248c6e97b6114b63a50", "score": "0.45558262", "text": "function typrFactory() {\n\nconst window = self;\n\n// Begin Typr.js\n\n\nvar Typr = {};\n\nTypr.parse = function(buff)\n{\n\tvar bin = Typr._bin;\n\tvar data = new Uint8Array(buff);\n\t\n\tvar tag = bin.readASCII(data, 0, 4); \n\tif(tag==\"ttcf\") {\n\t\tvar offset = 4;\n\t\tvar majV = bin.readUshort(data, offset); offset+=2;\n\t\tvar minV = bin.readUshort(data, offset); offset+=2;\n\t\tvar numF = bin.readUint (data, offset); offset+=4;\n\t\tvar fnts = [];\n\t\tfor(var i=0; i<numF; i++) {\n\t\t\tvar foff = bin.readUint (data, offset); offset+=4;\n\t\t\tfnts.push(Typr._readFont(data, foff));\n\t\t}\n\t\treturn fnts;\n\t}\n\telse return [Typr._readFont(data, 0)];\n};\n\nTypr._readFont = function(data, offset) {\n\tvar bin = Typr._bin;\n\tvar ooff = offset;\n\t\n\tvar sfnt_version = bin.readFixed(data, offset);\n\toffset += 4;\n\tvar numTables = bin.readUshort(data, offset);\n\toffset += 2;\n\tvar searchRange = bin.readUshort(data, offset);\n\toffset += 2;\n\tvar entrySelector = bin.readUshort(data, offset);\n\toffset += 2;\n\tvar rangeShift = bin.readUshort(data, offset);\n\toffset += 2;\n\t\n\tvar tags = [\n\t\t\"cmap\",\n\t\t\"head\",\n\t\t\"hhea\",\n\t\t\"maxp\",\n\t\t\"hmtx\",\n\t\t\"name\",\n\t\t\"OS/2\",\n\t\t\"post\",\n\t\t\n\t\t//\"cvt\",\n\t\t//\"fpgm\",\n\t\t\"loca\",\n\t\t\"glyf\",\n\t\t\"kern\",\n\t\t\n\t\t//\"prep\"\n\t\t//\"gasp\"\n\t\t\n\t\t\"CFF \",\n\t\t\n\t\t\n\t\t\"GPOS\",\n\t\t\"GSUB\",\n\t\t\n\t\t\"SVG \"\n\t\t//\"VORG\",\n\t\t];\n\t\n\tvar obj = {_data:data, _offset:ooff};\n\t//console.log(sfnt_version, numTables, searchRange, entrySelector, rangeShift);\n\t\n\tvar tabs = {};\n\t\n\tfor(var i=0; i<numTables; i++)\n\t{\n\t\tvar tag = bin.readASCII(data, offset, 4); offset += 4;\n\t\tvar checkSum = bin.readUint(data, offset); offset += 4;\n\t\tvar toffset = bin.readUint(data, offset); offset += 4;\n\t\tvar length = bin.readUint(data, offset); offset += 4;\n\t\ttabs[tag] = {offset:toffset, length:length};\n\t\t\n\t\t//if(tags.indexOf(tag)==-1) console.log(\"unknown tag\", tag, length);\n\t}\n\t\n\tfor(var i=0; i< tags.length; i++)\n\t{\n\t\tvar t = tags[i];\n\t\t//console.log(t);\n\t\t//if(tabs[t]) console.log(t, tabs[t].offset, tabs[t].length);\n\t\tif(tabs[t]) obj[t.trim()] = Typr[t.trim()].parse(data, tabs[t].offset, tabs[t].length, obj);\n\t}\n\t\n\treturn obj;\n};\n\nTypr._tabOffset = function(data, tab, foff)\n{\n\tvar bin = Typr._bin;\n\tvar numTables = bin.readUshort(data, foff+4);\n\tvar offset = foff+12;\n\tfor(var i=0; i<numTables; i++)\n\t{\n\t\tvar tag = bin.readASCII(data, offset, 4); offset += 4;\n\t\tvar checkSum = bin.readUint(data, offset); offset += 4;\n\t\tvar toffset = bin.readUint(data, offset); offset += 4;\n\t\tvar length = bin.readUint(data, offset); offset += 4;\n\t\tif(tag==tab) return toffset;\n\t}\n\treturn 0;\n};\n\n\n\n\n\nTypr._bin = {\n\treadFixed : function(data, o)\n\t{\n\t\treturn ((data[o]<<8) | data[o+1]) + (((data[o+2]<<8)|data[o+3])/(256*256+4));\n\t},\n\treadF2dot14 : function(data, o)\n\t{\n\t\tvar num = Typr._bin.readShort(data, o);\n\t\treturn num / 16384;\n\t},\n\treadInt : function(buff, p)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar a = Typr._bin.t.uint8;\n\t\ta[0] = buff[p+3];\n\t\ta[1] = buff[p+2];\n\t\ta[2] = buff[p+1];\n\t\ta[3] = buff[p];\n\t\treturn Typr._bin.t.int32[0];\n\t},\n\t\n\treadInt8 : function(buff, p)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar a = Typr._bin.t.uint8;\n\t\ta[0] = buff[p];\n\t\treturn Typr._bin.t.int8[0];\n\t},\n\treadShort : function(buff, p)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar a = Typr._bin.t.uint8;\n\t\ta[1] = buff[p]; a[0] = buff[p+1];\n\t\treturn Typr._bin.t.int16[0];\n\t},\n\treadUshort : function(buff, p)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\treturn (buff[p]<<8) | buff[p+1];\n\t},\n\treadUshorts : function(buff, p, len)\n\t{\n\t\tvar arr = [];\n\t\tfor(var i=0; i<len; i++) arr.push(Typr._bin.readUshort(buff, p+i*2));\n\t\treturn arr;\n\t},\n\treadUint : function(buff, p)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar a = Typr._bin.t.uint8;\n\t\ta[3] = buff[p]; a[2] = buff[p+1]; a[1] = buff[p+2]; a[0] = buff[p+3];\n\t\treturn Typr._bin.t.uint32[0];\n\t},\n\treadUint64 : function(buff, p)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\treturn (Typr._bin.readUint(buff, p)*(0xffffffff+1)) + Typr._bin.readUint(buff, p+4);\n\t},\n\treadASCII : function(buff, p, l)\t// l : length in Characters (not Bytes)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar s = \"\";\n\t\tfor(var i = 0; i < l; i++) s += String.fromCharCode(buff[p+i]);\n\t\treturn s;\n\t},\n\treadUnicode : function(buff, p, l)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar s = \"\";\n\t\tfor(var i = 0; i < l; i++)\t\n\t\t{\n\t\t\tvar c = (buff[p++]<<8) | buff[p++];\n\t\t\ts += String.fromCharCode(c);\n\t\t}\n\t\treturn s;\n\t},\n\t_tdec : window[\"TextDecoder\"] ? new window[\"TextDecoder\"]() : null,\n\treadUTF8 : function(buff, p, l) {\n\t\tvar tdec = Typr._bin._tdec;\n\t\tif(tdec && p==0 && l==buff.length) return tdec[\"decode\"](buff);\n\t\treturn Typr._bin.readASCII(buff,p,l);\n\t},\n\treadBytes : function(buff, p, l)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar arr = [];\n\t\tfor(var i=0; i<l; i++) arr.push(buff[p+i]);\n\t\treturn arr;\n\t},\n\treadASCIIArray : function(buff, p, l)\t// l : length in Characters (not Bytes)\n\t{\n\t\t//if(p>=buff.length) throw \"error\";\n\t\tvar s = [];\n\t\tfor(var i = 0; i < l; i++)\t\n\t\t\ts.push(String.fromCharCode(buff[p+i]));\n\t\treturn s;\n\t}\n};\n\nTypr._bin.t = {\n\tbuff: new ArrayBuffer(8),\n};\nTypr._bin.t.int8 = new Int8Array (Typr._bin.t.buff);\nTypr._bin.t.uint8 = new Uint8Array (Typr._bin.t.buff);\nTypr._bin.t.int16 = new Int16Array (Typr._bin.t.buff);\nTypr._bin.t.uint16 = new Uint16Array(Typr._bin.t.buff);\nTypr._bin.t.int32 = new Int32Array (Typr._bin.t.buff);\nTypr._bin.t.uint32 = new Uint32Array(Typr._bin.t.buff);\n\n\n\n\n\n// OpenType Layout Common Table Formats\n\nTypr._lctf = {};\n\nTypr._lctf.parse = function(data, offset, length, font, subt)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\tvar offset0 = offset;\n\tvar tableVersion = bin.readFixed(data, offset); offset += 4;\n\t\n\tvar offScriptList = bin.readUshort(data, offset); offset += 2;\n\tvar offFeatureList = bin.readUshort(data, offset); offset += 2;\n\tvar offLookupList = bin.readUshort(data, offset); offset += 2;\n\t\n\t\n\tobj.scriptList = Typr._lctf.readScriptList (data, offset0 + offScriptList);\n\tobj.featureList = Typr._lctf.readFeatureList(data, offset0 + offFeatureList);\n\tobj.lookupList = Typr._lctf.readLookupList (data, offset0 + offLookupList, subt);\n\t\n\treturn obj;\n};\n\nTypr._lctf.readLookupList = function(data, offset, subt)\n{\n\tvar bin = Typr._bin;\n\tvar offset0 = offset;\n\tvar obj = [];\n\tvar count = bin.readUshort(data, offset); offset+=2;\n\tfor(var i=0; i<count; i++) \n\t{\n\t\tvar noff = bin.readUshort(data, offset); offset+=2;\n\t\tvar lut = Typr._lctf.readLookupTable(data, offset0 + noff, subt);\n\t\tobj.push(lut);\n\t}\n\treturn obj;\n};\n\nTypr._lctf.readLookupTable = function(data, offset, subt)\n{\n\t//console.log(\"Parsing lookup table\", offset);\n\tvar bin = Typr._bin;\n\tvar offset0 = offset;\n\tvar obj = {tabs:[]};\n\t\n\tobj.ltype = bin.readUshort(data, offset); offset+=2;\n\tobj.flag = bin.readUshort(data, offset); offset+=2;\n\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\t\n\tfor(var i=0; i<cnt; i++)\n\t{\n\t\tvar noff = bin.readUshort(data, offset); offset+=2;\n\t\tvar tab = subt(data, obj.ltype, offset0 + noff);\n\t\t//console.log(obj.type, tab);\n\t\tobj.tabs.push(tab);\n\t}\n\treturn obj;\n};\n\nTypr._lctf.numOfOnes = function(n)\n{\n\tvar num = 0;\n\tfor(var i=0; i<32; i++) if(((n>>>i)&1) != 0) num++;\n\treturn num;\n};\n\nTypr._lctf.readClassDef = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar obj = [];\n\tvar format = bin.readUshort(data, offset); offset+=2;\n\tif(format==1) \n\t{\n\t\tvar startGlyph = bin.readUshort(data, offset); offset+=2;\n\t\tvar glyphCount = bin.readUshort(data, offset); offset+=2;\n\t\tfor(var i=0; i<glyphCount; i++)\n\t\t{\n\t\t\tobj.push(startGlyph+i);\n\t\t\tobj.push(startGlyph+i);\n\t\t\tobj.push(bin.readUshort(data, offset)); offset+=2;\n\t\t}\n\t}\n\tif(format==2)\n\t{\n\t\tvar count = bin.readUshort(data, offset); offset+=2;\n\t\tfor(var i=0; i<count; i++)\n\t\t{\n\t\t\tobj.push(bin.readUshort(data, offset)); offset+=2;\n\t\t\tobj.push(bin.readUshort(data, offset)); offset+=2;\n\t\t\tobj.push(bin.readUshort(data, offset)); offset+=2;\n\t\t}\n\t}\n\treturn obj;\n};\nTypr._lctf.getInterval = function(tab, val)\n{\n\tfor(var i=0; i<tab.length; i+=3)\n\t{\n\t\tvar start = tab[i], end = tab[i+1], index = tab[i+2];\n\t\tif(start<=val && val<=end) return i;\n\t}\n\treturn -1;\n};\n\n\nTypr._lctf.readCoverage = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar cvg = {};\n\tcvg.fmt = bin.readUshort(data, offset); offset+=2;\n\tvar count = bin.readUshort(data, offset); offset+=2;\n\t//console.log(\"parsing coverage\", offset-4, format, count);\n\tif(cvg.fmt==1) cvg.tab = bin.readUshorts(data, offset, count); \n\tif(cvg.fmt==2) cvg.tab = bin.readUshorts(data, offset, count*3);\n\treturn cvg;\n};\n\nTypr._lctf.coverageIndex = function(cvg, val)\n{\n\tvar tab = cvg.tab;\n\tif(cvg.fmt==1) return tab.indexOf(val);\n\tif(cvg.fmt==2) {\n\t\tvar ind = Typr._lctf.getInterval(tab, val);\n\t\tif(ind!=-1) return tab[ind+2] + (val - tab[ind]);\n\t}\n\treturn -1;\n};\n\nTypr._lctf.readFeatureList = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar offset0 = offset;\n\tvar obj = [];\n\t\n\tvar count = bin.readUshort(data, offset); offset+=2;\n\t\n\tfor(var i=0; i<count; i++)\n\t{\n\t\tvar tag = bin.readASCII(data, offset, 4); offset+=4;\n\t\tvar noff = bin.readUshort(data, offset); offset+=2;\n\t\tobj.push({tag: tag.trim(), tab:Typr._lctf.readFeatureTable(data, offset0 + noff)});\n\t}\n\treturn obj;\n};\n\nTypr._lctf.readFeatureTable = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\t\n\tvar featureParams = bin.readUshort(data, offset); offset+=2;\t// = 0\n\tvar lookupCount = bin.readUshort(data, offset); offset+=2;\n\t\n\tvar indices = [];\n\tfor(var i=0; i<lookupCount; i++) indices.push(bin.readUshort(data, offset+2*i));\n\treturn indices;\n};\n\n\nTypr._lctf.readScriptList = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar offset0 = offset;\n\tvar obj = {};\n\t\n\tvar count = bin.readUshort(data, offset); offset+=2;\n\t\n\tfor(var i=0; i<count; i++)\n\t{\n\t\tvar tag = bin.readASCII(data, offset, 4); offset+=4;\n\t\tvar noff = bin.readUshort(data, offset); offset+=2;\n\t\tobj[tag.trim()] = Typr._lctf.readScriptTable(data, offset0 + noff);\n\t}\n\treturn obj;\n};\n\nTypr._lctf.readScriptTable = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar offset0 = offset;\n\tvar obj = {};\n\t\n\tvar defLangSysOff = bin.readUshort(data, offset); offset+=2;\n\tobj.default = Typr._lctf.readLangSysTable(data, offset0 + defLangSysOff);\n\t\n\tvar langSysCount = bin.readUshort(data, offset); offset+=2;\n\t\n\tfor(var i=0; i<langSysCount; i++)\n\t{\n\t\tvar tag = bin.readASCII(data, offset, 4); offset+=4;\n\t\tvar langSysOff = bin.readUshort(data, offset); offset+=2;\n\t\tobj[tag.trim()] = Typr._lctf.readLangSysTable(data, offset0 + langSysOff);\n\t}\n\treturn obj;\n};\n\nTypr._lctf.readLangSysTable = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\t\n\tvar lookupOrder = bin.readUshort(data, offset); offset+=2;\n\t//if(lookupOrder!=0) throw \"lookupOrder not 0\";\n\tobj.reqFeature = bin.readUshort(data, offset); offset+=2;\n\t//if(obj.reqFeature != 0xffff) throw \"reqFeatureIndex != 0xffff\";\n\t\n\t//console.log(lookupOrder, obj.reqFeature);\n\t\n\tvar featureCount = bin.readUshort(data, offset); offset+=2;\n\tobj.features = bin.readUshorts(data, offset, featureCount);\n\treturn obj;\n};\n\n\tTypr.CFF = {};\n\tTypr.CFF.parse = function(data, offset, length)\n\t{\n\t\tvar bin = Typr._bin;\n\t\t\n\t\tdata = new Uint8Array(data.buffer, offset, length);\n\t\toffset = 0;\n\t\t\n\t\t// Header\n\t\tvar major = data[offset]; offset++;\n\t\tvar minor = data[offset]; offset++;\n\t\tvar hdrSize = data[offset]; offset++;\n\t\tvar offsize = data[offset]; offset++;\n\t\t//console.log(major, minor, hdrSize, offsize);\n\t\t\n\t\t// Name INDEX\n\t\tvar ninds = [];\n\t\toffset = Typr.CFF.readIndex(data, offset, ninds);\n\t\tvar names = [];\n\t\t\n\t\tfor(var i=0; i<ninds.length-1; i++) names.push(bin.readASCII(data, offset+ninds[i], ninds[i+1]-ninds[i]));\n\t\toffset += ninds[ninds.length-1];\n\t\t\n\t\t\n\t\t// Top DICT INDEX\n\t\tvar tdinds = [];\n\t\toffset = Typr.CFF.readIndex(data, offset, tdinds); //console.log(tdinds);\n\t\t// Top DICT Data\n\t\tvar topDicts = [];\n\t\tfor(var i=0; i<tdinds.length-1; i++) topDicts.push( Typr.CFF.readDict(data, offset+tdinds[i], offset+tdinds[i+1]) );\n\t\toffset += tdinds[tdinds.length-1];\n\t\tvar topdict = topDicts[0];\n\t\t//console.log(topdict);\n\t\t\n\t\t// String INDEX\n\t\tvar sinds = [];\n\t\toffset = Typr.CFF.readIndex(data, offset, sinds);\n\t\t// String Data\n\t\tvar strings = [];\n\t\tfor(var i=0; i<sinds.length-1; i++) strings.push(bin.readASCII(data, offset+sinds[i], sinds[i+1]-sinds[i]));\n\t\toffset += sinds[sinds.length-1];\n\t\t\n\t\t// Global Subr INDEX (subroutines)\t\t\n\t\tTypr.CFF.readSubrs(data, offset, topdict);\n\t\t\n\t\t// charstrings\n\t\tif(topdict.CharStrings)\n\t\t{\n\t\t\toffset = topdict.CharStrings;\n\t\t\tvar sinds = [];\n\t\t\toffset = Typr.CFF.readIndex(data, offset, sinds);\n\t\t\t\n\t\t\tvar cstr = [];\n\t\t\tfor(var i=0; i<sinds.length-1; i++) cstr.push(bin.readBytes(data, offset+sinds[i], sinds[i+1]-sinds[i]));\n\t\t\t//offset += sinds[sinds.length-1];\n\t\t\ttopdict.CharStrings = cstr;\n\t\t\t//console.log(topdict.CharStrings);\n\t\t}\n\t\t\n\t\t// CID font\n\t\tif(topdict.ROS) {\n\t\t\toffset = topdict.FDArray;\n\t\t\tvar fdind = [];\n\t\t\toffset = Typr.CFF.readIndex(data, offset, fdind);\n\t\t\t\n\t\t\ttopdict.FDArray = [];\n\t\t\tfor(var i=0; i<fdind.length-1; i++) {\n\t\t\t\tvar dict = Typr.CFF.readDict(data, offset+fdind[i], offset+fdind[i+1]);\n\t\t\t\tTypr.CFF._readFDict(data, dict, strings);\n\t\t\t\ttopdict.FDArray.push( dict );\n\t\t\t}\n\t\t\toffset += fdind[fdind.length-1];\n\t\t\t\n\t\t\toffset = topdict.FDSelect;\n\t\t\ttopdict.FDSelect = [];\n\t\t\tvar fmt = data[offset]; offset++;\n\t\t\tif(fmt==3) {\n\t\t\t\tvar rns = bin.readUshort(data, offset); offset+=2;\n\t\t\t\tfor(var i=0; i<rns+1; i++) {\n\t\t\t\t\ttopdict.FDSelect.push(bin.readUshort(data, offset), data[offset+2]); offset+=3;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse throw fmt;\n\t\t}\n\t\t\n\t\t// Encoding\n\t\tif(topdict.Encoding) topdict.Encoding = Typr.CFF.readEncoding(data, topdict.Encoding, topdict.CharStrings.length);\n\t\t\n\t\t// charset\n\t\tif(topdict.charset ) topdict.charset = Typr.CFF.readCharset (data, topdict.charset , topdict.CharStrings.length);\n\t\t\n\t\tTypr.CFF._readFDict(data, topdict, strings);\n\t\treturn topdict;\n\t};\n\tTypr.CFF._readFDict = function(data, dict, ss) {\n\t\tvar offset;\n\t\tif(dict.Private) {\n\t\t\toffset = dict.Private[1];\n\t\t\tdict.Private = Typr.CFF.readDict(data, offset, offset+dict.Private[0]);\n\t\t\tif(dict.Private.Subrs) Typr.CFF.readSubrs(data, offset+dict.Private.Subrs, dict.Private);\n\t\t}\n\t\tfor(var p in dict) if([\"FamilyName\",\"FontName\",\"FullName\",\"Notice\",\"version\",\"Copyright\"].indexOf(p)!=-1) dict[p]=ss[dict[p] -426 + 35];\n\t};\n\t\n\tTypr.CFF.readSubrs = function(data, offset, obj)\n\t{\n\t\tvar bin = Typr._bin;\n\t\tvar gsubinds = [];\n\t\toffset = Typr.CFF.readIndex(data, offset, gsubinds);\n\t\t\n\t\tvar bias, nSubrs = gsubinds.length;\n\t\tif (nSubrs < 1240) bias = 107;\n\t\telse if (nSubrs < 33900) bias = 1131;\n\t\telse bias = 32768;\n\t\tobj.Bias = bias;\n\t\t\n\t\tobj.Subrs = [];\n\t\tfor(var i=0; i<gsubinds.length-1; i++) obj.Subrs.push(bin.readBytes(data, offset+gsubinds[i], gsubinds[i+1]-gsubinds[i]));\n\t\t//offset += gsubinds[gsubinds.length-1];\n\t};\n\t\n\tTypr.CFF.tableSE = [\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 1, 2, 3, 4, 5, 6, 7, 8,\n 9, 10, 11, 12, 13, 14, 15, 16,\n 17, 18, 19, 20, 21, 22, 23, 24,\n 25, 26, 27, 28, 29, 30, 31, 32,\n 33, 34, 35, 36, 37, 38, 39, 40,\n 41, 42, 43, 44, 45, 46, 47, 48,\n 49, 50, 51, 52, 53, 54, 55, 56,\n 57, 58, 59, 60, 61, 62, 63, 64,\n 65, 66, 67, 68, 69, 70, 71, 72,\n 73, 74, 75, 76, 77, 78, 79, 80,\n 81, 82, 83, 84, 85, 86, 87, 88,\n 89, 90, 91, 92, 93, 94, 95, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 96, 97, 98, 99, 100, 101, 102,\n 103, 104, 105, 106, 107, 108, 109, 110,\n 0, 111, 112, 113, 114, 0, 115, 116,\n 117, 118, 119, 120, 121, 122, 0, 123,\n 0, 124, 125, 126, 127, 128, 129, 130,\n 131, 0, 132, 133, 0, 134, 135, 136,\n 137, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 138, 0, 139, 0, 0, 0, 0,\n 140, 141, 142, 143, 0, 0, 0, 0,\n 0, 144, 0, 0, 0, 145, 0, 0,\n 146, 147, 148, 149, 0, 0, 0, 0\n ];\n \n\tTypr.CFF.glyphByUnicode = function(cff, code)\n\t{\n\t\tfor(var i=0; i<cff.charset.length; i++) if(cff.charset[i]==code) return i;\n\t\treturn -1;\n\t};\n\t\n\tTypr.CFF.glyphBySE = function(cff, charcode)\t// glyph by standard encoding\n\t{\n\t\tif ( charcode < 0 || charcode > 255 ) return -1;\n\t\treturn Typr.CFF.glyphByUnicode(cff, Typr.CFF.tableSE[charcode]);\t\t\n\t};\n\t\n\tTypr.CFF.readEncoding = function(data, offset, num)\n\t{\n\t\tvar bin = Typr._bin;\n\t\t\n\t\tvar array = ['.notdef'];\n\t\tvar format = data[offset]; offset++;\n\t\t//console.log(\"Encoding\");\n\t\t//console.log(format);\n\t\t\n\t\tif(format==0)\n\t\t{\n\t\t\tvar nCodes = data[offset]; offset++;\n\t\t\tfor(var i=0; i<nCodes; i++) array.push(data[offset+i]);\n\t\t}\n\t\t/*\n\t\telse if(format==1 || format==2)\n\t\t{\n\t\t\twhile(charset.length<num)\n\t\t\t{\n\t\t\t\tvar first = bin.readUshort(data, offset); offset+=2;\n\t\t\t\tvar nLeft=0;\n\t\t\t\tif(format==1) { nLeft = data[offset]; offset++; }\n\t\t\t\telse { nLeft = bin.readUshort(data, offset); offset+=2; }\n\t\t\t\tfor(var i=0; i<=nLeft; i++) { charset.push(first); first++; }\n\t\t\t}\n\t\t}\n\t\t*/\n\t\telse throw \"error: unknown encoding format: \" + format;\n\t\t\n\t\treturn array;\n\t};\n\n\tTypr.CFF.readCharset = function(data, offset, num)\n\t{\n\t\tvar bin = Typr._bin;\n\t\t\n\t\tvar charset = ['.notdef'];\n\t\tvar format = data[offset]; offset++;\n\t\t\n\t\tif(format==0)\n\t\t{\n\t\t\tfor(var i=0; i<num; i++) \n\t\t\t{\n\t\t\t\tvar first = bin.readUshort(data, offset); offset+=2;\n\t\t\t\tcharset.push(first);\n\t\t\t}\n\t\t}\n\t\telse if(format==1 || format==2)\n\t\t{\n\t\t\twhile(charset.length<num)\n\t\t\t{\n\t\t\t\tvar first = bin.readUshort(data, offset); offset+=2;\n\t\t\t\tvar nLeft=0;\n\t\t\t\tif(format==1) { nLeft = data[offset]; offset++; }\n\t\t\t\telse { nLeft = bin.readUshort(data, offset); offset+=2; }\n\t\t\t\tfor(var i=0; i<=nLeft; i++) { charset.push(first); first++; }\n\t\t\t}\n\t\t}\n\t\telse throw \"error: format: \" + format;\n\t\t\n\t\treturn charset;\n\t};\n\n\tTypr.CFF.readIndex = function(data, offset, inds)\n\t{\n\t\tvar bin = Typr._bin;\n\t\t\n\t\tvar count = bin.readUshort(data, offset)+1; offset+=2;\n\t\tvar offsize = data[offset]; offset++;\n\t\t\n\t\tif (offsize==1) for(var i=0; i<count; i++) inds.push( data[offset+i] );\n\t\telse if(offsize==2) for(var i=0; i<count; i++) inds.push( bin.readUshort(data, offset+i*2) );\n\t\telse if(offsize==3) for(var i=0; i<count; i++) inds.push( bin.readUint (data, offset+i*3 - 1) & 0x00ffffff );\n\t\telse if(count!=1) throw \"unsupported offset size: \" + offsize + \", count: \" + count;\n\t\t\n\t\toffset += count*offsize;\n\t\treturn offset-1;\n\t};\n\t\n\tTypr.CFF.getCharString = function(data, offset, o)\n\t{\n\t\tvar bin = Typr._bin;\n\t\t\n\t\tvar b0 = data[offset], b1 = data[offset+1], b2 = data[offset+2], b3 = data[offset+3], b4=data[offset+4];\n\t\tvar vs = 1;\n\t\tvar op=null, val=null;\n\t\t// operand\n\t\tif(b0<=20) { op = b0; vs=1; }\n\t\tif(b0==12) { op = b0*100+b1; vs=2; }\n\t\t//if(b0==19 || b0==20) { op = b0/*+\" \"+b1*/; vs=2; }\n\t\tif(21 <=b0 && b0<= 27) { op = b0; vs=1; }\n\t\tif(b0==28) { val = bin.readShort(data,offset+1); vs=3; }\n\t\tif(29 <=b0 && b0<= 31) { op = b0; vs=1; }\n\t\tif(32 <=b0 && b0<=246) { val = b0-139; vs=1; }\n\t\tif(247<=b0 && b0<=250) { val = (b0-247)*256+b1+108; vs=2; }\n\t\tif(251<=b0 && b0<=254) { val =-(b0-251)*256-b1-108; vs=2; }\n\t\tif(b0==255) { val = bin.readInt(data, offset+1)/0xffff; vs=5; }\n\t\t\n\t\to.val = val!=null ? val : \"o\"+op;\n\t\to.size = vs;\n\t};\n\t\n\tTypr.CFF.readCharString = function(data, offset, length)\n\t{\n\t\tvar end = offset + length;\n\t\tvar bin = Typr._bin;\n\t\tvar arr = [];\n\t\t\n\t\twhile(offset<end)\n\t\t{\n\t\t\tvar b0 = data[offset], b1 = data[offset+1], b2 = data[offset+2], b3 = data[offset+3], b4=data[offset+4];\n\t\t\tvar vs = 1;\n\t\t\tvar op=null, val=null;\n\t\t\t// operand\n\t\t\tif(b0<=20) { op = b0; vs=1; }\n\t\t\tif(b0==12) { op = b0*100+b1; vs=2; }\n\t\t\tif(b0==19 || b0==20) { op = b0/*+\" \"+b1*/; vs=2; }\n\t\t\tif(21 <=b0 && b0<= 27) { op = b0; vs=1; }\n\t\t\tif(b0==28) { val = bin.readShort(data,offset+1); vs=3; }\n\t\t\tif(29 <=b0 && b0<= 31) { op = b0; vs=1; }\n\t\t\tif(32 <=b0 && b0<=246) { val = b0-139; vs=1; }\n\t\t\tif(247<=b0 && b0<=250) { val = (b0-247)*256+b1+108; vs=2; }\n\t\t\tif(251<=b0 && b0<=254) { val =-(b0-251)*256-b1-108; vs=2; }\n\t\t\tif(b0==255) { val = bin.readInt(data, offset+1)/0xffff; vs=5; }\n\t\t\t\n\t\t\tarr.push(val!=null ? val : \"o\"+op);\n\t\t\toffset += vs;\t\n\n\t\t\t//var cv = arr[arr.length-1];\n\t\t\t//if(cv==undefined) throw \"error\";\n\t\t\t//console.log()\n\t\t}\t\n\t\treturn arr;\n\t};\n\n\tTypr.CFF.readDict = function(data, offset, end)\n\t{\n\t\tvar bin = Typr._bin;\n\t\t//var dict = [];\n\t\tvar dict = {};\n\t\tvar carr = [];\n\t\t\n\t\twhile(offset<end)\n\t\t{\n\t\t\tvar b0 = data[offset], b1 = data[offset+1], b2 = data[offset+2], b3 = data[offset+3], b4=data[offset+4];\n\t\t\tvar vs = 1;\n\t\t\tvar key=null, val=null;\n\t\t\t// operand\n\t\t\tif(b0==28) { val = bin.readShort(data,offset+1); vs=3; }\n\t\t\tif(b0==29) { val = bin.readInt (data,offset+1); vs=5; }\n\t\t\tif(32 <=b0 && b0<=246) { val = b0-139; vs=1; }\n\t\t\tif(247<=b0 && b0<=250) { val = (b0-247)*256+b1+108; vs=2; }\n\t\t\tif(251<=b0 && b0<=254) { val =-(b0-251)*256-b1-108; vs=2; }\n\t\t\tif(b0==255) { val = bin.readInt(data, offset+1)/0xffff; vs=5; throw \"unknown number\"; }\n\t\t\t\n\t\t\tif(b0==30) \n\t\t\t{ \n\t\t\t\tvar nibs = [];\n\t\t\t\tvs = 1;\n\t\t\t\twhile(true)\n\t\t\t\t{\n\t\t\t\t\tvar b = data[offset+vs]; vs++;\n\t\t\t\t\tvar nib0 = b>>4, nib1 = b&0xf;\n\t\t\t\t\tif(nib0 != 0xf) nibs.push(nib0); if(nib1!=0xf) nibs.push(nib1);\n\t\t\t\t\tif(nib1==0xf) break;\n\t\t\t\t}\n\t\t\t\tvar s = \"\";\n\t\t\t\tvar chars = [0,1,2,3,4,5,6,7,8,9,\".\",\"e\",\"e-\",\"reserved\",\"-\",\"endOfNumber\"];\n\t\t\t\tfor(var i=0; i<nibs.length; i++) s += chars[nibs[i]];\n\t\t\t\t//console.log(nibs);\n\t\t\t\tval = parseFloat(s);\n\t\t\t}\n\t\t\t\n\t\t\tif(b0<=21)\t// operator\n\t\t\t{\n\t\t\t\tvar keys = [\"version\", \"Notice\", \"FullName\", \"FamilyName\", \"Weight\", \"FontBBox\", \"BlueValues\", \"OtherBlues\", \"FamilyBlues\",\"FamilyOtherBlues\",\n\t\t\t\t\t\"StdHW\", \"StdVW\", \"escape\", \"UniqueID\", \"XUID\", \"charset\", \"Encoding\", \"CharStrings\", \"Private\", \"Subrs\", \n\t\t\t\t\t\"defaultWidthX\", \"nominalWidthX\"];\n\t\t\t\t\t\n\t\t\t\tkey = keys[b0]; vs=1;\n\t\t\t\tif(b0==12) { \n\t\t\t\t\tvar keys = [ \"Copyright\", \"isFixedPitch\", \"ItalicAngle\", \"UnderlinePosition\", \"UnderlineThickness\", \"PaintType\", \"CharstringType\", \"FontMatrix\", \"StrokeWidth\", \"BlueScale\",\n\t\t\t\t\t\"BlueShift\", \"BlueFuzz\", \"StemSnapH\", \"StemSnapV\", \"ForceBold\", 0,0, \"LanguageGroup\", \"ExpansionFactor\", \"initialRandomSeed\",\n\t\t\t\t\t\"SyntheticBase\", \"PostScript\", \"BaseFontName\", \"BaseFontBlend\", 0,0,0,0,0,0, \n\t\t\t\t\t\"ROS\", \"CIDFontVersion\", \"CIDFontRevision\", \"CIDFontType\", \"CIDCount\", \"UIDBase\", \"FDArray\", \"FDSelect\", \"FontName\"];\n\t\t\t\t\tkey = keys[b1]; vs=2; \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(key!=null) { dict[key] = carr.length==1 ? carr[0] : carr; carr=[]; }\n\t\t\telse carr.push(val); \n\t\t\t\n\t\t\toffset += vs;\t\t\n\t\t}\t\n\t\treturn dict;\n\t};\n\n\nTypr.cmap = {};\nTypr.cmap.parse = function(data, offset, length)\n{\n\tdata = new Uint8Array(data.buffer, offset, length);\n\toffset = 0;\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\tvar version = bin.readUshort(data, offset); offset += 2;\n\tvar numTables = bin.readUshort(data, offset); offset += 2;\n\t\n\t//console.log(version, numTables);\n\t\n\tvar offs = [];\n\tobj.tables = [];\n\t\n\t\n\tfor(var i=0; i<numTables; i++)\n\t{\n\t\tvar platformID = bin.readUshort(data, offset); offset += 2;\n\t\tvar encodingID = bin.readUshort(data, offset); offset += 2;\n\t\tvar noffset = bin.readUint(data, offset); offset += 4;\n\t\t\n\t\tvar id = \"p\"+platformID+\"e\"+encodingID;\n\t\t\n\t\t//console.log(\"cmap subtable\", platformID, encodingID, noffset);\n\t\t\n\t\t\n\t\tvar tind = offs.indexOf(noffset);\n\t\t\n\t\tif(tind==-1)\n\t\t{\n\t\t\ttind = obj.tables.length;\n\t\t\tvar subt;\n\t\t\toffs.push(noffset);\n\t\t\tvar format = bin.readUshort(data, noffset);\n\t\t\tif (format== 0) subt = Typr.cmap.parse0(data, noffset);\n\t\t\telse if(format== 4) subt = Typr.cmap.parse4(data, noffset);\n\t\t\telse if(format== 6) subt = Typr.cmap.parse6(data, noffset);\n\t\t\telse if(format==12) subt = Typr.cmap.parse12(data,noffset);\n\t\t\telse console.log(\"unknown format: \"+format, platformID, encodingID, noffset);\n\t\t\tobj.tables.push(subt);\n\t\t}\n\t\t\n\t\tif(obj[id]!=null) throw \"multiple tables for one platform+encoding\";\n\t\tobj[id] = tind;\n\t}\n\treturn obj;\n};\n\nTypr.cmap.parse0 = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\tobj.format = bin.readUshort(data, offset); offset += 2;\n\tvar len = bin.readUshort(data, offset); offset += 2;\n\tvar lang = bin.readUshort(data, offset); offset += 2;\n\tobj.map = [];\n\tfor(var i=0; i<len-6; i++) obj.map.push(data[offset+i]);\n\treturn obj;\n};\n\nTypr.cmap.parse4 = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar offset0 = offset;\n\tvar obj = {};\n\t\n\tobj.format = bin.readUshort(data, offset); offset+=2;\n\tvar length = bin.readUshort(data, offset); offset+=2;\n\tvar language = bin.readUshort(data, offset); offset+=2;\n\tvar segCountX2 = bin.readUshort(data, offset); offset+=2;\n\tvar segCount = segCountX2/2;\n\tobj.searchRange = bin.readUshort(data, offset); offset+=2;\n\tobj.entrySelector = bin.readUshort(data, offset); offset+=2;\n\tobj.rangeShift = bin.readUshort(data, offset); offset+=2;\n\tobj.endCount = bin.readUshorts(data, offset, segCount); offset += segCount*2;\n\toffset+=2;\n\tobj.startCount = bin.readUshorts(data, offset, segCount); offset += segCount*2;\n\tobj.idDelta = [];\n\tfor(var i=0; i<segCount; i++) {obj.idDelta.push(bin.readShort(data, offset)); offset+=2;}\n\tobj.idRangeOffset = bin.readUshorts(data, offset, segCount); offset += segCount*2;\n\tobj.glyphIdArray = [];\n\twhile(offset< offset0+length) {obj.glyphIdArray.push(bin.readUshort(data, offset)); offset+=2;}\n\treturn obj;\n};\n\nTypr.cmap.parse6 = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\t\n\tobj.format = bin.readUshort(data, offset); offset+=2;\n\tvar length = bin.readUshort(data, offset); offset+=2;\n\tvar language = bin.readUshort(data, offset); offset+=2;\n\tobj.firstCode = bin.readUshort(data, offset); offset+=2;\n\tvar entryCount = bin.readUshort(data, offset); offset+=2;\n\tobj.glyphIdArray = [];\n\tfor(var i=0; i<entryCount; i++) {obj.glyphIdArray.push(bin.readUshort(data, offset)); offset+=2;}\n\t\n\treturn obj;\n};\n\nTypr.cmap.parse12 = function(data, offset)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\t\n\tobj.format = bin.readUshort(data, offset); offset+=2;\n\toffset += 2;\n\tvar length = bin.readUint(data, offset); offset+=4;\n\tvar lang = bin.readUint(data, offset); offset+=4;\n\tvar nGroups= bin.readUint(data, offset); offset+=4;\n\tobj.groups = [];\n\t\n\tfor(var i=0; i<nGroups; i++) \n\t{\n\t\tvar off = offset + i * 12;\n\t\tvar startCharCode = bin.readUint(data, off+0);\n\t\tvar endCharCode = bin.readUint(data, off+4);\n\t\tvar startGlyphID = bin.readUint(data, off+8);\n\t\tobj.groups.push([ startCharCode, endCharCode, startGlyphID ]);\n\t}\n\treturn obj;\n};\n\nTypr.glyf = {};\nTypr.glyf.parse = function(data, offset, length, font)\n{\n\tvar obj = [];\n\tfor(var g=0; g<font.maxp.numGlyphs; g++) obj.push(null);\n\treturn obj;\n};\n\nTypr.glyf._parseGlyf = function(font, g)\n{\n\tvar bin = Typr._bin;\n\tvar data = font._data;\n\t\n\tvar offset = Typr._tabOffset(data, \"glyf\", font._offset) + font.loca[g];\n\t\t\n\tif(font.loca[g]==font.loca[g+1]) return null;\n\t\t\n\tvar gl = {};\n\t\t\n\tgl.noc = bin.readShort(data, offset); offset+=2;\t\t// number of contours\n\tgl.xMin = bin.readShort(data, offset); offset+=2;\n\tgl.yMin = bin.readShort(data, offset); offset+=2;\n\tgl.xMax = bin.readShort(data, offset); offset+=2;\n\tgl.yMax = bin.readShort(data, offset); offset+=2;\n\t\n\tif(gl.xMin>=gl.xMax || gl.yMin>=gl.yMax) return null;\n\t\t\n\tif(gl.noc>0)\n\t{\n\t\tgl.endPts = [];\n\t\tfor(var i=0; i<gl.noc; i++) { gl.endPts.push(bin.readUshort(data,offset)); offset+=2; }\n\t\t\n\t\tvar instructionLength = bin.readUshort(data,offset); offset+=2;\n\t\tif((data.length-offset)<instructionLength) return null;\n\t\tgl.instructions = bin.readBytes(data, offset, instructionLength); offset+=instructionLength;\n\t\t\n\t\tvar crdnum = gl.endPts[gl.noc-1]+1;\n\t\tgl.flags = [];\n\t\tfor(var i=0; i<crdnum; i++ ) \n\t\t{ \n\t\t\tvar flag = data[offset]; offset++; \n\t\t\tgl.flags.push(flag); \n\t\t\tif((flag&8)!=0)\n\t\t\t{\n\t\t\t\tvar rep = data[offset]; offset++;\n\t\t\t\tfor(var j=0; j<rep; j++) { gl.flags.push(flag); i++; }\n\t\t\t}\n\t\t}\n\t\tgl.xs = [];\n\t\tfor(var i=0; i<crdnum; i++) {\n\t\t\tvar i8=((gl.flags[i]&2)!=0), same=((gl.flags[i]&16)!=0); \n\t\t\tif(i8) { gl.xs.push(same ? data[offset] : -data[offset]); offset++; }\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(same) gl.xs.push(0);\n\t\t\t\telse { gl.xs.push(bin.readShort(data, offset)); offset+=2; }\n\t\t\t}\n\t\t}\n\t\tgl.ys = [];\n\t\tfor(var i=0; i<crdnum; i++) {\n\t\t\tvar i8=((gl.flags[i]&4)!=0), same=((gl.flags[i]&32)!=0); \n\t\t\tif(i8) { gl.ys.push(same ? data[offset] : -data[offset]); offset++; }\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(same) gl.ys.push(0);\n\t\t\t\telse { gl.ys.push(bin.readShort(data, offset)); offset+=2; }\n\t\t\t}\n\t\t}\n\t\tvar x = 0, y = 0;\n\t\tfor(var i=0; i<crdnum; i++) { x += gl.xs[i]; y += gl.ys[i]; gl.xs[i]=x; gl.ys[i]=y; }\n\t\t//console.log(endPtsOfContours, instructionLength, instructions, flags, xCoordinates, yCoordinates);\n\t}\n\telse\n\t{\n\t\tvar ARG_1_AND_2_ARE_WORDS\t= 1<<0;\n\t\tvar ARGS_ARE_XY_VALUES\t\t= 1<<1;\n\t\tvar WE_HAVE_A_SCALE\t\t\t= 1<<3;\n\t\tvar MORE_COMPONENTS\t\t\t= 1<<5;\n\t\tvar WE_HAVE_AN_X_AND_Y_SCALE= 1<<6;\n\t\tvar WE_HAVE_A_TWO_BY_TWO\t= 1<<7;\n\t\tvar WE_HAVE_INSTRUCTIONS\t= 1<<8;\n\t\t\n\t\tgl.parts = [];\n\t\tvar flags;\n\t\tdo {\n\t\t\tflags = bin.readUshort(data, offset); offset += 2;\n\t\t\tvar part = { m:{a:1,b:0,c:0,d:1,tx:0,ty:0}, p1:-1, p2:-1 }; gl.parts.push(part);\n\t\t\tpart.glyphIndex = bin.readUshort(data, offset); offset += 2;\n\t\t\tif ( flags & ARG_1_AND_2_ARE_WORDS) {\n\t\t\t\tvar arg1 = bin.readShort(data, offset); offset += 2;\n\t\t\t\tvar arg2 = bin.readShort(data, offset); offset += 2;\n\t\t\t} else {\n\t\t\t\tvar arg1 = bin.readInt8(data, offset); offset ++;\n\t\t\t\tvar arg2 = bin.readInt8(data, offset); offset ++;\n\t\t\t}\n\t\t\t\n\t\t\tif(flags & ARGS_ARE_XY_VALUES) { part.m.tx = arg1; part.m.ty = arg2; }\n\t\t\telse { part.p1=arg1; part.p2=arg2; }\n\t\t\t//part.m.tx = arg1; part.m.ty = arg2;\n\t\t\t//else { throw \"params are not XY values\"; }\n\t\t\t\n\t\t\tif ( flags & WE_HAVE_A_SCALE ) {\n\t\t\t\tpart.m.a = part.m.d = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t} else if ( flags & WE_HAVE_AN_X_AND_Y_SCALE ) {\n\t\t\t\tpart.m.a = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t\tpart.m.d = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t} else if ( flags & WE_HAVE_A_TWO_BY_TWO ) {\n\t\t\t\tpart.m.a = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t\tpart.m.b = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t\tpart.m.c = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t\tpart.m.d = bin.readF2dot14(data, offset); offset += 2; \n\t\t\t}\n\t\t} while ( flags & MORE_COMPONENTS ) \n\t\tif (flags & WE_HAVE_INSTRUCTIONS){\n\t\t\tvar numInstr = bin.readUshort(data, offset); offset += 2;\n\t\t\tgl.instr = [];\n\t\t\tfor(var i=0; i<numInstr; i++) { gl.instr.push(data[offset]); offset++; }\n\t\t}\n\t}\n\treturn gl;\n};\n\n\nTypr.GPOS = {};\nTypr.GPOS.parse = function(data, offset, length, font) { return Typr._lctf.parse(data, offset, length, font, Typr.GPOS.subt); };\n\n\nTypr.GPOS.subt = function(data, ltype, offset)\t// lookup type\n{\n\tvar bin = Typr._bin, offset0 = offset, tab = {};\n\t\n\ttab.fmt = bin.readUshort(data, offset); offset+=2;\n\t\n\t//console.log(ltype, tab.fmt);\n\t\n\tif(ltype==1 || ltype==2 || ltype==3 || ltype==7 || (ltype==8 && tab.fmt<=2)) {\n\t\tvar covOff = bin.readUshort(data, offset); offset+=2;\n\t\ttab.coverage = Typr._lctf.readCoverage(data, covOff+offset0);\n\t}\n\tif(ltype==1 && tab.fmt==1) {\n\t\tvar valFmt1 = bin.readUshort(data, offset); offset+=2;\n\t\tvar ones1 = Typr._lctf.numOfOnes(valFmt1);\n\t\tif(valFmt1!=0) tab.pos = Typr.GPOS.readValueRecord(data, offset, valFmt1);\n\t}\n\telse if(ltype==2) {\n\t\tvar valFmt1 = bin.readUshort(data, offset); offset+=2;\n\t\tvar valFmt2 = bin.readUshort(data, offset); offset+=2;\n\t\tvar ones1 = Typr._lctf.numOfOnes(valFmt1);\n\t\tvar ones2 = Typr._lctf.numOfOnes(valFmt2);\n\t\tif(tab.fmt==1)\n\t\t{\n\t\t\ttab.pairsets = [];\n\t\t\tvar psc = bin.readUshort(data, offset); offset+=2; // PairSetCount\n\t\t\t\n\t\t\tfor(var i=0; i<psc; i++)\n\t\t\t{\n\t\t\t\tvar psoff = offset0 + bin.readUshort(data, offset); offset+=2;\n\t\t\t\t\n\t\t\t\tvar pvc = bin.readUshort(data, psoff); psoff+=2;\n\t\t\t\tvar arr = [];\n\t\t\t\tfor(var j=0; j<pvc; j++)\n\t\t\t\t{\n\t\t\t\t\tvar gid2 = bin.readUshort(data, psoff); psoff+=2;\n\t\t\t\t\tvar value1, value2;\n\t\t\t\t\tif(valFmt1!=0) { value1 = Typr.GPOS.readValueRecord(data, psoff, valFmt1); psoff+=ones1*2; }\n\t\t\t\t\tif(valFmt2!=0) { value2 = Typr.GPOS.readValueRecord(data, psoff, valFmt2); psoff+=ones2*2; }\n\t\t\t\t\t//if(value1!=null) throw \"e\";\n\t\t\t\t\tarr.push({gid2:gid2, val1:value1, val2:value2});\n\t\t\t\t}\n\t\t\t\ttab.pairsets.push(arr);\n\t\t\t}\n\t\t}\n\t\tif(tab.fmt==2)\n\t\t{\n\t\t\tvar classDef1 = bin.readUshort(data, offset); offset+=2;\n\t\t\tvar classDef2 = bin.readUshort(data, offset); offset+=2;\n\t\t\tvar class1Count = bin.readUshort(data, offset); offset+=2;\n\t\t\tvar class2Count = bin.readUshort(data, offset); offset+=2;\n\t\t\t\n\t\t\ttab.classDef1 = Typr._lctf.readClassDef(data, offset0 + classDef1);\n\t\t\ttab.classDef2 = Typr._lctf.readClassDef(data, offset0 + classDef2);\n\t\t\t\n\t\t\ttab.matrix = [];\n\t\t\tfor(var i=0; i<class1Count; i++)\n\t\t\t{\n\t\t\t\tvar row = [];\n\t\t\t\tfor(var j=0; j<class2Count; j++)\n\t\t\t\t{\n\t\t\t\t\tvar value1 = null, value2 = null;\n\t\t\t\t\tif(tab.valFmt1!=0) { value1 = Typr.GPOS.readValueRecord(data, offset, tab.valFmt1); offset+=ones1*2; }\n\t\t\t\t\tif(tab.valFmt2!=0) { value2 = Typr.GPOS.readValueRecord(data, offset, tab.valFmt2); offset+=ones2*2; }\n\t\t\t\t\trow.push({val1:value1, val2:value2});\n\t\t\t\t}\n\t\t\t\ttab.matrix.push(row);\n\t\t\t}\n\t\t}\n\t}\n\treturn tab;\n};\n\n\nTypr.GPOS.readValueRecord = function(data, offset, valFmt)\n{\n\tvar bin = Typr._bin;\n\tvar arr = [];\n\tarr.push( (valFmt&1) ? bin.readShort(data, offset) : 0 ); offset += (valFmt&1) ? 2 : 0; // X_PLACEMENT\n\tarr.push( (valFmt&2) ? bin.readShort(data, offset) : 0 ); offset += (valFmt&2) ? 2 : 0; // Y_PLACEMENT\n\tarr.push( (valFmt&4) ? bin.readShort(data, offset) : 0 ); offset += (valFmt&4) ? 2 : 0; // X_ADVANCE\n\tarr.push( (valFmt&8) ? bin.readShort(data, offset) : 0 ); offset += (valFmt&8) ? 2 : 0; // Y_ADVANCE\n\treturn arr;\n};\n\nTypr.GSUB = {};\nTypr.GSUB.parse = function(data, offset, length, font) { return Typr._lctf.parse(data, offset, length, font, Typr.GSUB.subt); };\n\n\nTypr.GSUB.subt = function(data, ltype, offset)\t// lookup type\n{\n\tvar bin = Typr._bin, offset0 = offset, tab = {};\n\t\n\ttab.fmt = bin.readUshort(data, offset); offset+=2;\n\t\n\tif(ltype!=1 && ltype!=4 && ltype!=5 && ltype!=6) return null;\n\t\n\tif(ltype==1 || ltype==4 || (ltype==5 && tab.fmt<=2) || (ltype==6 && tab.fmt<=2)) {\n\t\tvar covOff = bin.readUshort(data, offset); offset+=2;\n\t\ttab.coverage = Typr._lctf.readCoverage(data, offset0+covOff);\t// not always is coverage here\n\t}\n\t\n\tif(ltype==1) {\t\n\t\tif(tab.fmt==1) {\n\t\t\ttab.delta = bin.readShort(data, offset); offset+=2;\n\t\t}\n\t\telse if(tab.fmt==2) {\n\t\t\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\t\t\ttab.newg = bin.readUshorts(data, offset, cnt); offset+=tab.newg.length*2;\n\t\t}\n\t}\n\t// Ligature Substitution Subtable\n\telse if(ltype==4) {\n\t\ttab.vals = [];\n\t\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\t\tfor(var i=0; i<cnt; i++) {\n\t\t\tvar loff = bin.readUshort(data, offset); offset+=2;\n\t\t\ttab.vals.push(Typr.GSUB.readLigatureSet(data, offset0+loff));\n\t\t}\n\t\t//console.log(tab.coverage);\n\t\t//console.log(tab.vals);\n\t} \n\t// Contextual Substitution Subtable\n\telse if(ltype==5) {\n\t\tif(tab.fmt==2) {\n\t\t\tvar cDefOffset = bin.readUshort(data, offset); offset+=2;\n\t\t\ttab.cDef = Typr._lctf.readClassDef(data, offset0 + cDefOffset);\n\t\t\ttab.scset = [];\n\t\t\tvar subClassSetCount = bin.readUshort(data, offset); offset+=2;\n\t\t\tfor(var i=0; i<subClassSetCount; i++)\n\t\t\t{\n\t\t\t\tvar scsOff = bin.readUshort(data, offset); offset+=2;\n\t\t\t\ttab.scset.push( scsOff==0 ? null : Typr.GSUB.readSubClassSet(data, offset0 + scsOff) );\n\t\t\t}\n\t\t}\n\t\t//else console.log(\"unknown table format\", tab.fmt);\n\t}\n\t//*\n\telse if(ltype==6) {\n\t\t/*\n\t\tif(tab.fmt==2) {\n\t\t\tvar btDef = bin.readUshort(data, offset); offset+=2;\n\t\t\tvar inDef = bin.readUshort(data, offset); offset+=2;\n\t\t\tvar laDef = bin.readUshort(data, offset); offset+=2;\n\t\t\t\n\t\t\ttab.btDef = Typr._lctf.readClassDef(data, offset0 + btDef);\n\t\t\ttab.inDef = Typr._lctf.readClassDef(data, offset0 + inDef);\n\t\t\ttab.laDef = Typr._lctf.readClassDef(data, offset0 + laDef);\n\t\t\t\n\t\t\ttab.scset = [];\n\t\t\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\t\t\tfor(var i=0; i<cnt; i++) {\n\t\t\t\tvar loff = bin.readUshort(data, offset); offset+=2;\n\t\t\t\ttab.scset.push(Typr.GSUB.readChainSubClassSet(data, offset0+loff));\n\t\t\t}\n\t\t}\n\t\t*/\n\t\tif(tab.fmt==3) {\n\t\t\tfor(var i=0; i<3; i++) {\n\t\t\t\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\t\t\t\tvar cvgs = [];\n\t\t\t\tfor(var j=0; j<cnt; j++) cvgs.push( Typr._lctf.readCoverage(data, offset0 + bin.readUshort(data, offset+j*2)) );\n\t\t\t\toffset+=cnt*2;\n\t\t\t\tif(i==0) tab.backCvg = cvgs;\n\t\t\t\tif(i==1) tab.inptCvg = cvgs;\n\t\t\t\tif(i==2) tab.ahedCvg = cvgs;\n\t\t\t}\n\t\t\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\t\t\ttab.lookupRec = Typr.GSUB.readSubstLookupRecords(data, offset, cnt);\n\t\t}\n\t\t//console.log(tab);\n\t} //*/\n\t//if(tab.coverage.indexOf(3)!=-1) console.log(ltype, fmt, tab);\n\t\n\treturn tab;\n};\n\nTypr.GSUB.readSubClassSet = function(data, offset)\n{\n\tvar rUs = Typr._bin.readUshort, offset0 = offset, lset = [];\n\tvar cnt = rUs(data, offset); offset+=2;\n\tfor(var i=0; i<cnt; i++) {\n\t\tvar loff = rUs(data, offset); offset+=2;\n\t\tlset.push(Typr.GSUB.readSubClassRule(data, offset0+loff));\n\t}\n\treturn lset;\n};\nTypr.GSUB.readSubClassRule= function(data, offset)\n{\n\tvar rUs = Typr._bin.readUshort, rule = {};\n\tvar gcount = rUs(data, offset); offset+=2;\n\tvar scount = rUs(data, offset); offset+=2;\n\trule.input = [];\n\tfor(var i=0; i<gcount-1; i++) {\n\t\trule.input.push(rUs(data, offset)); offset+=2;\n\t}\n\trule.substLookupRecords = Typr.GSUB.readSubstLookupRecords(data, offset, scount);\n\treturn rule;\n};\nTypr.GSUB.readSubstLookupRecords = function(data, offset, cnt)\n{\n\tvar rUs = Typr._bin.readUshort;\n\tvar out = [];\n\tfor(var i=0; i<cnt; i++) { out.push(rUs(data, offset), rUs(data, offset+2)); offset+=4; }\n\treturn out;\n};\n\nTypr.GSUB.readChainSubClassSet = function(data, offset)\n{\n\tvar bin = Typr._bin, offset0 = offset, lset = [];\n\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\tfor(var i=0; i<cnt; i++) {\n\t\tvar loff = bin.readUshort(data, offset); offset+=2;\n\t\tlset.push(Typr.GSUB.readChainSubClassRule(data, offset0+loff));\n\t}\n\treturn lset;\n};\nTypr.GSUB.readChainSubClassRule= function(data, offset)\n{\n\tvar bin = Typr._bin, rule = {};\n\tvar pps = [\"backtrack\", \"input\", \"lookahead\"];\n\tfor(var pi=0; pi<pps.length; pi++) {\n\t\tvar cnt = bin.readUshort(data, offset); offset+=2; if(pi==1) cnt--;\n\t\trule[pps[pi]]=bin.readUshorts(data, offset, cnt); offset+= rule[pps[pi]].length*2;\n\t}\n\tvar cnt = bin.readUshort(data, offset); offset+=2;\n\trule.subst = bin.readUshorts(data, offset, cnt*2); offset += rule.subst.length*2;\n\treturn rule;\n};\n\nTypr.GSUB.readLigatureSet = function(data, offset)\n{\n\tvar bin = Typr._bin, offset0 = offset, lset = [];\n\tvar lcnt = bin.readUshort(data, offset); offset+=2;\n\tfor(var j=0; j<lcnt; j++) {\n\t\tvar loff = bin.readUshort(data, offset); offset+=2;\n\t\tlset.push(Typr.GSUB.readLigature(data, offset0+loff));\n\t}\n\treturn lset;\n};\nTypr.GSUB.readLigature = function(data, offset)\n{\n\tvar bin = Typr._bin, lig = {chain:[]};\n\tlig.nglyph = bin.readUshort(data, offset); offset+=2;\n\tvar ccnt = bin.readUshort(data, offset); offset+=2;\n\tfor(var k=0; k<ccnt-1; k++) { lig.chain.push(bin.readUshort(data, offset)); offset+=2; }\n\treturn lig;\n};\n\n\n\nTypr.head = {};\nTypr.head.parse = function(data, offset, length)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\tvar tableVersion = bin.readFixed(data, offset); offset += 4;\n\tobj.fontRevision = bin.readFixed(data, offset); offset += 4;\n\tvar checkSumAdjustment = bin.readUint(data, offset); offset += 4;\n\tvar magicNumber = bin.readUint(data, offset); offset += 4;\n\tobj.flags = bin.readUshort(data, offset); offset += 2;\n\tobj.unitsPerEm = bin.readUshort(data, offset); offset += 2;\n\tobj.created = bin.readUint64(data, offset); offset += 8;\n\tobj.modified = bin.readUint64(data, offset); offset += 8;\n\tobj.xMin = bin.readShort(data, offset); offset += 2;\n\tobj.yMin = bin.readShort(data, offset); offset += 2;\n\tobj.xMax = bin.readShort(data, offset); offset += 2;\n\tobj.yMax = bin.readShort(data, offset); offset += 2;\n\tobj.macStyle = bin.readUshort(data, offset); offset += 2;\n\tobj.lowestRecPPEM = bin.readUshort(data, offset); offset += 2;\n\tobj.fontDirectionHint = bin.readShort(data, offset); offset += 2;\n\tobj.indexToLocFormat = bin.readShort(data, offset); offset += 2;\n\tobj.glyphDataFormat = bin.readShort(data, offset); offset += 2;\n\treturn obj;\n};\n\n\nTypr.hhea = {};\nTypr.hhea.parse = function(data, offset, length)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\tvar tableVersion = bin.readFixed(data, offset); offset += 4;\n\tobj.ascender = bin.readShort(data, offset); offset += 2;\n\tobj.descender = bin.readShort(data, offset); offset += 2;\n\tobj.lineGap = bin.readShort(data, offset); offset += 2;\n\t\n\tobj.advanceWidthMax = bin.readUshort(data, offset); offset += 2;\n\tobj.minLeftSideBearing = bin.readShort(data, offset); offset += 2;\n\tobj.minRightSideBearing = bin.readShort(data, offset); offset += 2;\n\tobj.xMaxExtent = bin.readShort(data, offset); offset += 2;\n\t\n\tobj.caretSlopeRise = bin.readShort(data, offset); offset += 2;\n\tobj.caretSlopeRun = bin.readShort(data, offset); offset += 2;\n\tobj.caretOffset = bin.readShort(data, offset); offset += 2;\n\t\n\toffset += 4*2;\n\t\n\tobj.metricDataFormat = bin.readShort (data, offset); offset += 2;\n\tobj.numberOfHMetrics = bin.readUshort(data, offset); offset += 2;\n\treturn obj;\n};\n\n\nTypr.hmtx = {};\nTypr.hmtx.parse = function(data, offset, length, font)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\t\n\tobj.aWidth = [];\n\tobj.lsBearing = [];\n\t\n\t\n\tvar aw = 0, lsb = 0;\n\t\n\tfor(var i=0; i<font.maxp.numGlyphs; i++)\n\t{\n\t\tif(i<font.hhea.numberOfHMetrics) { aw=bin.readUshort(data, offset); offset += 2; lsb=bin.readShort(data, offset); offset+=2; }\n\t\tobj.aWidth.push(aw);\n\t\tobj.lsBearing.push(lsb);\n\t}\n\t\n\treturn obj;\n};\n\n\nTypr.kern = {};\nTypr.kern.parse = function(data, offset, length, font)\n{\n\tvar bin = Typr._bin;\n\t\n\tvar version = bin.readUshort(data, offset); offset+=2;\n\tif(version==1) return Typr.kern.parseV1(data, offset-2, length, font);\n\tvar nTables = bin.readUshort(data, offset); offset+=2;\n\t\n\tvar map = {glyph1: [], rval:[]};\n\tfor(var i=0; i<nTables; i++)\n\t{\n\t\toffset+=2;\t// skip version\n\t\tvar length = bin.readUshort(data, offset); offset+=2;\n\t\tvar coverage = bin.readUshort(data, offset); offset+=2;\n\t\tvar format = coverage>>>8;\n\t\t/* I have seen format 128 once, that's why I do */ format &= 0xf;\n\t\tif(format==0) offset = Typr.kern.readFormat0(data, offset, map);\n\t\telse throw \"unknown kern table format: \"+format;\n\t}\n\treturn map;\n};\n\nTypr.kern.parseV1 = function(data, offset, length, font)\n{\n\tvar bin = Typr._bin;\n\t\n\tvar version = bin.readFixed(data, offset); offset+=4;\n\tvar nTables = bin.readUint(data, offset); offset+=4;\n\t\n\tvar map = {glyph1: [], rval:[]};\n\tfor(var i=0; i<nTables; i++)\n\t{\n\t\tvar length = bin.readUint(data, offset); offset+=4;\n\t\tvar coverage = bin.readUshort(data, offset); offset+=2;\n\t\tvar tupleIndex = bin.readUshort(data, offset); offset+=2;\n\t\tvar format = coverage>>>8;\n\t\t/* I have seen format 128 once, that's why I do */ format &= 0xf;\n\t\tif(format==0) offset = Typr.kern.readFormat0(data, offset, map);\n\t\telse throw \"unknown kern table format: \"+format;\n\t}\n\treturn map;\n};\n\nTypr.kern.readFormat0 = function(data, offset, map)\n{\n\tvar bin = Typr._bin;\n\tvar pleft = -1;\n\tvar nPairs = bin.readUshort(data, offset); offset+=2;\n\tvar searchRange = bin.readUshort(data, offset); offset+=2;\n\tvar entrySelector = bin.readUshort(data, offset); offset+=2;\n\tvar rangeShift = bin.readUshort(data, offset); offset+=2;\n\tfor(var j=0; j<nPairs; j++)\n\t{\n\t\tvar left = bin.readUshort(data, offset); offset+=2;\n\t\tvar right = bin.readUshort(data, offset); offset+=2;\n\t\tvar value = bin.readShort (data, offset); offset+=2;\n\t\tif(left!=pleft) { map.glyph1.push(left); map.rval.push({ glyph2:[], vals:[] }); }\n\t\tvar rval = map.rval[map.rval.length-1];\n\t\trval.glyph2.push(right); rval.vals.push(value);\n\t\tpleft = left;\n\t}\n\treturn offset;\n};\n\n\n\nTypr.loca = {};\nTypr.loca.parse = function(data, offset, length, font)\n{\n\tvar bin = Typr._bin;\n\tvar obj = [];\n\t\n\tvar ver = font.head.indexToLocFormat;\n\t//console.log(\"loca\", ver, length, 4*font.maxp.numGlyphs);\n\tvar len = font.maxp.numGlyphs+1;\n\t\n\tif(ver==0) for(var i=0; i<len; i++) obj.push(bin.readUshort(data, offset+(i<<1))<<1);\n\tif(ver==1) for(var i=0; i<len; i++) obj.push(bin.readUint (data, offset+(i<<2)) );\n\t\n\treturn obj;\n};\n\n\nTypr.maxp = {};\nTypr.maxp.parse = function(data, offset, length)\n{\n\t//console.log(data.length, offset, length);\n\t\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\t\n\t// both versions 0.5 and 1.0\n\tvar ver = bin.readUint(data, offset); offset += 4;\n\tobj.numGlyphs = bin.readUshort(data, offset); offset += 2;\n\t\n\t// only 1.0\n\tif(ver == 0x00010000)\n\t{\n\t\tobj.maxPoints = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxContours = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxCompositePoints = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxCompositeContours = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxZones = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxTwilightPoints = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxStorage = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxFunctionDefs = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxInstructionDefs = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxStackElements = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxSizeOfInstructions = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxComponentElements = bin.readUshort(data, offset); offset += 2;\n\t\tobj.maxComponentDepth = bin.readUshort(data, offset); offset += 2;\n\t}\n\t\n\treturn obj;\n};\n\n\nTypr.name = {};\nTypr.name.parse = function(data, offset, length)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\tvar format = bin.readUshort(data, offset); offset += 2;\n\tvar count = bin.readUshort(data, offset); offset += 2;\n\tvar stringOffset = bin.readUshort(data, offset); offset += 2;\n\t\n\t//console.log(format,count);\n\t\n\tvar names = [\n\t\t\"copyright\",\n\t\t\"fontFamily\",\n\t\t\"fontSubfamily\",\n\t\t\"ID\",\n\t\t\"fullName\",\n\t\t\"version\",\n\t\t\"postScriptName\",\n\t\t\"trademark\",\n\t\t\"manufacturer\",\n\t\t\"designer\",\n\t\t\"description\",\n\t\t\"urlVendor\",\n\t\t\"urlDesigner\",\n\t\t\"licence\",\n\t\t\"licenceURL\",\n\t\t\"---\",\n\t\t\"typoFamilyName\",\n\t\t\"typoSubfamilyName\",\n\t\t\"compatibleFull\",\n\t\t\"sampleText\",\n\t\t\"postScriptCID\",\n\t\t\"wwsFamilyName\",\n\t\t\"wwsSubfamilyName\",\n\t\t\"lightPalette\",\n\t\t\"darkPalette\"\n\t];\n\t\n\tvar offset0 = offset;\n\t\n\tfor(var i=0; i<count; i++)\n\t{\n\t\tvar platformID = bin.readUshort(data, offset); offset += 2;\n\t\tvar encodingID = bin.readUshort(data, offset); offset += 2;\n\t\tvar languageID = bin.readUshort(data, offset); offset += 2;\n\t\tvar nameID = bin.readUshort(data, offset); offset += 2;\n\t\tvar slen = bin.readUshort(data, offset); offset += 2;\n\t\tvar noffset = bin.readUshort(data, offset); offset += 2;\n\t\t//console.log(platformID, encodingID, languageID.toString(16), nameID, length, noffset);\n\t\t\n\t\tvar cname = names[nameID];\n\t\tvar soff = offset0 + count*12 + noffset;\n\t\tvar str;\n\t\tif(platformID == 0) str = bin.readUnicode(data, soff, slen/2);\n\t\telse if(platformID == 3 && encodingID == 0) str = bin.readUnicode(data, soff, slen/2);\n\t\telse if(encodingID == 0) str = bin.readASCII (data, soff, slen);\n\t\telse if(encodingID == 1) str = bin.readUnicode(data, soff, slen/2);\n\t\telse if(encodingID == 3) str = bin.readUnicode(data, soff, slen/2);\n\t\t\n\t\telse if(platformID == 1) { str = bin.readASCII(data, soff, slen); console.log(\"reading unknown MAC encoding \"+encodingID+\" as ASCII\"); }\n\t\telse throw \"unknown encoding \"+encodingID + \", platformID: \"+platformID;\n\t\t\n\t\tvar tid = \"p\"+platformID+\",\"+(languageID).toString(16);//Typr._platforms[platformID];\n\t\tif(obj[tid]==null) obj[tid] = {};\n\t\tobj[tid][cname] = str;\n\t\tobj[tid]._lang = languageID;\n\t\t//console.log(tid, obj[tid]);\n\t}\n\t/*\n\tif(format == 1)\n\t{\n\t\tvar langTagCount = bin.readUshort(data, offset); offset += 2;\n\t\tfor(var i=0; i<langTagCount; i++)\n\t\t{\n\t\t\tvar length = bin.readUshort(data, offset); offset += 2;\n\t\t\tvar noffset = bin.readUshort(data, offset); offset += 2;\n\t\t}\n\t}\n\t*/\n\t\n\t//console.log(obj);\n\t\n\tfor(var p in obj) if(obj[p].postScriptName!=null && obj[p]._lang==0x0409) return obj[p];\t\t// United States\n\tfor(var p in obj) if(obj[p].postScriptName!=null && obj[p]._lang==0x0000) return obj[p];\t\t// Universal\n\tfor(var p in obj) if(obj[p].postScriptName!=null && obj[p]._lang==0x0c0c) return obj[p];\t\t// Canada\n\tfor(var p in obj) if(obj[p].postScriptName!=null) return obj[p];\n\t\n\tvar tname;\n\tfor(var p in obj) { tname=p; break; }\n\tconsole.log(\"returning name table with languageID \"+ obj[tname]._lang);\n\treturn obj[tname];\n};\n\n\nTypr[\"OS/2\"] = {};\nTypr[\"OS/2\"].parse = function(data, offset, length)\n{\n\tvar bin = Typr._bin;\n\tvar ver = bin.readUshort(data, offset); offset += 2;\n\t\n\tvar obj = {};\n\tif (ver==0) Typr[\"OS/2\"].version0(data, offset, obj);\n\telse if(ver==1) Typr[\"OS/2\"].version1(data, offset, obj);\n\telse if(ver==2 || ver==3 || ver==4) Typr[\"OS/2\"].version2(data, offset, obj);\n\telse if(ver==5) Typr[\"OS/2\"].version5(data, offset, obj);\n\telse throw \"unknown OS/2 table version: \"+ver;\n\t\n\treturn obj;\n};\n\nTypr[\"OS/2\"].version0 = function(data, offset, obj)\n{\n\tvar bin = Typr._bin;\n\tobj.xAvgCharWidth = bin.readShort(data, offset); offset += 2;\n\tobj.usWeightClass = bin.readUshort(data, offset); offset += 2;\n\tobj.usWidthClass = bin.readUshort(data, offset); offset += 2;\n\tobj.fsType = bin.readUshort(data, offset); offset += 2;\n\tobj.ySubscriptXSize = bin.readShort(data, offset); offset += 2;\n\tobj.ySubscriptYSize = bin.readShort(data, offset); offset += 2;\n\tobj.ySubscriptXOffset = bin.readShort(data, offset); offset += 2;\n\tobj.ySubscriptYOffset = bin.readShort(data, offset); offset += 2; \n\tobj.ySuperscriptXSize = bin.readShort(data, offset); offset += 2; \n\tobj.ySuperscriptYSize = bin.readShort(data, offset); offset += 2; \n\tobj.ySuperscriptXOffset = bin.readShort(data, offset); offset += 2;\n\tobj.ySuperscriptYOffset = bin.readShort(data, offset); offset += 2;\n\tobj.yStrikeoutSize = bin.readShort(data, offset); offset += 2;\n\tobj.yStrikeoutPosition = bin.readShort(data, offset); offset += 2;\n\tobj.sFamilyClass = bin.readShort(data, offset); offset += 2;\n\tobj.panose = bin.readBytes(data, offset, 10); offset += 10;\n\tobj.ulUnicodeRange1\t= bin.readUint(data, offset); offset += 4;\n\tobj.ulUnicodeRange2\t= bin.readUint(data, offset); offset += 4;\n\tobj.ulUnicodeRange3\t= bin.readUint(data, offset); offset += 4;\n\tobj.ulUnicodeRange4\t= bin.readUint(data, offset); offset += 4;\n\tobj.achVendID = [bin.readInt8(data, offset), bin.readInt8(data, offset+1),bin.readInt8(data, offset+2),bin.readInt8(data, offset+3)]; offset += 4;\n\tobj.fsSelection\t = bin.readUshort(data, offset); offset += 2;\n\tobj.usFirstCharIndex = bin.readUshort(data, offset); offset += 2;\n\tobj.usLastCharIndex = bin.readUshort(data, offset); offset += 2;\n\tobj.sTypoAscender = bin.readShort(data, offset); offset += 2;\n\tobj.sTypoDescender = bin.readShort(data, offset); offset += 2;\n\tobj.sTypoLineGap = bin.readShort(data, offset); offset += 2;\n\tobj.usWinAscent = bin.readUshort(data, offset); offset += 2;\n\tobj.usWinDescent = bin.readUshort(data, offset); offset += 2;\n\treturn offset;\n};\n\nTypr[\"OS/2\"].version1 = function(data, offset, obj)\n{\n\tvar bin = Typr._bin;\n\toffset = Typr[\"OS/2\"].version0(data, offset, obj);\n\t\n\tobj.ulCodePageRange1 = bin.readUint(data, offset); offset += 4;\n\tobj.ulCodePageRange2 = bin.readUint(data, offset); offset += 4;\n\treturn offset;\n};\n\nTypr[\"OS/2\"].version2 = function(data, offset, obj)\n{\n\tvar bin = Typr._bin;\n\toffset = Typr[\"OS/2\"].version1(data, offset, obj);\n\t\n\tobj.sxHeight = bin.readShort(data, offset); offset += 2;\n\tobj.sCapHeight = bin.readShort(data, offset); offset += 2;\n\tobj.usDefault = bin.readUshort(data, offset); offset += 2;\n\tobj.usBreak = bin.readUshort(data, offset); offset += 2;\n\tobj.usMaxContext = bin.readUshort(data, offset); offset += 2;\n\treturn offset;\n};\n\nTypr[\"OS/2\"].version5 = function(data, offset, obj)\n{\n\tvar bin = Typr._bin;\n\toffset = Typr[\"OS/2\"].version2(data, offset, obj);\n\n\tobj.usLowerOpticalPointSize = bin.readUshort(data, offset); offset += 2;\n\tobj.usUpperOpticalPointSize = bin.readUshort(data, offset); offset += 2;\n\treturn offset;\n};\n\nTypr.post = {};\nTypr.post.parse = function(data, offset, length)\n{\n\tvar bin = Typr._bin;\n\tvar obj = {};\n\t\n\tobj.version = bin.readFixed(data, offset); offset+=4;\n\tobj.italicAngle = bin.readFixed(data, offset); offset+=4;\n\tobj.underlinePosition = bin.readShort(data, offset); offset+=2;\n\tobj.underlineThickness = bin.readShort(data, offset); offset+=2;\n\n\treturn obj;\n};\nTypr.SVG = {};\nTypr.SVG.parse = function(data, offset, length)\n{\n\tvar bin = Typr._bin;\n\tvar obj = { entries: []};\n\n\tvar offset0 = offset;\n\n\tvar tableVersion = bin.readUshort(data, offset);\toffset += 2;\n\tvar svgDocIndexOffset = bin.readUint(data, offset);\toffset += 4;\n\tvar reserved = bin.readUint(data, offset); offset += 4;\n\n\toffset = svgDocIndexOffset + offset0;\n\n\tvar numEntries = bin.readUshort(data, offset);\toffset += 2;\n\n\tfor(var i=0; i<numEntries; i++)\n\t{\n\t\tvar startGlyphID = bin.readUshort(data, offset); offset += 2;\n\t\tvar endGlyphID = bin.readUshort(data, offset); offset += 2;\n\t\tvar svgDocOffset = bin.readUint (data, offset); offset += 4;\n\t\tvar svgDocLength = bin.readUint (data, offset); offset += 4;\n\n\t\tvar sbuf = new Uint8Array(data.buffer, offset0 + svgDocOffset + svgDocIndexOffset, svgDocLength);\n\t\tvar svg = bin.readUTF8(sbuf, 0, sbuf.length);\n\t\t\n\t\tfor(var f=startGlyphID; f<=endGlyphID; f++) {\n\t\t\tobj.entries[f] = svg;\n\t\t}\n\t}\n\treturn obj;\n};\n\nTypr.SVG.toPath = function(str)\n{\n\tvar pth = {cmds:[], crds:[]};\n\tif(str==null) return pth;\n\t\n\tvar prsr = new DOMParser();\n\tvar doc = prsr[\"parseFromString\"](str,\"image/svg+xml\");\n\t\n\tvar svg = doc.firstChild; while(svg.tagName!=\"svg\") svg = svg.nextSibling;\n\tvar vb = svg.getAttribute(\"viewBox\");\n\tif(vb) vb = vb.trim().split(\" \").map(parseFloat); else vb = [0,0,1000,1000];\n\tTypr.SVG._toPath(svg.children, pth);\n\tfor(var i=0; i<pth.crds.length; i+=2) {\n\t\tvar x = pth.crds[i], y = pth.crds[i+1];\n\t\tx -= vb[0];\n\t\ty -= vb[1];\n\t\ty = -y;\n\t\tpth.crds[i] = x;\n\t\tpth.crds[i+1] = y;\n\t}\n\treturn pth;\n};\n\nTypr.SVG._toPath = function(nds, pth, fill) {\n\tfor(var ni=0; ni<nds.length; ni++) {\n\t\tvar nd = nds[ni], tn = nd.tagName;\n\t\tvar cfl = nd.getAttribute(\"fill\"); if(cfl==null) cfl = fill;\n\t\tif(tn==\"g\") Typr.SVG._toPath(nd.children, pth, cfl);\n\t\telse if(tn==\"path\") {\n\t\t\tpth.cmds.push(cfl?cfl:\"#000000\");\n\t\t\tvar d = nd.getAttribute(\"d\"); //console.log(d);\n\t\t\tvar toks = Typr.SVG._tokens(d); //console.log(toks);\n\t\t\tTypr.SVG._toksToPath(toks, pth); pth.cmds.push(\"X\");\n\t\t}\n\t\telse if(tn==\"defs\") ;\n\t\telse console.log(tn, nd);\n\t}\n};\n\nTypr.SVG._tokens = function(d) {\n\tvar ts = [], off = 0, rn=false, cn=\"\"; // reading number, current number\n\twhile(off<d.length){\n\t\tvar cc=d.charCodeAt(off), ch = d.charAt(off); off++;\n\t\tvar isNum = (48<=cc && cc<=57) || ch==\".\" || ch==\"-\";\n\t\t\n\t\tif(rn) {\n\t\t\tif(ch==\"-\") { ts.push(parseFloat(cn)); cn=ch; }\n\t\t\telse if(isNum) cn+=ch;\n\t\t\telse { ts.push(parseFloat(cn)); if(ch!=\",\" && ch!=\" \") ts.push(ch); rn=false; }\n\t\t}\n\t\telse {\n\t\t\tif(isNum) { cn=ch; rn=true; }\n\t\t\telse if(ch!=\",\" && ch!=\" \") ts.push(ch);\n\t\t}\n\t}\n\tif(rn) ts.push(parseFloat(cn));\n\treturn ts;\n};\n\nTypr.SVG._toksToPath = function(ts, pth) {\t\n\tvar i = 0, x = 0, y = 0, ox = 0, oy = 0;\n\tvar pc = {\"M\":2,\"L\":2,\"H\":1,\"V\":1, \"S\":4, \"C\":6};\n\tvar cmds = pth.cmds, crds = pth.crds;\n\t\n\twhile(i<ts.length) {\n\t\tvar cmd = ts[i]; i++;\n\t\t\n\t\tif(cmd==\"z\") { cmds.push(\"Z\"); x=ox; y=oy; }\n\t\telse {\n\t\t\tvar cmu = cmd.toUpperCase();\n\t\t\tvar ps = pc[cmu], reps = Typr.SVG._reps(ts, i, ps);\n\t\t\n\t\t\tfor(var j=0; j<reps; j++) {\n\t\t\t\tvar xi = 0, yi = 0; if(cmd!=cmu) { xi=x; yi=y; }\n\t\t\t\t\n\t\t\t\tif(cmu==\"M\") { x = xi+ts[i++]; y = yi+ts[i++]; cmds.push(\"M\"); crds.push(x,y); ox=x; oy=y; }\n\t\t\t\telse if(cmu==\"L\") { x = xi+ts[i++]; y = yi+ts[i++]; cmds.push(\"L\"); crds.push(x,y); }\n\t\t\t\telse if(cmu==\"H\") { x = xi+ts[i++]; cmds.push(\"L\"); crds.push(x,y); }\n\t\t\t\telse if(cmu==\"V\") { y = yi+ts[i++]; cmds.push(\"L\"); crds.push(x,y); }\n\t\t\t\telse if(cmu==\"C\") {\n\t\t\t\t\tvar x1=xi+ts[i++], y1=yi+ts[i++], x2=xi+ts[i++], y2=yi+ts[i++], x3=xi+ts[i++], y3=yi+ts[i++];\n\t\t\t\t\tcmds.push(\"C\"); crds.push(x1,y1,x2,y2,x3,y3); x=x3; y=y3;\n\t\t\t\t}\n\t\t\t\telse if(cmu==\"S\") {\n\t\t\t\t\tvar co = Math.max(crds.length-4, 0);\n\t\t\t\t\tvar x1 = x+x-crds[co], y1 = y+y-crds[co+1];\n\t\t\t\t\tvar x2=xi+ts[i++], y2=yi+ts[i++], x3=xi+ts[i++], y3=yi+ts[i++]; \n\t\t\t\t\tcmds.push(\"C\"); crds.push(x1,y1,x2,y2,x3,y3); x=x3; y=y3;\n\t\t\t\t}\n\t\t\t\telse console.log(\"Unknown SVG command \"+cmd);\n\t\t\t}\n\t\t}\n\t}\n};\nTypr.SVG._reps = function(ts, off, ps) {\n\tvar i = off;\n\twhile(i<ts.length) { if((typeof ts[i]) == \"string\") break; i+=ps; }\n\treturn (i-off)/ps;\n};\n// End Typr.js\n\n// Begin Typr.U.js\n\nif(Typr ==null) Typr = {};\nif(Typr.U==null) Typr.U = {};\n\n\nTypr.U.codeToGlyph = function(font, code)\n{\n\tvar cmap = font.cmap;\n\t\n\tvar tind = -1;\n\tif(cmap.p0e4!=null) tind = cmap.p0e4;\n\telse if(cmap.p3e1!=null) tind = cmap.p3e1;\n\telse if(cmap.p1e0!=null) tind = cmap.p1e0;\n\telse if(cmap.p0e3!=null) tind = cmap.p0e3;\n\t\n\tif(tind==-1) throw \"no familiar platform and encoding!\";\n\t\n\tvar tab = cmap.tables[tind];\n\t\n\tif(tab.format==0)\n\t{\n\t\tif(code>=tab.map.length) return 0;\n\t\treturn tab.map[code];\n\t}\n\telse if(tab.format==4)\n\t{\n\t\tvar sind = -1;\n\t\tfor(var i=0; i<tab.endCount.length; i++) if(code<=tab.endCount[i]){ sind=i; break; } \n\t\tif(sind==-1) return 0;\n\t\tif(tab.startCount[sind]>code) return 0;\n\t\t\n\t\tvar gli = 0;\n\t\tif(tab.idRangeOffset[sind]!=0) gli = tab.glyphIdArray[(code-tab.startCount[sind]) + (tab.idRangeOffset[sind]>>1) - (tab.idRangeOffset.length-sind)];\n\t\telse gli = code + tab.idDelta[sind];\n\t\treturn gli & 0xFFFF;\n\t}\n\telse if(tab.format==12)\n\t{\n\t\tif(code>tab.groups[tab.groups.length-1][1]) return 0;\n\t\tfor(var i=0; i<tab.groups.length; i++)\n\t\t{\n\t\t\tvar grp = tab.groups[i];\n\t\t\tif(grp[0]<=code && code<=grp[1]) return grp[2] + (code-grp[0]);\n\t\t}\n\t\treturn 0;\n\t}\n\telse throw \"unknown cmap table format \"+tab.format;\n};\n\n\nTypr.U.glyphToPath = function(font, gid)\n{\n\tvar path = { cmds:[], crds:[] };\n\tif(font.SVG && font.SVG.entries[gid]) {\n\t\tvar p = font.SVG.entries[gid]; if(p==null) return path;\n\t\tif(typeof p == \"string\") { p = Typr.SVG.toPath(p); font.SVG.entries[gid]=p; }\n\t\treturn p;\n\t}\n\telse if(font.CFF) {\n\t\tvar state = {x:0,y:0,stack:[],nStems:0,haveWidth:false,width: font.CFF.Private ? font.CFF.Private.defaultWidthX : 0,open:false};\n\t\tvar cff=font.CFF, pdct = font.CFF.Private;\n\t\tif(cff.ROS) {\n\t\t\tvar gi = 0;\n\t\t\twhile(cff.FDSelect[gi+2]<=gid) gi+=2;\n\t\t\tpdct = cff.FDArray[cff.FDSelect[gi+1]].Private;\n\t\t}\n\t\tTypr.U._drawCFF(font.CFF.CharStrings[gid], state, cff, pdct, path);\n\t}\n\telse if(font.glyf) { Typr.U._drawGlyf(gid, font, path); }\n\treturn path;\n};\n\nTypr.U._drawGlyf = function(gid, font, path)\n{\n\tvar gl = font.glyf[gid];\n\tif(gl==null) gl = font.glyf[gid] = Typr.glyf._parseGlyf(font, gid);\n\tif(gl!=null){\n\t\tif(gl.noc>-1) Typr.U._simpleGlyph(gl, path);\n\t\telse Typr.U._compoGlyph (gl, font, path);\n\t}\n};\nTypr.U._simpleGlyph = function(gl, p)\n{\n\tfor(var c=0; c<gl.noc; c++)\n\t{\n\t\tvar i0 = (c==0) ? 0 : (gl.endPts[c-1] + 1);\n\t\tvar il = gl.endPts[c];\n\t\t\n\t\tfor(var i=i0; i<=il; i++)\n\t\t{\n\t\t\tvar pr = (i==i0)?il:(i-1);\n\t\t\tvar nx = (i==il)?i0:(i+1);\n\t\t\tvar onCurve = gl.flags[i]&1;\n\t\t\tvar prOnCurve = gl.flags[pr]&1;\n\t\t\tvar nxOnCurve = gl.flags[nx]&1;\n\t\t\t\n\t\t\tvar x = gl.xs[i], y = gl.ys[i];\n\t\t\t\n\t\t\tif(i==i0) { \n\t\t\t\tif(onCurve) \n\t\t\t\t{\n\t\t\t\t\tif(prOnCurve) Typr.U.P.moveTo(p, gl.xs[pr], gl.ys[pr]); \n\t\t\t\t\telse { Typr.U.P.moveTo(p,x,y); continue; /* will do curveTo at il */ }\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tif(prOnCurve) Typr.U.P.moveTo(p, gl.xs[pr], gl.ys[pr] );\n\t\t\t\t\telse Typr.U.P.moveTo(p, (gl.xs[pr]+x)/2, (gl.ys[pr]+y)/2 ); \n\t\t\t\t}\n\t\t\t}\n\t\t\tif(onCurve)\n\t\t\t{\n\t\t\t\tif(prOnCurve) Typr.U.P.lineTo(p,x,y);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(nxOnCurve) Typr.U.P.qcurveTo(p, x, y, gl.xs[nx], gl.ys[nx]); \n\t\t\t\telse Typr.U.P.qcurveTo(p, x, y, (x+gl.xs[nx])/2, (y+gl.ys[nx])/2); \n\t\t\t}\n\t\t}\n\t\tTypr.U.P.closePath(p);\n\t}\n};\nTypr.U._compoGlyph = function(gl, font, p)\n{\n\tfor(var j=0; j<gl.parts.length; j++)\n\t{\n\t\tvar path = { cmds:[], crds:[] };\n\t\tvar prt = gl.parts[j];\n\t\tTypr.U._drawGlyf(prt.glyphIndex, font, path);\n\t\t\n\t\tvar m = prt.m;\n\t\tfor(var i=0; i<path.crds.length; i+=2)\n\t\t{\n\t\t\tvar x = path.crds[i ], y = path.crds[i+1];\n\t\t\tp.crds.push(x*m.a + y*m.b + m.tx);\n\t\t\tp.crds.push(x*m.c + y*m.d + m.ty);\n\t\t}\n\t\tfor(var i=0; i<path.cmds.length; i++) p.cmds.push(path.cmds[i]);\n\t}\n};\n\n\nTypr.U._getGlyphClass = function(g, cd)\n{\n\tvar intr = Typr._lctf.getInterval(cd, g);\n\treturn intr==-1 ? 0 : cd[intr+2];\n\t//for(var i=0; i<cd.start.length; i++) \n\t//\tif(cd.start[i]<=g && cd.end[i]>=g) return cd.class[i];\n\t//return 0;\n};\n\nTypr.U.getPairAdjustment = function(font, g1, g2)\n{\n\t//return 0;\n\tif(font.GPOS) {\n\t\tvar gpos = font[\"GPOS\"];\n\t\tvar llist = gpos.lookupList, flist = gpos.featureList;\n\t\tvar tused = [];\n\t\tfor(var i=0; i<flist.length; i++) \n\t\t{\n\t\t\tvar fl = flist[i]; //console.log(fl);\n\t\t\tif(fl.tag!=\"kern\") continue;\n\t\t\tfor(var ti=0; ti<fl.tab.length; ti++) {\n\t\t\t\tif(tused[fl.tab[ti]]) continue; tused[fl.tab[ti]] = true;\n\t\t\t\tvar tab = llist[fl.tab[ti]];\n\t\t\t\t//console.log(tab);\n\t\t\t\t\n\t\t\t\tfor(var j=0; j<tab.tabs.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif(tab.tabs[i]==null) continue;\n\t\t\t\t\tvar ltab = tab.tabs[j], ind;\n\t\t\t\t\tif(ltab.coverage) { ind = Typr._lctf.coverageIndex(ltab.coverage, g1); if(ind==-1) continue; }\n\t\t\t\t\t\n\t\t\t\t\tif(tab.ltype==1) ;\n\t\t\t\t\telse if(tab.ltype==2)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar adj;\n\t\t\t\t\t\tif(ltab.fmt==1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar right = ltab.pairsets[ind];\n\t\t\t\t\t\t\tfor(var i=0; i<right.length; i++) if(right[i].gid2==g2) adj = right[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(ltab.fmt==2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar c1 = Typr.U._getGlyphClass(g1, ltab.classDef1);\n\t\t\t\t\t\t\tvar c2 = Typr.U._getGlyphClass(g2, ltab.classDef2);\n\t\t\t\t\t\t\tadj = ltab.matrix[c1][c2];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//if(adj) console.log(ltab, adj);\n\t\t\t\t\t\tif(adj && adj.val2) return adj.val2[2];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif(font.kern)\n\t{\n\t\tvar ind1 = font.kern.glyph1.indexOf(g1);\n\t\tif(ind1!=-1)\n\t\t{\n\t\t\tvar ind2 = font.kern.rval[ind1].glyph2.indexOf(g2);\n\t\t\tif(ind2!=-1) return font.kern.rval[ind1].vals[ind2];\n\t\t}\n\t}\n\t\n\treturn 0;\n};\n\nTypr.U.stringToGlyphs = function(font, str)\n{\n\tvar gls = [];\n\tfor(var i=0; i<str.length; i++) {\n\t\tvar cc = str.codePointAt(i); if(cc>0xffff) i++;\n\t\tgls.push(Typr.U.codeToGlyph(font, cc));\n\t}\n\tfor(var i=0; i<str.length; i++) {\n\t\tvar cc = str.codePointAt(i); //\n\t\tif(cc==2367) { var t=gls[i-1]; gls[i-1]=gls[i]; gls[i]=t; }\n\t\t//if(cc==2381) { var t=gls[i+1]; gls[i+1]=gls[i]; gls[i]=t; }\n\t\tif(cc>0xffff) i++;\n\t}\n\t//console.log(gls.slice(0));\n\t\n\t//console.log(gls); return gls;\n\t\n\tvar gsub = font[\"GSUB\"]; if(gsub==null) return gls;\n\tvar llist = gsub.lookupList, flist = gsub.featureList;\n\t\n\tvar cligs = [\"rlig\", \"liga\", \"mset\", \"isol\",\"init\",\"fina\",\"medi\", \"half\", \"pres\", \n\t\t\t\t\"blws\" /* Tibetan fonts like Himalaya.ttf */ ];\n\t\n\t//console.log(gls.slice(0));\n\tvar tused = [];\n\tfor(var fi=0; fi<flist.length; fi++)\n\t{\n\t\tvar fl = flist[fi]; if(cligs.indexOf(fl.tag)==-1) continue;\n\t\t//if(fl.tag==\"blwf\") continue;\n\t\t//console.log(fl);\n\t\t//console.log(fl.tag);\n\t\tfor(var ti=0; ti<fl.tab.length; ti++) {\n\t\t\tif(tused[fl.tab[ti]]) continue; tused[fl.tab[ti]] = true;\n\t\t\tvar tab = llist[fl.tab[ti]];\n\t\t\t//console.log(fl.tab[ti], tab.ltype);\n\t\t\t//console.log(fl.tag, tab);\n\t\t\tfor(var ci=0; ci<gls.length; ci++) {\n\t\t\t\tvar feat = Typr.U._getWPfeature(str, ci);\n\t\t\t\tif(\"isol,init,fina,medi\".indexOf(fl.tag)!=-1 && fl.tag!=feat) continue;\n\t\t\t\t\n\t\t\t\tTypr.U._applySubs(gls, ci, tab, llist);\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn gls;\n};\nTypr.U._getWPfeature = function(str, ci) { // get Word Position feature\n\tvar wsep = \"\\n\\t\\\" ,.:;!?() ،\";\n\tvar R = \"آأؤإاةدذرزوٱٲٳٵٶٷڈډڊڋڌڍڎڏڐڑڒړڔڕږڗژڙۀۃۄۅۆۇۈۉۊۋۍۏےۓەۮۯܐܕܖܗܘܙܞܨܪܬܯݍݙݚݛݫݬݱݳݴݸݹࡀࡆࡇࡉࡔࡧࡩࡪࢪࢫࢬࢮࢱࢲࢹૅેૉ૊૎૏ૐ૑૒૝ૡ૤૯஁ஃ஄அஉ஌எஏ஑னப஫஬\";\n\tvar L = \"ꡲ્૗\";\n\t\n\tvar slft = ci==0 || wsep.indexOf(str[ci-1])!=-1;\n\tvar srgt = ci==str.length-1 || wsep.indexOf(str[ci+1])!=-1;\n\t\t\n\tif(!slft && R.indexOf(str[ci-1])!=-1) slft=true;\n\tif(!srgt && R.indexOf(str[ci ])!=-1) srgt=true;\n\t\t\n\tif(!srgt && L.indexOf(str[ci+1])!=-1) srgt=true;\n\tif(!slft && L.indexOf(str[ci ])!=-1) slft=true;\n\t\t\n\tvar feat = null;\n\tif(slft) feat = srgt ? \"isol\" : \"init\";\n\telse feat = srgt ? \"fina\" : \"medi\";\n\t\n\treturn feat;\n};\nTypr.U._applySubs = function(gls, ci, tab, llist) {\n\tvar rlim = gls.length-ci-1;\n\t//if(ci==0) console.log(\"++++ \", tab.ltype);\n\tfor(var j=0; j<tab.tabs.length; j++)\n\t{\n\t\tif(tab.tabs[j]==null) continue;\n\t\tvar ltab = tab.tabs[j], ind;\n\t\tif(ltab.coverage) { ind = Typr._lctf.coverageIndex(ltab.coverage, gls[ci]); if(ind==-1) continue; }\n\t\t//if(ci==0) console.log(ind, ltab);\n\t\t//*\n\t\tif(tab.ltype==1) {\n\t\t\tvar gl = gls[ci];\n\t\t\tif(ltab.fmt==1) gls[ci] = gls[ci]+ltab.delta;\n\t\t\telse gls[ci] = ltab.newg[ind];\n\t\t\t//console.log(\"applying ... 1\", ci, gl, gls[ci]);\n\t\t}//*\n\t\telse if(tab.ltype==4) {\n\t\t\tvar vals = ltab.vals[ind];\n\t\t\t\n\t\t\tfor(var k=0; k<vals.length; k++) {\n\t\t\t\tvar lig = vals[k], rl = lig.chain.length; if(rl>rlim) continue;\n\t\t\t\tvar good = true, em1 = 0;\n\t\t\t\tfor(var l=0; l<rl; l++) { while(gls[ci+em1+(1+l)]==-1)em1++; if(lig.chain[l]!=gls[ci+em1+(1+l)]) good=false; }\n\t\t\t\tif(!good) continue;\n\t\t\t\tgls[ci]=lig.nglyph;\n\t\t\t\tfor(var l=0; l<rl+em1; l++) gls[ci+l+1]=-1; break; // first character changed, other ligatures do not apply anymore\n\t\t\t\t//console.log(\"lig\", ci, lig.chain, lig.nglyph);\n\t\t\t\t//console.log(\"applying ...\");\n\t\t\t}\n\t\t}\n\t\telse if(tab.ltype==5 && ltab.fmt==2) {\n\t\t\tvar cind = Typr._lctf.getInterval(ltab.cDef, gls[ci]);\n\t\t\tvar cls = ltab.cDef[cind+2], scs = ltab.scset[cls]; \n\t\t\tfor(var i=0; i<scs.length; i++) {\n\t\t\t\tvar sc = scs[i], inp = sc.input;\n\t\t\t\tif(inp.length>rlim) continue;\n\t\t\t\tvar good = true;\n\t\t\t\tfor(var l=0; l<inp.length; l++) {\n\t\t\t\t\tvar cind2 = Typr._lctf.getInterval(ltab.cDef, gls[ci+1+l]);\n\t\t\t\t\tif(cind==-1 && ltab.cDef[cind2+2]!=inp[l]) { good=false; break; }\n\t\t\t\t}\n\t\t\t\tif(!good) continue;\n\t\t\t\t//console.log(ci, gl);\n\t\t\t\tvar lrs = sc.substLookupRecords;\n\t\t\t\tfor(var k=0; k<lrs.length; k+=2)\n\t\t\t\t{\n\t\t\t\t\tvar gi = lrs[k], tabi = lrs[k+1];\n\t\t\t\t\t//Typr.U._applyType1(gls, ci+gi, llist[tabi]);\n\t\t\t\t\t//console.log(tabi, gls[ci+gi], llist[tabi]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if(tab.ltype==6 && ltab.fmt==3) {\n\t\t\t//if(ltab.backCvg.length==0) return;\n\t\t\tif(!Typr.U._glsCovered(gls, ltab.backCvg, ci-ltab.backCvg.length)) continue;\n\t\t\tif(!Typr.U._glsCovered(gls, ltab.inptCvg, ci)) continue;\n\t\t\tif(!Typr.U._glsCovered(gls, ltab.ahedCvg, ci+ltab.inptCvg.length)) continue;\n\t\t\t//console.log(ci, ltab);\n\t\t\tvar lr = ltab.lookupRec; //console.log(ci, gl, lr);\n\t\t\tfor(var i=0; i<lr.length; i+=2) {\n\t\t\t\tvar cind = lr[i], tab2 = llist[lr[i+1]];\n\t\t\t\t//console.log(\"-\", lr[i+1], tab2);\n\t\t\t\tTypr.U._applySubs(gls, ci+cind, tab2, llist);\n\t\t\t}\n\t\t}\n\t\t//else console.log(\"Unknown table\", tab.ltype, ltab.fmt);\n\t\t//*/\n\t}\n};\n\nTypr.U._glsCovered = function(gls, cvgs, ci) {\n\tfor(var i=0; i<cvgs.length; i++) {\n\t\tvar ind = Typr._lctf.coverageIndex(cvgs[i], gls[ci+i]); if(ind==-1) return false;\n\t}\n\treturn true;\n};\n\nTypr.U.glyphsToPath = function(font, gls, clr)\n{\t\n\t//gls = gls.reverse();//gls.slice(0,12).concat(gls.slice(12).reverse());\n\t\n\tvar tpath = {cmds:[], crds:[]};\n\tvar x = 0;\n\t\n\tfor(var i=0; i<gls.length; i++)\n\t{\n\t\tvar gid = gls[i]; if(gid==-1) continue;\n\t\tvar gid2 = (i<gls.length-1 && gls[i+1]!=-1) ? gls[i+1] : 0;\n\t\tvar path = Typr.U.glyphToPath(font, gid);\n\t\tfor(var j=0; j<path.crds.length; j+=2)\n\t\t{\n\t\t\ttpath.crds.push(path.crds[j] + x);\n\t\t\ttpath.crds.push(path.crds[j+1]);\n\t\t}\n\t\tif(clr) tpath.cmds.push(clr);\n\t\tfor(var j=0; j<path.cmds.length; j++) tpath.cmds.push(path.cmds[j]);\n\t\tif(clr) tpath.cmds.push(\"X\");\n\t\tx += font.hmtx.aWidth[gid];// - font.hmtx.lsBearing[gid];\n\t\tif(i<gls.length-1) x += Typr.U.getPairAdjustment(font, gid, gid2);\n\t}\n\treturn tpath;\n};\n\nTypr.U.pathToSVG = function(path, prec)\n{\n\tif(prec==null) prec = 5;\n\tvar out = [], co = 0, lmap = {\"M\":2,\"L\":2,\"Q\":4,\"C\":6};\n\tfor(var i=0; i<path.cmds.length; i++)\n\t{\n\t\tvar cmd = path.cmds[i], cn = co+(lmap[cmd]?lmap[cmd]:0); \n\t\tout.push(cmd);\n\t\twhile(co<cn) { var c = path.crds[co++]; out.push(parseFloat(c.toFixed(prec))+(co==cn?\"\":\" \")); }\n\t}\n\treturn out.join(\"\");\n};\n\nTypr.U.pathToContext = function(path, ctx)\n{\n\tvar c = 0, crds = path.crds;\n\t\n\tfor(var j=0; j<path.cmds.length; j++)\n\t{\n\t\tvar cmd = path.cmds[j];\n\t\tif (cmd==\"M\") {\n\t\t\tctx.moveTo(crds[c], crds[c+1]);\n\t\t\tc+=2;\n\t\t}\n\t\telse if(cmd==\"L\") {\n\t\t\tctx.lineTo(crds[c], crds[c+1]);\n\t\t\tc+=2;\n\t\t}\n\t\telse if(cmd==\"C\") {\n\t\t\tctx.bezierCurveTo(crds[c], crds[c+1], crds[c+2], crds[c+3], crds[c+4], crds[c+5]);\n\t\t\tc+=6;\n\t\t}\n\t\telse if(cmd==\"Q\") {\n\t\t\tctx.quadraticCurveTo(crds[c], crds[c+1], crds[c+2], crds[c+3]);\n\t\t\tc+=4;\n\t\t}\n\t\telse if(cmd.charAt(0)==\"#\") {\n\t\t\tctx.beginPath();\n\t\t\tctx.fillStyle = cmd;\n\t\t}\n\t\telse if(cmd==\"Z\") {\n\t\t\tctx.closePath();\n\t\t}\n\t\telse if(cmd==\"X\") {\n\t\t\tctx.fill();\n\t\t}\n\t}\n};\n\n\nTypr.U.P = {};\nTypr.U.P.moveTo = function(p, x, y)\n{\n\tp.cmds.push(\"M\"); p.crds.push(x,y);\n};\nTypr.U.P.lineTo = function(p, x, y)\n{\n\tp.cmds.push(\"L\"); p.crds.push(x,y);\n};\nTypr.U.P.curveTo = function(p, a,b,c,d,e,f)\n{\n\tp.cmds.push(\"C\"); p.crds.push(a,b,c,d,e,f);\n};\nTypr.U.P.qcurveTo = function(p, a,b,c,d)\n{\n\tp.cmds.push(\"Q\"); p.crds.push(a,b,c,d);\n};\nTypr.U.P.closePath = function(p) { p.cmds.push(\"Z\"); };\n\n\n\n\nTypr.U._drawCFF = function(cmds, state, font, pdct, p)\n{\n\tvar stack = state.stack;\n\tvar nStems = state.nStems, haveWidth=state.haveWidth, width=state.width, open=state.open;\n\tvar i=0;\n\tvar x=state.x, y=state.y, c1x=0, c1y=0, c2x=0, c2y=0, c3x=0, c3y=0, c4x=0, c4y=0, jpx=0, jpy=0;\n\t\n\tvar o = {val:0,size:0};\n\t//console.log(cmds);\n\twhile(i<cmds.length)\n\t{\n\t\tTypr.CFF.getCharString(cmds, i, o);\n\t\tvar v = o.val;\n\t\ti += o.size;\n\t\t\t\n\t\tif(v==\"o1\" || v==\"o18\") // hstem || hstemhm\n\t\t{\n\t\t\tvar hasWidthArg;\n\n\t\t\t// The number of stem operators on the stack is always even.\n\t\t\t// If the value is uneven, that means a width is specified.\n\t\t\thasWidthArg = stack.length % 2 !== 0;\n\t\t\tif (hasWidthArg && !haveWidth) {\n\t\t\t\twidth = stack.shift() + pdct.nominalWidthX;\n\t\t\t}\n\n\t\t\tnStems += stack.length >> 1;\n\t\t\tstack.length = 0;\n\t\t\thaveWidth = true;\n\t\t}\n\t\telse if(v==\"o3\" || v==\"o23\") // vstem || vstemhm\n\t\t{\n\t\t\tvar hasWidthArg;\n\n\t\t\t// The number of stem operators on the stack is always even.\n\t\t\t// If the value is uneven, that means a width is specified.\n\t\t\thasWidthArg = stack.length % 2 !== 0;\n\t\t\tif (hasWidthArg && !haveWidth) {\n\t\t\t\twidth = stack.shift() + pdct.nominalWidthX;\n\t\t\t}\n\n\t\t\tnStems += stack.length >> 1;\n\t\t\tstack.length = 0;\n\t\t\thaveWidth = true;\n\t\t}\n\t\telse if(v==\"o4\")\n\t\t{\n\t\t\tif (stack.length > 1 && !haveWidth) {\n width = stack.shift() + pdct.nominalWidthX;\n haveWidth = true;\n }\n\t\t\tif(open) Typr.U.P.closePath(p);\n\n y += stack.pop();\n\t\t\t\t\tTypr.U.P.moveTo(p,x,y); open=true;\n\t\t}\n\t\telse if(v==\"o5\")\n\t\t{\n\t\t\twhile (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n Typr.U.P.lineTo(p, x, y);\n }\n\t\t}\n\t\telse if(v==\"o6\" || v==\"o7\") // hlineto || vlineto\n\t\t{\n\t\t\tvar count = stack.length;\n\t\t\tvar isX = (v == \"o6\");\n\t\t\t\n\t\t\tfor(var j=0; j<count; j++) {\n\t\t\t\tvar sval = stack.shift();\n\t\t\t\t\n\t\t\t\tif(isX) x += sval; else y += sval;\n\t\t\t\tisX = !isX;\n\t\t\t\tTypr.U.P.lineTo(p, x, y);\n\t\t\t}\n\t\t}\n\t\telse if(v==\"o8\" || v==\"o24\")\t// rrcurveto || rcurveline\n\t\t{\n\t\t\tvar count = stack.length;\n\t\t\tvar index = 0;\n\t\t\twhile(index+6 <= count) {\n\t\t\t\tc1x = x + stack.shift();\n\t\t\t\tc1y = y + stack.shift();\n\t\t\t\tc2x = c1x + stack.shift();\n\t\t\t\tc2y = c1y + stack.shift();\n\t\t\t\tx = c2x + stack.shift();\n\t\t\t\ty = c2y + stack.shift();\n\t\t\t\tTypr.U.P.curveTo(p, c1x, c1y, c2x, c2y, x, y);\n\t\t\t\tindex+=6;\n\t\t\t}\n\t\t\tif(v==\"o24\")\n\t\t\t{\n\t\t\t\tx += stack.shift();\n\t\t\t\ty += stack.shift();\n\t\t\t\tTypr.U.P.lineTo(p, x, y);\n\t\t\t}\n\t\t}\n\t\telse if(v==\"o11\") break;\n\t\telse if(v==\"o1234\" || v==\"o1235\" || v==\"o1236\" || v==\"o1237\")//if((v+\"\").slice(0,3)==\"o12\")\n\t\t{\n\t\t\tif(v==\"o1234\")\n\t\t\t{\n\t\t\t\tc1x = x + stack.shift(); // dx1\n c1y = y; // dy1\n\t\t\t\tc2x = c1x + stack.shift(); // dx2\n\t\t\t\tc2y = c1y + stack.shift(); // dy2\n\t\t\t\tjpx = c2x + stack.shift(); // dx3\n\t\t\t\tjpy = c2y; // dy3\n\t\t\t\tc3x = jpx + stack.shift(); // dx4\n\t\t\t\tc3y = c2y; // dy4\n\t\t\t\tc4x = c3x + stack.shift(); // dx5\n\t\t\t\tc4y = y; // dy5\n\t\t\t\tx = c4x + stack.shift(); // dx6\n\t\t\t\tTypr.U.P.curveTo(p, c1x, c1y, c2x, c2y, jpx, jpy);\n\t\t\t\tTypr.U.P.curveTo(p, c3x, c3y, c4x, c4y, x, y);\n\t\t\t\t\n\t\t\t}\n\t\t\tif(v==\"o1235\")\n\t\t\t{\n\t\t\t\tc1x = x + stack.shift(); // dx1\n\t\t\t\tc1y = y + stack.shift(); // dy1\n\t\t\t\tc2x = c1x + stack.shift(); // dx2\n\t\t\t\tc2y = c1y + stack.shift(); // dy2\n\t\t\t\tjpx = c2x + stack.shift(); // dx3\n\t\t\t\tjpy = c2y + stack.shift(); // dy3\n\t\t\t\tc3x = jpx + stack.shift(); // dx4\n\t\t\t\tc3y = jpy + stack.shift(); // dy4\n\t\t\t\tc4x = c3x + stack.shift(); // dx5\n\t\t\t\tc4y = c3y + stack.shift(); // dy5\n\t\t\t\tx = c4x + stack.shift(); // dx6\n\t\t\t\ty = c4y + stack.shift(); // dy6\n\t\t\t\tstack.shift(); // flex depth\n\t\t\t\tTypr.U.P.curveTo(p, c1x, c1y, c2x, c2y, jpx, jpy);\n\t\t\t\tTypr.U.P.curveTo(p, c3x, c3y, c4x, c4y, x, y);\n\t\t\t}\n\t\t\tif(v==\"o1236\")\n\t\t\t{\n\t\t\t\tc1x = x + stack.shift(); // dx1\n\t\t\t\tc1y = y + stack.shift(); // dy1\n\t\t\t\tc2x = c1x + stack.shift(); // dx2\n\t\t\t\tc2y = c1y + stack.shift(); // dy2\n\t\t\t\tjpx = c2x + stack.shift(); // dx3\n\t\t\t\tjpy = c2y; // dy3\n\t\t\t\tc3x = jpx + stack.shift(); // dx4\n\t\t\t\tc3y = c2y; // dy4\n\t\t\t\tc4x = c3x + stack.shift(); // dx5\n\t\t\t\tc4y = c3y + stack.shift(); // dy5\n\t\t\t\tx = c4x + stack.shift(); // dx6\n\t\t\t\tTypr.U.P.curveTo(p, c1x, c1y, c2x, c2y, jpx, jpy);\n\t\t\t\tTypr.U.P.curveTo(p, c3x, c3y, c4x, c4y, x, y);\n\t\t\t}\n\t\t\tif(v==\"o1237\")\n\t\t\t{\n\t\t\t\tc1x = x + stack.shift(); // dx1\n\t\t\t\tc1y = y + stack.shift(); // dy1\n\t\t\t\tc2x = c1x + stack.shift(); // dx2\n\t\t\t\tc2y = c1y + stack.shift(); // dy2\n\t\t\t\tjpx = c2x + stack.shift(); // dx3\n\t\t\t\tjpy = c2y + stack.shift(); // dy3\n\t\t\t\tc3x = jpx + stack.shift(); // dx4\n\t\t\t\tc3y = jpy + stack.shift(); // dy4\n\t\t\t\tc4x = c3x + stack.shift(); // dx5\n\t\t\t\tc4y = c3y + stack.shift(); // dy5\n\t\t\t\tif (Math.abs(c4x - x) > Math.abs(c4y - y)) {\n\t\t\t\t x = c4x + stack.shift();\n\t\t\t\t} else {\n\t\t\t\t y = c4y + stack.shift();\n\t\t\t\t}\n\t\t\t\tTypr.U.P.curveTo(p, c1x, c1y, c2x, c2y, jpx, jpy);\n\t\t\t\tTypr.U.P.curveTo(p, c3x, c3y, c4x, c4y, x, y);\n\t\t\t}\n\t\t}\n\t\telse if(v==\"o14\")\n\t\t{\n\t\t\tif (stack.length > 0 && !haveWidth) {\n width = stack.shift() + font.nominalWidthX;\n haveWidth = true;\n }\n\t\t\tif(stack.length==4) // seac = standard encoding accented character\n\t\t\t{\n\t\t\t\tvar adx = stack.shift();\n\t\t\t\tvar ady = stack.shift();\n\t\t\t\tvar bchar = stack.shift();\n\t\t\t\tvar achar = stack.shift();\n\t\t\t\n\t\t\t\t\n\t\t\t\tvar bind = Typr.CFF.glyphBySE(font, bchar);\n\t\t\t\tvar aind = Typr.CFF.glyphBySE(font, achar);\n\t\t\t\t\n\t\t\t\t//console.log(bchar, bind);\n\t\t\t\t//console.log(achar, aind);\n\t\t\t\t//state.x=x; state.y=y; state.nStems=nStems; state.haveWidth=haveWidth; state.width=width; state.open=open;\n\t\t\t\t\n\t\t\t\tTypr.U._drawCFF(font.CharStrings[bind], state,font,pdct,p);\n\t\t\t\tstate.x = adx; state.y = ady;\n\t\t\t\tTypr.U._drawCFF(font.CharStrings[aind], state,font,pdct,p);\n\t\t\t\t\n\t\t\t\t//x=state.x; y=state.y; nStems=state.nStems; haveWidth=state.haveWidth; width=state.width; open=state.open;\n\t\t\t}\n\t\t\tif(open) { Typr.U.P.closePath(p); open=false; }\n\t\t}\t\t\n\t\telse if(v==\"o19\" || v==\"o20\") \n\t\t{ \n\t\t\tvar hasWidthArg;\n\n\t\t\t// The number of stem operators on the stack is always even.\n\t\t\t// If the value is uneven, that means a width is specified.\n\t\t\thasWidthArg = stack.length % 2 !== 0;\n\t\t\tif (hasWidthArg && !haveWidth) {\n\t\t\t\twidth = stack.shift() + pdct.nominalWidthX;\n\t\t\t}\n\n\t\t\tnStems += stack.length >> 1;\n\t\t\tstack.length = 0;\n\t\t\thaveWidth = true;\n\t\t\t\n\t\t\ti += (nStems + 7) >> 3;\n\t\t}\n\t\t\n\t\telse if(v==\"o21\") {\n\t\t\tif (stack.length > 2 && !haveWidth) {\n width = stack.shift() + pdct.nominalWidthX;\n haveWidth = true;\n }\n\n y += stack.pop();\n x += stack.pop();\n\t\t\t\t\t\n\t\t\t\t\tif(open) Typr.U.P.closePath(p);\n Typr.U.P.moveTo(p,x,y); open=true;\n\t\t}\n\t\telse if(v==\"o22\")\n\t\t{\n\t\t\t if (stack.length > 1 && !haveWidth) {\n width = stack.shift() + pdct.nominalWidthX;\n haveWidth = true;\n }\n\t\t\t\t\t\n x += stack.pop();\n\t\t\t\t\t\n\t\t\t\t\tif(open) Typr.U.P.closePath(p);\n\t\t\t\t\tTypr.U.P.moveTo(p,x,y); open=true; \n\t\t}\n\t\telse if(v==\"o25\")\n\t\t{\n\t\t\twhile (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n Typr.U.P.lineTo(p, x, y);\n }\n\n c1x = x + stack.shift();\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y + stack.shift();\n Typr.U.P.curveTo(p, c1x, c1y, c2x, c2y, x, y);\n\t\t}\n\t\telse if(v==\"o26\") \n\t\t{\n\t\t\tif (stack.length % 2) {\n x += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x;\n c1y = y + stack.shift();\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x;\n y = c2y + stack.shift();\n Typr.U.P.curveTo(p, c1x, c1y, c2x, c2y, x, y);\n }\n\n\t\t}\n\t\telse if(v==\"o27\")\n\t\t{\n\t\t\tif (stack.length % 2) {\n y += stack.shift();\n }\n\n while (stack.length > 0) {\n c1x = x + stack.shift();\n c1y = y;\n c2x = c1x + stack.shift();\n c2y = c1y + stack.shift();\n x = c2x + stack.shift();\n y = c2y;\n Typr.U.P.curveTo(p, c1x, c1y, c2x, c2y, x, y);\n }\n\t\t}\n\t\telse if(v==\"o10\" || v==\"o29\")\t// callsubr || callgsubr\n\t\t{\n\t\t\tvar obj = (v==\"o10\" ? pdct : font);\n\t\t\tif(stack.length==0) { console.log(\"error: empty stack\"); }\n\t\t\telse {\n\t\t\t\tvar ind = stack.pop();\n\t\t\t\tvar subr = obj.Subrs[ ind + obj.Bias ];\n\t\t\t\tstate.x=x; state.y=y; state.nStems=nStems; state.haveWidth=haveWidth; state.width=width; state.open=open;\n\t\t\t\tTypr.U._drawCFF(subr, state,font,pdct,p);\n\t\t\t\tx=state.x; y=state.y; nStems=state.nStems; haveWidth=state.haveWidth; width=state.width; open=state.open;\n\t\t\t}\n\t\t}\n\t\telse if(v==\"o30\" || v==\"o31\") // vhcurveto || hvcurveto\n\t\t{\n\t\t\tvar count, count1 = stack.length;\n\t\t\tvar index = 0;\n\t\t\tvar alternate = v == \"o31\";\n\t\t\t\n\t\t\tcount = count1 & ~2;\n\t\t\tindex += count1 - count;\n\t\t\t\n\t\t\twhile ( index < count ) \n\t\t\t{\n\t\t\t\tif(alternate)\n\t\t\t\t{\n\t\t\t\t\tc1x = x + stack.shift();\n\t\t\t\t\tc1y = y;\n\t\t\t\t\tc2x = c1x + stack.shift();\n\t\t\t\t\tc2y = c1y + stack.shift();\n\t\t\t\t\ty = c2y + stack.shift();\n\t\t\t\t\tif(count-index == 5) { x = c2x + stack.shift(); index++; }\n\t\t\t\t\telse x = c2x;\n\t\t\t\t\talternate = false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tc1x = x;\n\t\t\t\t\tc1y = y + stack.shift();\n\t\t\t\t\tc2x = c1x + stack.shift();\n\t\t\t\t\tc2y = c1y + stack.shift();\n\t\t\t\t\tx = c2x + stack.shift();\n\t\t\t\t\tif(count-index == 5) { y = c2y + stack.shift(); index++; }\n\t\t\t\t\telse y = c2y;\n\t\t\t\t\talternate = true;\n\t\t\t\t}\n Typr.U.P.curveTo(p, c1x, c1y, c2x, c2y, x, y);\n\t\t\t\tindex += 4;\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if((v+\"\").charAt(0)==\"o\") { console.log(\"Unknown operation: \"+v, cmds); throw v; }\n\t\telse stack.push(v);\n\t}\n\t//console.log(cmds);\n\tstate.x=x; state.y=y; state.nStems=nStems; state.haveWidth=haveWidth; state.width=width; state.open=open;\n};\n\n// End Typr.U.js\n\nreturn Typr\n\n}", "title": "" }, { "docid": "ac1ff0962ffa64d2aedf9847ca0b111e", "score": "0.4518774", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n const VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n const KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n const LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n const BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n const KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST,\n };\n\n // placeholder for recursive self-reference\n const DEFAULT = {\n keywords: KEYWORDS,\n illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n const NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n const CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n const INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/,\n end: /\\)/,\n keywords: KEYWORDS\n };\n\n const INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n const STRING = {\n className: 'string',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n INTERPOLATION,\n INTERPOLATED_VARIABLE\n ],\n variants: [\n {\n begin: /\\w*\"\"\"/,\n end: /\"\"\"\\w*/,\n relevance: 10\n },\n {\n begin: /\\w*\"/,\n end: /\"\\w*/\n }\n ]\n };\n\n const COMMAND = {\n className: 'string',\n contains: [\n hljs.BACKSLASH_ESCAPE,\n INTERPOLATION,\n INTERPOLATED_VARIABLE\n ],\n begin: '`',\n end: '`'\n };\n\n const MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n const COMMENT = {\n className: 'comment',\n variants: [\n {\n begin: '#=',\n end: '=#',\n relevance: 10\n },\n {\n begin: '#',\n end: '$'\n }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n { begin: /<:/ } // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "ff4ef44c005e6edd08e05881276363f5", "score": "0.4515893", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST,\n };\n\n // placeholder for recursive self-reference\n var DEFAULT = {\n keywords: KEYWORDS, illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/, end: /\\)/,\n keywords: KEYWORDS\n };\n\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [\n { begin: /\\w*\"\"\"/, end: /\"\"\"\\w*/, relevance: 10 },\n { begin: /\\w*\"/, end: /\"\\w*/ }\n ]\n };\n\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`', end: '`'\n };\n\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n var COMMENT = {\n className: 'comment',\n variants: [\n { begin: '#=', end: '=#', relevance: 10 },\n { begin: '#', end: '$' }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n {begin: /<:/} // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "6ad3032a5ee361407cce784b580ee401", "score": "0.4515893", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST.join(\" \"),\n literal: LITERAL_LIST.join(\" \"),\n built_in: BUILT_IN_LIST.join(\" \"),\n };\n\n // placeholder for recursive self-reference\n var DEFAULT = {\n keywords: KEYWORDS, illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/, end: /\\)/,\n keywords: KEYWORDS\n };\n\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [\n { begin: /\\w*\"\"\"/, end: /\"\"\"\\w*/, relevance: 10 },\n { begin: /\\w*\"/, end: /\"\\w*/ }\n ]\n };\n\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`', end: '`'\n };\n\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n var COMMENT = {\n className: 'comment',\n variants: [\n { begin: '#=', end: '=#', relevance: 10 },\n { begin: '#', end: '$' }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n {begin: /<:/} // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "ff4ef44c005e6edd08e05881276363f5", "score": "0.4515893", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST,\n };\n\n // placeholder for recursive self-reference\n var DEFAULT = {\n keywords: KEYWORDS, illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/, end: /\\)/,\n keywords: KEYWORDS\n };\n\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [\n { begin: /\\w*\"\"\"/, end: /\"\"\"\\w*/, relevance: 10 },\n { begin: /\\w*\"/, end: /\"\\w*/ }\n ]\n };\n\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`', end: '`'\n };\n\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n var COMMENT = {\n className: 'comment',\n variants: [\n { begin: '#=', end: '=#', relevance: 10 },\n { begin: '#', end: '$' }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n {begin: /<:/} // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "ff4ef44c005e6edd08e05881276363f5", "score": "0.4515893", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST,\n };\n\n // placeholder for recursive self-reference\n var DEFAULT = {\n keywords: KEYWORDS, illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/, end: /\\)/,\n keywords: KEYWORDS\n };\n\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [\n { begin: /\\w*\"\"\"/, end: /\"\"\"\\w*/, relevance: 10 },\n { begin: /\\w*\"/, end: /\"\\w*/ }\n ]\n };\n\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`', end: '`'\n };\n\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n var COMMENT = {\n className: 'comment',\n variants: [\n { begin: '#=', end: '=#', relevance: 10 },\n { begin: '#', end: '$' }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n {begin: /<:/} // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "ff4ef44c005e6edd08e05881276363f5", "score": "0.4515893", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST,\n };\n\n // placeholder for recursive self-reference\n var DEFAULT = {\n keywords: KEYWORDS, illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/, end: /\\)/,\n keywords: KEYWORDS\n };\n\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [\n { begin: /\\w*\"\"\"/, end: /\"\"\"\\w*/, relevance: 10 },\n { begin: /\\w*\"/, end: /\"\\w*/ }\n ]\n };\n\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`', end: '`'\n };\n\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n var COMMENT = {\n className: 'comment',\n variants: [\n { begin: '#=', end: '=#', relevance: 10 },\n { begin: '#', end: '$' }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n {begin: /<:/} // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "ff4ef44c005e6edd08e05881276363f5", "score": "0.4515893", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*';\n\n // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var KEYWORD_LIST = [\n 'baremodule',\n 'begin',\n 'break',\n 'catch',\n 'ccall',\n 'const',\n 'continue',\n 'do',\n 'else',\n 'elseif',\n 'end',\n 'export',\n 'false',\n 'finally',\n 'for',\n 'function',\n 'global',\n 'if',\n 'import',\n 'in',\n 'isa',\n 'let',\n 'local',\n 'macro',\n 'module',\n 'quote',\n 'return',\n 'true',\n 'try',\n 'using',\n 'where',\n 'while',\n ];\n\n // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var LITERAL_LIST = [\n 'ARGS',\n 'C_NULL',\n 'DEPOT_PATH',\n 'ENDIAN_BOM',\n 'ENV',\n 'Inf',\n 'Inf16',\n 'Inf32',\n 'Inf64',\n 'InsertionSort',\n 'LOAD_PATH',\n 'MergeSort',\n 'NaN',\n 'NaN16',\n 'NaN32',\n 'NaN64',\n 'PROGRAM_FILE',\n 'QuickSort',\n 'RoundDown',\n 'RoundFromZero',\n 'RoundNearest',\n 'RoundNearestTiesAway',\n 'RoundNearestTiesUp',\n 'RoundToZero',\n 'RoundUp',\n 'VERSION|0',\n 'devnull',\n 'false',\n 'im',\n 'missing',\n 'nothing',\n 'pi',\n 'stderr',\n 'stdin',\n 'stdout',\n 'true',\n 'undef',\n 'π',\n 'ℯ',\n ];\n\n // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n var BUILT_IN_LIST = [\n 'AbstractArray',\n 'AbstractChannel',\n 'AbstractChar',\n 'AbstractDict',\n 'AbstractDisplay',\n 'AbstractFloat',\n 'AbstractIrrational',\n 'AbstractMatrix',\n 'AbstractRange',\n 'AbstractSet',\n 'AbstractString',\n 'AbstractUnitRange',\n 'AbstractVecOrMat',\n 'AbstractVector',\n 'Any',\n 'ArgumentError',\n 'Array',\n 'AssertionError',\n 'BigFloat',\n 'BigInt',\n 'BitArray',\n 'BitMatrix',\n 'BitSet',\n 'BitVector',\n 'Bool',\n 'BoundsError',\n 'CapturedException',\n 'CartesianIndex',\n 'CartesianIndices',\n 'Cchar',\n 'Cdouble',\n 'Cfloat',\n 'Channel',\n 'Char',\n 'Cint',\n 'Cintmax_t',\n 'Clong',\n 'Clonglong',\n 'Cmd',\n 'Colon',\n 'Complex',\n 'ComplexF16',\n 'ComplexF32',\n 'ComplexF64',\n 'CompositeException',\n 'Condition',\n 'Cptrdiff_t',\n 'Cshort',\n 'Csize_t',\n 'Cssize_t',\n 'Cstring',\n 'Cuchar',\n 'Cuint',\n 'Cuintmax_t',\n 'Culong',\n 'Culonglong',\n 'Cushort',\n 'Cvoid',\n 'Cwchar_t',\n 'Cwstring',\n 'DataType',\n 'DenseArray',\n 'DenseMatrix',\n 'DenseVecOrMat',\n 'DenseVector',\n 'Dict',\n 'DimensionMismatch',\n 'Dims',\n 'DivideError',\n 'DomainError',\n 'EOFError',\n 'Enum',\n 'ErrorException',\n 'Exception',\n 'ExponentialBackOff',\n 'Expr',\n 'Float16',\n 'Float32',\n 'Float64',\n 'Function',\n 'GlobalRef',\n 'HTML',\n 'IO',\n 'IOBuffer',\n 'IOContext',\n 'IOStream',\n 'IdDict',\n 'IndexCartesian',\n 'IndexLinear',\n 'IndexStyle',\n 'InexactError',\n 'InitError',\n 'Int',\n 'Int128',\n 'Int16',\n 'Int32',\n 'Int64',\n 'Int8',\n 'Integer',\n 'InterruptException',\n 'InvalidStateException',\n 'Irrational',\n 'KeyError',\n 'LinRange',\n 'LineNumberNode',\n 'LinearIndices',\n 'LoadError',\n 'MIME',\n 'Matrix',\n 'Method',\n 'MethodError',\n 'Missing',\n 'MissingException',\n 'Module',\n 'NTuple',\n 'NamedTuple',\n 'Nothing',\n 'Number',\n 'OrdinalRange',\n 'OutOfMemoryError',\n 'OverflowError',\n 'Pair',\n 'PartialQuickSort',\n 'PermutedDimsArray',\n 'Pipe',\n 'ProcessFailedException',\n 'Ptr',\n 'QuoteNode',\n 'Rational',\n 'RawFD',\n 'ReadOnlyMemoryError',\n 'Real',\n 'ReentrantLock',\n 'Ref',\n 'Regex',\n 'RegexMatch',\n 'RoundingMode',\n 'SegmentationFault',\n 'Set',\n 'Signed',\n 'Some',\n 'StackOverflowError',\n 'StepRange',\n 'StepRangeLen',\n 'StridedArray',\n 'StridedMatrix',\n 'StridedVecOrMat',\n 'StridedVector',\n 'String',\n 'StringIndexError',\n 'SubArray',\n 'SubString',\n 'SubstitutionString',\n 'Symbol',\n 'SystemError',\n 'Task',\n 'TaskFailedException',\n 'Text',\n 'TextDisplay',\n 'Timer',\n 'Tuple',\n 'Type',\n 'TypeError',\n 'TypeVar',\n 'UInt',\n 'UInt128',\n 'UInt16',\n 'UInt32',\n 'UInt64',\n 'UInt8',\n 'UndefInitializer',\n 'UndefKeywordError',\n 'UndefRefError',\n 'UndefVarError',\n 'Union',\n 'UnionAll',\n 'UnitRange',\n 'Unsigned',\n 'Val',\n 'Vararg',\n 'VecElement',\n 'VecOrMat',\n 'Vector',\n 'VersionNumber',\n 'WeakKeyDict',\n 'WeakRef',\n ];\n\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST,\n };\n\n // placeholder for recursive self-reference\n var DEFAULT = {\n keywords: KEYWORDS, illegal: /<\\//\n };\n\n // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/, end: /\\)/,\n keywords: KEYWORDS\n };\n\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n };\n\n // TODO: neatly escape normal code in string literal\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [\n { begin: /\\w*\"\"\"/, end: /\"\"\"\\w*/, relevance: 10 },\n { begin: /\\w*\"/, end: /\"\\w*/ }\n ]\n };\n\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`', end: '`'\n };\n\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n\n var COMMENT = {\n className: 'comment',\n variants: [\n { begin: '#=', end: '=#', relevance: 10 },\n { begin: '#', end: '$' }\n ]\n };\n\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [\n NUMBER,\n CHAR,\n STRING,\n COMMAND,\n MACROCALL,\n COMMENT,\n hljs.HASH_COMMENT_MODE,\n {\n className: 'keyword',\n begin:\n '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n },\n {begin: /<:/} // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n\n return DEFAULT;\n}", "title": "" }, { "docid": "fa33d7b7fbe1f3988ec32b253aeb5c66", "score": "0.44817662", "text": "function get_ah_mapping() {\n\n return {\n \"type_arttype_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"title_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"creator_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"coverage_temporal_styleperiod_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"date_created_workdate_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"date_timeperiod_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"description_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"subject_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"format_medium_materialdisplay_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"identifier_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"identifier_master_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"instructor_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"title_alternative_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"source_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"contributor_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"date_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"description_detail_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"format_extent_measurements_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"source_pagenumber_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"coverage_spatial_repository_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"coverage_spatial_collection_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"coverage_spatial_repositoryid_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"coverage_spatial_location_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"rights_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"rights_accessRights_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"rights_license_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"rightsholder_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"creator_alternative_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"description_creatorbio_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"description_nationality_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"description_role_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"coverage_temporal_lifedates_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n },\n \"description_source_t\": {\n \"type\": \"text\",\n \"fields\": {\n \"keyword\": {\n \"type\": \"keyword\",\n \"ignore_above\": 256\n }\n }\n }\n };\n}", "title": "" }, { "docid": "b7e8635790a10c16ee4482d6c0d3f0f4", "score": "0.44404384", "text": "function julia(hljs) {\n // Since there are numerous special names in Julia, it is too much trouble\n // to maintain them by hand. Hence these names (i.e. keywords, literals and\n // built-ins) are automatically generated from Julia 1.5.2 itself through\n // the following scripts for each.\n // ref: https://docs.julialang.org/en/v1/manual/variables/#Allowed-Variable-Names\n var VARIABLE_NAME_RE = '[A-Za-z_\\\\u00A1-\\\\uFFFF][A-Za-z_0-9\\\\u00A1-\\\\uFFFF]*'; // # keyword generator, multi-word keywords handled manually below (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"in\", \"isa\", \"where\"]\n // for kw in collect(x.keyword for x in REPLCompletions.complete_keyword(\"\"))\n // if !(contains(kw, \" \") || kw == \"struct\")\n // push!(res, kw)\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n\n var KEYWORD_LIST = ['baremodule', 'begin', 'break', 'catch', 'ccall', 'const', 'continue', 'do', 'else', 'elseif', 'end', 'export', 'false', 'finally', 'for', 'function', 'global', 'if', 'import', 'in', 'isa', 'let', 'local', 'macro', 'module', 'quote', 'return', 'true', 'try', 'using', 'where', 'while']; // # literal generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[\"true\", \"false\"]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if !(v isa Function || v isa Type || v isa TypeVar || v isa Module || v isa Colon)\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n\n var LITERAL_LIST = ['ARGS', 'C_NULL', 'DEPOT_PATH', 'ENDIAN_BOM', 'ENV', 'Inf', 'Inf16', 'Inf32', 'Inf64', 'InsertionSort', 'LOAD_PATH', 'MergeSort', 'NaN', 'NaN16', 'NaN32', 'NaN64', 'PROGRAM_FILE', 'QuickSort', 'RoundDown', 'RoundFromZero', 'RoundNearest', 'RoundNearestTiesAway', 'RoundNearestTiesUp', 'RoundToZero', 'RoundUp', 'VERSION|0', 'devnull', 'false', 'im', 'missing', 'nothing', 'pi', 'stderr', 'stdin', 'stdout', 'true', 'undef', 'π', 'ℯ']; // # built_in generator (Julia 1.5.2)\n // import REPL.REPLCompletions\n // res = String[]\n // for compl in filter!(x -> isa(x, REPLCompletions.ModuleCompletion) && (x.parent === Base || x.parent === Core),\n // REPLCompletions.completions(\"\", 0)[1])\n // try\n // v = eval(Symbol(compl.mod))\n // if (v isa Type || v isa TypeVar) && (compl.mod != \"=>\")\n // push!(res, compl.mod)\n // end\n // catch e\n // end\n // end\n // sort!(unique!(res))\n // foreach(x -> println(\"\\'\", x, \"\\',\"), res)\n\n var BUILT_IN_LIST = ['AbstractArray', 'AbstractChannel', 'AbstractChar', 'AbstractDict', 'AbstractDisplay', 'AbstractFloat', 'AbstractIrrational', 'AbstractMatrix', 'AbstractRange', 'AbstractSet', 'AbstractString', 'AbstractUnitRange', 'AbstractVecOrMat', 'AbstractVector', 'Any', 'ArgumentError', 'Array', 'AssertionError', 'BigFloat', 'BigInt', 'BitArray', 'BitMatrix', 'BitSet', 'BitVector', 'Bool', 'BoundsError', 'CapturedException', 'CartesianIndex', 'CartesianIndices', 'Cchar', 'Cdouble', 'Cfloat', 'Channel', 'Char', 'Cint', 'Cintmax_t', 'Clong', 'Clonglong', 'Cmd', 'Colon', 'Complex', 'ComplexF16', 'ComplexF32', 'ComplexF64', 'CompositeException', 'Condition', 'Cptrdiff_t', 'Cshort', 'Csize_t', 'Cssize_t', 'Cstring', 'Cuchar', 'Cuint', 'Cuintmax_t', 'Culong', 'Culonglong', 'Cushort', 'Cvoid', 'Cwchar_t', 'Cwstring', 'DataType', 'DenseArray', 'DenseMatrix', 'DenseVecOrMat', 'DenseVector', 'Dict', 'DimensionMismatch', 'Dims', 'DivideError', 'DomainError', 'EOFError', 'Enum', 'ErrorException', 'Exception', 'ExponentialBackOff', 'Expr', 'Float16', 'Float32', 'Float64', 'Function', 'GlobalRef', 'HTML', 'IO', 'IOBuffer', 'IOContext', 'IOStream', 'IdDict', 'IndexCartesian', 'IndexLinear', 'IndexStyle', 'InexactError', 'InitError', 'Int', 'Int128', 'Int16', 'Int32', 'Int64', 'Int8', 'Integer', 'InterruptException', 'InvalidStateException', 'Irrational', 'KeyError', 'LinRange', 'LineNumberNode', 'LinearIndices', 'LoadError', 'MIME', 'Matrix', 'Method', 'MethodError', 'Missing', 'MissingException', 'Module', 'NTuple', 'NamedTuple', 'Nothing', 'Number', 'OrdinalRange', 'OutOfMemoryError', 'OverflowError', 'Pair', 'PartialQuickSort', 'PermutedDimsArray', 'Pipe', 'ProcessFailedException', 'Ptr', 'QuoteNode', 'Rational', 'RawFD', 'ReadOnlyMemoryError', 'Real', 'ReentrantLock', 'Ref', 'Regex', 'RegexMatch', 'RoundingMode', 'SegmentationFault', 'Set', 'Signed', 'Some', 'StackOverflowError', 'StepRange', 'StepRangeLen', 'StridedArray', 'StridedMatrix', 'StridedVecOrMat', 'StridedVector', 'String', 'StringIndexError', 'SubArray', 'SubString', 'SubstitutionString', 'Symbol', 'SystemError', 'Task', 'TaskFailedException', 'Text', 'TextDisplay', 'Timer', 'Tuple', 'Type', 'TypeError', 'TypeVar', 'UInt', 'UInt128', 'UInt16', 'UInt32', 'UInt64', 'UInt8', 'UndefInitializer', 'UndefKeywordError', 'UndefRefError', 'UndefVarError', 'Union', 'UnionAll', 'UnitRange', 'Unsigned', 'Val', 'Vararg', 'VecElement', 'VecOrMat', 'Vector', 'VersionNumber', 'WeakKeyDict', 'WeakRef'];\n var KEYWORDS = {\n $pattern: VARIABLE_NAME_RE,\n keyword: KEYWORD_LIST,\n literal: LITERAL_LIST,\n built_in: BUILT_IN_LIST\n }; // placeholder for recursive self-reference\n\n var DEFAULT = {\n keywords: KEYWORDS,\n illegal: /<\\//\n }; // ref: https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/\n\n var NUMBER = {\n className: 'number',\n // supported numeric literals:\n // * binary literal (e.g. 0x10)\n // * octal literal (e.g. 0o76543210)\n // * hexadecimal literal (e.g. 0xfedcba876543210)\n // * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)\n // * decimal literal (e.g. 9876543210, 100_000_000)\n // * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)\n begin: /(\\b0x[\\d_]*(\\.[\\d_]*)?|0x\\.\\d[\\d_]*)p[-+]?\\d+|\\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\\b\\d[\\d_]*(\\.[\\d_]*)?|\\.\\d[\\d_]*)([eEfF][-+]?\\d+)?/,\n relevance: 0\n };\n var CHAR = {\n className: 'string',\n begin: /'(.|\\\\[xXuU][a-zA-Z0-9]+)'/\n };\n var INTERPOLATION = {\n className: 'subst',\n begin: /\\$\\(/,\n end: /\\)/,\n keywords: KEYWORDS\n };\n var INTERPOLATED_VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + VARIABLE_NAME_RE\n }; // TODO: neatly escape normal code in string literal\n\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n variants: [{\n begin: /\\w*\"\"\"/,\n end: /\"\"\"\\w*/,\n relevance: 10\n }, {\n begin: /\\w*\"/,\n end: /\"\\w*/\n }]\n };\n var COMMAND = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, INTERPOLATION, INTERPOLATED_VARIABLE],\n begin: '`',\n end: '`'\n };\n var MACROCALL = {\n className: 'meta',\n begin: '@' + VARIABLE_NAME_RE\n };\n var COMMENT = {\n className: 'comment',\n variants: [{\n begin: '#=',\n end: '=#',\n relevance: 10\n }, {\n begin: '#',\n end: '$'\n }]\n };\n DEFAULT.name = 'Julia';\n DEFAULT.contains = [NUMBER, CHAR, STRING, COMMAND, MACROCALL, COMMENT, hljs.HASH_COMMENT_MODE, {\n className: 'keyword',\n begin: '\\\\b(((abstract|primitive)\\\\s+)type|(mutable\\\\s+)?struct)\\\\b'\n }, {\n begin: /<:/\n } // relevance booster\n ];\n INTERPOLATION.contains = DEFAULT.contains;\n return DEFAULT;\n }", "title": "" }, { "docid": "902393bbcd5eec5c47cc2b15766f822b", "score": "0.44281593", "text": "function generateAllTypes(tables) {\n //Forming GraphQL database\n let allTypes = '<span class=\"hljs-name\">const</span> <span class=\"hljs-attribute\">typeDefs</span> = <span class=\"hljs-string\">`\\n';\n //Forming GraphQL Query\n let tableQuery = ` type Query {\\n`;\n //Forming type mutation\n let typeMutation = ` type Mutation {\\n`;\n let mutationResolvers = ` Mutation: {\\n`;\n const [baseTables, joinTables] = sortTables(tables);\n const allJoinConnections = joinConnections(joinTables);\n let resolvers = '<span class=\"hljs-name\">const</span> <span class=\"hljs-attribute\">resolvers</span> = {\\n';\n let objectResolvers = '';\n baseTables.forEach((table) => {\n allTypes += `${tableToType(table, allJoinConnections[table.name])}\\n\\n`;\n tableQuery += ` ${mapConnection(table.name)}\\n`;\n typeMutation += `${createObjMutations(table)}\\n`;\n resolvers += ` ${generateResolverFunc(table.name)}\\n`;\n mutationResolvers += `${generateMutationResolvers(table.name)}\\n`;\n objectResolvers += `${generateObjectResolver(table, allJoinConnections[table.name])}\\n`;\n });\n resolvers += objectResolvers + mutationResolvers + ' }\\n' + '}';\n const exportText = `module.exports = {\\n typeDefs,\\n resolvers\\n}`;\n return [allTypes + '\\n' + tableQuery + ' }\\n\\n' + typeMutation + ' }\\n' + '}`</span>\\n\\n', resolvers, '\\n\\n' + exportText];\n}", "title": "" }, { "docid": "93a18c5b44316014ae7bd3dc4da0193f", "score": "0.4422459", "text": "function writeDefs() {\n return sclang.interpret(\n `\n var descs = Dictionary.new;\n SynthDescLib.default.synthDescs\n .keysValuesDo({ arg defName, synthDesc;\n synthDesc.def.writeDefFile(\"` +\n dest +\n `\");\n descs[defName] = synthDesc.asJSON();\n });\n descs\n `\n );\n }", "title": "" }, { "docid": "b5ed14bbd541564e31fe14ec3351bfe5", "score": "0.4388974", "text": "function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(typeName, allTypeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(suggestedTypes), node.name));\n }\n }\n}", "title": "" }, { "docid": "b5ed14bbd541564e31fe14ec3351bfe5", "score": "0.4388974", "text": "function PossibleTypeExtensionsRule(context) {\n var schema = context.getSchema();\n var definedTypes = Object.create(null);\n\n for (var _i2 = 0, _context$getDocument$2 = context.getDocument().definitions; _i2 < _context$getDocument$2.length; _i2++) {\n var def = _context$getDocument$2[_i2];\n\n if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_6__[\"isTypeDefinitionNode\"])(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension\n };\n\n function checkExtension(node) {\n var typeName = node.name.value;\n var defNode = definedTypes[typeName];\n var existingType = schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n var expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n var kindStr = extensionKindToTypeName(node.kind);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Cannot extend non-\".concat(kindStr, \" type \\\"\").concat(typeName, \"\\\".\"), defNode ? [defNode, node] : node));\n }\n } else {\n var allTypeNames = Object.keys(definedTypes);\n\n if (schema) {\n allTypeNames = allTypeNames.concat(Object.keys(schema.getTypeMap()));\n }\n\n var suggestedTypes = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(typeName, allTypeNames);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_4__[\"GraphQLError\"](\"Cannot extend type \\\"\".concat(typeName, \"\\\" because it is not defined.\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(suggestedTypes), node.name));\n }\n }\n}", "title": "" }, { "docid": "92362fc8b7325163faabdb973f0df44d", "score": "0.4387953", "text": "function LoadHL7Schema() {\n\t// exit if the editor is not active\n\tvar activeEditor = vscode.window.activeTextEditor;\n\tvar supportedSchemas = [\"2.1\", \"2.2\", \"2.3\", \"2.3.1\", \"2.4\", \"2.5\", \"2.5.1\", \"2.6\", \"2.7\", \"2.7.1\"];\n\tvar hl7SchemaTooltip = \"\";\n\tconst defaultSchemaVersion = \"2.7.1\";\n\tvar hl7Version = defaultSchemaVersion;\n\n\tif (!activeEditor) {\n\t\treturn;\n\t}\n\telse {\n\t\t// search for the first line starting with MSH. Extract the HL7 version info from this first header segment found \n\t\tvar currentMessage = activeEditor.document.getText();\n\t\tvar hl7HeaderRegex = /^MSH.+$/im;\n\t\tvar result = hl7HeaderRegex.exec(currentMessage);\n\n\t\tif (result != null) {\n\t\t\thl7Version = result[0].split(delimiters.FIELD)[11];\n\t\t\tif (supportedSchemas.includes(hl7Version)) {\n\t\t\t\thl7SchemaTooltip = \"HL7 v\" + hl7Version + \" (auto detected)\";\n\t\t\t}\n\t\t\t// HL7 version detected is not supported (more recent than current schema definitions known by this extension)\n\t\t\telse {\n\t\t\t\thl7Version = defaultSchemaVersion;\n\t\t\t\thl7SchemaTooltip = \"HL7 version detected is not supported. Defaulting to v\" + hl7Version;\n\t\t\t}\n\t\t}\n\t\t// Hl7 version not detected. Default to the most recent schema known by the extension \n\t\telse {\n\t\t\thl7Version = defaultSchemaVersion;\n\t\t\thl7SchemaTooltip = \"HL7 version not detected. Defaulting to v\" + hl7Version;\n\t\t}\n\t\t// load the schema based on the HL7 version detected\n\t\thl7Schema = require('./schema/' + hl7Version + '/segments.js');\n\t\thl7Fields = require('./schema/' + hl7Version + '/fields.js');\n\t\t// show HL7 version in status bar\n\t\tstatusbarHL7Version.color = 'white';\n\t\tstatusbarHL7Version.text = \"$(info) HL7 schema: v\" + hl7Version; // $(info) - GitHub Octicon - https://octicons.github.com/\n\t\tstatusbarHL7Version.tooltip = hl7SchemaTooltip;\n\t\tstatusbarHL7Version.show();\n\n\t\t// load custom segment schemas\n\t\tpreferences = new extensionPreferencesClass.ExtensionPreferences();\n\t\tif (preferences.CustomSegmentSchema != '') {\n\t\t\tif (fs.existsSync(preferences.CustomSegmentSchema)) {\n\t\t\t\tcustomSchema = require(preferences.CustomSegmentSchema);\n\t\t\t\thl7Schema = { ...hl7Schema, ...customSchema } // append the custom segments\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvscode.window.showWarningMessage(\"Could not load the custom schema file: \" + preferences.CustomSegmentSchema);\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "04cdd91c91845d1caa8b09ea37b42833", "score": "0.4382361", "text": "generateTypedef(name, def) {\n this.scope.define(name, {\n spec_path: def.$path,\n });\n\n if (def.type === 'object') {\n const properties = {};\n\n if (def.properties) {\n for (const name of Object.keys(def.properties)) {\n if (name === '$path') continue;\n\n const prop = def.properties[name];\n const deref = this.spec.dereference(prop);\n\n properties[name] = {\n type: this.resolveSchemaType(prop),\n jsdoc: deref.description,\n }\n }\n }\n\n this.typedefs.push({\n type: 'object',\n name,\n description: def.description || '',\n properties,\n });\n } else if (def.type === 'array') {\n this.typedefs.push({\n type: 'array',\n name,\n item: this.resolveSchemaType(def.items),\n });\n } else if (def.type === 'string' && def.enum) {\n this.typedefs.push({\n type: 'enum',\n name,\n variants: def.enum.map((v) => `'${v}'`),\n });\n } else if (def.allOf) {\n this.typedefs.push({\n type: 'union',\n name,\n members: def.allOf.map((v, i) => this.resolveSchemaType(v, `${name}UnionMember${i}`)),\n });\n }\n\n return name;\n }", "title": "" }, { "docid": "ab25e294ad45f7018b62486bb8ca0c60", "score": "0.43813702", "text": "function startCompilation(){\n current_function = 'main';\n // functions_table = {'hello':[0, ['integer', 'boolean'], 'string']};\n functions_table = {};\n // functions_call_table = [['hello', q_index, ['integer', 'boolean'], 'string']];\n functions_call_table = [];\n function_params_array = [];\n reserved_words = {\n '+': 0, '-': 1, '*': 2, '÷': 3, '==': 4, '<': 5,\n '>': 6, '<=': 7, '>=': 8, '!=': 9, 'and': 10,\n 'or': 11, '=': 12, 'print': 13, 'say': 14, 'move': 15,\n 'turn': 16, 'if': 17, 'else': 18, 'repeat': 19, 'do': 20,\n 'while': 21, 'end': 22, 'var': 23, 'wall_in_front': 24, 'function': 25,\n 'begin': 26, 'params': 27, 'no_params': 28, 'integer': 29, 'float': 30,\n 'string': 31, 'boolean': 32, 'gotoFunk': 33, 'Return': 34, 'Begin': 35,\n 'End': 36, 'gotoF': 37, 'goto': 38, 'gotoV': 39, 'on_goal': 40, 'not': 41\n };\n param_vars = {\n 'integer': [],\n 'float': [],\n 'string': [],\n 'boolean': []\n };\n int_vars = {\n 'global': [],\n 'local': [],\n 'temporal': []\n };\n\n float_vars = {\n 'global': [],\n 'local': [],\n 'temporal': []\n };\n\n string_vars = {\n 'global': [],\n 'local': [],\n 'temporal': []\n };\n\n boolean_vars = {\n 'global': [],\n 'local': [],\n 'temporal': []\n };\n\n quadruples = [];\n\n proc_table = {};\n}", "title": "" }, { "docid": "b2d5ed85fe63b1cac8b96e35dedd9251", "score": "0.4355499", "text": "function Yh(){}", "title": "" }, { "docid": "520e9fb69b4d4bc096e35fb5a9efb611", "score": "0.43458393", "text": "function registerTypeDefinitionProvider(languageId,provider){return modes.TypeDefinitionProviderRegistry.register(languageId,provider);}", "title": "" }, { "docid": "666707dae66346202841eba2924d1c4a", "score": "0.43416214", "text": "function PossibleTypeExtensionsRule(context) {\n const schema = context.getSchema();\n const definedTypes = Object.create(null);\n\n for (const def of context.getDocument().definitions) {\n if ((0,_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_0__.isTypeDefinitionNode)(def)) {\n definedTypes[def.name.value] = def;\n }\n }\n\n return {\n ScalarTypeExtension: checkExtension,\n ObjectTypeExtension: checkExtension,\n InterfaceTypeExtension: checkExtension,\n UnionTypeExtension: checkExtension,\n EnumTypeExtension: checkExtension,\n InputObjectTypeExtension: checkExtension,\n };\n\n function checkExtension(node) {\n const typeName = node.name.value;\n const defNode = definedTypes[typeName];\n const existingType =\n schema === null || schema === void 0 ? void 0 : schema.getType(typeName);\n let expectedKind;\n\n if (defNode) {\n expectedKind = defKindToExtKind[defNode.kind];\n } else if (existingType) {\n expectedKind = typeToExtKind(existingType);\n }\n\n if (expectedKind) {\n if (expectedKind !== node.kind) {\n const kindStr = extensionKindToTypeName(node.kind);\n context.reportError(\n new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(`Cannot extend non-${kindStr} type \"${typeName}\".`, {\n nodes: defNode ? [defNode, node] : node,\n }),\n );\n }\n } else {\n const allTypeNames = Object.keys({\n ...definedTypes,\n ...(schema === null || schema === void 0\n ? void 0\n : schema.getTypeMap()),\n });\n const suggestedTypes = (0,_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_2__.suggestionList)(typeName, allTypeNames);\n context.reportError(\n new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_1__.GraphQLError(\n `Cannot extend type \"${typeName}\" because it is not defined.` +\n (0,_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__.didYouMean)(suggestedTypes),\n {\n nodes: node.name,\n },\n ),\n );\n }\n }\n}", "title": "" }, { "docid": "067893ec4fb9cf20a88cab945ef72e14", "score": "0.43408293", "text": "function grammar_generate(type, name, length) {\n var grammar = \"\";\n switch (type) {\n case 'VARCHAR':\n grammar = \"VARCHAR\";\n break;\n case 'TINYINT':\n grammar = \"TINYINT\";\n break;\n case 'SMALLINT':\n grammar = \"SMALLINT\";\n break;\n case 'MEDIUMINT':\n grammar = \"MEDIUMINT\";\n break;\n case 'INT':\n grammar = \"INT\";\n break;\n case 'BIGINT':\n grammar = \"BIGINT\";\n break;\n case 'DECIMAL':\n grammar = \"DECIMAL\";\n break;\n case 'FLOAT':\n grammar = \"FLOAT\";\n break;\n case 'DOUBLE':\n grammar = \"DOUBLE\";\n break;\n case 'REAL':\n grammar = \"REAL\";\n break;\n case 'BIT':\n grammar = \"BIT\";\n break;\n case 'BOOLEAN':\n grammar = \"BOOLEAN\";\n break;\n case 'SERIAL':\n grammar = \"SERIAL\";\n break;\n case 'FOREIGN':\n grammar = \"FOREIGN KEY\";\n break;\n case 'DECIMAL':\n grammar = \"DECIMAL\";\n break;\n\n //DHONI\n case 'FLOAT':\n grammar = \"FLOAT\";\n break;\n case 'DOUBLE':\n grammar = \"DOUBLE\";\n break;\n case 'REAL':\n grammar = \"REAL\";\n break;\n case 'BIT':\n grammar = \"BIT\";\n break;\n case 'BOOLEAN':\n grammar = \"BOOLEAN\";\n break;\n case 'SERIAL':\n grammar = \"SERIAL\";\n break;\n\n //date&time\n case 'DATE':\n grammar = \"DATE\";\n break;\n case 'DATETIME':\n grammar = \"DATETIME\";\n break;\n case 'TIMESTAMP':\n grammar = \"TIMESTAMP\";\n break;\n case 'TIME':\n grammar = \"TIME\";\n break;\n case 'YEAR':\n grammar = \"YEAR\";\n break;\n\n //STRING\n case 'CHAR':\n grammar = \"CHAR\";\n break;\n case 'VARCHAR':\n grammar = \"VARCHAR\";\n break;\n case 'TINYTEXT':\n grammar = \"TINYTEXT\";\n break;\n case 'TEXT':\n grammar = \"TEXT\";\n break;\n case 'MEDIUMTEXT':\n grammar = \"MEDIUMTEXT\";\n break;\n case 'LONGTEXT':\n grammar = \"LONGTEXT\";\n break;\n case 'BINARY':\n grammar = \"BINARY\";\n break;\n case 'VARBINARY':\n grammar = \"VARBINARY\";\n break;\n case 'TINYBLOB':\n grammar = \"TINYBLOB\";\n break;\n case 'MEDIUMBLOB':\n grammar = \"MEDIUMBLOB\";\n break;\n case 'BLOB':\n grammar = \"BLOB\";\n break;\n case 'LONGBLOB':\n grammar = \"LONGBLOB\";\n break;\n case 'ENUM':\n grammar = \"ENUM\";\n break;\n case 'SET':\n grammar = \"SET\";\n break;\n\n //SPATIAL\n case 'GEOMETRY':\n grammar = \"GEOMETRY\";\n break;\n case 'POINT':\n grammar = \"POINT\";\n break;\n case 'LINESTRING':\n grammar = \"LINESTRING\";\n break;\n case 'POLYGON':\n grammar = \"POLYGON\";\n break;\n case 'MULTIPOINT':\n grammar = \"MULTIPOINT\";\n break;\n case 'MULTILINESTRING':\n grammar = \"MULTILINESTRING\";\n break;\n case 'MULTIPOLYGON':\n grammar = \"MULTIPOLYGON\";\n break;\n case 'GEOMETRYCOLLECTION':\n grammar = \"GEOMETRYCOLLECTION\";\n break;\n\n\n\n default:\n return null;\n break;\n }\n\n if (length != null) {\n return name + \" \" + grammar + \"(\" + length + \")\";\n }\n\n //check if column relation \n if (grammar == 'FOREIGN KEY') {\n return grammar + \" (\" + name + \")\";\n }\n\n //Default syntax alter column\n return name + \" \" + grammar;\n}", "title": "" }, { "docid": "a3341521c9f660ebd34f868b9d62df24", "score": "0.43356365", "text": "function get_schema(res_def_type){\n os_server = {\n \t \"res_name\": \"textbox\",\n \"flavor\" : \"combobox\",\n \"image\": \"combobox\",\n \"count\": \"textbox\",\n \"keypair\": \"combobox\",\n \"network\": \"textbox\"\n\t};\n aws_ec2 = {\n \t \"res_name\": \"textbox\",\n \t \"region\": \"combobox\",\n \"flavor\": \"combobox\",\n \"count\": \"textbox\",\n \"keypair\": \"combobox\",\n \"security_group\": \"combobox\"\n };\n gcloud_gce = {\n \t \"res_name\": \"textbox\",\n \"flavor\": \"combobox\",\n \"region\": \"combobox\",\n \"image\": \"combobox\",\n \"count\": \"textbox\"\n };\n duffy = {\n \t \"res_name\": \"textbox\",\n \"version\": \"textbox\",\n \"arch\": \"textbox\",\n \"count\": \"textbox\"\n };\n aws_s3 = {\n \t \"res_name\": \"textbox\",\n \"region\": \"combobox\",\n \"permission\": \"combobox\"\n };\n os_heat = {\n \"res_name\": \"textbox\",\n \"template_path\": \"textbox\"\n };\n os_keypair = {\n \"res_name\": \"textbox\",\n \"public_key_path\": \"textbox\"\n };\n aws_ec2_key = {\n \"res_name\": \"textbox\",\n \"region\": \"combobox\",\n };\n aws_cfn = {\n \"res_name\":\"textbox\" ,\n \"region\": \"combobox\",\n \"template\": \"combobox\",\n \"disable_rollback\": \"combobox\"\n };\n os_volume = {\n \"res_name\": \"textbox\",\n \"count\": \"textbox\",\n \"size\": \"textbox\"\n };\n os_object = {\n \"res_name\": \"textbox\",\n \"count\": \"textbox\",\n \"access\": \"combobox\"\n };\n libvirt = {\n \"res_name\": \"textbox\",\n \"xml\": \"textbox\",\n \"uri\": \"textbox\"\n };\n rax_server = {\n \"image\": \"combobox\",\n \"count\": \"textbox\",\n \"keypair\": \"combobox\",\n \"region\": \"combobox\",\n \"res_name\": \"textbox\"\n };\n schema_dict = {\n \"os_server\": os_server,\n \"aws_ec2\": aws_ec2,\n \"gcloud_gce\": gcloud_gce,\n \"duffy\": duffy,\n \"aws_s3\": aws_s3,\n \"os_heat\": os_heat,\n \"os_keypair\": os_keypair,\n \"aws_ec2_key\": aws_ec2_key,\n \"aws_cfn\": aws_cfn,\n \"os_volume\": os_volume,\n \"os_object\": os_object,\n \"libvirt\": libvirt,\n \"rax_server\": rax_server\n }\n\treturn schema_dict[res_def_type]\n}", "title": "" }, { "docid": "8496005d5fe5e64f050ef980ab36340d", "score": "0.43240815", "text": "function gutsDescriptor () {\n\t//\n\tthis.mainJar\t=\t'${mainJar}';\n\tthis.appClass\t=\t'${appClass}';\n\tthis.appletClass=\t'${appletClass}';\n\t//\n\tthis.finalName\t=\t'${project.build.finalName}';\n\tthis.groupId\t=\t'${project.groupId}';\n\tthis.artifactId\t=\t'${project.artifactId}';\n\tthis.version\t=\t'${project.version}';\n\tthis.timeStamp\t=\t'${timestamp}' ;\n\t//\n}", "title": "" }, { "docid": "f2974ee1ef44ff6186c8a232136231b0", "score": "0.4318084", "text": "function typed(typesig, raw){\n\t// ---- Initialize implicit variables\n\tvar types = new Array();\n\ttypes = typeAst(typesig);\n\tif (arguments[3] === undefined) {\n\t\tvar params = parameterAst(raw);\n\t\targuments[2] = params.length;\n\t\targuments[3] = [];\n\t}\n\tif (arguments[4] === undefined) {\n\t\targuments[4] = false;\n\t}\n\tvar postDeclaration = arguments[4];\n\tvar arity = arguments[2];\n\tif (!(arity === (types.length - 1)) && !postDeclaration) {\n\t\treturn new Error(\"Function definition does not match type signature\");\n\t}\n\tvar args = arguments[3];\n\t// ---- End Initialize implicit variables\n\n\tfunction func(next){\n\t\tvar nexts = new Array();\n\t\tfor (k in arguments) {if (!(k === undefined)) {nexts.push(arguments[k]);}}\n\t\tvar newTypes = cloneArray(types);\n\t\tvar failed = false;\n\t\t// Simple typecheck of applied parameters\n\t\tnexts.forEach(function(e,i,k){\n\t\t\tif (!(type(e) === newTypes[i])) { //check each parameter type\n\t\t\t\tfailed = true;\n\t\t\t} else {\n\t\t\t\tnewTypes = newTypes.slice(1,newTypes.length);\n\t\t\t}\n\t\t});\n\t\tif (failed) {return new Error(\"Parameter(s) does not match type signature\");}\n\t\tvar newArgs = cloneArray(args);\n\t\tnexts.forEach(function(e){newArgs.push(e);});\n\n\t\t// Ready for computing\n\t\tif (newArgs.length === arity) {\n\t\t\tvar result = raw.apply(undefined, newArgs);\n\t\t\tif (!(type(result) === newTypes[0])) { //check result type\n\t\t\t\treturn new Error(\"Result \" + result + \" does not match type signature\");\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t} else {\n\t\t\t// Print new type signature\n\t\t\tvar renderedTypes = renderTypeSig(newTypes);\n\t\t\treturn Ughh.typed(renderedTypes, raw, arity, newArgs, true);\n\t\t}\n\t}\n\tfunc.typeSig = renderTypeSig(types);\n\treturn func;\n}", "title": "" }, { "docid": "b595050e974b04b3e68e4de6d11b4d26", "score": "0.43037358", "text": "Analysis_ExtDef(left, right) {\n // 定义变量\n if (right.length === 3) {\n // 目前symbol_list的末尾是Specifier <ID> ;,由此找到Specifier和<ID>\n let specifier = this.symbolList[this.symbolList.length - 3];\n let identifier = this.symbolList[this.symbolList.length - 2];\n\n let existed = false;\n let currentTable = this.tables[this.currentTableStack[this.currentTableStack.length - 1]];\n if (currentTable.findSymbol(identifier.value) !== -1) {\n console.log('变量 %s 重定义 【row = %d】', identifier.value, identifier.row);\n process.exit(-1);\n }\n\n // 将这一变量加入table\n let variable = new IdentifierInfo(IdentifierType.Variable, specifier.value, identifier.value);\n // 加入table\n this.tables[this.currentTableStack[this.currentTableStack.length - 1]].addSymbol(variable);\n\n // 更新symbolList\n let count = right.length;\n while (count--) {\n this.symbolList.pop();\n }\n this.symbolList.push(new SemanticSymbol(left, identifier.value, identifier.row, -1,\n this.currentTableStack[this.currentTableStack.length - 1],\n this.tables[this.currentTableStack[this.currentTableStack.length - 1]].table.length - 1));\n }\n // 定义函数\n else {\n let identifier = this.symbolList[this.symbolList.length - 2];\n // 退出作用域\n this.currentTableStack.pop();\n // 更新symbolList\n let count = right.length;\n while (count--) {\n this.symbolList.pop();\n }\n this.symbolList.push(new SemanticSymbol(left, identifier.value, identifier.row, -1,\n identifier.tableIdx, identifier.index));\n }\n }", "title": "" }, { "docid": "f24923ad90002c024ec145a164831215", "score": "0.43027344", "text": "function emitCtsType(type) {\n if (type == null) {\n write(\"null\");\n }\n else if (type.flags & ts.TypeFlags.String ||\n type.flags & ts.TypeFlags.StringLiteral) {\n write(\"String\");\n }\n else if (type.flags & ts.TypeFlags.Number) {\n write(\"Number\");\n }\n else if (type.symbol && type.symbol.flags & ts.SymbolFlags.Declare) {\n if (type.symbol.parent && type.symbol.parent.flags & ts.SymbolFlags.Declare) {\n write(\"$$cts$$brand$$\" + type.symbol.parent.name + \".prototype\");\n }\n else {\n write(\"$$cts$$brand$$\" + type.symbol.name);\n }\n }\n else if (type.flags & ts.TypeFlags.Null) {\n emitCtsRt(\"Null\");\n }\n else if (type.flags & ts.TypeFlags.Undefined) {\n emitCtsRt(\"Undefined\");\n }\n else if (type.flags & ts.TypeFlags.Intersection) {\n write(\"(new \");\n emitCtsRt(\"IntersectionType\");\n write(\"(\");\n var types = type.types;\n for (var i = 0; i < types.length; i++) {\n emitCtsType(types[i].baseType || types[i]);\n if (i !== types.length - 1)\n write(\", \");\n }\n write(\"))\");\n }\n else if (type.flags & ts.TypeFlags.Union) {\n write(\"(new \");\n emitCtsRt(\"UnionType\");\n write(\"(\");\n var types = type.types;\n for (var i = 0; i < types.length; i++) {\n emitCtsType(types[i].baseType || types[i]);\n if (i !== types.length - 1)\n write(\", \");\n }\n write(\"))\");\n }\n else if (type.flags & ts.TypeFlags.Concrete) {\n emitCtsType(type.baseType);\n }\n else if (type.flags & ts.TypeFlags.Boolean) {\n write(\"Boolean\");\n }\n else if (type.symbol) {\n // FIXME\n write(type.symbol.name);\n }\n else {\n console.log(type);\n throw new Error(\"Cannot create dynamic type check!\");\n }\n }", "title": "" }, { "docid": "ace01130dfc9053880eb26ce83c323b8", "score": "0.4302008", "text": "function generateJS(ast, options) {\n // These only indent non-empty lines to avoid trailing whitespace.\n function indent2(code) { return code.replace(/^(.+)$/gm, \" $1\"); }\n\n function l(i) { return \"peg$c\" + i; } // |literals[i]| of the abstract machine\n function r(i) { return \"peg$r\" + i; } // |classes[i]| of the abstract machine\n function e(i) { return \"peg$e\" + i; } // |expectations[i]| of the abstract machine\n function f(i) { return \"peg$f\" + i; } // |actions[i]| of the abstract machine\n\n function generateTables() {\n function buildLiteral(literal) {\n return \"\\\"\" + stringEscape(literal) + \"\\\"\";\n }\n\n function buildRegexp(cls) {\n return \"/^[\"\n + (cls.inverted ? \"^\" : \"\")\n + cls.value.map(part =>\n Array.isArray(part)\n ? regexpClassEscape(part[0])\n + \"-\"\n + regexpClassEscape(part[1])\n : regexpClassEscape(part)\n ).join(\"\")\n + \"]/\" + (cls.ignoreCase ? \"i\" : \"\");\n }\n\n function buildExpectation(e) {\n switch (e.type) {\n case \"rule\": {\n return \"peg$otherExpectation(\\\"\" + stringEscape(e.value) + \"\\\")\";\n }\n case \"literal\": {\n return \"peg$literalExpectation(\\\"\"\n + stringEscape(e.value)\n + \"\\\", \"\n + e.ignoreCase\n + \")\";\n }\n case \"class\": {\n const parts = e.value.map(part =>\n Array.isArray(part)\n ? \"[\\\"\" + stringEscape(part[0]) + \"\\\", \\\"\" + stringEscape(part[1]) + \"\\\"]\"\n : \"\\\"\" + stringEscape(part) + \"\\\"\"\n ).join(\", \");\n\n return \"peg$classExpectation([\"\n + parts + \"], \"\n + e.inverted + \", \"\n + e.ignoreCase\n + \")\";\n }\n case \"any\": return \"peg$anyExpectation()\";\n default: throw new Error(\"Unknown expectation type (\" + JSON.stringify(e) + \")\");\n }\n }\n\n function buildFunc(a) {\n return \"function(\" + a.params.join(\", \") + \") {\"\n + a.body\n + \"}\";\n }\n\n return ast.literals.map(\n (c, i) => \"var \" + l(i) + \" = \" + buildLiteral(c) + \";\"\n ).concat(\"\", ast.classes.map(\n (c, i) => \"var \" + r(i) + \" = \" + buildRegexp(c) + \";\"\n )).concat(\"\", ast.expectations.map(\n (c, i) => \"var \" + e(i) + \" = \" + buildExpectation(c) + \";\"\n )).concat(\"\", ast.functions.map(\n (c, i) => \"var \" + f(i) + \" = \" + buildFunc(c) + \";\"\n )).join(\"\\n\");\n }\n\n function generateRuleHeader(ruleNameCode, ruleIndexCode) {\n const parts = [];\n\n parts.push(\"\");\n\n if (options.trace) {\n parts.push([\n \"peg$tracer.trace({\",\n \" type: \\\"rule.enter\\\",\",\n \" rule: \" + ruleNameCode + \",\",\n \" location: peg$computeLocation(startPos, startPos)\",\n \"});\",\n \"\"\n ].join(\"\\n\"));\n }\n\n if (options.cache) {\n parts.push([\n \"var key = peg$currPos * \" + ast.rules.length + \" + \" + ruleIndexCode + \";\",\n \"var cached = peg$resultsCache[key];\",\n \"\",\n \"if (cached) {\",\n \" peg$currPos = cached.nextPos;\",\n \"\"\n ].join(\"\\n\"));\n\n if (options.trace) {\n parts.push([\n \"if (cached.result !== peg$FAILED) {\",\n \" peg$tracer.trace({\",\n \" type: \\\"rule.match\\\",\",\n \" rule: \" + ruleNameCode + \",\",\n \" result: cached.result,\",\n \" location: peg$computeLocation(startPos, peg$currPos)\",\n \" });\",\n \"} else {\",\n \" peg$tracer.trace({\",\n \" type: \\\"rule.fail\\\",\",\n \" rule: \" + ruleNameCode + \",\",\n \" location: peg$computeLocation(startPos, startPos)\",\n \" });\",\n \"}\",\n \"\"\n ].join(\"\\n\"));\n }\n\n parts.push([\n \" return cached.result;\",\n \"}\",\n \"\"\n ].join(\"\\n\"));\n }\n\n return parts.join(\"\\n\");\n }\n\n function generateRuleFooter(ruleNameCode, resultCode) {\n const parts = [];\n\n if (options.cache) {\n parts.push([\n \"\",\n \"peg$resultsCache[key] = { nextPos: peg$currPos, result: \" + resultCode + \" };\"\n ].join(\"\\n\"));\n }\n\n if (options.trace) {\n parts.push([\n \"\",\n \"if (\" + resultCode + \" !== peg$FAILED) {\",\n \" peg$tracer.trace({\",\n \" type: \\\"rule.match\\\",\",\n \" rule: \" + ruleNameCode + \",\",\n \" result: \" + resultCode + \",\",\n \" location: peg$computeLocation(startPos, peg$currPos)\",\n \" });\",\n \"} else {\",\n \" peg$tracer.trace({\",\n \" type: \\\"rule.fail\\\",\",\n \" rule: \" + ruleNameCode + \",\",\n \" location: peg$computeLocation(startPos, startPos)\",\n \" });\",\n \"}\"\n ].join(\"\\n\"));\n }\n\n parts.push([\n \"\",\n \"return \" + resultCode + \";\"\n ].join(\"\\n\"));\n\n return parts.join(\"\\n\");\n }\n\n function generateRuleFunction(rule) {\n const parts = [];\n const stack = new Stack(rule.name, \"s\", \"var\");\n\n function compile(bc) {\n let ip = 0;\n const end = bc.length;\n const parts = [];\n let value;\n\n function compileCondition(cond, argCount) {\n const baseLength = argCount + 3;\n const thenLength = bc[ip + baseLength - 2];\n const elseLength = bc[ip + baseLength - 1];\n let thenCode, elseCode;\n\n stack.checkedIf(ip,\n () => {\n ip += baseLength;\n thenCode = compile(bc.slice(ip, ip + thenLength));\n ip += thenLength;\n },\n elseLength > 0 ? () => {\n elseCode = compile(bc.slice(ip, ip + elseLength));\n ip += elseLength;\n } : null\n );\n\n parts.push(\"if (\" + cond + \") {\");\n parts.push(indent2(thenCode));\n if (elseLength > 0) {\n parts.push(\"} else {\");\n parts.push(indent2(elseCode));\n }\n parts.push(\"}\");\n }\n\n function compileLoop(cond) {\n const baseLength = 2;\n const bodyLength = bc[ip + baseLength - 1];\n let bodyCode;\n\n stack.checkedLoop(ip, () => {\n ip += baseLength;\n bodyCode = compile(bc.slice(ip, ip + bodyLength));\n ip += bodyLength;\n });\n\n parts.push(\"while (\" + cond + \") {\");\n parts.push(indent2(bodyCode));\n parts.push(\"}\");\n }\n\n function compileCall() {\n const baseLength = 4;\n const paramsLength = bc[ip + baseLength - 1];\n\n const value = f(bc[ip + 1]) + \"(\"\n + bc.slice(ip + baseLength, ip + baseLength + paramsLength).map(\n p => stack.index(p)\n ).join(\", \")\n + \")\";\n stack.pop(bc[ip + 2]);\n parts.push(stack.push(value));\n ip += baseLength + paramsLength;\n }\n\n while (ip < end) {\n switch (bc[ip]) {\n case op.PUSH_EMPTY_STRING: // PUSH_EMPTY_STRING\n parts.push(stack.push(\"''\"));\n ip++;\n break;\n\n case op.PUSH_CURR_POS: // PUSH_CURR_POS\n parts.push(stack.push(\"peg$currPos\"));\n ip++;\n break;\n\n case op.PUSH_UNDEFINED: // PUSH_UNDEFINED\n parts.push(stack.push(\"undefined\"));\n ip++;\n break;\n\n case op.PUSH_NULL: // PUSH_NULL\n parts.push(stack.push(\"null\"));\n ip++;\n break;\n\n case op.PUSH_FAILED: // PUSH_FAILED\n parts.push(stack.push(\"peg$FAILED\"));\n ip++;\n break;\n\n case op.PUSH_EMPTY_ARRAY: // PUSH_EMPTY_ARRAY\n parts.push(stack.push(\"[]\"));\n ip++;\n break;\n\n case op.POP: // POP\n stack.pop();\n ip++;\n break;\n\n case op.POP_CURR_POS: // POP_CURR_POS\n parts.push(\"peg$currPos = \" + stack.pop() + \";\");\n ip++;\n break;\n\n case op.POP_N: // POP_N n\n stack.pop(bc[ip + 1]);\n ip += 2;\n break;\n\n case op.NIP: // NIP\n value = stack.pop();\n stack.pop();\n parts.push(stack.push(value));\n ip++;\n break;\n\n case op.APPEND: // APPEND\n value = stack.pop();\n parts.push(stack.top() + \".push(\" + value + \");\");\n ip++;\n break;\n\n case op.WRAP: // WRAP n\n parts.push(\n // @ts-expect-error pop() returns array if argument is specified\n stack.push(\"[\" + stack.pop(bc[ip + 1]).join(\", \") + \"]\")\n );\n ip += 2;\n break;\n\n case op.TEXT: // TEXT\n parts.push(\n stack.push(\"input.substring(\" + stack.pop() + \", peg$currPos)\")\n );\n ip++;\n break;\n\n case op.PLUCK: { // PLUCK n, k, p1, ..., pK\n const baseLength = 3;\n const paramsLength = bc[ip + baseLength - 1];\n const n = baseLength + paramsLength;\n value = bc.slice(ip + baseLength, ip + n);\n value = paramsLength === 1\n ? stack.index(value[0])\n : `[ ${\n value.map(p => stack.index(p)).join(\", \")\n } ]`;\n stack.pop(bc[ip + 1]);\n parts.push(stack.push(value));\n ip += n;\n break;\n }\n\n case op.IF: // IF t, f\n compileCondition(stack.top(), 0);\n break;\n\n case op.IF_ERROR: // IF_ERROR t, f\n compileCondition(stack.top() + \" === peg$FAILED\", 0);\n break;\n\n case op.IF_NOT_ERROR: // IF_NOT_ERROR t, f\n compileCondition(stack.top() + \" !== peg$FAILED\", 0);\n break;\n\n case op.WHILE_NOT_ERROR: // WHILE_NOT_ERROR b\n compileLoop(stack.top() + \" !== peg$FAILED\");\n break;\n\n case op.MATCH_ANY: // MATCH_ANY a, f, ...\n compileCondition(\"input.length > peg$currPos\", 0);\n break;\n\n case op.MATCH_STRING: // MATCH_STRING s, a, f, ...\n compileCondition(\n ast.literals[bc[ip + 1]].length > 1\n ? \"input.substr(peg$currPos, \"\n + ast.literals[bc[ip + 1]].length\n + \") === \"\n + l(bc[ip + 1])\n : \"input.charCodeAt(peg$currPos) === \"\n + ast.literals[bc[ip + 1]].charCodeAt(0),\n 1\n );\n break;\n\n case op.MATCH_STRING_IC: // MATCH_STRING_IC s, a, f, ...\n compileCondition(\n \"input.substr(peg$currPos, \"\n + ast.literals[bc[ip + 1]].length\n + \").toLowerCase() === \"\n + l(bc[ip + 1]),\n 1\n );\n break;\n\n case op.MATCH_CHAR_CLASS: // MATCH_CHAR_CLASS c, a, f, ...\n compileCondition(\n r(bc[ip + 1]) + \".test(input.charAt(peg$currPos))\",\n 1\n );\n break;\n\n case op.ACCEPT_N: // ACCEPT_N n\n parts.push(stack.push(\n bc[ip + 1] > 1\n ? \"input.substr(peg$currPos, \" + bc[ip + 1] + \")\"\n : \"input.charAt(peg$currPos)\"\n ));\n parts.push(\n bc[ip + 1] > 1\n ? \"peg$currPos += \" + bc[ip + 1] + \";\"\n : \"peg$currPos++;\"\n );\n ip += 2;\n break;\n\n case op.ACCEPT_STRING: // ACCEPT_STRING s\n parts.push(stack.push(l(bc[ip + 1])));\n parts.push(\n ast.literals[bc[ip + 1]].length > 1\n ? \"peg$currPos += \" + ast.literals[bc[ip + 1]].length + \";\"\n : \"peg$currPos++;\"\n );\n ip += 2;\n break;\n\n case op.FAIL: // FAIL e\n parts.push(stack.push(\"peg$FAILED\"));\n parts.push(\"if (peg$silentFails === 0) { peg$fail(\" + e(bc[ip + 1]) + \"); }\");\n ip += 2;\n break;\n\n case op.LOAD_SAVED_POS: // LOAD_SAVED_POS p\n parts.push(\"peg$savedPos = \" + stack.index(bc[ip + 1]) + \";\");\n ip += 2;\n break;\n\n case op.UPDATE_SAVED_POS: // UPDATE_SAVED_POS\n parts.push(\"peg$savedPos = peg$currPos;\");\n ip++;\n break;\n\n case op.CALL: // CALL f, n, pc, p1, p2, ..., pN\n compileCall();\n break;\n\n case op.RULE: // RULE r\n parts.push(stack.push(\"peg$parse\" + ast.rules[bc[ip + 1]].name + \"()\"));\n ip += 2;\n break;\n\n case op.SILENT_FAILS_ON: // SILENT_FAILS_ON\n parts.push(\"peg$silentFails++;\");\n ip++;\n break;\n\n case op.SILENT_FAILS_OFF: // SILENT_FAILS_OFF\n parts.push(\"peg$silentFails--;\");\n ip++;\n break;\n\n default:\n throw new Error(\"Invalid opcode: \" + bc[ip] + \".\");\n }\n }\n\n return parts.join(\"\\n\");\n }\n\n const code = compile(rule.bytecode);\n\n parts.push(\"function peg$parse\" + rule.name + \"() {\");\n\n if (options.trace) {\n parts.push(\" var startPos = peg$currPos;\");\n }\n\n parts.push(indent2(stack.defines()));\n\n parts.push(indent2(generateRuleHeader(\n \"\\\"\" + stringEscape(rule.name) + \"\\\"\",\n asts.indexOfRule(ast, rule.name)\n )));\n parts.push(indent2(code));\n parts.push(indent2(generateRuleFooter(\n \"\\\"\" + stringEscape(rule.name) + \"\\\"\",\n stack.result()\n )));\n\n parts.push(\"}\");\n\n return parts.join(\"\\n\");\n }\n\n function generateToplevel() {\n const parts = [];\n\n if (ast.topLevelInitializer) {\n parts.push(ast.topLevelInitializer.code);\n parts.push(\"\");\n }\n\n parts.push([\n \"function peg$subclass(child, parent) {\",\n \" function C() { this.constructor = child; }\",\n \" C.prototype = parent.prototype;\",\n \" child.prototype = new C();\",\n \"}\",\n \"\",\n \"function peg$SyntaxError(message, expected, found, location) {\",\n \" var self = Error.call(this, message);\",\n \" if (Object.setPrototypeOf) {\",\n \" Object.setPrototypeOf(self, peg$SyntaxError.prototype);\",\n \" }\",\n \" self.expected = expected;\",\n \" self.found = found;\",\n \" self.location = location;\",\n \" self.name = \\\"SyntaxError\\\";\",\n \" return self;\",\n \"}\",\n \"\",\n \"peg$subclass(peg$SyntaxError, Error);\",\n \"\",\n \"function peg$padEnd(str, targetLength, padString) {\",\n \" padString = padString || \\\" \\\";\",\n \" if (str.length > targetLength) { return str; }\",\n \" targetLength -= str.length;\",\n \" padString += padString.repeat(targetLength);\",\n \" return str + padString.slice(0, targetLength);\",\n \"}\",\n \"\",\n \"peg$SyntaxError.prototype.format = function(sources) {\",\n \" var str = \\\"Error: \\\" + this.message;\",\n \" if (this.location) {\",\n \" var src = null;\",\n \" var k;\",\n \" for (k = 0; k < sources.length; k++) {\",\n \" if (sources[k].source === this.location.source) {\",\n \" src = sources[k].text.split(/\\\\r\\\\n|\\\\n|\\\\r/g);\",\n \" break;\",\n \" }\",\n \" }\",\n \" var s = this.location.start;\",\n \" var loc = this.location.source + \\\":\\\" + s.line + \\\":\\\" + s.column;\",\n \" if (src) {\",\n \" var e = this.location.end;\",\n \" var filler = peg$padEnd(\\\"\\\", s.line.toString().length);\",\n \" var line = src[s.line - 1];\",\n \" var last = s.line === e.line ? e.column : line.length + 1;\",\n \" str += \\\"\\\\n --> \\\" + loc + \\\"\\\\n\\\"\",\n \" + filler + \\\" |\\\\n\\\"\",\n \" + s.line + \\\" | \\\" + line + \\\"\\\\n\\\"\",\n \" + filler + \\\" | \\\" + peg$padEnd(\\\"\\\", s.column - 1)\",\n \" + peg$padEnd(\\\"\\\", last - s.column, \\\"^\\\");\",\n \" } else {\",\n \" str += \\\"\\\\n at \\\" + loc;\",\n \" }\",\n \" }\",\n \" return str;\",\n \"};\",\n \"\",\n \"peg$SyntaxError.buildMessage = function(expected, found) {\",\n \" var DESCRIBE_EXPECTATION_FNS = {\",\n \" literal: function(expectation) {\",\n \" return \\\"\\\\\\\"\\\" + literalEscape(expectation.text) + \\\"\\\\\\\"\\\";\",\n \" },\",\n \"\",\n \" class: function(expectation) {\",\n \" var escapedParts = expectation.parts.map(function(part) {\",\n \" return Array.isArray(part)\",\n \" ? classEscape(part[0]) + \\\"-\\\" + classEscape(part[1])\",\n \" : classEscape(part);\",\n \" });\",\n \"\",\n \" return \\\"[\\\" + (expectation.inverted ? \\\"^\\\" : \\\"\\\") + escapedParts + \\\"]\\\";\",\n \" },\",\n \"\",\n \" any: function() {\",\n \" return \\\"any character\\\";\",\n \" },\",\n \"\",\n \" end: function() {\",\n \" return \\\"end of input\\\";\",\n \" },\",\n \"\",\n \" other: function(expectation) {\",\n \" return expectation.description;\",\n \" }\",\n \" };\",\n \"\",\n \" function hex(ch) {\",\n \" return ch.charCodeAt(0).toString(16).toUpperCase();\",\n \" }\",\n \"\",\n \" function literalEscape(s) {\",\n \" return s\",\n \" .replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\")\", // backslash\n \" .replace(/\\\"/g, \\\"\\\\\\\\\\\\\\\"\\\")\", // closing double quote\n \" .replace(/\\\\0/g, \\\"\\\\\\\\0\\\")\", // null\n \" .replace(/\\\\t/g, \\\"\\\\\\\\t\\\")\", // horizontal tab\n \" .replace(/\\\\n/g, \\\"\\\\\\\\n\\\")\", // line feed\n \" .replace(/\\\\r/g, \\\"\\\\\\\\r\\\")\", // carriage return\n \" .replace(/[\\\\x00-\\\\x0F]/g, function(ch) { return \\\"\\\\\\\\x0\\\" + hex(ch); })\",\n \" .replace(/[\\\\x10-\\\\x1F\\\\x7F-\\\\x9F]/g, function(ch) { return \\\"\\\\\\\\x\\\" + hex(ch); });\",\n \" }\",\n \"\",\n \" function classEscape(s) {\",\n \" return s\",\n \" .replace(/\\\\\\\\/g, \\\"\\\\\\\\\\\\\\\\\\\")\", // backslash\n \" .replace(/\\\\]/g, \\\"\\\\\\\\]\\\")\", // closing bracket\n \" .replace(/\\\\^/g, \\\"\\\\\\\\^\\\")\", // caret\n \" .replace(/-/g, \\\"\\\\\\\\-\\\")\", // dash\n \" .replace(/\\\\0/g, \\\"\\\\\\\\0\\\")\", // null\n \" .replace(/\\\\t/g, \\\"\\\\\\\\t\\\")\", // horizontal tab\n \" .replace(/\\\\n/g, \\\"\\\\\\\\n\\\")\", // line feed\n \" .replace(/\\\\r/g, \\\"\\\\\\\\r\\\")\", // carriage return\n \" .replace(/[\\\\x00-\\\\x0F]/g, function(ch) { return \\\"\\\\\\\\x0\\\" + hex(ch); })\",\n \" .replace(/[\\\\x10-\\\\x1F\\\\x7F-\\\\x9F]/g, function(ch) { return \\\"\\\\\\\\x\\\" + hex(ch); });\",\n \" }\",\n \"\",\n \" function describeExpectation(expectation) {\",\n \" return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\",\n \" }\",\n \"\",\n \" function describeExpected(expected) {\",\n \" var descriptions = expected.map(describeExpectation);\",\n \" var i, j;\",\n \"\",\n \" descriptions.sort();\",\n \"\",\n \" if (descriptions.length > 0) {\",\n \" for (i = 1, j = 1; i < descriptions.length; i++) {\",\n \" if (descriptions[i - 1] !== descriptions[i]) {\",\n \" descriptions[j] = descriptions[i];\",\n \" j++;\",\n \" }\",\n \" }\",\n \" descriptions.length = j;\",\n \" }\",\n \"\",\n \" switch (descriptions.length) {\",\n \" case 1:\",\n \" return descriptions[0];\",\n \"\",\n \" case 2:\",\n \" return descriptions[0] + \\\" or \\\" + descriptions[1];\",\n \"\",\n \" default:\",\n \" return descriptions.slice(0, -1).join(\\\", \\\")\",\n \" + \\\", or \\\"\",\n \" + descriptions[descriptions.length - 1];\",\n \" }\",\n \" }\",\n \"\",\n \" function describeFound(found) {\",\n \" return found ? \\\"\\\\\\\"\\\" + literalEscape(found) + \\\"\\\\\\\"\\\" : \\\"end of input\\\";\",\n \" }\",\n \"\",\n \" return \\\"Expected \\\" + describeExpected(expected) + \\\" but \\\" + describeFound(found) + \\\" found.\\\";\",\n \"};\",\n \"\"\n ].join(\"\\n\"));\n\n if (options.trace) {\n parts.push([\n \"function peg$DefaultTracer() {\",\n \" this.indentLevel = 0;\",\n \"}\",\n \"\",\n \"peg$DefaultTracer.prototype.trace = function(event) {\",\n \" var that = this;\",\n \"\",\n \" function log(event) {\",\n \" function repeat(string, n) {\",\n \" var result = \\\"\\\", i;\",\n \"\",\n \" for (i = 0; i < n; i++) {\",\n \" result += string;\",\n \" }\",\n \"\",\n \" return result;\",\n \" }\",\n \"\",\n \" function pad(string, length) {\",\n \" return string + repeat(\\\" \\\", length - string.length);\",\n \" }\",\n \"\",\n \" if (typeof console === \\\"object\\\") {\", // IE 8-10\n \" console.log(\",\n \" event.location.start.line + \\\":\\\" + event.location.start.column + \\\"-\\\"\",\n \" + event.location.end.line + \\\":\\\" + event.location.end.column + \\\" \\\"\",\n \" + pad(event.type, 10) + \\\" \\\"\",\n \" + repeat(\\\" \\\", that.indentLevel) + event.rule\",\n \" );\",\n \" }\",\n \" }\",\n \"\",\n \" switch (event.type) {\",\n \" case \\\"rule.enter\\\":\",\n \" log(event);\",\n \" this.indentLevel++;\",\n \" break;\",\n \"\",\n \" case \\\"rule.match\\\":\",\n \" this.indentLevel--;\",\n \" log(event);\",\n \" break;\",\n \"\",\n \" case \\\"rule.fail\\\":\",\n \" this.indentLevel--;\",\n \" log(event);\",\n \" break;\",\n \"\",\n \" default:\",\n \" throw new Error(\\\"Invalid event type: \\\" + event.type + \\\".\\\");\",\n \" }\",\n \"};\",\n \"\"\n ].join(\"\\n\"));\n }\n\n const startRuleFunctions = \"{ \"\n + options.allowedStartRules.map(\n r => r + \": peg$parse\" + r\n ).join(\", \")\n + \" }\";\n const startRuleFunction = \"peg$parse\" + options.allowedStartRules[0];\n\n parts.push([\n \"function peg$parse(input, options) {\",\n \" options = options !== undefined ? options : {};\",\n \"\",\n \" var peg$FAILED = {};\",\n \" var peg$source = options.grammarSource;\",\n \"\",\n \" var peg$startRuleFunctions = \" + startRuleFunctions + \";\",\n \" var peg$startRuleFunction = \" + startRuleFunction + \";\",\n \"\",\n indent2(generateTables()),\n \"\",\n \" var peg$currPos = 0;\",\n \" var peg$savedPos = 0;\",\n \" var peg$posDetailsCache = [{ line: 1, column: 1 }];\",\n \" var peg$maxFailPos = 0;\",\n \" var peg$maxFailExpected = [];\",\n \" var peg$silentFails = 0;\", // 0 = report failures, > 0 = silence failures\n \"\"\n ].join(\"\\n\"));\n\n if (options.cache) {\n parts.push([\n \" var peg$resultsCache = {};\",\n \"\"\n ].join(\"\\n\"));\n }\n\n if (options.trace) {\n parts.push([\n \" var peg$tracer = \\\"tracer\\\" in options ? options.tracer : new peg$DefaultTracer();\",\n \"\"\n ].join(\"\\n\"));\n }\n\n parts.push([\n \" var peg$result;\",\n \"\",\n \" if (\\\"startRule\\\" in options) {\",\n \" if (!(options.startRule in peg$startRuleFunctions)) {\",\n \" throw new Error(\\\"Can't start parsing from rule \\\\\\\"\\\" + options.startRule + \\\"\\\\\\\".\\\");\",\n \" }\",\n \"\",\n \" peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\",\n \" }\",\n \"\",\n \" function text() {\",\n \" return input.substring(peg$savedPos, peg$currPos);\",\n \" }\",\n \"\",\n \" function offset() {\",\n \" return peg$savedPos;\",\n \" }\",\n \"\",\n \" function range() {\",\n \" return {\",\n \" source: peg$source,\",\n \" start: peg$savedPos,\",\n \" end: peg$currPos\",\n \" };\",\n \" }\",\n \"\",\n \" function location() {\",\n \" return peg$computeLocation(peg$savedPos, peg$currPos);\",\n \" }\",\n \"\",\n \" function expected(description, location) {\",\n \" location = location !== undefined\",\n \" ? location\",\n \" : peg$computeLocation(peg$savedPos, peg$currPos);\",\n \"\",\n \" throw peg$buildStructuredError(\",\n \" [peg$otherExpectation(description)],\",\n \" input.substring(peg$savedPos, peg$currPos),\",\n \" location\",\n \" );\",\n \" }\",\n \"\",\n \" function error(message, location) {\",\n \" location = location !== undefined\",\n \" ? location\",\n \" : peg$computeLocation(peg$savedPos, peg$currPos);\",\n \"\",\n \" throw peg$buildSimpleError(message, location);\",\n \" }\",\n \"\",\n \" function peg$literalExpectation(text, ignoreCase) {\",\n \" return { type: \\\"literal\\\", text: text, ignoreCase: ignoreCase };\",\n \" }\",\n \"\",\n \" function peg$classExpectation(parts, inverted, ignoreCase) {\",\n \" return { type: \\\"class\\\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\",\n \" }\",\n \"\",\n \" function peg$anyExpectation() {\",\n \" return { type: \\\"any\\\" };\",\n \" }\",\n \"\",\n \" function peg$endExpectation() {\",\n \" return { type: \\\"end\\\" };\",\n \" }\",\n \"\",\n \" function peg$otherExpectation(description) {\",\n \" return { type: \\\"other\\\", description: description };\",\n \" }\",\n \"\",\n \" function peg$computePosDetails(pos) {\",\n \" var details = peg$posDetailsCache[pos];\",\n \" var p;\",\n \"\",\n \" if (details) {\",\n \" return details;\",\n \" } else {\",\n \" p = pos - 1;\",\n \" while (!peg$posDetailsCache[p]) {\",\n \" p--;\",\n \" }\",\n \"\",\n \" details = peg$posDetailsCache[p];\",\n \" details = {\",\n \" line: details.line,\",\n \" column: details.column\",\n \" };\",\n \"\",\n \" while (p < pos) {\",\n \" if (input.charCodeAt(p) === 10) {\",\n \" details.line++;\",\n \" details.column = 1;\",\n \" } else {\",\n \" details.column++;\",\n \" }\",\n \"\",\n \" p++;\",\n \" }\",\n \"\",\n \" peg$posDetailsCache[pos] = details;\",\n \"\",\n \" return details;\",\n \" }\",\n \" }\",\n \"\",\n \" function peg$computeLocation(startPos, endPos) {\",\n \" var startPosDetails = peg$computePosDetails(startPos);\",\n \" var endPosDetails = peg$computePosDetails(endPos);\",\n \"\",\n \" return {\",\n \" source: peg$source,\",\n \" start: {\",\n \" offset: startPos,\",\n \" line: startPosDetails.line,\",\n \" column: startPosDetails.column\",\n \" },\",\n \" end: {\",\n \" offset: endPos,\",\n \" line: endPosDetails.line,\",\n \" column: endPosDetails.column\",\n \" }\",\n \" };\",\n \" }\",\n \"\",\n \" function peg$fail(expected) {\",\n \" if (peg$currPos < peg$maxFailPos) { return; }\",\n \"\",\n \" if (peg$currPos > peg$maxFailPos) {\",\n \" peg$maxFailPos = peg$currPos;\",\n \" peg$maxFailExpected = [];\",\n \" }\",\n \"\",\n \" peg$maxFailExpected.push(expected);\",\n \" }\",\n \"\",\n \" function peg$buildSimpleError(message, location) {\",\n \" return new peg$SyntaxError(message, null, null, location);\",\n \" }\",\n \"\",\n \" function peg$buildStructuredError(expected, found, location) {\",\n \" return new peg$SyntaxError(\",\n \" peg$SyntaxError.buildMessage(expected, found),\",\n \" expected,\",\n \" found,\",\n \" location\",\n \" );\",\n \" }\",\n \"\"\n ].join(\"\\n\"));\n\n ast.rules.forEach(rule => {\n parts.push(indent2(generateRuleFunction(rule)));\n parts.push(\"\");\n });\n\n if (ast.initializer) {\n parts.push(indent2(ast.initializer.code));\n parts.push(\"\");\n }\n\n parts.push([\n \" peg$result = peg$startRuleFunction();\",\n \"\",\n \" if (peg$result !== peg$FAILED && peg$currPos === input.length) {\",\n \" return peg$result;\",\n \" } else {\",\n \" if (peg$result !== peg$FAILED && peg$currPos < input.length) {\",\n \" peg$fail(peg$endExpectation());\",\n \" }\",\n \"\",\n \" throw peg$buildStructuredError(\",\n \" peg$maxFailExpected,\",\n \" peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\",\n \" peg$maxFailPos < input.length\",\n \" ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\",\n \" : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\",\n \" );\",\n \" }\",\n \"}\"\n ].join(\"\\n\"));\n\n return parts.join(\"\\n\");\n }\n\n function generateWrapper(toplevelCode) {\n function generateGeneratedByComment() {\n return [\n `// Generated by Peggy ${VERSION}.`,\n \"//\",\n \"// https://peggyjs.org/\"\n ].join(\"\\n\");\n }\n\n function generateParserObject() {\n return options.trace\n ? [\n \"{\",\n \" SyntaxError: peg$SyntaxError,\",\n \" DefaultTracer: peg$DefaultTracer,\",\n \" parse: peg$parse\",\n \"}\"\n ].join(\"\\n\")\n : [\n \"{\",\n \" SyntaxError: peg$SyntaxError,\",\n \" parse: peg$parse\",\n \"}\"\n ].join(\"\\n\");\n }\n\n function generateParserExports() {\n return options.trace\n ? [\n \"{\",\n \" peg$SyntaxError as SyntaxError,\",\n \" peg$DefaultTracer as DefaultTracer,\",\n \" peg$parse as parse\",\n \"}\"\n ].join(\"\\n\")\n : [\n \"{\",\n \" peg$SyntaxError as SyntaxError,\",\n \" peg$parse as parse\",\n \"}\"\n ].join(\"\\n\");\n }\n\n const generators = {\n bare() {\n return [\n generateGeneratedByComment(),\n \"(function() {\",\n \" \\\"use strict\\\";\",\n \"\",\n indent2(toplevelCode),\n \"\",\n indent2(\"return \" + generateParserObject() + \";\"),\n \"})()\"\n ].join(\"\\n\");\n },\n\n commonjs() {\n const parts = [];\n const dependencyVars = Object.keys(options.dependencies);\n\n parts.push([\n generateGeneratedByComment(),\n \"\",\n \"\\\"use strict\\\";\",\n \"\"\n ].join(\"\\n\"));\n\n if (dependencyVars.length > 0) {\n dependencyVars.forEach(variable => {\n parts.push(\"var \" + variable\n + \" = require(\\\"\"\n + stringEscape(options.dependencies[variable])\n + \"\\\");\"\n );\n });\n parts.push(\"\");\n }\n\n parts.push([\n toplevelCode,\n \"\",\n \"module.exports = \" + generateParserObject() + \";\",\n \"\"\n ].join(\"\\n\"));\n\n return parts.join(\"\\n\");\n },\n\n es() {\n const parts = [];\n const dependencyVars = Object.keys(options.dependencies);\n\n parts.push(\n generateGeneratedByComment(),\n \"\"\n );\n\n if (dependencyVars.length > 0) {\n dependencyVars.forEach(variable => {\n parts.push(\"import \" + variable\n + \" from \\\"\"\n + stringEscape(options.dependencies[variable])\n + \"\\\";\"\n );\n });\n parts.push(\"\");\n }\n\n parts.push(\n toplevelCode,\n \"\",\n \"export \" + generateParserExports() + \";\",\n \"\"\n );\n\n return parts.join(\"\\n\");\n },\n\n amd() {\n const dependencyVars = Object.keys(options.dependencies);\n const dependencyIds = dependencyVars.map(v => options.dependencies[v]);\n const dependencies = \"[\"\n + dependencyIds.map(\n id => \"\\\"\" + stringEscape(id) + \"\\\"\"\n ).join(\", \")\n + \"]\";\n const params = dependencyVars.join(\", \");\n\n return [\n generateGeneratedByComment(),\n \"define(\" + dependencies + \", function(\" + params + \") {\",\n \" \\\"use strict\\\";\",\n \"\",\n indent2(toplevelCode),\n \"\",\n indent2(\"return \" + generateParserObject() + \";\"),\n \"});\",\n \"\"\n ].join(\"\\n\");\n },\n\n globals() {\n return [\n generateGeneratedByComment(),\n \"(function(root) {\",\n \" \\\"use strict\\\";\",\n \"\",\n indent2(toplevelCode),\n \"\",\n indent2(\"root.\" + options.exportVar + \" = \" + generateParserObject() + \";\"),\n \"})(this);\",\n \"\"\n ].join(\"\\n\");\n },\n\n umd() {\n const parts = [];\n const dependencyVars = Object.keys(options.dependencies);\n const dependencyIds = dependencyVars.map(v => options.dependencies[v]);\n const dependencies = \"[\"\n + dependencyIds.map(\n id => \"\\\"\" + stringEscape(id) + \"\\\"\"\n ).join(\", \")\n + \"]\";\n const requires = dependencyIds.map(\n id => \"require(\\\"\" + stringEscape(id) + \"\\\")\"\n ).join(\", \");\n const params = dependencyVars.join(\", \");\n\n parts.push([\n generateGeneratedByComment(),\n \"(function(root, factory) {\",\n \" if (typeof define === \\\"function\\\" && define.amd) {\",\n \" define(\" + dependencies + \", factory);\",\n \" } else if (typeof module === \\\"object\\\" && module.exports) {\",\n \" module.exports = factory(\" + requires + \");\"\n ].join(\"\\n\"));\n\n if (options.exportVar !== null) {\n parts.push([\n \" } else {\",\n \" root.\" + options.exportVar + \" = factory();\"\n ].join(\"\\n\"));\n }\n\n parts.push([\n \" }\",\n \"})(this, function(\" + params + \") {\",\n \" \\\"use strict\\\";\",\n \"\",\n indent2(toplevelCode),\n \"\",\n indent2(\"return \" + generateParserObject() + \";\"),\n \"});\",\n \"\"\n ].join(\"\\n\"));\n\n return parts.join(\"\\n\");\n }\n };\n\n return generators[options.format]();\n }\n\n ast.code = generateWrapper(generateToplevel());\n}", "title": "" }, { "docid": "895c9e65691850c90625a9738fa63ee0", "score": "0.4290458", "text": "function hs(t, e) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, (function() {\n var n, r, i, o, u, s, a, c;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, (function(h) {\n switch (h.label) {\n case 0:\n return ys(n = O(t)), ms(n), !0 !== e || !0 === n.Ml ? [ 3 /*break*/ , 3 ] : (r = n.Vl.va(), \n [ 4 /*yield*/ , fs(n, r.it()) ]);\n\n case 1:\n return i = h.sent(), n.Ml = !0, [ 4 /*yield*/ , bu(n.yl, !0) ];\n\n case 2:\n for (h.sent(), o = 0, u = i; o < u.length; o++) s = u[o], tu(n.yl, s);\n return [ 3 /*break*/ , 7 ];\n\n case 3:\n return !1 !== e || !1 === n.Ml ? [ 3 /*break*/ , 7 ] : (a = [], c = Promise.resolve(), \n n.Sl.forEach((function(t, e) {\n n.Vl.La(e) ? a.push(e) : c = c.then((function() {\n return $u(n, e), co(n.bh, e, \n /*keepPersistedTargetData=*/ !0);\n })), eu(n.yl, e);\n })), [ 4 /*yield*/ , c ]);\n\n case 4:\n return h.sent(), [ 4 /*yield*/ , fs(n, a) ];\n\n case 5:\n return h.sent(), \n // PORTING NOTE: Multi-Tab only.\n function(t) {\n var e = O(t);\n e.xl.forEach((function(t, n) {\n eu(e.yl, n);\n })), e.Nl.kc(), e.xl = new Map, e.Cl = new rn(tt.H);\n }(n), n.Ml = !1, [ 4 /*yield*/ , bu(n.yl, !1) ];\n\n case 6:\n h.sent(), h.label = 7;\n\n case 7:\n return [ 2 /*return*/ ];\n }\n }));\n }));\n}", "title": "" }, { "docid": "f98bd7fd96843b89bd5edc5fc63325f5", "score": "0.42837793", "text": "function compileSchema(sch) {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch);\n if (_sch)\n return _sch;\n const rootId = resolve_1.getFullPath(sch.root.baseId); // TODO if getFullPath removed 1 tests fails\n const { es5, lines } = this.opts.code;\n const { ownProperties } = this.opts;\n const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });\n let _ValidationError;\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: validation_error_1.default,\n code: codegen_1._ `require(\"ajv/dist/runtime/validation_error\").default`,\n });\n }\n const validateName = gen.scopeName(\"validate\");\n sch.validateName = validateName;\n const schemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: names_1.default.data,\n parentData: names_1.default.parentData,\n parentDataProperty: names_1.default.parentDataProperty,\n dataNames: [names_1.default.data],\n dataPathArr: [codegen_1.nil],\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set(),\n topSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true\n ? { ref: sch.schema, code: codegen_1.stringify(sch.schema) }\n : { ref: sch.schema }),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: codegen_1.nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: codegen_1._ `\"\"`,\n opts: this.opts,\n self: this,\n };\n let sourceCode;\n try {\n this._compilations.add(sch);\n validate_1.validateFunctionCode(schemaCxt);\n gen.optimize(this.opts.code.optimize);\n // gen.optimize(1)\n const validateCode = gen.toString();\n sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process)\n sourceCode = this.opts.code.process(sourceCode, sch);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);\n const validate = makeValidate(this, this.scope.get());\n this.scope.value(validateName, { ref: validate });\n validate.errors = null;\n validate.schema = sch.schema;\n validate.schemaEnv = sch;\n if (sch.$async)\n validate.$async = true;\n if (this.opts.code.source === true) {\n validate.source = { validateName, validateCode, scopeValues: gen._values };\n }\n if (this.opts.unevaluated) {\n const { props, items } = schemaCxt;\n validate.evaluated = {\n props: props instanceof codegen_1.Name ? undefined : props,\n items: items instanceof codegen_1.Name ? undefined : items,\n dynamicProps: props instanceof codegen_1.Name,\n dynamicItems: items instanceof codegen_1.Name,\n };\n if (validate.source)\n validate.source.evaluated = codegen_1.stringify(validate.evaluated);\n }\n sch.validate = validate;\n return sch;\n }\n catch (e) {\n delete sch.validate;\n delete sch.validateName;\n if (sourceCode)\n this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e;\n }\n finally {\n this._compilations.delete(sch);\n }\n}", "title": "" }, { "docid": "f98bd7fd96843b89bd5edc5fc63325f5", "score": "0.42837793", "text": "function compileSchema(sch) {\n // TODO refactor - remove compilations\n const _sch = getCompilingSchema.call(this, sch);\n if (_sch)\n return _sch;\n const rootId = resolve_1.getFullPath(sch.root.baseId); // TODO if getFullPath removed 1 tests fails\n const { es5, lines } = this.opts.code;\n const { ownProperties } = this.opts;\n const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });\n let _ValidationError;\n if (sch.$async) {\n _ValidationError = gen.scopeValue(\"Error\", {\n ref: validation_error_1.default,\n code: codegen_1._ `require(\"ajv/dist/runtime/validation_error\").default`,\n });\n }\n const validateName = gen.scopeName(\"validate\");\n sch.validateName = validateName;\n const schemaCxt = {\n gen,\n allErrors: this.opts.allErrors,\n data: names_1.default.data,\n parentData: names_1.default.parentData,\n parentDataProperty: names_1.default.parentDataProperty,\n dataNames: [names_1.default.data],\n dataPathArr: [codegen_1.nil],\n dataLevel: 0,\n dataTypes: [],\n definedProperties: new Set(),\n topSchemaRef: gen.scopeValue(\"schema\", this.opts.code.source === true\n ? { ref: sch.schema, code: codegen_1.stringify(sch.schema) }\n : { ref: sch.schema }),\n validateName,\n ValidationError: _ValidationError,\n schema: sch.schema,\n schemaEnv: sch,\n rootId,\n baseId: sch.baseId || rootId,\n schemaPath: codegen_1.nil,\n errSchemaPath: sch.schemaPath || (this.opts.jtd ? \"\" : \"#\"),\n errorPath: codegen_1._ `\"\"`,\n opts: this.opts,\n self: this,\n };\n let sourceCode;\n try {\n this._compilations.add(sch);\n validate_1.validateFunctionCode(schemaCxt);\n gen.optimize(this.opts.code.optimize);\n // gen.optimize(1)\n const validateCode = gen.toString();\n sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;\n // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))\n if (this.opts.code.process)\n sourceCode = this.opts.code.process(sourceCode, sch);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode)\n const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);\n const validate = makeValidate(this, this.scope.get());\n this.scope.value(validateName, { ref: validate });\n validate.errors = null;\n validate.schema = sch.schema;\n validate.schemaEnv = sch;\n if (sch.$async)\n validate.$async = true;\n if (this.opts.code.source === true) {\n validate.source = { validateName, validateCode, scopeValues: gen._values };\n }\n if (this.opts.unevaluated) {\n const { props, items } = schemaCxt;\n validate.evaluated = {\n props: props instanceof codegen_1.Name ? undefined : props,\n items: items instanceof codegen_1.Name ? undefined : items,\n dynamicProps: props instanceof codegen_1.Name,\n dynamicItems: items instanceof codegen_1.Name,\n };\n if (validate.source)\n validate.source.evaluated = codegen_1.stringify(validate.evaluated);\n }\n sch.validate = validate;\n return sch;\n }\n catch (e) {\n delete sch.validate;\n delete sch.validateName;\n if (sourceCode)\n this.logger.error(\"Error compiling schema, function code:\", sourceCode);\n // console.log(\"\\n\\n\\n *** \\n\", sourceCode, this.opts)\n throw e;\n }\n finally {\n this._compilations.delete(sch);\n }\n}", "title": "" }, { "docid": "3dd1f76adca0fdc286665aa6278822c1", "score": "0.42829838", "text": "function buildType(type) {\n\t switch (type.kind) {\n\t case _introspection.TypeKind.SCALAR:\n\t return buildScalarDef(type);\n\t case _introspection.TypeKind.OBJECT:\n\t return buildObjectDef(type);\n\t case _introspection.TypeKind.INTERFACE:\n\t return buildInterfaceDef(type);\n\t case _introspection.TypeKind.UNION:\n\t return buildUnionDef(type);\n\t case _introspection.TypeKind.ENUM:\n\t return buildEnumDef(type);\n\t case _introspection.TypeKind.INPUT_OBJECT:\n\t return buildInputObjectDef(type);\n\t default:\n\t throw new Error('Invalid or incomplete schema, unknown kind: ' + type.kind + '. Ensure ' + 'that a full introspection query is used in order to build a ' + 'client schema.');\n\t }\n\t }", "title": "" }, { "docid": "d112b0eb2665538643f0e5f3456f2496", "score": "0.4277073", "text": "function Typedefs__Backend__Typedefs__Backend__JSON___64_Typedefs__Backend__CodegenInterdep_36_JSONDef_58_JSON_58__33_sourceCode_58_0($_0_arg, $_1_arg){\n let $cg$1 = null;\n if((((((Prelude__Foldable__Prelude__List___64_Prelude__Foldable__Foldable_36_List_58__33_foldr_58_0(null, null, $partial_0_2$prim_95__95_strCons(), \"\", Prelude__List__replicate(null, (new $JSRTS.jsbn.BigInteger((\"0\"))), \" \")) + Language__JSON__Data__format_58_formatValue_58_0(null, null, null, (new $JSRTS.jsbn.BigInteger((\"0\"))), (new $JSRTS.jsbn.BigInteger((\"2\"))), Typedefs__Backend__JSON__makeSchema($_0_arg, $_1_arg))) == \"\")) ? 1|0 : 0|0) === 0)) {\n $cg$1 = true;\n } else {\n $cg$1 = false;\n }\n \n const $cg$3 = Decidable__Equality__Decidable__Equality___64_Decidable__Equality__DecEq_36_Bool_58__33_decEq_58_0($cg$1, true);\n let $cg$2 = null;\n if(($cg$3.type === 1)) {\n $cg$2 = $HC_0_0$Prelude__List__Nil;\n } else {\n let $cg$4 = null;\n if((((((Prelude__Foldable__Prelude__List___64_Prelude__Foldable__Foldable_36_List_58__33_foldr_58_0(null, null, $partial_0_2$prim_95__95_strCons(), \"\", Prelude__List__replicate(null, (new $JSRTS.jsbn.BigInteger((\"0\"))), \" \")) + Language__JSON__Data__format_58_formatValue_58_0(null, null, null, (new $JSRTS.jsbn.BigInteger((\"0\"))), (new $JSRTS.jsbn.BigInteger((\"2\"))), Typedefs__Backend__JSON__makeSchema($_0_arg, $_1_arg))).slice(1) == \"\")) ? 1|0 : 0|0) === 0)) {\n $cg$4 = true;\n } else {\n $cg$4 = false;\n }\n \n const $cg$6 = Decidable__Equality__Decidable__Equality___64_Decidable__Equality__DecEq_36_Bool_58__33_decEq_58_0($cg$4, true);\n let $cg$5 = null;\n if(($cg$6.type === 1)) {\n $cg$5 = $HC_0_0$Prelude__Strings__StrNil;\n } else {\n $cg$5 = new $HC_2_1$Prelude__Strings__StrCons((Prelude__Foldable__Prelude__List___64_Prelude__Foldable__Foldable_36_List_58__33_foldr_58_0(null, null, $partial_0_2$prim_95__95_strCons(), \"\", Prelude__List__replicate(null, (new $JSRTS.jsbn.BigInteger((\"0\"))), \" \")) + Language__JSON__Data__format_58_formatValue_58_0(null, null, null, (new $JSRTS.jsbn.BigInteger((\"0\"))), (new $JSRTS.jsbn.BigInteger((\"2\"))), Typedefs__Backend__JSON__makeSchema($_0_arg, $_1_arg))).slice(1)[0], (Prelude__Foldable__Prelude__List___64_Prelude__Foldable__Foldable_36_List_58__33_foldr_58_0(null, null, $partial_0_2$prim_95__95_strCons(), \"\", Prelude__List__replicate(null, (new $JSRTS.jsbn.BigInteger((\"0\"))), \" \")) + Language__JSON__Data__format_58_formatValue_58_0(null, null, null, (new $JSRTS.jsbn.BigInteger((\"0\"))), (new $JSRTS.jsbn.BigInteger((\"2\"))), Typedefs__Backend__JSON__makeSchema($_0_arg, $_1_arg))).slice(1).slice(1));\n }\n \n $cg$2 = new $HC_2_1$Prelude__List___58__58_((Prelude__Foldable__Prelude__List___64_Prelude__Foldable__Foldable_36_List_58__33_foldr_58_0(null, null, $partial_0_2$prim_95__95_strCons(), \"\", Prelude__List__replicate(null, (new $JSRTS.jsbn.BigInteger((\"0\"))), \" \")) + Language__JSON__Data__format_58_formatValue_58_0(null, null, null, (new $JSRTS.jsbn.BigInteger((\"0\"))), (new $JSRTS.jsbn.BigInteger((\"2\"))), Typedefs__Backend__JSON__makeSchema($_0_arg, $_1_arg)))[0], _95_Prelude__Strings__unpack_95_with_95_36(null, $cg$5));\n }\n \n return Text__PrettyPrint__WL__Combinators__literal_58_mkLiteral_58_0(null, $cg$2);\n}", "title": "" }, { "docid": "840e0a8d4a77c39f9f38e2a55784decc", "score": "0.42688566", "text": "function buildASTSchema(ast, options) {\n if (!ast || ast.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].DOCUMENT) {\n throw new Error('Must provide a document ast.');\n }\n\n var schemaDef = void 0;\n\n var typeDefs = [];\n var nodeMap = Object.create(null);\n var directiveDefs = [];\n for (var i = 0; i < ast.definitions.length; i++) {\n var d = ast.definitions[i];\n switch (d.kind) {\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].SCHEMA_DEFINITION:\n if (schemaDef) {\n throw new Error('Must provide only one schema definition.');\n }\n schemaDef = d;\n break;\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].SCALAR_TYPE_DEFINITION:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].OBJECT_TYPE_DEFINITION:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INTERFACE_TYPE_DEFINITION:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].ENUM_TYPE_DEFINITION:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].UNION_TYPE_DEFINITION:\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].INPUT_OBJECT_TYPE_DEFINITION:\n var _typeName = d.name.value;\n if (nodeMap[_typeName]) {\n throw new Error('Type \"' + _typeName + '\" was defined more than once.');\n }\n typeDefs.push(d);\n nodeMap[_typeName] = d;\n break;\n case _language_kinds__WEBPACK_IMPORTED_MODULE_7__[\"Kind\"].DIRECTIVE_DEFINITION:\n directiveDefs.push(d);\n break;\n }\n }\n\n var operationTypes = schemaDef ? getOperationTypes(schemaDef) : {\n query: nodeMap.Query ? 'Query' : null,\n mutation: nodeMap.Mutation ? 'Mutation' : null,\n subscription: nodeMap.Subscription ? 'Subscription' : null\n };\n\n var definitionBuilder = new ASTDefinitionBuilder(nodeMap, options, function (typeName) {\n throw new Error('Type \"' + typeName + '\" not found in document.');\n });\n\n var types = typeDefs.map(function (def) {\n return definitionBuilder.buildType(def.name.value);\n });\n\n var directives = directiveDefs.map(function (def) {\n return definitionBuilder.buildDirective(def);\n });\n\n // If specified directives were not explicitly declared, add them.\n if (!directives.some(function (directive) {\n return directive.name === 'skip';\n })) {\n directives.push(_type_directives__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLSkipDirective\"]);\n }\n\n if (!directives.some(function (directive) {\n return directive.name === 'include';\n })) {\n directives.push(_type_directives__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLIncludeDirective\"]);\n }\n\n if (!directives.some(function (directive) {\n return directive.name === 'deprecated';\n })) {\n directives.push(_type_directives__WEBPACK_IMPORTED_MODULE_10__[\"GraphQLDeprecatedDirective\"]);\n }\n\n // Note: While this could make early assertions to get the correctly\n // typed values below, that would throw immediately while type system\n // validation with validateSchema() will produce more actionable results.\n return new _type_schema__WEBPACK_IMPORTED_MODULE_13__[\"GraphQLSchema\"]({\n query: operationTypes.query ? definitionBuilder.buildType(operationTypes.query) : null,\n mutation: operationTypes.mutation ? definitionBuilder.buildType(operationTypes.mutation) : null,\n subscription: operationTypes.subscription ? definitionBuilder.buildType(operationTypes.subscription) : null,\n types: types,\n directives: directives,\n astNode: schemaDef,\n assumeValid: options && options.assumeValid\n });\n\n function getOperationTypes(schema) {\n var opTypes = {};\n schema.operationTypes.forEach(function (operationType) {\n var typeName = operationType.type.name.value;\n var operation = operationType.operation;\n if (opTypes[operation]) {\n throw new Error('Must provide only one ' + operation + ' type in schema.');\n }\n if (!nodeMap[typeName]) {\n throw new Error('Specified ' + operation + ' type \"' + typeName + '\" not found in document.');\n }\n opTypes[operation] = typeName;\n });\n return opTypes;\n }\n}", "title": "" }, { "docid": "d8ae576d7f0caa540274bebec09a3acd", "score": "0.42674622", "text": "function definitionToType(definition, compiler, forceLocation) {\n debug(\"definition %O\", definition);\n let typeClass = definition_1.Definition.typeClass(definition);\n let typeHint = definition_1.Definition.typeStringWithoutLocation(definition);\n switch (typeClass) {\n case \"bool\":\n return {\n typeClass,\n typeHint\n };\n case \"address\": {\n switch (compiler_2.solidityFamily(compiler)) {\n case \"pre-0.5.0\":\n return {\n typeClass,\n kind: \"general\",\n typeHint\n };\n case \"0.5.x\":\n return {\n typeClass,\n kind: \"specific\",\n payable: definition_1.Definition.typeIdentifier(definition) === \"t_address_payable\"\n };\n }\n break; //to satisfy typescript\n }\n case \"uint\": {\n let bytes = definition_1.Definition.specifiedSize(definition);\n return {\n typeClass,\n bits: bytes * 8,\n typeHint\n };\n }\n case \"int\": { //typeScript won't let me group these for some reason\n let bytes = definition_1.Definition.specifiedSize(definition);\n return {\n typeClass,\n bits: bytes * 8,\n typeHint\n };\n }\n case \"fixed\": { //typeScript won't let me group these for some reason\n let bytes = definition_1.Definition.specifiedSize(definition);\n let places = definition_1.Definition.decimalPlaces(definition);\n return {\n typeClass,\n bits: bytes * 8,\n places,\n typeHint\n };\n }\n case \"ufixed\": {\n let bytes = definition_1.Definition.specifiedSize(definition);\n let places = definition_1.Definition.decimalPlaces(definition);\n return {\n typeClass,\n bits: bytes * 8,\n places,\n typeHint\n };\n }\n case \"string\": {\n if (forceLocation === null) {\n return {\n typeClass,\n typeHint\n };\n }\n let location = forceLocation || definition_1.Definition.referenceType(definition);\n return {\n typeClass,\n location,\n typeHint\n };\n }\n case \"bytes\": {\n let length = definition_1.Definition.specifiedSize(definition);\n if (length !== null) {\n return {\n typeClass,\n kind: \"static\",\n length,\n typeHint\n };\n }\n else {\n if (forceLocation === null) {\n return {\n typeClass,\n kind: \"dynamic\",\n typeHint\n };\n }\n let location = forceLocation || definition_1.Definition.referenceType(definition);\n return {\n typeClass,\n kind: \"dynamic\",\n location,\n typeHint\n };\n }\n }\n case \"array\": {\n let baseDefinition = definition_1.Definition.baseDefinition(definition);\n let baseType = definitionToType(baseDefinition, compiler, forceLocation);\n let location = forceLocation || definition_1.Definition.referenceType(definition);\n if (definition_1.Definition.isDynamicArray(definition)) {\n if (forceLocation !== null) {\n return {\n typeClass,\n baseType,\n kind: \"dynamic\",\n location,\n typeHint\n };\n }\n else {\n return {\n typeClass,\n baseType,\n kind: \"dynamic\",\n typeHint\n };\n }\n }\n else {\n let length = new bn_js_1.default(definition_1.Definition.staticLengthAsString(definition));\n if (forceLocation !== null) {\n return {\n typeClass,\n baseType,\n kind: \"static\",\n length,\n location,\n typeHint\n };\n }\n else {\n return {\n typeClass,\n baseType,\n kind: \"static\",\n length,\n typeHint\n };\n }\n }\n }\n case \"mapping\": {\n let keyDefinition = definition_1.Definition.keyDefinition(definition);\n //note that we can skip the scopes argument here! that's only needed when\n //a general node, rather than a declaration, is being passed in\n let keyType = definitionToType(keyDefinition, compiler, null);\n //suppress the location on the key type (it'll be given as memory but\n //this is meaningless)\n //also, we have to tell TypeScript ourselves that this will be an elementary\n //type; it has no way of knowing that\n let valueDefinition = definition.valueType || definition.typeName.valueType;\n let valueType = definitionToType(valueDefinition, compiler, forceLocation);\n if (forceLocation === null) {\n return {\n typeClass,\n keyType,\n valueType\n };\n }\n return {\n typeClass,\n keyType,\n valueType,\n location: \"storage\"\n };\n }\n case \"function\": {\n let visibility = definition_1.Definition.visibility(definition);\n let mutability = definition_1.Definition.mutability(definition);\n let [inputParameters, outputParameters] = definition_1.Definition.parameters(definition);\n //note: don't force a location on these! use the listed location!\n let inputParameterTypes = inputParameters.map(parameter => definitionToType(parameter, compiler));\n let outputParameterTypes = outputParameters.map(parameter => definitionToType(parameter, compiler));\n switch (visibility) {\n case \"internal\":\n return {\n typeClass,\n visibility,\n mutability,\n inputParameterTypes,\n outputParameterTypes\n };\n case \"external\":\n return {\n typeClass,\n visibility,\n kind: \"specific\",\n mutability,\n inputParameterTypes,\n outputParameterTypes\n };\n }\n break; //to satisfy typescript\n }\n case \"struct\": {\n let id = definition_1.Definition.typeId(definition).toString();\n let qualifiedName = definition_1.Definition.typeStringWithoutLocation(definition).match(/struct (.*)/)[1];\n let [definingContractName, typeName] = qualifiedName.split(\".\");\n if (forceLocation === null) {\n return {\n typeClass,\n kind: \"local\",\n id,\n typeName,\n definingContractName\n };\n }\n let location = forceLocation || definition_1.Definition.referenceType(definition);\n return {\n typeClass,\n kind: \"local\",\n id,\n typeName,\n definingContractName,\n location\n };\n }\n case \"enum\": {\n let id = definition_1.Definition.typeId(definition).toString();\n let qualifiedName = definition_1.Definition.typeStringWithoutLocation(definition).match(/enum (.*)/)[1];\n let [definingContractName, typeName] = qualifiedName.split(\".\");\n return {\n typeClass,\n kind: \"local\",\n id,\n typeName,\n definingContractName\n };\n }\n case \"contract\": {\n let id = definition_1.Definition.typeId(definition).toString();\n let typeName = definition.typeName\n ? definition.typeName.name\n : definition.name;\n let contractKind = definition_1.Definition.contractKind(definition);\n return {\n typeClass,\n kind: \"native\",\n id,\n typeName,\n contractKind\n };\n }\n case \"magic\": {\n let typeIdentifier = definition_1.Definition.typeIdentifier(definition);\n let variable = typeIdentifier.match(/^t_magic_(.*)$/)[1];\n return {\n typeClass,\n variable\n };\n }\n }\n }", "title": "" }, { "docid": "fc070330198edc26611bb7f119c51b50", "score": "0.42597663", "text": "async function do_parse_def() {\n // Parses definition name\n if (tokens) tokens.push([\"def\", \"\"]);\n var name = parse_name();\n\n if (name.length === 0) {\n error(\"Expected a definition.\");\n }\n if (tokens) tokens[tokens.length - 1][2] = file+\"/\"+name;\n if (tokens) tokens.push([\"txt\", \"\"]);\n\n // If name is empty, stop\n if (name.length === 0) return false;\n\n // Parses argument names and types\n var erass = [];\n var names = [];\n var types = [];\n if (match_here(\"(\")) {\n while (idx < code.length) {\n var arg_name = parse_string();\n var arg_type = match(\":\") ? await parse_term(names) : Hol(new_hole_name());\n var arg_eras = match(\";\");\n var arg_skip = match(\",\");\n erass.push(arg_eras);\n names.push(arg_name);\n types.push(arg_type);\n if (match(\")\")) break;\n }\n }\n\n // Parses return type, if any\n var type = match(\":\") ? await parse_term(names) : null;\n var skip = match(\";\");\n var term = await parse_term(names);\n\n // Fills foralls and lambdas of arguments\n for (var i = names.length - 1; i >= 0; --i) {\n var type = type && All(names[i], types[i], type, erass[i]);\n var term = Lam(names[i], type ? null : types[i], term, erass[i]);\n }\n\n // Defines the top-level term\n define(file+\"/\"+name, type ? Ann(type, term, false) : term);\n\n return true;\n }", "title": "" }, { "docid": "68fc5cf5b7a5fb3ffafa05e9e9ad72b4", "score": "0.42576477", "text": "function parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer__WEBPACK_IMPORTED_MODULE_2__.TokenKind.NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n\n case 'type':\n return parseObjectTypeDefinition(lexer);\n\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n\n case 'union':\n return parseUnionTypeDefinition(lexer);\n\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}", "title": "" }, { "docid": "e4b3b681df6bf8a009dbc5d4cdce5211", "score": "0.4249918", "text": "function parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer__WEBPACK_IMPORTED_MODULE_2__[\"TokenKind\"].NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n case 'type':\n return parseObjectTypeDefinition(lexer);\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n case 'union':\n return parseUnionTypeDefinition(lexer);\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n case 'extend':\n return parseTypeExtension(lexer);\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}", "title": "" }, { "docid": "22dc5e22826763a22fd5900ef8dcd11d", "score": "0.42442703", "text": "function parseTypeSystemDefinition(lexer) {\n // Many definitions begin with a description and require a lookahead.\n var keywordToken = peekDescription(lexer) ? lexer.lookahead() : lexer.token;\n\n if (keywordToken.kind === _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].NAME) {\n switch (keywordToken.value) {\n case 'schema':\n return parseSchemaDefinition(lexer);\n\n case 'scalar':\n return parseScalarTypeDefinition(lexer);\n\n case 'type':\n return parseObjectTypeDefinition(lexer);\n\n case 'interface':\n return parseInterfaceTypeDefinition(lexer);\n\n case 'union':\n return parseUnionTypeDefinition(lexer);\n\n case 'enum':\n return parseEnumTypeDefinition(lexer);\n\n case 'input':\n return parseInputObjectTypeDefinition(lexer);\n\n case 'directive':\n return parseDirectiveDefinition(lexer);\n }\n }\n\n throw unexpected(lexer, keywordToken);\n}", "title": "" }, { "docid": "09d3285863a7f91c1db9e411d2e62d04", "score": "0.42356348", "text": "function buildType(type) {\n switch (type.kind) {\n case _introspection.TypeKind.SCALAR:\n return buildScalarDef(type);\n case _introspection.TypeKind.OBJECT:\n return buildObjectDef(type);\n case _introspection.TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n case _introspection.TypeKind.UNION:\n return buildUnionDef(type);\n case _introspection.TypeKind.ENUM:\n return buildEnumDef(type);\n case _introspection.TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n default:\n throw new Error('Invalid or incomplete schema, unknown kind: ' + type.kind + '. Ensure ' + 'that a full introspection query is used in order to build a ' + 'client schema.');\n }\n }", "title": "" }, { "docid": "e07472982fccc248c8ab1e1aa44c7683", "score": "0.42350316", "text": "function scheme(hljs) {\n var SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n var SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n var SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n var KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n 'builtin-name':\n 'case-lambda call/cc class define-class exit-handler field import ' +\n 'inherit init-field interface let*-values let-values let/ec mixin ' +\n 'opt-lambda override protect provide public rename require ' +\n 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +\n 'when with-syntax and begin call-with-current-continuation ' +\n 'call-with-input-file call-with-output-file case cond define ' +\n 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +\n 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' +\n '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +\n 'boolean? caar cadr call-with-input-file call-with-output-file ' +\n 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +\n 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +\n 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +\n 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +\n 'char? close-input-port close-output-port complex? cons cos ' +\n 'current-input-port current-output-port denominator display eof-object? ' +\n 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +\n 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +\n 'integer? interaction-environment lcm length list list->string ' +\n 'list->vector list-ref list-tail list? load log magnitude make-polar ' +\n 'make-rectangular make-string make-vector max member memq memv min ' +\n 'modulo negative? newline not null-environment null? number->string ' +\n 'number? numerator odd? open-input-file open-output-file output-port? ' +\n 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +\n 'rational? rationalize read read-char real-part real? remainder reverse ' +\n 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +\n 'string->list string->number string->symbol string-append string-ci<=? ' +\n 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +\n 'string-fill! string-length string-ref string-set! string<=? string<? ' +\n 'string=? string>=? string>? string? substring symbol->string symbol? ' +\n 'tan transcript-off transcript-on truncate values vector ' +\n 'vector->list vector-fill! vector-length vector-ref vector-set! ' +\n 'with-input-from-file with-output-to-file write write-char zero?'\n };\n\n var LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n\n var NUMBER = {\n className: 'number',\n variants: [\n { begin: SCHEME_SIMPLE_NUMBER_RE, relevance: 0 },\n { begin: SCHEME_COMPLEX_NUMBER_RE, relevance: 0 },\n { begin: '#b[0-1]+(/[0-1]+)?' },\n { begin: '#o[0-7]+(/[0-7]+)?' },\n { begin: '#x[0-9a-f]+(/[0-9a-f]+)?' }\n ]\n };\n\n var STRING = hljs.QUOTE_STRING_MODE;\n\n var COMMENT_MODES = [\n hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n ),\n hljs.COMMENT('#\\\\|', '\\\\|#')\n ];\n\n var IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n\n var QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n\n var BODY = {\n endsWithParent: true,\n relevance: 0\n };\n\n var QUOTED_LIST = {\n variants: [\n { begin: /'/ },\n { begin: '`' }\n ],\n contains: [\n {\n begin: '\\\\(', end: '\\\\)',\n contains: ['self', LITERAL, STRING, NUMBER, IDENT, QUOTED_IDENT]\n }\n ]\n };\n\n var NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n\n var LAMBDA = {\n begin: /lambda/, endsWithParent: true, returnBegin: true,\n contains: [\n NAME,\n {\n begin: /\\(/, end: /\\)/, endsParent: true,\n contains: [IDENT],\n }\n ]\n };\n\n var LIST = {\n variants: [\n { begin: '\\\\(', end: '\\\\)' },\n { begin: '\\\\[', end: '\\\\]' }\n ],\n contains: [LAMBDA, NAME, BODY]\n };\n\n BODY.contains = [LITERAL, NUMBER, STRING, IDENT, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES);\n\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [hljs.SHEBANG(), NUMBER, STRING, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES)\n };\n}", "title": "" }, { "docid": "9c04351bbb1abc760c8db85a2e584a49", "score": "0.4228263", "text": "function scheme(hljs) {\n const SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n const SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n const SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n const KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n 'builtin-name': 'case-lambda call/cc class define-class exit-handler field import ' + 'inherit init-field interface let*-values let-values let/ec mixin ' + 'opt-lambda override protect provide public rename require ' + 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' + 'when with-syntax and begin call-with-current-continuation ' + 'call-with-input-file call-with-output-file case cond define ' + 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' + 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' + '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' + 'boolean? caar cadr call-with-input-file call-with-output-file ' + 'call-with-values car cdddar cddddr cdr ceiling char->integer ' + 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' + 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' + 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' + 'char? close-input-port close-output-port complex? cons cos ' + 'current-input-port current-output-port denominator display eof-object? ' + 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' + 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' + 'integer? interaction-environment lcm length list list->string ' + 'list->vector list-ref list-tail list? load log magnitude make-polar ' + 'make-rectangular make-string make-vector max member memq memv min ' + 'modulo negative? newline not null-environment null? number->string ' + 'number? numerator odd? open-input-file open-output-file output-port? ' + 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' + 'rational? rationalize read read-char real-part real? remainder reverse ' + 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' + 'string->list string->number string->symbol string-append string-ci<=? ' + 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' + 'string-fill! string-length string-ref string-set! string<=? string<? ' + 'string=? string>=? string>? string? substring symbol->string symbol? ' + 'tan transcript-off transcript-on truncate values vector ' + 'vector->list vector-fill! vector-length vector-ref vector-set! ' + 'with-input-from-file with-output-to-file write write-char zero?'\n };\n const LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n const NUMBER = {\n className: 'number',\n variants: [{\n begin: SCHEME_SIMPLE_NUMBER_RE,\n relevance: 0\n }, {\n begin: SCHEME_COMPLEX_NUMBER_RE,\n relevance: 0\n }, {\n begin: '#b[0-1]+(/[0-1]+)?'\n }, {\n begin: '#o[0-7]+(/[0-7]+)?'\n }, {\n begin: '#x[0-9a-f]+(/[0-9a-f]+)?'\n }]\n };\n const STRING = hljs.QUOTE_STRING_MODE;\n const COMMENT_MODES = [hljs.COMMENT(';', '$', {\n relevance: 0\n }), hljs.COMMENT('#\\\\|', '\\\\|#')];\n const IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n const QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n const QUOTED_LIST = {\n variants: [{\n begin: /'/\n }, {\n begin: '`'\n }],\n contains: [{\n begin: '\\\\(',\n end: '\\\\)',\n contains: ['self', LITERAL, STRING, NUMBER, IDENT, QUOTED_IDENT]\n }]\n };\n const NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n const LAMBDA = {\n begin: /lambda/,\n endsWithParent: true,\n returnBegin: true,\n contains: [NAME, {\n endsParent: true,\n variants: [{\n begin: /\\(/,\n end: /\\)/\n }, {\n begin: /\\[/,\n end: /\\]/\n }],\n contains: [IDENT]\n }]\n };\n const LIST = {\n variants: [{\n begin: '\\\\(',\n end: '\\\\)'\n }, {\n begin: '\\\\[',\n end: '\\\\]'\n }],\n contains: [LAMBDA, NAME, BODY]\n };\n BODY.contains = [LITERAL, NUMBER, STRING, IDENT, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES);\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [hljs.SHEBANG(), NUMBER, STRING, QUOTED_IDENT, QUOTED_LIST, LIST].concat(COMMENT_MODES)\n };\n }", "title": "" }, { "docid": "9f8df8e3d700b7d34f2af6e080b36ec5", "score": "0.42229956", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: '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', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.42229956", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.42229956", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "9dd1d666624b01bc5ad316e23e29d65d", "score": "0.42229956", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.42229956", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "1c46e9a7742b555e41adfa13a581e000", "score": "0.42229956", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt', 'kts' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "b784f41d089c582d686e1947f9a03425", "score": "0.4221592", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword: 'abstract as val var vararg get set class object open private protected public noinline ' + 'crossinline dynamic final enum if else do while for when throw try catch finally ' + 'import package is in fun override companion reified inline lateinit init ' + 'interface annotation data sealed internal infix operator out by constructor super ' + 'tailrec where const inner suspend typealias external expect actual',\n built_in: 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal: '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 className: 'symbol',\n begin: /@\\w+/\n }]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n }; // for string templates\n\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 begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [VARIABLE, SUBST]\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 begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [hljs.BACKSLASH_ESCAPE, VARIABLE, SUBST]\n }]\n };\n SUBST.contains.push(STRING);\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 begin: /\\(/,\n end: /\\)/,\n contains: [hljs.inherit(STRING, {\n className: 'meta-string'\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\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT('/\\\\*', '\\\\*/', {\n contains: [hljs.C_BLOCK_COMMENT_MODE]\n });\n const KOTLIN_PAREN_TYPE = {\n variants: [{\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\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 return {\n name: 'Kotlin',\n aliases: ['kt', 'kts'],\n keywords: KEYWORDS,\n contains: [hljs.COMMENT('/\\\\*\\\\*', '\\\\*/', {\n relevance: 0,\n contains: [{\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }]\n }), hljs.C_LINE_COMMENT_MODE, KOTLIN_NESTED_COMMENT, KEYWORDS_WITH_LABEL, LABEL, ANNOTATION_USE_SITE, ANNOTATION, {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [{\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [hljs.UNDERSCORE_TITLE_MODE]\n }, {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n }, {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [{\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [KOTLIN_PAREN_TYPE, hljs.C_LINE_COMMENT_MODE, KOTLIN_NESTED_COMMENT],\n relevance: 0\n }, hljs.C_LINE_COMMENT_MODE, KOTLIN_NESTED_COMMENT, ANNOTATION_USE_SITE, ANNOTATION, STRING, hljs.C_NUMBER_MODE]\n }, KOTLIN_NESTED_COMMENT]\n }, {\n className: 'class',\n beginKeywords: 'class interface trait',\n // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [{\n beginKeywords: 'public protected internal private constructor'\n }, hljs.UNDERSCORE_TITLE_MODE, {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n }, {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n }, ANNOTATION_USE_SITE, ANNOTATION]\n }, STRING, {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n }, KOTLIN_NUMBER_MODE]\n };\n }", "title": "" }, { "docid": "7e16bf7889cf4e08841c3727061d85a3", "score": "0.42211664", "text": "function getTypeDefProducer() {\n\n var innerTypeMap = {\n String: _type.GraphQLString,\n Int: _type.GraphQLInt,\n Float: _type.GraphQLFloat,\n Boolean: _type.GraphQLBoolean,\n ID: _type.GraphQLID\n };\n\n return function (typeAST) {\n var typeName = getInnerTypeName(typeAST);\n if (!(0, _jsutilsIsNullish2['default'])(innerTypeMap[typeName])) {\n return buildWrappedType(innerTypeMap[typeName], typeAST);\n }\n\n if ((0, _jsutilsIsNullish2['default'])(astMap[typeName])) {\n throw new Error('Type ' + typeName + ' not found in document');\n }\n\n var innerTypeDef = makeSchemaDef(astMap[typeName]);\n if ((0, _jsutilsIsNullish2['default'])(innerTypeDef)) {\n throw new Error('Nothing constructed for ' + typeName);\n }\n innerTypeMap[typeName] = innerTypeDef;\n return buildWrappedType(innerTypeDef, typeAST);\n };\n }", "title": "" }, { "docid": "cf79d5996ebf45d58c378e2986a4c782", "score": "0.42205945", "text": "function generateHelps(){\n\t\tcreateHelp('ans', ans, 'ans(n) returns the n:th answer and ans returns ans(0).');\n\t\tcreateHelp('random', rand, 'random (or rand) is a random number. Use as a constant.');\n\t\tcreateHelp('PI', 'pi', 'pi is an approximate of the constant pi.');\n\t\tcreateHelp('e', 'e', 'e is the base of the natural logarithm.');\n\t\tcreateHelp('base', parseInt, 'base(a,n) converts a from the base of n to default.');\n\t\tcreateHelp('sin', Math.sin, 'sin(&alpha;) converts an angle value to an x coordinate.');\n\t\tcreateHelp('cos', Math.cos, 'cos(&alpha;) converts an angle value to an y coordinate.');\n\t\tcreateHelp('tan', Math.tan, 'tan(&alpha;) converts an angle value to a line modifier factor (k).');\n\t\tcreateHelp('asin', Math.asin, 'asin(num) inverse function of sin(&alpha;).');\n\t\tcreateHelp('acos', Math.acos, 'acos(num) inverse function of cos(&alpha;).');\n\t\tcreateHelp('atan', Math.atan, 'atan(num) inverse function of tan(&alpha;).');\n\t\tcreateHelp('atan2', Math.atan2, 'atan2(y, x) inverse function of tan(&alpha;).');\n\t\tcreateHelp('pow', Math.pow, 'pow(a, b) returns a<sup>b</sup>');\n\t\tcreateHelp('sqrt', Math.sqrt, 'sqrt(a) returns the square root of a.');\n\t\tcreateHelp('log', Math.log, 'log(a, b) returns the natural logarithm of a (E-based).');\n\t\tcreateHelp('exp', Math.exp, 'exp(a) returns the value of E<sup>a</sup>.');\n\t\tcreateHelp('abs', Math.abs, 'abs(a) returns the absolute value of a.');\n\t\tcreateHelp('max', Math.max, 'max(a,b,...) returns the highest value in arguments.');\n\t\tcreateHelp('min', Math.min, 'min(a,b,...) returns the lowest value in arguments.');\n\t\tcreateHelp('floor', Math.floor, 'floor(a) returns a, rounded downwards to the nearest integer.');\n\t\tcreateHelp('ceil', Math.ceil, 'ceil(a) returns a, rounded updwards to the nearest integer.');\n\t\tcreateHelp('round', Math.round, 'round(a) returns a, rounded to the nearest integer.');\n\t\tcreateHelp('frac', frac, 'frac(a) returns the decimal part of a number.');\n\t\tcreateHelp('whack', whack, 'whack(a) returns all the numbers in a added together and repeated until only one number remains.');\n\n\t\twhack.toString = function(){ return 'function whack() { [native code] }'; };\n\t\tfrac.toString = function(){ return 'function frac() { [native code] }'; };\n\t\thelp.toString = function(){ return 'function help() { [native code] }'; };\n\t\tans.toString = function(){ return ans(0); };\n\t\trand.toString = function(){ return rand(); };\n\t}", "title": "" }, { "docid": "f5dac55e278e694c1418382047e54394", "score": "0.42205667", "text": "function createTypeChecker(program, fullTypeCheck) {\r\n var Symbol = ts.objectAllocator.getSymbolConstructor();\r\n var Type = ts.objectAllocator.getTypeConstructor();\r\n var Signature = ts.objectAllocator.getSignatureConstructor();\r\n var typeCount = 0;\r\n var emptyArray = [];\r\n var emptySymbols = {};\r\n var compilerOptions = program.getCompilerOptions();\r\n var checker = {\r\n getProgram: function () { return program; },\r\n getNodeCount: function () { return ts.sum(program.getSourceFiles(), \"nodeCount\"); },\r\n getIdentifierCount: function () { return ts.sum(program.getSourceFiles(), \"identifierCount\"); },\r\n getSymbolCount: function () { return ts.sum(program.getSourceFiles(), \"symbolCount\"); },\r\n getTypeCount: function () { return typeCount; },\r\n isUndefinedSymbol: function (symbol) { return symbol === undefinedSymbol; },\r\n isArgumentsSymbol: function (symbol) { return symbol === argumentsSymbol; },\r\n emitFiles: invokeEmitter,\r\n getDiagnostics: getDiagnostics,\r\n getDeclarationDiagnostics: getDeclarationDiagnostics,\r\n getGlobalDiagnostics: getGlobalDiagnostics,\r\n getTypeOfSymbolAtLocation: getTypeOfSymbolAtLocation,\r\n getDeclaredTypeOfSymbol: getDeclaredTypeOfSymbol,\r\n getPropertiesOfType: getPropertiesOfType,\r\n getPropertyOfType: getPropertyOfType,\r\n getSignaturesOfType: getSignaturesOfType,\r\n getIndexTypeOfType: getIndexTypeOfType,\r\n getReturnTypeOfSignature: getReturnTypeOfSignature,\r\n getSymbolsInScope: getSymbolsInScope,\r\n getSymbolAtLocation: getSymbolAtLocation,\r\n getShorthandAssignmentValueSymbol: getShorthandAssignmentValueSymbol,\r\n getTypeAtLocation: getTypeAtLocation,\r\n typeToString: typeToString,\r\n getSymbolDisplayBuilder: getSymbolDisplayBuilder,\r\n symbolToString: symbolToString,\r\n getAugmentedPropertiesOfType: getAugmentedPropertiesOfType,\r\n getRootSymbols: getRootSymbols,\r\n getContextualType: getContextualType,\r\n getFullyQualifiedName: getFullyQualifiedName,\r\n getResolvedSignature: getResolvedSignature,\r\n getEnumMemberValue: getEnumMemberValue,\r\n isValidPropertyAccess: isValidPropertyAccess,\r\n getSignatureFromDeclaration: getSignatureFromDeclaration,\r\n isImplementationOfOverload: isImplementationOfOverload,\r\n getAliasedSymbol: resolveImport,\r\n hasEarlyErrors: hasEarlyErrors,\r\n isEmitBlocked: isEmitBlocked\r\n };\r\n var undefinedSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, \"undefined\");\r\n var argumentsSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, \"arguments\");\r\n var unknownSymbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, \"unknown\");\r\n var resolvingSymbol = createSymbol(268435456 /* Transient */, \"__resolving__\");\r\n var anyType = createIntrinsicType(1 /* Any */, \"any\");\r\n var stringType = createIntrinsicType(2 /* String */, \"string\");\r\n var numberType = createIntrinsicType(4 /* Number */, \"number\");\r\n var booleanType = createIntrinsicType(8 /* Boolean */, \"boolean\");\r\n var voidType = createIntrinsicType(16 /* Void */, \"void\");\r\n var undefinedType = createIntrinsicType(32 /* Undefined */, \"undefined\");\r\n var nullType = createIntrinsicType(64 /* Null */, \"null\");\r\n var unknownType = createIntrinsicType(1 /* Any */, \"unknown\");\r\n var resolvingType = createIntrinsicType(1 /* Any */, \"__resolving__\");\r\n var emptyObjectType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);\r\n var anyFunctionType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);\r\n var noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);\r\n var inferenceFailureType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined);\r\n var anySignature = createSignature(undefined, undefined, emptyArray, anyType, 0, false, false);\r\n var unknownSignature = createSignature(undefined, undefined, emptyArray, unknownType, 0, false, false);\r\n var globals = {};\r\n var globalArraySymbol;\r\n var globalObjectType;\r\n var globalFunctionType;\r\n var globalArrayType;\r\n var globalStringType;\r\n var globalNumberType;\r\n var globalBooleanType;\r\n var globalRegExpType;\r\n var globalTemplateStringsArrayType;\r\n var tupleTypes = {};\r\n var unionTypes = {};\r\n var stringLiteralTypes = {};\r\n var emitExtends = false;\r\n var mergedSymbols = [];\r\n var symbolLinks = [];\r\n var nodeLinks = [];\r\n var potentialThisCollisions = [];\r\n var diagnostics = [];\r\n var diagnosticsModified = false;\r\n function addDiagnostic(diagnostic) {\r\n diagnostics.push(diagnostic);\r\n diagnosticsModified = true;\r\n }\r\n function error(location, message, arg0, arg1, arg2) {\r\n var diagnostic = location ? ts.createDiagnosticForNode(location, message, arg0, arg1, arg2) : ts.createCompilerDiagnostic(message, arg0, arg1, arg2);\r\n addDiagnostic(diagnostic);\r\n }\r\n function createSymbol(flags, name) {\r\n return new Symbol(flags, name);\r\n }\r\n function getExcludedSymbolFlags(flags) {\r\n var result = 0;\r\n if (flags & 2 /* BlockScopedVariable */)\r\n result |= 107455 /* BlockScopedVariableExcludes */;\r\n if (flags & 1 /* FunctionScopedVariable */)\r\n result |= 107454 /* FunctionScopedVariableExcludes */;\r\n if (flags & 4 /* Property */)\r\n result |= 107455 /* PropertyExcludes */;\r\n if (flags & 8 /* EnumMember */)\r\n result |= 107455 /* EnumMemberExcludes */;\r\n if (flags & 16 /* Function */)\r\n result |= 106927 /* FunctionExcludes */;\r\n if (flags & 32 /* Class */)\r\n result |= 3258879 /* ClassExcludes */;\r\n if (flags & 64 /* Interface */)\r\n result |= 3152288 /* InterfaceExcludes */;\r\n if (flags & 256 /* RegularEnum */)\r\n result |= 3258623 /* RegularEnumExcludes */;\r\n if (flags & 128 /* ConstEnum */)\r\n result |= 3259263 /* ConstEnumExcludes */;\r\n if (flags & 512 /* ValueModule */)\r\n result |= 106639 /* ValueModuleExcludes */;\r\n if (flags & 8192 /* Method */)\r\n result |= 99263 /* MethodExcludes */;\r\n if (flags & 32768 /* GetAccessor */)\r\n result |= 41919 /* GetAccessorExcludes */;\r\n if (flags & 65536 /* SetAccessor */)\r\n result |= 74687 /* SetAccessorExcludes */;\r\n if (flags & 1048576 /* TypeParameter */)\r\n result |= 2103776 /* TypeParameterExcludes */;\r\n if (flags & 2097152 /* TypeAlias */)\r\n result |= 3152352 /* TypeAliasExcludes */;\r\n if (flags & 33554432 /* Import */)\r\n result |= 33554432 /* ImportExcludes */;\r\n return result;\r\n }\r\n function recordMergedSymbol(target, source) {\r\n if (!source.mergeId)\r\n source.mergeId = nextMergeId++;\r\n mergedSymbols[source.mergeId] = target;\r\n }\r\n function cloneSymbol(symbol) {\r\n var result = createSymbol(symbol.flags | 134217728 /* Merged */, symbol.name);\r\n result.declarations = symbol.declarations.slice(0);\r\n result.parent = symbol.parent;\r\n if (symbol.valueDeclaration)\r\n result.valueDeclaration = symbol.valueDeclaration;\r\n if (symbol.constEnumOnlyModule)\r\n result.constEnumOnlyModule = true;\r\n if (symbol.members)\r\n result.members = cloneSymbolTable(symbol.members);\r\n if (symbol.exports)\r\n result.exports = cloneSymbolTable(symbol.exports);\r\n recordMergedSymbol(result, symbol);\r\n return result;\r\n }\r\n function extendSymbol(target, source) {\r\n if (!(target.flags & getExcludedSymbolFlags(source.flags))) {\r\n if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) {\r\n // reset flag when merging instantiated module into value module that has only const enums\r\n target.constEnumOnlyModule = false;\r\n }\r\n target.flags |= source.flags;\r\n if (!target.valueDeclaration && source.valueDeclaration)\r\n target.valueDeclaration = source.valueDeclaration;\r\n ts.forEach(source.declarations, function (node) {\r\n target.declarations.push(node);\r\n });\r\n if (source.members) {\r\n if (!target.members)\r\n target.members = {};\r\n extendSymbolTable(target.members, source.members);\r\n }\r\n if (source.exports) {\r\n if (!target.exports)\r\n target.exports = {};\r\n extendSymbolTable(target.exports, source.exports);\r\n }\r\n recordMergedSymbol(target, source);\r\n }\r\n else {\r\n var message = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0;\r\n ts.forEach(source.declarations, function (node) {\r\n error(node.name ? node.name : node, message, symbolToString(source));\r\n });\r\n ts.forEach(target.declarations, function (node) {\r\n error(node.name ? node.name : node, message, symbolToString(source));\r\n });\r\n }\r\n }\r\n function cloneSymbolTable(symbolTable) {\r\n var result = {};\r\n for (var id in symbolTable) {\r\n if (ts.hasProperty(symbolTable, id)) {\r\n result[id] = symbolTable[id];\r\n }\r\n }\r\n return result;\r\n }\r\n function extendSymbolTable(target, source) {\r\n for (var id in source) {\r\n if (ts.hasProperty(source, id)) {\r\n if (!ts.hasProperty(target, id)) {\r\n target[id] = source[id];\r\n }\r\n else {\r\n var symbol = target[id];\r\n if (!(symbol.flags & 134217728 /* Merged */)) {\r\n target[id] = symbol = cloneSymbol(symbol);\r\n }\r\n extendSymbol(symbol, source[id]);\r\n }\r\n }\r\n }\r\n }\r\n function getSymbolLinks(symbol) {\r\n if (symbol.flags & 268435456 /* Transient */)\r\n return symbol;\r\n if (!symbol.id)\r\n symbol.id = nextSymbolId++;\r\n return symbolLinks[symbol.id] || (symbolLinks[symbol.id] = {});\r\n }\r\n function getNodeLinks(node) {\r\n if (!node.id)\r\n node.id = nextNodeId++;\r\n return nodeLinks[node.id] || (nodeLinks[node.id] = {});\r\n }\r\n function getSourceFile(node) {\r\n return ts.getAncestor(node, 201 /* SourceFile */);\r\n }\r\n function isGlobalSourceFile(node) {\r\n return node.kind === 201 /* SourceFile */ && !ts.isExternalModule(node);\r\n }\r\n function getSymbol(symbols, name, meaning) {\r\n if (meaning && ts.hasProperty(symbols, name)) {\r\n var symbol = symbols[name];\r\n ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, \"Should never get an instantiated symbol here.\");\r\n if (symbol.flags & meaning) {\r\n return symbol;\r\n }\r\n if (symbol.flags & 33554432 /* Import */) {\r\n var target = resolveImport(symbol);\r\n // unknown symbol will mean that there were reported error during import resolution\r\n // treat it as positive answer to avoid cascading errors\r\n if (target === unknownSymbol || target.flags & meaning) {\r\n return symbol;\r\n }\r\n }\r\n }\r\n // return undefined if we can't find a symbol.\r\n }\r\n /** Returns true if node1 is defined before node 2**/\r\n function isDefinedBefore(node1, node2) {\r\n var file1 = ts.getSourceFileOfNode(node1);\r\n var file2 = ts.getSourceFileOfNode(node2);\r\n if (file1 === file2) {\r\n return node1.pos <= node2.pos;\r\n }\r\n if (!compilerOptions.out) {\r\n return true;\r\n }\r\n var sourceFiles = program.getSourceFiles();\r\n return sourceFiles.indexOf(file1) <= sourceFiles.indexOf(file2);\r\n }\r\n // Resolve a given name for a given meaning at a given location. An error is reported if the name was not found and\r\n // the nameNotFoundMessage argument is not undefined. Returns the resolved symbol, or undefined if no symbol with\r\n // the given name can be found.\r\n function resolveName(location, name, meaning, nameNotFoundMessage, nameArg) {\r\n var result;\r\n var lastLocation;\r\n var propertyWithInvalidInitializer;\r\n var errorLocation = location;\r\n loop: while (location) {\r\n // Locals of a source file are not in scope (because they get merged into the global symbol table)\r\n if (location.locals && !isGlobalSourceFile(location)) {\r\n if (result = getSymbol(location.locals, name, meaning)) {\r\n break loop;\r\n }\r\n }\r\n switch (location.kind) {\r\n case 201 /* SourceFile */:\r\n if (!ts.isExternalModule(location))\r\n break;\r\n case 189 /* ModuleDeclaration */:\r\n if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 35653619 /* ModuleMember */)) {\r\n break loop;\r\n }\r\n break;\r\n case 188 /* EnumDeclaration */:\r\n if (result = getSymbol(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) {\r\n break loop;\r\n }\r\n break;\r\n case 124 /* Property */:\r\n // TypeScript 1.0 spec (April 2014): 8.4.1\r\n // Initializer expressions for instance member variables are evaluated in the scope \r\n // of the class constructor body but are not permitted to reference parameters or \r\n // local variables of the constructor. This effectively means that entities from outer scopes \r\n // by the same name as a constructor parameter or local variable are inaccessible \r\n // in initializer expressions for instance member variables.\r\n if (location.parent.kind === 185 /* ClassDeclaration */ && !(location.flags & 128 /* Static */)) {\r\n var ctor = findConstructorDeclaration(location.parent);\r\n if (ctor && ctor.locals) {\r\n if (getSymbol(ctor.locals, name, meaning & 107455 /* Value */)) {\r\n // Remember the property node, it will be used later to report appropriate error\r\n propertyWithInvalidInitializer = location;\r\n }\r\n }\r\n }\r\n break;\r\n case 185 /* ClassDeclaration */:\r\n case 186 /* InterfaceDeclaration */:\r\n if (result = getSymbol(getSymbolOfNode(location).members, name, meaning & 3152352 /* Type */)) {\r\n if (lastLocation && lastLocation.flags & 128 /* Static */) {\r\n // TypeScript 1.0 spec (April 2014): 3.4.1\r\n // The scope of a type parameter extends over the entire declaration with which the type\r\n // parameter list is associated, with the exception of static member declarations in classes.\r\n error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);\r\n return undefined;\r\n }\r\n break loop;\r\n }\r\n break;\r\n case 125 /* Method */:\r\n case 126 /* Constructor */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n case 184 /* FunctionDeclaration */:\r\n case 151 /* ArrowFunction */:\r\n if (name === \"arguments\") {\r\n result = argumentsSymbol;\r\n break loop;\r\n }\r\n break;\r\n case 150 /* FunctionExpression */:\r\n if (name === \"arguments\") {\r\n result = argumentsSymbol;\r\n break loop;\r\n }\r\n var id = location.name;\r\n if (id && name === id.text) {\r\n result = location.symbol;\r\n break loop;\r\n }\r\n break;\r\n case 197 /* CatchClause */:\r\n var id = location.name;\r\n if (name === id.text) {\r\n result = location.symbol;\r\n break loop;\r\n }\r\n break;\r\n }\r\n lastLocation = location;\r\n location = location.parent;\r\n }\r\n if (!result) {\r\n result = getSymbol(globals, name, meaning);\r\n }\r\n if (!result) {\r\n if (nameNotFoundMessage) {\r\n error(errorLocation, nameNotFoundMessage, typeof nameArg === \"string\" ? nameArg : ts.declarationNameToString(nameArg));\r\n }\r\n return undefined;\r\n }\r\n // Perform extra checks only if error reporting was requested\r\n if (nameNotFoundMessage) {\r\n if (propertyWithInvalidInitializer) {\r\n // We have a match, but the reference occurred within a property initializer and the identifier also binds\r\n // to a local variable in the constructor where the code will be emitted.\r\n var propertyName = propertyWithInvalidInitializer.name;\r\n error(errorLocation, ts.Diagnostics.Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor, ts.declarationNameToString(propertyName), typeof nameArg === \"string\" ? nameArg : ts.declarationNameToString(nameArg));\r\n return undefined;\r\n }\r\n if (result.flags & 2 /* BlockScopedVariable */) {\r\n // Block-scoped variables cannot be used before their definition\r\n var declaration = ts.forEach(result.declarations, function (d) { return d.flags & 6144 /* BlockScoped */ ? d : undefined; });\r\n ts.Debug.assert(declaration !== undefined, \"Block-scoped variable declaration is undefined\");\r\n if (!isDefinedBefore(declaration, errorLocation)) {\r\n error(errorLocation, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.declarationNameToString(declaration.name));\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function resolveImport(symbol) {\r\n ts.Debug.assert((symbol.flags & 33554432 /* Import */) !== 0, \"Should only get Imports here.\");\r\n var links = getSymbolLinks(symbol);\r\n if (!links.target) {\r\n links.target = resolvingSymbol;\r\n var node = getDeclarationOfKind(symbol, 191 /* ImportDeclaration */);\r\n var target = node.moduleReference.kind === 193 /* ExternalModuleReference */ ? resolveExternalModuleName(node, ts.getExternalModuleImportDeclarationExpression(node)) : getSymbolOfPartOfRightHandSideOfImport(node.moduleReference, node);\r\n if (links.target === resolvingSymbol) {\r\n links.target = target || unknownSymbol;\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Circular_definition_of_import_alias_0, symbolToString(symbol));\r\n }\r\n }\r\n else if (links.target === resolvingSymbol) {\r\n links.target = unknownSymbol;\r\n }\r\n return links.target;\r\n }\r\n // This function is only for imports with entity names\r\n function getSymbolOfPartOfRightHandSideOfImport(entityName, importDeclaration) {\r\n if (!importDeclaration) {\r\n importDeclaration = ts.getAncestor(entityName, 191 /* ImportDeclaration */);\r\n ts.Debug.assert(importDeclaration !== undefined);\r\n }\r\n // There are three things we might try to look for. In the following examples,\r\n // the search term is enclosed in |...|:\r\n //\r\n // import a = |b|; // Namespace\r\n // import a = |b.c|; // Value, type, namespace\r\n // import a = |b.c|.d; // Namespace\r\n if (entityName.kind === 63 /* Identifier */ && isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {\r\n entityName = entityName.parent;\r\n }\r\n // Check for case 1 and 3 in the above example\r\n if (entityName.kind === 63 /* Identifier */ || entityName.parent.kind === 120 /* QualifiedName */) {\r\n return resolveEntityName(importDeclaration, entityName, 1536 /* Namespace */);\r\n }\r\n else {\r\n // Case 2 in above example\r\n // entityName.kind could be a QualifiedName or a Missing identifier\r\n ts.Debug.assert(entityName.parent.kind === 191 /* ImportDeclaration */);\r\n return resolveEntityName(importDeclaration, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */);\r\n }\r\n }\r\n function getFullyQualifiedName(symbol) {\r\n return symbol.parent ? getFullyQualifiedName(symbol.parent) + \".\" + symbolToString(symbol) : symbolToString(symbol);\r\n }\r\n // Resolves a qualified name and any involved import aliases\r\n function resolveEntityName(location, name, meaning) {\r\n if (ts.getFullWidth(name) === 0) {\r\n return undefined;\r\n }\r\n if (name.kind === 63 /* Identifier */) {\r\n var symbol = resolveName(location, name.text, meaning, ts.Diagnostics.Cannot_find_name_0, name);\r\n if (!symbol) {\r\n return;\r\n }\r\n }\r\n else if (name.kind === 120 /* QualifiedName */) {\r\n var namespace = resolveEntityName(location, name.left, 1536 /* Namespace */);\r\n if (!namespace || namespace === unknownSymbol || ts.getFullWidth(name.right) === 0)\r\n return;\r\n var symbol = getSymbol(namespace.exports, name.right.text, meaning);\r\n if (!symbol) {\r\n error(location, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(namespace), ts.declarationNameToString(name.right));\r\n return;\r\n }\r\n }\r\n ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0, \"Should never get an instantiated symbol here.\");\r\n return symbol.flags & meaning ? symbol : resolveImport(symbol);\r\n }\r\n function isExternalModuleNameRelative(moduleName) {\r\n // TypeScript 1.0 spec (April 2014): 11.2.1\r\n // An external module name is \"relative\" if the first term is \".\" or \"..\".\r\n return moduleName.substr(0, 2) === \"./\" || moduleName.substr(0, 3) === \"../\" || moduleName.substr(0, 2) === \".\\\\\" || moduleName.substr(0, 3) === \"..\\\\\";\r\n }\r\n function resolveExternalModuleName(location, moduleReferenceExpression) {\r\n if (moduleReferenceExpression.kind !== 7 /* StringLiteral */) {\r\n return;\r\n }\r\n var moduleReferenceLiteral = moduleReferenceExpression;\r\n var searchPath = ts.getDirectoryPath(getSourceFile(location).filename);\r\n // Module names are escaped in our symbol table. However, string literal values aren't.\r\n // Escape the name in the \"require(...)\" clause to ensure we find the right symbol.\r\n var moduleName = ts.escapeIdentifier(moduleReferenceLiteral.text);\r\n if (!moduleName)\r\n return;\r\n var isRelative = isExternalModuleNameRelative(moduleName);\r\n if (!isRelative) {\r\n var symbol = getSymbol(globals, '\"' + moduleName + '\"', 512 /* ValueModule */);\r\n if (symbol) {\r\n return getResolvedExportSymbol(symbol);\r\n }\r\n }\r\n while (true) {\r\n var filename = ts.normalizePath(ts.combinePaths(searchPath, moduleName));\r\n var sourceFile = program.getSourceFile(filename + \".ts\") || program.getSourceFile(filename + \".d.ts\");\r\n if (sourceFile || isRelative)\r\n break;\r\n var parentPath = ts.getDirectoryPath(searchPath);\r\n if (parentPath === searchPath)\r\n break;\r\n searchPath = parentPath;\r\n }\r\n if (sourceFile) {\r\n if (sourceFile.symbol) {\r\n return getResolvedExportSymbol(sourceFile.symbol);\r\n }\r\n error(moduleReferenceLiteral, ts.Diagnostics.File_0_is_not_an_external_module, sourceFile.filename);\r\n return;\r\n }\r\n error(moduleReferenceLiteral, ts.Diagnostics.Cannot_find_external_module_0, moduleName);\r\n }\r\n function getResolvedExportSymbol(moduleSymbol) {\r\n var symbol = getExportAssignmentSymbol(moduleSymbol);\r\n if (symbol) {\r\n if (symbol.flags & (107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */)) {\r\n return symbol;\r\n }\r\n if (symbol.flags & 33554432 /* Import */) {\r\n return resolveImport(symbol);\r\n }\r\n }\r\n return moduleSymbol;\r\n }\r\n function getExportAssignmentSymbol(symbol) {\r\n checkTypeOfExportAssignmentSymbol(symbol);\r\n var symbolLinks = getSymbolLinks(symbol);\r\n return symbolLinks.exportAssignSymbol === unknownSymbol ? undefined : symbolLinks.exportAssignSymbol;\r\n }\r\n function checkTypeOfExportAssignmentSymbol(containerSymbol) {\r\n var symbolLinks = getSymbolLinks(containerSymbol);\r\n if (!symbolLinks.exportAssignSymbol) {\r\n var exportInformation = collectExportInformationForSourceFileOrModule(containerSymbol);\r\n if (exportInformation.exportAssignments.length) {\r\n if (exportInformation.exportAssignments.length > 1) {\r\n // TypeScript 1.0 spec (April 2014): 11.2.4\r\n // It is an error for an external module to contain more than one export assignment.\r\n ts.forEach(exportInformation.exportAssignments, function (node) { return error(node, ts.Diagnostics.A_module_cannot_have_more_than_one_export_assignment); });\r\n }\r\n var node = exportInformation.exportAssignments[0];\r\n if (exportInformation.hasExportedMember) {\r\n // TypeScript 1.0 spec (April 2014): 11.2.3\r\n // If an external module contains an export assignment it is an error \r\n // for the external module to also contain export declarations.\r\n // The two types of exports are mutually exclusive.\r\n error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);\r\n }\r\n if (node.exportName.text) {\r\n var meaning = 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */;\r\n var exportSymbol = resolveName(node, node.exportName.text, meaning, ts.Diagnostics.Cannot_find_name_0, node.exportName);\r\n }\r\n }\r\n symbolLinks.exportAssignSymbol = exportSymbol || unknownSymbol;\r\n }\r\n }\r\n function collectExportInformationForSourceFileOrModule(symbol) {\r\n var seenExportedMember = false;\r\n var result = [];\r\n ts.forEach(symbol.declarations, function (declaration) {\r\n var block = (declaration.kind === 201 /* SourceFile */ ? declaration : declaration.body);\r\n ts.forEach(block.statements, function (node) {\r\n if (node.kind === 192 /* ExportAssignment */) {\r\n result.push(node);\r\n }\r\n else {\r\n seenExportedMember = seenExportedMember || (node.flags & 1 /* Export */) !== 0;\r\n }\r\n });\r\n });\r\n return {\r\n hasExportedMember: seenExportedMember,\r\n exportAssignments: result\r\n };\r\n }\r\n function getMergedSymbol(symbol) {\r\n var merged;\r\n return symbol && symbol.mergeId && (merged = mergedSymbols[symbol.mergeId]) ? merged : symbol;\r\n }\r\n function getSymbolOfNode(node) {\r\n return getMergedSymbol(node.symbol);\r\n }\r\n function getParentOfSymbol(symbol) {\r\n return getMergedSymbol(symbol.parent);\r\n }\r\n function getExportSymbolOfValueSymbolIfExported(symbol) {\r\n return symbol && (symbol.flags & 4194304 /* ExportValue */) !== 0 ? getMergedSymbol(symbol.exportSymbol) : symbol;\r\n }\r\n function symbolIsValue(symbol) {\r\n // If it is an instantiated symbol, then it is a value if the symbol it is an\r\n // instantiation of is a value.\r\n if (symbol.flags & 67108864 /* Instantiated */) {\r\n return symbolIsValue(getSymbolLinks(symbol).target);\r\n }\r\n // If the symbol has the value flag, it is trivially a value.\r\n if (symbol.flags & 107455 /* Value */) {\r\n return true;\r\n }\r\n // If it is an import, then it is a value if the symbol it resolves to is a value.\r\n if (symbol.flags & 33554432 /* Import */) {\r\n return (resolveImport(symbol).flags & 107455 /* Value */) !== 0;\r\n }\r\n return false;\r\n }\r\n function findConstructorDeclaration(node) {\r\n var members = node.members;\r\n for (var i = 0; i < members.length; i++) {\r\n var member = members[i];\r\n if (member.kind === 126 /* Constructor */ && member.body) {\r\n return member;\r\n }\r\n }\r\n }\r\n function createType(flags) {\r\n var result = new Type(checker, flags);\r\n result.id = typeCount++;\r\n return result;\r\n }\r\n function createIntrinsicType(kind, intrinsicName) {\r\n var type = createType(kind);\r\n type.intrinsicName = intrinsicName;\r\n return type;\r\n }\r\n function createObjectType(kind, symbol) {\r\n var type = createType(kind);\r\n type.symbol = symbol;\r\n return type;\r\n }\r\n // A reserved member name starts with two underscores followed by a non-underscore\r\n function isReservedMemberName(name) {\r\n return name.charCodeAt(0) === 95 /* _ */ && name.charCodeAt(1) === 95 /* _ */ && name.charCodeAt(2) !== 95 /* _ */;\r\n }\r\n function getNamedMembers(members) {\r\n var result;\r\n for (var id in members) {\r\n if (ts.hasProperty(members, id)) {\r\n if (!isReservedMemberName(id)) {\r\n if (!result)\r\n result = [];\r\n var symbol = members[id];\r\n if (symbolIsValue(symbol)) {\r\n result.push(symbol);\r\n }\r\n }\r\n }\r\n }\r\n return result || emptyArray;\r\n }\r\n function setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) {\r\n type.members = members;\r\n type.properties = getNamedMembers(members);\r\n type.callSignatures = callSignatures;\r\n type.constructSignatures = constructSignatures;\r\n if (stringIndexType)\r\n type.stringIndexType = stringIndexType;\r\n if (numberIndexType)\r\n type.numberIndexType = numberIndexType;\r\n return type;\r\n }\r\n function createAnonymousType(symbol, members, callSignatures, constructSignatures, stringIndexType, numberIndexType) {\r\n return setObjectTypeMembers(createObjectType(32768 /* Anonymous */, symbol), members, callSignatures, constructSignatures, stringIndexType, numberIndexType);\r\n }\r\n function isOptionalProperty(propertySymbol) {\r\n // class C {\r\n // constructor(public x?) { }\r\n // }\r\n //\r\n // x is an optional parameter, but it is a required property.\r\n return propertySymbol.valueDeclaration && ts.hasQuestionToken(propertySymbol.valueDeclaration) && propertySymbol.valueDeclaration.kind !== 123 /* Parameter */;\r\n }\r\n function forEachSymbolTableInScope(enclosingDeclaration, callback) {\r\n var result;\r\n for (var location = enclosingDeclaration; location; location = location.parent) {\r\n // Locals of a source file are not in scope (because they get merged into the global symbol table)\r\n if (location.locals && !isGlobalSourceFile(location)) {\r\n if (result = callback(location.locals)) {\r\n return result;\r\n }\r\n }\r\n switch (location.kind) {\r\n case 201 /* SourceFile */:\r\n if (!ts.isExternalModule(location)) {\r\n break;\r\n }\r\n case 189 /* ModuleDeclaration */:\r\n if (result = callback(getSymbolOfNode(location).exports)) {\r\n return result;\r\n }\r\n break;\r\n case 185 /* ClassDeclaration */:\r\n case 186 /* InterfaceDeclaration */:\r\n if (result = callback(getSymbolOfNode(location).members)) {\r\n return result;\r\n }\r\n break;\r\n }\r\n }\r\n return callback(globals);\r\n }\r\n function getQualifiedLeftMeaning(rightMeaning) {\r\n // If we are looking in value space, the parent meaning is value, other wise it is namespace\r\n return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1536 /* Namespace */;\r\n }\r\n function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) {\r\n function getAccessibleSymbolChainFromSymbolTable(symbols) {\r\n function canQualifySymbol(symbolFromSymbolTable, meaning) {\r\n // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible\r\n if (!needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning)) {\r\n return true;\r\n }\r\n // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too\r\n var accessibleParent = getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing);\r\n return !!accessibleParent;\r\n }\r\n function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol) {\r\n if (symbol === (resolvedAliasSymbol || symbolFromSymbolTable)) {\r\n // if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table)\r\n // and if symbolfrom symbolTable or alias resolution matches the symbol, \r\n // check the symbol can be qualified, it is only then this symbol is accessible\r\n return !ts.forEach(symbolFromSymbolTable.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); }) && canQualifySymbol(symbolFromSymbolTable, meaning);\r\n }\r\n }\r\n // If symbol is directly available by its name in the symbol table\r\n if (isAccessible(ts.lookUp(symbols, symbol.name))) {\r\n return [symbol];\r\n }\r\n // Check if symbol is any of the alias\r\n return ts.forEachValue(symbols, function (symbolFromSymbolTable) {\r\n if (symbolFromSymbolTable.flags & 33554432 /* Import */) {\r\n if (!useOnlyExternalAliasing || ts.forEach(symbolFromSymbolTable.declarations, ts.isExternalModuleImportDeclaration)) {\r\n var resolvedImportedSymbol = resolveImport(symbolFromSymbolTable);\r\n if (isAccessible(symbolFromSymbolTable, resolveImport(symbolFromSymbolTable))) {\r\n return [symbolFromSymbolTable];\r\n }\r\n // Look in the exported members, if we can find accessibleSymbolChain, symbol is accessible using this chain\r\n // but only if the symbolFromSymbolTable can be qualified\r\n var accessibleSymbolsFromExports = resolvedImportedSymbol.exports ? getAccessibleSymbolChainFromSymbolTable(resolvedImportedSymbol.exports) : undefined;\r\n if (accessibleSymbolsFromExports && canQualifySymbol(symbolFromSymbolTable, getQualifiedLeftMeaning(meaning))) {\r\n return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n if (symbol) {\r\n return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable);\r\n }\r\n }\r\n function needsQualification(symbol, enclosingDeclaration, meaning) {\r\n var qualify = false;\r\n forEachSymbolTableInScope(enclosingDeclaration, function (symbolTable) {\r\n // If symbol of this name is not available in the symbol table we are ok\r\n if (!ts.hasProperty(symbolTable, symbol.name)) {\r\n // Continue to the next symbol table\r\n return false;\r\n }\r\n // If the symbol with this name is present it should refer to the symbol\r\n var symbolFromSymbolTable = symbolTable[symbol.name];\r\n if (symbolFromSymbolTable === symbol) {\r\n // No need to qualify\r\n return true;\r\n }\r\n // Qualify if the symbol from symbol table has same meaning as expected\r\n symbolFromSymbolTable = (symbolFromSymbolTable.flags & 33554432 /* Import */) ? resolveImport(symbolFromSymbolTable) : symbolFromSymbolTable;\r\n if (symbolFromSymbolTable.flags & meaning) {\r\n qualify = true;\r\n return true;\r\n }\r\n // Continue to the next symbol table\r\n return false;\r\n });\r\n return qualify;\r\n }\r\n function isSymbolAccessible(symbol, enclosingDeclaration, meaning) {\r\n if (symbol && enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) {\r\n var initialSymbol = symbol;\r\n var meaningToLook = meaning;\r\n while (symbol) {\r\n // Symbol is accessible if it by itself is accessible\r\n var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaningToLook, false);\r\n if (accessibleSymbolChain) {\r\n var hasAccessibleDeclarations = hasVisibleDeclarations(accessibleSymbolChain[0]);\r\n if (!hasAccessibleDeclarations) {\r\n return {\r\n accessibility: 1 /* NotAccessible */,\r\n errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),\r\n errorModuleName: symbol !== initialSymbol ? symbolToString(symbol, enclosingDeclaration, 1536 /* Namespace */) : undefined\r\n };\r\n }\r\n return hasAccessibleDeclarations;\r\n }\r\n // If we haven't got the accessible symbol, it doesn't mean the symbol is actually inaccessible.\r\n // It could be a qualified symbol and hence verify the path\r\n // e.g.:\r\n // module m {\r\n // export class c {\r\n // }\r\n // }\r\n // var x: typeof m.c\r\n // In the above example when we start with checking if typeof m.c symbol is accessible,\r\n // we are going to see if c can be accessed in scope directly. \r\n // But it can't, hence the accessible is going to be undefined, but that doesn't mean m.c is inaccessible\r\n // It is accessible if the parent m is accessible because then m.c can be accessed through qualification\r\n meaningToLook = getQualifiedLeftMeaning(meaning);\r\n symbol = getParentOfSymbol(symbol);\r\n }\r\n // This could be a symbol that is not exported in the external module \r\n // or it could be a symbol from different external module that is not aliased and hence cannot be named\r\n var symbolExternalModule = ts.forEach(initialSymbol.declarations, function (declaration) { return getExternalModuleContainer(declaration); });\r\n if (symbolExternalModule) {\r\n var enclosingExternalModule = getExternalModuleContainer(enclosingDeclaration);\r\n if (symbolExternalModule !== enclosingExternalModule) {\r\n // name from different external module that is not visible\r\n return {\r\n accessibility: 2 /* CannotBeNamed */,\r\n errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning),\r\n errorModuleName: symbolToString(symbolExternalModule)\r\n };\r\n }\r\n }\r\n // Just a local name that is not accessible\r\n return {\r\n accessibility: 1 /* NotAccessible */,\r\n errorSymbolName: symbolToString(initialSymbol, enclosingDeclaration, meaning)\r\n };\r\n }\r\n return { accessibility: 0 /* Accessible */ };\r\n function getExternalModuleContainer(declaration) {\r\n for (; declaration; declaration = declaration.parent) {\r\n if (hasExternalModuleSymbol(declaration)) {\r\n return getSymbolOfNode(declaration);\r\n }\r\n }\r\n }\r\n }\r\n function hasExternalModuleSymbol(declaration) {\r\n return (declaration.kind === 189 /* ModuleDeclaration */ && declaration.name.kind === 7 /* StringLiteral */) || (declaration.kind === 201 /* SourceFile */ && ts.isExternalModule(declaration));\r\n }\r\n function hasVisibleDeclarations(symbol) {\r\n var aliasesToMakeVisible;\r\n if (ts.forEach(symbol.declarations, function (declaration) { return !getIsDeclarationVisible(declaration); })) {\r\n return undefined;\r\n }\r\n return { accessibility: 0 /* Accessible */, aliasesToMakeVisible: aliasesToMakeVisible };\r\n function getIsDeclarationVisible(declaration) {\r\n if (!isDeclarationVisible(declaration)) {\r\n // Mark the unexported alias as visible if its parent is visible \r\n // because these kind of aliases can be used to name types in declaration file\r\n if (declaration.kind === 191 /* ImportDeclaration */ && !(declaration.flags & 1 /* Export */) && isDeclarationVisible(declaration.parent)) {\r\n getNodeLinks(declaration).isVisible = true;\r\n if (aliasesToMakeVisible) {\r\n if (!ts.contains(aliasesToMakeVisible, declaration)) {\r\n aliasesToMakeVisible.push(declaration);\r\n }\r\n }\r\n else {\r\n aliasesToMakeVisible = [declaration];\r\n }\r\n return true;\r\n }\r\n // Declaration is not visible\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n function isEntityNameVisible(entityName, enclosingDeclaration) {\r\n // get symbol of the first identifier of the entityName\r\n var meaning;\r\n if (entityName.parent.kind === 135 /* TypeQuery */) {\r\n // Typeof value\r\n meaning = 107455 /* Value */ | 4194304 /* ExportValue */;\r\n }\r\n else if (entityName.kind === 120 /* QualifiedName */ || entityName.parent.kind === 191 /* ImportDeclaration */) {\r\n // Left identifier from type reference or TypeAlias\r\n // Entity name of the import declaration \r\n meaning = 1536 /* Namespace */;\r\n }\r\n else {\r\n // Type Reference or TypeAlias entity = Identifier\r\n meaning = 3152352 /* Type */;\r\n }\r\n var firstIdentifier = getFirstIdentifier(entityName);\r\n var symbol = resolveName(enclosingDeclaration, firstIdentifier.text, meaning, undefined, undefined);\r\n // Verify if the symbol is accessible\r\n return hasVisibleDeclarations(symbol) || {\r\n accessibility: 1 /* NotAccessible */,\r\n errorSymbolName: ts.getTextOfNode(firstIdentifier),\r\n errorNode: firstIdentifier\r\n };\r\n }\r\n function releaseStringWriter(writer) {\r\n writer.clear();\r\n stringWriters.push(writer);\r\n }\r\n function writeKeyword(writer, kind) {\r\n writer.writeKeyword(ts.tokenToString(kind));\r\n }\r\n function writePunctuation(writer, kind) {\r\n writer.writePunctuation(ts.tokenToString(kind));\r\n }\r\n function writeSpace(writer) {\r\n writer.writeSpace(\" \");\r\n }\r\n function symbolToString(symbol, enclosingDeclaration, meaning) {\r\n var writer = getSingleLineStringWriter();\r\n getSymbolDisplayBuilder().buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning);\r\n var result = writer.string();\r\n releaseStringWriter(writer);\r\n return result;\r\n }\r\n function typeToString(type, enclosingDeclaration, flags) {\r\n var writer = getSingleLineStringWriter();\r\n getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags);\r\n var result = writer.string();\r\n releaseStringWriter(writer);\r\n var maxLength = compilerOptions.noErrorTruncation || flags & 4 /* NoTruncation */ ? undefined : 100;\r\n if (maxLength && result.length >= maxLength) {\r\n result = result.substr(0, maxLength - \"...\".length) + \"...\";\r\n }\r\n return result;\r\n }\r\n function getTypeAliasForTypeLiteral(type) {\r\n if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) {\r\n var node = type.symbol.declarations[0].parent;\r\n while (node.kind === 140 /* ParenthesizedType */) {\r\n node = node.parent;\r\n }\r\n if (node.kind === 187 /* TypeAliasDeclaration */) {\r\n return getSymbolOfNode(node);\r\n }\r\n }\r\n return undefined;\r\n }\r\n // This is for caching the result of getSymbolDisplayBuilder. Do not access directly.\r\n var _displayBuilder;\r\n function getSymbolDisplayBuilder() {\r\n /**\r\n * Writes only the name of the symbol out to the writer. Uses the original source text\r\n * for the name of the symbol if it is available to match how the user inputted the name.\r\n */\r\n function appendSymbolNameOnly(symbol, writer) {\r\n if (symbol.declarations && symbol.declarations.length > 0) {\r\n var declaration = symbol.declarations[0];\r\n if (declaration.name) {\r\n writer.writeSymbol(ts.declarationNameToString(declaration.name), symbol);\r\n return;\r\n }\r\n }\r\n writer.writeSymbol(symbol.name, symbol);\r\n }\r\n /**\r\n * Enclosing declaration is optional when we don't want to get qualified name in the enclosing declaration scope\r\n * Meaning needs to be specified if the enclosing declaration is given\r\n */\r\n function buildSymbolDisplay(symbol, writer, enclosingDeclaration, meaning, flags) {\r\n var parentSymbol;\r\n function appendParentTypeArgumentsAndSymbolName(symbol) {\r\n if (parentSymbol) {\r\n // Write type arguments of instantiated class/interface here\r\n if (flags & 1 /* WriteTypeParametersOrArguments */) {\r\n if (symbol.flags & 67108864 /* Instantiated */) {\r\n buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol), symbol.mapper, writer, enclosingDeclaration);\r\n }\r\n else {\r\n buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration);\r\n }\r\n }\r\n writePunctuation(writer, 19 /* DotToken */);\r\n }\r\n parentSymbol = symbol;\r\n appendSymbolNameOnly(symbol, writer);\r\n }\r\n // Let the writer know we just wrote out a symbol. The declaration emitter writer uses \r\n // this to determine if an import it has previously seen (and not written out) needs \r\n // to be written to the file once the walk of the tree is complete.\r\n //\r\n // NOTE(cyrusn): This approach feels somewhat unfortunate. A simple pass over the tree\r\n // up front (for example, during checking) could determine if we need to emit the imports\r\n // and we could then access that data during declaration emit.\r\n writer.trackSymbol(symbol, enclosingDeclaration, meaning);\r\n function walkSymbol(symbol, meaning) {\r\n if (symbol) {\r\n var accessibleSymbolChain = getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, !!(flags & 2 /* UseOnlyExternalAliasing */));\r\n if (!accessibleSymbolChain || needsQualification(accessibleSymbolChain[0], enclosingDeclaration, accessibleSymbolChain.length === 1 ? meaning : getQualifiedLeftMeaning(meaning))) {\r\n // Go up and add our parent.\r\n walkSymbol(getParentOfSymbol(accessibleSymbolChain ? accessibleSymbolChain[0] : symbol), getQualifiedLeftMeaning(meaning));\r\n }\r\n if (accessibleSymbolChain) {\r\n for (var i = 0, n = accessibleSymbolChain.length; i < n; i++) {\r\n appendParentTypeArgumentsAndSymbolName(accessibleSymbolChain[i]);\r\n }\r\n }\r\n else {\r\n // If we didn't find accessible symbol chain for this symbol, break if this is external module\r\n if (!parentSymbol && ts.forEach(symbol.declarations, function (declaration) { return hasExternalModuleSymbol(declaration); })) {\r\n return;\r\n }\r\n // if this is anonymous type break\r\n if (symbol.flags & 2048 /* TypeLiteral */ || symbol.flags & 4096 /* ObjectLiteral */) {\r\n return;\r\n }\r\n appendParentTypeArgumentsAndSymbolName(symbol);\r\n }\r\n }\r\n }\r\n // Get qualified name \r\n if (enclosingDeclaration && !(symbol.flags & 1048576 /* TypeParameter */)) {\r\n walkSymbol(symbol, meaning);\r\n return;\r\n }\r\n return appendParentTypeArgumentsAndSymbolName(symbol);\r\n }\r\n function buildTypeDisplay(type, writer, enclosingDeclaration, globalFlags, typeStack) {\r\n var globalFlagsToPass = globalFlags & 16 /* WriteOwnNameForAnyLike */;\r\n return writeType(type, globalFlags);\r\n function writeType(type, flags) {\r\n // Write undefined/null type as any\r\n if (type.flags & 127 /* Intrinsic */) {\r\n // Special handling for unknown / resolving types, they should show up as any and not unknown or __resolving\r\n writer.writeKeyword(!(globalFlags & 16 /* WriteOwnNameForAnyLike */) && (type.flags & 1 /* Any */) ? \"any\" : type.intrinsicName);\r\n }\r\n else if (type.flags & 4096 /* Reference */) {\r\n writeTypeReference(type, flags);\r\n }\r\n else if (type.flags & (1024 /* Class */ | 2048 /* Interface */ | 128 /* Enum */ | 512 /* TypeParameter */)) {\r\n buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 3152352 /* Type */);\r\n }\r\n else if (type.flags & 8192 /* Tuple */) {\r\n writeTupleType(type);\r\n }\r\n else if (type.flags & 16384 /* Union */) {\r\n writeUnionType(type, flags);\r\n }\r\n else if (type.flags & 32768 /* Anonymous */) {\r\n writeAnonymousType(type, flags);\r\n }\r\n else if (type.flags & 256 /* StringLiteral */) {\r\n writer.writeStringLiteral(type.text);\r\n }\r\n else {\r\n // Should never get here\r\n // { ... }\r\n writePunctuation(writer, 13 /* OpenBraceToken */);\r\n writeSpace(writer);\r\n writePunctuation(writer, 20 /* DotDotDotToken */);\r\n writeSpace(writer);\r\n writePunctuation(writer, 14 /* CloseBraceToken */);\r\n }\r\n }\r\n function writeTypeList(types, union) {\r\n for (var i = 0; i < types.length; i++) {\r\n if (i > 0) {\r\n if (union) {\r\n writeSpace(writer);\r\n }\r\n writePunctuation(writer, union ? 43 /* BarToken */ : 22 /* CommaToken */);\r\n writeSpace(writer);\r\n }\r\n writeType(types[i], union ? 64 /* InElementType */ : 0 /* None */);\r\n }\r\n }\r\n function writeTypeReference(type, flags) {\r\n if (type.target === globalArrayType && !(flags & 1 /* WriteArrayAsGenericType */)) {\r\n writeType(type.typeArguments[0], 64 /* InElementType */);\r\n writePunctuation(writer, 17 /* OpenBracketToken */);\r\n writePunctuation(writer, 18 /* CloseBracketToken */);\r\n }\r\n else {\r\n buildSymbolDisplay(type.target.symbol, writer, enclosingDeclaration, 3152352 /* Type */);\r\n writePunctuation(writer, 23 /* LessThanToken */);\r\n writeTypeList(type.typeArguments, false);\r\n writePunctuation(writer, 24 /* GreaterThanToken */);\r\n }\r\n }\r\n function writeTupleType(type) {\r\n writePunctuation(writer, 17 /* OpenBracketToken */);\r\n writeTypeList(type.elementTypes, false);\r\n writePunctuation(writer, 18 /* CloseBracketToken */);\r\n }\r\n function writeUnionType(type, flags) {\r\n if (flags & 64 /* InElementType */) {\r\n writePunctuation(writer, 15 /* OpenParenToken */);\r\n }\r\n writeTypeList(type.types, true);\r\n if (flags & 64 /* InElementType */) {\r\n writePunctuation(writer, 16 /* CloseParenToken */);\r\n }\r\n }\r\n function writeAnonymousType(type, flags) {\r\n // Always use 'typeof T' for type of class, enum, and module objects\r\n if (type.symbol && type.symbol.flags & (32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {\r\n writeTypeofSymbol(type);\r\n }\r\n else if (shouldWriteTypeOfFunctionSymbol()) {\r\n writeTypeofSymbol(type);\r\n }\r\n else if (typeStack && ts.contains(typeStack, type)) {\r\n // If type is an anonymous type literal in a type alias declaration, use type alias name\r\n var typeAlias = getTypeAliasForTypeLiteral(type);\r\n if (typeAlias) {\r\n buildSymbolDisplay(typeAlias, writer, enclosingDeclaration, 3152352 /* Type */);\r\n }\r\n else {\r\n // Recursive usage, use any\r\n writeKeyword(writer, 109 /* AnyKeyword */);\r\n }\r\n }\r\n else {\r\n if (!typeStack) {\r\n typeStack = [];\r\n }\r\n typeStack.push(type);\r\n writeLiteralType(type, flags);\r\n typeStack.pop();\r\n }\r\n function shouldWriteTypeOfFunctionSymbol() {\r\n if (type.symbol) {\r\n var isStaticMethodSymbol = !!(type.symbol.flags & 8192 /* Method */ && ts.forEach(type.symbol.declarations, function (declaration) { return declaration.flags & 128 /* Static */; }));\r\n var isNonLocalFunctionSymbol = !!(type.symbol.flags & 16 /* Function */) && (type.symbol.parent || ts.forEach(type.symbol.declarations, function (declaration) { return declaration.parent.kind === 201 /* SourceFile */ || declaration.parent.kind === 190 /* ModuleBlock */; }));\r\n if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {\r\n // typeof is allowed only for static/non local functions\r\n return !!(flags & 2 /* UseTypeOfFunction */) || (typeStack && ts.contains(typeStack, type)); // it is type of the symbol uses itself recursively\r\n }\r\n }\r\n }\r\n }\r\n function writeTypeofSymbol(type) {\r\n writeKeyword(writer, 95 /* TypeOfKeyword */);\r\n writeSpace(writer);\r\n buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, 107455 /* Value */);\r\n }\r\n function writeLiteralType(type, flags) {\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n if (!resolved.properties.length && !resolved.stringIndexType && !resolved.numberIndexType) {\r\n if (!resolved.callSignatures.length && !resolved.constructSignatures.length) {\r\n writePunctuation(writer, 13 /* OpenBraceToken */);\r\n writePunctuation(writer, 14 /* CloseBraceToken */);\r\n return;\r\n }\r\n if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) {\r\n if (flags & 64 /* InElementType */) {\r\n writePunctuation(writer, 15 /* OpenParenToken */);\r\n }\r\n buildSignatureDisplay(resolved.callSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack);\r\n if (flags & 64 /* InElementType */) {\r\n writePunctuation(writer, 16 /* CloseParenToken */);\r\n }\r\n return;\r\n }\r\n if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) {\r\n if (flags & 64 /* InElementType */) {\r\n writePunctuation(writer, 15 /* OpenParenToken */);\r\n }\r\n writeKeyword(writer, 86 /* NewKeyword */);\r\n writeSpace(writer);\r\n buildSignatureDisplay(resolved.constructSignatures[0], writer, enclosingDeclaration, globalFlagsToPass | 8 /* WriteArrowStyleSignature */, typeStack);\r\n if (flags & 64 /* InElementType */) {\r\n writePunctuation(writer, 16 /* CloseParenToken */);\r\n }\r\n return;\r\n }\r\n }\r\n writePunctuation(writer, 13 /* OpenBraceToken */);\r\n writer.writeLine();\r\n writer.increaseIndent();\r\n for (var i = 0; i < resolved.callSignatures.length; i++) {\r\n buildSignatureDisplay(resolved.callSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack);\r\n writePunctuation(writer, 21 /* SemicolonToken */);\r\n writer.writeLine();\r\n }\r\n for (var i = 0; i < resolved.constructSignatures.length; i++) {\r\n writeKeyword(writer, 86 /* NewKeyword */);\r\n writeSpace(writer);\r\n buildSignatureDisplay(resolved.constructSignatures[i], writer, enclosingDeclaration, globalFlagsToPass, typeStack);\r\n writePunctuation(writer, 21 /* SemicolonToken */);\r\n writer.writeLine();\r\n }\r\n if (resolved.stringIndexType) {\r\n // [x: string]: \r\n writePunctuation(writer, 17 /* OpenBracketToken */);\r\n writer.writeParameter(\"x\");\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n writeSpace(writer);\r\n writeKeyword(writer, 118 /* StringKeyword */);\r\n writePunctuation(writer, 18 /* CloseBracketToken */);\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n writeSpace(writer);\r\n writeType(resolved.stringIndexType, 0 /* None */);\r\n writePunctuation(writer, 21 /* SemicolonToken */);\r\n writer.writeLine();\r\n }\r\n if (resolved.numberIndexType) {\r\n // [x: number]: \r\n writePunctuation(writer, 17 /* OpenBracketToken */);\r\n writer.writeParameter(\"x\");\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n writeSpace(writer);\r\n writeKeyword(writer, 116 /* NumberKeyword */);\r\n writePunctuation(writer, 18 /* CloseBracketToken */);\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n writeSpace(writer);\r\n writeType(resolved.numberIndexType, 0 /* None */);\r\n writePunctuation(writer, 21 /* SemicolonToken */);\r\n writer.writeLine();\r\n }\r\n for (var i = 0; i < resolved.properties.length; i++) {\r\n var p = resolved.properties[i];\r\n var t = getTypeOfSymbol(p);\r\n if (p.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(t).length) {\r\n var signatures = getSignaturesOfType(t, 0 /* Call */);\r\n for (var j = 0; j < signatures.length; j++) {\r\n buildSymbolDisplay(p, writer);\r\n if (isOptionalProperty(p)) {\r\n writePunctuation(writer, 49 /* QuestionToken */);\r\n }\r\n buildSignatureDisplay(signatures[j], writer, enclosingDeclaration, globalFlagsToPass, typeStack);\r\n writePunctuation(writer, 21 /* SemicolonToken */);\r\n writer.writeLine();\r\n }\r\n }\r\n else {\r\n buildSymbolDisplay(p, writer);\r\n if (isOptionalProperty(p)) {\r\n writePunctuation(writer, 49 /* QuestionToken */);\r\n }\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n writeSpace(writer);\r\n writeType(t, 0 /* None */);\r\n writePunctuation(writer, 21 /* SemicolonToken */);\r\n writer.writeLine();\r\n }\r\n }\r\n writer.decreaseIndent();\r\n writePunctuation(writer, 14 /* CloseBraceToken */);\r\n }\r\n }\r\n function buildTypeParameterDisplayFromSymbol(symbol, writer, enclosingDeclaraiton, flags) {\r\n var targetSymbol = getTargetSymbol(symbol);\r\n if (targetSymbol.flags & 32 /* Class */ || targetSymbol.flags & 64 /* Interface */) {\r\n buildDisplayForTypeParametersAndDelimiters(getTypeParametersOfClassOrInterface(symbol), writer, enclosingDeclaraiton, flags);\r\n }\r\n }\r\n function buildTypeParameterDisplay(tp, writer, enclosingDeclaration, flags, typeStack) {\r\n appendSymbolNameOnly(tp.symbol, writer);\r\n var constraint = getConstraintOfTypeParameter(tp);\r\n if (constraint) {\r\n writeSpace(writer);\r\n writeKeyword(writer, 77 /* ExtendsKeyword */);\r\n writeSpace(writer);\r\n buildTypeDisplay(constraint, writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n }\r\n function buildParameterDisplay(p, writer, enclosingDeclaration, flags, typeStack) {\r\n if (ts.hasDotDotDotToken(p.valueDeclaration)) {\r\n writePunctuation(writer, 20 /* DotDotDotToken */);\r\n }\r\n appendSymbolNameOnly(p, writer);\r\n if (ts.hasQuestionToken(p.valueDeclaration) || p.valueDeclaration.initializer) {\r\n writePunctuation(writer, 49 /* QuestionToken */);\r\n }\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n writeSpace(writer);\r\n buildTypeDisplay(getTypeOfSymbol(p), writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n function buildDisplayForTypeParametersAndDelimiters(typeParameters, writer, enclosingDeclaration, flags, typeStack) {\r\n if (typeParameters && typeParameters.length) {\r\n writePunctuation(writer, 23 /* LessThanToken */);\r\n for (var i = 0; i < typeParameters.length; i++) {\r\n if (i > 0) {\r\n writePunctuation(writer, 22 /* CommaToken */);\r\n writeSpace(writer);\r\n }\r\n buildTypeParameterDisplay(typeParameters[i], writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n writePunctuation(writer, 24 /* GreaterThanToken */);\r\n }\r\n }\r\n function buildDisplayForTypeArgumentsAndDelimiters(typeParameters, mapper, writer, enclosingDeclaration, flags, typeStack) {\r\n if (typeParameters && typeParameters.length) {\r\n writePunctuation(writer, 23 /* LessThanToken */);\r\n for (var i = 0; i < typeParameters.length; i++) {\r\n if (i > 0) {\r\n writePunctuation(writer, 22 /* CommaToken */);\r\n writeSpace(writer);\r\n }\r\n buildTypeDisplay(mapper(typeParameters[i]), writer, enclosingDeclaration, 0 /* None */);\r\n }\r\n writePunctuation(writer, 24 /* GreaterThanToken */);\r\n }\r\n }\r\n function buildDisplayForParametersAndDelimiters(parameters, writer, enclosingDeclaration, flags, typeStack) {\r\n writePunctuation(writer, 15 /* OpenParenToken */);\r\n for (var i = 0; i < parameters.length; i++) {\r\n if (i > 0) {\r\n writePunctuation(writer, 22 /* CommaToken */);\r\n writeSpace(writer);\r\n }\r\n buildParameterDisplay(parameters[i], writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n writePunctuation(writer, 16 /* CloseParenToken */);\r\n }\r\n function buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack) {\r\n if (flags & 8 /* WriteArrowStyleSignature */) {\r\n writeSpace(writer);\r\n writePunctuation(writer, 31 /* EqualsGreaterThanToken */);\r\n }\r\n else {\r\n writePunctuation(writer, 50 /* ColonToken */);\r\n }\r\n writeSpace(writer);\r\n buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n function buildSignatureDisplay(signature, writer, enclosingDeclaration, flags, typeStack) {\r\n if (signature.target && (flags & 32 /* WriteTypeArgumentsOfSignature */)) {\r\n // Instantiated signature, write type arguments instead\r\n // This is achieved by passing in the mapper separately\r\n buildDisplayForTypeArgumentsAndDelimiters(signature.target.typeParameters, signature.mapper, writer, enclosingDeclaration);\r\n }\r\n else {\r\n buildDisplayForTypeParametersAndDelimiters(signature.typeParameters, writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n buildDisplayForParametersAndDelimiters(signature.parameters, writer, enclosingDeclaration, flags, typeStack);\r\n buildReturnTypeDisplay(signature, writer, enclosingDeclaration, flags, typeStack);\r\n }\r\n return _displayBuilder || (_displayBuilder = {\r\n symbolToString: symbolToString,\r\n typeToString: typeToString,\r\n buildSymbolDisplay: buildSymbolDisplay,\r\n buildTypeDisplay: buildTypeDisplay,\r\n buildTypeParameterDisplay: buildTypeParameterDisplay,\r\n buildParameterDisplay: buildParameterDisplay,\r\n buildDisplayForParametersAndDelimiters: buildDisplayForParametersAndDelimiters,\r\n buildDisplayForTypeParametersAndDelimiters: buildDisplayForTypeParametersAndDelimiters,\r\n buildDisplayForTypeArgumentsAndDelimiters: buildDisplayForTypeArgumentsAndDelimiters,\r\n buildTypeParameterDisplayFromSymbol: buildTypeParameterDisplayFromSymbol,\r\n buildSignatureDisplay: buildSignatureDisplay,\r\n buildReturnTypeDisplay: buildReturnTypeDisplay\r\n });\r\n }\r\n function isDeclarationVisible(node) {\r\n function getContainingExternalModule(node) {\r\n for (; node; node = node.parent) {\r\n if (node.kind === 189 /* ModuleDeclaration */) {\r\n if (node.name.kind === 7 /* StringLiteral */) {\r\n return node;\r\n }\r\n }\r\n else if (node.kind === 201 /* SourceFile */) {\r\n return ts.isExternalModule(node) ? node : undefined;\r\n }\r\n }\r\n ts.Debug.fail(\"getContainingModule cant reach here\");\r\n }\r\n function isUsedInExportAssignment(node) {\r\n // Get source File and see if it is external module and has export assigned symbol\r\n var externalModule = getContainingExternalModule(node);\r\n if (externalModule) {\r\n // This is export assigned symbol node\r\n var externalModuleSymbol = getSymbolOfNode(externalModule);\r\n var exportAssignmentSymbol = getExportAssignmentSymbol(externalModuleSymbol);\r\n var resolvedExportSymbol;\r\n var symbolOfNode = getSymbolOfNode(node);\r\n if (isSymbolUsedInExportAssignment(symbolOfNode)) {\r\n return true;\r\n }\r\n // if symbolOfNode is import declaration, resolve the symbol declaration and check\r\n if (symbolOfNode.flags & 33554432 /* Import */) {\r\n return isSymbolUsedInExportAssignment(resolveImport(symbolOfNode));\r\n }\r\n }\r\n // Check if the symbol is used in export assignment\r\n function isSymbolUsedInExportAssignment(symbol) {\r\n if (exportAssignmentSymbol === symbol) {\r\n return true;\r\n }\r\n if (exportAssignmentSymbol && !!(exportAssignmentSymbol.flags & 33554432 /* Import */)) {\r\n // if export assigned symbol is import declaration, resolve the import\r\n resolvedExportSymbol = resolvedExportSymbol || resolveImport(exportAssignmentSymbol);\r\n if (resolvedExportSymbol === symbol) {\r\n return true;\r\n }\r\n // Container of resolvedExportSymbol is visible\r\n return ts.forEach(resolvedExportSymbol.declarations, function (current) {\r\n while (current) {\r\n if (current === node) {\r\n return true;\r\n }\r\n current = current.parent;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n function determineIfDeclarationIsVisible() {\r\n switch (node.kind) {\r\n case 183 /* VariableDeclaration */:\r\n case 189 /* ModuleDeclaration */:\r\n case 185 /* ClassDeclaration */:\r\n case 186 /* InterfaceDeclaration */:\r\n case 187 /* TypeAliasDeclaration */:\r\n case 184 /* FunctionDeclaration */:\r\n case 188 /* EnumDeclaration */:\r\n case 191 /* ImportDeclaration */:\r\n // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent\r\n var parent = node.kind === 183 /* VariableDeclaration */ ? node.parent.parent : node.parent;\r\n // If the node is not exported or it is not ambient module element (except import declaration)\r\n if (!(node.flags & 1 /* Export */) && !(node.kind !== 191 /* ImportDeclaration */ && parent.kind !== 201 /* SourceFile */ && ts.isInAmbientContext(parent))) {\r\n return isGlobalSourceFile(parent) || isUsedInExportAssignment(node);\r\n }\r\n // Exported members/ambient module elements (exception import declaration) are visible if parent is visible\r\n return isDeclarationVisible(parent);\r\n case 124 /* Property */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n case 125 /* Method */:\r\n if (node.flags & (32 /* Private */ | 64 /* Protected */)) {\r\n // Private/protected properties/methods are not visible\r\n return false;\r\n }\r\n case 126 /* Constructor */:\r\n case 130 /* ConstructSignature */:\r\n case 129 /* CallSignature */:\r\n case 131 /* IndexSignature */:\r\n case 123 /* Parameter */:\r\n case 190 /* ModuleBlock */:\r\n case 122 /* TypeParameter */:\r\n case 133 /* FunctionType */:\r\n case 134 /* ConstructorType */:\r\n case 136 /* TypeLiteral */:\r\n case 132 /* TypeReference */:\r\n case 137 /* ArrayType */:\r\n case 138 /* TupleType */:\r\n case 139 /* UnionType */:\r\n case 140 /* ParenthesizedType */:\r\n return isDeclarationVisible(node.parent);\r\n case 201 /* SourceFile */:\r\n return true;\r\n default:\r\n ts.Debug.fail(\"isDeclarationVisible unknown: SyntaxKind: \" + node.kind);\r\n }\r\n }\r\n if (node) {\r\n var links = getNodeLinks(node);\r\n if (links.isVisible === undefined) {\r\n links.isVisible = !!determineIfDeclarationIsVisible();\r\n }\r\n return links.isVisible;\r\n }\r\n }\r\n function getTypeOfPrototypeProperty(prototype) {\r\n // TypeScript 1.0 spec (April 2014): 8.4\r\n // Every class automatically contains a static property member named 'prototype', \r\n // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter.\r\n // It is an error to explicitly declare a static property member with the name 'prototype'.\r\n var classType = getDeclaredTypeOfSymbol(prototype.parent);\r\n return classType.typeParameters ? createTypeReference(classType, ts.map(classType.typeParameters, function (_) { return anyType; })) : classType;\r\n }\r\n function getTypeOfVariableOrParameterOrPropertyDeclaration(declaration) {\r\n // A variable declared in a for..in statement is always of type any\r\n if (declaration.parent.kind === 171 /* ForInStatement */) {\r\n return anyType;\r\n }\r\n // Use type from type annotation if one is present\r\n if (declaration.type) {\r\n return getTypeFromTypeNode(declaration.type);\r\n }\r\n if (declaration.kind === 123 /* Parameter */) {\r\n var func = declaration.parent;\r\n // For a parameter of a set accessor, use the type of the get accessor if one is present\r\n if (func.kind === 128 /* SetAccessor */ && !ts.hasComputedNameButNotSymbol(func)) {\r\n var getter = getDeclarationOfKind(declaration.parent.symbol, 127 /* GetAccessor */);\r\n if (getter) {\r\n return getReturnTypeOfSignature(getSignatureFromDeclaration(getter));\r\n }\r\n }\r\n // Use contextual parameter type if one is available\r\n var type = getContextuallyTypedParameterType(declaration);\r\n if (type) {\r\n return type;\r\n }\r\n }\r\n // Use the type of the initializer expression if one is present\r\n if (declaration.initializer) {\r\n var type = checkAndMarkExpression(declaration.initializer);\r\n // Widening of property assignments is handled by checkObjectLiteral, exclude them here\r\n if (declaration.kind !== 198 /* PropertyAssignment */) {\r\n var unwidenedType = type;\r\n type = getWidenedType(type);\r\n if (type !== unwidenedType) {\r\n checkImplicitAny(type);\r\n }\r\n }\r\n return type;\r\n }\r\n // If it is a short-hand property assignment; Use the type of the identifier\r\n if (declaration.kind === 199 /* ShorthandPropertyAssignment */) {\r\n var type = checkIdentifier(declaration.name);\r\n return type;\r\n }\r\n // Rest parameters default to type any[], other parameters default to type any\r\n var type = ts.hasDotDotDotToken(declaration) ? createArrayType(anyType) : anyType;\r\n checkImplicitAny(type);\r\n return type;\r\n function checkImplicitAny(type) {\r\n if (!fullTypeCheck || !compilerOptions.noImplicitAny) {\r\n return;\r\n }\r\n // We need to have ended up with 'any', 'any[]', 'any[][]', etc.\r\n if (getInnermostTypeOfNestedArrayTypes(type) !== anyType) {\r\n return;\r\n }\r\n // Ignore privates within ambient contexts; they exist purely for documentative purposes to avoid name clashing.\r\n // (e.g. privates within .d.ts files do not expose type information)\r\n if (isPrivateWithinAmbient(declaration) || (declaration.kind === 123 /* Parameter */ && isPrivateWithinAmbient(declaration.parent))) {\r\n return;\r\n }\r\n switch (declaration.kind) {\r\n case 124 /* Property */:\r\n var diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type;\r\n break;\r\n case 123 /* Parameter */:\r\n var diagnostic = ts.hasDotDotDotToken(declaration) ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type;\r\n break;\r\n default:\r\n var diagnostic = ts.Diagnostics.Variable_0_implicitly_has_an_1_type;\r\n }\r\n error(declaration, diagnostic, ts.declarationNameToString(declaration.name), typeToString(type));\r\n }\r\n }\r\n function getTypeOfVariableOrParameterOrProperty(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.type) {\r\n // Handle prototype property\r\n if (symbol.flags & 536870912 /* Prototype */) {\r\n return links.type = getTypeOfPrototypeProperty(symbol);\r\n }\r\n // Handle catch clause variables\r\n var declaration = symbol.valueDeclaration;\r\n if (declaration.kind === 197 /* CatchClause */) {\r\n return links.type = anyType;\r\n }\r\n // Handle variable, parameter or property\r\n links.type = resolvingType;\r\n var type = getTypeOfVariableOrParameterOrPropertyDeclaration(declaration);\r\n if (links.type === resolvingType) {\r\n links.type = type;\r\n }\r\n }\r\n else if (links.type === resolvingType) {\r\n links.type = anyType;\r\n if (compilerOptions.noImplicitAny) {\r\n var diagnostic = symbol.valueDeclaration.type ? ts.Diagnostics._0_implicitly_has_type_any_because_it_is_referenced_directly_or_indirectly_in_its_own_type_annotation : ts.Diagnostics._0_implicitly_has_type_any_because_it_is_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer;\r\n error(symbol.valueDeclaration, diagnostic, symbolToString(symbol));\r\n }\r\n }\r\n return links.type;\r\n }\r\n function getSetAccessorTypeAnnotationNode(accessor) {\r\n return accessor && accessor.parameters.length > 0 && accessor.parameters[0].type;\r\n }\r\n function getAnnotatedAccessorType(accessor) {\r\n if (accessor) {\r\n if (accessor.kind === 127 /* GetAccessor */) {\r\n return accessor.type && getTypeFromTypeNode(accessor.type);\r\n }\r\n else {\r\n var setterTypeAnnotation = getSetAccessorTypeAnnotationNode(accessor);\r\n return setterTypeAnnotation && getTypeFromTypeNode(setterTypeAnnotation);\r\n }\r\n }\r\n return undefined;\r\n }\r\n function getTypeOfAccessors(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n checkAndStoreTypeOfAccessors(symbol, links);\r\n return links.type;\r\n }\r\n function checkAndStoreTypeOfAccessors(symbol, links) {\r\n links = links || getSymbolLinks(symbol);\r\n if (!links.type) {\r\n links.type = resolvingType;\r\n var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */);\r\n var setter = getDeclarationOfKind(symbol, 128 /* SetAccessor */);\r\n var type;\r\n // First try to see if the user specified a return type on the get-accessor.\r\n var getterReturnType = getAnnotatedAccessorType(getter);\r\n if (getterReturnType) {\r\n type = getterReturnType;\r\n }\r\n else {\r\n // If the user didn't specify a return type, try to use the set-accessor's parameter type.\r\n var setterParameterType = getAnnotatedAccessorType(setter);\r\n if (setterParameterType) {\r\n type = setterParameterType;\r\n }\r\n else {\r\n // If there are no specified types, try to infer it from the body of the get accessor if it exists.\r\n if (getter && getter.body) {\r\n type = getReturnTypeFromBody(getter);\r\n }\r\n else {\r\n if (compilerOptions.noImplicitAny) {\r\n error(setter, ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_type_annotation, symbolToString(symbol));\r\n }\r\n type = anyType;\r\n }\r\n }\r\n }\r\n if (links.type === resolvingType) {\r\n links.type = type;\r\n }\r\n }\r\n else if (links.type === resolvingType) {\r\n links.type = anyType;\r\n if (compilerOptions.noImplicitAny) {\r\n var getter = getDeclarationOfKind(symbol, 127 /* GetAccessor */);\r\n error(getter, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol));\r\n }\r\n }\r\n }\r\n function getTypeOfFuncClassEnumModule(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.type) {\r\n links.type = createObjectType(32768 /* Anonymous */, symbol);\r\n }\r\n return links.type;\r\n }\r\n function getTypeOfEnumMember(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.type) {\r\n links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol));\r\n }\r\n return links.type;\r\n }\r\n function getTypeOfImport(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.type) {\r\n links.type = getTypeOfSymbol(resolveImport(symbol));\r\n }\r\n return links.type;\r\n }\r\n function getTypeOfInstantiatedSymbol(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.type) {\r\n links.type = instantiateType(getTypeOfSymbol(links.target), links.mapper);\r\n }\r\n return links.type;\r\n }\r\n function getTypeOfSymbol(symbol) {\r\n if (symbol.flags & 67108864 /* Instantiated */) {\r\n return getTypeOfInstantiatedSymbol(symbol);\r\n }\r\n if (symbol.flags & (3 /* Variable */ | 4 /* Property */)) {\r\n return getTypeOfVariableOrParameterOrProperty(symbol);\r\n }\r\n if (symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 384 /* Enum */ | 512 /* ValueModule */)) {\r\n return getTypeOfFuncClassEnumModule(symbol);\r\n }\r\n if (symbol.flags & 8 /* EnumMember */) {\r\n return getTypeOfEnumMember(symbol);\r\n }\r\n if (symbol.flags & 98304 /* Accessor */) {\r\n return getTypeOfAccessors(symbol);\r\n }\r\n if (symbol.flags & 33554432 /* Import */) {\r\n return getTypeOfImport(symbol);\r\n }\r\n return unknownType;\r\n }\r\n function getTargetType(type) {\r\n return type.flags & 4096 /* Reference */ ? type.target : type;\r\n }\r\n function hasBaseType(type, checkBase) {\r\n return check(type);\r\n function check(type) {\r\n var target = getTargetType(type);\r\n return target === checkBase || ts.forEach(target.baseTypes, check);\r\n }\r\n }\r\n // Return combined list of type parameters from all declarations of a class or interface. Elsewhere we check they're all\r\n // the same, but even if they're not we still need the complete list to ensure instantiations supply type arguments\r\n // for all type parameters.\r\n function getTypeParametersOfClassOrInterface(symbol) {\r\n var result;\r\n ts.forEach(symbol.declarations, function (node) {\r\n if (node.kind === 186 /* InterfaceDeclaration */ || node.kind === 185 /* ClassDeclaration */) {\r\n var declaration = node;\r\n if (declaration.typeParameters && declaration.typeParameters.length) {\r\n ts.forEach(declaration.typeParameters, function (node) {\r\n var tp = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node));\r\n if (!result) {\r\n result = [tp];\r\n }\r\n else if (!ts.contains(result, tp)) {\r\n result.push(tp);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n return result;\r\n }\r\n function getDeclaredTypeOfClass(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.declaredType) {\r\n var type = links.declaredType = createObjectType(1024 /* Class */, symbol);\r\n var typeParameters = getTypeParametersOfClassOrInterface(symbol);\r\n if (typeParameters) {\r\n type.flags |= 4096 /* Reference */;\r\n type.typeParameters = typeParameters;\r\n type.instantiations = {};\r\n type.instantiations[getTypeListId(type.typeParameters)] = type;\r\n type.target = type;\r\n type.typeArguments = type.typeParameters;\r\n }\r\n type.baseTypes = [];\r\n var declaration = getDeclarationOfKind(symbol, 185 /* ClassDeclaration */);\r\n var baseTypeNode = ts.getClassBaseTypeNode(declaration);\r\n if (baseTypeNode) {\r\n var baseType = getTypeFromTypeReferenceNode(baseTypeNode);\r\n if (baseType !== unknownType) {\r\n if (getTargetType(baseType).flags & 1024 /* Class */) {\r\n if (type !== baseType && !hasBaseType(baseType, type)) {\r\n type.baseTypes.push(baseType);\r\n }\r\n else {\r\n error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */));\r\n }\r\n }\r\n else {\r\n error(baseTypeNode, ts.Diagnostics.A_class_may_only_extend_another_class);\r\n }\r\n }\r\n }\r\n type.declaredProperties = getNamedMembers(symbol.members);\r\n type.declaredCallSignatures = emptyArray;\r\n type.declaredConstructSignatures = emptyArray;\r\n type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);\r\n type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);\r\n }\r\n return links.declaredType;\r\n }\r\n function getDeclaredTypeOfInterface(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.declaredType) {\r\n var type = links.declaredType = createObjectType(2048 /* Interface */, symbol);\r\n var typeParameters = getTypeParametersOfClassOrInterface(symbol);\r\n if (typeParameters) {\r\n type.flags |= 4096 /* Reference */;\r\n type.typeParameters = typeParameters;\r\n type.instantiations = {};\r\n type.instantiations[getTypeListId(type.typeParameters)] = type;\r\n type.target = type;\r\n type.typeArguments = type.typeParameters;\r\n }\r\n type.baseTypes = [];\r\n ts.forEach(symbol.declarations, function (declaration) {\r\n if (declaration.kind === 186 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) {\r\n ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), function (node) {\r\n var baseType = getTypeFromTypeReferenceNode(node);\r\n if (baseType !== unknownType) {\r\n if (getTargetType(baseType).flags & (1024 /* Class */ | 2048 /* Interface */)) {\r\n if (type !== baseType && !hasBaseType(baseType, type)) {\r\n type.baseTypes.push(baseType);\r\n }\r\n else {\r\n error(declaration, ts.Diagnostics.Type_0_recursively_references_itself_as_a_base_type, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */));\r\n }\r\n }\r\n else {\r\n error(node, ts.Diagnostics.An_interface_may_only_extend_a_class_or_another_interface);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n type.declaredProperties = getNamedMembers(symbol.members);\r\n type.declaredCallSignatures = getSignaturesOfSymbol(symbol.members[\"__call\"]);\r\n type.declaredConstructSignatures = getSignaturesOfSymbol(symbol.members[\"__new\"]);\r\n type.declaredStringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);\r\n type.declaredNumberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);\r\n }\r\n return links.declaredType;\r\n }\r\n function getDeclaredTypeOfTypeAlias(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.declaredType) {\r\n links.declaredType = resolvingType;\r\n var declaration = getDeclarationOfKind(symbol, 187 /* TypeAliasDeclaration */);\r\n var type = getTypeFromTypeNode(declaration.type);\r\n if (links.declaredType === resolvingType) {\r\n links.declaredType = type;\r\n }\r\n }\r\n else if (links.declaredType === resolvingType) {\r\n links.declaredType = unknownType;\r\n var declaration = getDeclarationOfKind(symbol, 187 /* TypeAliasDeclaration */);\r\n error(declaration.name, ts.Diagnostics.Type_alias_0_circularly_references_itself, symbolToString(symbol));\r\n }\r\n return links.declaredType;\r\n }\r\n function getDeclaredTypeOfEnum(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.declaredType) {\r\n var type = createType(128 /* Enum */);\r\n type.symbol = symbol;\r\n links.declaredType = type;\r\n }\r\n return links.declaredType;\r\n }\r\n function getDeclaredTypeOfTypeParameter(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.declaredType) {\r\n var type = createType(512 /* TypeParameter */);\r\n type.symbol = symbol;\r\n if (!getDeclarationOfKind(symbol, 122 /* TypeParameter */).constraint) {\r\n type.constraint = noConstraintType;\r\n }\r\n links.declaredType = type;\r\n }\r\n return links.declaredType;\r\n }\r\n function getDeclaredTypeOfImport(symbol) {\r\n var links = getSymbolLinks(symbol);\r\n if (!links.declaredType) {\r\n links.declaredType = getDeclaredTypeOfSymbol(resolveImport(symbol));\r\n }\r\n return links.declaredType;\r\n }\r\n function getDeclaredTypeOfSymbol(symbol) {\r\n ts.Debug.assert((symbol.flags & 67108864 /* Instantiated */) === 0);\r\n if (symbol.flags & 32 /* Class */) {\r\n return getDeclaredTypeOfClass(symbol);\r\n }\r\n if (symbol.flags & 64 /* Interface */) {\r\n return getDeclaredTypeOfInterface(symbol);\r\n }\r\n if (symbol.flags & 2097152 /* TypeAlias */) {\r\n return getDeclaredTypeOfTypeAlias(symbol);\r\n }\r\n if (symbol.flags & 384 /* Enum */) {\r\n return getDeclaredTypeOfEnum(symbol);\r\n }\r\n if (symbol.flags & 1048576 /* TypeParameter */) {\r\n return getDeclaredTypeOfTypeParameter(symbol);\r\n }\r\n if (symbol.flags & 33554432 /* Import */) {\r\n return getDeclaredTypeOfImport(symbol);\r\n }\r\n return unknownType;\r\n }\r\n function createSymbolTable(symbols) {\r\n var result = {};\r\n for (var i = 0; i < symbols.length; i++) {\r\n var symbol = symbols[i];\r\n result[symbol.name] = symbol;\r\n }\r\n return result;\r\n }\r\n function createInstantiatedSymbolTable(symbols, mapper) {\r\n var result = {};\r\n for (var i = 0; i < symbols.length; i++) {\r\n var symbol = symbols[i];\r\n result[symbol.name] = instantiateSymbol(symbol, mapper);\r\n }\r\n return result;\r\n }\r\n function addInheritedMembers(symbols, baseSymbols) {\r\n for (var i = 0; i < baseSymbols.length; i++) {\r\n var s = baseSymbols[i];\r\n if (!ts.hasProperty(symbols, s.name)) {\r\n symbols[s.name] = s;\r\n }\r\n }\r\n }\r\n function addInheritedSignatures(signatures, baseSignatures) {\r\n if (baseSignatures) {\r\n for (var i = 0; i < baseSignatures.length; i++) {\r\n signatures.push(baseSignatures[i]);\r\n }\r\n }\r\n }\r\n function resolveClassOrInterfaceMembers(type) {\r\n var members = type.symbol.members;\r\n var callSignatures = type.declaredCallSignatures;\r\n var constructSignatures = type.declaredConstructSignatures;\r\n var stringIndexType = type.declaredStringIndexType;\r\n var numberIndexType = type.declaredNumberIndexType;\r\n if (type.baseTypes.length) {\r\n members = createSymbolTable(type.declaredProperties);\r\n ts.forEach(type.baseTypes, function (baseType) {\r\n addInheritedMembers(members, getPropertiesOfObjectType(baseType));\r\n callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(baseType, 0 /* Call */));\r\n constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(baseType, 1 /* Construct */));\r\n stringIndexType = stringIndexType || getIndexTypeOfType(baseType, 0 /* String */);\r\n numberIndexType = numberIndexType || getIndexTypeOfType(baseType, 1 /* Number */);\r\n });\r\n }\r\n setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);\r\n }\r\n function resolveTypeReferenceMembers(type) {\r\n var target = type.target;\r\n var mapper = createTypeMapper(target.typeParameters, type.typeArguments);\r\n var members = createInstantiatedSymbolTable(target.declaredProperties, mapper);\r\n var callSignatures = instantiateList(target.declaredCallSignatures, mapper, instantiateSignature);\r\n var constructSignatures = instantiateList(target.declaredConstructSignatures, mapper, instantiateSignature);\r\n var stringIndexType = target.declaredStringIndexType ? instantiateType(target.declaredStringIndexType, mapper) : undefined;\r\n var numberIndexType = target.declaredNumberIndexType ? instantiateType(target.declaredNumberIndexType, mapper) : undefined;\r\n ts.forEach(target.baseTypes, function (baseType) {\r\n var instantiatedBaseType = instantiateType(baseType, mapper);\r\n addInheritedMembers(members, getPropertiesOfObjectType(instantiatedBaseType));\r\n callSignatures = ts.concatenate(callSignatures, getSignaturesOfType(instantiatedBaseType, 0 /* Call */));\r\n constructSignatures = ts.concatenate(constructSignatures, getSignaturesOfType(instantiatedBaseType, 1 /* Construct */));\r\n stringIndexType = stringIndexType || getIndexTypeOfType(instantiatedBaseType, 0 /* String */);\r\n numberIndexType = numberIndexType || getIndexTypeOfType(instantiatedBaseType, 1 /* Number */);\r\n });\r\n setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);\r\n }\r\n function createSignature(declaration, typeParameters, parameters, resolvedReturnType, minArgumentCount, hasRestParameter, hasStringLiterals) {\r\n var sig = new Signature(checker);\r\n sig.declaration = declaration;\r\n sig.typeParameters = typeParameters;\r\n sig.parameters = parameters;\r\n sig.resolvedReturnType = resolvedReturnType;\r\n sig.minArgumentCount = minArgumentCount;\r\n sig.hasRestParameter = hasRestParameter;\r\n sig.hasStringLiterals = hasStringLiterals;\r\n return sig;\r\n }\r\n function cloneSignature(sig) {\r\n return createSignature(sig.declaration, sig.typeParameters, sig.parameters, sig.resolvedReturnType, sig.minArgumentCount, sig.hasRestParameter, sig.hasStringLiterals);\r\n }\r\n function getDefaultConstructSignatures(classType) {\r\n if (classType.baseTypes.length) {\r\n var baseType = classType.baseTypes[0];\r\n var baseSignatures = getSignaturesOfType(getTypeOfSymbol(baseType.symbol), 1 /* Construct */);\r\n return ts.map(baseSignatures, function (baseSignature) {\r\n var signature = baseType.flags & 4096 /* Reference */ ? getSignatureInstantiation(baseSignature, baseType.typeArguments) : cloneSignature(baseSignature);\r\n signature.typeParameters = classType.typeParameters;\r\n signature.resolvedReturnType = classType;\r\n return signature;\r\n });\r\n }\r\n return [createSignature(undefined, classType.typeParameters, emptyArray, classType, 0, false, false)];\r\n }\r\n function createTupleTypeMemberSymbols(memberTypes) {\r\n var members = {};\r\n for (var i = 0; i < memberTypes.length; i++) {\r\n var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */, \"\" + i);\r\n symbol.type = memberTypes[i];\r\n members[i] = symbol;\r\n }\r\n return members;\r\n }\r\n function resolveTupleTypeMembers(type) {\r\n var arrayType = resolveObjectOrUnionTypeMembers(createArrayType(getUnionType(type.elementTypes)));\r\n var members = createTupleTypeMemberSymbols(type.elementTypes);\r\n addInheritedMembers(members, arrayType.properties);\r\n setObjectTypeMembers(type, members, arrayType.callSignatures, arrayType.constructSignatures, arrayType.stringIndexType, arrayType.numberIndexType);\r\n }\r\n function signatureListsIdentical(s, t) {\r\n if (s.length !== t.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < s.length; i++) {\r\n if (!compareSignatures(s[i], t[i], false, compareTypes)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n // If the lists of call or construct signatures in the given types are all identical except for return types,\r\n // and if none of the signatures are generic, return a list of signatures that has substitutes a union of the\r\n // return types of the corresponding signatures in each resulting signature.\r\n function getUnionSignatures(types, kind) {\r\n var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); });\r\n var signatures = signatureLists[0];\r\n for (var i = 0; i < signatures.length; i++) {\r\n if (signatures[i].typeParameters) {\r\n return emptyArray;\r\n }\r\n }\r\n for (var i = 1; i < signatureLists.length; i++) {\r\n if (!signatureListsIdentical(signatures, signatureLists[i])) {\r\n return emptyArray;\r\n }\r\n }\r\n var result = ts.map(signatures, cloneSignature);\r\n for (var i = 0; i < result.length; i++) {\r\n var s = result[i];\r\n // Clear resolved return type we possibly got from cloneSignature\r\n s.resolvedReturnType = undefined;\r\n s.unionSignatures = ts.map(signatureLists, function (signatures) { return signatures[i]; });\r\n }\r\n return result;\r\n }\r\n function getUnionIndexType(types, kind) {\r\n var indexTypes = [];\r\n for (var i = 0; i < types.length; i++) {\r\n var indexType = getIndexTypeOfType(types[i], kind);\r\n if (!indexType) {\r\n return undefined;\r\n }\r\n indexTypes.push(indexType);\r\n }\r\n return getUnionType(indexTypes);\r\n }\r\n function resolveUnionTypeMembers(type) {\r\n // The members and properties collections are empty for union types. To get all properties of a union\r\n // type use getPropertiesOfType (only the language service uses this).\r\n var callSignatures = getUnionSignatures(type.types, 0 /* Call */);\r\n var constructSignatures = getUnionSignatures(type.types, 1 /* Construct */);\r\n var stringIndexType = getUnionIndexType(type.types, 0 /* String */);\r\n var numberIndexType = getUnionIndexType(type.types, 1 /* Number */);\r\n setObjectTypeMembers(type, emptySymbols, callSignatures, constructSignatures, stringIndexType, numberIndexType);\r\n }\r\n function resolveAnonymousTypeMembers(type) {\r\n var symbol = type.symbol;\r\n if (symbol.flags & 2048 /* TypeLiteral */) {\r\n var members = symbol.members;\r\n var callSignatures = getSignaturesOfSymbol(members[\"__call\"]);\r\n var constructSignatures = getSignaturesOfSymbol(members[\"__new\"]);\r\n var stringIndexType = getIndexTypeOfSymbol(symbol, 0 /* String */);\r\n var numberIndexType = getIndexTypeOfSymbol(symbol, 1 /* Number */);\r\n }\r\n else {\r\n // Combinations of function, class, enum and module\r\n var members = emptySymbols;\r\n var callSignatures = emptyArray;\r\n var constructSignatures = emptyArray;\r\n if (symbol.flags & 1952 /* HasExports */) {\r\n members = symbol.exports;\r\n }\r\n if (symbol.flags & (16 /* Function */ | 8192 /* Method */)) {\r\n callSignatures = getSignaturesOfSymbol(symbol);\r\n }\r\n if (symbol.flags & 32 /* Class */) {\r\n var classType = getDeclaredTypeOfClass(symbol);\r\n constructSignatures = getSignaturesOfSymbol(symbol.members[\"__constructor\"]);\r\n if (!constructSignatures.length) {\r\n constructSignatures = getDefaultConstructSignatures(classType);\r\n }\r\n if (classType.baseTypes.length) {\r\n members = createSymbolTable(getNamedMembers(members));\r\n addInheritedMembers(members, getPropertiesOfObjectType(getTypeOfSymbol(classType.baseTypes[0].symbol)));\r\n }\r\n }\r\n var stringIndexType = undefined;\r\n var numberIndexType = (symbol.flags & 384 /* Enum */) ? stringType : undefined;\r\n }\r\n setObjectTypeMembers(type, members, callSignatures, constructSignatures, stringIndexType, numberIndexType);\r\n }\r\n function resolveObjectOrUnionTypeMembers(type) {\r\n if (!type.members) {\r\n if (type.flags & (1024 /* Class */ | 2048 /* Interface */)) {\r\n resolveClassOrInterfaceMembers(type);\r\n }\r\n else if (type.flags & 32768 /* Anonymous */) {\r\n resolveAnonymousTypeMembers(type);\r\n }\r\n else if (type.flags & 8192 /* Tuple */) {\r\n resolveTupleTypeMembers(type);\r\n }\r\n else if (type.flags & 16384 /* Union */) {\r\n resolveUnionTypeMembers(type);\r\n }\r\n else {\r\n resolveTypeReferenceMembers(type);\r\n }\r\n }\r\n return type;\r\n }\r\n // Return properties of an object type or an empty array for other types\r\n function getPropertiesOfObjectType(type) {\r\n if (type.flags & 48128 /* ObjectType */) {\r\n return resolveObjectOrUnionTypeMembers(type).properties;\r\n }\r\n return emptyArray;\r\n }\r\n // If the given type is an object type and that type has a property by the given name, return\r\n // the symbol for that property. Otherwise return undefined.\r\n function getPropertyOfObjectType(type, name) {\r\n if (type.flags & 48128 /* ObjectType */) {\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n if (ts.hasProperty(resolved.members, name)) {\r\n var symbol = resolved.members[name];\r\n if (symbolIsValue(symbol)) {\r\n return symbol;\r\n }\r\n }\r\n }\r\n }\r\n function getPropertiesOfUnionType(type) {\r\n var result = [];\r\n ts.forEach(getPropertiesOfType(type.types[0]), function (prop) {\r\n var unionProp = getPropertyOfUnionType(type, prop.name);\r\n if (unionProp) {\r\n result.push(unionProp);\r\n }\r\n });\r\n return result;\r\n }\r\n function getPropertiesOfType(type) {\r\n if (type.flags & 16384 /* Union */) {\r\n return getPropertiesOfUnionType(type);\r\n }\r\n return getPropertiesOfObjectType(getApparentType(type));\r\n }\r\n // For a type parameter, return the base constraint of the type parameter. For the string, number, and\r\n // boolean primitive types, return the corresponding object types.Otherwise return the type itself.\r\n // Note that the apparent type of a union type is the union type itself.\r\n function getApparentType(type) {\r\n if (type.flags & 512 /* TypeParameter */) {\r\n do {\r\n type = getConstraintOfTypeParameter(type);\r\n } while (type && type.flags & 512 /* TypeParameter */);\r\n if (!type) {\r\n type = emptyObjectType;\r\n }\r\n }\r\n if (type.flags & 258 /* StringLike */) {\r\n type = globalStringType;\r\n }\r\n else if (type.flags & 132 /* NumberLike */) {\r\n type = globalNumberType;\r\n }\r\n else if (type.flags & 8 /* Boolean */) {\r\n type = globalBooleanType;\r\n }\r\n return type;\r\n }\r\n function createUnionProperty(unionType, name) {\r\n var types = unionType.types;\r\n var props;\r\n for (var i = 0; i < types.length; i++) {\r\n var type = getApparentType(types[i]);\r\n if (type !== unknownType) {\r\n var prop = getPropertyOfType(type, name);\r\n if (!prop) {\r\n return undefined;\r\n }\r\n if (!props) {\r\n props = [prop];\r\n }\r\n else {\r\n props.push(prop);\r\n }\r\n }\r\n }\r\n var propTypes = [];\r\n var declarations = [];\r\n for (var i = 0; i < props.length; i++) {\r\n var prop = props[i];\r\n if (prop.declarations) {\r\n declarations.push.apply(declarations, prop.declarations);\r\n }\r\n propTypes.push(getTypeOfSymbol(prop));\r\n }\r\n var result = createSymbol(4 /* Property */ | 268435456 /* Transient */ | 1073741824 /* UnionProperty */, name);\r\n result.unionType = unionType;\r\n result.declarations = declarations;\r\n result.type = getUnionType(propTypes);\r\n return result;\r\n }\r\n function getPropertyOfUnionType(type, name) {\r\n var properties = type.resolvedProperties || (type.resolvedProperties = {});\r\n if (ts.hasProperty(properties, name)) {\r\n return properties[name];\r\n }\r\n var property = createUnionProperty(type, name);\r\n if (property) {\r\n properties[name] = property;\r\n }\r\n return property;\r\n }\r\n // Return the symbol for the property with the given name in the given type. Creates synthetic union properties when\r\n // necessary, maps primitive types and type parameters are to their apparent types, and augments with properties from\r\n // Object and Function as appropriate.\r\n function getPropertyOfType(type, name) {\r\n if (type.flags & 16384 /* Union */) {\r\n return getPropertyOfUnionType(type, name);\r\n }\r\n if (!(type.flags & 48128 /* ObjectType */)) {\r\n type = getApparentType(type);\r\n if (!(type.flags & 48128 /* ObjectType */)) {\r\n return undefined;\r\n }\r\n }\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n if (ts.hasProperty(resolved.members, name)) {\r\n var symbol = resolved.members[name];\r\n if (symbolIsValue(symbol)) {\r\n return symbol;\r\n }\r\n }\r\n if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) {\r\n var symbol = getPropertyOfObjectType(globalFunctionType, name);\r\n if (symbol)\r\n return symbol;\r\n }\r\n return getPropertyOfObjectType(globalObjectType, name);\r\n }\r\n function getSignaturesOfObjectOrUnionType(type, kind) {\r\n if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) {\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n return kind === 0 /* Call */ ? resolved.callSignatures : resolved.constructSignatures;\r\n }\r\n return emptyArray;\r\n }\r\n // Return the signatures of the given kind in the given type. Creates synthetic union signatures when necessary and\r\n // maps primitive types and type parameters are to their apparent types.\r\n function getSignaturesOfType(type, kind) {\r\n return getSignaturesOfObjectOrUnionType(getApparentType(type), kind);\r\n }\r\n function getIndexTypeOfObjectOrUnionType(type, kind) {\r\n if (type.flags & (48128 /* ObjectType */ | 16384 /* Union */)) {\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n return kind === 0 /* String */ ? resolved.stringIndexType : resolved.numberIndexType;\r\n }\r\n }\r\n // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and\r\n // maps primitive types and type parameters are to their apparent types.\r\n function getIndexTypeOfType(type, kind) {\r\n return getIndexTypeOfObjectOrUnionType(getApparentType(type), kind);\r\n }\r\n // Return list of type parameters with duplicates removed (duplicate identifier errors are generated in the actual\r\n // type checking functions).\r\n function getTypeParametersFromDeclaration(typeParameterDeclarations) {\r\n var result = [];\r\n ts.forEach(typeParameterDeclarations, function (node) {\r\n var tp = getDeclaredTypeOfTypeParameter(node.symbol);\r\n if (!ts.contains(result, tp)) {\r\n result.push(tp);\r\n }\r\n });\r\n return result;\r\n }\r\n function getSignatureFromDeclaration(declaration) {\r\n var links = getNodeLinks(declaration);\r\n if (!links.resolvedSignature) {\r\n var classType = declaration.kind === 126 /* Constructor */ ? getDeclaredTypeOfClass(declaration.parent.symbol) : undefined;\r\n var typeParameters = classType ? classType.typeParameters : declaration.typeParameters ? getTypeParametersFromDeclaration(declaration.typeParameters) : undefined;\r\n var parameters = [];\r\n var hasStringLiterals = false;\r\n var minArgumentCount = -1;\r\n for (var i = 0, n = declaration.parameters.length; i < n; i++) {\r\n var param = declaration.parameters[i];\r\n parameters.push(param.symbol);\r\n if (param.type && param.type.kind === 7 /* StringLiteral */) {\r\n hasStringLiterals = true;\r\n }\r\n if (minArgumentCount < 0) {\r\n if (param.initializer || param.questionToken || param.dotDotDotToken) {\r\n minArgumentCount = i;\r\n }\r\n }\r\n }\r\n if (minArgumentCount < 0) {\r\n minArgumentCount = declaration.parameters.length;\r\n }\r\n var returnType;\r\n if (classType) {\r\n returnType = classType;\r\n }\r\n else if (declaration.type) {\r\n returnType = getTypeFromTypeNode(declaration.type);\r\n }\r\n else {\r\n // TypeScript 1.0 spec (April 2014):\r\n // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation.\r\n if (declaration.kind === 127 /* GetAccessor */ && !ts.hasComputedNameButNotSymbol(declaration)) {\r\n var setter = getDeclarationOfKind(declaration.symbol, 128 /* SetAccessor */);\r\n returnType = getAnnotatedAccessorType(setter);\r\n }\r\n if (!returnType && !declaration.body) {\r\n returnType = anyType;\r\n }\r\n }\r\n links.resolvedSignature = createSignature(declaration, typeParameters, parameters, returnType, minArgumentCount, ts.hasRestParameters(declaration), hasStringLiterals);\r\n }\r\n return links.resolvedSignature;\r\n }\r\n function getSignaturesOfSymbol(symbol) {\r\n if (!symbol)\r\n return emptyArray;\r\n var result = [];\r\n for (var i = 0, len = symbol.declarations.length; i < len; i++) {\r\n var node = symbol.declarations[i];\r\n switch (node.kind) {\r\n case 133 /* FunctionType */:\r\n case 134 /* ConstructorType */:\r\n case 184 /* FunctionDeclaration */:\r\n case 125 /* Method */:\r\n case 126 /* Constructor */:\r\n case 129 /* CallSignature */:\r\n case 130 /* ConstructSignature */:\r\n case 131 /* IndexSignature */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n case 150 /* FunctionExpression */:\r\n case 151 /* ArrowFunction */:\r\n // Don't include signature if node is the implementation of an overloaded function. A node is considered\r\n // an implementation node if it has a body and the previous node is of the same kind and immediately\r\n // precedes the implementation node (i.e. has the same parent and ends where the implementation starts).\r\n if (i > 0 && node.body) {\r\n var previous = symbol.declarations[i - 1];\r\n if (node.parent === previous.parent && node.kind === previous.kind && node.pos === previous.end) {\r\n break;\r\n }\r\n }\r\n result.push(getSignatureFromDeclaration(node));\r\n }\r\n }\r\n return result;\r\n }\r\n function getReturnTypeOfSignature(signature) {\r\n if (!signature.resolvedReturnType) {\r\n signature.resolvedReturnType = resolvingType;\r\n if (signature.target) {\r\n var type = instantiateType(getReturnTypeOfSignature(signature.target), signature.mapper);\r\n }\r\n else if (signature.unionSignatures) {\r\n var type = getUnionType(ts.map(signature.unionSignatures, getReturnTypeOfSignature));\r\n }\r\n else {\r\n var type = getReturnTypeFromBody(signature.declaration);\r\n }\r\n if (signature.resolvedReturnType === resolvingType) {\r\n signature.resolvedReturnType = type;\r\n }\r\n }\r\n else if (signature.resolvedReturnType === resolvingType) {\r\n signature.resolvedReturnType = anyType;\r\n if (compilerOptions.noImplicitAny) {\r\n var declaration = signature.declaration;\r\n if (declaration.name) {\r\n error(declaration.name, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, ts.declarationNameToString(declaration.name));\r\n }\r\n else {\r\n error(declaration, ts.Diagnostics.Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions);\r\n }\r\n }\r\n }\r\n return signature.resolvedReturnType;\r\n }\r\n function getRestTypeOfSignature(signature) {\r\n if (signature.hasRestParameter) {\r\n var type = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);\r\n if (type.flags & 4096 /* Reference */ && type.target === globalArrayType) {\r\n return type.typeArguments[0];\r\n }\r\n }\r\n return anyType;\r\n }\r\n function getSignatureInstantiation(signature, typeArguments) {\r\n return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), true);\r\n }\r\n function getErasedSignature(signature) {\r\n if (!signature.typeParameters)\r\n return signature;\r\n if (!signature.erasedSignatureCache) {\r\n if (signature.target) {\r\n signature.erasedSignatureCache = instantiateSignature(getErasedSignature(signature.target), signature.mapper);\r\n }\r\n else {\r\n signature.erasedSignatureCache = instantiateSignature(signature, createTypeEraser(signature.typeParameters), true);\r\n }\r\n }\r\n return signature.erasedSignatureCache;\r\n }\r\n function getOrCreateTypeFromSignature(signature) {\r\n // There are two ways to declare a construct signature, one is by declaring a class constructor\r\n // using the constructor keyword, and the other is declaring a bare construct signature in an\r\n // object type literal or interface (using the new keyword). Each way of declaring a constructor\r\n // will result in a different declaration kind.\r\n if (!signature.isolatedSignatureType) {\r\n var isConstructor = signature.declaration.kind === 126 /* Constructor */ || signature.declaration.kind === 130 /* ConstructSignature */;\r\n var type = createObjectType(32768 /* Anonymous */ | 65536 /* FromSignature */);\r\n type.members = emptySymbols;\r\n type.properties = emptyArray;\r\n type.callSignatures = !isConstructor ? [signature] : emptyArray;\r\n type.constructSignatures = isConstructor ? [signature] : emptyArray;\r\n signature.isolatedSignatureType = type;\r\n }\r\n return signature.isolatedSignatureType;\r\n }\r\n function getIndexSymbol(symbol) {\r\n return symbol.members[\"__index\"];\r\n }\r\n function getIndexDeclarationOfSymbol(symbol, kind) {\r\n var syntaxKind = kind === 1 /* Number */ ? 116 /* NumberKeyword */ : 118 /* StringKeyword */;\r\n var indexSymbol = getIndexSymbol(symbol);\r\n if (indexSymbol) {\r\n var len = indexSymbol.declarations.length;\r\n for (var i = 0; i < len; i++) {\r\n var node = indexSymbol.declarations[i];\r\n if (node.parameters.length === 1) {\r\n var parameter = node.parameters[0];\r\n if (parameter && parameter.type && parameter.type.kind === syntaxKind) {\r\n return node;\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n function getIndexTypeOfSymbol(symbol, kind) {\r\n var declaration = getIndexDeclarationOfSymbol(symbol, kind);\r\n return declaration ? declaration.type ? getTypeFromTypeNode(declaration.type) : anyType : undefined;\r\n }\r\n function getConstraintOfTypeParameter(type) {\r\n if (!type.constraint) {\r\n if (type.target) {\r\n var targetConstraint = getConstraintOfTypeParameter(type.target);\r\n type.constraint = targetConstraint ? instantiateType(targetConstraint, type.mapper) : noConstraintType;\r\n }\r\n else {\r\n type.constraint = getTypeFromTypeNode(getDeclarationOfKind(type.symbol, 122 /* TypeParameter */).constraint);\r\n }\r\n }\r\n return type.constraint === noConstraintType ? undefined : type.constraint;\r\n }\r\n function getTypeListId(types) {\r\n switch (types.length) {\r\n case 1:\r\n return \"\" + types[0].id;\r\n case 2:\r\n return types[0].id + \",\" + types[1].id;\r\n default:\r\n var result = \"\";\r\n for (var i = 0; i < types.length; i++) {\r\n if (i > 0)\r\n result += \",\";\r\n result += types[i].id;\r\n }\r\n return result;\r\n }\r\n }\r\n function createTypeReference(target, typeArguments) {\r\n var id = getTypeListId(typeArguments);\r\n var type = target.instantiations[id];\r\n if (!type) {\r\n type = target.instantiations[id] = createObjectType(4096 /* Reference */, target.symbol);\r\n type.target = target;\r\n type.typeArguments = typeArguments;\r\n }\r\n return type;\r\n }\r\n function isTypeParameterReferenceIllegalInConstraint(typeReferenceNode, typeParameterSymbol) {\r\n var links = getNodeLinks(typeReferenceNode);\r\n if (links.isIllegalTypeReferenceInConstraint !== undefined) {\r\n return links.isIllegalTypeReferenceInConstraint;\r\n }\r\n // bubble up to the declaration\r\n var currentNode = typeReferenceNode;\r\n while (!ts.forEach(typeParameterSymbol.declarations, function (d) { return d.parent === currentNode.parent; })) {\r\n currentNode = currentNode.parent;\r\n }\r\n // if last step was made from the type parameter this means that path has started somewhere in constraint which is illegal\r\n links.isIllegalTypeReferenceInConstraint = currentNode.kind === 122 /* TypeParameter */;\r\n return links.isIllegalTypeReferenceInConstraint;\r\n }\r\n function checkTypeParameterHasIllegalReferencesInConstraint(typeParameter) {\r\n var typeParameterSymbol;\r\n function check(n) {\r\n if (n.kind === 132 /* TypeReference */ && n.typeName.kind === 63 /* Identifier */) {\r\n var links = getNodeLinks(n);\r\n if (links.isIllegalTypeReferenceInConstraint === undefined) {\r\n var symbol = resolveName(typeParameter, n.typeName.text, 3152352 /* Type */, undefined, undefined);\r\n if (symbol && (symbol.flags & 1048576 /* TypeParameter */)) {\r\n // TypeScript 1.0 spec (April 2014): 3.4.1\r\n // Type parameters declared in a particular type parameter list \r\n // may not be referenced in constraints in that type parameter list\r\n // symbol.declaration.parent === typeParameter.parent\r\n // -> typeParameter and symbol.declaration originate from the same type parameter list \r\n // -> illegal for all declarations in symbol\r\n // forEach === exists\r\n links.isIllegalTypeReferenceInConstraint = ts.forEach(symbol.declarations, function (d) { return d.parent == typeParameter.parent; });\r\n }\r\n }\r\n if (links.isIllegalTypeReferenceInConstraint) {\r\n error(typeParameter, ts.Diagnostics.Constraint_of_a_type_parameter_cannot_reference_any_type_parameter_from_the_same_type_parameter_list);\r\n }\r\n }\r\n ts.forEachChild(n, check);\r\n }\r\n if (typeParameter.constraint) {\r\n typeParameterSymbol = getSymbolOfNode(typeParameter);\r\n check(typeParameter.constraint);\r\n }\r\n }\r\n function getTypeFromTypeReferenceNode(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n var symbol = resolveEntityName(node, node.typeName, 3152352 /* Type */);\r\n if (symbol) {\r\n var type;\r\n if ((symbol.flags & 1048576 /* TypeParameter */) && isTypeParameterReferenceIllegalInConstraint(node, symbol)) {\r\n // TypeScript 1.0 spec (April 2014): 3.4.1\r\n // Type parameters declared in a particular type parameter list \r\n // may not be referenced in constraints in that type parameter list\r\n // Implementation: such type references are resolved to 'unknown' type that usually denotes error\r\n type = unknownType;\r\n }\r\n else {\r\n type = getDeclaredTypeOfSymbol(symbol);\r\n if (type.flags & (1024 /* Class */ | 2048 /* Interface */) && type.flags & 4096 /* Reference */) {\r\n var typeParameters = type.typeParameters;\r\n if (node.typeArguments && node.typeArguments.length === typeParameters.length) {\r\n type = createTypeReference(type, ts.map(node.typeArguments, getTypeFromTypeNode));\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Generic_type_0_requires_1_type_argument_s, typeToString(type, undefined, 1 /* WriteArrayAsGenericType */), typeParameters.length);\r\n type = undefined;\r\n }\r\n }\r\n else {\r\n if (node.typeArguments) {\r\n error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type));\r\n type = undefined;\r\n }\r\n }\r\n }\r\n }\r\n links.resolvedType = type || unknownType;\r\n }\r\n return links.resolvedType;\r\n }\r\n function getTypeFromTypeQueryNode(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n // TypeScript 1.0 spec (April 2014): 3.6.3\r\n // The expression is processed as an identifier expression (section 4.3)\r\n // or property access expression(section 4.10),\r\n // the widened type(section 3.9) of which becomes the result. \r\n links.resolvedType = getWidenedType(checkExpressionOrQualifiedName(node.exprName));\r\n }\r\n return links.resolvedType;\r\n }\r\n function getTypeOfGlobalSymbol(symbol, arity) {\r\n function getTypeDeclaration(symbol) {\r\n var declarations = symbol.declarations;\r\n for (var i = 0; i < declarations.length; i++) {\r\n var declaration = declarations[i];\r\n switch (declaration.kind) {\r\n case 185 /* ClassDeclaration */:\r\n case 186 /* InterfaceDeclaration */:\r\n case 188 /* EnumDeclaration */:\r\n return declaration;\r\n }\r\n }\r\n }\r\n if (!symbol) {\r\n return emptyObjectType;\r\n }\r\n var type = getDeclaredTypeOfSymbol(symbol);\r\n if (!(type.flags & 48128 /* ObjectType */)) {\r\n error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_be_a_class_or_interface_type, symbol.name);\r\n return emptyObjectType;\r\n }\r\n if ((type.typeParameters ? type.typeParameters.length : 0) !== arity) {\r\n error(getTypeDeclaration(symbol), ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, symbol.name, arity);\r\n return emptyObjectType;\r\n }\r\n return type;\r\n }\r\n function getGlobalSymbol(name) {\r\n return resolveName(undefined, name, 3152352 /* Type */, ts.Diagnostics.Cannot_find_global_type_0, name);\r\n }\r\n function getGlobalType(name) {\r\n return getTypeOfGlobalSymbol(getGlobalSymbol(name), 0);\r\n }\r\n function createArrayType(elementType) {\r\n // globalArrayType will be undefined if we get here during creation of the Array type. This for example happens if\r\n // user code augments the Array type with call or construct signatures that have an array type as the return type.\r\n // We instead use globalArraySymbol to obtain the (not yet fully constructed) Array type.\r\n var arrayType = globalArrayType || getDeclaredTypeOfSymbol(globalArraySymbol);\r\n return arrayType !== emptyObjectType ? createTypeReference(arrayType, [elementType]) : emptyObjectType;\r\n }\r\n function getTypeFromArrayTypeNode(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n links.resolvedType = createArrayType(getTypeFromTypeNode(node.elementType));\r\n }\r\n return links.resolvedType;\r\n }\r\n function createTupleType(elementTypes) {\r\n var id = getTypeListId(elementTypes);\r\n var type = tupleTypes[id];\r\n if (!type) {\r\n type = tupleTypes[id] = createObjectType(8192 /* Tuple */);\r\n type.elementTypes = elementTypes;\r\n }\r\n return type;\r\n }\r\n function getTypeFromTupleTypeNode(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n links.resolvedType = createTupleType(ts.map(node.elementTypes, getTypeFromTypeNode));\r\n }\r\n return links.resolvedType;\r\n }\r\n function addTypeToSortedSet(sortedSet, type) {\r\n if (type.flags & 16384 /* Union */) {\r\n addTypesToSortedSet(sortedSet, type.types);\r\n }\r\n else {\r\n var i = 0;\r\n var id = type.id;\r\n while (i < sortedSet.length && sortedSet[i].id < id) {\r\n i++;\r\n }\r\n if (i === sortedSet.length || sortedSet[i].id !== id) {\r\n sortedSet.splice(i, 0, type);\r\n }\r\n }\r\n }\r\n function addTypesToSortedSet(sortedTypes, types) {\r\n for (var i = 0, len = types.length; i < len; i++) {\r\n addTypeToSortedSet(sortedTypes, types[i]);\r\n }\r\n }\r\n function isSubtypeOfAny(candidate, types) {\r\n for (var i = 0, len = types.length; i < len; i++) {\r\n if (candidate !== types[i] && isTypeSubtypeOf(candidate, types[i])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function removeSubtypes(types) {\r\n var i = types.length;\r\n while (i > 0) {\r\n i--;\r\n if (isSubtypeOfAny(types[i], types)) {\r\n types.splice(i, 1);\r\n }\r\n }\r\n }\r\n function containsAnyType(types) {\r\n for (var i = 0; i < types.length; i++) {\r\n if (types[i].flags & 1 /* Any */) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function removeAllButLast(types, typeToRemove) {\r\n var i = types.length;\r\n while (i > 0 && types.length > 1) {\r\n i--;\r\n if (types[i] === typeToRemove) {\r\n types.splice(i, 1);\r\n }\r\n }\r\n }\r\n function getUnionType(types, noSubtypeReduction) {\r\n if (types.length === 0) {\r\n return emptyObjectType;\r\n }\r\n var sortedTypes = [];\r\n addTypesToSortedSet(sortedTypes, types);\r\n if (noSubtypeReduction) {\r\n if (containsAnyType(sortedTypes)) {\r\n return anyType;\r\n }\r\n removeAllButLast(sortedTypes, undefinedType);\r\n removeAllButLast(sortedTypes, nullType);\r\n }\r\n else {\r\n removeSubtypes(sortedTypes);\r\n }\r\n if (sortedTypes.length === 1) {\r\n return sortedTypes[0];\r\n }\r\n var id = getTypeListId(sortedTypes);\r\n var type = unionTypes[id];\r\n if (!type) {\r\n type = unionTypes[id] = createObjectType(16384 /* Union */);\r\n type.types = sortedTypes;\r\n }\r\n return type;\r\n }\r\n function getTypeFromUnionTypeNode(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n links.resolvedType = getUnionType(ts.map(node.types, getTypeFromTypeNode), true);\r\n }\r\n return links.resolvedType;\r\n }\r\n function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n // Deferred resolution of members is handled by resolveObjectTypeMembers\r\n links.resolvedType = createObjectType(32768 /* Anonymous */, node.symbol);\r\n }\r\n return links.resolvedType;\r\n }\r\n function getStringLiteralType(node) {\r\n if (ts.hasProperty(stringLiteralTypes, node.text)) {\r\n return stringLiteralTypes[node.text];\r\n }\r\n var type = stringLiteralTypes[node.text] = createType(256 /* StringLiteral */);\r\n type.text = ts.getTextOfNode(node);\r\n return type;\r\n }\r\n function getTypeFromStringLiteral(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedType) {\r\n links.resolvedType = getStringLiteralType(node);\r\n }\r\n return links.resolvedType;\r\n }\r\n function getTypeFromTypeNode(node) {\r\n switch (node.kind) {\r\n case 109 /* AnyKeyword */:\r\n return anyType;\r\n case 118 /* StringKeyword */:\r\n return stringType;\r\n case 116 /* NumberKeyword */:\r\n return numberType;\r\n case 110 /* BooleanKeyword */:\r\n return booleanType;\r\n case 97 /* VoidKeyword */:\r\n return voidType;\r\n case 7 /* StringLiteral */:\r\n return getTypeFromStringLiteral(node);\r\n case 132 /* TypeReference */:\r\n return getTypeFromTypeReferenceNode(node);\r\n case 135 /* TypeQuery */:\r\n return getTypeFromTypeQueryNode(node);\r\n case 137 /* ArrayType */:\r\n return getTypeFromArrayTypeNode(node);\r\n case 138 /* TupleType */:\r\n return getTypeFromTupleTypeNode(node);\r\n case 139 /* UnionType */:\r\n return getTypeFromUnionTypeNode(node);\r\n case 140 /* ParenthesizedType */:\r\n return getTypeFromTypeNode(node.type);\r\n case 133 /* FunctionType */:\r\n case 134 /* ConstructorType */:\r\n case 136 /* TypeLiteral */:\r\n return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);\r\n case 63 /* Identifier */:\r\n case 120 /* QualifiedName */:\r\n var symbol = getSymbolInfo(node);\r\n return symbol && getDeclaredTypeOfSymbol(symbol);\r\n default:\r\n return unknownType;\r\n }\r\n }\r\n function instantiateList(items, mapper, instantiator) {\r\n if (items && items.length) {\r\n var result = [];\r\n for (var i = 0; i < items.length; i++) {\r\n result.push(instantiator(items[i], mapper));\r\n }\r\n return result;\r\n }\r\n return items;\r\n }\r\n function createUnaryTypeMapper(source, target) {\r\n return function (t) { return t === source ? target : t; };\r\n }\r\n function createBinaryTypeMapper(source1, target1, source2, target2) {\r\n return function (t) { return t === source1 ? target1 : t === source2 ? target2 : t; };\r\n }\r\n function createTypeMapper(sources, targets) {\r\n switch (sources.length) {\r\n case 1: return createUnaryTypeMapper(sources[0], targets[0]);\r\n case 2: return createBinaryTypeMapper(sources[0], targets[0], sources[1], targets[1]);\r\n }\r\n return function (t) {\r\n for (var i = 0; i < sources.length; i++) {\r\n if (t === sources[i])\r\n return targets[i];\r\n }\r\n return t;\r\n };\r\n }\r\n function createUnaryTypeEraser(source) {\r\n return function (t) { return t === source ? anyType : t; };\r\n }\r\n function createBinaryTypeEraser(source1, source2) {\r\n return function (t) { return t === source1 || t === source2 ? anyType : t; };\r\n }\r\n function createTypeEraser(sources) {\r\n switch (sources.length) {\r\n case 1: return createUnaryTypeEraser(sources[0]);\r\n case 2: return createBinaryTypeEraser(sources[0], sources[1]);\r\n }\r\n return function (t) {\r\n for (var i = 0; i < sources.length; i++) {\r\n if (t === sources[i])\r\n return anyType;\r\n }\r\n return t;\r\n };\r\n }\r\n function createInferenceMapper(context) {\r\n return function (t) {\r\n for (var i = 0; i < context.typeParameters.length; i++) {\r\n if (t === context.typeParameters[i]) {\r\n return getInferredType(context, i);\r\n }\r\n }\r\n return t;\r\n };\r\n }\r\n function identityMapper(type) {\r\n return type;\r\n }\r\n function combineTypeMappers(mapper1, mapper2) {\r\n return function (t) { return mapper2(mapper1(t)); };\r\n }\r\n function instantiateTypeParameter(typeParameter, mapper) {\r\n var result = createType(512 /* TypeParameter */);\r\n result.symbol = typeParameter.symbol;\r\n if (typeParameter.constraint) {\r\n result.constraint = instantiateType(typeParameter.constraint, mapper);\r\n }\r\n else {\r\n result.target = typeParameter;\r\n result.mapper = mapper;\r\n }\r\n return result;\r\n }\r\n function instantiateSignature(signature, mapper, eraseTypeParameters) {\r\n if (signature.typeParameters && !eraseTypeParameters) {\r\n var freshTypeParameters = instantiateList(signature.typeParameters, mapper, instantiateTypeParameter);\r\n mapper = combineTypeMappers(createTypeMapper(signature.typeParameters, freshTypeParameters), mapper);\r\n }\r\n var result = createSignature(signature.declaration, freshTypeParameters, instantiateList(signature.parameters, mapper, instantiateSymbol), signature.resolvedReturnType ? instantiateType(signature.resolvedReturnType, mapper) : undefined, signature.minArgumentCount, signature.hasRestParameter, signature.hasStringLiterals);\r\n result.target = signature;\r\n result.mapper = mapper;\r\n return result;\r\n }\r\n function instantiateSymbol(symbol, mapper) {\r\n if (symbol.flags & 67108864 /* Instantiated */) {\r\n var links = getSymbolLinks(symbol);\r\n // If symbol being instantiated is itself a instantiation, fetch the original target and combine the\r\n // type mappers. This ensures that original type identities are properly preserved and that aliases\r\n // always reference a non-aliases.\r\n symbol = links.target;\r\n mapper = combineTypeMappers(links.mapper, mapper);\r\n }\r\n // Keep the flags from the symbol we're instantiating. Mark that is instantiated, and \r\n // also transient so that we can just store data on it directly.\r\n var result = createSymbol(67108864 /* Instantiated */ | 268435456 /* Transient */ | symbol.flags, symbol.name);\r\n result.declarations = symbol.declarations;\r\n result.parent = symbol.parent;\r\n result.target = symbol;\r\n result.mapper = mapper;\r\n if (symbol.valueDeclaration) {\r\n result.valueDeclaration = symbol.valueDeclaration;\r\n }\r\n return result;\r\n }\r\n function instantiateAnonymousType(type, mapper) {\r\n var result = createObjectType(32768 /* Anonymous */, type.symbol);\r\n result.properties = instantiateList(getPropertiesOfObjectType(type), mapper, instantiateSymbol);\r\n result.members = createSymbolTable(result.properties);\r\n result.callSignatures = instantiateList(getSignaturesOfType(type, 0 /* Call */), mapper, instantiateSignature);\r\n result.constructSignatures = instantiateList(getSignaturesOfType(type, 1 /* Construct */), mapper, instantiateSignature);\r\n var stringIndexType = getIndexTypeOfType(type, 0 /* String */);\r\n var numberIndexType = getIndexTypeOfType(type, 1 /* Number */);\r\n if (stringIndexType)\r\n result.stringIndexType = instantiateType(stringIndexType, mapper);\r\n if (numberIndexType)\r\n result.numberIndexType = instantiateType(numberIndexType, mapper);\r\n return result;\r\n }\r\n function instantiateType(type, mapper) {\r\n if (mapper !== identityMapper) {\r\n if (type.flags & 512 /* TypeParameter */) {\r\n return mapper(type);\r\n }\r\n if (type.flags & 32768 /* Anonymous */) {\r\n return type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) ? instantiateAnonymousType(type, mapper) : type;\r\n }\r\n if (type.flags & 4096 /* Reference */) {\r\n return createTypeReference(type.target, instantiateList(type.typeArguments, mapper, instantiateType));\r\n }\r\n if (type.flags & 8192 /* Tuple */) {\r\n return createTupleType(instantiateList(type.elementTypes, mapper, instantiateType));\r\n }\r\n if (type.flags & 16384 /* Union */) {\r\n return getUnionType(instantiateList(type.types, mapper, instantiateType), true);\r\n }\r\n }\r\n return type;\r\n }\r\n // Returns true if the given expression contains (at any level of nesting) a function or arrow expression\r\n // that is subject to contextual typing.\r\n function isContextSensitive(node) {\r\n ts.Debug.assert(node.kind !== 125 /* Method */ || ts.isObjectLiteralMethod(node));\r\n switch (node.kind) {\r\n case 150 /* FunctionExpression */:\r\n case 151 /* ArrowFunction */:\r\n return isContextSensitiveFunctionLikeDeclaration(node);\r\n case 142 /* ObjectLiteralExpression */:\r\n return ts.forEach(node.properties, isContextSensitive);\r\n case 141 /* ArrayLiteralExpression */:\r\n return ts.forEach(node.elements, isContextSensitive);\r\n case 158 /* ConditionalExpression */:\r\n return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse);\r\n case 157 /* BinaryExpression */:\r\n return node.operator === 48 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right));\r\n case 198 /* PropertyAssignment */:\r\n return isContextSensitive(node.initializer);\r\n case 125 /* Method */:\r\n return isContextSensitiveFunctionLikeDeclaration(node);\r\n }\r\n return false;\r\n }\r\n function isContextSensitiveFunctionLikeDeclaration(node) {\r\n return !node.typeParameters && !ts.forEach(node.parameters, function (p) { return p.type; });\r\n }\r\n function getTypeWithoutConstructors(type) {\r\n if (type.flags & 48128 /* ObjectType */) {\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n if (resolved.constructSignatures.length) {\r\n var result = createObjectType(32768 /* Anonymous */, type.symbol);\r\n result.members = resolved.members;\r\n result.properties = resolved.properties;\r\n result.callSignatures = resolved.callSignatures;\r\n result.constructSignatures = emptyArray;\r\n type = result;\r\n }\r\n }\r\n return type;\r\n }\r\n // TYPE CHECKING\r\n var subtypeRelation = {};\r\n var assignableRelation = {};\r\n var identityRelation = {};\r\n function isTypeIdenticalTo(source, target) {\r\n return checkTypeRelatedTo(source, target, identityRelation, undefined);\r\n }\r\n function compareTypes(source, target) {\r\n return checkTypeRelatedTo(source, target, identityRelation, undefined) ? -1 /* True */ : 0 /* False */;\r\n }\r\n function isTypeSubtypeOf(source, target) {\r\n return checkTypeSubtypeOf(source, target, undefined);\r\n }\r\n function isTypeAssignableTo(source, target) {\r\n return checkTypeAssignableTo(source, target, undefined);\r\n }\r\n function checkTypeSubtypeOf(source, target, errorNode, headMessage, containingMessageChain) {\r\n return checkTypeRelatedTo(source, target, subtypeRelation, errorNode, headMessage, containingMessageChain);\r\n }\r\n function checkTypeAssignableTo(source, target, errorNode, headMessage) {\r\n return checkTypeRelatedTo(source, target, assignableRelation, errorNode, headMessage);\r\n }\r\n function isSignatureAssignableTo(source, target) {\r\n var sourceType = getOrCreateTypeFromSignature(source);\r\n var targetType = getOrCreateTypeFromSignature(target);\r\n return checkTypeRelatedTo(sourceType, targetType, assignableRelation, undefined);\r\n }\r\n function checkTypeRelatedTo(source, target, relation, errorNode, headMessage, containingMessageChain) {\r\n var errorInfo;\r\n var sourceStack;\r\n var targetStack;\r\n var maybeStack;\r\n var expandingFlags;\r\n var depth = 0;\r\n var overflow = false;\r\n ts.Debug.assert(relation !== identityRelation || !errorNode, \"no error reporting in identity checking\");\r\n var result = isRelatedTo(source, target, errorNode !== undefined, headMessage);\r\n if (overflow) {\r\n error(errorNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));\r\n }\r\n else if (errorInfo) {\r\n if (containingMessageChain) {\r\n errorInfo = ts.concatenateDiagnosticMessageChains(containingMessageChain, errorInfo);\r\n }\r\n addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo, program.getCompilerHost().getNewLine()));\r\n }\r\n return result !== 0 /* False */;\r\n function reportError(message, arg0, arg1, arg2) {\r\n errorInfo = ts.chainDiagnosticMessages(errorInfo, message, arg0, arg1, arg2);\r\n }\r\n // Compare two types and return\r\n // Ternary.True if they are related with no assumptions,\r\n // Ternary.Maybe if they are related with assumptions of other relationships, or\r\n // Ternary.False if they are not related.\r\n function isRelatedTo(source, target, reportErrors, headMessage) {\r\n var result;\r\n if (relation === identityRelation) {\r\n // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases\r\n if (source === target)\r\n return -1 /* True */;\r\n }\r\n else {\r\n if (source === target)\r\n return -1 /* True */;\r\n if (target.flags & 1 /* Any */)\r\n return -1 /* True */;\r\n if (source === undefinedType)\r\n return -1 /* True */;\r\n if (source === nullType && target !== undefinedType)\r\n return -1 /* True */;\r\n if (source.flags & 128 /* Enum */ && target === numberType)\r\n return -1 /* True */;\r\n if (source.flags & 256 /* StringLiteral */ && target === stringType)\r\n return -1 /* True */;\r\n if (relation === assignableRelation) {\r\n if (source.flags & 1 /* Any */)\r\n return -1 /* True */;\r\n if (source === numberType && target.flags & 128 /* Enum */)\r\n return -1 /* True */;\r\n }\r\n }\r\n if (source.flags & 16384 /* Union */) {\r\n if (result = unionTypeRelatedToType(source, target, reportErrors)) {\r\n return result;\r\n }\r\n }\r\n else if (target.flags & 16384 /* Union */) {\r\n if (result = typeRelatedToUnionType(source, target, reportErrors)) {\r\n return result;\r\n }\r\n }\r\n else if (source.flags & 512 /* TypeParameter */ && target.flags & 512 /* TypeParameter */) {\r\n if (result = typeParameterRelatedTo(source, target, reportErrors)) {\r\n return result;\r\n }\r\n }\r\n else {\r\n var saveErrorInfo = errorInfo;\r\n if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) {\r\n // We have type references to same target type, see if relationship holds for all type arguments\r\n if (result = typesRelatedTo(source.typeArguments, target.typeArguments, reportErrors)) {\r\n return result;\r\n }\r\n }\r\n // Even if relationship doesn't hold for type arguments, it may hold in a structural comparison\r\n // Report structural errors only if we haven't reported any errors yet\r\n var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo;\r\n // identity relation does not use apparent type\r\n var sourceOrApparentType = relation === identityRelation ? source : getApparentType(source);\r\n if (sourceOrApparentType.flags & 48128 /* ObjectType */ && target.flags & 48128 /* ObjectType */ && (result = objectTypeRelatedTo(sourceOrApparentType, target, reportStructuralErrors))) {\r\n errorInfo = saveErrorInfo;\r\n return result;\r\n }\r\n }\r\n if (reportErrors) {\r\n headMessage = headMessage || ts.Diagnostics.Type_0_is_not_assignable_to_type_1;\r\n reportError(headMessage, typeToString(source), typeToString(target));\r\n }\r\n return 0 /* False */;\r\n }\r\n function typeRelatedToUnionType(source, target, reportErrors) {\r\n var targetTypes = target.types;\r\n for (var i = 0, len = targetTypes.length; i < len; i++) {\r\n var related = isRelatedTo(source, targetTypes[i], reportErrors && i === len - 1);\r\n if (related) {\r\n return related;\r\n }\r\n }\r\n return 0 /* False */;\r\n }\r\n function unionTypeRelatedToType(source, target, reportErrors) {\r\n var result = -1 /* True */;\r\n var sourceTypes = source.types;\r\n for (var i = 0, len = sourceTypes.length; i < len; i++) {\r\n var related = isRelatedTo(sourceTypes[i], target, reportErrors);\r\n if (!related) {\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n }\r\n return result;\r\n }\r\n function typesRelatedTo(sources, targets, reportErrors) {\r\n var result = -1 /* True */;\r\n for (var i = 0, len = sources.length; i < len; i++) {\r\n var related = isRelatedTo(sources[i], targets[i], reportErrors);\r\n if (!related) {\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n }\r\n return result;\r\n }\r\n function typeParameterRelatedTo(source, target, reportErrors) {\r\n if (relation === identityRelation) {\r\n if (source.symbol.name !== target.symbol.name) {\r\n return 0 /* False */;\r\n }\r\n // covers case when both type parameters does not have constraint (both equal to noConstraintType)\r\n if (source.constraint === target.constraint) {\r\n return -1 /* True */;\r\n }\r\n if (source.constraint === noConstraintType || target.constraint === noConstraintType) {\r\n return 0 /* False */;\r\n }\r\n return isRelatedTo(source.constraint, target.constraint, reportErrors);\r\n }\r\n else {\r\n while (true) {\r\n var constraint = getConstraintOfTypeParameter(source);\r\n if (constraint === target)\r\n return -1 /* True */;\r\n if (!(constraint && constraint.flags & 512 /* TypeParameter */))\r\n break;\r\n source = constraint;\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n // Determine if two object types are related by structure. First, check if the result is already available in the global cache.\r\n // Second, check if we have already started a comparison of the given two types in which case we assume the result to be true.\r\n // Third, check if both types are part of deeply nested chains of generic type instantiations and if so assume the types are\r\n // equal and infinitely expanding. Fourth, if we have reached a depth of 100 nested comparisons, assume we have runaway recursion\r\n // and issue an error. Otherwise, actually compare the structure of the two types.\r\n function objectTypeRelatedTo(source, target, reportErrors) {\r\n if (overflow) {\r\n return 0 /* False */;\r\n }\r\n var id = source.id + \",\" + target.id;\r\n var related = relation[id];\r\n if (related !== undefined) {\r\n return related ? -1 /* True */ : 0 /* False */;\r\n }\r\n if (depth > 0) {\r\n for (var i = 0; i < depth; i++) {\r\n // If source and target are already being compared, consider them related with assumptions\r\n if (maybeStack[i][id]) {\r\n return 1 /* Maybe */;\r\n }\r\n }\r\n if (depth === 100) {\r\n overflow = true;\r\n return 0 /* False */;\r\n }\r\n }\r\n else {\r\n sourceStack = [];\r\n targetStack = [];\r\n maybeStack = [];\r\n expandingFlags = 0;\r\n }\r\n sourceStack[depth] = source;\r\n targetStack[depth] = target;\r\n maybeStack[depth] = {};\r\n maybeStack[depth][id] = true;\r\n depth++;\r\n var saveExpandingFlags = expandingFlags;\r\n if (!(expandingFlags & 1) && isDeeplyNestedGeneric(source, sourceStack))\r\n expandingFlags |= 1;\r\n if (!(expandingFlags & 2) && isDeeplyNestedGeneric(target, targetStack))\r\n expandingFlags |= 2;\r\n if (expandingFlags === 3) {\r\n var result = 1 /* Maybe */;\r\n }\r\n else {\r\n var result = propertiesRelatedTo(source, target, reportErrors);\r\n if (result) {\r\n result &= signaturesRelatedTo(source, target, 0 /* Call */, reportErrors);\r\n if (result) {\r\n result &= signaturesRelatedTo(source, target, 1 /* Construct */, reportErrors);\r\n if (result) {\r\n result &= stringIndexTypesRelatedTo(source, target, reportErrors);\r\n if (result) {\r\n result &= numberIndexTypesRelatedTo(source, target, reportErrors);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n expandingFlags = saveExpandingFlags;\r\n depth--;\r\n if (result) {\r\n var maybeCache = maybeStack[depth];\r\n // If result is definitely true, copy assumptions to global cache, else copy to next level up\r\n var destinationCache = result === -1 /* True */ || depth === 0 ? relation : maybeStack[depth - 1];\r\n for (var p in maybeCache) {\r\n destinationCache[p] = maybeCache[p];\r\n }\r\n }\r\n else {\r\n // A false result goes straight into global cache (when something is false under assumptions it\r\n // will also be false without assumptions)\r\n relation[id] = false;\r\n }\r\n return result;\r\n }\r\n // Return true if the given type is part of a deeply nested chain of generic instantiations. We consider this to be the case\r\n // when structural type comparisons have been started for 10 or more instantiations of the same generic type. It is possible,\r\n // though highly unlikely, for this test to be true in a situation where a chain of instantiations is not infinitely expanding.\r\n // Effectively, we will generate a false positive when two types are structurally equal to at least 10 levels, but unequal at\r\n // some level beyond that.\r\n function isDeeplyNestedGeneric(type, stack) {\r\n if (type.flags & 4096 /* Reference */ && depth >= 10) {\r\n var target = type.target;\r\n var count = 0;\r\n for (var i = 0; i < depth; i++) {\r\n var t = stack[i];\r\n if (t.flags & 4096 /* Reference */ && t.target === target) {\r\n count++;\r\n if (count >= 10)\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n function propertiesRelatedTo(source, target, reportErrors) {\r\n if (relation === identityRelation) {\r\n return propertiesIdenticalTo(source, target);\r\n }\r\n var result = -1 /* True */;\r\n var properties = getPropertiesOfObjectType(target);\r\n for (var i = 0; i < properties.length; i++) {\r\n var targetProp = properties[i];\r\n var sourceProp = getPropertyOfType(source, targetProp.name);\r\n if (sourceProp !== targetProp) {\r\n if (!sourceProp) {\r\n if (relation === subtypeRelation || !isOptionalProperty(targetProp)) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Property_0_is_missing_in_type_1, symbolToString(targetProp), typeToString(source));\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n else if (!(targetProp.flags & 536870912 /* Prototype */)) {\r\n var sourceFlags = getDeclarationFlagsFromSymbol(sourceProp);\r\n var targetFlags = getDeclarationFlagsFromSymbol(targetProp);\r\n if (sourceFlags & 32 /* Private */ || targetFlags & 32 /* Private */) {\r\n if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {\r\n if (reportErrors) {\r\n if (sourceFlags & 32 /* Private */ && targetFlags & 32 /* Private */) {\r\n reportError(ts.Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));\r\n }\r\n else {\r\n reportError(ts.Diagnostics.Property_0_is_private_in_type_1_but_not_in_type_2, symbolToString(targetProp), typeToString(sourceFlags & 32 /* Private */ ? source : target), typeToString(sourceFlags & 32 /* Private */ ? target : source));\r\n }\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n else if (targetFlags & 64 /* Protected */) {\r\n var sourceDeclaredInClass = sourceProp.parent && sourceProp.parent.flags & 32 /* Class */;\r\n var sourceClass = sourceDeclaredInClass ? getDeclaredTypeOfSymbol(sourceProp.parent) : undefined;\r\n var targetClass = getDeclaredTypeOfSymbol(targetProp.parent);\r\n if (!sourceClass || !hasBaseType(sourceClass, targetClass)) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2, symbolToString(targetProp), typeToString(sourceClass || source), typeToString(targetClass));\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n else if (sourceFlags & 64 /* Protected */) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Property_0_is_protected_in_type_1_but_public_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));\r\n }\r\n return 0 /* False */;\r\n }\r\n var related = isRelatedTo(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp), reportErrors);\r\n if (!related) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(targetProp));\r\n }\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n if (isOptionalProperty(sourceProp) && !isOptionalProperty(targetProp)) {\r\n // TypeScript 1.0 spec (April 2014): 3.8.3\r\n // S is a subtype of a type T, and T is a supertype of S if ...\r\n // S' and T are object types and, for each member M in T..\r\n // M is a property and S' contains a property N where\r\n // if M is a required property, N is also a required property \r\n // (M - property in T)\r\n // (N - property in S)\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n function propertiesIdenticalTo(source, target) {\r\n var sourceProperties = getPropertiesOfObjectType(source);\r\n var targetProperties = getPropertiesOfObjectType(target);\r\n if (sourceProperties.length !== targetProperties.length) {\r\n return 0 /* False */;\r\n }\r\n var result = -1 /* True */;\r\n for (var i = 0, len = sourceProperties.length; i < len; ++i) {\r\n var sourceProp = sourceProperties[i];\r\n var targetProp = getPropertyOfObjectType(target, sourceProp.name);\r\n if (!targetProp) {\r\n return 0 /* False */;\r\n }\r\n var related = compareProperties(sourceProp, targetProp, isRelatedTo);\r\n if (!related) {\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n }\r\n return result;\r\n }\r\n function signaturesRelatedTo(source, target, kind, reportErrors) {\r\n if (relation === identityRelation) {\r\n return signaturesIdenticalTo(source, target, kind);\r\n }\r\n if (target === anyFunctionType || source === anyFunctionType) {\r\n return -1 /* True */;\r\n }\r\n var sourceSignatures = getSignaturesOfType(source, kind);\r\n var targetSignatures = getSignaturesOfType(target, kind);\r\n var result = -1 /* True */;\r\n var saveErrorInfo = errorInfo;\r\n outer: for (var i = 0; i < targetSignatures.length; i++) {\r\n var t = targetSignatures[i];\r\n if (!t.hasStringLiterals || target.flags & 65536 /* FromSignature */) {\r\n var localErrors = reportErrors;\r\n for (var j = 0; j < sourceSignatures.length; j++) {\r\n var s = sourceSignatures[j];\r\n if (!s.hasStringLiterals || source.flags & 65536 /* FromSignature */) {\r\n var related = signatureRelatedTo(s, t, localErrors);\r\n if (related) {\r\n result &= related;\r\n errorInfo = saveErrorInfo;\r\n continue outer;\r\n }\r\n // Only report errors from the first failure\r\n localErrors = false;\r\n }\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n return result;\r\n }\r\n function signatureRelatedTo(source, target, reportErrors) {\r\n if (source === target) {\r\n return -1 /* True */;\r\n }\r\n if (!target.hasRestParameter && source.minArgumentCount > target.parameters.length) {\r\n return 0 /* False */;\r\n }\r\n var sourceMax = source.parameters.length;\r\n var targetMax = target.parameters.length;\r\n var checkCount;\r\n if (source.hasRestParameter && target.hasRestParameter) {\r\n checkCount = sourceMax > targetMax ? sourceMax : targetMax;\r\n sourceMax--;\r\n targetMax--;\r\n }\r\n else if (source.hasRestParameter) {\r\n sourceMax--;\r\n checkCount = targetMax;\r\n }\r\n else if (target.hasRestParameter) {\r\n targetMax--;\r\n checkCount = sourceMax;\r\n }\r\n else {\r\n checkCount = sourceMax < targetMax ? sourceMax : targetMax;\r\n }\r\n // Spec 1.0 Section 3.8.3 & 3.8.4:\r\n // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N\r\n source = getErasedSignature(source);\r\n target = getErasedSignature(target);\r\n var result = -1 /* True */;\r\n for (var i = 0; i < checkCount; i++) {\r\n var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source);\r\n var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target);\r\n var saveErrorInfo = errorInfo;\r\n var related = isRelatedTo(s, t, reportErrors);\r\n if (!related) {\r\n related = isRelatedTo(t, s, false);\r\n if (!related) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Types_of_parameters_0_and_1_are_incompatible, source.parameters[i < sourceMax ? i : sourceMax].name, target.parameters[i < targetMax ? i : targetMax].name);\r\n }\r\n return 0 /* False */;\r\n }\r\n errorInfo = saveErrorInfo;\r\n }\r\n result &= related;\r\n }\r\n var t = getReturnTypeOfSignature(target);\r\n if (t === voidType)\r\n return result;\r\n var s = getReturnTypeOfSignature(source);\r\n return result & isRelatedTo(s, t, reportErrors);\r\n }\r\n function signaturesIdenticalTo(source, target, kind) {\r\n var sourceSignatures = getSignaturesOfType(source, kind);\r\n var targetSignatures = getSignaturesOfType(target, kind);\r\n if (sourceSignatures.length !== targetSignatures.length) {\r\n return 0 /* False */;\r\n }\r\n var result = -1 /* True */;\r\n for (var i = 0, len = sourceSignatures.length; i < len; ++i) {\r\n var related = compareSignatures(sourceSignatures[i], targetSignatures[i], true, isRelatedTo);\r\n if (!related) {\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n }\r\n return result;\r\n }\r\n function stringIndexTypesRelatedTo(source, target, reportErrors) {\r\n if (relation === identityRelation) {\r\n return indexTypesIdenticalTo(0 /* String */, source, target);\r\n }\r\n var targetType = getIndexTypeOfType(target, 0 /* String */);\r\n if (targetType) {\r\n var sourceType = getIndexTypeOfType(source, 0 /* String */);\r\n if (!sourceType) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source));\r\n }\r\n return 0 /* False */;\r\n }\r\n var related = isRelatedTo(sourceType, targetType, reportErrors);\r\n if (!related) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Index_signatures_are_incompatible);\r\n }\r\n return 0 /* False */;\r\n }\r\n return related;\r\n }\r\n return -1 /* True */;\r\n }\r\n function numberIndexTypesRelatedTo(source, target, reportErrors) {\r\n if (relation === identityRelation) {\r\n return indexTypesIdenticalTo(1 /* Number */, source, target);\r\n }\r\n var targetType = getIndexTypeOfType(target, 1 /* Number */);\r\n if (targetType) {\r\n var sourceStringType = getIndexTypeOfType(source, 0 /* String */);\r\n var sourceNumberType = getIndexTypeOfType(source, 1 /* Number */);\r\n if (!(sourceStringType || sourceNumberType)) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Index_signature_is_missing_in_type_0, typeToString(source));\r\n }\r\n return 0 /* False */;\r\n }\r\n if (sourceStringType && sourceNumberType) {\r\n // If we know for sure we're testing both string and numeric index types then only report errors from the second one\r\n var related = isRelatedTo(sourceStringType, targetType, false) || isRelatedTo(sourceNumberType, targetType, reportErrors);\r\n }\r\n else {\r\n var related = isRelatedTo(sourceStringType || sourceNumberType, targetType, reportErrors);\r\n }\r\n if (!related) {\r\n if (reportErrors) {\r\n reportError(ts.Diagnostics.Index_signatures_are_incompatible);\r\n }\r\n return 0 /* False */;\r\n }\r\n return related;\r\n }\r\n return -1 /* True */;\r\n }\r\n function indexTypesIdenticalTo(indexKind, source, target) {\r\n var targetType = getIndexTypeOfType(target, indexKind);\r\n var sourceType = getIndexTypeOfType(source, indexKind);\r\n if (!sourceType && !targetType) {\r\n return -1 /* True */;\r\n }\r\n if (sourceType && targetType) {\r\n return isRelatedTo(sourceType, targetType);\r\n }\r\n return 0 /* False */;\r\n }\r\n }\r\n function isPropertyIdenticalTo(sourceProp, targetProp) {\r\n return compareProperties(sourceProp, targetProp, compareTypes) !== 0 /* False */;\r\n }\r\n function compareProperties(sourceProp, targetProp, compareTypes) {\r\n // Two members are considered identical when\r\n // - they are public properties with identical names, optionality, and types,\r\n // - they are private or protected properties originating in the same declaration and having identical types\r\n if (sourceProp === targetProp) {\r\n return -1 /* True */;\r\n }\r\n var sourcePropAccessibility = getDeclarationFlagsFromSymbol(sourceProp) & (32 /* Private */ | 64 /* Protected */);\r\n var targetPropAccessibility = getDeclarationFlagsFromSymbol(targetProp) & (32 /* Private */ | 64 /* Protected */);\r\n if (sourcePropAccessibility !== targetPropAccessibility) {\r\n return 0 /* False */;\r\n }\r\n if (sourcePropAccessibility) {\r\n if (getTargetSymbol(sourceProp) !== getTargetSymbol(targetProp)) {\r\n return 0 /* False */;\r\n }\r\n }\r\n else {\r\n if (isOptionalProperty(sourceProp) !== isOptionalProperty(targetProp)) {\r\n return 0 /* False */;\r\n }\r\n }\r\n return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));\r\n }\r\n function compareSignatures(source, target, compareReturnTypes, compareTypes) {\r\n if (source === target) {\r\n return -1 /* True */;\r\n }\r\n if (source.parameters.length !== target.parameters.length || source.minArgumentCount !== target.minArgumentCount || source.hasRestParameter !== target.hasRestParameter) {\r\n return 0 /* False */;\r\n }\r\n var result = -1 /* True */;\r\n if (source.typeParameters && target.typeParameters) {\r\n if (source.typeParameters.length !== target.typeParameters.length) {\r\n return 0 /* False */;\r\n }\r\n for (var i = 0, len = source.typeParameters.length; i < len; ++i) {\r\n var related = compareTypes(source.typeParameters[i], target.typeParameters[i]);\r\n if (!related) {\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n }\r\n }\r\n else if (source.typeParameters || source.typeParameters) {\r\n return 0 /* False */;\r\n }\r\n // Spec 1.0 Section 3.8.3 & 3.8.4:\r\n // M and N (the signatures) are instantiated using type Any as the type argument for all type parameters declared by M and N\r\n source = getErasedSignature(source);\r\n target = getErasedSignature(target);\r\n for (var i = 0, len = source.parameters.length; i < len; i++) {\r\n var s = source.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(source) : getTypeOfSymbol(source.parameters[i]);\r\n var t = target.hasRestParameter && i === len - 1 ? getRestTypeOfSignature(target) : getTypeOfSymbol(target.parameters[i]);\r\n var related = compareTypes(s, t);\r\n if (!related) {\r\n return 0 /* False */;\r\n }\r\n result &= related;\r\n }\r\n if (compareReturnTypes) {\r\n result &= compareTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));\r\n }\r\n return result;\r\n }\r\n function isSupertypeOfEach(candidate, types) {\r\n for (var i = 0, len = types.length; i < len; i++) {\r\n if (candidate !== types[i] && !isTypeSubtypeOf(types[i], candidate))\r\n return false;\r\n }\r\n return true;\r\n }\r\n function getCommonSupertype(types) {\r\n return ts.forEach(types, function (t) { return isSupertypeOfEach(t, types) ? t : undefined; });\r\n }\r\n function reportNoCommonSupertypeError(types, errorLocation, errorMessageChainHead) {\r\n var bestSupertype;\r\n var bestSupertypeDownfallType; // The type that caused bestSupertype not to be the common supertype\r\n var bestSupertypeScore = 0;\r\n for (var i = 0; i < types.length; i++) {\r\n var score = 0;\r\n var downfallType = undefined;\r\n for (var j = 0; j < types.length; j++) {\r\n if (isTypeSubtypeOf(types[j], types[i])) {\r\n score++;\r\n }\r\n else if (!downfallType) {\r\n downfallType = types[j];\r\n }\r\n }\r\n if (score > bestSupertypeScore) {\r\n bestSupertype = types[i];\r\n bestSupertypeDownfallType = downfallType;\r\n bestSupertypeScore = score;\r\n }\r\n // types.length - 1 is the maximum score, given that getCommonSupertype returned false\r\n if (bestSupertypeScore === types.length - 1) {\r\n break;\r\n }\r\n }\r\n // In the following errors, the {1} slot is before the {0} slot because checkTypeSubtypeOf supplies the\r\n // subtype as the first argument to the error\r\n checkTypeSubtypeOf(bestSupertypeDownfallType, bestSupertype, errorLocation, ts.Diagnostics.Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0, errorMessageChainHead);\r\n }\r\n function isTypeOfObjectLiteral(type) {\r\n return (type.flags & 32768 /* Anonymous */) && type.symbol && (type.symbol.flags & 4096 /* ObjectLiteral */) ? true : false;\r\n }\r\n function isArrayType(type) {\r\n return type.flags & 4096 /* Reference */ && type.target === globalArrayType;\r\n }\r\n function getInnermostTypeOfNestedArrayTypes(type) {\r\n while (isArrayType(type)) {\r\n type = type.typeArguments[0];\r\n }\r\n return type;\r\n }\r\n /* If we are widening on a literal, then we may need to the 'node' parameter for reporting purposes */\r\n function getWidenedType(type, suppressNoImplicitAnyErrors) {\r\n if (type.flags & (32 /* Undefined */ | 64 /* Null */)) {\r\n return anyType;\r\n }\r\n if (type.flags & 16384 /* Union */) {\r\n return getWidenedTypeOfUnion(type);\r\n }\r\n if (isTypeOfObjectLiteral(type)) {\r\n return getWidenedTypeOfObjectLiteral(type);\r\n }\r\n if (isArrayType(type)) {\r\n return getWidenedTypeOfArrayLiteral(type);\r\n }\r\n return type;\r\n function getWidenedTypeOfUnion(type) {\r\n return getUnionType(ts.map(type.types, function (t) { return getWidenedType(t, suppressNoImplicitAnyErrors); }));\r\n }\r\n function getWidenedTypeOfObjectLiteral(type) {\r\n var properties = getPropertiesOfObjectType(type);\r\n if (properties.length) {\r\n var widenedTypes = [];\r\n var propTypeWasWidened = false;\r\n ts.forEach(properties, function (p) {\r\n var propType = getTypeOfSymbol(p);\r\n var widenedType = getWidenedType(propType);\r\n if (propType !== widenedType) {\r\n propTypeWasWidened = true;\r\n if (!suppressNoImplicitAnyErrors && compilerOptions.noImplicitAny && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) {\r\n error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, p.name, typeToString(widenedType));\r\n }\r\n }\r\n widenedTypes.push(widenedType);\r\n });\r\n if (propTypeWasWidened) {\r\n var members = {};\r\n var index = 0;\r\n ts.forEach(properties, function (p) {\r\n var symbol = createSymbol(4 /* Property */ | 268435456 /* Transient */ | p.flags, p.name);\r\n symbol.declarations = p.declarations;\r\n symbol.parent = p.parent;\r\n symbol.type = widenedTypes[index++];\r\n symbol.target = p;\r\n if (p.valueDeclaration)\r\n symbol.valueDeclaration = p.valueDeclaration;\r\n members[symbol.name] = symbol;\r\n });\r\n var stringIndexType = getIndexTypeOfType(type, 0 /* String */);\r\n var numberIndexType = getIndexTypeOfType(type, 1 /* Number */);\r\n if (stringIndexType)\r\n stringIndexType = getWidenedType(stringIndexType);\r\n if (numberIndexType)\r\n numberIndexType = getWidenedType(numberIndexType);\r\n type = createAnonymousType(type.symbol, members, emptyArray, emptyArray, stringIndexType, numberIndexType);\r\n }\r\n }\r\n return type;\r\n }\r\n function getWidenedTypeOfArrayLiteral(type) {\r\n var elementType = type.typeArguments[0];\r\n var widenedType = getWidenedType(elementType, suppressNoImplicitAnyErrors);\r\n type = elementType !== widenedType ? createArrayType(widenedType) : type;\r\n return type;\r\n }\r\n }\r\n function forEachMatchingParameterType(source, target, callback) {\r\n var sourceMax = source.parameters.length;\r\n var targetMax = target.parameters.length;\r\n var count;\r\n if (source.hasRestParameter && target.hasRestParameter) {\r\n count = sourceMax > targetMax ? sourceMax : targetMax;\r\n sourceMax--;\r\n targetMax--;\r\n }\r\n else if (source.hasRestParameter) {\r\n sourceMax--;\r\n count = targetMax;\r\n }\r\n else if (target.hasRestParameter) {\r\n targetMax--;\r\n count = sourceMax;\r\n }\r\n else {\r\n count = sourceMax < targetMax ? sourceMax : targetMax;\r\n }\r\n for (var i = 0; i < count; i++) {\r\n var s = i < sourceMax ? getTypeOfSymbol(source.parameters[i]) : getRestTypeOfSignature(source);\r\n var t = i < targetMax ? getTypeOfSymbol(target.parameters[i]) : getRestTypeOfSignature(target);\r\n callback(s, t);\r\n }\r\n }\r\n function createInferenceContext(typeParameters, inferUnionTypes) {\r\n var inferences = [];\r\n for (var i = 0; i < typeParameters.length; i++) {\r\n inferences.push({ primary: undefined, secondary: undefined });\r\n }\r\n return {\r\n typeParameters: typeParameters,\r\n inferUnionTypes: inferUnionTypes,\r\n inferenceCount: 0,\r\n inferences: inferences,\r\n inferredTypes: new Array(typeParameters.length)\r\n };\r\n }\r\n function inferTypes(context, source, target) {\r\n var sourceStack;\r\n var targetStack;\r\n var depth = 0;\r\n var inferiority = 0;\r\n inferFromTypes(source, target);\r\n function isInProcess(source, target) {\r\n for (var i = 0; i < depth; i++) {\r\n if (source === sourceStack[i] && target === targetStack[i])\r\n return true;\r\n }\r\n return false;\r\n }\r\n function isWithinDepthLimit(type, stack) {\r\n if (depth >= 5) {\r\n var target = type.target;\r\n var count = 0;\r\n for (var i = 0; i < depth; i++) {\r\n var t = stack[i];\r\n if (t.flags & 4096 /* Reference */ && t.target === target)\r\n count++;\r\n }\r\n return count < 5;\r\n }\r\n return true;\r\n }\r\n function inferFromTypes(source, target) {\r\n if (target.flags & 512 /* TypeParameter */) {\r\n // If target is a type parameter, make an inference\r\n var typeParameters = context.typeParameters;\r\n for (var i = 0; i < typeParameters.length; i++) {\r\n if (target === typeParameters[i]) {\r\n var inferences = context.inferences[i];\r\n var candidates = inferiority ? inferences.secondary || (inferences.secondary = []) : inferences.primary || (inferences.primary = []);\r\n if (!ts.contains(candidates, source))\r\n candidates.push(source);\r\n break;\r\n }\r\n }\r\n }\r\n else if (source.flags & 4096 /* Reference */ && target.flags & 4096 /* Reference */ && source.target === target.target) {\r\n // If source and target are references to the same generic type, infer from type arguments\r\n var sourceTypes = source.typeArguments;\r\n var targetTypes = target.typeArguments;\r\n for (var i = 0; i < sourceTypes.length; i++) {\r\n inferFromTypes(sourceTypes[i], targetTypes[i]);\r\n }\r\n }\r\n else if (target.flags & 16384 /* Union */) {\r\n var targetTypes = target.types;\r\n var typeParameterCount = 0;\r\n var typeParameter;\r\n for (var i = 0; i < targetTypes.length; i++) {\r\n var t = targetTypes[i];\r\n if (t.flags & 512 /* TypeParameter */ && ts.contains(context.typeParameters, t)) {\r\n typeParameter = t;\r\n typeParameterCount++;\r\n }\r\n else {\r\n inferFromTypes(source, t);\r\n }\r\n }\r\n // If union contains a single naked type parameter, make a secondary inference to that type parameter\r\n if (typeParameterCount === 1) {\r\n inferiority++;\r\n inferFromTypes(source, typeParameter);\r\n inferiority--;\r\n }\r\n }\r\n else if (source.flags & 16384 /* Union */) {\r\n // Source is a union type, infer from each consituent type\r\n var sourceTypes = source.types;\r\n for (var i = 0; i < sourceTypes.length; i++) {\r\n inferFromTypes(sourceTypes[i], target);\r\n }\r\n }\r\n else if (source.flags & 48128 /* ObjectType */ && (target.flags & (4096 /* Reference */ | 8192 /* Tuple */) || (target.flags & 32768 /* Anonymous */) && target.symbol && target.symbol.flags & (8192 /* Method */ | 2048 /* TypeLiteral */))) {\r\n // If source is an object type, and target is a type reference, a tuple type, the type of a method, or a type literal, infer from members\r\n if (!isInProcess(source, target) && isWithinDepthLimit(source, sourceStack) && isWithinDepthLimit(target, targetStack)) {\r\n if (depth === 0) {\r\n sourceStack = [];\r\n targetStack = [];\r\n }\r\n sourceStack[depth] = source;\r\n targetStack[depth] = target;\r\n depth++;\r\n inferFromProperties(source, target);\r\n inferFromSignatures(source, target, 0 /* Call */);\r\n inferFromSignatures(source, target, 1 /* Construct */);\r\n inferFromIndexTypes(source, target, 0 /* String */, 0 /* String */);\r\n inferFromIndexTypes(source, target, 1 /* Number */, 1 /* Number */);\r\n inferFromIndexTypes(source, target, 0 /* String */, 1 /* Number */);\r\n depth--;\r\n }\r\n }\r\n }\r\n function inferFromProperties(source, target) {\r\n var properties = getPropertiesOfObjectType(target);\r\n for (var i = 0; i < properties.length; i++) {\r\n var targetProp = properties[i];\r\n var sourceProp = getPropertyOfObjectType(source, targetProp.name);\r\n if (sourceProp) {\r\n inferFromTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));\r\n }\r\n }\r\n }\r\n function inferFromSignatures(source, target, kind) {\r\n var sourceSignatures = getSignaturesOfType(source, kind);\r\n var targetSignatures = getSignaturesOfType(target, kind);\r\n var sourceLen = sourceSignatures.length;\r\n var targetLen = targetSignatures.length;\r\n var len = sourceLen < targetLen ? sourceLen : targetLen;\r\n for (var i = 0; i < len; i++) {\r\n inferFromSignature(getErasedSignature(sourceSignatures[sourceLen - len + i]), getErasedSignature(targetSignatures[targetLen - len + i]));\r\n }\r\n }\r\n function inferFromSignature(source, target) {\r\n forEachMatchingParameterType(source, target, inferFromTypes);\r\n inferFromTypes(getReturnTypeOfSignature(source), getReturnTypeOfSignature(target));\r\n }\r\n function inferFromIndexTypes(source, target, sourceKind, targetKind) {\r\n var targetIndexType = getIndexTypeOfType(target, targetKind);\r\n if (targetIndexType) {\r\n var sourceIndexType = getIndexTypeOfType(source, sourceKind);\r\n if (sourceIndexType) {\r\n inferFromTypes(sourceIndexType, targetIndexType);\r\n }\r\n }\r\n }\r\n }\r\n function getInferenceCandidates(context, index) {\r\n var inferences = context.inferences[index];\r\n return inferences.primary || inferences.secondary || emptyArray;\r\n }\r\n function getInferredType(context, index) {\r\n var inferredType = context.inferredTypes[index];\r\n if (!inferredType) {\r\n var inferences = getInferenceCandidates(context, index);\r\n if (inferences.length) {\r\n // Infer widened union or supertype, or the undefined type for no common supertype\r\n var unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences) : getCommonSupertype(inferences);\r\n inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : inferenceFailureType;\r\n }\r\n else {\r\n // Infer the empty object type when no inferences were made\r\n inferredType = emptyObjectType;\r\n }\r\n if (inferredType !== inferenceFailureType) {\r\n var constraint = getConstraintOfTypeParameter(context.typeParameters[index]);\r\n inferredType = constraint && !isTypeAssignableTo(inferredType, constraint) ? constraint : inferredType;\r\n }\r\n context.inferredTypes[index] = inferredType;\r\n }\r\n return inferredType;\r\n }\r\n function getInferredTypes(context) {\r\n for (var i = 0; i < context.inferredTypes.length; i++) {\r\n getInferredType(context, i);\r\n }\r\n return context.inferredTypes;\r\n }\r\n function hasAncestor(node, kind) {\r\n return ts.getAncestor(node, kind) !== undefined;\r\n }\r\n // EXPRESSION TYPE CHECKING\r\n function getResolvedSymbol(node) {\r\n var links = getNodeLinks(node);\r\n if (!links.resolvedSymbol) {\r\n links.resolvedSymbol = (ts.getFullWidth(node) > 0 && resolveName(node, node.text, 107455 /* Value */ | 4194304 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node)) || unknownSymbol;\r\n }\r\n return links.resolvedSymbol;\r\n }\r\n function isInTypeQuery(node) {\r\n while (node) {\r\n switch (node.kind) {\r\n case 135 /* TypeQuery */:\r\n return true;\r\n case 63 /* Identifier */:\r\n case 120 /* QualifiedName */:\r\n node = node.parent;\r\n continue;\r\n default:\r\n return false;\r\n }\r\n }\r\n ts.Debug.fail(\"should not get here\");\r\n }\r\n // Remove one or more primitive types from a union type\r\n function subtractPrimitiveTypes(type, subtractMask) {\r\n if (type.flags & 16384 /* Union */) {\r\n var types = type.types;\r\n if (ts.forEach(types, function (t) { return t.flags & subtractMask; })) {\r\n return getUnionType(ts.filter(types, function (t) { return !(t.flags & subtractMask); }));\r\n }\r\n }\r\n return type;\r\n }\r\n // Check if a given variable is assigned within a given syntax node\r\n function isVariableAssignedWithin(symbol, node) {\r\n var links = getNodeLinks(node);\r\n if (links.assignmentChecks) {\r\n var cachedResult = links.assignmentChecks[symbol.id];\r\n if (cachedResult !== undefined) {\r\n return cachedResult;\r\n }\r\n }\r\n else {\r\n links.assignmentChecks = {};\r\n }\r\n return links.assignmentChecks[symbol.id] = isAssignedIn(node);\r\n function isAssignedInBinaryExpression(node) {\r\n if (node.operator >= 51 /* FirstAssignment */ && node.operator <= 62 /* LastAssignment */) {\r\n var n = node.left;\r\n while (n.kind === 149 /* ParenthesizedExpression */) {\r\n n = n.expression;\r\n }\r\n if (n.kind === 63 /* Identifier */ && getResolvedSymbol(n) === symbol) {\r\n return true;\r\n }\r\n }\r\n return ts.forEachChild(node, isAssignedIn);\r\n }\r\n function isAssignedInVariableDeclaration(node) {\r\n if (getSymbolOfNode(node) === symbol && node.initializer) {\r\n return true;\r\n }\r\n return ts.forEachChild(node, isAssignedIn);\r\n }\r\n function isAssignedIn(node) {\r\n switch (node.kind) {\r\n case 157 /* BinaryExpression */:\r\n return isAssignedInBinaryExpression(node);\r\n case 183 /* VariableDeclaration */:\r\n return isAssignedInVariableDeclaration(node);\r\n case 141 /* ArrayLiteralExpression */:\r\n case 142 /* ObjectLiteralExpression */:\r\n case 143 /* PropertyAccessExpression */:\r\n case 144 /* ElementAccessExpression */:\r\n case 145 /* CallExpression */:\r\n case 146 /* NewExpression */:\r\n case 148 /* TypeAssertionExpression */:\r\n case 149 /* ParenthesizedExpression */:\r\n case 155 /* PrefixUnaryExpression */:\r\n case 152 /* DeleteExpression */:\r\n case 153 /* TypeOfExpression */:\r\n case 154 /* VoidExpression */:\r\n case 156 /* PostfixUnaryExpression */:\r\n case 158 /* ConditionalExpression */:\r\n case 163 /* Block */:\r\n case 164 /* VariableStatement */:\r\n case 166 /* ExpressionStatement */:\r\n case 167 /* IfStatement */:\r\n case 168 /* DoStatement */:\r\n case 169 /* WhileStatement */:\r\n case 170 /* ForStatement */:\r\n case 171 /* ForInStatement */:\r\n case 174 /* ReturnStatement */:\r\n case 175 /* WithStatement */:\r\n case 176 /* SwitchStatement */:\r\n case 194 /* CaseClause */:\r\n case 195 /* DefaultClause */:\r\n case 177 /* LabeledStatement */:\r\n case 178 /* ThrowStatement */:\r\n case 179 /* TryStatement */:\r\n case 180 /* TryBlock */:\r\n case 197 /* CatchClause */:\r\n case 181 /* FinallyBlock */:\r\n return ts.forEachChild(node, isAssignedIn);\r\n }\r\n return false;\r\n }\r\n }\r\n function resolveLocation(node) {\r\n // Resolve location from top down towards node if it is a context sensitive expression\r\n // That helps in making sure not assigning types as any when resolved out of order\r\n var containerNodes = [];\r\n for (var parent = node.parent; parent; parent = parent.parent) {\r\n if ((ts.isExpression(parent) || ts.isObjectLiteralMethod(node)) && isContextSensitive(parent)) {\r\n containerNodes.unshift(parent);\r\n }\r\n }\r\n ts.forEach(containerNodes, function (node) {\r\n getTypeOfNode(node);\r\n });\r\n }\r\n function getSymbolAtLocation(node) {\r\n resolveLocation(node);\r\n return getSymbolInfo(node);\r\n }\r\n function getTypeAtLocation(node) {\r\n resolveLocation(node);\r\n return getTypeOfNode(node);\r\n }\r\n function getTypeOfSymbolAtLocation(symbol, node) {\r\n resolveLocation(node);\r\n // Get the narrowed type of symbol at given location instead of just getting \r\n // the type of the symbol.\r\n // eg. \r\n // function foo(a: string | number) {\r\n // if (typeof a === \"string\") {\r\n // a/**/\r\n // }\r\n // }\r\n // getTypeOfSymbol for a would return type of parameter symbol string | number\r\n // Unless we provide location /**/, checker wouldn't know how to narrow the type\r\n // By using getNarrowedTypeOfSymbol would return string since it would be able to narrow\r\n // it by typeguard in the if true condition\r\n return getNarrowedTypeOfSymbol(symbol, node);\r\n }\r\n // Get the narrowed type of a given symbol at a given location\r\n function getNarrowedTypeOfSymbol(symbol, node) {\r\n var type = getTypeOfSymbol(symbol);\r\n // Only narrow when symbol is variable of a structured type\r\n if (node && (symbol.flags & 3 /* Variable */ && type.flags & 65025 /* Structured */)) {\r\n loop: while (node.parent) {\r\n var child = node;\r\n node = node.parent;\r\n var narrowedType = type;\r\n switch (node.kind) {\r\n case 167 /* IfStatement */:\r\n // In a branch of an if statement, narrow based on controlling expression\r\n if (child !== node.expression) {\r\n narrowedType = narrowType(type, node.expression, child === node.thenStatement);\r\n }\r\n break;\r\n case 158 /* ConditionalExpression */:\r\n // In a branch of a conditional expression, narrow based on controlling condition\r\n if (child !== node.condition) {\r\n narrowedType = narrowType(type, node.condition, child === node.whenTrue);\r\n }\r\n break;\r\n case 157 /* BinaryExpression */:\r\n // In the right operand of an && or ||, narrow based on left operand\r\n if (child === node.right) {\r\n if (node.operator === 47 /* AmpersandAmpersandToken */) {\r\n narrowedType = narrowType(type, node.left, true);\r\n }\r\n else if (node.operator === 48 /* BarBarToken */) {\r\n narrowedType = narrowType(type, node.left, false);\r\n }\r\n }\r\n break;\r\n case 201 /* SourceFile */:\r\n case 189 /* ModuleDeclaration */:\r\n case 184 /* FunctionDeclaration */:\r\n case 125 /* Method */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n case 126 /* Constructor */:\r\n break loop;\r\n }\r\n // Use narrowed type if it is a subtype and construct contains no assignments to variable\r\n if (narrowedType !== type && isTypeSubtypeOf(narrowedType, type)) {\r\n if (isVariableAssignedWithin(symbol, node)) {\r\n break;\r\n }\r\n type = narrowedType;\r\n }\r\n }\r\n }\r\n return type;\r\n function narrowTypeByEquality(type, expr, assumeTrue) {\r\n // Check that we have 'typeof <symbol>' on the left and string literal on the right\r\n if (expr.left.kind !== 153 /* TypeOfExpression */ || expr.right.kind !== 7 /* StringLiteral */) {\r\n return type;\r\n }\r\n var left = expr.left;\r\n var right = expr.right;\r\n if (left.expression.kind !== 63 /* Identifier */ || getResolvedSymbol(left.expression) !== symbol) {\r\n return type;\r\n }\r\n var t = right.text;\r\n var checkType = t === \"string\" ? stringType : t === \"number\" ? numberType : t === \"boolean\" ? booleanType : emptyObjectType;\r\n if (expr.operator === 30 /* ExclamationEqualsEqualsToken */) {\r\n assumeTrue = !assumeTrue;\r\n }\r\n if (assumeTrue) {\r\n // The assumed result is true. If check was for a primitive type, that type is the narrowed type. Otherwise we can\r\n // remove the primitive types from the narrowed type.\r\n return checkType === emptyObjectType ? subtractPrimitiveTypes(type, 2 /* String */ | 4 /* Number */ | 8 /* Boolean */) : checkType;\r\n }\r\n else {\r\n // The assumed result is false. If check was for a primitive type we can remove that type from the narrowed type.\r\n // Otherwise we don't have enough information to do anything.\r\n return checkType === emptyObjectType ? type : subtractPrimitiveTypes(type, checkType.flags);\r\n }\r\n }\r\n function narrowTypeByAnd(type, expr, assumeTrue) {\r\n if (assumeTrue) {\r\n // The assumed result is true, therefore we narrow assuming each operand to be true.\r\n return narrowType(narrowType(type, expr.left, true), expr.right, true);\r\n }\r\n else {\r\n // The assumed result is false. This means either the first operand was false, or the first operand was true\r\n // and the second operand was false. We narrow with those assumptions and union the two resulting types.\r\n return getUnionType([\r\n narrowType(type, expr.left, false),\r\n narrowType(narrowType(type, expr.left, true), expr.right, false)\r\n ]);\r\n }\r\n }\r\n function narrowTypeByOr(type, expr, assumeTrue) {\r\n if (assumeTrue) {\r\n // The assumed result is true. This means either the first operand was true, or the first operand was false\r\n // and the second operand was true. We narrow with those assumptions and union the two resulting types.\r\n return getUnionType([\r\n narrowType(type, expr.left, true),\r\n narrowType(narrowType(type, expr.left, false), expr.right, true)\r\n ]);\r\n }\r\n else {\r\n // The assumed result is false, therefore we narrow assuming each operand to be false.\r\n return narrowType(narrowType(type, expr.left, false), expr.right, false);\r\n }\r\n }\r\n function narrowTypeByInstanceof(type, expr, assumeTrue) {\r\n // Check that assumed result is true and we have variable symbol on the left\r\n if (!assumeTrue || expr.left.kind !== 63 /* Identifier */ || getResolvedSymbol(expr.left) !== symbol) {\r\n return type;\r\n }\r\n // Check that right operand is a function type with a prototype property\r\n var rightType = checkExpression(expr.right);\r\n if (!isTypeSubtypeOf(rightType, globalFunctionType)) {\r\n return type;\r\n }\r\n var prototypeProperty = getPropertyOfType(rightType, \"prototype\");\r\n if (!prototypeProperty) {\r\n return type;\r\n }\r\n var prototypeType = getTypeOfSymbol(prototypeProperty);\r\n // Narrow to type of prototype property if it is a subtype of current type\r\n return isTypeSubtypeOf(prototypeType, type) ? prototypeType : type;\r\n }\r\n // Narrow the given type based on the given expression having the assumed boolean value\r\n function narrowType(type, expr, assumeTrue) {\r\n switch (expr.kind) {\r\n case 149 /* ParenthesizedExpression */:\r\n return narrowType(type, expr.expression, assumeTrue);\r\n case 157 /* BinaryExpression */:\r\n var operator = expr.operator;\r\n if (operator === 29 /* EqualsEqualsEqualsToken */ || operator === 30 /* ExclamationEqualsEqualsToken */) {\r\n return narrowTypeByEquality(type, expr, assumeTrue);\r\n }\r\n else if (operator === 47 /* AmpersandAmpersandToken */) {\r\n return narrowTypeByAnd(type, expr, assumeTrue);\r\n }\r\n else if (operator === 48 /* BarBarToken */) {\r\n return narrowTypeByOr(type, expr, assumeTrue);\r\n }\r\n else if (operator === 85 /* InstanceOfKeyword */) {\r\n return narrowTypeByInstanceof(type, expr, assumeTrue);\r\n }\r\n break;\r\n case 155 /* PrefixUnaryExpression */:\r\n if (expr.operator === 45 /* ExclamationToken */) {\r\n return narrowType(type, expr.operand, !assumeTrue);\r\n }\r\n break;\r\n }\r\n return type;\r\n }\r\n }\r\n function checkIdentifier(node) {\r\n var symbol = getResolvedSymbol(node);\r\n if (symbol.flags & 33554432 /* Import */) {\r\n // Mark the import as referenced so that we emit it in the final .js file.\r\n // exception: identifiers that appear in type queries, const enums, modules that contain only const enums\r\n getSymbolLinks(symbol).referenced = getSymbolLinks(symbol).referenced || (!isInTypeQuery(node) && !isConstEnumOrConstEnumOnlyModule(resolveImport(symbol)));\r\n }\r\n checkCollisionWithCapturedSuperVariable(node, node);\r\n checkCollisionWithCapturedThisVariable(node, node);\r\n checkCollisionWithIndexVariableInGeneratedCode(node, node);\r\n return getNarrowedTypeOfSymbol(getExportSymbolOfValueSymbolIfExported(symbol), node);\r\n }\r\n function captureLexicalThis(node, container) {\r\n var classNode = container.parent && container.parent.kind === 185 /* ClassDeclaration */ ? container.parent : undefined;\r\n getNodeLinks(node).flags |= 2 /* LexicalThis */;\r\n if (container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */) {\r\n getNodeLinks(classNode).flags |= 4 /* CaptureThis */;\r\n }\r\n else {\r\n getNodeLinks(container).flags |= 4 /* CaptureThis */;\r\n }\r\n }\r\n function checkThisExpression(node) {\r\n // Stop at the first arrow function so that we can\r\n // tell whether 'this' needs to be captured.\r\n var container = ts.getThisContainer(node, true);\r\n var needToCaptureLexicalThis = false;\r\n // Now skip arrow functions to get the \"real\" owner of 'this'.\r\n if (container.kind === 151 /* ArrowFunction */) {\r\n container = ts.getThisContainer(container, false);\r\n needToCaptureLexicalThis = true;\r\n }\r\n switch (container.kind) {\r\n case 189 /* ModuleDeclaration */:\r\n error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_body);\r\n break;\r\n case 188 /* EnumDeclaration */:\r\n error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location);\r\n break;\r\n case 126 /* Constructor */:\r\n if (isInConstructorArgumentInitializer(node, container)) {\r\n error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments);\r\n }\r\n break;\r\n case 124 /* Property */:\r\n if (container.flags & 128 /* Static */) {\r\n error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer);\r\n }\r\n break;\r\n }\r\n if (needToCaptureLexicalThis) {\r\n captureLexicalThis(node, container);\r\n }\r\n var classNode = container.parent && container.parent.kind === 185 /* ClassDeclaration */ ? container.parent : undefined;\r\n if (classNode) {\r\n var symbol = getSymbolOfNode(classNode);\r\n return container.flags & 128 /* Static */ ? getTypeOfSymbol(symbol) : getDeclaredTypeOfSymbol(symbol);\r\n }\r\n return anyType;\r\n }\r\n function getSuperContainer(node) {\r\n while (true) {\r\n node = node.parent;\r\n if (!node)\r\n return node;\r\n switch (node.kind) {\r\n case 184 /* FunctionDeclaration */:\r\n case 150 /* FunctionExpression */:\r\n case 151 /* ArrowFunction */:\r\n case 124 /* Property */:\r\n case 125 /* Method */:\r\n case 126 /* Constructor */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n return node;\r\n }\r\n }\r\n }\r\n function isInConstructorArgumentInitializer(node, constructorDecl) {\r\n for (var n = node; n && n !== constructorDecl; n = n.parent) {\r\n if (n.kind === 123 /* Parameter */) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n function checkSuperExpression(node) {\r\n var isCallExpression = node.parent.kind === 145 /* CallExpression */ && node.parent.expression === node;\r\n var enclosingClass = ts.getAncestor(node, 185 /* ClassDeclaration */);\r\n var baseClass;\r\n if (enclosingClass && ts.getClassBaseTypeNode(enclosingClass)) {\r\n var classType = getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClass));\r\n baseClass = classType.baseTypes.length && classType.baseTypes[0];\r\n }\r\n if (!baseClass) {\r\n error(node, ts.Diagnostics.super_can_only_be_referenced_in_a_derived_class);\r\n return unknownType;\r\n }\r\n var container = getSuperContainer(node);\r\n if (container) {\r\n var canUseSuperExpression = false;\r\n if (isCallExpression) {\r\n // TS 1.0 SPEC (April 2014): 4.8.1\r\n // Super calls are only permitted in constructors of derived classes\r\n canUseSuperExpression = container.kind === 126 /* Constructor */;\r\n }\r\n else {\r\n // TS 1.0 SPEC (April 2014)\r\n // 'super' property access is allowed\r\n // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance\r\n // - In a static member function or static member accessor\r\n // super property access might appear in arrow functions with arbitrary deep nesting\r\n var needToCaptureLexicalThis = false;\r\n while (container && container.kind === 151 /* ArrowFunction */) {\r\n container = getSuperContainer(container);\r\n needToCaptureLexicalThis = true;\r\n }\r\n // topmost container must be something that is directly nested in the class declaration\r\n if (container && container.parent && container.parent.kind === 185 /* ClassDeclaration */) {\r\n if (container.flags & 128 /* Static */) {\r\n canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */;\r\n }\r\n else {\r\n canUseSuperExpression = container.kind === 125 /* Method */ || container.kind === 127 /* GetAccessor */ || container.kind === 128 /* SetAccessor */ || container.kind === 124 /* Property */ || container.kind === 126 /* Constructor */;\r\n }\r\n }\r\n }\r\n if (canUseSuperExpression) {\r\n var returnType;\r\n if ((container.flags & 128 /* Static */) || isCallExpression) {\r\n getNodeLinks(node).flags |= 32 /* SuperStatic */;\r\n returnType = getTypeOfSymbol(baseClass.symbol);\r\n }\r\n else {\r\n getNodeLinks(node).flags |= 16 /* SuperInstance */;\r\n returnType = baseClass;\r\n }\r\n if (container.kind === 126 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) {\r\n // issue custom error message for super property access in constructor arguments (to be aligned with old compiler)\r\n error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments);\r\n returnType = unknownType;\r\n }\r\n if (!isCallExpression && needToCaptureLexicalThis) {\r\n // call expressions are allowed only in constructors so they should always capture correct 'this'\r\n // super property access expressions can also appear in arrow functions -\r\n // in this case they should also use correct lexical this\r\n captureLexicalThis(node.parent, container);\r\n }\r\n return returnType;\r\n }\r\n }\r\n if (isCallExpression) {\r\n error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors);\r\n }\r\n else {\r\n error(node, ts.Diagnostics.super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class);\r\n }\r\n return unknownType;\r\n }\r\n // Return contextual type of parameter or undefined if no contextual type is available\r\n function getContextuallyTypedParameterType(parameter) {\r\n if (isFunctionExpressionOrArrowFunction(parameter.parent)) {\r\n var func = parameter.parent;\r\n if (isContextSensitive(func)) {\r\n var contextualSignature = getContextualSignature(func);\r\n if (contextualSignature) {\r\n var funcHasRestParameters = ts.hasRestParameters(func);\r\n var len = func.parameters.length - (funcHasRestParameters ? 1 : 0);\r\n var indexOfParameter = ts.indexOf(func.parameters, parameter);\r\n if (indexOfParameter < len) {\r\n return getTypeAtPosition(contextualSignature, indexOfParameter);\r\n }\r\n // If last parameter is contextually rest parameter get its type\r\n if (indexOfParameter === (func.parameters.length - 1) && funcHasRestParameters && contextualSignature.hasRestParameter && func.parameters.length >= contextualSignature.parameters.length) {\r\n return getTypeOfSymbol(contextualSignature.parameters[contextualSignature.parameters.length - 1]);\r\n }\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n // In a variable, parameter or property declaration with a type annotation, the contextual type of an initializer\r\n // expression is the type of the variable, parameter or property. In a parameter declaration of a contextually\r\n // typed function expression, the contextual type of an initializer expression is the contextual type of the\r\n // parameter.\r\n function getContextualTypeForInitializerExpression(node) {\r\n var declaration = node.parent;\r\n if (node === declaration.initializer) {\r\n if (declaration.type) {\r\n return getTypeFromTypeNode(declaration.type);\r\n }\r\n if (declaration.kind === 123 /* Parameter */) {\r\n return getContextuallyTypedParameterType(declaration);\r\n }\r\n }\r\n return undefined;\r\n }\r\n function getContextualTypeForReturnExpression(node) {\r\n var func = ts.getContainingFunction(node);\r\n if (func) {\r\n // If the containing function has a return type annotation, is a constructor, or is a get accessor whose\r\n // corresponding set accessor has a type annotation, return statements in the function are contextually typed\r\n if (func.type || func.kind === 126 /* Constructor */ || func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */))) {\r\n return getReturnTypeOfSignature(getSignatureFromDeclaration(func));\r\n }\r\n // Otherwise, if the containing function is contextually typed by a function type with exactly one call signature\r\n // and that call signature is non-generic, return statements are contextually typed by the return type of the signature\r\n var signature = getContextualSignatureForFunctionLikeDeclaration(func);\r\n if (signature) {\r\n return getReturnTypeOfSignature(signature);\r\n }\r\n }\r\n return undefined;\r\n }\r\n // In a typed function call, an argument expression is contextually typed by the type of the corresponding parameter.\r\n function getContextualTypeForArgument(node) {\r\n var callExpression = node.parent;\r\n var argIndex = ts.indexOf(callExpression.arguments, node);\r\n if (argIndex >= 0) {\r\n var signature = getResolvedSignature(callExpression);\r\n return getTypeAtPosition(signature, argIndex);\r\n }\r\n return undefined;\r\n }\r\n function getContextualTypeForBinaryOperand(node) {\r\n var binaryExpression = node.parent;\r\n var operator = binaryExpression.operator;\r\n if (operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) {\r\n // In an assignment expression, the right operand is contextually typed by the type of the left operand.\r\n if (node === binaryExpression.right) {\r\n return checkExpression(binaryExpression.left);\r\n }\r\n }\r\n else if (operator === 48 /* BarBarToken */) {\r\n // When an || expression has a contextual type, the operands are contextually typed by that type. When an ||\r\n // expression has no contextual type, the right operand is contextually typed by the type of the left operand.\r\n var type = getContextualType(binaryExpression);\r\n if (!type && node === binaryExpression.right) {\r\n type = checkExpression(binaryExpression.left);\r\n }\r\n return type;\r\n }\r\n return undefined;\r\n }\r\n // Apply a mapping function to a contextual type and return the resulting type. If the contextual type\r\n // is a union type, the mapping function is applied to each constituent type and a union of the resulting\r\n // types is returned.\r\n function applyToContextualType(type, mapper) {\r\n if (!(type.flags & 16384 /* Union */)) {\r\n return mapper(type);\r\n }\r\n var types = type.types;\r\n var mappedType;\r\n var mappedTypes;\r\n for (var i = 0; i < types.length; i++) {\r\n var t = mapper(types[i]);\r\n if (t) {\r\n if (!mappedType) {\r\n mappedType = t;\r\n }\r\n else if (!mappedTypes) {\r\n mappedTypes = [mappedType, t];\r\n }\r\n else {\r\n mappedTypes.push(t);\r\n }\r\n }\r\n }\r\n return mappedTypes ? getUnionType(mappedTypes) : mappedType;\r\n }\r\n function getTypeOfPropertyOfContextualType(type, name) {\r\n return applyToContextualType(type, function (t) {\r\n var prop = getPropertyOfObjectType(t, name);\r\n return prop ? getTypeOfSymbol(prop) : undefined;\r\n });\r\n }\r\n function getIndexTypeOfContextualType(type, kind) {\r\n return applyToContextualType(type, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); });\r\n }\r\n // Return true if the given contextual type is a tuple-like type\r\n function contextualTypeIsTupleType(type) {\r\n return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getPropertyOfObjectType(t, \"0\"); }) : getPropertyOfObjectType(type, \"0\"));\r\n }\r\n // Return true if the given contextual type provides an index signature of the given kind\r\n function contextualTypeHasIndexSignature(type, kind) {\r\n return !!(type.flags & 16384 /* Union */ ? ts.forEach(type.types, function (t) { return getIndexTypeOfObjectOrUnionType(t, kind); }) : getIndexTypeOfObjectOrUnionType(type, kind));\r\n }\r\n // In an object literal contextually typed by a type T, the contextual type of a property assignment is the type of\r\n // the matching property in T, if one exists. Otherwise, it is the type of the numeric index signature in T, if one\r\n // exists. Otherwise, it is the type of the string index signature in T, if one exists.\r\n function getContextualTypeForObjectLiteralMethod(node) {\r\n ts.Debug.assert(ts.isObjectLiteralMethod(node));\r\n if (isInsideWithStatementBody(node)) {\r\n // We cannot answer semantic questions within a with block, do not proceed any further\r\n return undefined;\r\n }\r\n return getContextualTypeForObjectLiteralElement(node);\r\n }\r\n function getContextualTypeForObjectLiteralElement(element) {\r\n var objectLiteral = element.parent;\r\n var type = getContextualType(objectLiteral);\r\n // TODO(jfreeman): Handle this case for computed names and symbols\r\n var name = element.name.text;\r\n if (type && name) {\r\n return getTypeOfPropertyOfContextualType(type, name) || isNumericName(name) && getIndexTypeOfContextualType(type, 1 /* Number */) || getIndexTypeOfContextualType(type, 0 /* String */);\r\n }\r\n return undefined;\r\n }\r\n // In an array literal contextually typed by a type T, the contextual type of an element expression at index N is\r\n // the type of the property with the numeric name N in T, if one exists. Otherwise, it is the type of the numeric\r\n // index signature in T, if one exists.\r\n function getContextualTypeForElementExpression(node) {\r\n var arrayLiteral = node.parent;\r\n var type = getContextualType(arrayLiteral);\r\n if (type) {\r\n var index = ts.indexOf(arrayLiteral.elements, node);\r\n return getTypeOfPropertyOfContextualType(type, \"\" + index) || getIndexTypeOfContextualType(type, 1 /* Number */);\r\n }\r\n return undefined;\r\n }\r\n // In a contextually typed conditional expression, the true/false expressions are contextually typed by the same type.\r\n function getContextualTypeForConditionalOperand(node) {\r\n var conditional = node.parent;\r\n return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional) : undefined;\r\n }\r\n // Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily\r\n // be \"pushed\" onto a node using the contextualType property.\r\n function getContextualType(node) {\r\n if (isInsideWithStatementBody(node)) {\r\n // We cannot answer semantic questions within a with block, do not proceed any further\r\n return undefined;\r\n }\r\n if (node.contextualType) {\r\n return node.contextualType;\r\n }\r\n var parent = node.parent;\r\n switch (parent.kind) {\r\n case 183 /* VariableDeclaration */:\r\n case 123 /* Parameter */:\r\n case 124 /* Property */:\r\n return getContextualTypeForInitializerExpression(node);\r\n case 151 /* ArrowFunction */:\r\n case 174 /* ReturnStatement */:\r\n return getContextualTypeForReturnExpression(node);\r\n case 145 /* CallExpression */:\r\n case 146 /* NewExpression */:\r\n return getContextualTypeForArgument(node);\r\n case 148 /* TypeAssertionExpression */:\r\n return getTypeFromTypeNode(parent.type);\r\n case 157 /* BinaryExpression */:\r\n return getContextualTypeForBinaryOperand(node);\r\n case 198 /* PropertyAssignment */:\r\n return getContextualTypeForObjectLiteralElement(parent);\r\n case 141 /* ArrayLiteralExpression */:\r\n return getContextualTypeForElementExpression(node);\r\n case 158 /* ConditionalExpression */:\r\n return getContextualTypeForConditionalOperand(node);\r\n }\r\n return undefined;\r\n }\r\n // If the given type is an object or union type, if that type has a single signature, and if\r\n // that signature is non-generic, return the signature. Otherwise return undefined.\r\n function getNonGenericSignature(type) {\r\n var signatures = getSignaturesOfObjectOrUnionType(type, 0 /* Call */);\r\n if (signatures.length === 1) {\r\n var signature = signatures[0];\r\n if (!signature.typeParameters) {\r\n return signature;\r\n }\r\n }\r\n }\r\n function isFunctionExpressionOrArrowFunction(node) {\r\n return node.kind === 150 /* FunctionExpression */ || node.kind === 151 /* ArrowFunction */;\r\n }\r\n function getContextualSignatureForFunctionLikeDeclaration(node) {\r\n // Only function expressions and arrow functions are contextually typed.\r\n return isFunctionExpressionOrArrowFunction(node) ? getContextualSignature(node) : undefined;\r\n }\r\n // Return the contextual signature for a given expression node. A contextual type provides a\r\n // contextual signature if it has a single call signature and if that call signature is non-generic.\r\n // If the contextual type is a union type, get the signature from each type possible and if they are \r\n // all identical ignoring their return type, the result is same signature but with return type as \r\n // union type of return types from these signatures\r\n function getContextualSignature(node) {\r\n ts.Debug.assert(node.kind !== 125 /* Method */ || ts.isObjectLiteralMethod(node));\r\n var type = ts.isObjectLiteralMethod(node) ? getContextualTypeForObjectLiteralMethod(node) : getContextualType(node);\r\n if (!type) {\r\n return undefined;\r\n }\r\n if (!(type.flags & 16384 /* Union */)) {\r\n return getNonGenericSignature(type);\r\n }\r\n var signatureList;\r\n var types = type.types;\r\n for (var i = 0; i < types.length; i++) {\r\n // The signature set of all constituent type with call signatures should match\r\n // So number of signatures allowed is either 0 or 1\r\n if (signatureList && getSignaturesOfObjectOrUnionType(types[i], 0 /* Call */).length > 1) {\r\n return undefined;\r\n }\r\n var signature = getNonGenericSignature(types[i]);\r\n if (signature) {\r\n if (!signatureList) {\r\n // This signature will contribute to contextual union signature\r\n signatureList = [signature];\r\n }\r\n else if (!compareSignatures(signatureList[0], signature, false, compareTypes)) {\r\n // Signatures arent identical, do not use\r\n return undefined;\r\n }\r\n else {\r\n // Use this signature for contextual union signature\r\n signatureList.push(signature);\r\n }\r\n }\r\n }\r\n // Result is union of signatures collected (return type is union of return types of this signature set)\r\n var result;\r\n if (signatureList) {\r\n result = cloneSignature(signatureList[0]);\r\n // Clear resolved return type we possibly got from cloneSignature\r\n result.resolvedReturnType = undefined;\r\n result.unionSignatures = signatureList;\r\n }\r\n return result;\r\n }\r\n // Presence of a contextual type mapper indicates inferential typing, except the identityMapper object is\r\n // used as a special marker for other purposes.\r\n function isInferentialContext(mapper) {\r\n return mapper && mapper !== identityMapper;\r\n }\r\n function checkArrayLiteral(node, contextualMapper) {\r\n var elements = node.elements;\r\n if (!elements.length) {\r\n return createArrayType(undefinedType);\r\n }\r\n var elementTypes = ts.map(elements, function (e) { return checkExpression(e, contextualMapper); });\r\n var contextualType = getContextualType(node);\r\n if (contextualType && contextualTypeIsTupleType(contextualType)) {\r\n return createTupleType(elementTypes);\r\n }\r\n return createArrayType(getUnionType(elementTypes));\r\n }\r\n function isNumericName(name) {\r\n // The intent of numeric names is that\r\n // - they are names with text in a numeric form, and that\r\n // - setting properties/indexing with them is always equivalent to doing so with the numeric literal 'numLit',\r\n // acquired by applying the abstract 'ToNumber' operation on the name's text.\r\n //\r\n // The subtlety is in the latter portion, as we cannot reliably say that anything that looks like a numeric literal is a numeric name.\r\n // In fact, it is the case that the text of the name must be equal to 'ToString(numLit)' for this to hold.\r\n //\r\n // Consider the property name '\"0xF00D\"'. When one indexes with '0xF00D', they are actually indexing with the value of 'ToString(0xF00D)'\r\n // according to the ECMAScript specification, so it is actually as if the user indexed with the string '\"61453\"'.\r\n // Thus, the text of all numeric literals equivalent to '61543' such as '0xF00D', '0xf00D', '0170015', etc. are not valid numeric names\r\n // because their 'ToString' representation is not equal to their original text.\r\n // This is motivated by ECMA-262 sections 9.3.1, 9.8.1, 11.1.5, and 11.2.1.\r\n //\r\n // Here, we test whether 'ToString(ToNumber(name))' is exactly equal to 'name'.\r\n // The '+' prefix operator is equivalent here to applying the abstract ToNumber operation.\r\n // Applying the 'toString()' method on a number gives us the abstract ToString operation on a number.\r\n //\r\n // Note that this accepts the values 'Infinity', '-Infinity', and 'NaN', and that this is intentional.\r\n // This is desired behavior, because when indexing with them as numeric entities, you are indexing\r\n // with the strings '\"Infinity\"', '\"-Infinity\"', and '\"NaN\"' respectively.\r\n return (+name).toString() === name;\r\n }\r\n function checkObjectLiteral(node, contextualMapper) {\r\n var members = node.symbol.members;\r\n var properties = {};\r\n var contextualType = getContextualType(node);\r\n for (var id in members) {\r\n if (ts.hasProperty(members, id)) {\r\n var member = members[id];\r\n if (member.flags & 4 /* Property */ || ts.isObjectLiteralMethod(member.declarations[0])) {\r\n var memberDecl = member.declarations[0];\r\n var type;\r\n if (memberDecl.kind === 198 /* PropertyAssignment */) {\r\n type = checkExpression(memberDecl.initializer, contextualMapper);\r\n }\r\n else if (memberDecl.kind === 125 /* Method */) {\r\n type = checkObjectLiteralMethod(memberDecl, contextualMapper);\r\n }\r\n else {\r\n ts.Debug.assert(memberDecl.kind === 199 /* ShorthandPropertyAssignment */);\r\n type = memberDecl.name.kind === 121 /* ComputedPropertyName */ ? unknownType : checkExpression(memberDecl.name, contextualMapper);\r\n }\r\n var prop = createSymbol(4 /* Property */ | 268435456 /* Transient */ | member.flags, member.name);\r\n prop.declarations = member.declarations;\r\n prop.parent = member.parent;\r\n if (member.valueDeclaration) {\r\n prop.valueDeclaration = member.valueDeclaration;\r\n }\r\n prop.type = type;\r\n prop.target = member;\r\n member = prop;\r\n }\r\n else {\r\n // TypeScript 1.0 spec (April 2014)\r\n // A get accessor declaration is processed in the same manner as \r\n // an ordinary function declaration(section 6.1) with no parameters.\r\n // A set accessor declaration is processed in the same manner \r\n // as an ordinary function declaration with a single parameter and a Void return type.\r\n var getAccessor = getDeclarationOfKind(member, 127 /* GetAccessor */);\r\n if (getAccessor) {\r\n checkAccessorDeclaration(getAccessor);\r\n }\r\n var setAccessor = getDeclarationOfKind(member, 128 /* SetAccessor */);\r\n if (setAccessor) {\r\n checkAccessorDeclaration(setAccessor);\r\n }\r\n }\r\n properties[member.name] = member;\r\n }\r\n }\r\n var stringIndexType = getIndexType(0 /* String */);\r\n var numberIndexType = getIndexType(1 /* Number */);\r\n return createAnonymousType(node.symbol, properties, emptyArray, emptyArray, stringIndexType, numberIndexType);\r\n function getIndexType(kind) {\r\n if (contextualType && contextualTypeHasIndexSignature(contextualType, kind)) {\r\n var propTypes = [];\r\n for (var id in properties) {\r\n if (ts.hasProperty(properties, id)) {\r\n if (kind === 0 /* String */ || isNumericName(id)) {\r\n var type = getTypeOfSymbol(properties[id]);\r\n if (!ts.contains(propTypes, type)) {\r\n propTypes.push(type);\r\n }\r\n }\r\n }\r\n }\r\n return propTypes.length ? getUnionType(propTypes) : undefinedType;\r\n }\r\n return undefined;\r\n }\r\n }\r\n // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized\r\n // '.prototype' property as well as synthesized tuple index properties.\r\n function getDeclarationKindFromSymbol(s) {\r\n return s.valueDeclaration ? s.valueDeclaration.kind : 124 /* Property */;\r\n }\r\n function getDeclarationFlagsFromSymbol(s) {\r\n return s.valueDeclaration ? s.valueDeclaration.flags : s.flags & 536870912 /* Prototype */ ? 16 /* Public */ | 128 /* Static */ : 0;\r\n }\r\n function checkClassPropertyAccess(node, left, type, prop) {\r\n var flags = getDeclarationFlagsFromSymbol(prop);\r\n // Public properties are always accessible\r\n if (!(flags & (32 /* Private */ | 64 /* Protected */))) {\r\n return;\r\n }\r\n // Property is known to be private or protected at this point\r\n // Get the declaring and enclosing class instance types\r\n var enclosingClassDeclaration = ts.getAncestor(node, 185 /* ClassDeclaration */);\r\n var enclosingClass = enclosingClassDeclaration ? getDeclaredTypeOfSymbol(getSymbolOfNode(enclosingClassDeclaration)) : undefined;\r\n var declaringClass = getDeclaredTypeOfSymbol(prop.parent);\r\n // Private property is accessible if declaring and enclosing class are the same\r\n if (flags & 32 /* Private */) {\r\n if (declaringClass !== enclosingClass) {\r\n error(node, ts.Diagnostics.Property_0_is_private_and_only_accessible_within_class_1, symbolToString(prop), typeToString(declaringClass));\r\n }\r\n return;\r\n }\r\n // Property is known to be protected at this point\r\n // All protected properties of a supertype are accessible in a super access\r\n if (left.kind === 89 /* SuperKeyword */) {\r\n return;\r\n }\r\n // A protected property is accessible in the declaring class and classes derived from it\r\n if (!enclosingClass || !hasBaseType(enclosingClass, declaringClass)) {\r\n error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses, symbolToString(prop), typeToString(declaringClass));\r\n return;\r\n }\r\n // No further restrictions for static properties\r\n if (flags & 128 /* Static */) {\r\n return;\r\n }\r\n // An instance property must be accessed through an instance of the enclosing class\r\n if (!(getTargetType(type).flags & (1024 /* Class */ | 2048 /* Interface */) && hasBaseType(type, enclosingClass))) {\r\n error(node, ts.Diagnostics.Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1, symbolToString(prop), typeToString(enclosingClass));\r\n }\r\n }\r\n function checkPropertyAccessExpression(node) {\r\n return checkPropertyAccessExpressionOrQualifiedName(node, node.expression, node.name);\r\n }\r\n function checkQualifiedName(node) {\r\n return checkPropertyAccessExpressionOrQualifiedName(node, node.left, node.right);\r\n }\r\n function checkPropertyAccessExpressionOrQualifiedName(node, left, right) {\r\n var type = checkExpressionOrQualifiedName(left);\r\n if (type === unknownType)\r\n return type;\r\n if (type !== anyType) {\r\n var apparentType = getApparentType(getWidenedType(type));\r\n if (apparentType === unknownType) {\r\n // handle cases when type is Type parameter with invalid constraint\r\n return unknownType;\r\n }\r\n var prop = getPropertyOfType(apparentType, right.text);\r\n if (!prop) {\r\n if (right.text) {\r\n error(right, ts.Diagnostics.Property_0_does_not_exist_on_type_1, ts.declarationNameToString(right), typeToString(type));\r\n }\r\n return unknownType;\r\n }\r\n getNodeLinks(node).resolvedSymbol = prop;\r\n if (prop.parent && prop.parent.flags & 32 /* Class */) {\r\n // TS 1.0 spec (April 2014): 4.8.2\r\n // - In a constructor, instance member function, instance member accessor, or \r\n // instance member variable initializer where this references a derived class instance, \r\n // a super property access is permitted and must specify a public instance member function of the base class.\r\n // - In a static member function or static member accessor \r\n // where this references the constructor function object of a derived class, \r\n // a super property access is permitted and must specify a public static member function of the base class.\r\n if (left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) {\r\n error(right, ts.Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword);\r\n }\r\n else {\r\n checkClassPropertyAccess(node, left, type, prop);\r\n }\r\n }\r\n return getTypeOfSymbol(prop);\r\n }\r\n return anyType;\r\n }\r\n function isValidPropertyAccess(node, propertyName) {\r\n var left = node.kind === 143 /* PropertyAccessExpression */ ? node.expression : node.left;\r\n var type = checkExpressionOrQualifiedName(left);\r\n if (type !== unknownType && type !== anyType) {\r\n var prop = getPropertyOfType(getWidenedType(type), propertyName);\r\n if (prop && prop.parent && prop.parent.flags & 32 /* Class */) {\r\n if (left.kind === 89 /* SuperKeyword */ && getDeclarationKindFromSymbol(prop) !== 125 /* Method */) {\r\n return false;\r\n }\r\n else {\r\n var diagnosticsCount = diagnostics.length;\r\n checkClassPropertyAccess(node, left, type, prop);\r\n return diagnostics.length === diagnosticsCount;\r\n }\r\n }\r\n }\r\n return true;\r\n }\r\n function checkIndexedAccess(node) {\r\n // Obtain base constraint such that we can bail out if the constraint is an unknown type\r\n var objectType = getApparentType(checkExpression(node.expression));\r\n var indexType = node.argumentExpression ? checkExpression(node.argumentExpression) : unknownType;\r\n if (objectType === unknownType) {\r\n return unknownType;\r\n }\r\n if (isConstEnumObjectType(objectType) && node.argumentExpression && node.argumentExpression.kind !== 7 /* StringLiteral */) {\r\n error(node.argumentExpression, ts.Diagnostics.Index_expression_arguments_in_const_enums_must_be_of_type_string);\r\n }\r\n // TypeScript 1.0 spec (April 2014): 4.10 Property Access\r\n // - If IndexExpr is a string literal or a numeric literal and ObjExpr's apparent type has a property with the name \r\n // given by that literal(converted to its string representation in the case of a numeric literal), the property access is of the type of that property.\r\n // - Otherwise, if ObjExpr's apparent type has a numeric index signature and IndexExpr is of type Any, the Number primitive type, or an enum type, \r\n // the property access is of the type of that index signature.\r\n // - Otherwise, if ObjExpr's apparent type has a string index signature and IndexExpr is of type Any, the String or Number primitive type, or an enum type, \r\n // the property access is of the type of that index signature.\r\n // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any.\r\n // See if we can index as a property.\r\n if (node.argumentExpression) {\r\n if (node.argumentExpression.kind === 7 /* StringLiteral */ || node.argumentExpression.kind === 6 /* NumericLiteral */) {\r\n var name = node.argumentExpression.text;\r\n var prop = getPropertyOfType(objectType, name);\r\n if (prop) {\r\n getNodeLinks(node).resolvedSymbol = prop;\r\n return getTypeOfSymbol(prop);\r\n }\r\n }\r\n }\r\n // Check for compatible indexer types.\r\n if (indexType.flags & (1 /* Any */ | 258 /* StringLike */ | 132 /* NumberLike */)) {\r\n // Try to use a number indexer.\r\n if (indexType.flags & (1 /* Any */ | 132 /* NumberLike */)) {\r\n var numberIndexType = getIndexTypeOfType(objectType, 1 /* Number */);\r\n if (numberIndexType) {\r\n return numberIndexType;\r\n }\r\n }\r\n // Try to use string indexing.\r\n var stringIndexType = getIndexTypeOfType(objectType, 0 /* String */);\r\n if (stringIndexType) {\r\n return stringIndexType;\r\n }\r\n // Fall back to any.\r\n if (compilerOptions.noImplicitAny && objectType !== anyType) {\r\n error(node, ts.Diagnostics.Index_signature_of_object_type_implicitly_has_an_any_type);\r\n }\r\n return anyType;\r\n }\r\n // REVIEW: Users should know the type that was actually used.\r\n error(node, ts.Diagnostics.An_index_expression_argument_must_be_of_type_string_number_or_any);\r\n return unknownType;\r\n }\r\n function resolveUntypedCall(node) {\r\n if (node.kind === 147 /* TaggedTemplateExpression */) {\r\n checkExpression(node.template);\r\n }\r\n else {\r\n ts.forEach(node.arguments, function (argument) {\r\n checkExpression(argument);\r\n });\r\n }\r\n return anySignature;\r\n }\r\n function resolveErrorCall(node) {\r\n resolveUntypedCall(node);\r\n return unknownSignature;\r\n }\r\n function hasCorrectArity(node, args, signature) {\r\n var adjustedArgCount;\r\n var typeArguments;\r\n var callIsIncomplete;\r\n if (node.kind === 147 /* TaggedTemplateExpression */) {\r\n var tagExpression = node;\r\n // Even if the call is incomplete, we'll have a missing expression as our last argument,\r\n // so we can say the count is just the arg list length\r\n adjustedArgCount = args.length;\r\n typeArguments = undefined;\r\n if (tagExpression.template.kind === 159 /* TemplateExpression */) {\r\n // If a tagged template expression lacks a tail literal, the call is incomplete.\r\n // Specifically, a template only can end in a TemplateTail or a Missing literal.\r\n var templateExpression = tagExpression.template;\r\n var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans);\r\n ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span.\r\n callIsIncomplete = ts.getFullWidth(lastSpan.literal) === 0 || !!lastSpan.literal.isUnterminated;\r\n }\r\n else {\r\n // If the template didn't end in a backtick, or its beginning occurred right prior to EOF,\r\n // then this might actually turn out to be a TemplateHead in the future;\r\n // so we consider the call to be incomplete.\r\n var templateLiteral = tagExpression.template;\r\n ts.Debug.assert(templateLiteral.kind === 9 /* NoSubstitutionTemplateLiteral */);\r\n callIsIncomplete = !!templateLiteral.isUnterminated;\r\n }\r\n }\r\n else {\r\n var callExpression = node;\r\n if (!callExpression.arguments) {\r\n // This only happens when we have something of the form: 'new C'\r\n ts.Debug.assert(callExpression.kind === 146 /* NewExpression */);\r\n return signature.minArgumentCount === 0;\r\n }\r\n // For IDE scenarios we may have an incomplete call, so a trailing comma is tantamount to adding another argument.\r\n adjustedArgCount = callExpression.arguments.hasTrailingComma ? args.length + 1 : args.length;\r\n // If we are missing the close paren, the call is incomplete.\r\n callIsIncomplete = callExpression.arguments.end === callExpression.end;\r\n typeArguments = callExpression.typeArguments;\r\n }\r\n ts.Debug.assert(adjustedArgCount !== undefined, \"'adjustedArgCount' undefined\");\r\n ts.Debug.assert(callIsIncomplete !== undefined, \"'callIsIncomplete' undefined\");\r\n return checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature);\r\n /**\r\n * @param adjustedArgCount The \"apparent\" number of arguments that we will have in this call.\r\n * @param typeArguments Type arguments node of the call if it exists; undefined otherwise.\r\n * @param callIsIncomplete Whether or not a call is unfinished, and we should be \"lenient\" when we have too few arguments.\r\n * @param signature The signature whose arity we are comparing.\r\n */\r\n function checkArity(adjustedArgCount, typeArguments, callIsIncomplete, signature) {\r\n // Too many arguments implies incorrect arity.\r\n if (!signature.hasRestParameter && adjustedArgCount > signature.parameters.length) {\r\n return false;\r\n }\r\n // If the user supplied type arguments, but the number of type arguments does not match\r\n // the declared number of type parameters, the call has an incorrect arity.\r\n var hasRightNumberOfTypeArgs = !typeArguments || (signature.typeParameters && typeArguments.length === signature.typeParameters.length);\r\n if (!hasRightNumberOfTypeArgs) {\r\n return false;\r\n }\r\n // If the call is incomplete, we should skip the lower bound check.\r\n var hasEnoughArguments = adjustedArgCount >= signature.minArgumentCount;\r\n return callIsIncomplete || hasEnoughArguments;\r\n }\r\n }\r\n // If type has a single call signature and no other members, return that signature. Otherwise, return undefined.\r\n function getSingleCallSignature(type) {\r\n if (type.flags & 48128 /* ObjectType */) {\r\n var resolved = resolveObjectOrUnionTypeMembers(type);\r\n if (resolved.callSignatures.length === 1 && resolved.constructSignatures.length === 0 && resolved.properties.length === 0 && !resolved.stringIndexType && !resolved.numberIndexType) {\r\n return resolved.callSignatures[0];\r\n }\r\n }\r\n return undefined;\r\n }\r\n // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec)\r\n function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper) {\r\n var context = createInferenceContext(signature.typeParameters, true);\r\n forEachMatchingParameterType(contextualSignature, signature, function (source, target) {\r\n // Type parameters from outer context referenced by source type are fixed by instantiation of the source type\r\n inferTypes(context, instantiateType(source, contextualMapper), target);\r\n });\r\n return getSignatureInstantiation(signature, getInferredTypes(context));\r\n }\r\n function inferTypeArguments(signature, args, excludeArgument) {\r\n var typeParameters = signature.typeParameters;\r\n var context = createInferenceContext(typeParameters, false);\r\n var mapper = createInferenceMapper(context);\r\n for (var i = 0; i < args.length; i++) {\r\n if (args[i].kind === 161 /* OmittedExpression */) {\r\n continue;\r\n }\r\n if (!excludeArgument || excludeArgument[i] === undefined) {\r\n var parameterType = getTypeAtPosition(signature, i);\r\n if (i === 0 && args[i].parent.kind === 147 /* TaggedTemplateExpression */) {\r\n inferTypes(context, globalTemplateStringsArrayType, parameterType);\r\n continue;\r\n }\r\n inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType);\r\n }\r\n }\r\n // Next, infer from those context sensitive arguments that are no longer excluded\r\n if (excludeArgument) {\r\n for (var i = 0; i < args.length; i++) {\r\n if (args[i].kind === 161 /* OmittedExpression */) {\r\n continue;\r\n }\r\n // No need to special-case tagged templates; their excludeArgument value will be 'undefined'.\r\n if (excludeArgument[i] === false) {\r\n var parameterType = getTypeAtPosition(signature, i);\r\n inferTypes(context, checkExpressionWithContextualType(args[i], parameterType, mapper), parameterType);\r\n }\r\n }\r\n }\r\n var inferredTypes = getInferredTypes(context);\r\n // Inference has failed if the inferenceFailureType type is in list of inferences\r\n context.failedTypeParameterIndex = ts.indexOf(inferredTypes, inferenceFailureType);\r\n for (var i = 0; i < inferredTypes.length; i++) {\r\n if (inferredTypes[i] === inferenceFailureType) {\r\n inferredTypes[i] = unknownType;\r\n }\r\n }\r\n return context;\r\n }\r\n function checkTypeArguments(signature, typeArguments, typeArgumentResultTypes, reportErrors) {\r\n var typeParameters = signature.typeParameters;\r\n var typeArgumentsAreAssignable = true;\r\n for (var i = 0; i < typeParameters.length; i++) {\r\n var typeArgNode = typeArguments[i];\r\n var typeArgument = getTypeFromTypeNode(typeArgNode);\r\n // Do not push on this array! It has a preallocated length\r\n typeArgumentResultTypes[i] = typeArgument;\r\n if (typeArgumentsAreAssignable) {\r\n var constraint = getConstraintOfTypeParameter(typeParameters[i]);\r\n if (constraint) {\r\n typeArgumentsAreAssignable = checkTypeAssignableTo(typeArgument, constraint, reportErrors ? typeArgNode : undefined, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1);\r\n }\r\n }\r\n }\r\n return typeArgumentsAreAssignable;\r\n }\r\n function checkApplicableSignature(node, args, signature, relation, excludeArgument, reportErrors) {\r\n for (var i = 0; i < args.length; i++) {\r\n var arg = args[i];\r\n var argType;\r\n if (arg.kind === 161 /* OmittedExpression */) {\r\n continue;\r\n }\r\n var paramType = getTypeAtPosition(signature, i);\r\n if (i === 0 && node.kind === 147 /* TaggedTemplateExpression */) {\r\n // A tagged template expression has something of a\r\n // \"virtual\" parameter with the \"cooked\" strings array type.\r\n argType = globalTemplateStringsArrayType;\r\n }\r\n else {\r\n // String literals get string literal types unless we're reporting errors\r\n argType = arg.kind === 7 /* StringLiteral */ && !reportErrors ? getStringLiteralType(arg) : checkExpressionWithContextualType(arg, paramType, excludeArgument && excludeArgument[i] ? identityMapper : undefined);\r\n }\r\n // Use argument expression as error location when reporting errors\r\n var isValidArgument = checkTypeRelatedTo(argType, paramType, relation, reportErrors ? arg : undefined, ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1);\r\n if (!isValidArgument) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n /**\r\n * Returns the effective arguments for an expression that works like a function invokation.\r\n *\r\n * If 'node' is a CallExpression or a NewExpression, then its argument list is returned.\r\n * If 'node' is a TaggedTemplateExpression, a new argument list is constructed from the substitution\r\n * expressions, where the first element of the list is the template for error reporting purposes.\r\n */\r\n function getEffectiveCallArguments(node) {\r\n var args;\r\n if (node.kind === 147 /* TaggedTemplateExpression */) {\r\n var template = node.template;\r\n args = [template];\r\n if (template.kind === 159 /* TemplateExpression */) {\r\n ts.forEach(template.templateSpans, function (span) {\r\n args.push(span.expression);\r\n });\r\n }\r\n }\r\n else {\r\n args = node.arguments || emptyArray;\r\n }\r\n return args;\r\n }\r\n function resolveCall(node, signatures, candidatesOutArray) {\r\n var isTaggedTemplate = node.kind === 147 /* TaggedTemplateExpression */;\r\n var typeArguments = isTaggedTemplate ? undefined : node.typeArguments;\r\n ts.forEach(typeArguments, checkSourceElement);\r\n var candidates = candidatesOutArray || [];\r\n // collectCandidates fills up the candidates array directly\r\n collectCandidates();\r\n if (!candidates.length) {\r\n error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target);\r\n return resolveErrorCall(node);\r\n }\r\n var args = getEffectiveCallArguments(node);\r\n // The following applies to any value of 'excludeArgument[i]':\r\n // - true: the argument at 'i' is susceptible to a one-time permanent contextual typing.\r\n // - undefined: the argument at 'i' is *not* susceptible to permanent contextual typing.\r\n // - false: the argument at 'i' *was* and *has been* permanently contextually typed.\r\n //\r\n // The idea is that we will perform type argument inference & assignability checking once\r\n // without using the susceptible parameters that are functions, and once more for each of those\r\n // parameters, contextually typing each as we go along.\r\n //\r\n // For a tagged template, then the first argument be 'undefined' if necessary\r\n // because it represents a TemplateStringsArray.\r\n var excludeArgument;\r\n for (var i = isTaggedTemplate ? 1 : 0; i < args.length; i++) {\r\n if (isContextSensitive(args[i])) {\r\n if (!excludeArgument) {\r\n excludeArgument = new Array(args.length);\r\n }\r\n excludeArgument[i] = true;\r\n }\r\n }\r\n // The following variables are captured and modified by calls to chooseOverload.\r\n // If overload resolution or type argument inference fails, we want to report the\r\n // best error possible. The best error is one which says that an argument was not\r\n // assignable to a parameter. This implies that everything else about the overload\r\n // was fine. So if there is any overload that is only incorrect because of an\r\n // argument, we will report an error on that one.\r\n //\r\n // function foo(s: string) {}\r\n // function foo(n: number) {} // Report argument error on this overload\r\n // function foo() {}\r\n // foo(true);\r\n //\r\n // If none of the overloads even made it that far, there are two possibilities.\r\n // There was a problem with type arguments for some overload, in which case\r\n // report an error on that. Or none of the overloads even had correct arity,\r\n // in which case give an arity error.\r\n //\r\n // function foo<T>(x: T, y: T) {} // Report type argument inference error\r\n // function foo() {}\r\n // foo(0, true);\r\n //\r\n var candidateForArgumentError;\r\n var candidateForTypeArgumentError;\r\n var resultOfFailedInference;\r\n var result;\r\n // Section 4.12.1:\r\n // if the candidate list contains one or more signatures for which the type of each argument\r\n // expression is a subtype of each corresponding parameter type, the return type of the first\r\n // of those signatures becomes the return type of the function call.\r\n // Otherwise, the return type of the first signature in the candidate list becomes the return\r\n // type of the function call.\r\n //\r\n // Whether the call is an error is determined by assignability of the arguments. The subtype pass\r\n // is just important for choosing the best signature. So in the case where there is only one\r\n // signature, the subtype pass is useless. So skipping it is an optimization.\r\n if (candidates.length > 1) {\r\n result = chooseOverload(candidates, subtypeRelation);\r\n }\r\n if (!result) {\r\n // Reinitialize these pointers for round two\r\n candidateForArgumentError = undefined;\r\n candidateForTypeArgumentError = undefined;\r\n resultOfFailedInference = undefined;\r\n result = chooseOverload(candidates, assignableRelation);\r\n }\r\n if (result) {\r\n return result;\r\n }\r\n // No signatures were applicable. Now report errors based on the last applicable signature with\r\n // no arguments excluded from assignability checks.\r\n // If candidate is undefined, it means that no candidates had a suitable arity. In that case,\r\n // skip the checkApplicableSignature check.\r\n if (candidateForArgumentError) {\r\n // excludeArgument is undefined, in this case also equivalent to [undefined, undefined, ...]\r\n // The importance of excludeArgument is to prevent us from typing function expression parameters\r\n // in arguments too early. If possible, we'd like to only type them once we know the correct\r\n // overload. However, this matters for the case where the call is correct. When the call is\r\n // an error, we don't need to exclude any arguments, although it would cause no harm to do so.\r\n checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, undefined, true);\r\n }\r\n else if (candidateForTypeArgumentError) {\r\n if (!isTaggedTemplate && node.typeArguments) {\r\n checkTypeArguments(candidateForTypeArgumentError, node.typeArguments, [], true);\r\n }\r\n else {\r\n ts.Debug.assert(resultOfFailedInference.failedTypeParameterIndex >= 0);\r\n var failedTypeParameter = candidateForTypeArgumentError.typeParameters[resultOfFailedInference.failedTypeParameterIndex];\r\n var inferenceCandidates = getInferenceCandidates(resultOfFailedInference, resultOfFailedInference.failedTypeParameterIndex);\r\n var diagnosticChainHead = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly, typeToString(failedTypeParameter));\r\n reportNoCommonSupertypeError(inferenceCandidates, node.expression || node.tag, diagnosticChainHead);\r\n }\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Supplied_parameters_do_not_match_any_signature_of_call_target);\r\n }\r\n // No signature was applicable. We have already reported the errors for the invalid signature.\r\n // If this is a type resolution session, e.g. Language Service, try to get better information that anySignature.\r\n // Pick the first candidate that matches the arity. This way we can get a contextual type for cases like:\r\n // declare function f(a: { xa: number; xb: number; });\r\n // f({ |\r\n if (!fullTypeCheck) {\r\n for (var i = 0, n = candidates.length; i < n; i++) {\r\n if (hasCorrectArity(node, args, candidates[i])) {\r\n return candidates[i];\r\n }\r\n }\r\n }\r\n return resolveErrorCall(node);\r\n function chooseOverload(candidates, relation) {\r\n for (var i = 0; i < candidates.length; i++) {\r\n if (!hasCorrectArity(node, args, candidates[i])) {\r\n continue;\r\n }\r\n var originalCandidate = candidates[i];\r\n var inferenceResult;\r\n while (true) {\r\n var candidate = originalCandidate;\r\n if (candidate.typeParameters) {\r\n var typeArgumentTypes;\r\n var typeArgumentsAreValid;\r\n if (typeArguments) {\r\n typeArgumentTypes = new Array(candidate.typeParameters.length);\r\n typeArgumentsAreValid = checkTypeArguments(candidate, typeArguments, typeArgumentTypes, false);\r\n }\r\n else {\r\n inferenceResult = inferTypeArguments(candidate, args, excludeArgument);\r\n typeArgumentsAreValid = inferenceResult.failedTypeParameterIndex < 0;\r\n typeArgumentTypes = inferenceResult.inferredTypes;\r\n }\r\n if (!typeArgumentsAreValid) {\r\n break;\r\n }\r\n candidate = getSignatureInstantiation(candidate, typeArgumentTypes);\r\n }\r\n if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, false)) {\r\n break;\r\n }\r\n var index = excludeArgument ? ts.indexOf(excludeArgument, true) : -1;\r\n if (index < 0) {\r\n return candidate;\r\n }\r\n excludeArgument[index] = false;\r\n }\r\n // A post-mortem of this iteration of the loop. The signature was not applicable,\r\n // so we want to track it as a candidate for reporting an error. If the candidate\r\n // had no type parameters, or had no issues related to type arguments, we can\r\n // report an error based on the arguments. If there was an issue with type\r\n // arguments, then we can only report an error based on the type arguments.\r\n if (originalCandidate.typeParameters) {\r\n var instantiatedCandidate = candidate;\r\n if (typeArgumentsAreValid) {\r\n candidateForArgumentError = instantiatedCandidate;\r\n }\r\n else {\r\n candidateForTypeArgumentError = originalCandidate;\r\n if (!typeArguments) {\r\n resultOfFailedInference = inferenceResult;\r\n }\r\n }\r\n }\r\n else {\r\n ts.Debug.assert(originalCandidate === candidate);\r\n candidateForArgumentError = originalCandidate;\r\n }\r\n }\r\n return undefined;\r\n }\r\n // The candidate list orders groups in reverse, but within a group signatures are kept in declaration order\r\n // A nit here is that we reorder only signatures that belong to the same symbol,\r\n // so order how inherited signatures are processed is still preserved.\r\n // interface A { (x: string): void }\r\n // interface B extends A { (x: 'foo'): string }\r\n // var b: B;\r\n // b('foo') // <- here overloads should be processed as [(x:'foo'): string, (x: string): void]\r\n function collectCandidates() {\r\n var result = candidates;\r\n var lastParent;\r\n var lastSymbol;\r\n var cutoffPos = 0;\r\n var pos;\r\n ts.Debug.assert(!result.length);\r\n for (var i = 0; i < signatures.length; i++) {\r\n var signature = signatures[i];\r\n var symbol = signature.declaration && getSymbolOfNode(signature.declaration);\r\n var parent = signature.declaration && signature.declaration.parent;\r\n if (!lastSymbol || symbol === lastSymbol) {\r\n if (lastParent && parent === lastParent) {\r\n pos++;\r\n }\r\n else {\r\n lastParent = parent;\r\n pos = cutoffPos;\r\n }\r\n }\r\n else {\r\n // current declaration belongs to a different symbol\r\n // set cutoffPos so re-orderings in the future won't change result set from 0 to cutoffPos\r\n pos = cutoffPos = result.length;\r\n lastParent = parent;\r\n }\r\n lastSymbol = symbol;\r\n for (var j = result.length; j > pos; j--) {\r\n result[j] = result[j - 1];\r\n }\r\n result[pos] = signature;\r\n }\r\n }\r\n }\r\n function resolveCallExpression(node, candidatesOutArray) {\r\n if (node.expression.kind === 89 /* SuperKeyword */) {\r\n var superType = checkSuperExpression(node.expression);\r\n if (superType !== unknownType) {\r\n return resolveCall(node, getSignaturesOfType(superType, 1 /* Construct */), candidatesOutArray);\r\n }\r\n return resolveUntypedCall(node);\r\n }\r\n var funcType = checkExpression(node.expression);\r\n var apparentType = getApparentType(funcType);\r\n if (apparentType === unknownType) {\r\n // Another error has already been reported\r\n return resolveErrorCall(node);\r\n }\r\n // Technically, this signatures list may be incomplete. We are taking the apparent type,\r\n // but we are not including call signatures that may have been added to the Object or\r\n // Function interface, since they have none by default. This is a bit of a leap of faith\r\n // that the user will not add any.\r\n var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);\r\n var constructSignatures = getSignaturesOfType(apparentType, 1 /* Construct */);\r\n // TS 1.0 spec: 4.12\r\n // If FuncExpr is of type Any, or of an object type that has no call or construct signatures\r\n // but is a subtype of the Function interface, the call is an untyped function call. In an\r\n // untyped function call no TypeArgs are permitted, Args can be any argument list, no contextual\r\n // types are provided for the argument expressions, and the result is always of type Any.\r\n // We exclude union types because we may have a union of function types that happen to have\r\n // no common signatures.\r\n if (funcType === anyType || (!callSignatures.length && !constructSignatures.length && !(funcType.flags & 16384 /* Union */) && isTypeAssignableTo(funcType, globalFunctionType))) {\r\n if (node.typeArguments) {\r\n error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);\r\n }\r\n return resolveUntypedCall(node);\r\n }\r\n // If FuncExpr's apparent type(section 3.8.1) is a function type, the call is a typed function call.\r\n // TypeScript employs overload resolution in typed function calls in order to support functions\r\n // with multiple call signatures.\r\n if (!callSignatures.length) {\r\n if (constructSignatures.length) {\r\n error(node, ts.Diagnostics.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new, typeToString(funcType));\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature);\r\n }\r\n return resolveErrorCall(node);\r\n }\r\n return resolveCall(node, callSignatures, candidatesOutArray);\r\n }\r\n function resolveNewExpression(node, candidatesOutArray) {\r\n var expressionType = checkExpression(node.expression);\r\n // TS 1.0 spec: 4.11\r\n // If ConstructExpr is of type Any, Args can be any argument\r\n // list and the result of the operation is of type Any.\r\n if (expressionType === anyType) {\r\n if (node.typeArguments) {\r\n error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);\r\n }\r\n return resolveUntypedCall(node);\r\n }\r\n // If ConstructExpr's apparent type(section 3.8.1) is an object type with one or\r\n // more construct signatures, the expression is processed in the same manner as a\r\n // function call, but using the construct signatures as the initial set of candidate\r\n // signatures for overload resolution.The result type of the function call becomes\r\n // the result type of the operation.\r\n expressionType = getApparentType(expressionType);\r\n if (expressionType === unknownType) {\r\n // Another error has already been reported\r\n return resolveErrorCall(node);\r\n }\r\n // Technically, this signatures list may be incomplete. We are taking the apparent type,\r\n // but we are not including construct signatures that may have been added to the Object or\r\n // Function interface, since they have none by default. This is a bit of a leap of faith\r\n // that the user will not add any.\r\n var constructSignatures = getSignaturesOfType(expressionType, 1 /* Construct */);\r\n if (constructSignatures.length) {\r\n return resolveCall(node, constructSignatures, candidatesOutArray);\r\n }\r\n // If ConstructExpr's apparent type is an object type with no construct signatures but\r\n // one or more call signatures, the expression is processed as a function call. A compile-time\r\n // error occurs if the result of the function call is not Void. The type of the result of the\r\n // operation is Any.\r\n var callSignatures = getSignaturesOfType(expressionType, 0 /* Call */);\r\n if (callSignatures.length) {\r\n var signature = resolveCall(node, callSignatures, candidatesOutArray);\r\n if (getReturnTypeOfSignature(signature) !== voidType) {\r\n error(node, ts.Diagnostics.Only_a_void_function_can_be_called_with_the_new_keyword);\r\n }\r\n return signature;\r\n }\r\n error(node, ts.Diagnostics.Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature);\r\n return resolveErrorCall(node);\r\n }\r\n function resolveTaggedTemplateExpression(node, candidatesOutArray) {\r\n var tagType = checkExpression(node.tag);\r\n var apparentType = getApparentType(tagType);\r\n if (apparentType === unknownType) {\r\n // Another error has already been reported\r\n return resolveErrorCall(node);\r\n }\r\n var callSignatures = getSignaturesOfType(apparentType, 0 /* Call */);\r\n if (tagType === anyType || (!callSignatures.length && !(tagType.flags & 16384 /* Union */) && isTypeAssignableTo(tagType, globalFunctionType))) {\r\n return resolveUntypedCall(node);\r\n }\r\n if (!callSignatures.length) {\r\n error(node, ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature);\r\n return resolveErrorCall(node);\r\n }\r\n return resolveCall(node, callSignatures, candidatesOutArray);\r\n }\r\n // candidatesOutArray is passed by signature help in the language service, and collectCandidates\r\n // must fill it up with the appropriate candidate signatures\r\n function getResolvedSignature(node, candidatesOutArray) {\r\n var links = getNodeLinks(node);\r\n // If getResolvedSignature has already been called, we will have cached the resolvedSignature.\r\n // However, it is possible that either candidatesOutArray was not passed in the first time,\r\n // or that a different candidatesOutArray was passed in. Therefore, we need to redo the work\r\n // to correctly fill the candidatesOutArray.\r\n if (!links.resolvedSignature || candidatesOutArray) {\r\n links.resolvedSignature = anySignature;\r\n if (node.kind === 145 /* CallExpression */) {\r\n links.resolvedSignature = resolveCallExpression(node, candidatesOutArray);\r\n }\r\n else if (node.kind === 146 /* NewExpression */) {\r\n links.resolvedSignature = resolveNewExpression(node, candidatesOutArray);\r\n }\r\n else if (node.kind === 147 /* TaggedTemplateExpression */) {\r\n links.resolvedSignature = resolveTaggedTemplateExpression(node, candidatesOutArray);\r\n }\r\n else {\r\n ts.Debug.fail(\"Branch in 'getResolvedSignature' should be unreachable.\");\r\n }\r\n }\r\n return links.resolvedSignature;\r\n }\r\n function checkCallExpression(node) {\r\n var signature = getResolvedSignature(node);\r\n if (node.expression.kind === 89 /* SuperKeyword */) {\r\n return voidType;\r\n }\r\n if (node.kind === 146 /* NewExpression */) {\r\n var declaration = signature.declaration;\r\n if (declaration && declaration.kind !== 126 /* Constructor */ && declaration.kind !== 130 /* ConstructSignature */ && declaration.kind !== 134 /* ConstructorType */) {\r\n // When resolved signature is a call signature (and not a construct signature) the result type is any\r\n if (compilerOptions.noImplicitAny) {\r\n error(node, ts.Diagnostics.new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type);\r\n }\r\n return anyType;\r\n }\r\n }\r\n return getReturnTypeOfSignature(signature);\r\n }\r\n function checkTaggedTemplateExpression(node) {\r\n return getReturnTypeOfSignature(getResolvedSignature(node));\r\n }\r\n function checkTypeAssertion(node) {\r\n var exprType = checkExpression(node.expression);\r\n var targetType = getTypeFromTypeNode(node.type);\r\n if (fullTypeCheck && targetType !== unknownType) {\r\n var widenedType = getWidenedType(exprType, true);\r\n if (!(isTypeAssignableTo(targetType, widenedType))) {\r\n checkTypeAssignableTo(exprType, targetType, node, ts.Diagnostics.Neither_type_0_nor_type_1_is_assignable_to_the_other);\r\n }\r\n }\r\n return targetType;\r\n }\r\n function getTypeAtPosition(signature, pos) {\r\n return signature.hasRestParameter ? pos < signature.parameters.length - 1 ? getTypeOfSymbol(signature.parameters[pos]) : getRestTypeOfSignature(signature) : pos < signature.parameters.length ? getTypeOfSymbol(signature.parameters[pos]) : anyType;\r\n }\r\n function assignContextualParameterTypes(signature, context, mapper) {\r\n var len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0);\r\n for (var i = 0; i < len; i++) {\r\n var parameter = signature.parameters[i];\r\n var links = getSymbolLinks(parameter);\r\n links.type = instantiateType(getTypeAtPosition(context, i), mapper);\r\n }\r\n if (signature.hasRestParameter && context.hasRestParameter && signature.parameters.length >= context.parameters.length) {\r\n var parameter = signature.parameters[signature.parameters.length - 1];\r\n var links = getSymbolLinks(parameter);\r\n links.type = instantiateType(getTypeOfSymbol(context.parameters[context.parameters.length - 1]), mapper);\r\n }\r\n }\r\n function getReturnTypeFromBody(func, contextualMapper) {\r\n var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func);\r\n if (func.body.kind !== 163 /* Block */) {\r\n var unwidenedType = checkAndMarkExpression(func.body, contextualMapper);\r\n var widenedType = getWidenedType(unwidenedType);\r\n if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== unwidenedType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) {\r\n error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeToString(widenedType));\r\n }\r\n return widenedType;\r\n }\r\n // Aggregate the types of expressions within all the return statements.\r\n var types = checkAndAggregateReturnExpressionTypes(func.body, contextualMapper);\r\n // Try to return the best common type if we have any return expressions.\r\n if (types.length > 0) {\r\n // When return statements are contextually typed we allow the return type to be a union type. Otherwise we require the\r\n // return expressions to have a best common supertype.\r\n var commonType = contextualSignature ? getUnionType(types) : getCommonSupertype(types);\r\n if (!commonType) {\r\n error(func, ts.Diagnostics.No_best_common_type_exists_among_return_expressions);\r\n return unknownType;\r\n }\r\n var widenedType = getWidenedType(commonType);\r\n // Check and report for noImplicitAny if the best common type implicitly gets widened to an 'any'/arrays-of-'any' type.\r\n if (fullTypeCheck && compilerOptions.noImplicitAny && !contextualSignature && widenedType !== commonType && getInnermostTypeOfNestedArrayTypes(widenedType) === anyType) {\r\n var typeName = typeToString(widenedType);\r\n if (func.name) {\r\n error(func, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(func.name), typeName);\r\n }\r\n else {\r\n error(func, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName);\r\n }\r\n }\r\n return widenedType;\r\n }\r\n return voidType;\r\n }\r\n /// Returns a set of types relating to every return expression relating to a function block.\r\n function checkAndAggregateReturnExpressionTypes(body, contextualMapper) {\r\n var aggregatedTypes = [];\r\n ts.forEachReturnStatement(body, function (returnStatement) {\r\n var expr = returnStatement.expression;\r\n if (expr) {\r\n var type = checkAndMarkExpression(expr, contextualMapper);\r\n if (!ts.contains(aggregatedTypes, type)) {\r\n aggregatedTypes.push(type);\r\n }\r\n }\r\n });\r\n return aggregatedTypes;\r\n }\r\n function bodyContainsAReturnStatement(funcBody) {\r\n return ts.forEachReturnStatement(funcBody, function (returnStatement) {\r\n return true;\r\n });\r\n }\r\n function bodyContainsSingleThrowStatement(body) {\r\n return (body.statements.length === 1) && (body.statements[0].kind === 178 /* ThrowStatement */);\r\n }\r\n // TypeScript Specification 1.0 (6.3) - July 2014\r\n // An explicitly typed function whose return type isn't the Void or the Any type\r\n // must have at least one return statement somewhere in its body.\r\n // An exception to this rule is if the function implementation consists of a single 'throw' statement.\r\n function checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(func, returnType) {\r\n if (!fullTypeCheck) {\r\n return;\r\n }\r\n // Functions that return 'void' or 'any' don't need any return expressions.\r\n if (returnType === voidType || returnType === anyType) {\r\n return;\r\n }\r\n // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check.\r\n if (!func.body || func.body.kind !== 163 /* Block */) {\r\n return;\r\n }\r\n var bodyBlock = func.body;\r\n // Ensure the body has at least one return expression.\r\n if (bodyContainsAReturnStatement(bodyBlock)) {\r\n return;\r\n }\r\n // If there are no return expressions, then we need to check if\r\n // the function body consists solely of a throw statement;\r\n // this is to make an exception for unimplemented functions.\r\n if (bodyContainsSingleThrowStatement(bodyBlock)) {\r\n return;\r\n }\r\n // This function does not conform to the specification.\r\n error(func.type, ts.Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value_or_consist_of_a_single_throw_statement);\r\n }\r\n function checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper) {\r\n ts.Debug.assert(node.kind !== 125 /* Method */ || ts.isObjectLiteralMethod(node));\r\n // The identityMapper object is used to indicate that function expressions are wildcards\r\n if (contextualMapper === identityMapper) {\r\n return anyFunctionType;\r\n }\r\n var links = getNodeLinks(node);\r\n var type = getTypeOfSymbol(node.symbol);\r\n // Check if function expression is contextually typed and assign parameter types if so\r\n if (!(links.flags & 64 /* ContextChecked */)) {\r\n var contextualSignature = getContextualSignature(node);\r\n // If a type check is started at a function expression that is an argument of a function call, obtaining the\r\n // contextual type may recursively get back to here during overload resolution of the call. If so, we will have\r\n // already assigned contextual types.\r\n if (!(links.flags & 64 /* ContextChecked */)) {\r\n links.flags |= 64 /* ContextChecked */;\r\n if (contextualSignature) {\r\n var signature = getSignaturesOfType(type, 0 /* Call */)[0];\r\n if (isContextSensitive(node)) {\r\n assignContextualParameterTypes(signature, contextualSignature, contextualMapper || identityMapper);\r\n }\r\n if (!node.type) {\r\n signature.resolvedReturnType = resolvingType;\r\n var returnType = getReturnTypeFromBody(node, contextualMapper);\r\n if (signature.resolvedReturnType === resolvingType) {\r\n signature.resolvedReturnType = returnType;\r\n }\r\n }\r\n }\r\n checkSignatureDeclaration(node);\r\n }\r\n }\r\n if (fullTypeCheck && node.kind !== 125 /* Method */) {\r\n checkCollisionWithCapturedSuperVariable(node, node.name);\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n }\r\n return type;\r\n }\r\n function checkFunctionExpressionOrObjectLiteralMethodBody(node) {\r\n ts.Debug.assert(node.kind !== 125 /* Method */ || ts.isObjectLiteralMethod(node));\r\n if (node.type) {\r\n checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type));\r\n }\r\n if (node.body) {\r\n if (node.body.kind === 163 /* Block */) {\r\n checkSourceElement(node.body);\r\n }\r\n else {\r\n var exprType = checkExpression(node.body);\r\n if (node.type) {\r\n checkTypeAssignableTo(exprType, getTypeFromTypeNode(node.type), node.body, undefined);\r\n }\r\n checkFunctionExpressionBodies(node.body);\r\n }\r\n }\r\n }\r\n function checkArithmeticOperandType(operand, type, diagnostic) {\r\n if (!(type.flags & (1 /* Any */ | 132 /* NumberLike */))) {\r\n error(operand, diagnostic);\r\n return false;\r\n }\r\n return true;\r\n }\r\n function checkReferenceExpression(n, invalidReferenceMessage, constantVarianleMessage) {\r\n function findSymbol(n) {\r\n var symbol = getNodeLinks(n).resolvedSymbol;\r\n // Because we got the symbol from the resolvedSymbol property, it might be of kind\r\n // SymbolFlags.ExportValue. In this case it is necessary to get the actual export\r\n // symbol, which will have the correct flags set on it.\r\n return symbol && getExportSymbolOfValueSymbolIfExported(symbol);\r\n }\r\n function isReferenceOrErrorExpression(n) {\r\n switch (n.kind) {\r\n case 63 /* Identifier */:\r\n var symbol = findSymbol(n);\r\n // TypeScript 1.0 spec (April 2014): 4.3\r\n // An identifier expression that references a variable or parameter is classified as a reference. \r\n // An identifier expression that references any other kind of entity is classified as a value(and therefore cannot be the target of an assignment).\r\n return !symbol || symbol === unknownSymbol || symbol === argumentsSymbol || (symbol.flags & 3 /* Variable */) !== 0;\r\n case 143 /* PropertyAccessExpression */:\r\n var symbol = findSymbol(n);\r\n // TypeScript 1.0 spec (April 2014): 4.10\r\n // A property access expression is always classified as a reference.\r\n // NOTE (not in spec): assignment to enum members should not be allowed\r\n return !symbol || symbol === unknownSymbol || (symbol.flags & ~8 /* EnumMember */) !== 0;\r\n case 144 /* ElementAccessExpression */:\r\n // old compiler doesn't check indexed assess\r\n return true;\r\n case 149 /* ParenthesizedExpression */:\r\n return isReferenceOrErrorExpression(n.expression);\r\n default:\r\n return false;\r\n }\r\n }\r\n function isConstVariableReference(n) {\r\n switch (n.kind) {\r\n case 63 /* Identifier */:\r\n case 143 /* PropertyAccessExpression */:\r\n var symbol = findSymbol(n);\r\n return symbol && (symbol.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(symbol) & 4096 /* Const */) !== 0;\r\n case 144 /* ElementAccessExpression */:\r\n var index = n.argumentExpression;\r\n var symbol = findSymbol(n.expression);\r\n if (symbol && index && index.kind === 7 /* StringLiteral */) {\r\n var name = index.text;\r\n var prop = getPropertyOfType(getTypeOfSymbol(symbol), name);\r\n return prop && (prop.flags & 3 /* Variable */) !== 0 && (getDeclarationFlagsFromSymbol(prop) & 4096 /* Const */) !== 0;\r\n }\r\n return false;\r\n case 149 /* ParenthesizedExpression */:\r\n return isConstVariableReference(n.expression);\r\n default:\r\n return false;\r\n }\r\n }\r\n if (!isReferenceOrErrorExpression(n)) {\r\n error(n, invalidReferenceMessage);\r\n return false;\r\n }\r\n if (isConstVariableReference(n)) {\r\n error(n, constantVarianleMessage);\r\n return false;\r\n }\r\n return true;\r\n }\r\n function checkDeleteExpression(node) {\r\n var operandType = checkExpression(node.expression);\r\n return booleanType;\r\n }\r\n function checkTypeOfExpression(node) {\r\n var operandType = checkExpression(node.expression);\r\n return stringType;\r\n }\r\n function checkVoidExpression(node) {\r\n var operandType = checkExpression(node.expression);\r\n return undefinedType;\r\n }\r\n function checkPrefixUnaryExpression(node) {\r\n var operandType = checkExpression(node.operand);\r\n switch (node.operator) {\r\n case 32 /* PlusToken */:\r\n case 33 /* MinusToken */:\r\n case 46 /* TildeToken */:\r\n return numberType;\r\n case 45 /* ExclamationToken */:\r\n return booleanType;\r\n case 37 /* PlusPlusToken */:\r\n case 38 /* MinusMinusToken */:\r\n var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);\r\n if (ok) {\r\n // run check only if former checks succeeded to avoid reporting cascading errors\r\n checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant);\r\n }\r\n return numberType;\r\n }\r\n return unknownType;\r\n }\r\n function checkPostfixUnaryExpression(node) {\r\n var operandType = checkExpression(node.operand);\r\n var ok = checkArithmeticOperandType(node.operand, operandType, ts.Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type);\r\n if (ok) {\r\n // run check only if former checks succeeded to avoid reporting cascading errors\r\n checkReferenceExpression(node.operand, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_property_or_indexer, ts.Diagnostics.The_operand_of_an_increment_or_decrement_operator_cannot_be_a_constant);\r\n }\r\n return numberType;\r\n }\r\n // Return true if type is any, an object type, a type parameter, or a union type composed of only those kinds of types\r\n function isStructuredType(type) {\r\n if (type.flags & 16384 /* Union */) {\r\n return !ts.forEach(type.types, function (t) { return !isStructuredType(t); });\r\n }\r\n return (type.flags & 65025 /* Structured */) !== 0;\r\n }\r\n function isConstEnumObjectType(type) {\r\n return type.flags & (48128 /* ObjectType */ | 32768 /* Anonymous */) && type.symbol && isConstEnumSymbol(type.symbol);\r\n }\r\n function isConstEnumSymbol(symbol) {\r\n return (symbol.flags & 128 /* ConstEnum */) !== 0;\r\n }\r\n function checkInstanceOfExpression(node, leftType, rightType) {\r\n // TypeScript 1.0 spec (April 2014): 4.15.4\r\n // The instanceof operator requires the left operand to be of type Any, an object type, or a type parameter type,\r\n // and the right operand to be of type Any or a subtype of the 'Function' interface type. \r\n // The result is always of the Boolean primitive type.\r\n // NOTE: do not raise error if leftType is unknown as related error was already reported\r\n if (leftType !== unknownType && !isStructuredType(leftType)) {\r\n error(node.left, ts.Diagnostics.The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);\r\n }\r\n // NOTE: do not raise error if right is unknown as related error was already reported\r\n if (rightType !== unknownType && rightType !== anyType && !isTypeSubtypeOf(rightType, globalFunctionType)) {\r\n error(node.right, ts.Diagnostics.The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type);\r\n }\r\n return booleanType;\r\n }\r\n function checkInExpression(node, leftType, rightType) {\r\n // TypeScript 1.0 spec (April 2014): 4.15.5\r\n // The in operator requires the left operand to be of type Any, the String primitive type, or the Number primitive type,\r\n // and the right operand to be of type Any, an object type, or a type parameter type.\r\n // The result is always of the Boolean primitive type.\r\n if (leftType !== anyType && leftType !== stringType && leftType !== numberType) {\r\n error(node.left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_types_any_string_or_number);\r\n }\r\n if (!isStructuredType(rightType)) {\r\n error(node.right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter);\r\n }\r\n return booleanType;\r\n }\r\n function checkBinaryExpression(node, contextualMapper) {\r\n var operator = node.operator;\r\n var leftType = checkExpression(node.left, contextualMapper);\r\n var rightType = checkExpression(node.right, contextualMapper);\r\n switch (operator) {\r\n case 34 /* AsteriskToken */:\r\n case 54 /* AsteriskEqualsToken */:\r\n case 35 /* SlashToken */:\r\n case 55 /* SlashEqualsToken */:\r\n case 36 /* PercentToken */:\r\n case 56 /* PercentEqualsToken */:\r\n case 33 /* MinusToken */:\r\n case 53 /* MinusEqualsToken */:\r\n case 39 /* LessThanLessThanToken */:\r\n case 57 /* LessThanLessThanEqualsToken */:\r\n case 40 /* GreaterThanGreaterThanToken */:\r\n case 58 /* GreaterThanGreaterThanEqualsToken */:\r\n case 41 /* GreaterThanGreaterThanGreaterThanToken */:\r\n case 59 /* GreaterThanGreaterThanGreaterThanEqualsToken */:\r\n case 43 /* BarToken */:\r\n case 61 /* BarEqualsToken */:\r\n case 44 /* CaretToken */:\r\n case 62 /* CaretEqualsToken */:\r\n case 42 /* AmpersandToken */:\r\n case 60 /* AmpersandEqualsToken */:\r\n // TypeScript 1.0 spec (April 2014): 4.15.1\r\n // These operators require their operands to be of type Any, the Number primitive type,\r\n // or an enum type. Operands of an enum type are treated \r\n // as having the primitive type Number. If one operand is the null or undefined value,\r\n // it is treated as having the type of the other operand.\r\n // The result is always of the Number primitive type.\r\n if (leftType.flags & (32 /* Undefined */ | 64 /* Null */))\r\n leftType = rightType;\r\n if (rightType.flags & (32 /* Undefined */ | 64 /* Null */))\r\n rightType = leftType;\r\n var suggestedOperator;\r\n // if a user tries to apply a bitwise operator to 2 boolean operands \r\n // try and return them a helpful suggestion\r\n if ((leftType.flags & 8 /* Boolean */) && (rightType.flags & 8 /* Boolean */) && (suggestedOperator = getSuggestedBooleanOperator(node.operator)) !== undefined) {\r\n error(node, ts.Diagnostics.The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead, ts.tokenToString(node.operator), ts.tokenToString(suggestedOperator));\r\n }\r\n else {\r\n // otherwise just check each operand separately and report errors as normal \r\n var leftOk = checkArithmeticOperandType(node.left, leftType, ts.Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type);\r\n var rightOk = checkArithmeticOperandType(node.right, rightType, ts.Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type);\r\n if (leftOk && rightOk) {\r\n checkAssignmentOperator(numberType);\r\n }\r\n }\r\n return numberType;\r\n case 32 /* PlusToken */:\r\n case 52 /* PlusEqualsToken */:\r\n // TypeScript 1.0 spec (April 2014): 4.15.2\r\n // The binary + operator requires both operands to be of the Number primitive type or an enum type,\r\n // or at least one of the operands to be of type Any or the String primitive type.\r\n // If one operand is the null or undefined value, it is treated as having the type of the other operand.\r\n if (leftType.flags & (32 /* Undefined */ | 64 /* Null */))\r\n leftType = rightType;\r\n if (rightType.flags & (32 /* Undefined */ | 64 /* Null */))\r\n rightType = leftType;\r\n var resultType;\r\n if (leftType.flags & 132 /* NumberLike */ && rightType.flags & 132 /* NumberLike */) {\r\n // Operands of an enum type are treated as having the primitive type Number.\r\n // If both operands are of the Number primitive type, the result is of the Number primitive type.\r\n resultType = numberType;\r\n }\r\n else if (leftType.flags & 258 /* StringLike */ || rightType.flags & 258 /* StringLike */) {\r\n // If one or both operands are of the String primitive type, the result is of the String primitive type.\r\n resultType = stringType;\r\n }\r\n else if (leftType.flags & 1 /* Any */ || leftType === unknownType || rightType.flags & 1 /* Any */ || rightType === unknownType) {\r\n // Otherwise, the result is of type Any.\r\n // NOTE: unknown type here denotes error type. Old compiler treated this case as any type so do we.\r\n resultType = anyType;\r\n }\r\n if (!resultType) {\r\n reportOperatorError();\r\n return anyType;\r\n }\r\n if (operator === 52 /* PlusEqualsToken */) {\r\n checkAssignmentOperator(resultType);\r\n }\r\n return resultType;\r\n case 27 /* EqualsEqualsToken */:\r\n case 28 /* ExclamationEqualsToken */:\r\n case 29 /* EqualsEqualsEqualsToken */:\r\n case 30 /* ExclamationEqualsEqualsToken */:\r\n case 23 /* LessThanToken */:\r\n case 24 /* GreaterThanToken */:\r\n case 25 /* LessThanEqualsToken */:\r\n case 26 /* GreaterThanEqualsToken */:\r\n if (!isTypeAssignableTo(leftType, rightType) && !isTypeAssignableTo(rightType, leftType)) {\r\n reportOperatorError();\r\n }\r\n return booleanType;\r\n case 85 /* InstanceOfKeyword */:\r\n return checkInstanceOfExpression(node, leftType, rightType);\r\n case 84 /* InKeyword */:\r\n return checkInExpression(node, leftType, rightType);\r\n case 47 /* AmpersandAmpersandToken */:\r\n return rightType;\r\n case 48 /* BarBarToken */:\r\n return getUnionType([leftType, rightType]);\r\n case 51 /* EqualsToken */:\r\n checkAssignmentOperator(rightType);\r\n return rightType;\r\n case 22 /* CommaToken */:\r\n return rightType;\r\n }\r\n function getSuggestedBooleanOperator(operator) {\r\n switch (operator) {\r\n case 43 /* BarToken */:\r\n case 61 /* BarEqualsToken */:\r\n return 48 /* BarBarToken */;\r\n case 44 /* CaretToken */:\r\n case 62 /* CaretEqualsToken */:\r\n return 30 /* ExclamationEqualsEqualsToken */;\r\n case 42 /* AmpersandToken */:\r\n case 60 /* AmpersandEqualsToken */:\r\n return 47 /* AmpersandAmpersandToken */;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n function checkAssignmentOperator(valueType) {\r\n if (fullTypeCheck && operator >= 51 /* FirstAssignment */ && operator <= 62 /* LastAssignment */) {\r\n // TypeScript 1.0 spec (April 2014): 4.17\r\n // An assignment of the form\r\n // VarExpr = ValueExpr\r\n // requires VarExpr to be classified as a reference\r\n // A compound assignment furthermore requires VarExpr to be classified as a reference (section 4.1) \r\n // and the type of the non - compound operation to be assignable to the type of VarExpr.\r\n var ok = checkReferenceExpression(node.left, ts.Diagnostics.Invalid_left_hand_side_of_assignment_expression, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant);\r\n // Use default messages\r\n if (ok) {\r\n // to avoid cascading errors check assignability only if 'isReference' check succeeded and no errors were reported\r\n checkTypeAssignableTo(valueType, leftType, node.left, undefined);\r\n }\r\n }\r\n }\r\n function reportOperatorError() {\r\n error(node, ts.Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2, ts.tokenToString(node.operator), typeToString(leftType), typeToString(rightType));\r\n }\r\n }\r\n function checkConditionalExpression(node, contextualMapper) {\r\n checkExpression(node.condition);\r\n var type1 = checkExpression(node.whenTrue, contextualMapper);\r\n var type2 = checkExpression(node.whenFalse, contextualMapper);\r\n return getUnionType([type1, type2]);\r\n }\r\n function checkTemplateExpression(node) {\r\n // We just want to check each expressions, but we are unconcerned with\r\n // the type of each expression, as any value may be coerced into a string.\r\n // It is worth asking whether this is what we really want though.\r\n // A place where we actually *are* concerned with the expressions' types are\r\n // in tagged templates.\r\n ts.forEach(node.templateSpans, function (templateSpan) {\r\n checkExpression(templateSpan.expression);\r\n });\r\n return stringType;\r\n }\r\n function checkExpressionWithContextualType(node, contextualType, contextualMapper) {\r\n var saveContextualType = node.contextualType;\r\n node.contextualType = contextualType;\r\n var result = checkExpression(node, contextualMapper);\r\n node.contextualType = saveContextualType;\r\n return result;\r\n }\r\n function checkAndMarkExpression(node, contextualMapper) {\r\n var result = checkExpression(node, contextualMapper);\r\n getNodeLinks(node).flags |= 1 /* TypeChecked */;\r\n return result;\r\n }\r\n function checkObjectLiteralMethod(node, contextualMapper) {\r\n var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);\r\n return instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper);\r\n }\r\n function instantiateTypeWithSingleGenericCallSignature(node, type, contextualMapper) {\r\n if (contextualMapper && contextualMapper !== identityMapper) {\r\n var signature = getSingleCallSignature(type);\r\n if (signature && signature.typeParameters) {\r\n var contextualType = getContextualType(node);\r\n if (contextualType) {\r\n var contextualSignature = getSingleCallSignature(contextualType);\r\n if (contextualSignature && !contextualSignature.typeParameters) {\r\n return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper));\r\n }\r\n }\r\n }\r\n }\r\n return type;\r\n }\r\n function checkExpression(node, contextualMapper) {\r\n return checkExpressionOrQualifiedName(node, contextualMapper);\r\n }\r\n // Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When\r\n // contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the\r\n // expression is being inferentially typed (section 4.12.2 in spec) and provides the type mapper to use in\r\n // conjunction with the generic contextual type. When contextualMapper is equal to the identityMapper function\r\n // object, it serves as an indicator that all contained function and arrow expressions should be considered to\r\n // have the wildcard function type; this form of type check is used during overload resolution to exclude\r\n // contextually typed function and arrow expressions in the initial phase.\r\n function checkExpressionOrQualifiedName(node, contextualMapper) {\r\n var type;\r\n if (node.kind == 120 /* QualifiedName */) {\r\n type = checkQualifiedName(node);\r\n }\r\n else {\r\n var uninstantiatedType = checkExpressionWorker(node, contextualMapper);\r\n type = instantiateTypeWithSingleGenericCallSignature(node, uninstantiatedType, contextualMapper);\r\n }\r\n if (isConstEnumObjectType(type)) {\r\n // enum object type for const enums are only permitted in:\r\n // - 'left' in property access \r\n // - 'object' in indexed access\r\n // - target in rhs of import statement\r\n var ok = (node.parent.kind === 143 /* PropertyAccessExpression */ && node.parent.expression === node) || (node.parent.kind === 144 /* ElementAccessExpression */ && node.parent.expression === node) || ((node.kind === 63 /* Identifier */ || node.kind === 120 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node));\r\n if (!ok) {\r\n error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment);\r\n }\r\n }\r\n return type;\r\n }\r\n function checkExpressionWorker(node, contextualMapper) {\r\n switch (node.kind) {\r\n case 63 /* Identifier */:\r\n return checkIdentifier(node);\r\n case 91 /* ThisKeyword */:\r\n return checkThisExpression(node);\r\n case 89 /* SuperKeyword */:\r\n return checkSuperExpression(node);\r\n case 87 /* NullKeyword */:\r\n return nullType;\r\n case 93 /* TrueKeyword */:\r\n case 78 /* FalseKeyword */:\r\n return booleanType;\r\n case 6 /* NumericLiteral */:\r\n return numberType;\r\n case 159 /* TemplateExpression */:\r\n return checkTemplateExpression(node);\r\n case 7 /* StringLiteral */:\r\n case 9 /* NoSubstitutionTemplateLiteral */:\r\n return stringType;\r\n case 8 /* RegularExpressionLiteral */:\r\n return globalRegExpType;\r\n case 141 /* ArrayLiteralExpression */:\r\n return checkArrayLiteral(node, contextualMapper);\r\n case 142 /* ObjectLiteralExpression */:\r\n return checkObjectLiteral(node, contextualMapper);\r\n case 143 /* PropertyAccessExpression */:\r\n return checkPropertyAccessExpression(node);\r\n case 144 /* ElementAccessExpression */:\r\n return checkIndexedAccess(node);\r\n case 145 /* CallExpression */:\r\n case 146 /* NewExpression */:\r\n return checkCallExpression(node);\r\n case 147 /* TaggedTemplateExpression */:\r\n return checkTaggedTemplateExpression(node);\r\n case 148 /* TypeAssertionExpression */:\r\n return checkTypeAssertion(node);\r\n case 149 /* ParenthesizedExpression */:\r\n return checkExpression(node.expression);\r\n case 150 /* FunctionExpression */:\r\n case 151 /* ArrowFunction */:\r\n return checkFunctionExpressionOrObjectLiteralMethod(node, contextualMapper);\r\n case 153 /* TypeOfExpression */:\r\n return checkTypeOfExpression(node);\r\n case 152 /* DeleteExpression */:\r\n return checkDeleteExpression(node);\r\n case 154 /* VoidExpression */:\r\n return checkVoidExpression(node);\r\n case 155 /* PrefixUnaryExpression */:\r\n return checkPrefixUnaryExpression(node);\r\n case 156 /* PostfixUnaryExpression */:\r\n return checkPostfixUnaryExpression(node);\r\n case 157 /* BinaryExpression */:\r\n return checkBinaryExpression(node, contextualMapper);\r\n case 158 /* ConditionalExpression */:\r\n return checkConditionalExpression(node, contextualMapper);\r\n case 161 /* OmittedExpression */:\r\n return undefinedType;\r\n }\r\n return unknownType;\r\n }\r\n // DECLARATION AND STATEMENT TYPE CHECKING\r\n function checkTypeParameter(node) {\r\n checkSourceElement(node.constraint);\r\n if (fullTypeCheck) {\r\n checkTypeParameterHasIllegalReferencesInConstraint(node);\r\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0);\r\n }\r\n // TODO: Check multiple declarations are identical\r\n }\r\n function checkParameter(parameterDeclaration) {\r\n checkVariableOrParameterDeclaration(parameterDeclaration);\r\n if (fullTypeCheck) {\r\n checkCollisionWithIndexVariableInGeneratedCode(parameterDeclaration, parameterDeclaration.name);\r\n if (parameterDeclaration.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */) && !(parameterDeclaration.parent.kind === 126 /* Constructor */ && parameterDeclaration.parent.body)) {\r\n error(parameterDeclaration, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation);\r\n }\r\n if (parameterDeclaration.dotDotDotToken) {\r\n if (!isArrayType(getTypeOfSymbol(parameterDeclaration.symbol))) {\r\n error(parameterDeclaration, ts.Diagnostics.A_rest_parameter_must_be_of_an_array_type);\r\n }\r\n }\r\n else {\r\n if (parameterDeclaration.initializer && !parameterDeclaration.parent.body) {\r\n error(parameterDeclaration, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation);\r\n }\r\n }\r\n }\r\n function checkReferencesInInitializer(n) {\r\n if (n.kind === 63 /* Identifier */) {\r\n var referencedSymbol = getNodeLinks(n).resolvedSymbol;\r\n // check FunctionLikeDeclaration.locals (stores parameters\\function local variable) \r\n // if it contains entry with a specified name and if this entry matches the resolved symbol\r\n if (referencedSymbol && referencedSymbol !== unknownSymbol && getSymbol(parameterDeclaration.parent.locals, referencedSymbol.name, 107455 /* Value */) === referencedSymbol) {\r\n if (referencedSymbol.valueDeclaration.kind === 123 /* Parameter */) {\r\n if (referencedSymbol.valueDeclaration === parameterDeclaration) {\r\n error(n, ts.Diagnostics.Parameter_0_cannot_be_referenced_in_its_initializer, ts.declarationNameToString(parameterDeclaration.name));\r\n return;\r\n }\r\n var enclosingOrReferencedParameter = ts.forEach(parameterDeclaration.parent.parameters, function (p) { return p === parameterDeclaration || p === referencedSymbol.valueDeclaration ? p : undefined; });\r\n if (enclosingOrReferencedParameter === referencedSymbol.valueDeclaration) {\r\n // legal case - parameter initializer references some parameter strictly on left of current parameter declaration\r\n return;\r\n }\r\n }\r\n error(n, ts.Diagnostics.Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(parameterDeclaration.name), ts.declarationNameToString(n));\r\n }\r\n }\r\n else {\r\n ts.forEachChild(n, checkReferencesInInitializer);\r\n }\r\n }\r\n if (parameterDeclaration.initializer) {\r\n checkReferencesInInitializer(parameterDeclaration.initializer);\r\n }\r\n }\r\n function checkSignatureDeclaration(node) {\r\n checkTypeParameters(node.typeParameters);\r\n ts.forEach(node.parameters, checkParameter);\r\n if (node.type) {\r\n checkSourceElement(node.type);\r\n }\r\n if (fullTypeCheck) {\r\n checkCollisionWithArgumentsInGeneratedCode(node);\r\n if (compilerOptions.noImplicitAny && !node.type) {\r\n switch (node.kind) {\r\n case 130 /* ConstructSignature */:\r\n error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);\r\n break;\r\n case 129 /* CallSignature */:\r\n error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type);\r\n break;\r\n }\r\n }\r\n }\r\n checkSpecializedSignatureDeclaration(node);\r\n }\r\n function checkTypeForDuplicateIndexSignatures(node) {\r\n if (node.kind === 186 /* InterfaceDeclaration */) {\r\n var nodeSymbol = getSymbolOfNode(node);\r\n // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration\r\n // to prevent this run check only for the first declaration of a given kind\r\n if (nodeSymbol.declarations.length > 0 && nodeSymbol.declarations[0] !== node) {\r\n return;\r\n }\r\n }\r\n // TypeScript 1.0 spec (April 2014)\r\n // 3.7.4: An object type can contain at most one string index signature and one numeric index signature.\r\n // 8.5: A class declaration can have at most one string index member declaration and one numeric index member declaration\r\n var indexSymbol = getIndexSymbol(getSymbolOfNode(node));\r\n if (indexSymbol) {\r\n var seenNumericIndexer = false;\r\n var seenStringIndexer = false;\r\n for (var i = 0, len = indexSymbol.declarations.length; i < len; ++i) {\r\n var declaration = indexSymbol.declarations[i];\r\n if (declaration.parameters.length == 1 && declaration.parameters[0].type) {\r\n switch (declaration.parameters[0].type.kind) {\r\n case 118 /* StringKeyword */:\r\n if (!seenStringIndexer) {\r\n seenStringIndexer = true;\r\n }\r\n else {\r\n error(declaration, ts.Diagnostics.Duplicate_string_index_signature);\r\n }\r\n break;\r\n case 116 /* NumberKeyword */:\r\n if (!seenNumericIndexer) {\r\n seenNumericIndexer = true;\r\n }\r\n else {\r\n error(declaration, ts.Diagnostics.Duplicate_number_index_signature);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function checkPropertyDeclaration(node) {\r\n if (fullTypeCheck) {\r\n checkVariableOrParameterOrPropertyInFullTypeCheck(node);\r\n }\r\n }\r\n function checkMethodDeclaration(node) {\r\n checkFunctionLikeDeclaration(node);\r\n }\r\n function checkConstructorDeclaration(node) {\r\n checkSignatureDeclaration(node);\r\n checkSourceElement(node.body);\r\n var symbol = getSymbolOfNode(node);\r\n var firstDeclaration = getDeclarationOfKind(symbol, node.kind);\r\n // Only type check the symbol once\r\n if (node === firstDeclaration) {\r\n checkFunctionOrConstructorSymbol(symbol);\r\n }\r\n // exit early in the case of signature - super checks are not relevant to them\r\n if (!node.body) {\r\n return;\r\n }\r\n if (!fullTypeCheck) {\r\n return;\r\n }\r\n function isSuperCallExpression(n) {\r\n return n.kind === 145 /* CallExpression */ && n.expression.kind === 89 /* SuperKeyword */;\r\n }\r\n function containsSuperCall(n) {\r\n if (isSuperCallExpression(n)) {\r\n return true;\r\n }\r\n switch (n.kind) {\r\n case 150 /* FunctionExpression */:\r\n case 184 /* FunctionDeclaration */:\r\n case 151 /* ArrowFunction */:\r\n case 142 /* ObjectLiteralExpression */: return false;\r\n default: return ts.forEachChild(n, containsSuperCall);\r\n }\r\n }\r\n function markThisReferencesAsErrors(n) {\r\n if (n.kind === 91 /* ThisKeyword */) {\r\n error(n, ts.Diagnostics.this_cannot_be_referenced_in_current_location);\r\n }\r\n else if (n.kind !== 150 /* FunctionExpression */ && n.kind !== 184 /* FunctionDeclaration */) {\r\n ts.forEachChild(n, markThisReferencesAsErrors);\r\n }\r\n }\r\n function isInstancePropertyWithInitializer(n) {\r\n return n.kind === 124 /* Property */ && !(n.flags & 128 /* Static */) && !!n.initializer;\r\n }\r\n // TS 1.0 spec (April 2014): 8.3.2\r\n // Constructors of classes with no extends clause may not contain super calls, whereas \r\n // constructors of derived classes must contain at least one super call somewhere in their function body.\r\n if (ts.getClassBaseTypeNode(node.parent)) {\r\n if (containsSuperCall(node.body)) {\r\n // The first statement in the body of a constructor must be a super call if both of the following are true:\r\n // - The containing class is a derived class.\r\n // - The constructor declares parameter properties \r\n // or the containing class declares instance member variables with initializers.\r\n var superCallShouldBeFirst = ts.forEach(node.parent.members, isInstancePropertyWithInitializer) || ts.forEach(node.parameters, function (p) { return p.flags & (16 /* Public */ | 32 /* Private */ | 64 /* Protected */); });\r\n if (superCallShouldBeFirst) {\r\n var statements = node.body.statements;\r\n if (!statements.length || statements[0].kind !== 166 /* ExpressionStatement */ || !isSuperCallExpression(statements[0].expression)) {\r\n error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties);\r\n }\r\n else {\r\n // In such a required super call, it is a compile-time error for argument expressions to reference this.\r\n markThisReferencesAsErrors(statements[0].expression);\r\n }\r\n }\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Constructors_for_derived_classes_must_contain_a_super_call);\r\n }\r\n }\r\n }\r\n function checkAccessorDeclaration(node) {\r\n if (fullTypeCheck) {\r\n if (node.kind === 127 /* GetAccessor */) {\r\n if (!ts.isInAmbientContext(node) && node.body && !(bodyContainsAReturnStatement(node.body) || bodyContainsSingleThrowStatement(node.body))) {\r\n error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value_or_consist_of_a_single_throw_statement);\r\n }\r\n }\r\n if (!ts.hasComputedNameButNotSymbol(node)) {\r\n // TypeScript 1.0 spec (April 2014): 8.4.3\r\n // Accessors for the same member name must specify the same accessibility.\r\n var otherKind = node.kind === 127 /* GetAccessor */ ? 128 /* SetAccessor */ : 127 /* GetAccessor */;\r\n var otherAccessor = getDeclarationOfKind(node.symbol, otherKind);\r\n if (otherAccessor) {\r\n if (((node.flags & 112 /* AccessibilityModifier */) !== (otherAccessor.flags & 112 /* AccessibilityModifier */))) {\r\n error(node.name, ts.Diagnostics.Getter_and_setter_accessors_do_not_agree_in_visibility);\r\n }\r\n var currentAccessorType = getAnnotatedAccessorType(node);\r\n var otherAccessorType = getAnnotatedAccessorType(otherAccessor);\r\n // TypeScript 1.0 spec (April 2014): 4.5\r\n // If both accessors include type annotations, the specified types must be identical.\r\n if (currentAccessorType && otherAccessorType) {\r\n if (!isTypeIdenticalTo(currentAccessorType, otherAccessorType)) {\r\n error(node, ts.Diagnostics.get_and_set_accessor_must_have_the_same_type);\r\n }\r\n }\r\n }\r\n checkAndStoreTypeOfAccessors(getSymbolOfNode(node));\r\n }\r\n }\r\n checkFunctionLikeDeclaration(node);\r\n }\r\n function checkTypeReference(node) {\r\n var type = getTypeFromTypeReferenceNode(node);\r\n if (type !== unknownType && node.typeArguments) {\r\n // Do type argument local checks only if referenced type is successfully resolved\r\n var len = node.typeArguments.length;\r\n for (var i = 0; i < len; i++) {\r\n checkSourceElement(node.typeArguments[i]);\r\n var constraint = getConstraintOfTypeParameter(type.target.typeParameters[i]);\r\n if (fullTypeCheck && constraint) {\r\n var typeArgument = type.typeArguments[i];\r\n checkTypeAssignableTo(typeArgument, constraint, node, ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1);\r\n }\r\n }\r\n }\r\n }\r\n function checkTypeQuery(node) {\r\n getTypeFromTypeQueryNode(node);\r\n }\r\n function checkTypeLiteral(node) {\r\n ts.forEach(node.members, checkSourceElement);\r\n if (fullTypeCheck) {\r\n var type = getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node);\r\n checkIndexConstraints(type);\r\n checkTypeForDuplicateIndexSignatures(node);\r\n }\r\n }\r\n function checkArrayType(node) {\r\n checkSourceElement(node.elementType);\r\n }\r\n function checkTupleType(node) {\r\n ts.forEach(node.elementTypes, checkSourceElement);\r\n }\r\n function checkUnionType(node) {\r\n ts.forEach(node.types, checkSourceElement);\r\n }\r\n function isPrivateWithinAmbient(node) {\r\n return (node.flags & 32 /* Private */) && ts.isInAmbientContext(node);\r\n }\r\n function checkSpecializedSignatureDeclaration(signatureDeclarationNode) {\r\n if (!fullTypeCheck) {\r\n return;\r\n }\r\n var signature = getSignatureFromDeclaration(signatureDeclarationNode);\r\n if (!signature.hasStringLiterals) {\r\n return;\r\n }\r\n // TypeScript 1.0 spec (April 2014): 3.7.2.2\r\n // Specialized signatures are not permitted in conjunction with a function body\r\n if (signatureDeclarationNode.body) {\r\n error(signatureDeclarationNode, ts.Diagnostics.A_signature_with_an_implementation_cannot_use_a_string_literal_type);\r\n return;\r\n }\r\n // TypeScript 1.0 spec (April 2014): 3.7.2.4\r\n // Every specialized call or construct signature in an object type must be assignable\r\n // to at least one non-specialized call or construct signature in the same object type\r\n var signaturesToCheck;\r\n // Unnamed (call\\construct) signatures in interfaces are inherited and not shadowed so examining just node symbol won't give complete answer.\r\n // Use declaring type to obtain full list of signatures.\r\n if (!signatureDeclarationNode.name && signatureDeclarationNode.parent && signatureDeclarationNode.parent.kind === 186 /* InterfaceDeclaration */) {\r\n ts.Debug.assert(signatureDeclarationNode.kind === 129 /* CallSignature */ || signatureDeclarationNode.kind === 130 /* ConstructSignature */);\r\n var signatureKind = signatureDeclarationNode.kind === 129 /* CallSignature */ ? 0 /* Call */ : 1 /* Construct */;\r\n var containingSymbol = getSymbolOfNode(signatureDeclarationNode.parent);\r\n var containingType = getDeclaredTypeOfSymbol(containingSymbol);\r\n signaturesToCheck = getSignaturesOfType(containingType, signatureKind);\r\n }\r\n else {\r\n signaturesToCheck = getSignaturesOfSymbol(getSymbolOfNode(signatureDeclarationNode));\r\n }\r\n for (var i = 0; i < signaturesToCheck.length; i++) {\r\n var otherSignature = signaturesToCheck[i];\r\n if (!otherSignature.hasStringLiterals && isSignatureAssignableTo(signature, otherSignature)) {\r\n return;\r\n }\r\n }\r\n error(signatureDeclarationNode, ts.Diagnostics.Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature);\r\n }\r\n function getEffectiveDeclarationFlags(n, flagsToCheck) {\r\n var flags = n.flags;\r\n if (n.parent.kind !== 186 /* InterfaceDeclaration */ && ts.isInAmbientContext(n)) {\r\n if (!(flags & 2 /* Ambient */)) {\r\n // It is nested in an ambient context, which means it is automatically exported\r\n flags |= 1 /* Export */;\r\n }\r\n flags |= 2 /* Ambient */;\r\n }\r\n return flags & flagsToCheck;\r\n }\r\n function checkFunctionOrConstructorSymbol(symbol) {\r\n if (!fullTypeCheck) {\r\n return;\r\n }\r\n function getCanonicalOverload(overloads, implementation) {\r\n // Consider the canonical set of flags to be the flags of the bodyDeclaration or the first declaration\r\n // Error on all deviations from this canonical set of flags\r\n // The caveat is that if some overloads are defined in lib.d.ts, we don't want to\r\n // report the errors on those. To achieve this, we will say that the implementation is\r\n // the canonical signature only if it is in the same container as the first overload\r\n var implementationSharesContainerWithFirstOverload = implementation !== undefined && implementation.parent === overloads[0].parent;\r\n return implementationSharesContainerWithFirstOverload ? implementation : overloads[0];\r\n }\r\n function checkFlagAgreementBetweenOverloads(overloads, implementation, flagsToCheck, someOverloadFlags, allOverloadFlags) {\r\n // Error if some overloads have a flag that is not shared by all overloads. To find the\r\n // deviations, we XOR someOverloadFlags with allOverloadFlags\r\n var someButNotAllOverloadFlags = someOverloadFlags ^ allOverloadFlags;\r\n if (someButNotAllOverloadFlags !== 0) {\r\n var canonicalFlags = getEffectiveDeclarationFlags(getCanonicalOverload(overloads, implementation), flagsToCheck);\r\n ts.forEach(overloads, function (o) {\r\n var deviation = getEffectiveDeclarationFlags(o, flagsToCheck) ^ canonicalFlags;\r\n if (deviation & 1 /* Export */) {\r\n error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_exported_or_not_exported);\r\n }\r\n else if (deviation & 2 /* Ambient */) {\r\n error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_ambient_or_non_ambient);\r\n }\r\n else if (deviation & (32 /* Private */ | 64 /* Protected */)) {\r\n error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_public_private_or_protected);\r\n }\r\n });\r\n }\r\n }\r\n function checkQuestionTokenAgreementBetweenOverloads(overloads, implementation, someHaveQuestionToken, allHaveQuestionToken) {\r\n if (someHaveQuestionToken !== allHaveQuestionToken) {\r\n var canonicalHasQuestionToken = ts.hasQuestionToken(getCanonicalOverload(overloads, implementation));\r\n ts.forEach(overloads, function (o) {\r\n var deviation = ts.hasQuestionToken(o) !== canonicalHasQuestionToken;\r\n if (deviation) {\r\n error(o.name, ts.Diagnostics.Overload_signatures_must_all_be_optional_or_required);\r\n }\r\n });\r\n }\r\n }\r\n var flagsToCheck = 1 /* Export */ | 2 /* Ambient */ | 32 /* Private */ | 64 /* Protected */;\r\n var someNodeFlags = 0;\r\n var allNodeFlags = flagsToCheck;\r\n var someHaveQuestionToken = false;\r\n var allHaveQuestionToken = true;\r\n var hasOverloads = false;\r\n var bodyDeclaration;\r\n var lastSeenNonAmbientDeclaration;\r\n var previousDeclaration;\r\n var declarations = symbol.declarations;\r\n var isConstructor = (symbol.flags & 16384 /* Constructor */) !== 0;\r\n function reportImplementationExpectedError(node) {\r\n if (node.name && ts.getFullWidth(node.name) === 0) {\r\n return;\r\n }\r\n var seen = false;\r\n var subsequentNode = ts.forEachChild(node.parent, function (c) {\r\n if (seen) {\r\n return c;\r\n }\r\n else {\r\n seen = c === node;\r\n }\r\n });\r\n if (subsequentNode) {\r\n if (subsequentNode.kind === node.kind) {\r\n var errorNode = subsequentNode.name || subsequentNode;\r\n // TODO(jfreeman): These are methods, so handle computed name case\r\n if (node.name && subsequentNode.name && node.name.text === subsequentNode.name.text) {\r\n // the only situation when this is possible (same kind\\same name but different symbol) - mixed static and instance class members\r\n ts.Debug.assert(node.kind === 125 /* Method */);\r\n ts.Debug.assert((node.flags & 128 /* Static */) !== (subsequentNode.flags & 128 /* Static */));\r\n var diagnostic = node.flags & 128 /* Static */ ? ts.Diagnostics.Function_overload_must_be_static : ts.Diagnostics.Function_overload_must_not_be_static;\r\n error(errorNode, diagnostic);\r\n return;\r\n }\r\n else if (subsequentNode.body) {\r\n error(errorNode, ts.Diagnostics.Function_implementation_name_must_be_0, ts.declarationNameToString(node.name));\r\n return;\r\n }\r\n }\r\n }\r\n var errorNode = node.name || node;\r\n if (isConstructor) {\r\n error(errorNode, ts.Diagnostics.Constructor_implementation_is_missing);\r\n }\r\n else {\r\n error(errorNode, ts.Diagnostics.Function_implementation_is_missing_or_not_immediately_following_the_declaration);\r\n }\r\n }\r\n // when checking exported function declarations across modules check only duplicate implementations\r\n // names and consistency of modifiers are verified when we check local symbol\r\n var isExportSymbolInsideModule = symbol.parent && symbol.parent.flags & 1536 /* Module */;\r\n var duplicateFunctionDeclaration = false;\r\n var multipleConstructorImplementation = false;\r\n for (var i = 0; i < declarations.length; i++) {\r\n var node = declarations[i];\r\n var inAmbientContext = ts.isInAmbientContext(node);\r\n var inAmbientContextOrInterface = node.parent.kind === 186 /* InterfaceDeclaration */ || node.parent.kind === 136 /* TypeLiteral */ || inAmbientContext;\r\n if (inAmbientContextOrInterface) {\r\n // check if declarations are consecutive only if they are non-ambient\r\n // 1. ambient declarations can be interleaved\r\n // i.e. this is legal\r\n // declare function foo();\r\n // declare function bar();\r\n // declare function foo();\r\n // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one\r\n previousDeclaration = undefined;\r\n }\r\n if (node.kind === 184 /* FunctionDeclaration */ || node.kind === 125 /* Method */ || node.kind === 126 /* Constructor */) {\r\n var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck);\r\n someNodeFlags |= currentNodeFlags;\r\n allNodeFlags &= currentNodeFlags;\r\n someHaveQuestionToken = someHaveQuestionToken || ts.hasQuestionToken(node);\r\n allHaveQuestionToken = allHaveQuestionToken && ts.hasQuestionToken(node);\r\n if (node.body && bodyDeclaration) {\r\n if (isConstructor) {\r\n multipleConstructorImplementation = true;\r\n }\r\n else {\r\n duplicateFunctionDeclaration = true;\r\n }\r\n }\r\n else if (!isExportSymbolInsideModule && previousDeclaration && previousDeclaration.parent === node.parent && previousDeclaration.end !== node.pos) {\r\n reportImplementationExpectedError(previousDeclaration);\r\n }\r\n if (node.body) {\r\n if (!bodyDeclaration) {\r\n bodyDeclaration = node;\r\n }\r\n }\r\n else {\r\n hasOverloads = true;\r\n }\r\n previousDeclaration = node;\r\n if (!inAmbientContextOrInterface) {\r\n lastSeenNonAmbientDeclaration = node;\r\n }\r\n }\r\n }\r\n if (multipleConstructorImplementation) {\r\n ts.forEach(declarations, function (declaration) {\r\n error(declaration, ts.Diagnostics.Multiple_constructor_implementations_are_not_allowed);\r\n });\r\n }\r\n if (duplicateFunctionDeclaration) {\r\n ts.forEach(declarations, function (declaration) {\r\n error(declaration.name, ts.Diagnostics.Duplicate_function_implementation);\r\n });\r\n }\r\n if (!isExportSymbolInsideModule && lastSeenNonAmbientDeclaration && !lastSeenNonAmbientDeclaration.body) {\r\n reportImplementationExpectedError(lastSeenNonAmbientDeclaration);\r\n }\r\n if (hasOverloads) {\r\n checkFlagAgreementBetweenOverloads(declarations, bodyDeclaration, flagsToCheck, someNodeFlags, allNodeFlags);\r\n checkQuestionTokenAgreementBetweenOverloads(declarations, bodyDeclaration, someHaveQuestionToken, allHaveQuestionToken);\r\n if (bodyDeclaration) {\r\n var signatures = getSignaturesOfSymbol(symbol);\r\n var bodySignature = getSignatureFromDeclaration(bodyDeclaration);\r\n // If the implementation signature has string literals, we will have reported an error in\r\n // checkSpecializedSignatureDeclaration\r\n if (!bodySignature.hasStringLiterals) {\r\n for (var i = 0, len = signatures.length; i < len; ++i) {\r\n if (!signatures[i].hasStringLiterals && !isSignatureAssignableTo(bodySignature, signatures[i])) {\r\n error(signatures[i].declaration, ts.Diagnostics.Overload_signature_is_not_compatible_with_function_implementation);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function checkExportsOnMergedDeclarations(node) {\r\n if (!fullTypeCheck) {\r\n return;\r\n }\r\n var symbol;\r\n // Exports should be checked only if enclosing module contains both exported and non exported declarations.\r\n // In case if all declarations are non-exported check is unnecessary.\r\n // if localSymbol is defined on node then node itself is exported - check is required\r\n var symbol = node.localSymbol;\r\n if (!symbol) {\r\n // local symbol is undefined => this declaration is non-exported.\r\n // however symbol might contain other declarations that are exported\r\n symbol = getSymbolOfNode(node);\r\n if (!(symbol.flags & 29360128 /* Export */)) {\r\n // this is a pure local symbol (all declarations are non-exported) - no need to check anything\r\n return;\r\n }\r\n }\r\n // run the check only for the first declaration in the list\r\n if (getDeclarationOfKind(symbol, node.kind) !== node) {\r\n return;\r\n }\r\n // we use SymbolFlags.ExportValue, SymbolFlags.ExportType and SymbolFlags.ExportNamespace \r\n // to denote disjoint declarationSpaces (without making new enum type).\r\n var exportedDeclarationSpaces = 0;\r\n var nonExportedDeclarationSpaces = 0;\r\n ts.forEach(symbol.declarations, function (d) {\r\n var declarationSpaces = getDeclarationSpaces(d);\r\n if (getEffectiveDeclarationFlags(d, 1 /* Export */)) {\r\n exportedDeclarationSpaces |= declarationSpaces;\r\n }\r\n else {\r\n nonExportedDeclarationSpaces |= declarationSpaces;\r\n }\r\n });\r\n var commonDeclarationSpace = exportedDeclarationSpaces & nonExportedDeclarationSpaces;\r\n if (commonDeclarationSpace) {\r\n // declaration spaces for exported and non-exported declarations intersect\r\n ts.forEach(symbol.declarations, function (d) {\r\n if (getDeclarationSpaces(d) & commonDeclarationSpace) {\r\n error(d.name, ts.Diagnostics.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local, ts.declarationNameToString(d.name));\r\n }\r\n });\r\n }\r\n function getDeclarationSpaces(d) {\r\n switch (d.kind) {\r\n case 186 /* InterfaceDeclaration */:\r\n return 8388608 /* ExportType */;\r\n case 189 /* ModuleDeclaration */:\r\n return d.name.kind === 7 /* StringLiteral */ || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 16777216 /* ExportNamespace */ | 4194304 /* ExportValue */ : 16777216 /* ExportNamespace */;\r\n case 185 /* ClassDeclaration */:\r\n case 188 /* EnumDeclaration */:\r\n return 8388608 /* ExportType */ | 4194304 /* ExportValue */;\r\n case 191 /* ImportDeclaration */:\r\n var result = 0;\r\n var target = resolveImport(getSymbolOfNode(d));\r\n ts.forEach(target.declarations, function (d) {\r\n result |= getDeclarationSpaces(d);\r\n });\r\n return result;\r\n default:\r\n return 4194304 /* ExportValue */;\r\n }\r\n }\r\n }\r\n function checkFunctionDeclaration(node) {\r\n checkFunctionLikeDeclaration(node);\r\n if (fullTypeCheck) {\r\n checkCollisionWithCapturedSuperVariable(node, node.name);\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\r\n }\r\n }\r\n function checkFunctionLikeDeclaration(node) {\r\n checkSignatureDeclaration(node);\r\n if (!ts.hasComputedNameButNotSymbol(node)) {\r\n // first we want to check the local symbol that contain this declaration\r\n // - if node.localSymbol !== undefined - this is current declaration is exported and localSymbol points to the local symbol\r\n // - if node.localSymbol === undefined - this node is non-exported so we can just pick the result of getSymbolOfNode\r\n var symbol = getSymbolOfNode(node);\r\n var localSymbol = node.localSymbol || symbol;\r\n var firstDeclaration = getDeclarationOfKind(localSymbol, node.kind);\r\n // Only type check the symbol once\r\n if (node === firstDeclaration) {\r\n checkFunctionOrConstructorSymbol(localSymbol);\r\n }\r\n if (symbol.parent) {\r\n // run check once for the first declaration\r\n if (getDeclarationOfKind(symbol, node.kind) === node) {\r\n // run check on export symbol to check that modifiers agree across all exported declarations\r\n checkFunctionOrConstructorSymbol(symbol);\r\n }\r\n }\r\n }\r\n checkSourceElement(node.body);\r\n if (node.type && !isAccessor(node.kind)) {\r\n checkIfNonVoidFunctionHasReturnExpressionsOrSingleThrowStatment(node, getTypeFromTypeNode(node.type));\r\n }\r\n // If there is no body and no explicit return type, then report an error.\r\n if (fullTypeCheck && compilerOptions.noImplicitAny && !node.body && !node.type) {\r\n // Ignore privates within ambient contexts; they exist purely for documentative purposes to avoid name clashing.\r\n // (e.g. privates within .d.ts files do not expose type information)\r\n if (!isPrivateWithinAmbient(node)) {\r\n var typeName = typeToString(anyType);\r\n if (node.name) {\r\n error(node, ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type, ts.declarationNameToString(node.name), typeName);\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeName);\r\n }\r\n }\r\n }\r\n }\r\n function checkBlock(node) {\r\n ts.forEach(node.statements, checkSourceElement);\r\n if (ts.isFunctionBlock(node) || node.kind === 190 /* ModuleBlock */) {\r\n checkFunctionExpressionBodies(node);\r\n }\r\n }\r\n function checkCollisionWithArgumentsInGeneratedCode(node) {\r\n // no rest parameters \\ declaration context \\ overload - no codegen impact\r\n if (!ts.hasRestParameters(node) || ts.isInAmbientContext(node) || !node.body) {\r\n return;\r\n }\r\n ts.forEach(node.parameters, function (p) {\r\n if (p.name && p.name.text === argumentsSymbol.name) {\r\n error(p, ts.Diagnostics.Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters);\r\n }\r\n });\r\n }\r\n function checkCollisionWithIndexVariableInGeneratedCode(node, name) {\r\n if (!(name && name.text === \"_i\")) {\r\n return;\r\n }\r\n if (node.kind === 123 /* Parameter */) {\r\n // report error if parameter has name '_i' when:\r\n // - function has implementation (not a signature)\r\n // - function has rest parameters\r\n // - context is not ambient (otherwise no codegen impact)\r\n if (node.parent.body && ts.hasRestParameters(node.parent) && !ts.isInAmbientContext(node)) {\r\n error(node, ts.Diagnostics.Duplicate_identifier_i_Compiler_uses_i_to_initialize_rest_parameter);\r\n }\r\n return;\r\n }\r\n var symbol = getNodeLinks(node).resolvedSymbol;\r\n if (symbol === unknownSymbol) {\r\n return;\r\n }\r\n // we would like to discover cases like one below:\r\n //\r\n // var _i = \"!\";\r\n // function foo(...a) {\r\n // function bar() {\r\n // var x = { get baz() { return _i; } }\r\n // }\r\n // }\r\n // \r\n // at runtime '_i' referenced in getter will be resolved to the generated index variable '_i' used to initialize rest parameters.\r\n // legitimate case: when '_i' is defined inside the function declaration with rest parameters.\r\n // \r\n // function foo(...a) {\r\n // var _i = \"!\";\r\n // function bar() {\r\n // var x = { get baz() { return _i; } }\r\n // }\r\n // }\r\n //// if resolved symbol for node has more than one declaration - this is definitely an error\r\n //// (there is nothing value-like in the language that can be nested in function and consists of multiple declarations)\r\n //if (symbol.declarations.length > 1) {\r\n // error(node, Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter);\r\n // return;\r\n //}\r\n // short gist of the check:\r\n // - otherwise\r\n // - walk to the top of the tree starting from the 'node'\r\n // - at every step check if 'current' node contains any declaration of original node\r\n // yes - return\r\n // no - check if current declaration is function with rest parameters\r\n // yes - report error since '_i' from this function will shadow '_i' defined in the outer scope\r\n // no - go up to the next level\r\n var current = node;\r\n while (current) {\r\n var definedOnCurrentLevel = ts.forEach(symbol.declarations, function (d) { return d.parent === current ? d : undefined; });\r\n if (definedOnCurrentLevel) {\r\n return;\r\n }\r\n switch (current.kind) {\r\n case 184 /* FunctionDeclaration */:\r\n case 150 /* FunctionExpression */:\r\n case 125 /* Method */:\r\n case 151 /* ArrowFunction */:\r\n case 126 /* Constructor */:\r\n if (ts.hasRestParameters(current)) {\r\n error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_i_that_compiler_uses_to_initialize_rest_parameter);\r\n return;\r\n }\r\n break;\r\n }\r\n current = current.parent;\r\n }\r\n }\r\n function needCollisionCheckForIdentifier(node, identifier, name) {\r\n if (!identifier || identifier.text !== name) {\r\n return false;\r\n }\r\n if (node.kind === 124 /* Property */ || node.kind === 125 /* Method */ || node.kind === 127 /* GetAccessor */ || node.kind === 128 /* SetAccessor */) {\r\n // it is ok to have member named '_super' or '_this' - member access is always qualified\r\n return false;\r\n }\r\n if (ts.isInAmbientContext(node)) {\r\n // ambient context - no codegen impact\r\n return false;\r\n }\r\n if (node.kind === 123 /* Parameter */ && !node.parent.body) {\r\n // just an overload - no codegen impact\r\n return false;\r\n }\r\n return true;\r\n }\r\n function checkCollisionWithCapturedThisVariable(node, name) {\r\n if (needCollisionCheckForIdentifier(node, name, \"_this\")) {\r\n potentialThisCollisions.push(node);\r\n }\r\n }\r\n // this function will run after checking the source file so 'CaptureThis' is correct for all nodes\r\n function checkIfThisIsCapturedInEnclosingScope(node) {\r\n var current = node;\r\n while (current) {\r\n if (getNodeCheckFlags(current) & 4 /* CaptureThis */) {\r\n var isDeclaration = node.kind !== 63 /* Identifier */;\r\n if (isDeclaration) {\r\n error(node.name, ts.Diagnostics.Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference);\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference);\r\n }\r\n return;\r\n }\r\n current = current.parent;\r\n }\r\n }\r\n function checkCollisionWithCapturedSuperVariable(node, name) {\r\n if (!needCollisionCheckForIdentifier(node, name, \"_super\")) {\r\n return;\r\n }\r\n // bubble up and find containing type\r\n var enclosingClass = ts.getAncestor(node, 185 /* ClassDeclaration */);\r\n // if containing type was not found or it is ambient - exit (no codegen)\r\n if (!enclosingClass || ts.isInAmbientContext(enclosingClass)) {\r\n return;\r\n }\r\n if (ts.getClassBaseTypeNode(enclosingClass)) {\r\n var isDeclaration = node.kind !== 63 /* Identifier */;\r\n if (isDeclaration) {\r\n error(node, ts.Diagnostics.Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference);\r\n }\r\n else {\r\n error(node, ts.Diagnostics.Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference);\r\n }\r\n }\r\n }\r\n function checkCollisionWithRequireExportsInGeneratedCode(node, name) {\r\n if (!needCollisionCheckForIdentifier(node, name, \"require\") && !needCollisionCheckForIdentifier(node, name, \"exports\")) {\r\n return;\r\n }\r\n // Uninstantiated modules shouldnt do this check\r\n if (node.kind === 189 /* ModuleDeclaration */ && ts.getModuleInstanceState(node) !== 1 /* Instantiated */) {\r\n return;\r\n }\r\n // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent\r\n var parent = node.kind === 183 /* VariableDeclaration */ ? node.parent.parent : node.parent;\r\n if (parent.kind === 201 /* SourceFile */ && ts.isExternalModule(parent)) {\r\n // If the declaration happens to be in external module, report error that require and exports are reserved keywords\r\n error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_an_external_module, ts.declarationNameToString(name), ts.declarationNameToString(name));\r\n }\r\n }\r\n function checkCollisionWithConstDeclarations(node) {\r\n // Variable declarations are hoisted to the top of their function scope. They can shadow\r\n // block scoped declarations, which bind tighter. this will not be flagged as duplicate definition\r\n // by the binder as the declaration scope is different.\r\n // A non-initialized declaration is a no-op as the block declaration will resolve before the var\r\n // declaration. the problem is if the declaration has an initializer. this will act as a write to the\r\n // block declared value. this is fine for let, but not const.\r\n //\r\n // Only consider declarations with initializers, uninitialized var declarations will not \r\n // step on a const variable.\r\n // Do not consider let and const declarations, as duplicate block-scoped declarations \r\n // are handled by the binder.\r\n // We are only looking for var declarations that step on const declarations from a \r\n // different scope. e.g.:\r\n // var x = 0;\r\n // {\r\n // const x = 0;\r\n // var x = 0;\r\n // }\r\n if (node.initializer && (node.flags & 6144 /* BlockScoped */) === 0) {\r\n var symbol = getSymbolOfNode(node);\r\n if (symbol.flags & 1 /* FunctionScopedVariable */) {\r\n var localDeclarationSymbol = resolveName(node, node.name.text, 3 /* Variable */, undefined, undefined);\r\n if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) {\r\n if (getDeclarationFlagsFromSymbol(localDeclarationSymbol) & 4096 /* Const */) {\r\n error(node, ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0, symbolToString(localDeclarationSymbol));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function checkVariableOrParameterOrPropertyInFullTypeCheck(node) {\r\n ts.Debug.assert(fullTypeCheck);\r\n checkSourceElement(node.type);\r\n if (ts.hasComputedNameButNotSymbol(node)) {\r\n // Just check the initializer, since this property won't contribute to the enclosing type\r\n return node.initializer ? checkAndMarkExpression(node.initializer) : anyType;\r\n }\r\n var symbol = getSymbolOfNode(node);\r\n var type;\r\n if (symbol.valueDeclaration !== node) {\r\n type = getTypeOfVariableOrParameterOrPropertyDeclaration(node);\r\n }\r\n else {\r\n type = getTypeOfVariableOrParameterOrProperty(symbol);\r\n }\r\n if (node.initializer && !(getNodeLinks(node.initializer).flags & 1 /* TypeChecked */)) {\r\n // Use default messages\r\n checkTypeAssignableTo(checkAndMarkExpression(node.initializer), type, node, undefined);\r\n }\r\n return type;\r\n }\r\n function checkVariableOrParameterDeclaration(node) {\r\n if (fullTypeCheck) {\r\n var type = checkVariableOrParameterOrPropertyInFullTypeCheck(node);\r\n checkExportsOnMergedDeclarations(node);\r\n if (node.initializer) {\r\n checkCollisionWithConstDeclarations(node);\r\n }\r\n checkCollisionWithCapturedSuperVariable(node, node.name);\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\r\n var symbol = getSymbolOfNode(node);\r\n if (node !== symbol.valueDeclaration) {\r\n // TypeScript 1.0 spec (April 2014): 5.1\r\n // Multiple declarations for the same variable name in the same declaration space are permitted,\r\n // provided that each declaration associates the same type with the variable.\r\n var typeOfValueDeclaration = getTypeOfVariableOrParameterOrProperty(symbol);\r\n if (typeOfValueDeclaration !== unknownType && type !== unknownType && !isTypeIdenticalTo(typeOfValueDeclaration, type)) {\r\n error(node.name, ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, ts.declarationNameToString(node.name), typeToString(typeOfValueDeclaration), typeToString(type));\r\n }\r\n }\r\n }\r\n }\r\n function checkVariableStatement(node) {\r\n ts.forEach(node.declarations, checkVariableOrParameterDeclaration);\r\n }\r\n function checkExpressionStatement(node) {\r\n checkExpression(node.expression);\r\n }\r\n function checkIfStatement(node) {\r\n checkExpression(node.expression);\r\n checkSourceElement(node.thenStatement);\r\n checkSourceElement(node.elseStatement);\r\n }\r\n function checkDoStatement(node) {\r\n checkSourceElement(node.statement);\r\n checkExpression(node.expression);\r\n }\r\n function checkWhileStatement(node) {\r\n checkExpression(node.expression);\r\n checkSourceElement(node.statement);\r\n }\r\n function checkForStatement(node) {\r\n if (node.declarations)\r\n ts.forEach(node.declarations, checkVariableOrParameterDeclaration);\r\n if (node.initializer)\r\n checkExpression(node.initializer);\r\n if (node.condition)\r\n checkExpression(node.condition);\r\n if (node.iterator)\r\n checkExpression(node.iterator);\r\n checkSourceElement(node.statement);\r\n }\r\n function checkForInStatement(node) {\r\n // TypeScript 1.0 spec (April 2014): 5.4\r\n // In a 'for-in' statement of the form\r\n // for (var VarDecl in Expr) Statement\r\n // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any,\r\n // and Expr must be an expression of type Any, an object type, or a type parameter type. \r\n if (node.declarations) {\r\n if (node.declarations.length >= 1) {\r\n var decl = node.declarations[0];\r\n checkVariableOrParameterDeclaration(decl);\r\n if (decl.type) {\r\n error(decl, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation);\r\n }\r\n }\r\n }\r\n // In a 'for-in' statement of the form\r\n // for (Var in Expr) Statement\r\n // Var must be an expression classified as a reference of type Any or the String primitive type,\r\n // and Expr must be an expression of type Any, an object type, or a type parameter type.\r\n if (node.variable) {\r\n var exprType = checkExpression(node.variable);\r\n if (exprType !== anyType && exprType !== stringType) {\r\n error(node.variable, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any);\r\n }\r\n else {\r\n // run check only former check succeeded to avoid cascading errors\r\n checkReferenceExpression(node.variable, ts.Diagnostics.Invalid_left_hand_side_in_for_in_statement, ts.Diagnostics.Left_hand_side_of_assignment_expression_cannot_be_a_constant);\r\n }\r\n }\r\n var exprType = checkExpression(node.expression);\r\n // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved\r\n // in this case error about missing name is already reported - do not report extra one\r\n if (!isStructuredType(exprType) && exprType !== unknownType) {\r\n error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter);\r\n }\r\n checkSourceElement(node.statement);\r\n }\r\n function checkBreakOrContinueStatement(node) {\r\n // TODO: Check that target label is valid\r\n }\r\n function checkReturnStatement(node) {\r\n if (node.expression && !(getNodeLinks(node.expression).flags & 1 /* TypeChecked */)) {\r\n var func = ts.getContainingFunction(node);\r\n if (func) {\r\n if (func.kind === 128 /* SetAccessor */) {\r\n if (node.expression) {\r\n error(node.expression, ts.Diagnostics.Setters_cannot_return_a_value);\r\n }\r\n }\r\n else {\r\n var returnType = getReturnTypeOfSignature(getSignatureFromDeclaration(func));\r\n // do assignability check only if we short circuited in determining return type\r\n // - function has explicit type annotation\r\n // - function is getter with no type annotation and setter parameter type is used\r\n // - function is a constructor (will be special cased below)\r\n var checkAssignability = func.type || (func.kind === 127 /* GetAccessor */ && getSetAccessorTypeAnnotationNode(getDeclarationOfKind(func.symbol, 128 /* SetAccessor */)));\r\n if (checkAssignability) {\r\n checkTypeAssignableTo(checkExpression(node.expression), returnType, node.expression, undefined);\r\n }\r\n else if (func.kind == 126 /* Constructor */) {\r\n // constructor doesn't have explicit return type annotation and yet its return type is known - declaring type\r\n // handle constructors and issue specialized error message for them.\r\n if (!isTypeAssignableTo(checkExpression(node.expression), returnType)) {\r\n error(node.expression, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function checkWithStatement(node) {\r\n checkExpression(node.expression);\r\n error(node.expression, ts.Diagnostics.All_symbols_within_a_with_block_will_be_resolved_to_any);\r\n }\r\n function checkSwitchStatement(node) {\r\n var expressionType = checkExpression(node.expression);\r\n ts.forEach(node.clauses, function (clause) {\r\n if (fullTypeCheck && clause.kind === 194 /* CaseClause */) {\r\n var caseClause = clause;\r\n // TypeScript 1.0 spec (April 2014):5.9\r\n // In a 'switch' statement, each 'case' expression must be of a type that is assignable to or from the type of the 'switch' expression.\r\n var caseType = checkExpression(caseClause.expression);\r\n if (!isTypeAssignableTo(expressionType, caseType)) {\r\n // check 'expressionType isAssignableTo caseType' failed, try the reversed check and report errors if it fails\r\n checkTypeAssignableTo(caseType, expressionType, caseClause.expression, undefined);\r\n }\r\n }\r\n ts.forEach(clause.statements, checkSourceElement);\r\n });\r\n }\r\n function checkLabeledStatement(node) {\r\n checkSourceElement(node.statement);\r\n }\r\n function checkThrowStatement(node) {\r\n if (node.expression) {\r\n checkExpression(node.expression);\r\n }\r\n }\r\n function checkTryStatement(node) {\r\n checkBlock(node.tryBlock);\r\n if (node.catchClause)\r\n checkBlock(node.catchClause.block);\r\n if (node.finallyBlock)\r\n checkBlock(node.finallyBlock);\r\n }\r\n function checkIndexConstraints(type) {\r\n function checkIndexConstraintForProperty(prop, propertyType, indexDeclaration, indexType, indexKind) {\r\n if (!indexType) {\r\n return;\r\n }\r\n // index is numeric and property name is not valid numeric literal\r\n if (indexKind === 1 /* Number */ && !isNumericName(prop.name)) {\r\n return;\r\n }\r\n // perform property check if property or indexer is declared in 'type'\r\n // this allows to rule out cases when both property and indexer are inherited from the base class\r\n var errorNode;\r\n if (prop.parent === type.symbol) {\r\n errorNode = prop.valueDeclaration;\r\n }\r\n else if (indexDeclaration) {\r\n errorNode = indexDeclaration;\r\n }\r\n else if (type.flags & 2048 /* Interface */) {\r\n // for interfaces property and indexer might be inherited from different bases\r\n // check if any base class already has both property and indexer.\r\n // check should be performed only if 'type' is the first type that brings property\\indexer together\r\n var someBaseClassHasBothPropertyAndIndexer = ts.forEach(type.baseTypes, function (base) { return getPropertyOfObjectType(base, prop.name) && getIndexTypeOfType(base, indexKind); });\r\n errorNode = someBaseClassHasBothPropertyAndIndexer ? undefined : type.symbol.declarations[0];\r\n }\r\n if (errorNode && !isTypeAssignableTo(propertyType, indexType)) {\r\n var errorMessage = indexKind === 0 /* String */ ? ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_string_index_type_2 : ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2;\r\n error(errorNode, errorMessage, symbolToString(prop), typeToString(propertyType), typeToString(indexType));\r\n }\r\n }\r\n var declaredNumberIndexer = getIndexDeclarationOfSymbol(type.symbol, 1 /* Number */);\r\n var declaredStringIndexer = getIndexDeclarationOfSymbol(type.symbol, 0 /* String */);\r\n var stringIndexType = getIndexTypeOfType(type, 0 /* String */);\r\n var numberIndexType = getIndexTypeOfType(type, 1 /* Number */);\r\n if (stringIndexType || numberIndexType) {\r\n ts.forEach(getPropertiesOfObjectType(type), function (prop) {\r\n var propType = getTypeOfSymbol(prop);\r\n checkIndexConstraintForProperty(prop, propType, declaredStringIndexer, stringIndexType, 0 /* String */);\r\n checkIndexConstraintForProperty(prop, propType, declaredNumberIndexer, numberIndexType, 1 /* Number */);\r\n });\r\n }\r\n var errorNode;\r\n if (stringIndexType && numberIndexType) {\r\n errorNode = declaredNumberIndexer || declaredStringIndexer;\r\n // condition 'errorNode === undefined' may appear if types does not declare nor string neither number indexer\r\n if (!errorNode && (type.flags & 2048 /* Interface */)) {\r\n var someBaseTypeHasBothIndexers = ts.forEach(type.baseTypes, function (base) { return getIndexTypeOfType(base, 0 /* String */) && getIndexTypeOfType(base, 1 /* Number */); });\r\n errorNode = someBaseTypeHasBothIndexers ? undefined : type.symbol.declarations[0];\r\n }\r\n }\r\n if (errorNode && !isTypeAssignableTo(numberIndexType, stringIndexType)) {\r\n error(errorNode, ts.Diagnostics.Numeric_index_type_0_is_not_assignable_to_string_index_type_1, typeToString(numberIndexType), typeToString(stringIndexType));\r\n }\r\n }\r\n // TODO(jfreeman): Decide what to do for computed properties\r\n function checkTypeNameIsReserved(name, message) {\r\n switch (name.text) {\r\n case \"any\":\r\n case \"number\":\r\n case \"boolean\":\r\n case \"string\":\r\n case \"void\":\r\n error(name, message, name.text);\r\n }\r\n }\r\n // Check each type parameter and check that list has no duplicate type parameter declarations\r\n function checkTypeParameters(typeParameterDeclarations) {\r\n if (typeParameterDeclarations) {\r\n for (var i = 0; i < typeParameterDeclarations.length; i++) {\r\n var node = typeParameterDeclarations[i];\r\n checkTypeParameter(node);\r\n if (fullTypeCheck) {\r\n for (var j = 0; j < i; j++) {\r\n if (typeParameterDeclarations[j].symbol === node.symbol) {\r\n error(node.name, ts.Diagnostics.Duplicate_identifier_0, ts.declarationNameToString(node.name));\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n function checkClassDeclaration(node) {\r\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Class_name_cannot_be_0);\r\n checkTypeParameters(node.typeParameters);\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\r\n checkExportsOnMergedDeclarations(node);\r\n var symbol = getSymbolOfNode(node);\r\n var type = getDeclaredTypeOfSymbol(symbol);\r\n var staticType = getTypeOfSymbol(symbol);\r\n var baseTypeNode = ts.getClassBaseTypeNode(node);\r\n if (baseTypeNode) {\r\n emitExtends = emitExtends || !ts.isInAmbientContext(node);\r\n checkTypeReference(baseTypeNode);\r\n }\r\n if (type.baseTypes.length) {\r\n if (fullTypeCheck) {\r\n var baseType = type.baseTypes[0];\r\n checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Class_0_incorrectly_extends_base_class_1);\r\n var staticBaseType = getTypeOfSymbol(baseType.symbol);\r\n checkTypeAssignableTo(staticType, getTypeWithoutConstructors(staticBaseType), node.name, ts.Diagnostics.Class_static_side_0_incorrectly_extends_base_class_static_side_1);\r\n if (baseType.symbol !== resolveEntityName(node, baseTypeNode.typeName, 107455 /* Value */)) {\r\n error(baseTypeNode, ts.Diagnostics.Type_name_0_in_extends_clause_does_not_reference_constructor_function_for_0, typeToString(baseType));\r\n }\r\n checkKindsOfPropertyMemberOverrides(type, baseType);\r\n }\r\n // Check that base type can be evaluated as expression\r\n checkExpressionOrQualifiedName(baseTypeNode.typeName);\r\n }\r\n var implementedTypeNodes = ts.getClassImplementedTypeNodes(node);\r\n if (implementedTypeNodes) {\r\n ts.forEach(implementedTypeNodes, function (typeRefNode) {\r\n checkTypeReference(typeRefNode);\r\n if (fullTypeCheck) {\r\n var t = getTypeFromTypeReferenceNode(typeRefNode);\r\n if (t !== unknownType) {\r\n var declaredType = (t.flags & 4096 /* Reference */) ? t.target : t;\r\n if (declaredType.flags & (1024 /* Class */ | 2048 /* Interface */)) {\r\n checkTypeAssignableTo(type, t, node.name, ts.Diagnostics.Class_0_incorrectly_implements_interface_1);\r\n }\r\n else {\r\n error(typeRefNode, ts.Diagnostics.A_class_may_only_implement_another_class_or_interface);\r\n }\r\n }\r\n }\r\n });\r\n }\r\n ts.forEach(node.members, checkSourceElement);\r\n if (fullTypeCheck) {\r\n checkIndexConstraints(type);\r\n checkTypeForDuplicateIndexSignatures(node);\r\n }\r\n }\r\n function getTargetSymbol(s) {\r\n // if symbol is instantiated its flags are not copied from the 'target'\r\n // so we'll need to get back original 'target' symbol to work with correct set of flags\r\n return s.flags & 67108864 /* Instantiated */ ? getSymbolLinks(s).target : s;\r\n }\r\n function checkKindsOfPropertyMemberOverrides(type, baseType) {\r\n // TypeScript 1.0 spec (April 2014): 8.2.3\r\n // A derived class inherits all members from its base class it doesn't override.\r\n // Inheritance means that a derived class implicitly contains all non - overridden members of the base class.\r\n // Both public and private property members are inherited, but only public property members can be overridden.\r\n // A property member in a derived class is said to override a property member in a base class\r\n // when the derived class property member has the same name and kind(instance or static) \r\n // as the base class property member.\r\n // The type of an overriding property member must be assignable(section 3.8.4)\r\n // to the type of the overridden property member, or otherwise a compile - time error occurs.\r\n // Base class instance member functions can be overridden by derived class instance member functions,\r\n // but not by other kinds of members.\r\n // Base class instance member variables and accessors can be overridden by \r\n // derived class instance member variables and accessors, but not by other kinds of members.\r\n // NOTE: assignability is checked in checkClassDeclaration\r\n var baseProperties = getPropertiesOfObjectType(baseType);\r\n for (var i = 0, len = baseProperties.length; i < len; ++i) {\r\n var base = getTargetSymbol(baseProperties[i]);\r\n if (base.flags & 536870912 /* Prototype */) {\r\n continue;\r\n }\r\n var derived = getTargetSymbol(getPropertyOfObjectType(type, base.name));\r\n if (derived) {\r\n var baseDeclarationFlags = getDeclarationFlagsFromSymbol(base);\r\n var derivedDeclarationFlags = getDeclarationFlagsFromSymbol(derived);\r\n if ((baseDeclarationFlags & 32 /* Private */) || (derivedDeclarationFlags & 32 /* Private */)) {\r\n continue;\r\n }\r\n if ((baseDeclarationFlags & 128 /* Static */) !== (derivedDeclarationFlags & 128 /* Static */)) {\r\n continue;\r\n }\r\n if ((base.flags & derived.flags & 8192 /* Method */) || ((base.flags & 98308 /* PropertyOrAccessor */) && (derived.flags & 98308 /* PropertyOrAccessor */))) {\r\n continue;\r\n }\r\n var errorMessage;\r\n if (base.flags & 8192 /* Method */) {\r\n if (derived.flags & 98304 /* Accessor */) {\r\n errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor;\r\n }\r\n else {\r\n ts.Debug.assert((derived.flags & 4 /* Property */) !== 0);\r\n errorMessage = ts.Diagnostics.Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property;\r\n }\r\n }\r\n else if (base.flags & 4 /* Property */) {\r\n ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0);\r\n errorMessage = ts.Diagnostics.Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function;\r\n }\r\n else {\r\n ts.Debug.assert((base.flags & 98304 /* Accessor */) !== 0);\r\n ts.Debug.assert((derived.flags & 8192 /* Method */) !== 0);\r\n errorMessage = ts.Diagnostics.Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function;\r\n }\r\n error(derived.valueDeclaration.name, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));\r\n }\r\n }\r\n }\r\n function isAccessor(kind) {\r\n return kind === 127 /* GetAccessor */ || kind === 128 /* SetAccessor */;\r\n }\r\n function areTypeParametersIdentical(list1, list2) {\r\n if (!list1 && !list2) {\r\n return true;\r\n }\r\n if (!list1 || !list2 || list1.length !== list2.length) {\r\n return false;\r\n }\r\n for (var i = 0, len = list1.length; i < len; i++) {\r\n var tp1 = list1[i];\r\n var tp2 = list2[i];\r\n if (tp1.name.text !== tp2.name.text) {\r\n return false;\r\n }\r\n if (!tp1.constraint && !tp2.constraint) {\r\n continue;\r\n }\r\n if (!tp1.constraint || !tp2.constraint) {\r\n return false;\r\n }\r\n if (!isTypeIdenticalTo(getTypeFromTypeNode(tp1.constraint), getTypeFromTypeNode(tp2.constraint))) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function checkInheritedPropertiesAreIdentical(type, typeNode) {\r\n if (!type.baseTypes.length || type.baseTypes.length === 1) {\r\n return true;\r\n }\r\n var seen = {};\r\n ts.forEach(type.declaredProperties, function (p) {\r\n seen[p.name] = { prop: p, containingType: type };\r\n });\r\n var ok = true;\r\n for (var i = 0, len = type.baseTypes.length; i < len; ++i) {\r\n var base = type.baseTypes[i];\r\n var properties = getPropertiesOfObjectType(base);\r\n for (var j = 0, proplen = properties.length; j < proplen; ++j) {\r\n var prop = properties[j];\r\n if (!ts.hasProperty(seen, prop.name)) {\r\n seen[prop.name] = { prop: prop, containingType: base };\r\n }\r\n else {\r\n var existing = seen[prop.name];\r\n var isInheritedProperty = existing.containingType !== type;\r\n if (isInheritedProperty && !isPropertyIdenticalTo(existing.prop, prop)) {\r\n ok = false;\r\n var typeName1 = typeToString(existing.containingType);\r\n var typeName2 = typeToString(base);\r\n var errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Named_properties_0_of_types_1_and_2_are_not_identical, prop.name, typeName1, typeName2);\r\n errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Interface_0_cannot_simultaneously_extend_types_1_and_2, typeToString(type), typeName1, typeName2);\r\n addDiagnostic(ts.createDiagnosticForNodeFromMessageChain(typeNode, errorInfo, program.getCompilerHost().getNewLine()));\r\n }\r\n }\r\n }\r\n }\r\n return ok;\r\n }\r\n function checkInterfaceDeclaration(node) {\r\n checkTypeParameters(node.typeParameters);\r\n if (fullTypeCheck) {\r\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Interface_name_cannot_be_0);\r\n checkExportsOnMergedDeclarations(node);\r\n var symbol = getSymbolOfNode(node);\r\n var firstInterfaceDecl = getDeclarationOfKind(symbol, 186 /* InterfaceDeclaration */);\r\n if (symbol.declarations.length > 1) {\r\n if (node !== firstInterfaceDecl && !areTypeParametersIdentical(firstInterfaceDecl.typeParameters, node.typeParameters)) {\r\n error(node.name, ts.Diagnostics.All_declarations_of_an_interface_must_have_identical_type_parameters);\r\n }\r\n }\r\n // Only check this symbol once\r\n if (node === firstInterfaceDecl) {\r\n var type = getDeclaredTypeOfSymbol(symbol);\r\n // run subsequent checks only if first set succeeded\r\n if (checkInheritedPropertiesAreIdentical(type, node.name)) {\r\n ts.forEach(type.baseTypes, function (baseType) {\r\n checkTypeAssignableTo(type, baseType, node.name, ts.Diagnostics.Interface_0_incorrectly_extends_interface_1);\r\n });\r\n checkIndexConstraints(type);\r\n }\r\n }\r\n }\r\n ts.forEach(ts.getInterfaceBaseTypeNodes(node), checkTypeReference);\r\n ts.forEach(node.members, checkSourceElement);\r\n if (fullTypeCheck) {\r\n checkTypeForDuplicateIndexSignatures(node);\r\n }\r\n }\r\n function checkTypeAliasDeclaration(node) {\r\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_alias_name_cannot_be_0);\r\n checkSourceElement(node.type);\r\n }\r\n function computeEnumMemberValues(node) {\r\n var nodeLinks = getNodeLinks(node);\r\n if (!(nodeLinks.flags & 128 /* EnumValuesComputed */)) {\r\n var enumSymbol = getSymbolOfNode(node);\r\n var enumType = getDeclaredTypeOfSymbol(enumSymbol);\r\n var autoValue = 0;\r\n var ambient = ts.isInAmbientContext(node);\r\n var enumIsConst = ts.isConst(node);\r\n ts.forEach(node.members, function (member) {\r\n // TODO(jfreeman): Check that it is not a computed name\r\n if (isNumericName(member.name.text)) {\r\n error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);\r\n }\r\n var initializer = member.initializer;\r\n if (initializer) {\r\n autoValue = getConstantValueForEnumMemberInitializer(initializer, enumIsConst);\r\n if (autoValue === undefined) {\r\n if (enumIsConst) {\r\n error(initializer, ts.Diagnostics.In_const_enum_declarations_member_initializer_must_be_constant_expression);\r\n }\r\n else if (!ambient) {\r\n // Only here do we need to check that the initializer is assignable to the enum type.\r\n // If it is a constant value (not undefined), it is syntactically constrained to be a number. \r\n // Also, we do not need to check this for ambients because there is already\r\n // a syntax error if it is not a constant.\r\n checkTypeAssignableTo(checkExpression(initializer), enumType, initializer, undefined);\r\n }\r\n }\r\n else if (enumIsConst) {\r\n if (isNaN(autoValue)) {\r\n error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN);\r\n }\r\n else if (!isFinite(autoValue)) {\r\n error(initializer, ts.Diagnostics.const_enum_member_initializer_was_evaluated_to_a_non_finite_value);\r\n }\r\n }\r\n }\r\n else if (ambient && !enumIsConst) {\r\n autoValue = undefined;\r\n }\r\n if (autoValue !== undefined) {\r\n getNodeLinks(member).enumMemberValue = autoValue++;\r\n }\r\n });\r\n nodeLinks.flags |= 128 /* EnumValuesComputed */;\r\n }\r\n function getConstantValueForEnumMemberInitializer(initializer, enumIsConst) {\r\n return evalConstant(initializer);\r\n function evalConstant(e) {\r\n switch (e.kind) {\r\n case 155 /* PrefixUnaryExpression */:\r\n var value = evalConstant(e.operand);\r\n if (value === undefined) {\r\n return undefined;\r\n }\r\n switch (e.operator) {\r\n case 32 /* PlusToken */: return value;\r\n case 33 /* MinusToken */: return -value;\r\n case 46 /* TildeToken */: return enumIsConst ? ~value : undefined;\r\n }\r\n return undefined;\r\n case 157 /* BinaryExpression */:\r\n if (!enumIsConst) {\r\n return undefined;\r\n }\r\n var left = evalConstant(e.left);\r\n if (left === undefined) {\r\n return undefined;\r\n }\r\n var right = evalConstant(e.right);\r\n if (right === undefined) {\r\n return undefined;\r\n }\r\n switch (e.operator) {\r\n case 43 /* BarToken */: return left | right;\r\n case 42 /* AmpersandToken */: return left & right;\r\n case 40 /* GreaterThanGreaterThanToken */: return left >> right;\r\n case 41 /* GreaterThanGreaterThanGreaterThanToken */: return left >>> right;\r\n case 39 /* LessThanLessThanToken */: return left << right;\r\n case 44 /* CaretToken */: return left ^ right;\r\n case 34 /* AsteriskToken */: return left * right;\r\n case 35 /* SlashToken */: return left / right;\r\n case 32 /* PlusToken */: return left + right;\r\n case 33 /* MinusToken */: return left - right;\r\n case 36 /* PercentToken */: return left % right;\r\n }\r\n return undefined;\r\n case 6 /* NumericLiteral */:\r\n return +e.text;\r\n case 149 /* ParenthesizedExpression */:\r\n return enumIsConst ? evalConstant(e.expression) : undefined;\r\n case 63 /* Identifier */:\r\n case 144 /* ElementAccessExpression */:\r\n case 143 /* PropertyAccessExpression */:\r\n if (!enumIsConst) {\r\n return undefined;\r\n }\r\n var member = initializer.parent;\r\n var currentType = getTypeOfSymbol(getSymbolOfNode(member.parent));\r\n var enumType;\r\n var propertyName;\r\n if (e.kind === 63 /* Identifier */) {\r\n // unqualified names can refer to member that reside in different declaration of the enum so just doing name resolution won't work.\r\n // instead pick current enum type and later try to fetch member from the type\r\n enumType = currentType;\r\n propertyName = e.text;\r\n }\r\n else {\r\n if (e.kind === 144 /* ElementAccessExpression */) {\r\n if (e.argumentExpression === undefined || e.argumentExpression.kind !== 7 /* StringLiteral */) {\r\n return undefined;\r\n }\r\n var enumType = getTypeOfNode(e.expression);\r\n propertyName = e.argumentExpression.text;\r\n }\r\n else {\r\n var enumType = getTypeOfNode(e.expression);\r\n propertyName = e.name.text;\r\n }\r\n if (enumType !== currentType) {\r\n return undefined;\r\n }\r\n }\r\n if (propertyName === undefined) {\r\n return undefined;\r\n }\r\n var property = getPropertyOfObjectType(enumType, propertyName);\r\n if (!property || !(property.flags & 8 /* EnumMember */)) {\r\n return undefined;\r\n }\r\n var propertyDecl = property.valueDeclaration;\r\n // self references are illegal\r\n if (member === propertyDecl) {\r\n return undefined;\r\n }\r\n // illegal case: forward reference\r\n if (!isDefinedBefore(propertyDecl, member)) {\r\n return undefined;\r\n }\r\n return getNodeLinks(propertyDecl).enumMemberValue;\r\n }\r\n }\r\n }\r\n }\r\n function checkEnumDeclaration(node) {\r\n if (!fullTypeCheck) {\r\n return;\r\n }\r\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Enum_name_cannot_be_0);\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\r\n checkExportsOnMergedDeclarations(node);\r\n computeEnumMemberValues(node);\r\n // Spec 2014 - Section 9.3:\r\n // It isn't possible for one enum declaration to continue the automatic numbering sequence of another,\r\n // and when an enum type has multiple declarations, only one declaration is permitted to omit a value\r\n // for the first member.\r\n //\r\n // Only perform this check once per symbol\r\n var enumSymbol = getSymbolOfNode(node);\r\n var firstDeclaration = getDeclarationOfKind(enumSymbol, node.kind);\r\n if (node === firstDeclaration) {\r\n if (enumSymbol.declarations.length > 1) {\r\n var enumIsConst = ts.isConst(node);\r\n // check that const is placed\\omitted on all enum declarations\r\n ts.forEach(enumSymbol.declarations, function (decl) {\r\n if (ts.isConstEnumDeclaration(decl) !== enumIsConst) {\r\n error(decl.name, ts.Diagnostics.Enum_declarations_must_all_be_const_or_non_const);\r\n }\r\n });\r\n }\r\n var seenEnumMissingInitialInitializer = false;\r\n ts.forEach(enumSymbol.declarations, function (declaration) {\r\n // return true if we hit a violation of the rule, false otherwise\r\n if (declaration.kind !== 188 /* EnumDeclaration */) {\r\n return false;\r\n }\r\n var enumDeclaration = declaration;\r\n if (!enumDeclaration.members.length) {\r\n return false;\r\n }\r\n var firstEnumMember = enumDeclaration.members[0];\r\n if (!firstEnumMember.initializer) {\r\n if (seenEnumMissingInitialInitializer) {\r\n error(firstEnumMember.name, ts.Diagnostics.In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element);\r\n }\r\n else {\r\n seenEnumMissingInitialInitializer = true;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n function getFirstNonAmbientClassOrFunctionDeclaration(symbol) {\r\n var declarations = symbol.declarations;\r\n for (var i = 0; i < declarations.length; i++) {\r\n var declaration = declarations[i];\r\n if ((declaration.kind === 185 /* ClassDeclaration */ || (declaration.kind === 184 /* FunctionDeclaration */ && declaration.body)) && !ts.isInAmbientContext(declaration)) {\r\n return declaration;\r\n }\r\n }\r\n return undefined;\r\n }\r\n function checkModuleDeclaration(node) {\r\n if (fullTypeCheck) {\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\r\n checkExportsOnMergedDeclarations(node);\r\n var symbol = getSymbolOfNode(node);\r\n if (symbol.flags & 512 /* ValueModule */ && symbol.declarations.length > 1 && !ts.isInAmbientContext(node)) {\r\n var classOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);\r\n if (classOrFunc) {\r\n if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(classOrFunc)) {\r\n error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged);\r\n }\r\n else if (node.pos < classOrFunc.pos) {\r\n error(node.name, ts.Diagnostics.A_module_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged);\r\n }\r\n }\r\n }\r\n if (node.name.kind === 7 /* StringLiteral */) {\r\n if (!isGlobalSourceFile(node.parent)) {\r\n error(node.name, ts.Diagnostics.Ambient_external_modules_cannot_be_nested_in_other_modules);\r\n }\r\n if (isExternalModuleNameRelative(node.name.text)) {\r\n error(node.name, ts.Diagnostics.Ambient_external_module_declaration_cannot_specify_relative_module_name);\r\n }\r\n }\r\n }\r\n checkSourceElement(node.body);\r\n }\r\n function getFirstIdentifier(node) {\r\n while (node.kind === 120 /* QualifiedName */) {\r\n node = node.left;\r\n }\r\n return node;\r\n }\r\n function checkImportDeclaration(node) {\r\n checkCollisionWithCapturedThisVariable(node, node.name);\r\n checkCollisionWithRequireExportsInGeneratedCode(node, node.name);\r\n var symbol = getSymbolOfNode(node);\r\n var target;\r\n if (ts.isInternalModuleImportDeclaration(node)) {\r\n target = resolveImport(symbol);\r\n // Import declaration for an internal module\r\n if (target !== unknownSymbol) {\r\n if (target.flags & 107455 /* Value */) {\r\n // Target is a value symbol, check that it is not hidden by a local declaration with the same name and\r\n // ensure it can be evaluated as an expression\r\n var moduleName = getFirstIdentifier(node.moduleReference);\r\n if (resolveEntityName(node, moduleName, 107455 /* Value */ | 1536 /* Namespace */).flags & 1536 /* Namespace */) {\r\n checkExpressionOrQualifiedName(node.moduleReference);\r\n }\r\n else {\r\n error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName));\r\n }\r\n }\r\n if (target.flags & 3152352 /* Type */) {\r\n checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0);\r\n }\r\n }\r\n }\r\n else {\r\n // Import declaration for an external module\r\n if (node.parent.kind === 201 /* SourceFile */) {\r\n target = resolveImport(symbol);\r\n }\r\n else if (node.parent.kind === 190 /* ModuleBlock */ && node.parent.parent.name.kind === 7 /* StringLiteral */) {\r\n // TypeScript 1.0 spec (April 2013): 12.1.6\r\n // An ExternalImportDeclaration in an AmbientExternalModuleDeclaration may reference \r\n // other external modules only through top - level external module names.\r\n // Relative external module names are not permitted.\r\n if (ts.getExternalModuleImportDeclarationExpression(node).kind === 7 /* StringLiteral */) {\r\n if (isExternalModuleNameRelative(ts.getExternalModuleImportDeclarationExpression(node).text)) {\r\n error(node, ts.Diagnostics.Import_declaration_in_an_ambient_external_module_declaration_cannot_reference_external_module_through_relative_external_module_name);\r\n target = unknownSymbol;\r\n }\r\n else {\r\n target = resolveImport(symbol);\r\n }\r\n }\r\n else {\r\n target = unknownSymbol;\r\n }\r\n }\r\n else {\r\n // Parent is an internal module (syntax error is already reported)\r\n target = unknownSymbol;\r\n }\r\n }\r\n if (target !== unknownSymbol) {\r\n var excludedMeanings = (symbol.flags & 107455 /* Value */ ? 107455 /* Value */ : 0) | (symbol.flags & 3152352 /* Type */ ? 3152352 /* Type */ : 0) | (symbol.flags & 1536 /* Namespace */ ? 1536 /* Namespace */ : 0);\r\n if (target.flags & excludedMeanings) {\r\n error(node, ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0, symbolToString(symbol));\r\n }\r\n }\r\n }\r\n function checkExportAssignment(node) {\r\n var container = node.parent;\r\n if (container.kind !== 201 /* SourceFile */) {\r\n // In a module, the immediate parent will be a block, so climb up one more parent\r\n container = container.parent;\r\n }\r\n checkTypeOfExportAssignmentSymbol(getSymbolOfNode(container));\r\n }\r\n function checkSourceElement(node) {\r\n if (!node)\r\n return;\r\n switch (node.kind) {\r\n case 122 /* TypeParameter */:\r\n return checkTypeParameter(node);\r\n case 123 /* Parameter */:\r\n return checkParameter(node);\r\n case 124 /* Property */:\r\n return checkPropertyDeclaration(node);\r\n case 133 /* FunctionType */:\r\n case 134 /* ConstructorType */:\r\n case 129 /* CallSignature */:\r\n case 130 /* ConstructSignature */:\r\n case 131 /* IndexSignature */:\r\n return checkSignatureDeclaration(node);\r\n case 125 /* Method */:\r\n return checkMethodDeclaration(node);\r\n case 126 /* Constructor */:\r\n return checkConstructorDeclaration(node);\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n return checkAccessorDeclaration(node);\r\n case 132 /* TypeReference */:\r\n return checkTypeReference(node);\r\n case 135 /* TypeQuery */:\r\n return checkTypeQuery(node);\r\n case 136 /* TypeLiteral */:\r\n return checkTypeLiteral(node);\r\n case 137 /* ArrayType */:\r\n return checkArrayType(node);\r\n case 138 /* TupleType */:\r\n return checkTupleType(node);\r\n case 139 /* UnionType */:\r\n return checkUnionType(node);\r\n case 140 /* ParenthesizedType */:\r\n return checkSourceElement(node.type);\r\n case 184 /* FunctionDeclaration */:\r\n return checkFunctionDeclaration(node);\r\n case 163 /* Block */:\r\n case 190 /* ModuleBlock */:\r\n return checkBlock(node);\r\n case 164 /* VariableStatement */:\r\n return checkVariableStatement(node);\r\n case 166 /* ExpressionStatement */:\r\n return checkExpressionStatement(node);\r\n case 167 /* IfStatement */:\r\n return checkIfStatement(node);\r\n case 168 /* DoStatement */:\r\n return checkDoStatement(node);\r\n case 169 /* WhileStatement */:\r\n return checkWhileStatement(node);\r\n case 170 /* ForStatement */:\r\n return checkForStatement(node);\r\n case 171 /* ForInStatement */:\r\n return checkForInStatement(node);\r\n case 172 /* ContinueStatement */:\r\n case 173 /* BreakStatement */:\r\n return checkBreakOrContinueStatement(node);\r\n case 174 /* ReturnStatement */:\r\n return checkReturnStatement(node);\r\n case 175 /* WithStatement */:\r\n return checkWithStatement(node);\r\n case 176 /* SwitchStatement */:\r\n return checkSwitchStatement(node);\r\n case 177 /* LabeledStatement */:\r\n return checkLabeledStatement(node);\r\n case 178 /* ThrowStatement */:\r\n return checkThrowStatement(node);\r\n case 179 /* TryStatement */:\r\n return checkTryStatement(node);\r\n case 183 /* VariableDeclaration */:\r\n return ts.Debug.fail(\"Checker encountered variable declaration\");\r\n case 185 /* ClassDeclaration */:\r\n return checkClassDeclaration(node);\r\n case 186 /* InterfaceDeclaration */:\r\n return checkInterfaceDeclaration(node);\r\n case 187 /* TypeAliasDeclaration */:\r\n return checkTypeAliasDeclaration(node);\r\n case 188 /* EnumDeclaration */:\r\n return checkEnumDeclaration(node);\r\n case 189 /* ModuleDeclaration */:\r\n return checkModuleDeclaration(node);\r\n case 191 /* ImportDeclaration */:\r\n return checkImportDeclaration(node);\r\n case 192 /* ExportAssignment */:\r\n return checkExportAssignment(node);\r\n }\r\n }\r\n // Function expression bodies are checked after all statements in the enclosing body. This is to ensure\r\n // constructs like the following are permitted:\r\n // var foo = function () {\r\n // var s = foo();\r\n // return \"hello\";\r\n // }\r\n // Here, performing a full type check of the body of the function expression whilst in the process of\r\n // determining the type of foo would cause foo to be given type any because of the recursive reference.\r\n // Delaying the type check of the body ensures foo has been assigned a type.\r\n function checkFunctionExpressionBodies(node) {\r\n switch (node.kind) {\r\n case 150 /* FunctionExpression */:\r\n case 151 /* ArrowFunction */:\r\n ts.forEach(node.parameters, checkFunctionExpressionBodies);\r\n checkFunctionExpressionOrObjectLiteralMethodBody(node);\r\n break;\r\n case 125 /* Method */:\r\n ts.forEach(node.parameters, checkFunctionExpressionBodies);\r\n if (ts.isObjectLiteralMethod(node)) {\r\n checkFunctionExpressionOrObjectLiteralMethodBody(node);\r\n }\r\n break;\r\n case 126 /* Constructor */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n case 184 /* FunctionDeclaration */:\r\n ts.forEach(node.parameters, checkFunctionExpressionBodies);\r\n break;\r\n case 175 /* WithStatement */:\r\n checkFunctionExpressionBodies(node.expression);\r\n break;\r\n case 123 /* Parameter */:\r\n case 124 /* Property */:\r\n case 141 /* ArrayLiteralExpression */:\r\n case 142 /* ObjectLiteralExpression */:\r\n case 198 /* PropertyAssignment */:\r\n case 143 /* PropertyAccessExpression */:\r\n case 144 /* ElementAccessExpression */:\r\n case 145 /* CallExpression */:\r\n case 146 /* NewExpression */:\r\n case 147 /* TaggedTemplateExpression */:\r\n case 148 /* TypeAssertionExpression */:\r\n case 149 /* ParenthesizedExpression */:\r\n case 153 /* TypeOfExpression */:\r\n case 154 /* VoidExpression */:\r\n case 152 /* DeleteExpression */:\r\n case 155 /* PrefixUnaryExpression */:\r\n case 156 /* PostfixUnaryExpression */:\r\n case 157 /* BinaryExpression */:\r\n case 158 /* ConditionalExpression */:\r\n case 163 /* Block */:\r\n case 190 /* ModuleBlock */:\r\n case 164 /* VariableStatement */:\r\n case 166 /* ExpressionStatement */:\r\n case 167 /* IfStatement */:\r\n case 168 /* DoStatement */:\r\n case 169 /* WhileStatement */:\r\n case 170 /* ForStatement */:\r\n case 171 /* ForInStatement */:\r\n case 172 /* ContinueStatement */:\r\n case 173 /* BreakStatement */:\r\n case 174 /* ReturnStatement */:\r\n case 176 /* SwitchStatement */:\r\n case 194 /* CaseClause */:\r\n case 195 /* DefaultClause */:\r\n case 177 /* LabeledStatement */:\r\n case 178 /* ThrowStatement */:\r\n case 179 /* TryStatement */:\r\n case 180 /* TryBlock */:\r\n case 197 /* CatchClause */:\r\n case 181 /* FinallyBlock */:\r\n case 183 /* VariableDeclaration */:\r\n case 185 /* ClassDeclaration */:\r\n case 188 /* EnumDeclaration */:\r\n case 200 /* EnumMember */:\r\n case 201 /* SourceFile */:\r\n ts.forEachChild(node, checkFunctionExpressionBodies);\r\n break;\r\n }\r\n }\r\n // Fully type check a source file and collect the relevant diagnostics.\r\n function checkSourceFile(node) {\r\n var links = getNodeLinks(node);\r\n if (!(links.flags & 1 /* TypeChecked */)) {\r\n emitExtends = false;\r\n potentialThisCollisions.length = 0;\r\n ts.forEach(node.statements, checkSourceElement);\r\n checkFunctionExpressionBodies(node);\r\n if (ts.isExternalModule(node)) {\r\n var symbol = getExportAssignmentSymbol(node.symbol);\r\n if (symbol && symbol.flags & 33554432 /* Import */) {\r\n // Mark the import as referenced so that we emit it in the final .js file.\r\n getSymbolLinks(symbol).referenced = true;\r\n }\r\n }\r\n if (potentialThisCollisions.length) {\r\n ts.forEach(potentialThisCollisions, checkIfThisIsCapturedInEnclosingScope);\r\n potentialThisCollisions.length = 0;\r\n }\r\n if (emitExtends) {\r\n links.flags |= 8 /* EmitExtends */;\r\n }\r\n links.flags |= 1 /* TypeChecked */;\r\n }\r\n }\r\n function getSortedDiagnostics() {\r\n ts.Debug.assert(fullTypeCheck, \"diagnostics are available only in the full typecheck mode\");\r\n if (diagnosticsModified) {\r\n diagnostics.sort(ts.compareDiagnostics);\r\n diagnostics = ts.deduplicateSortedDiagnostics(diagnostics);\r\n diagnosticsModified = false;\r\n }\r\n return diagnostics;\r\n }\r\n function getDiagnostics(sourceFile) {\r\n if (sourceFile) {\r\n checkSourceFile(sourceFile);\r\n return ts.filter(getSortedDiagnostics(), function (d) { return d.file === sourceFile; });\r\n }\r\n ts.forEach(program.getSourceFiles(), checkSourceFile);\r\n return getSortedDiagnostics();\r\n }\r\n function getDeclarationDiagnostics(targetSourceFile) {\r\n var resolver = createResolver();\r\n checkSourceFile(targetSourceFile);\r\n return ts.getDeclarationDiagnostics(program, resolver, targetSourceFile);\r\n }\r\n function getGlobalDiagnostics() {\r\n return ts.filter(getSortedDiagnostics(), function (d) { return !d.file; });\r\n }\r\n // Language service support\r\n function isInsideWithStatementBody(node) {\r\n if (node) {\r\n while (node.parent) {\r\n if (node.parent.kind === 175 /* WithStatement */ && node.parent.statement === node) {\r\n return true;\r\n }\r\n node = node.parent;\r\n }\r\n }\r\n return false;\r\n }\r\n function getSymbolsInScope(location, meaning) {\r\n var symbols = {};\r\n var memberFlags = 0;\r\n function copySymbol(symbol, meaning) {\r\n if (symbol.flags & meaning) {\r\n var id = symbol.name;\r\n if (!isReservedMemberName(id) && !ts.hasProperty(symbols, id)) {\r\n symbols[id] = symbol;\r\n }\r\n }\r\n }\r\n function copySymbols(source, meaning) {\r\n if (meaning) {\r\n for (var id in source) {\r\n if (ts.hasProperty(source, id)) {\r\n copySymbol(source[id], meaning);\r\n }\r\n }\r\n }\r\n }\r\n if (isInsideWithStatementBody(location)) {\r\n // We cannot answer semantic questions within a with block, do not proceed any further\r\n return [];\r\n }\r\n while (location) {\r\n if (location.locals && !isGlobalSourceFile(location)) {\r\n copySymbols(location.locals, meaning);\r\n }\r\n switch (location.kind) {\r\n case 201 /* SourceFile */:\r\n if (!ts.isExternalModule(location))\r\n break;\r\n case 189 /* ModuleDeclaration */:\r\n copySymbols(getSymbolOfNode(location).exports, meaning & 35653619 /* ModuleMember */);\r\n break;\r\n case 188 /* EnumDeclaration */:\r\n copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */);\r\n break;\r\n case 185 /* ClassDeclaration */:\r\n case 186 /* InterfaceDeclaration */:\r\n if (!(memberFlags & 128 /* Static */)) {\r\n copySymbols(getSymbolOfNode(location).members, meaning & 3152352 /* Type */);\r\n }\r\n break;\r\n case 150 /* FunctionExpression */:\r\n if (location.name) {\r\n copySymbol(location.symbol, meaning);\r\n }\r\n break;\r\n case 197 /* CatchClause */:\r\n if (location.name.text) {\r\n copySymbol(location.symbol, meaning);\r\n }\r\n break;\r\n }\r\n memberFlags = location.flags;\r\n location = location.parent;\r\n }\r\n copySymbols(globals, meaning);\r\n return ts.mapToArray(symbols);\r\n }\r\n function isTypeDeclarationName(name) {\r\n return name.kind == 63 /* Identifier */ && isTypeDeclaration(name.parent) && name.parent.name === name;\r\n }\r\n function isTypeDeclaration(node) {\r\n switch (node.kind) {\r\n case 122 /* TypeParameter */:\r\n case 185 /* ClassDeclaration */:\r\n case 186 /* InterfaceDeclaration */:\r\n case 187 /* TypeAliasDeclaration */:\r\n case 188 /* EnumDeclaration */:\r\n return true;\r\n }\r\n }\r\n // True if the given identifier is part of a type reference\r\n function isTypeReferenceIdentifier(entityName) {\r\n var node = entityName;\r\n while (node.parent && node.parent.kind === 120 /* QualifiedName */)\r\n node = node.parent;\r\n return node.parent && node.parent.kind === 132 /* TypeReference */;\r\n }\r\n function isTypeNode(node) {\r\n if (132 /* FirstTypeNode */ <= node.kind && node.kind <= 140 /* LastTypeNode */) {\r\n return true;\r\n }\r\n switch (node.kind) {\r\n case 109 /* AnyKeyword */:\r\n case 116 /* NumberKeyword */:\r\n case 118 /* StringKeyword */:\r\n case 110 /* BooleanKeyword */:\r\n return true;\r\n case 97 /* VoidKeyword */:\r\n return node.parent.kind !== 154 /* VoidExpression */;\r\n case 7 /* StringLiteral */:\r\n // Specialized signatures can have string literals as their parameters' type names\r\n return node.parent.kind === 123 /* Parameter */;\r\n case 63 /* Identifier */:\r\n // If the identifier is the RHS of a qualified name, then it's a type iff its parent is.\r\n if (node.parent.kind === 120 /* QualifiedName */ && node.parent.right === node) {\r\n node = node.parent;\r\n }\r\n case 120 /* QualifiedName */:\r\n // At this point, node is either a qualified name or an identifier\r\n ts.Debug.assert(node.kind === 63 /* Identifier */ || node.kind === 120 /* QualifiedName */, \"'node' was expected to be a qualified name or identifier in 'isTypeNode'.\");\r\n var parent = node.parent;\r\n if (parent.kind === 135 /* TypeQuery */) {\r\n return false;\r\n }\r\n // Do not recursively call isTypeNode on the parent. In the example:\r\n //\r\n // var a: A.B.C;\r\n //\r\n // Calling isTypeNode would consider the qualified name A.B a type node. Only C or\r\n // A.B.C is a type node.\r\n if (132 /* FirstTypeNode */ <= parent.kind && parent.kind <= 140 /* LastTypeNode */) {\r\n return true;\r\n }\r\n switch (parent.kind) {\r\n case 122 /* TypeParameter */:\r\n return node === parent.constraint;\r\n case 124 /* Property */:\r\n case 123 /* Parameter */:\r\n case 183 /* VariableDeclaration */:\r\n return node === parent.type;\r\n case 184 /* FunctionDeclaration */:\r\n case 150 /* FunctionExpression */:\r\n case 151 /* ArrowFunction */:\r\n case 126 /* Constructor */:\r\n case 125 /* Method */:\r\n case 127 /* GetAccessor */:\r\n case 128 /* SetAccessor */:\r\n return node === parent.type;\r\n case 129 /* CallSignature */:\r\n case 130 /* ConstructSignature */:\r\n case 131 /* IndexSignature */:\r\n return node === parent.type;\r\n case 148 /* TypeAssertionExpression */:\r\n return node === parent.type;\r\n case 145 /* CallExpression */:\r\n case 146 /* NewExpression */:\r\n return parent.typeArguments && ts.indexOf(parent.typeArguments, node) >= 0;\r\n case 147 /* TaggedTemplateExpression */:\r\n // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments.\r\n return false;\r\n }\r\n }\r\n return false;\r\n }\r\n function isInRightSideOfImportOrExportAssignment(node) {\r\n while (node.parent.kind === 120 /* QualifiedName */) {\r\n node = node.parent;\r\n }\r\n if (node.parent.kind === 191 /* ImportDeclaration */) {\r\n return node.parent.moduleReference === node;\r\n }\r\n if (node.parent.kind === 192 /* ExportAssignment */) {\r\n return node.parent.exportName === node;\r\n }\r\n return false;\r\n }\r\n function isRightSideOfQualifiedNameOrPropertyAccess(node) {\r\n return (node.parent.kind === 120 /* QualifiedName */ && node.parent.right === node) || (node.parent.kind === 143 /* PropertyAccessExpression */ && node.parent.name === node);\r\n }\r\n function getSymbolOfEntityNameOrPropertyAccessExpression(entityName) {\r\n if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) {\r\n return getSymbolOfNode(entityName.parent);\r\n }\r\n if (entityName.parent.kind === 192 /* ExportAssignment */) {\r\n return resolveEntityName(entityName.parent.parent, entityName, 107455 /* Value */ | 3152352 /* Type */ | 1536 /* Namespace */ | 33554432 /* Import */);\r\n }\r\n if (entityName.kind !== 143 /* PropertyAccessExpression */) {\r\n if (isInRightSideOfImportOrExportAssignment(entityName)) {\r\n // Since we already checked for ExportAssignment, this really could only be an Import\r\n return getSymbolOfPartOfRightHandSideOfImport(entityName);\r\n }\r\n }\r\n if (isRightSideOfQualifiedNameOrPropertyAccess(entityName)) {\r\n entityName = entityName.parent;\r\n }\r\n if (ts.isExpression(entityName)) {\r\n if (ts.getFullWidth(entityName) === 0) {\r\n // Missing entity name.\r\n return undefined;\r\n }\r\n if (entityName.kind === 63 /* Identifier */) {\r\n // Include Import in the meaning, this ensures that we do not follow aliases to where they point and instead\r\n // return the alias symbol.\r\n var meaning = 107455 /* Value */ | 33554432 /* Import */;\r\n return resolveEntityName(entityName, entityName, meaning);\r\n }\r\n else if (entityName.kind === 143 /* PropertyAccessExpression */) {\r\n var symbol = getNodeLinks(entityName).resolvedSymbol;\r\n if (!symbol) {\r\n checkPropertyAccessExpression(entityName);\r\n }\r\n return getNodeLinks(entityName).resolvedSymbol;\r\n }\r\n else if (entityName.kind === 120 /* QualifiedName */) {\r\n var symbol = getNodeLinks(entityName).resolvedSymbol;\r\n if (!symbol) {\r\n checkQualifiedName(entityName);\r\n }\r\n return getNodeLinks(entityName).resolvedSymbol;\r\n }\r\n }\r\n else if (isTypeReferenceIdentifier(entityName)) {\r\n var meaning = entityName.parent.kind === 132 /* TypeReference */ ? 3152352 /* Type */ : 1536 /* Namespace */;\r\n // Include Import in the meaning, this ensures that we do not follow aliases to where they point and instead\r\n // return the alias symbol.\r\n meaning |= 33554432 /* Import */;\r\n return resolveEntityName(entityName, entityName, meaning);\r\n }\r\n // Do we want to return undefined here?\r\n return undefined;\r\n }\r\n function getSymbolInfo(node) {\r\n if (isInsideWithStatementBody(node)) {\r\n // We cannot answer semantic questions within a with block, do not proceed any further\r\n return undefined;\r\n }\r\n if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {\r\n // This is a declaration, call getSymbolOfNode\r\n return getSymbolOfNode(node.parent);\r\n }\r\n if (node.kind === 63 /* Identifier */ && isInRightSideOfImportOrExportAssignment(node)) {\r\n return node.parent.kind === 192 /* ExportAssignment */ ? getSymbolOfEntityNameOrPropertyAccessExpression(node) : getSymbolOfPartOfRightHandSideOfImport(node);\r\n }\r\n switch (node.kind) {\r\n case 63 /* Identifier */:\r\n case 143 /* PropertyAccessExpression */:\r\n case 120 /* QualifiedName */:\r\n return getSymbolOfEntityNameOrPropertyAccessExpression(node);\r\n case 91 /* ThisKeyword */:\r\n case 89 /* SuperKeyword */:\r\n var type = checkExpression(node);\r\n return type.symbol;\r\n case 111 /* ConstructorKeyword */:\r\n // constructor keyword for an overload, should take us to the definition if it exist\r\n var constructorDeclaration = node.parent;\r\n if (constructorDeclaration && constructorDeclaration.kind === 126 /* Constructor */) {\r\n return constructorDeclaration.parent.symbol;\r\n }\r\n return undefined;\r\n case 7 /* StringLiteral */:\r\n // External module name in an import declaration\r\n if (ts.isExternalModuleImportDeclaration(node.parent.parent) && ts.getExternalModuleImportDeclarationExpression(node.parent.parent) === node) {\r\n var importSymbol = getSymbolOfNode(node.parent.parent);\r\n var moduleType = getTypeOfSymbol(importSymbol);\r\n return moduleType ? moduleType.symbol : undefined;\r\n }\r\n case 6 /* NumericLiteral */:\r\n // index access\r\n if (node.parent.kind == 144 /* ElementAccessExpression */ && node.parent.argumentExpression === node) {\r\n var objectType = checkExpression(node.parent.expression);\r\n if (objectType === unknownType)\r\n return undefined;\r\n var apparentType = getApparentType(objectType);\r\n if (apparentType === unknownType)\r\n return undefined;\r\n return getPropertyOfType(apparentType, node.text);\r\n }\r\n break;\r\n }\r\n return undefined;\r\n }\r\n function getShorthandAssignmentValueSymbol(location) {\r\n // The function returns a value symbol of an identifier in the short-hand property assignment.\r\n // This is necessary as an identifier in short-hand property assignment can contains two meaning:\r\n // property name and property value.\r\n if (location && location.kind === 199 /* ShorthandPropertyAssignment */) {\r\n return resolveEntityName(location, location.name, 107455 /* Value */);\r\n }\r\n return undefined;\r\n }\r\n function getTypeOfNode(node) {\r\n if (isInsideWithStatementBody(node)) {\r\n // We cannot answer semantic questions within a with block, do not proceed any further\r\n return unknownType;\r\n }\r\n if (ts.isExpression(node)) {\r\n return getTypeOfExpression(node);\r\n }\r\n if (isTypeNode(node)) {\r\n return getTypeFromTypeNode(node);\r\n }\r\n if (isTypeDeclaration(node)) {\r\n // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration\r\n var symbol = getSymbolOfNode(node);\r\n return getDeclaredTypeOfSymbol(symbol);\r\n }\r\n if (isTypeDeclarationName(node)) {\r\n var symbol = getSymbolInfo(node);\r\n return symbol && getDeclaredTypeOfSymbol(symbol);\r\n }\r\n if (ts.isDeclaration(node)) {\r\n // In this case, we call getSymbolOfNode instead of getSymbolInfo because it is a declaration\r\n var symbol = getSymbolOfNode(node);\r\n return getTypeOfSymbol(symbol);\r\n }\r\n if (ts.isDeclarationOrFunctionExpressionOrCatchVariableName(node)) {\r\n var symbol = getSymbolInfo(node);\r\n return symbol && getTypeOfSymbol(symbol);\r\n }\r\n if (isInRightSideOfImportOrExportAssignment(node)) {\r\n var symbol = getSymbolInfo(node);\r\n var declaredType = symbol && getDeclaredTypeOfSymbol(symbol);\r\n return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol);\r\n }\r\n return unknownType;\r\n }\r\n function getTypeOfExpression(expr) {\r\n if (isRightSideOfQualifiedNameOrPropertyAccess(expr)) {\r\n expr = expr.parent;\r\n }\r\n return checkExpression(expr);\r\n }\r\n // Return the list of properties of the given type, augmented with properties from Function\r\n // if the type has call or construct signatures\r\n function getAugmentedPropertiesOfType(type) {\r\n var type = getApparentType(type);\r\n var propsByName = createSymbolTable(getPropertiesOfType(type));\r\n if (getSignaturesOfType(type, 0 /* Call */).length || getSignaturesOfType(type, 1 /* Construct */).length) {\r\n ts.forEach(getPropertiesOfType(globalFunctionType), function (p) {\r\n if (!ts.hasProperty(propsByName, p.name)) {\r\n propsByName[p.name] = p;\r\n }\r\n });\r\n }\r\n return getNamedMembers(propsByName);\r\n }\r\n function getRootSymbols(symbol) {\r\n if (symbol.flags & 1073741824 /* UnionProperty */) {\r\n var symbols = [];\r\n var name = symbol.name;\r\n ts.forEach(getSymbolLinks(symbol).unionType.types, function (t) {\r\n symbols.push(getPropertyOfType(t, name));\r\n });\r\n return symbols;\r\n }\r\n else if (symbol.flags & 268435456 /* Transient */) {\r\n var target = getSymbolLinks(symbol).target;\r\n if (target) {\r\n return [target];\r\n }\r\n }\r\n return [symbol];\r\n }\r\n // Emitter support\r\n function isExternalModuleSymbol(symbol) {\r\n return symbol.flags & 512 /* ValueModule */ && symbol.declarations.length === 1 && symbol.declarations[0].kind === 201 /* SourceFile */;\r\n }\r\n function isNodeDescendentOf(node, ancestor) {\r\n while (node) {\r\n if (node === ancestor)\r\n return true;\r\n node = node.parent;\r\n }\r\n return false;\r\n }\r\n function isUniqueLocalName(name, container) {\r\n for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {\r\n if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n function getLocalNameOfContainer(container) {\r\n var links = getNodeLinks(container);\r\n if (!links.localModuleName) {\r\n var prefix = \"\";\r\n var name = ts.unescapeIdentifier(container.name.text);\r\n while (!isUniqueLocalName(ts.escapeIdentifier(prefix + name), container)) {\r\n prefix += \"_\";\r\n }\r\n links.localModuleName = prefix + ts.getTextOfNode(container.name);\r\n }\r\n return links.localModuleName;\r\n }\r\n function getLocalNameForSymbol(symbol, location) {\r\n var node = location;\r\n while (node) {\r\n if ((node.kind === 189 /* ModuleDeclaration */ || node.kind === 188 /* EnumDeclaration */) && getSymbolOfNode(node) === symbol) {\r\n return getLocalNameOfContainer(node);\r\n }\r\n node = node.parent;\r\n }\r\n ts.Debug.fail(\"getLocalNameForSymbol failed\");\r\n }\r\n function getExpressionNamePrefix(node) {\r\n var symbol = getNodeLinks(node).resolvedSymbol;\r\n if (symbol) {\r\n // In general, we need to prefix an identifier with its parent name if it references\r\n // an exported entity from another module declaration. If we reference an exported\r\n // entity within the same module declaration, then whether we prefix depends on the\r\n // kind of entity. SymbolFlags.ExportHasLocal encompasses all the kinds that we\r\n // do NOT prefix.\r\n var exportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);\r\n if (symbol !== exportSymbol && !(exportSymbol.flags & 944 /* ExportHasLocal */)) {\r\n symbol = exportSymbol;\r\n }\r\n if (symbol.parent) {\r\n return isExternalModuleSymbol(symbol.parent) ? \"exports\" : getLocalNameForSymbol(getParentOfSymbol(symbol), node.parent);\r\n }\r\n }\r\n }\r\n function getExportAssignmentName(node) {\r\n var symbol = getExportAssignmentSymbol(getSymbolOfNode(node));\r\n return symbol && symbolIsValue(symbol) && !isConstEnumSymbol(symbol) ? symbolToString(symbol) : undefined;\r\n }\r\n function isTopLevelValueImportWithEntityName(node) {\r\n if (node.parent.kind !== 201 /* SourceFile */ || !ts.isInternalModuleImportDeclaration(node)) {\r\n // parent is not source file or it is not reference to internal module\r\n return false;\r\n }\r\n return isImportResolvedToValue(getSymbolOfNode(node));\r\n }\r\n function hasSemanticErrors(sourceFile) {\r\n // Return true if there is any semantic error in a file or globally\r\n return getDiagnostics(sourceFile).length > 0 || getGlobalDiagnostics().length > 0;\r\n }\r\n function isEmitBlocked(sourceFile) {\r\n return program.getDiagnostics(sourceFile).length !== 0 || hasEarlyErrors(sourceFile) || (compilerOptions.noEmitOnError && getDiagnostics(sourceFile).length !== 0);\r\n }\r\n function hasEarlyErrors(sourceFile) {\r\n return ts.forEach(getDiagnostics(sourceFile), function (d) { return d.isEarly; });\r\n }\r\n function isImportResolvedToValue(symbol) {\r\n var target = resolveImport(symbol);\r\n // const enums and modules that contain only const enums are not considered values from the emit perespective\r\n return target !== unknownSymbol && target.flags & 107455 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target);\r\n }\r\n function isConstEnumOrConstEnumOnlyModule(s) {\r\n return isConstEnumSymbol(s) || s.constEnumOnlyModule;\r\n }\r\n function isReferencedImportDeclaration(node) {\r\n var symbol = getSymbolOfNode(node);\r\n if (getSymbolLinks(symbol).referenced) {\r\n return true;\r\n }\r\n // logic below will answer 'true' for exported import declaration in a nested module that itself is not exported.\r\n // As a consequence this might cause emitting extra.\r\n if (node.flags & 1 /* Export */) {\r\n return isImportResolvedToValue(symbol);\r\n }\r\n return false;\r\n }\r\n function isImplementationOfOverload(node) {\r\n if (node.body) {\r\n var symbol = getSymbolOfNode(node);\r\n var signaturesOfSymbol = getSignaturesOfSymbol(symbol);\r\n // If this function body corresponds to function with multiple signature, it is implementation of overload\r\n // e.g.: function foo(a: string): string;\r\n // function foo(a: number): number;\r\n // function foo(a: any) { // This is implementation of the overloads\r\n // return a;\r\n // }\r\n return signaturesOfSymbol.length > 1 || (signaturesOfSymbol.length === 1 && signaturesOfSymbol[0].declaration !== node);\r\n }\r\n return false;\r\n }\r\n function getNodeCheckFlags(node) {\r\n return getNodeLinks(node).flags;\r\n }\r\n function getEnumMemberValue(node) {\r\n computeEnumMemberValues(node.parent);\r\n return getNodeLinks(node).enumMemberValue;\r\n }\r\n function getConstantValue(node) {\r\n var symbol = getNodeLinks(node).resolvedSymbol;\r\n if (symbol && (symbol.flags & 8 /* EnumMember */)) {\r\n var declaration = symbol.valueDeclaration;\r\n var constantValue;\r\n if (declaration.kind === 200 /* EnumMember */ && (constantValue = getNodeLinks(declaration).enumMemberValue) !== undefined) {\r\n return constantValue;\r\n }\r\n }\r\n return undefined;\r\n }\r\n function writeTypeOfDeclaration(declaration, enclosingDeclaration, flags, writer) {\r\n // Get type of the symbol if this is the valid symbol otherwise get type at location\r\n var symbol = getSymbolOfNode(declaration);\r\n var type = symbol && !(symbol.flags & (2048 /* TypeLiteral */ | 131072 /* CallSignature */ | 262144 /* ConstructSignature */)) ? getTypeOfSymbol(symbol) : unknownType;\r\n getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration, flags);\r\n }\r\n function writeReturnTypeOfSignatureDeclaration(signatureDeclaration, enclosingDeclaration, flags, writer) {\r\n var signature = getSignatureFromDeclaration(signatureDeclaration);\r\n getSymbolDisplayBuilder().buildTypeDisplay(getReturnTypeOfSignature(signature), writer, enclosingDeclaration, flags);\r\n }\r\n function createResolver() {\r\n return {\r\n getProgram: function () { return program; },\r\n getLocalNameOfContainer: getLocalNameOfContainer,\r\n getExpressionNamePrefix: getExpressionNamePrefix,\r\n getExportAssignmentName: getExportAssignmentName,\r\n isReferencedImportDeclaration: isReferencedImportDeclaration,\r\n getNodeCheckFlags: getNodeCheckFlags,\r\n getEnumMemberValue: getEnumMemberValue,\r\n isTopLevelValueImportWithEntityName: isTopLevelValueImportWithEntityName,\r\n hasSemanticErrors: hasSemanticErrors,\r\n isEmitBlocked: isEmitBlocked,\r\n isDeclarationVisible: isDeclarationVisible,\r\n isImplementationOfOverload: isImplementationOfOverload,\r\n writeTypeOfDeclaration: writeTypeOfDeclaration,\r\n writeReturnTypeOfSignatureDeclaration: writeReturnTypeOfSignatureDeclaration,\r\n isSymbolAccessible: isSymbolAccessible,\r\n isEntityNameVisible: isEntityNameVisible,\r\n getConstantValue: getConstantValue\r\n };\r\n }\r\n function invokeEmitter(targetSourceFile) {\r\n var resolver = createResolver();\r\n return ts.emitFiles(resolver, targetSourceFile);\r\n }\r\n function initializeTypeChecker() {\r\n // Bind all source files and propagate errors\r\n ts.forEach(program.getSourceFiles(), function (file) {\r\n ts.bindSourceFile(file);\r\n ts.forEach(file.semanticDiagnostics, addDiagnostic);\r\n });\r\n // Initialize global symbol table\r\n ts.forEach(program.getSourceFiles(), function (file) {\r\n if (!ts.isExternalModule(file)) {\r\n extendSymbolTable(globals, file.locals);\r\n }\r\n });\r\n // Initialize special symbols\r\n getSymbolLinks(undefinedSymbol).type = undefinedType;\r\n getSymbolLinks(argumentsSymbol).type = getGlobalType(\"IArguments\");\r\n getSymbolLinks(unknownSymbol).type = unknownType;\r\n globals[undefinedSymbol.name] = undefinedSymbol;\r\n // Initialize special types\r\n globalArraySymbol = getGlobalSymbol(\"Array\");\r\n globalArrayType = getTypeOfGlobalSymbol(globalArraySymbol, 1);\r\n globalObjectType = getGlobalType(\"Object\");\r\n globalFunctionType = getGlobalType(\"Function\");\r\n globalStringType = getGlobalType(\"String\");\r\n globalNumberType = getGlobalType(\"Number\");\r\n globalBooleanType = getGlobalType(\"Boolean\");\r\n globalRegExpType = getGlobalType(\"RegExp\");\r\n // If we're in ES6 mode, load the TemplateStringsArray.\r\n // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.\r\n globalTemplateStringsArrayType = compilerOptions.target >= 2 /* ES6 */ ? getGlobalType(\"TemplateStringsArray\") : unknownType;\r\n }\r\n initializeTypeChecker();\r\n return checker;\r\n }", "title": "" }, { "docid": "f8fce565368bc3308327bc0bdaa1b852", "score": "0.42195264", "text": "function SplitCode(cppPath)\r\n{\r\n\tvar fso = new ActiveXObject('Scripting.FileSystemObject');\r\n\tvar hPath = cppPath.replace(/.cpp$/, \".h\");\r\n\tif (!fso.FileExists(hPath))\r\n\t\treturn;\r\n\t\t\r\n\tvar cppFile = fso.GetFile(cppPath);\r\n\tvar hFile = fso.GetFile(hPath);\r\n\tvar tsh = hFile.OpenAsTextStream(1);\r\n\tvar hText = tsh.ReadAll();\r\n\ttsh.Close();\r\n\tvar tscpp = cppFile.OpenAsTextStream(8);\r\n\t\r\n\tvar ClassPattern = /^[ \\t]*class[ \\t]+(\\w+)[\\s\\S]+?(?:^[ \\t]*\\};$)/mg\r\n\tvar ClassInfo = hText.match(ClassPattern);\r\n\tvar numClass = ClassInfo.length;\r\n\tfor (nc = 0 ; nc < numClass; nc++)\r\n\t{\r\n\t\tvar ClassText = ClassInfo[nc];\r\n\t\tClassText.match(ClassPattern);\r\n\t\tvar ClassName = RegExp.$1;\r\n\t\t\r\n\t\tvar FnPattern = /(^(?:[ \\t]+\\w+)*[ \\t]+(\\w+)\\([^\\)]*\\))([\\s]*\\{([^\\}]*\\{[^\\}]*\\})*[^\\}]*\\}+?)/mg\r\n\t\tvar FnPatternIf = /(^(?:#if.+\\s+)*(?:[ \\t]+\\w+)*[ \\t]+(\\w+)\\([^\\)]*\\))([\\s]*\\{([^\\}]*\\{[^\\}]*\\})*[^\\}]*\\}+?(?:\\s+#e(?:ndif|lif|lse)[^\\r\\n]*)*)/mg\r\n\t\tvar FnInfo = ClassText.match(FnPatternIf);\r\n\t\tvar numFn = FnInfo.length;\r\n\t\tfor (n = 0 ; n < numFn; n++)\r\n\t\t{\r\n\t\t\tvar FnTextIf = FnInfo[n];\r\n\t\t\tvar FnTextIf = FnTextIf.match(FnPatternIf);\r\n\t\t\tvar FnDef = RegExp.$1;\r\n\t\t\tvar FnName = RegExp.$2;\r\n\t\t\tvar FnBody = RegExp.$3;\r\n\t\t\t\r\n\t\t\tvar FnFullName = ClassName + \"::\" + FnName;\r\n\t\t\tFnDef = FnDef.replace(FnName, FnFullName);\r\n\t\t\tFnDef = FnDef.replace(/^\\t(?:\\s*virtual\\s+)*/, \"\");\r\n\t\t\tFnBody = FnBody.replace(/^\\t/mg, \"\");\r\n\t\t\t\r\n\t\t\ttscpp.Write(FnDef);\r\n\t\t\ttscpp.Write(FnBody);\r\n\t\t\ttscpp.WriteBlankLines(2);\r\n\t\t\t\r\n\t\t\tvar FnText = FnTextIf.input.match(FnPattern);\r\n\t\t\tvar FnDecl = RegExp.$1 + \";\";\r\n\t\t\tClassText = ClassText.replace(FnText, FnDecl);\r\n\t\t}\r\n\t\thText = hText.replace(ClassInfo[nc], ClassText);\r\n\t}\r\n\ttscpp.Close();\r\n\ttsh = hFile.OpenAsTextStream(2);\r\n\ttsh.Write(hText);\r\n\ttsh.Close();\r\n}", "title": "" }, { "docid": "768b9881576d54975572fd7b0a18a4d5", "score": "0.42190105", "text": "function buildType(type) {\n switch (type.kind) {\n case _typeIntrospection.TypeKind.SCALAR:\n return buildScalarDef(type);\n case _typeIntrospection.TypeKind.OBJECT:\n return buildObjectDef(type);\n case _typeIntrospection.TypeKind.INTERFACE:\n return buildInterfaceDef(type);\n case _typeIntrospection.TypeKind.UNION:\n return buildUnionDef(type);\n case _typeIntrospection.TypeKind.ENUM:\n return buildEnumDef(type);\n case _typeIntrospection.TypeKind.INPUT_OBJECT:\n return buildInputObjectDef(type);\n default:\n throw new Error('Invalid or incomplete schema, unknown kind: ' + type.kind + '. Ensure ' + 'that a full introspection query is used in order to build a ' + 'client schema.');\n }\n }", "title": "" }, { "docid": "88e1630078f8e9a2e6b627be65a060cf", "score": "0.4218843", "text": "enterClassOrDeclType(ctx) {\n\t}", "title": "" }, { "docid": "2ffc08c2b100aaa28292afcc52df6764", "score": "0.42113325", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline '\n + 'crossinline dynamic final enum if else do while for when throw try catch finally '\n + 'import package is in fun override companion reified inline lateinit init '\n + 'interface annotation data sealed internal infix operator out by constructor super '\n + 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: { contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\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, { className: 'string' }),\n \"self\"\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 { contains: [ hljs.C_BLOCK_COMMENT_MODE ] }\n );\n const KOTLIN_PAREN_TYPE = { variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\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: [\n 'kt',\n 'kts'\n ],\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 begin: [\n /class|interface|trait/,\n /\\s+/,\n hljs.UNDERSCORE_IDENT_RE\n ],\n beginScope: {\n 3: \"title.class\"\n },\n keywords: 'class interface trait',\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n { beginKeywords: 'public protected internal private constructor' },\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: /[<\\(,){\\s]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "f7a0b973fc4deec3cdd3902010941837", "score": "0.4193467", "text": "function describe(typeName) {\n var clzT = Java.type(\"java.lang.Class\");\n\n var meths = clzT.forName(typeName).getMethods();\n \n if (typeof ctx.types[typeName] === \"undefined\")\n\tctx.types[typeName] = {};\n\n var p = {\"a\" : \"b\"}; // works\n var o = new java.lang.Object(); // doesn't work\n for (var i=0; i<meths.length; i++) {\n\tvar m = meths[i];\n\tvar mname = m.getName();\n\tif (typeof ctx.types[typeName][mname] === \"undefined\") {\n\t print(m); // try to debug what's going on\n\t ctx.types[typeName][mname] = [];\n\t print(ctx.types[typeName][mname]); // try to debug what's going on\n\t}\n\tctx.types[typeName][mname].push(m); // using p works, but o or m doesn't\n }\n\n return ctx.types[typeName];\n}", "title": "" }, { "docid": "485a3d68e44bb258a44dd7947b681785", "score": "0.41816223", "text": "function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker,symbol,sourceFile,enclosingDeclaration,location,semanticMeaning){if(semanticMeaning===void 0){semanticMeaning=ts.getMeaningFromLocation(location);}var displayParts=[];var documentation;var tags;var symbolFlags=symbol.flags;var symbolKind=getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker,symbol,location);var hasAddedSymbolInfo;var isThisExpression=location.kind===99/* ThisKeyword */&&ts.isExpression(location);var type;// Class at constructor site need to be shown as constructor apart from property,method, vars\nif(symbolKind!==ts.ScriptElementKind.unknown||symbolFlags&32/* Class */||symbolFlags&8388608/* Alias */){// If it is accessor they are allowed only if location is at name of the accessor\nif(symbolKind===ts.ScriptElementKind.memberGetAccessorElement||symbolKind===ts.ScriptElementKind.memberSetAccessorElement){symbolKind=ts.ScriptElementKind.memberVariableElement;}var signature=void 0;type=isThisExpression?typeChecker.getTypeAtLocation(location):typeChecker.getTypeOfSymbolAtLocation(symbol,location);if(type){if(location.parent&&location.parent.kind===179/* PropertyAccessExpression */){var right=location.parent.name;// Either the location is on the right of a property access, or on the left and the right is missing\nif(right===location||right&&right.getFullWidth()===0){location=location.parent;}}// try get the call/construct signature from the type if it matches\nvar callExpressionLike=void 0;if(location.kind===181/* CallExpression */||location.kind===182/* NewExpression */){callExpressionLike=location;}else if(ts.isCallExpressionTarget(location)||ts.isNewExpressionTarget(location)){callExpressionLike=location.parent;}else if(location.parent&&ts.isJsxOpeningLikeElement(location.parent)&&ts.isFunctionLike(symbol.valueDeclaration)){callExpressionLike=location.parent;}if(callExpressionLike){var candidateSignatures=[];signature=typeChecker.getResolvedSignature(callExpressionLike,candidateSignatures);if(!signature&&candidateSignatures.length){// Use the first candidate:\nsignature=candidateSignatures[0];}var useConstructSignatures=callExpressionLike.kind===182/* NewExpression */||ts.isCallExpression(callExpressionLike)&&callExpressionLike.expression.kind===97/* SuperKeyword */;var allSignatures=useConstructSignatures?type.getConstructSignatures():type.getCallSignatures();if(!ts.contains(allSignatures,signature.target)&&!ts.contains(allSignatures,signature)){// Get the first signature if there is one -- allSignatures may contain\n// either the original signature or its target, so check for either\nsignature=allSignatures.length?allSignatures[0]:undefined;}if(signature){if(useConstructSignatures&&symbolFlags&32/* Class */){// Constructor\nsymbolKind=ts.ScriptElementKind.constructorImplementationElement;addPrefixForAnyFunctionOrVar(type.symbol,symbolKind);}else if(symbolFlags&8388608/* Alias */){symbolKind=ts.ScriptElementKind.alias;pushTypePart(symbolKind);displayParts.push(ts.spacePart());if(useConstructSignatures){displayParts.push(ts.keywordPart(94/* NewKeyword */));displayParts.push(ts.spacePart());}addFullSymbolName(symbol);}else{addPrefixForAnyFunctionOrVar(symbol,symbolKind);}switch(symbolKind){case ts.ScriptElementKind.jsxAttribute:case ts.ScriptElementKind.memberVariableElement:case ts.ScriptElementKind.variableElement:case ts.ScriptElementKind.constElement:case ts.ScriptElementKind.letElement:case ts.ScriptElementKind.parameterElement:case ts.ScriptElementKind.localVariableElement:// If it is call or construct signature of lambda's write type name\ndisplayParts.push(ts.punctuationPart(56/* ColonToken */));displayParts.push(ts.spacePart());if(useConstructSignatures){displayParts.push(ts.keywordPart(94/* NewKeyword */));displayParts.push(ts.spacePart());}if(!(type.flags&32768/* Object */&&type.objectFlags&16/* Anonymous */)&&type.symbol){ts.addRange(displayParts,ts.symbolToDisplayParts(typeChecker,type.symbol,enclosingDeclaration,/*meaning*/undefined,1/* WriteTypeParametersOrArguments */));}addSignatureDisplayParts(signature,allSignatures,8/* WriteArrowStyleSignature */);break;default:// Just signature\naddSignatureDisplayParts(signature,allSignatures);}hasAddedSymbolInfo=true;}}else if(ts.isNameOfFunctionDeclaration(location)&&!(symbol.flags&98304/* Accessor */)||location.kind===123/* ConstructorKeyword */&&location.parent.kind===152/* Constructor */){// get the signature from the declaration and write it\nvar functionDeclaration=location.parent;var allSignatures=functionDeclaration.kind===152/* Constructor */?type.getNonNullableType().getConstructSignatures():type.getNonNullableType().getCallSignatures();if(!typeChecker.isImplementationOfOverload(functionDeclaration)){signature=typeChecker.getSignatureFromDeclaration(functionDeclaration);}else{signature=allSignatures[0];}if(functionDeclaration.kind===152/* Constructor */){// show (constructor) Type(...) signature\nsymbolKind=ts.ScriptElementKind.constructorImplementationElement;addPrefixForAnyFunctionOrVar(type.symbol,symbolKind);}else{// (function/method) symbol(..signature)\naddPrefixForAnyFunctionOrVar(functionDeclaration.kind===155/* CallSignature */&&!(type.symbol.flags&2048/* TypeLiteral */||type.symbol.flags&4096/* ObjectLiteral */)?type.symbol:symbol,symbolKind);}addSignatureDisplayParts(signature,allSignatures);hasAddedSymbolInfo=true;}}}if(symbolFlags&32/* Class */&&!hasAddedSymbolInfo&&!isThisExpression){if(ts.getDeclarationOfKind(symbol,199/* ClassExpression */)){// Special case for class expressions because we would like to indicate that\n// the class name is local to the class body (similar to function expression)\n// (local class) class <className>\npushTypePart(ts.ScriptElementKind.localClassElement);}else{// Class declaration has name which is not local.\ndisplayParts.push(ts.keywordPart(75/* ClassKeyword */));}displayParts.push(ts.spacePart());addFullSymbolName(symbol);writeTypeParametersOfSymbol(symbol,sourceFile);}if(symbolFlags&64/* Interface */&&semanticMeaning&2/* Type */){addNewLineIfDisplayPartsExist();displayParts.push(ts.keywordPart(109/* InterfaceKeyword */));displayParts.push(ts.spacePart());addFullSymbolName(symbol);writeTypeParametersOfSymbol(symbol,sourceFile);}if(symbolFlags&524288/* TypeAlias */){addNewLineIfDisplayPartsExist();displayParts.push(ts.keywordPart(138/* TypeKeyword */));displayParts.push(ts.spacePart());addFullSymbolName(symbol);writeTypeParametersOfSymbol(symbol,sourceFile);displayParts.push(ts.spacePart());displayParts.push(ts.operatorPart(58/* EqualsToken */));displayParts.push(ts.spacePart());ts.addRange(displayParts,ts.typeToDisplayParts(typeChecker,typeChecker.getDeclaredTypeOfSymbol(symbol),enclosingDeclaration,512/* InTypeAlias */));}if(symbolFlags&384/* Enum */){addNewLineIfDisplayPartsExist();if(ts.forEach(symbol.declarations,ts.isConstEnumDeclaration)){displayParts.push(ts.keywordPart(76/* ConstKeyword */));displayParts.push(ts.spacePart());}displayParts.push(ts.keywordPart(83/* EnumKeyword */));displayParts.push(ts.spacePart());addFullSymbolName(symbol);}if(symbolFlags&1536/* Module */){addNewLineIfDisplayPartsExist();var declaration=ts.getDeclarationOfKind(symbol,233/* ModuleDeclaration */);var isNamespace=declaration&&declaration.name&&declaration.name.kind===71/* Identifier */;displayParts.push(ts.keywordPart(isNamespace?129/* NamespaceKeyword */:128/* ModuleKeyword */));displayParts.push(ts.spacePart());addFullSymbolName(symbol);}if(symbolFlags&262144/* TypeParameter */&&semanticMeaning&2/* Type */){addNewLineIfDisplayPartsExist();displayParts.push(ts.punctuationPart(19/* OpenParenToken */));displayParts.push(ts.textPart(\"type parameter\"));displayParts.push(ts.punctuationPart(20/* CloseParenToken */));displayParts.push(ts.spacePart());addFullSymbolName(symbol);if(symbol.parent){// Class/Interface type parameter\naddInPrefix();addFullSymbolName(symbol.parent,enclosingDeclaration);writeTypeParametersOfSymbol(symbol.parent,enclosingDeclaration);}else{// Method/function type parameter\nvar declaration=ts.getDeclarationOfKind(symbol,145/* TypeParameter */);ts.Debug.assert(declaration!==undefined);declaration=declaration.parent;if(declaration){if(ts.isFunctionLikeKind(declaration.kind)){addInPrefix();var signature=typeChecker.getSignatureFromDeclaration(declaration);if(declaration.kind===156/* ConstructSignature */){displayParts.push(ts.keywordPart(94/* NewKeyword */));displayParts.push(ts.spacePart());}else if(declaration.kind!==155/* CallSignature */&&declaration.name){addFullSymbolName(declaration.symbol);}ts.addRange(displayParts,ts.signatureToDisplayParts(typeChecker,signature,sourceFile,32/* WriteTypeArgumentsOfSignature */));}else if(declaration.kind===231/* TypeAliasDeclaration */){// Type alias type parameter\n// For example\n// type list<T> = T[]; // Both T will go through same code path\naddInPrefix();displayParts.push(ts.keywordPart(138/* TypeKeyword */));displayParts.push(ts.spacePart());addFullSymbolName(declaration.symbol);writeTypeParametersOfSymbol(declaration.symbol,sourceFile);}}}}if(symbolFlags&8/* EnumMember */){symbolKind=ts.ScriptElementKind.enumMemberElement;addPrefixForAnyFunctionOrVar(symbol,\"enum member\");var declaration=symbol.declarations[0];if(declaration.kind===264/* EnumMember */){var constantValue=typeChecker.getConstantValue(declaration);if(constantValue!==undefined){displayParts.push(ts.spacePart());displayParts.push(ts.operatorPart(58/* EqualsToken */));displayParts.push(ts.spacePart());displayParts.push(ts.displayPart(constantValue.toString(),ts.SymbolDisplayPartKind.numericLiteral));}}}if(symbolFlags&8388608/* Alias */){addNewLineIfDisplayPartsExist();if(symbol.declarations[0].kind===236/* NamespaceExportDeclaration */){displayParts.push(ts.keywordPart(84/* ExportKeyword */));displayParts.push(ts.spacePart());displayParts.push(ts.keywordPart(129/* NamespaceKeyword */));}else{displayParts.push(ts.keywordPart(91/* ImportKeyword */));}displayParts.push(ts.spacePart());addFullSymbolName(symbol);ts.forEach(symbol.declarations,function(declaration){if(declaration.kind===237/* ImportEqualsDeclaration */){var importEqualsDeclaration=declaration;if(ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)){displayParts.push(ts.spacePart());displayParts.push(ts.operatorPart(58/* EqualsToken */));displayParts.push(ts.spacePart());displayParts.push(ts.keywordPart(132/* RequireKeyword */));displayParts.push(ts.punctuationPart(19/* OpenParenToken */));displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)),ts.SymbolDisplayPartKind.stringLiteral));displayParts.push(ts.punctuationPart(20/* CloseParenToken */));}else{var internalAliasSymbol=typeChecker.getSymbolAtLocation(importEqualsDeclaration.moduleReference);if(internalAliasSymbol){displayParts.push(ts.spacePart());displayParts.push(ts.operatorPart(58/* EqualsToken */));displayParts.push(ts.spacePart());addFullSymbolName(internalAliasSymbol,enclosingDeclaration);}}return true;}});}if(!hasAddedSymbolInfo){if(symbolKind!==ts.ScriptElementKind.unknown){if(type){if(isThisExpression){addNewLineIfDisplayPartsExist();displayParts.push(ts.keywordPart(99/* ThisKeyword */));}else{addPrefixForAnyFunctionOrVar(symbol,symbolKind);}// For properties, variables and local vars: show the type\nif(symbolKind===ts.ScriptElementKind.memberVariableElement||symbolKind===ts.ScriptElementKind.jsxAttribute||symbolFlags&3/* Variable */||symbolKind===ts.ScriptElementKind.localVariableElement||isThisExpression){displayParts.push(ts.punctuationPart(56/* ColonToken */));displayParts.push(ts.spacePart());// If the type is type parameter, format it specially\nif(type.symbol&&type.symbol.flags&262144/* TypeParameter */){var typeParameterParts=ts.mapToDisplayParts(function(writer){typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplay(type,writer,enclosingDeclaration);});ts.addRange(displayParts,typeParameterParts);}else{ts.addRange(displayParts,ts.typeToDisplayParts(typeChecker,type,enclosingDeclaration));}}else if(symbolFlags&16/* Function */||symbolFlags&8192/* Method */||symbolFlags&16384/* Constructor */||symbolFlags&131072/* Signature */||symbolFlags&98304/* Accessor */||symbolKind===ts.ScriptElementKind.memberFunctionElement){var allSignatures=type.getNonNullableType().getCallSignatures();addSignatureDisplayParts(allSignatures[0],allSignatures);}}}else{symbolKind=getSymbolKind(typeChecker,symbol,location);}}if(!documentation){documentation=symbol.getDocumentationComment();tags=symbol.getJsDocTags();if(documentation.length===0&&symbol.flags&4/* Property */){// For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo`\n// there documentation comments might be attached to the right hand side symbol of their declarations.\n// The pattern of such special property access is that the parent symbol is the symbol of the file.\nif(symbol.parent&&ts.forEach(symbol.parent.declarations,function(declaration){return declaration.kind===265/* SourceFile */;})){for(var _i=0,_a=symbol.declarations;_i<_a.length;_i++){var declaration=_a[_i];if(!declaration.parent||declaration.parent.kind!==194/* BinaryExpression */){continue;}var rhsSymbol=typeChecker.getSymbolAtLocation(declaration.parent.right);if(!rhsSymbol){continue;}documentation=rhsSymbol.getDocumentationComment();tags=rhsSymbol.getJsDocTags();if(documentation.length>0){break;}}}}}return{displayParts:displayParts,documentation:documentation,symbolKind:symbolKind,tags:tags};function addNewLineIfDisplayPartsExist(){if(displayParts.length){displayParts.push(ts.lineBreakPart());}}function addInPrefix(){displayParts.push(ts.spacePart());displayParts.push(ts.keywordPart(92/* InKeyword */));displayParts.push(ts.spacePart());}function addFullSymbolName(symbol,enclosingDeclaration){var fullSymbolDisplayParts=ts.symbolToDisplayParts(typeChecker,symbol,enclosingDeclaration||sourceFile,/*meaning*/undefined,1/* WriteTypeParametersOrArguments */|2/* UseOnlyExternalAliasing */);ts.addRange(displayParts,fullSymbolDisplayParts);}function addPrefixForAnyFunctionOrVar(symbol,symbolKind){addNewLineIfDisplayPartsExist();if(symbolKind){pushTypePart(symbolKind);displayParts.push(ts.spacePart());addFullSymbolName(symbol);}}function pushTypePart(symbolKind){switch(symbolKind){case ts.ScriptElementKind.variableElement:case ts.ScriptElementKind.functionElement:case ts.ScriptElementKind.letElement:case ts.ScriptElementKind.constElement:case ts.ScriptElementKind.constructorImplementationElement:displayParts.push(ts.textOrKeywordPart(symbolKind));return;default:displayParts.push(ts.punctuationPart(19/* OpenParenToken */));displayParts.push(ts.textOrKeywordPart(symbolKind));displayParts.push(ts.punctuationPart(20/* CloseParenToken */));return;}}function addSignatureDisplayParts(signature,allSignatures,flags){ts.addRange(displayParts,ts.signatureToDisplayParts(typeChecker,signature,enclosingDeclaration,flags|32/* WriteTypeArgumentsOfSignature */));if(allSignatures.length>1){displayParts.push(ts.spacePart());displayParts.push(ts.punctuationPart(19/* OpenParenToken */));displayParts.push(ts.operatorPart(37/* PlusToken */));displayParts.push(ts.displayPart((allSignatures.length-1).toString(),ts.SymbolDisplayPartKind.numericLiteral));displayParts.push(ts.spacePart());displayParts.push(ts.textPart(allSignatures.length===2?\"overload\":\"overloads\"));displayParts.push(ts.punctuationPart(20/* CloseParenToken */));}documentation=signature.getDocumentationComment();tags=signature.getJsDocTags();}function writeTypeParametersOfSymbol(symbol,enclosingDeclaration){var typeParameterParts=ts.mapToDisplayParts(function(writer){typeChecker.getSymbolDisplayBuilder().buildTypeParameterDisplayFromSymbol(symbol,writer,enclosingDeclaration);});ts.addRange(displayParts,typeParameterParts);}}", "title": "" }, { "docid": "7bda11f3b7978f9ed6123a0c31540cdc", "score": "0.41738462", "text": "translate (factoryDefinition) {\n _.forEach(factoryDefinition, (store, storeType) => {\n switch (storeType) {\n case 'backing':\n this.definition.backing.merge(store)\n break\n\n case 'functions':\n case 'context':\n _.assign(this.definition[storeType], store)\n break\n\n case 'types':\n _.forEach(store, (typeDef, typeName) => {\n if (typeName.match(/^@/)) return true\n this.definition.addKind(\n Kind.OBJECT_TYPE_DEFINITION,\n _.get(typeDef, 'name', typeName),\n this._type(typeDef, typeName)\n )\n })\n break\n\n case 'schemas':\n _.forEach(store, (schemaDef, schemaName) => {\n if (schemaName.match(/^@/)) return true\n this.definition.addKind(\n Kind.SCHEMA_DEFINITION,\n _.get(schemaDef, 'name', schemaName),\n new Schema(schemaDef, schemaName)\n )\n })\n break\n\n case 'directives':\n _.forEach(store, (directiveDef, directiveName) => {\n this.definition.addKind(\n Kind.DIRECTIVE_DEFINITION,\n _.get(directiveDef, 'name', directiveName),\n this._Directive(directiveDef, directiveName)\n )\n })\n break\n\n default:\n break\n }\n })\n\n return this.definition\n }", "title": "" }, { "docid": "80d14f0149559a974e5997f8d53d27d6", "score": "0.41697514", "text": "function swift(hljs) {\n var SWIFT_KEYWORDS = {\n // override the pattern since the default of of /\\w+/ is not sufficient to\n // capture the keywords that start with the character \"#\"\n $pattern: /[\\w#]+/,\n keyword: '#available #colorLiteral #column #else #elseif #endif #file ' +\n '#fileLiteral #function #if #imageLiteral #line #selector #sourceLocation ' +\n '_ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype ' +\n 'associativity break case catch class continue convenience default defer deinit didSet do ' +\n 'dynamic dynamicType else enum extension fallthrough false fileprivate final for func ' +\n 'get guard if import in indirect infix init inout internal is lazy left let ' +\n 'mutating nil none nonmutating open operator optional override postfix precedence ' +\n 'prefix private protocol Protocol public repeat required rethrows return ' +\n 'right self Self set some static struct subscript super switch throw throws true ' +\n 'try try! try? Type typealias unowned var weak where while willSet',\n literal: 'true false nil',\n built_in: 'abs advance alignof alignofValue anyGenerator assert assertionFailure ' +\n 'bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC ' +\n 'bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros ' +\n 'debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords ' +\n 'enumerate equal fatalError filter find getBridgedObjectiveCType getVaList ' +\n 'indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC ' +\n 'isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare ' +\n 'map max maxElement min minElement numericCast overlaps partition posix ' +\n 'precondition preconditionFailure print println quickSort readLine reduce reflect ' +\n 'reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split ' +\n 'startsWith stride strideof strideofValue swap toString transcode ' +\n 'underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap ' +\n 'unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer ' +\n 'withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers ' +\n 'withUnsafePointer withUnsafePointers withVaList zip'\n };\n\n var TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*',\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: 'type',\n begin: '\\\\b[A-Z][\\\\w\\u00C0-\\u02B8\\']*[!?]'\n };\n var BLOCK_COMMENT = hljs.COMMENT(\n '/\\\\*',\n '\\\\*/',\n {\n contains: ['self']\n }\n );\n var SUBST = {\n className: 'subst',\n begin: /\\\\\\(/, end: '\\\\)',\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /\"\"\"/, end: /\"\"\"/},\n {begin: /\"/, end: /\"/},\n ]\n };\n\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_numeric-literal\n // TODO: Update for leading `-` after lookbehind is supported everywhere\n var decimalDigits = '([0-9]_*)+';\n var hexDigits = '([0-9a-fA-F]_*)+';\n var NUMBER = {\n className: 'number',\n relevance: 0,\n variants: [\n // decimal floating-point-literal (subsumes decimal-literal)\n { begin: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` +\n `([eE][+-]?(${decimalDigits}))?\\\\b` },\n\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n { begin: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` +\n `([pP][+-]?(${decimalDigits}))?\\\\b` },\n\n // octal-literal\n { begin: /\\b0o([0-7]_*)+\\b/ },\n\n // binary-literal\n { begin: /\\b0b([01]_*)+\\b/ },\n ]\n };\n SUBST.contains = [NUMBER];\n\n return {\n name: 'Swift',\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBER,\n {\n className: 'function',\n beginKeywords: 'func', end: /\\{/, excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</, end: />/\n },\n {\n className: 'params',\n begin: /\\(/, end: /\\)/, endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n 'self',\n NUMBER,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {begin: ':'} // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: 'class',\n beginKeywords: 'struct protocol class extension enum',\n keywords: SWIFT_KEYWORDS,\n end: '\\\\{',\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/})\n ]\n },\n {\n className: 'meta', // @attributes\n begin: '(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|' +\n '@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|' +\n '@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|' +\n '@infix|@prefix|@postfix|@autoclosure|@testable|@available|' +\n '@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|' +\n '@propertyWrapper|@main)\\\\b'\n\n },\n {\n beginKeywords: 'import', end: /$/,\n contains: [hljs.C_LINE_COMMENT_MODE, BLOCK_COMMENT],\n relevance: 0\n }\n ]\n };\n}", "title": "" }, { "docid": "4ae38f926ad90cf2821fbb3981680b17", "score": "0.41648978", "text": "function scheme(hljs) {\n const SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n const SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n const SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n const KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n 'builtin-name':\n 'case-lambda call/cc class define-class exit-handler field import ' +\n 'inherit init-field interface let*-values let-values let/ec mixin ' +\n 'opt-lambda override protect provide public rename require ' +\n 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +\n 'when with-syntax and begin call-with-current-continuation ' +\n 'call-with-input-file call-with-output-file case cond define ' +\n 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +\n 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' +\n '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +\n 'boolean? caar cadr call-with-input-file call-with-output-file ' +\n 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +\n 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +\n 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +\n 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +\n 'char? close-input-port close-output-port complex? cons cos ' +\n 'current-input-port current-output-port denominator display eof-object? ' +\n 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +\n 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +\n 'integer? interaction-environment lcm length list list->string ' +\n 'list->vector list-ref list-tail list? load log magnitude make-polar ' +\n 'make-rectangular make-string make-vector max member memq memv min ' +\n 'modulo negative? newline not null-environment null? number->string ' +\n 'number? numerator odd? open-input-file open-output-file output-port? ' +\n 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +\n 'rational? rationalize read read-char real-part real? remainder reverse ' +\n 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +\n 'string->list string->number string->symbol string-append string-ci<=? ' +\n 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +\n 'string-fill! string-length string-ref string-set! string<=? string<? ' +\n 'string=? string>=? string>? string? substring symbol->string symbol? ' +\n 'tan transcript-off transcript-on truncate values vector ' +\n 'vector->list vector-fill! vector-length vector-ref vector-set! ' +\n 'with-input-from-file with-output-to-file write write-char zero?'\n };\n\n const LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n\n const NUMBER = {\n className: 'number',\n variants: [\n {\n begin: SCHEME_SIMPLE_NUMBER_RE,\n relevance: 0\n },\n {\n begin: SCHEME_COMPLEX_NUMBER_RE,\n relevance: 0\n },\n {\n begin: '#b[0-1]+(/[0-1]+)?'\n },\n {\n begin: '#o[0-7]+(/[0-7]+)?'\n },\n {\n begin: '#x[0-9a-f]+(/[0-9a-f]+)?'\n }\n ]\n };\n\n const STRING = hljs.QUOTE_STRING_MODE;\n\n const COMMENT_MODES = [\n hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n ),\n hljs.COMMENT('#\\\\|', '\\\\|#')\n ];\n\n const IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n\n const QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n\n const QUOTED_LIST = {\n variants: [\n {\n begin: /'/\n },\n {\n begin: '`'\n }\n ],\n contains: [\n {\n begin: '\\\\(',\n end: '\\\\)',\n contains: [\n 'self',\n LITERAL,\n STRING,\n NUMBER,\n IDENT,\n QUOTED_IDENT\n ]\n }\n ]\n };\n\n const NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n\n const LAMBDA = {\n begin: /lambda/,\n endsWithParent: true,\n returnBegin: true,\n contains: [\n NAME,\n {\n endsParent: true,\n variants: [\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n }\n ],\n contains: [ IDENT ]\n }\n ]\n };\n\n const LIST = {\n variants: [\n {\n begin: '\\\\(',\n end: '\\\\)'\n },\n {\n begin: '\\\\[',\n end: '\\\\]'\n }\n ],\n contains: [\n LAMBDA,\n NAME,\n BODY\n ]\n };\n\n BODY.contains = [\n LITERAL,\n NUMBER,\n STRING,\n IDENT,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES);\n\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [\n hljs.SHEBANG(),\n NUMBER,\n STRING,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES)\n };\n}", "title": "" }, { "docid": "4ae38f926ad90cf2821fbb3981680b17", "score": "0.41648978", "text": "function scheme(hljs) {\n const SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n const SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n const SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n const KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n 'builtin-name':\n 'case-lambda call/cc class define-class exit-handler field import ' +\n 'inherit init-field interface let*-values let-values let/ec mixin ' +\n 'opt-lambda override protect provide public rename require ' +\n 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +\n 'when with-syntax and begin call-with-current-continuation ' +\n 'call-with-input-file call-with-output-file case cond define ' +\n 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +\n 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' +\n '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +\n 'boolean? caar cadr call-with-input-file call-with-output-file ' +\n 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +\n 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +\n 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +\n 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +\n 'char? close-input-port close-output-port complex? cons cos ' +\n 'current-input-port current-output-port denominator display eof-object? ' +\n 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +\n 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +\n 'integer? interaction-environment lcm length list list->string ' +\n 'list->vector list-ref list-tail list? load log magnitude make-polar ' +\n 'make-rectangular make-string make-vector max member memq memv min ' +\n 'modulo negative? newline not null-environment null? number->string ' +\n 'number? numerator odd? open-input-file open-output-file output-port? ' +\n 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +\n 'rational? rationalize read read-char real-part real? remainder reverse ' +\n 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +\n 'string->list string->number string->symbol string-append string-ci<=? ' +\n 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +\n 'string-fill! string-length string-ref string-set! string<=? string<? ' +\n 'string=? string>=? string>? string? substring symbol->string symbol? ' +\n 'tan transcript-off transcript-on truncate values vector ' +\n 'vector->list vector-fill! vector-length vector-ref vector-set! ' +\n 'with-input-from-file with-output-to-file write write-char zero?'\n };\n\n const LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n\n const NUMBER = {\n className: 'number',\n variants: [\n {\n begin: SCHEME_SIMPLE_NUMBER_RE,\n relevance: 0\n },\n {\n begin: SCHEME_COMPLEX_NUMBER_RE,\n relevance: 0\n },\n {\n begin: '#b[0-1]+(/[0-1]+)?'\n },\n {\n begin: '#o[0-7]+(/[0-7]+)?'\n },\n {\n begin: '#x[0-9a-f]+(/[0-9a-f]+)?'\n }\n ]\n };\n\n const STRING = hljs.QUOTE_STRING_MODE;\n\n const COMMENT_MODES = [\n hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n ),\n hljs.COMMENT('#\\\\|', '\\\\|#')\n ];\n\n const IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n\n const QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n\n const QUOTED_LIST = {\n variants: [\n {\n begin: /'/\n },\n {\n begin: '`'\n }\n ],\n contains: [\n {\n begin: '\\\\(',\n end: '\\\\)',\n contains: [\n 'self',\n LITERAL,\n STRING,\n NUMBER,\n IDENT,\n QUOTED_IDENT\n ]\n }\n ]\n };\n\n const NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n\n const LAMBDA = {\n begin: /lambda/,\n endsWithParent: true,\n returnBegin: true,\n contains: [\n NAME,\n {\n endsParent: true,\n variants: [\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n }\n ],\n contains: [ IDENT ]\n }\n ]\n };\n\n const LIST = {\n variants: [\n {\n begin: '\\\\(',\n end: '\\\\)'\n },\n {\n begin: '\\\\[',\n end: '\\\\]'\n }\n ],\n contains: [\n LAMBDA,\n NAME,\n BODY\n ]\n };\n\n BODY.contains = [\n LITERAL,\n NUMBER,\n STRING,\n IDENT,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES);\n\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [\n hljs.SHEBANG(),\n NUMBER,\n STRING,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES)\n };\n}", "title": "" }, { "docid": "4ae38f926ad90cf2821fbb3981680b17", "score": "0.41648978", "text": "function scheme(hljs) {\n const SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n const SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n const SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n const KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n 'builtin-name':\n 'case-lambda call/cc class define-class exit-handler field import ' +\n 'inherit init-field interface let*-values let-values let/ec mixin ' +\n 'opt-lambda override protect provide public rename require ' +\n 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +\n 'when with-syntax and begin call-with-current-continuation ' +\n 'call-with-input-file call-with-output-file case cond define ' +\n 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +\n 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' +\n '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +\n 'boolean? caar cadr call-with-input-file call-with-output-file ' +\n 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +\n 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +\n 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +\n 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +\n 'char? close-input-port close-output-port complex? cons cos ' +\n 'current-input-port current-output-port denominator display eof-object? ' +\n 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +\n 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +\n 'integer? interaction-environment lcm length list list->string ' +\n 'list->vector list-ref list-tail list? load log magnitude make-polar ' +\n 'make-rectangular make-string make-vector max member memq memv min ' +\n 'modulo negative? newline not null-environment null? number->string ' +\n 'number? numerator odd? open-input-file open-output-file output-port? ' +\n 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +\n 'rational? rationalize read read-char real-part real? remainder reverse ' +\n 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +\n 'string->list string->number string->symbol string-append string-ci<=? ' +\n 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +\n 'string-fill! string-length string-ref string-set! string<=? string<? ' +\n 'string=? string>=? string>? string? substring symbol->string symbol? ' +\n 'tan transcript-off transcript-on truncate values vector ' +\n 'vector->list vector-fill! vector-length vector-ref vector-set! ' +\n 'with-input-from-file with-output-to-file write write-char zero?'\n };\n\n const LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n\n const NUMBER = {\n className: 'number',\n variants: [\n {\n begin: SCHEME_SIMPLE_NUMBER_RE,\n relevance: 0\n },\n {\n begin: SCHEME_COMPLEX_NUMBER_RE,\n relevance: 0\n },\n {\n begin: '#b[0-1]+(/[0-1]+)?'\n },\n {\n begin: '#o[0-7]+(/[0-7]+)?'\n },\n {\n begin: '#x[0-9a-f]+(/[0-9a-f]+)?'\n }\n ]\n };\n\n const STRING = hljs.QUOTE_STRING_MODE;\n\n const COMMENT_MODES = [\n hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n ),\n hljs.COMMENT('#\\\\|', '\\\\|#')\n ];\n\n const IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n\n const QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n\n const QUOTED_LIST = {\n variants: [\n {\n begin: /'/\n },\n {\n begin: '`'\n }\n ],\n contains: [\n {\n begin: '\\\\(',\n end: '\\\\)',\n contains: [\n 'self',\n LITERAL,\n STRING,\n NUMBER,\n IDENT,\n QUOTED_IDENT\n ]\n }\n ]\n };\n\n const NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n\n const LAMBDA = {\n begin: /lambda/,\n endsWithParent: true,\n returnBegin: true,\n contains: [\n NAME,\n {\n endsParent: true,\n variants: [\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n }\n ],\n contains: [ IDENT ]\n }\n ]\n };\n\n const LIST = {\n variants: [\n {\n begin: '\\\\(',\n end: '\\\\)'\n },\n {\n begin: '\\\\[',\n end: '\\\\]'\n }\n ],\n contains: [\n LAMBDA,\n NAME,\n BODY\n ]\n };\n\n BODY.contains = [\n LITERAL,\n NUMBER,\n STRING,\n IDENT,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES);\n\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [\n hljs.SHEBANG(),\n NUMBER,\n STRING,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES)\n };\n}", "title": "" }, { "docid": "4ae38f926ad90cf2821fbb3981680b17", "score": "0.41648978", "text": "function scheme(hljs) {\n const SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n const SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n const SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n const KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n 'builtin-name':\n 'case-lambda call/cc class define-class exit-handler field import ' +\n 'inherit init-field interface let*-values let-values let/ec mixin ' +\n 'opt-lambda override protect provide public rename require ' +\n 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +\n 'when with-syntax and begin call-with-current-continuation ' +\n 'call-with-input-file call-with-output-file case cond define ' +\n 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +\n 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' +\n '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +\n 'boolean? caar cadr call-with-input-file call-with-output-file ' +\n 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +\n 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +\n 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +\n 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +\n 'char? close-input-port close-output-port complex? cons cos ' +\n 'current-input-port current-output-port denominator display eof-object? ' +\n 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +\n 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +\n 'integer? interaction-environment lcm length list list->string ' +\n 'list->vector list-ref list-tail list? load log magnitude make-polar ' +\n 'make-rectangular make-string make-vector max member memq memv min ' +\n 'modulo negative? newline not null-environment null? number->string ' +\n 'number? numerator odd? open-input-file open-output-file output-port? ' +\n 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +\n 'rational? rationalize read read-char real-part real? remainder reverse ' +\n 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +\n 'string->list string->number string->symbol string-append string-ci<=? ' +\n 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +\n 'string-fill! string-length string-ref string-set! string<=? string<? ' +\n 'string=? string>=? string>? string? substring symbol->string symbol? ' +\n 'tan transcript-off transcript-on truncate values vector ' +\n 'vector->list vector-fill! vector-length vector-ref vector-set! ' +\n 'with-input-from-file with-output-to-file write write-char zero?'\n };\n\n const LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n\n const NUMBER = {\n className: 'number',\n variants: [\n {\n begin: SCHEME_SIMPLE_NUMBER_RE,\n relevance: 0\n },\n {\n begin: SCHEME_COMPLEX_NUMBER_RE,\n relevance: 0\n },\n {\n begin: '#b[0-1]+(/[0-1]+)?'\n },\n {\n begin: '#o[0-7]+(/[0-7]+)?'\n },\n {\n begin: '#x[0-9a-f]+(/[0-9a-f]+)?'\n }\n ]\n };\n\n const STRING = hljs.QUOTE_STRING_MODE;\n\n const COMMENT_MODES = [\n hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n ),\n hljs.COMMENT('#\\\\|', '\\\\|#')\n ];\n\n const IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n\n const QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n\n const QUOTED_LIST = {\n variants: [\n {\n begin: /'/\n },\n {\n begin: '`'\n }\n ],\n contains: [\n {\n begin: '\\\\(',\n end: '\\\\)',\n contains: [\n 'self',\n LITERAL,\n STRING,\n NUMBER,\n IDENT,\n QUOTED_IDENT\n ]\n }\n ]\n };\n\n const NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n\n const LAMBDA = {\n begin: /lambda/,\n endsWithParent: true,\n returnBegin: true,\n contains: [\n NAME,\n {\n endsParent: true,\n variants: [\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n }\n ],\n contains: [ IDENT ]\n }\n ]\n };\n\n const LIST = {\n variants: [\n {\n begin: '\\\\(',\n end: '\\\\)'\n },\n {\n begin: '\\\\[',\n end: '\\\\]'\n }\n ],\n contains: [\n LAMBDA,\n NAME,\n BODY\n ]\n };\n\n BODY.contains = [\n LITERAL,\n NUMBER,\n STRING,\n IDENT,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES);\n\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [\n hljs.SHEBANG(),\n NUMBER,\n STRING,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES)\n };\n}", "title": "" }, { "docid": "c573bf2d5e3e17d8f07248a32eb80480", "score": "0.4153491", "text": "showDefinition() {\n const self = this;\n this.clangExpand({\n definition: true\n }, result => self.show(result.definition));\n }", "title": "" }, { "docid": "ffa8b2a167b8bea1cc127656aff7ee52", "score": "0.415267", "text": "__getDefinitions() {\n this.definitions = [];\n this.__setLoading(true);\n const dict = this.__getDictionary(this.__curDict)\n dict.getDefinitions(this.__word).then(defs=>{\n this.definitions = defs;\n this.__setLoading(false);\n });\n }", "title": "" }, { "docid": "33cd2bcfe742264ff1c70663ab518295", "score": "0.41523698", "text": "function xmlUnderlyingType(statement,outTs) {\n statement = normaliseStatement(statement);\n\n// PH: Add aggregate for function parameters\n var reg = /\\bSET\\b|\\bBAG\\b|\\bLIST\\b|\\bARRAY\\b|\\bAGGREGATE\\b/i;\n var agg = statement.match(reg);\n \n if (agg) {\n \tagg = agg.toString();\n agg = agg.toUpperCase();\n\tvar opos = statement.search(/\\[/);\n\tvar cpos = statement.search(/\\]/);\n\tvar bounds = null;\n\tvar lower = \"\";\n\tvar upper = \"\";\n\tif (opos != -1) {\n\t bounds = statement.substr(opos+1, cpos-opos-1);\n\t bounds = bounds.replace(/\\s/g,\"\");\n\t lower = bounds.match(/.*\\:/);\n\t lower = lower[0].replace(/\\:/,\"\");\n\t upper = bounds.match(/\\:.*/);\n\t upper = upper[0].replace(/\\:/,\"\");\n\t}\n\t\n\tvar pos = statement.search(/\\bOF\\b/i);\n\tvar rest = statement.substr(pos+3);\n\tvar unique = null;\n\tvar optional = null;\n\treg = /\\bOPTIONAL\\b/i;\n\t\n\tif (rest.match(reg)) {\n\t optional=\"YES\";\n\t rest = rest.replace(reg,\"\");\n\t}\n\t\n\treg = /\\bUNIQUE\\b/i;\n\t\n\tif (rest.match(reg)) {\n\t unique=\"YES\";\n\t rest = rest.replace(reg,\"\");\n\t}\n\t\n\tvar typename = getWord(1,rest);\n//thx added\n\treg = /\\:/i;\n\n\tif(rest.match(reg)){\n\t\tvar typelabel = getAfterColon(rest);\n\t}\n\txmlOpenElement(\"<aggregate\",outTs);\n\txmlAttr(\"type\",agg,outTs);\n\t\n\tif (bounds) {\n\t xmlAttr(\"lower\",lower,outTs);\n\t xmlAttr(\"upper\",upper,outTs);\n\t}\n\n\tif (optional) xmlAttr(\"optional\",optional,outTs);\n\t\n\tif (unique) xmlAttr(\"unique\",unique,outTs);\n\n\txmlCloseAttr(outTs); \n\n // PH: GENERIC_ENTITY\n\treg = /\\bBINARY\\b|\\bBOOLEAN\\b|\\bGENERIC_ENTITY\\b|\\bGENERIC\\b|\\bINTEGER\\b|\\bLOGICAL\\b|\\bNUMBER\\b|\\bREAL\\b|\\bSTRING\\b/i;\n\tvar aggtype = statement.match(reg);\n\t\n\tif (aggtype) {\n\t aggtype = aggtype.toString();\n\t aggtype = aggtype.toUpperCase();\n\t xmlOpenElement(\"<builtintype\",outTs);\n\t xmlAttr(\"type\",aggtype,outTs);\n\t if (typelabel){\n\t \txmlAttr(\"typelabel\",typelabel,outTs);\n\t }\n\t xmlCloseAttr(outTs);\n\t}\n\telse {\n\t xmlOpenElement(\"<typename\",outTs);\n\t xmlAttr(\"name\",typename,outTs);\n\t xmlCloseAttr(outTs);\n\t}\n\treturn;\n }\n\n reg = /\\bBINARY\\b|\\bBOOLEAN\\b|\\bGENERIC_ENTITY\\b|GENERIC\\b|\\bINTEGER\\b|\\bLOGICAL\\b|\\bNUMBER\\b|\\bREAL\\b|\\bSTRING\\b/i;\n var type = statement.match(reg);\n\n if (type) {\n \ttype = type.toString();\n \ttype = type.toUpperCase();\n\txmlOpenElement(\"<builtintype\",outTs);\n\txmlAttr(\"type\",type,outTs);\n\t if (typelabel){\n\t \txmlAttr(\"typelabel\",typelabel,outTs);\n\t }\n\txmlCloseAttr(outTs);\n\treturn;\n }\n \n xmlOpenElement(\"<typename\",outTs);\n statement = trim(statement);\n xmlAttr(\"name\",statement,outTs);\n xmlCloseAttr(outTs);\n}", "title": "" }, { "docid": "e2ac3ff4f2d5d1ad172c8174e2cd9d50", "score": "0.4151561", "text": "function scheme(hljs) {\n const SCHEME_IDENT_RE = '[^\\\\(\\\\)\\\\[\\\\]\\\\{\\\\}\",\\'`;#|\\\\\\\\\\\\s]+';\n const SCHEME_SIMPLE_NUMBER_RE = '(-|\\\\+)?\\\\d+([./]\\\\d+)?';\n const SCHEME_COMPLEX_NUMBER_RE = SCHEME_SIMPLE_NUMBER_RE + '[+\\\\-]' + SCHEME_SIMPLE_NUMBER_RE + 'i';\n const KEYWORDS = {\n $pattern: SCHEME_IDENT_RE,\n built_in:\n 'case-lambda call/cc class define-class exit-handler field import ' +\n 'inherit init-field interface let*-values let-values let/ec mixin ' +\n 'opt-lambda override protect provide public rename require ' +\n 'require-for-syntax syntax syntax-case syntax-error unit/sig unless ' +\n 'when with-syntax and begin call-with-current-continuation ' +\n 'call-with-input-file call-with-output-file case cond define ' +\n 'define-syntax delay do dynamic-wind else for-each if lambda let let* ' +\n 'let-syntax letrec letrec-syntax map or syntax-rules \\' * + , ,@ - ... / ' +\n '; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan ' +\n 'boolean? caar cadr call-with-input-file call-with-output-file ' +\n 'call-with-values car cdddar cddddr cdr ceiling char->integer ' +\n 'char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? ' +\n 'char-downcase char-lower-case? char-numeric? char-ready? char-upcase ' +\n 'char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? ' +\n 'char? close-input-port close-output-port complex? cons cos ' +\n 'current-input-port current-output-port denominator display eof-object? ' +\n 'eq? equal? eqv? eval even? exact->inexact exact? exp expt floor ' +\n 'force gcd imag-part inexact->exact inexact? input-port? integer->char ' +\n 'integer? interaction-environment lcm length list list->string ' +\n 'list->vector list-ref list-tail list? load log magnitude make-polar ' +\n 'make-rectangular make-string make-vector max member memq memv min ' +\n 'modulo negative? newline not null-environment null? number->string ' +\n 'number? numerator odd? open-input-file open-output-file output-port? ' +\n 'pair? peek-char port? positive? procedure? quasiquote quote quotient ' +\n 'rational? rationalize read read-char real-part real? remainder reverse ' +\n 'round scheme-report-environment set! set-car! set-cdr! sin sqrt string ' +\n 'string->list string->number string->symbol string-append string-ci<=? ' +\n 'string-ci<? string-ci=? string-ci>=? string-ci>? string-copy ' +\n 'string-fill! string-length string-ref string-set! string<=? string<? ' +\n 'string=? string>=? string>? string? substring symbol->string symbol? ' +\n 'tan transcript-off transcript-on truncate values vector ' +\n 'vector->list vector-fill! vector-length vector-ref vector-set! ' +\n 'with-input-from-file with-output-to-file write write-char zero?'\n };\n\n const LITERAL = {\n className: 'literal',\n begin: '(#t|#f|#\\\\\\\\' + SCHEME_IDENT_RE + '|#\\\\\\\\.)'\n };\n\n const NUMBER = {\n className: 'number',\n variants: [\n {\n begin: SCHEME_SIMPLE_NUMBER_RE,\n relevance: 0\n },\n {\n begin: SCHEME_COMPLEX_NUMBER_RE,\n relevance: 0\n },\n {\n begin: '#b[0-1]+(/[0-1]+)?'\n },\n {\n begin: '#o[0-7]+(/[0-7]+)?'\n },\n {\n begin: '#x[0-9a-f]+(/[0-9a-f]+)?'\n }\n ]\n };\n\n const STRING = hljs.QUOTE_STRING_MODE;\n\n const COMMENT_MODES = [\n hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n ),\n hljs.COMMENT('#\\\\|', '\\\\|#')\n ];\n\n const IDENT = {\n begin: SCHEME_IDENT_RE,\n relevance: 0\n };\n\n const QUOTED_IDENT = {\n className: 'symbol',\n begin: '\\'' + SCHEME_IDENT_RE\n };\n\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n\n const QUOTED_LIST = {\n variants: [\n {\n begin: /'/\n },\n {\n begin: '`'\n }\n ],\n contains: [\n {\n begin: '\\\\(',\n end: '\\\\)',\n contains: [\n 'self',\n LITERAL,\n STRING,\n NUMBER,\n IDENT,\n QUOTED_IDENT\n ]\n }\n ]\n };\n\n const NAME = {\n className: 'name',\n relevance: 0,\n begin: SCHEME_IDENT_RE,\n keywords: KEYWORDS\n };\n\n const LAMBDA = {\n begin: /lambda/,\n endsWithParent: true,\n returnBegin: true,\n contains: [\n NAME,\n {\n endsParent: true,\n variants: [\n {\n begin: /\\(/,\n end: /\\)/\n },\n {\n begin: /\\[/,\n end: /\\]/\n }\n ],\n contains: [ IDENT ]\n }\n ]\n };\n\n const LIST = {\n variants: [\n {\n begin: '\\\\(',\n end: '\\\\)'\n },\n {\n begin: '\\\\[',\n end: '\\\\]'\n }\n ],\n contains: [\n LAMBDA,\n NAME,\n BODY\n ]\n };\n\n BODY.contains = [\n LITERAL,\n NUMBER,\n STRING,\n IDENT,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES);\n\n return {\n name: 'Scheme',\n illegal: /\\S/,\n contains: [\n hljs.SHEBANG(),\n NUMBER,\n STRING,\n QUOTED_IDENT,\n QUOTED_LIST,\n LIST\n ].concat(COMMENT_MODES)\n };\n}", "title": "" }, { "docid": "3a37b932284c26504faa4a56a243f156", "score": "0.4151028", "text": "function clojure(hljs) {\n const SYMBOLSTART = 'a-zA-Z_\\\\-!.?+*=<>&#\\'';\n const SYMBOL_RE = '[' + SYMBOLSTART + '][' + SYMBOLSTART + '0-9/;:]*';\n const globals = 'def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord';\n const keywords = {\n $pattern: SYMBOL_RE,\n built_in:\n // Clojure keywords\n globals + ' ' +\n 'cond apply if-not if-let if not not= =|0 <|0 >|0 <=|0 >=|0 ==|0 +|0 /|0 *|0 -|0 rem ' +\n 'quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? ' +\n 'set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? ' +\n 'class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? ' +\n 'string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . ' +\n 'inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last ' +\n 'drop-while while intern condp case reduced cycle split-at split-with repeat replicate ' +\n 'iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext ' +\n 'nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends ' +\n 'add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler ' +\n 'set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter ' +\n 'monitor-exit macroexpand macroexpand-1 for dosync and or ' +\n 'when when-not when-let comp juxt partial sequence memoize constantly complement identity assert ' +\n 'peek pop doto proxy first rest cons cast coll last butlast ' +\n 'sigs reify second ffirst fnext nfirst nnext meta with-meta ns in-ns create-ns import ' +\n 'refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! ' +\n 'assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger ' +\n 'bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline ' +\n 'flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking ' +\n 'assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! ' +\n 'reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! ' +\n 'new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty ' +\n 'hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list ' +\n 'disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer ' +\n 'chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate ' +\n 'unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta ' +\n 'lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize'\n };\n\n const SIMPLE_NUMBER_RE = '[-+]?\\\\d+(\\\\.\\\\d+)?';\n\n const SYMBOL = {\n begin: SYMBOL_RE,\n relevance: 0\n };\n const NUMBER = {\n className: 'number',\n begin: SIMPLE_NUMBER_RE,\n relevance: 0\n };\n const STRING = hljs.inherit(hljs.QUOTE_STRING_MODE, {\n illegal: null\n });\n const COMMENT = hljs.COMMENT(\n ';',\n '$',\n {\n relevance: 0\n }\n );\n const LITERAL = {\n className: 'literal',\n begin: /\\b(true|false|nil)\\b/\n };\n const COLLECTION = {\n begin: '[\\\\[\\\\{]',\n end: '[\\\\]\\\\}]',\n relevance: 0\n };\n const HINT = {\n className: 'comment',\n begin: '\\\\^' + SYMBOL_RE\n };\n const HINT_COL = hljs.COMMENT('\\\\^\\\\{', '\\\\}');\n const KEY = {\n className: 'symbol',\n begin: '[:]{1,2}' + SYMBOL_RE\n };\n const LIST = {\n begin: '\\\\(',\n end: '\\\\)'\n };\n const BODY = {\n endsWithParent: true,\n relevance: 0\n };\n const NAME = {\n keywords: keywords,\n className: 'name',\n begin: SYMBOL_RE,\n relevance: 0,\n starts: BODY\n };\n const DEFAULT_CONTAINS = [\n LIST,\n STRING,\n HINT,\n HINT_COL,\n COMMENT,\n KEY,\n COLLECTION,\n NUMBER,\n LITERAL,\n SYMBOL\n ];\n\n const GLOBAL = {\n beginKeywords: globals,\n keywords: {\n $pattern: SYMBOL_RE,\n keyword: globals\n },\n end: '(\\\\[|#|\\\\d|\"|:|\\\\{|\\\\)|\\\\(|$)',\n contains: [\n {\n className: 'title',\n begin: SYMBOL_RE,\n relevance: 0,\n excludeEnd: true,\n // we can only have a single title\n endsParent: true\n }\n ].concat(DEFAULT_CONTAINS)\n };\n\n LIST.contains = [\n hljs.COMMENT('comment', ''),\n GLOBAL,\n NAME,\n BODY\n ];\n BODY.contains = DEFAULT_CONTAINS;\n COLLECTION.contains = DEFAULT_CONTAINS;\n HINT_COL.contains = [ COLLECTION ];\n\n return {\n name: 'Clojure',\n aliases: [ 'clj' ],\n illegal: /\\S/,\n contains: [\n LIST,\n STRING,\n HINT,\n HINT_COL,\n COMMENT,\n KEY,\n COLLECTION,\n NUMBER,\n LITERAL\n ]\n };\n}", "title": "" }, { "docid": "4214463327fc6d5e42d539c594d5ff48", "score": "0.41495797", "text": "function ExecutableDefinitions(context) {\n return {\n Document: function Document(node) {\n node.definitions.forEach(function (definition) {\n if (definition.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].OPERATION_DEFINITION && definition.kind !== _language_kinds__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].FRAGMENT_DEFINITION) {\n context.reportError(new _error__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](nonExecutableDefinitionMessage(definition.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_DEFINITION ? 'schema' : definition.name.value), [definition]));\n }\n });\n return false;\n }\n };\n}", "title": "" } ]
b24fb2ef40b9347e6412cee2bb4bc7d8
Update view using JSON
[ { "docid": "48bb627f3323e1ecbfa9ee3b8c9ecf01", "score": "0.7253162", "text": "function updateWithJson(ctx, url) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // Update view with current json\n updateView(ctx, this.responseText);\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" } ]
[ { "docid": "da3c09ed3833c70420d13f030095dcee", "score": "0.67852074", "text": "@action updateFromJson(json) {\n console.log('I will update myself based on JSON values');\n this.title = json.title;\n this.views = json.views;\n this.front_delta = json.front_delta;\n this.front_html = json.front_html;\n this.back_delta = json.back_delta;\n this.back_html = json.back_html;\n if(!json.collaborators) { json.collaborators = {}};\n this.fork_of = json.fork_of;\n }", "title": "" }, { "docid": "498e4bf1545c12f70a04135b06f02376", "score": "0.67630357", "text": "@action updateFromJson(json) {\n console.log('I will update myself based on JSON values');\n this.title = json.title;\n this.views = json.views;\n if(!json.collaborators) { json.collaborators = {}};\n if(!json.cards) { json.cards = {}};\n this.collaborators.replace(json.collaborators);\n this.cards.replace(json.cards);\n this.fork_of = json.fork_of;\n }", "title": "" }, { "docid": "19fdf884c7a12ae0e9ae0c9fe443bf2d", "score": "0.66331613", "text": "async edit({ params, request, response, view }) {}", "title": "" }, { "docid": "19fdf884c7a12ae0e9ae0c9fe443bf2d", "score": "0.66331613", "text": "async edit({ params, request, response, view }) {}", "title": "" }, { "docid": "dac5234156074bd07c717f7e0fd68282", "score": "0.6531813", "text": "async edit({\n params,\n request,\n response,\n view\n }) {}", "title": "" }, { "docid": "ad0238fbff1b18aa156256dee17890bc", "score": "0.644969", "text": "function setJsonView(){\n var both = [constants.OPERATION_PUT, constants.OPERATION_POST];\n\n if ( both.indexOf(requestHeader.selectedOperation) > -1 ){\n $scope.setJsonView(true, true);\n } else {\n $scope.setJsonView(true, false);\n }\n }", "title": "" }, { "docid": "5f736dda87fe7db91f0fcb60b14e5f4f", "score": "0.6262068", "text": "function updatedJson(){\n console.log(\"data updated\");\n}", "title": "" }, { "docid": "9e04ab6b4e3991bb548821d03a30075f", "score": "0.6245529", "text": "async edit({ params, request, response, view }) {\n }", "title": "" }, { "docid": "db5c2f86175ead2c6771e1e82e0d6882", "score": "0.6187278", "text": "updateFromJson(json) {\n const self = this;\n self.set('details', json);\n const keys = Object.keys(json);\n keys.forEach(key => {\n self.set(key, json[key]);\n });\n }", "title": "" }, { "docid": "21300d8dbf87e06fd42d58cbacace32e", "score": "0.61726975", "text": "updateFromJson(json) {\n this.slug = json.slug\n this.userId = json.userId\n this.source = json.document\n this.type = json.type\n this.createdAt = json.created_at\n this.shares = json.shares\n this.name = json.name\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.61607516", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "739796bb58ecddd77b5623a5b204bc82", "score": "0.60716015", "text": "function updateView(res) { \n if(activeSite === \"Digg\") { \n buildDiggObj(res)\n }\n else if(activeSite === \"Mashable\") {\n buildMashObj(res)\n }\n }", "title": "" }, { "docid": "fb6cb57a72c7cdb3c57a5856e7a8db61", "score": "0.60478556", "text": "function updateJsonPath(visToUpdate) {\n\n // Convert string json object to objects\n let convertMappings = function (mappingToConvert) {\n Object.keys(mappingToConvert).forEach(function (key) {\n if (typeof mappingToConvert[key] === \"string\") {\n mappingToConvert[key] = JSON.parse(mappingToConvert[key]);\n }\n return mappingToConvert;\n })\n }\n\n convertMappings(visToUpdate.visFieldToPathMappingInput);\n\n // Perform put request to update the chart components\n ComponentService.addNewActiveVisualization(DEPLOYMENT_ID, {\n instanceId: visToUpdate.instanceId,\n visId: visToUpdate.visId,\n fieldCollectionId: visToUpdate.fieldCollectionIdInput,\n visFieldToPathMapping: JSON.parse(JSON.stringify(visToUpdate.visFieldToPathMappingInput))\n }).then(function (data) {\n // Request succeeded --> notify the user\n visToUpdate.fieldCollectionId = visToUpdate.fieldCollectionIdInput;\n visToUpdate.visFieldToPathMapping = JSON.parse(JSON.stringify(visToUpdate.visFieldToPathMappingInput));\n $('div.modal.fade').modal('hide');\n NotificationService.notify('Chart was updated successfully.', 'success');\n }, function (errData) {\n // Request failed --> notify the user and do nothing\n alert(JSON.stringify(errData));\n NotificationService.notify('Update of visualization instance failed.', 'error');\n });\n }", "title": "" }, { "docid": "c8778f91360e15ff8578a46f77811f4d", "score": "0.6015111", "text": "function update(rawdata){\n\t//PUT YOUR UPDATE CODE TO CREATE OR UPDATE VISUALIZATION BELOW\n\n}", "title": "" }, { "docid": "46c2d485d2bb0989cf8b3ceaf4cd4c2e", "score": "0.59789336", "text": "function updateView(url, id, map, render) {\n var render = render\n if(typeof url !== 'string' || typeof id !== 'string' || !(map instanceof Map))\n throw new Error('Check parameters');\n\n $.get(url, function(viewData) {\n map.set(id, viewData);\n if (render === true)\n renderView(id, map, window.content);\n });\n }", "title": "" }, { "docid": "6dd11c5d7ad1839585003f95096ae904", "score": "0.59724635", "text": "function updateDataAndView() {\n data.updateState(cState);\n viz.updateView(cState, data.getPathData(cState.getCity(), cState.getMetric()), data.getInputDataCity(cState.getCity()));\n}", "title": "" }, { "docid": "bc955519e17e3bc908573870860b80c4", "score": "0.59335387", "text": "function updateView(ctx, jsonData) {\n var gameData = JSON.parse(jsonData, (key, objectData) => {\n // key = Object1, etc.\n document.getElementById(\"myCanvas\").innerHTML = drawObject(ctx, objectData.left, objectData.top, objectData.width, objectData.height, objectData.objectcolor);\n return objectData; // return the unchanged property value.\n });\n}", "title": "" }, { "docid": "6d6a8f433d2187d231ef22aca7e823a5", "score": "0.58718413", "text": "function updateTask() {\n\n let updated = {\n title: titleUpdate.value,\n date: dateUpdate.value,\n details: detailsUpdate.value\n }\n\n fetch('/todo', {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(updated)\n })\n .then(res => res.json())\n .then(data => console.log(data));\n\n\n location.reload()\n}", "title": "" }, { "docid": "2a8d34aa759b65fa07ba964bd5f86c8a", "score": "0.5844552", "text": "function updateView() {\n _updateView = true;\n }", "title": "" }, { "docid": "332ea1647d9cfa782d04c91c8c082ca3", "score": "0.58435744", "text": "function updateViewUser() {\n updateViewIds(\"userIds\");\n}", "title": "" }, { "docid": "e1965a004913cca3130a37de2e802cb2", "score": "0.58433676", "text": "function updateView() {\n ngModelController.$setViewValue({ keys: scope.keys, data: scope.data });\n }", "title": "" }, { "docid": "469ea555216c5da3661f9de1422744c4", "score": "0.5838429", "text": "function render_add_Json() {\n\t\tvar param = {};\n\t\tvar _filterData = Ti.App.Properties.getList(\"Filter_Data\");\n\t\tif (_filterData) {\n\t\t\tif (_filterData[0] !== '') {\n\t\t\t\tparam.log_date = _filterData[0];\n\t\t\t}\n\n\t\t\tif (_filterData[1] !== '') {\n\t\t\t\tparam.horse_id = _filterData[1];\n\t\t\t}\n\n\t\t\tif (_filterData[2] !== '') {\n\t\t\t\tparam.subject = _filterData[2];\n\t\t\t}\n\n\t\t\tif (_filterData[3] !== '') {\n\t\t\t\tparam.author_id = _filterData[3];\n\t\t\t}\n\t\t}\n\n\t\tnew API_Call('POST', system_url.getEdit_View_url(), param, function(json) {\n\t\t\trender_edit_Json(json);\n\t\t});\n\t}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.58306026", "text": "update(){}", "title": "" }, { "docid": "a89fbadfa228c6a5d0db308116ea96c3", "score": "0.58306026", "text": "update(){}", "title": "" }, { "docid": "ec7068336ffaa480c4a9b9355fc2eb03", "score": "0.5819362", "text": "function updateView() {\n updateViewMainCategory();\n updateViewMain();\n updateViewLogin();\n updateViewManager();\n updateViewUser();\n updateViewBartender();\n}", "title": "" }, { "docid": "d929d7732fdb36bc42d439fb3a016b1f", "score": "0.58007866", "text": "function update_view() {\n // place all the products \n for (i = 0; i < 12; i++){\n var prod = get_product(i); //THIS MAY NEED TO BE CHANGED TO JSON\n drink_box(prod);\n }\n set_categories ();\n update_language();\n update_total();\n update_userInfo();\n}", "title": "" }, { "docid": "1b5e5b2e31df72c92ac9fa13917a7e8f", "score": "0.5791997", "text": "function update_view() {\n G.rows = parse_data(G.data); // reparse data (if cols changed)\n check_filters(); // refilter data (if filters changed)\n G.stats = calc_stats(); // generate stats on current data\n sort_rows(V.sort);\n\n switch (V.view) {\n case 'Table':\n tabulate();\n break;\n case 'Chart':\n visualize();\n break;\n default:\n no_such_view();\n }\n\n // prepare to export things as they are seen now\n G.timestamp = new Date(); // remember when we obtained this data\n prep_exports();\n}", "title": "" }, { "docid": "12f9e0ab780fe5cf35e10363c541a214", "score": "0.578095", "text": "function putJson(data) {\n $.ajax({\n url: 'http://localhost:3000/elevator/1',\n method: 'PUT',\n data: data,\n // contentType: 'application/json; charset=UTF-8',\n // TODO implement event emiter\n complete: () => { getJson(target.render); getJson(status.render); }\n });\n }", "title": "" }, { "docid": "2564919b9070fa0c2bccf599f97e207e", "score": "0.574624", "text": "updateJsonButtonHandler() {\n if (this.jsonChanged) {\n this.props.updateJson(JSON.parse(this.json));\n this.jsonChanged = false;\n //TODO: implement a MODAL here\n alert('Updated!');\n } else alert('Already up to date.');\n }", "title": "" }, { "docid": "82bec78cfbc45113fbd1f0ccf08c9d6a", "score": "0.57036984", "text": "function updateView() {\n updateCompanyList();\n updatePagingData();\n }", "title": "" }, { "docid": "139e3a85cf42c4228d4518b9e21feeaa", "score": "0.5685485", "text": "update(data) {\n for (let key of data) {\n let val = data[key];\n if (key == \"id\" && this._data.id) {\n continue;\n }\n this._data[key] = val;\n }\n this.dispatchEvent('Model.Change', { path: null, value: data }, true);\n }", "title": "" }, { "docid": "4aeb26455f1fb14ece2c1f1cf9bdd62a", "score": "0.5681359", "text": "putJSON(json){\n return fetch(this.endpoint, {\n headers: {\n 'Content-type': 'application/json',\n },\n method: 'PUT',\n body: JSON.stringify(json),\n });\n }", "title": "" }, { "docid": "3b3f2ac8c8c6ea3c9a90868dd140c912", "score": "0.56563467", "text": "function updateJSON(de){\n\tif(de==null){\n\t\tconsole.error(\"Invalid JSON... maybe.\");\n\t\treturn;\n\t} else if(de.error){\n\t\tconsole.log(de.error);\n\t\treturn false;\n\t}\n\td = de; //pump it out into global space\n\t$('#loadblock').addClass('invisible');//remove pane if it was showing\n\tif(d.message != null && d.message != \"\"&& d.message != oldmessage){\n\t\t$('#dialog').html(d.message);\n\t\t$('#dialog').dialog();\n\t\toldmessage = d.message;\n\t}\n\t$(\"#graphtotier\").progressbar({value: (((d.heroes.conquest + d.overlord.conquest)-(d.tier*200))/2)});//progress bar will autocap at 100%\n\t$(\"#ticker\").html(\"Week: \"+d.week+\", Hero Conquest: \"+d.heroes.conquest+\", Hero Gold: \"+d.heroes.gold+\", Overlord Conquest: \"+d.overlord.conquest+\", Divine Favour:\"+parseInt((d.heroes.conquest-d.overlord.conquest)/25));\n\t//update the applicable view:\n\tif(d.heroes.location==\"overworld\")\n\t\tupdateOverworld();\n\telse \n\t\tupdateInstance();\t\n}", "title": "" }, { "docid": "933610b268f3c22d23cfb3e3676ee18d", "score": "0.5649959", "text": "function updateView(list,idContratto){\n\n }", "title": "" }, { "docid": "7fbec15905681144dd9630fddc7183a8", "score": "0.562241", "text": "updateData(data_json){\n const submit = () => {\n fetch(\"/update\", {\n method: \"put\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data_json),\n })\n .then((res) => {\n return res.json()\n })\n };\n submit()\n }", "title": "" }, { "docid": "2da3904a7906cf8604e783ffa0f75dd8", "score": "0.5616066", "text": "saveEdit(item) {\n\t\t//MAKE JSON UPDATE REQUEST\n\t\t//\n\t\tlet id = item.id\n\t\tdelete item.id\n\t\tlet newItem = item\n\n\t\tconsole.log(newItem)\n\t\tthis.state.json_client.patch(this.state.nav + '/update/' + id, \n\t\t\tnewItem, function(err, res, body) {\n\t\t\treturn console.log(res.statusCode)\n\t\t})\n\t}", "title": "" }, { "docid": "f4b5bf593fe368ccdad83bd4d9ee2c0f", "score": "0.5590446", "text": "function updateView(){\n $.getJSON(BASE_URL + \"/rides/count\", updateRideCount)\n\n $.when($.getJSON(BASE_URL + \"/rides/count/per_month\", perYear),\n ).then(updateChart);\n}", "title": "" }, { "docid": "e5ce7c25373f498c3ca2b866a46daf88", "score": "0.5582762", "text": "updateData(resource, editedObj) {\n return fetch(`${remoteURL}/${resource}/${editedObj.id}`, {\n method: \"PUT\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(editedObj)\n }).then(data => data.json());\n }", "title": "" }, { "docid": "fc8be63ebfd32c739f98d1e443a9dff3", "score": "0.55821335", "text": "patchDataJSON(data) {\n this.data._r = data;\n }", "title": "" }, { "docid": "9b44104a5ff2e249db1439a5a54b1c19", "score": "0.5571964", "text": "function changeShop(shop){\n editedJSON.Shop = shop;\n}", "title": "" }, { "docid": "0185d4ec41e2dc37f05efed97738a452", "score": "0.5568579", "text": "function editTask(data){\n\t\tconsole.log(data);\n\t\tvar id = data._id;\n\t\tvar rev = data._rev;\n\t\tvar created = data.created_at;\n\t\tvar updated = date.getTime();;\n\t\tvar done = !data.done;\n\t\tvar title = data.title;\n\t\tvar type = data.type;\n\t\t$.ajax({\n\t \ttype: \"PUT\",\n\t \turl: server+\"/\"+id,\n\t \tcontentType: \"application/json\",\n\t \tdata: JSON.stringify({ \"_rev\": rev,\"title\": title,\"done\": done,\"created_at\": created,\"updated_at\": updated,\"type\": type}),\n\t \tdayaType: \"json\",\n\t \tsuccess: function(data){\n console.log(data);\n\t \tconsole.log(\"Tarea editada\")\n\t \t}\n\t\t});\n\t}", "title": "" }, { "docid": "265d8d22e5577d9449f6b5581509512d", "score": "0.5559346", "text": "onChange(newValue) {\n this.json = newValue;\n this.jsonChanged = true;\n }", "title": "" }, { "docid": "258ffe50367ff437c594e8add2589908", "score": "0.55590224", "text": "function updateOne(k) {\n\t\t\t\t\tif (k) {\n\t\t\t\t\t\tif (inOldjson(k) && !(k in json))\n\t\t\t\t\t\t\tactions[k] = 'remove';\n\t\t\t\t\t\telse if (!inOldjson(k) && (k in json))\n\t\t\t\t\t\t\tactions[k] = 'add';\n\t\t\t\t\t\telse if (!inOldjson(k) && !(k in json)) {\n\t\t\t\t\t\t\tif (k in actions) delete actions[k];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (oldjson[k].name === json[k].name && oldjson[k].title === json[k].title && oldjson[k].text === json[k].text) {\n\t\t\t\t\t\t\t\tif (k in actions) delete actions[k];\n\t\t\t\t\t\t\t\tif (k in oldjson) delete oldjson[k];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse actions[k] = 'modify';\n\t\t\t\t\t}\n\t\t\t\t}", "title": "" }, { "docid": "64d85c510928ca169d285801e4cbde30", "score": "0.5541421", "text": "function updatePantry(){\n\n //build the obj to send to the api\n var pantry = {\n 'parent_site': $scope.parentSite,\n 'description': $scope.pantryEditDesc,\n 'hours': $scope.pantryEditHours,\n 'pantry_condition': $scope.pantryEditCond\n };\n\n //Call the pantry update in the api\n $http.put('webapi/pantry/update', pantry)\n .then(function(response){\n //clear all edit fields\n $scope.pantryEditDesc = null;\n $scope.parentSite = null;\n $scope.pantryEditHours = null;\n $scope.pantryEditCond = null;\n\n //Handle the response\n if(response.status === 200){\n //hide everything\n hideAllOptions();\n //show the success message\n $scope.successMessage = true;\n }else{\n hideAllOptions();\n $scope.nonSuccessMessage = true;\n }\n });\n }", "title": "" }, { "docid": "cdc36809c2715d9808cc5ab5196cdabe", "score": "0.55206966", "text": "function edit() {\n\t\t// Code here ...\n\t\t// View Edit\n\t\t// if(OK){update() };\n\t}", "title": "" }, { "docid": "3a7db872fbcfa4a53977ae0337adea93", "score": "0.5519577", "text": "function verUpdate(idStock) {\n var data = {idStock: idStock};\n $http({\n method: 'POST',\n url: '../../controller/cStockByIdStock.php',\n data: JSON.stringify(data),\n contentType: 'application/json',\n dataType: 'JSON'\n }).then(function successCallback(response) {\n $scope.update = response.data.list;\n console.log(response.data.list);\n }, function errorCallback(response) {\n alert(response.error);\n });\n $('.update').css(\"display\", \"flex\");\n $('.update').css(\"flex-direction\", \"column\");\n }", "title": "" }, { "docid": "b8c482cde3cad8b3a6f0c309c5826e13", "score": "0.551779", "text": "function updateView() {\n $scope.$apply();\n }", "title": "" }, { "docid": "4922e99260f4ce14a59ff19bc551618a", "score": "0.548145", "text": "async editRating(params) {\n\n let vp = {}\n vp.id = this.props.navigation.getParam('ID')\n vp.rating = this.state.giveRating\n return await fetch('https://geo-spotit.herokuapp.com/changeRating', {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(vp),\n })\n .then((response) => response.json())\n .then((vp) => {\n this.setState({\n updated: true,\n rating: vp.rating,\n numOfRatings: vp.numberOfRatings,\n modalOpen: false,\n })\n })\n }", "title": "" }, { "docid": "8708ea7916c248f9dad89af774a56f0a", "score": "0.5468472", "text": "function updateItem(event) {\n event.preventDefault();\n\n var date = $('#datepicker').val();\n\n var data = {\n id: $(this).data('id'),\n item: $('#edit-text').val().trim(),\n setDate: date,\n completed: $('#completed').val()\n };\n $.ajax({\n method: 'PUT',\n url: '/api/tasks',\n data: data,\n success: function () {\n var url = '../view-date/' + date;\n document.location = url;\n }\n });\n }", "title": "" }, { "docid": "5bed234045c337f6f9bc2041906451db", "score": "0.5463388", "text": "update() {\r\n // Saves the data\r\n FileWriterRemote.write(this.getUpdateFormat(), () => {\r\n // Loads the data asynchronously after the new data has been saved\r\n FileWriterRemote.get((err, json) => {\r\n if (err) return console.log(err);\r\n\r\n this.updater(new ListHandler(json.items, json.order, this.updater));\r\n })\r\n });\r\n }", "title": "" }, { "docid": "32b8053420da38a1d24808977ebf9519", "score": "0.5462401", "text": "function update_nutrition_visit_level(visit_id) {\n\n $.ajax({\n url: \"\" + api_url + \"/p_visits/\" + visit_id,\n type: \"PUT\",\n data: {\n \"c_node_id\": 3//change\n },\n dataType: \"JSON\",\n success: function (data) {\n\n console.log('sucess update visit id'); \n\n swal(\"success!\", \"Advice patient to return to the doctor!\", \"success\");\n\n },\n error: function (e) {\n\n swal(\n 'Oops...',\n 'Something went wrong!',\n 'error'\n );\n\n }\n });\n}", "title": "" }, { "docid": "ce51f5a336e14c0e19747d5a2e17cb73", "score": "0.54564416", "text": "function updatePlant() {\n $('body').on('click', '.btn--update', function() {\n let updatedPlantName = $(\"#name\").val();\n let updatedPlantType = $(\"#plantType\").val();\n let updatedCurrentHealth = $(\"#currentHealth\").val();\n let id = $('.btn--update').attr('data-id');\n let updatedPlantObject = {\n name: updatedPlantName,\n plantType: updatedPlantType,\n currentHealth: updatedCurrentHealth,\n };\n $.ajax({ \n type: \"PUT\", \n contentType: 'application/json',\n url:`/plants/one/${id}`, \n data: JSON.stringify(updatedPlantObject),\n success: function(response) {\n let name = $(`tr[data-id=\"${response._id}\"]`).find('.plant__item--name');\n let plantType = $(`tr[data-id=\"${response._id}\"]`).find('.plant__item--type');\n let currentHealth = $(`tr[data-id=\"${response._id}\"]`).find('.plant__item--health');\n let updatedDate = $(`tr[data-id=\"${response._id}\"]`).find('.plant__item--date');\n let updatedMomentObj = moment(response.lastUpdated);\n let momentUpdatedDate = updatedMomentObj.fromNow();\n \n name.text(response.name);\n plantType.text(response.plantType);\n currentHealth.text(response.currentHealth);\n updatedDate.text(momentUpdatedDate);\n },\n fail: function(id) {\n console.log(id);\n }\n });\n\n $('#name').val('');\n $('#plantType').val('');\n $(\"#currentHealth\").val('');\n $('.btn--update').hide();\n $('.btn--submit').show();\n });\n}", "title": "" }, { "docid": "385354f280cb02c2685bcf419bc4308a", "score": "0.5456245", "text": "function View(jsons, versionMajor, versionMinor) {\r\n\r\n // CONSTRUCTOR\r\n // Initialize members\r\n this.mNbJSONsLoaded = 0;\r\n this.mDatabase = {};\r\n this.mSealed = {};\r\n this.mVersionMajor = versionMajor;\r\n this.mVersionMinor = versionMinor;\r\n this.mVersion = versionMajor + '.' + versionMinor;\r\n this.mJSONs = { nbFiles: jsons.length };\r\n for (var json of jsons) {\r\n // Request the JSON file asynchronously\r\n this.requestJSON('json/v' + this.mVersion + '/' + json + '.json', this.mJSONs, json, this.onFileLoaded, this);\r\n }\r\n\r\n}//end View", "title": "" }, { "docid": "17d485d8e72336e1621ba8b922f00fe8", "score": "0.5454326", "text": "function dataToContactView(index){\n var jsonObject = abStack.jsonABData[index]\n abContactViewIdField = jsonObject[\"id\"]\n abContactViewFirstNameField = jsonObject[\"firstname\"]\n abContactViewLastNameField = jsonObject[\"lastname\"]\n abContactViewNumberField = jsonObject[\"mobile\"]\n abContactViewEmailField = jsonObject[\"email\"]\n}", "title": "" }, { "docid": "84060029f5816e103736a9db849b711c", "score": "0.54519504", "text": "function updateOverview() {\n $scope.overview = currentItemData;\n $scope.vidItem = $scope.overview\n }", "title": "" }, { "docid": "cc259e36d2a5f1a52918931fad150fde", "score": "0.54417825", "text": "async update({ params, request, response }) {}", "title": "" }, { "docid": "5d098ef0215d751de1507f455a67c15d", "score": "0.5426516", "text": "update(cache, { data }) {\n cache.modify({\n id: cache.identify(data.updateTodo),\n fields: {\n value: () => data.updateTodo.value,\n completed: () => data.updateTodo.completed,\n },\n })\n }", "title": "" }, { "docid": "aa8999018b773a14879ccb579d9f8124", "score": "0.5425497", "text": "function update(data) {\n if (model.data !== data) {\n model.data = data;\n $.update(model, model.__ref);\n }\n }", "title": "" }, { "docid": "cb13c2a26a10f069192a8c97b71106cd", "score": "0.54251105", "text": "async updateData() {\n return await fetch('https://geo-spotit.herokuapp.com/getViewPointInfo')\n .then((response) => response.json())\n .then((responseJson) => {\n this.setState({\n listOfViews: responseJson.viewPoints,\n })\n Alert.alert('Spotsa på kartet er nå oppdatert!')\n })\n .catch((error) => console.log(error))\n }", "title": "" }, { "docid": "ccb02e228db39d3af359fdd75b16bb6a", "score": "0.5423626", "text": "function update($scope, $http){\n\t\t$scope.method = \"POST\";\n\t\t$scope.url = \"http://localhost/ProjectManager/main/changeJsonFile.php\";\n\t\t\n\t\t$http({\n\t\t\tmethod: $scope.method,\n\t\t\turl: $scope.url,\n\t\t\tdata: $scope.projects,\n\t\t\theaders:{\"Content-Type\": \"application/json\"}\n\n\t\t//\tcache: $templateCache\n\t\t})\n\t\t.success(function(data, status) {\n\t\t\t$scope.status = status;\n\t\t\t//$scope.data = data;\n\t\t})\n\t\t.error(function(data, status) {\n\t\t\t$scope.data = data || \"Request failed\";\n\t\t\t$scope.status = status;\n\t\t});\n\n}", "title": "" }, { "docid": "3a8752e5250ad865562cc2afe0300ae5", "score": "0.5412087", "text": "modifyProductView(data){\n this.routageProductUpdate()\n this.$emit(\"onmodifyproductview\",data)\n }", "title": "" }, { "docid": "17c616631b33a1f5a53baed15c528e0c", "score": "0.5406504", "text": "updateData() {}", "title": "" }, { "docid": "1b9edf8ec0343d3a7f8ddfb1d927beff", "score": "0.53880906", "text": "function updateJSON(node,data){\n\tif((data!=null)&&(data.children!=null)){ \n\t\tvar object = $.parseJSON(json); \n var path = getNodePath(node);\n if(typeof(path)!==\"undefined\"){ \n var nodeIndex = eval(\"object\"+path);\n if((typeof(nodeIndex)!==\"undefined\")&&(Array.isArray(nodeIndex))){\n \tnodeIndex.splice(0,nodeIndex.length);\n $.each(data.children,function(index,child){\n nodeIndex.push(child); \n var nodeGraph = st.graph.getNode(child.id);\n if(typeof(nodeGraph)!==\"undefined\"){\n \tnodeGraph.setData(\"level\",child.data.$level); \n } \n \t});\n }\n }\n json = JSON.stringify(object);\n st.refresh();\n }\n}", "title": "" }, { "docid": "31906f381a8dab9b2aac1089babe3461", "score": "0.53818923", "text": "function ObjectView(data) {\n\tvar editMode = false;\n\tif (data){\n\t\teditMode = true;\n\t}\n\tvar objData = {};\n\tif (!editMode){\n\t\t// set date\n\t\tvar currentdate = new Date();\n\t\tvar date = (currentdate.getDate() < 10) ? \"0\"+currentdate.getDate() : currentdate.getDate();\n\t\tvar month = ((currentdate.getMonth()+1) < 10) ? \"0\"+(currentdate.getMonth()+1) : (currentdate.getMonth()+1);\n\t\tobjData.date = date+\".\"+month+\".\"+currentdate.getFullYear(); \n\t\t// set id\n\t\tvar timestamp = new Date().getTime();\n\t\tobjData.id = timestamp;\n\t} else {\n\t\tobjData.id = data.id;\n\t}\n\tvar self = Ti.UI.createScrollView({\n\t\tbackgroundGradient:style.backgroundGradient,\n\t\tcontentHeight:'auto'\n\t});\n\n\t// ++++++++++++++TOP++++++++++++++\n\tvar areaTop= Ti.UI.createView({\n\t\ttop:0,\n\t\tleft:0,\n\t\theight:\"25%\"\n\t});\n\tself.add(areaTop);\n\t\n\tif (Ti.Platform.getOsname() != \"android\"){\n\t\tvar btnBack = Ti.UI.createButton({\n\t\t\ttitle:\" \"+L('back')+\" \",\n\t\t\ttop:20,\n\t\t\tleft:5,\n\t\t\tcolor:'#ffffff',\n\t\t\tborderColor:'#ffffff',\n\t\t\tborderWidth:1,\n\t\t\tborderRadius:5\n\t\t});\n\t\tbtnBack.addEventListener(\"click\", function(e){\n\t\t\tself.fireEvent(\"shouldCloseView\");\n\t\t});\n\t\tareaTop.add(btnBack);\n\t}\n\n\tvar btnSave = Ti.UI.createView({\n\t\ttop:20,\n\t\tright:5,\n\t\twidth:Ti.UI.SIZE,\n\t\theight:30,\n\t\tborderColor:'#ffffff',\n\t\tborderWidth:1,\n\t\tborderRadius:5,\n\t\tcolor:'#ffffff',\n\t\tbackgroundImage:'transparent',\n\t\tzIndex:10\n\t});\n\t\n\tvar btnSaveTitle = Ti.UI.createLabel({\n\t\ttext: \" \"+L('save')+\" \",\n\t\ttouchEnabled:false,\n\t\tcolor:'#ffffff',\n\t\tcenter:{x:'50%',y:'50%'}\n\t});\n\tbtnSave.add(btnSaveTitle);\n\tbtnSave.addEventListener(\"click\", function(){\n\t\tif (!objData || !objData.description){\n\t\t\tvar dialog = Ti.UI.createAlertDialog({\n\t\t\t\ttitle:'Hinweis',\n\t\t\t\tmessage:'Bitte geben Sie eine Bezeichnung ein',\n\t\t\t\tok: 'Okay'\n\t\t\t});\n\t\t\tdialog.show();\n\t\t\treturn;\n\t\t}\n\t\tif (editMode){\n\t\t\tupdateData(objData);\n\t\t\tTi.App.fireEvent(\"fillInventoryList\");\n\t\t} else {\n\t\t\tsaveData(objData);\n\t\t};\n\t\tself.fireEvent(\"shouldCloseView\");\n\t});\n\tareaTop.add(btnSave);\n\t\n\tvar btnScan = Ti.UI.createButton({\n\t\ttop:60,\n\t\tright:5,\n\t\ttitle: '\\uE260',\n\t\tbackgroundColor:'transparent',\n\t\tstyle: Titanium.UI.iPhone.SystemButtonStyle.PLAIN,\n\t\tcolor: '#ffffff',\n\t\tselectedColor: '#994c616e',\n\t\tfont: {fontFamily: style.iconFontFamily, fontSize: '16sp'},\n\t\tborderColor:'#ffffff',\n\t\tborderWidth:1,\n\t\tborderRadius:5\n\t});\n\n\tbtnScan.addEventListener(\"click\", function(e){\n\t\tvar ScanView = require(Ti.App.config.windowPath + 'ScanWindow');\n\t\tvar scanView = new ScanView();\n\t\tscanView.open();\n\t});\n\tareaTop.add(btnScan);\n\t\n\tvar scanIcon = createInfoIcon({\n\t\tright:btnScan.right,\n\t\ttop:btnScan.top+30,\n\t\ttext:L('infoScan'),\n\t\twin:self\n\t});\n\t\n\tvar headline = Ti.UI.createLabel({\n\t\ttext:(editMode) ? L('editObject') : L('addObject'),\n\t\tcenter:{x:'50%',y:'60%'},\n\t\tfont: {fontFamily: style.specialFontFamily, fontSize:\"50sp\"},\n\t\tcolor:'#ffffff'\n\t});\n\tareaTop.add(headline);\n\t// ++++++++++++++BOTTOM++++++++++++++\n\tvar areaBottom = Ti.UI.createView({\n\t\tbottom:0,\n\t\tleft:0,\n\t\theight:\"75%\",\n\t\tbackgroundColor:style.whiteTransparentBackground\n\t});\n\tself.add(areaBottom);\n\tvar inputField = [\n\t\t{\n\t\t\tid:\"serial\",\n\t\t\twidth:'55%',\n\t\t\ttype:'textfield',\n\t\t\thintText:L('serial')+\"...\",\n\t\t\ttitle:L('serial')+\": \"\n\t\t},\n\t\t{\n\t\t\tid:\"category\",\n\t\t\twidth:'55%',\n\t\t\ttype:'textfield',\n\t\t\thintText:L('category')+\"...\",\n\t\t\ttitle:L('category')+\": \"\n\t\t},\n\t\t{\n\t\t\tid:\"brand\",\n\t\t\twidth:'55%',\n\t\t\ttype:'textfield',\n\t\t\thintText:L('brand')+\"...\",\n\t\t\ttitle:L('brand')+\": \",\n\t\t\tbrandList:[\n\t\t\t\t\"Sony\",\n\t\t\t\t\"LG\",\n\t\t\t\t\"Samsung\",\n\t\t\t\t\"Apple\"\t\t\t\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tid:\"description\",\n\t\t\twidth:'80%',\n\t\t\ttype:'textfield',\n\t\t\thintText:L('description')+\"...\",\n\t\t\ttitle:L('description')+\": \"\n\t\t},\n\t];\n\n\tfor (i in inputField){\n\t\tswitch(inputField[i].type){\n\t\t\tcase \"textfield\":\n\t\t\t\t// create standard textfield\n\t\t\t\tvar textfield = Ti.UI.createTextField({\n\t\t\t\t\tbottom:(20 + (50*i)),\n\t\t\t\t\tleft:\"10%\",\n\t\t\t\t\theight:20,\n\t\t\t\t\twidth:inputField[i].width,\n\t\t\t\t\tpaddingLeft:4,\n\t\t\t\t\tpaddingRight:4,\n\t\t\t\t\tborderColor:'#ffffff',\n\t\t\t\t\tborderWidth:1,\n\t\t\t\t\tid:inputField[i].id,\n\t\t\t\t\thintText:inputField[i].hintText,\n\t\t\t\t\tcolor: '#ffffff',\n\t\t\t\t\t// returnKeyType: Ti.UI.RETURNKEY_NEXT,\n\t\t\t\t\tfont: {fontFamily: 'Helvetica Neue', fontSize:\"13sp\", color:'#000000'}\t\t\n\t\t\t\t});\n\t\t\t\tareaBottom.add(textfield);\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\ttextfield.blur();\n\t\t\t\t},200);\n\t\t\t\ttextfield.addEventListener(\"change\", function(e){\n\t\t\t\t\tswitch(e.source.id){\n\t\t\t\t\t\tcase 'serial':\n\t\t\t\t\t\t\tobjData.serial = (e.value) ? e.value : null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'brand':\n\t\t\t\t\t\t\tobjData.brand = (e.value) ? e.value : null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\tobjData.description = (e.value) ? e.value : null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'category':\n\t\t\t\t\t\t\tobjData.category = (e.value) ? e.value : null;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif (editMode) {\n\t\t\t\t\tswitch(inputField[i].id){\n\t\t\t\t\t\tcase 'serial':\n\t\t\t\t\t\t\tobjData.serial = textfield.value = data.serial;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'brand':\n\t\t\t\t\t\t\tobjData.brand = textfield.value = data.brand;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'description':\n\t\t\t\t\t\t\tobjData.description = textfield.value = data.description;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'category':\n\t\t\t\t\t\t\tobjData.category = textfield.value = data.category;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar textfieldTitle = Ti.UI.createLabel({\n\t\t\t\t\ttext:inputField[i].title,\n\t\t\t\t\tbottom:(43 + (50*i)),\n\t\t\t\t\twidth:100,\n\t\t\t\t\tleft:\"10%\",\n\t\t\t\t\tvisible:(Ti.Platform.getOsname() != \"android\") ? true : false,\n\t\t\t\t\tcolor: '#ffffff',\n\t\t\t\t\tfont: {fontFamily: 'Helvetica Neue', fontSize:\"12sp\", color:'#000000'}\t\t\t\n\t\t\t\t});\n\t\t\t\tareaBottom.add(textfieldTitle);\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\n\t}\n\t// ++++++++++++++IMG CONTAINER++++++++++++++\n\t\n\tvar invoiceContainer = Ti.UI.createView({\n\t\tbackgroundImage:'/images/invoice.png',\n\t\twidth:64,\n\t\theight:120,\n\t\tbottom:20,\n\t\tright:'11%',\n\t\ttype:\"invoice\"\n\t});\n\tareaBottom.add(invoiceContainer);\n\tinvoiceContainer.addEventListener(\"singletap\", addPhoto);\n\t\n\tvar invoiceIcon = createInfoIcon({\n\t\tright:'9%',\n\t\tbottom:invoiceContainer.bottom+invoiceContainer.height,\n\t\ttext:L('infoInvoice'),\n\t\twin:self\n\t});\n\t\n\tvar invoiceFlag = Ti.UI.createButton({\n\t\tcenter:{x:'50%',y:'50%'},\n\t\ttitle: (data && data.imgInvoice) ? '\\uE207' : '\\u002B',\n\t\twidth:Ti.UI.FILL,\n\t\theight:Ti.UI.FILL,\n\t\ttouchEnabled:false,\n\t\tbackgroundColor:'#36000000',\n\t\tstyle: Titanium.UI.iPhone.SystemButtonStyle.PLAIN,\n\t\tcolor: '#ffffff',\n\t\tselectedColor: '#994c616e',\n\t\tfont: {fontFamily: style.iconFontFamily, fontSize: '23sp'}\n\t});\n\tinvoiceContainer.add(invoiceFlag);\n\t\n\t// invoice label\n\tvar transform = Ti.UI.create2DMatrix();\n\ttransform = transform.rotate(90);\n\tvar rotate = Titanium.UI.createAnimation();\n\trotate.transform = transform;\n\t\n\tvar invoiceLabel = Ti.UI.createLabel({\n\t\ttext:L('Invoice upload','Rechnung einfügen'),\n\t\tfont: {fontSize: '12sp'}\n\t}).toImage();\n\t\n\tvar invoiceImg = Ti.UI.createImageView({\n\t\timage:invoiceLabel,\n\t\tright:-80,\n\t\tbottom:120,\n\t\tvisible:false\n\t});\n\t\n\tareaBottom.add(invoiceImg);\n\t\n\tinvoiceImg.animate(rotate);\n\tinvoiceImg.visible = true;\n\t// ++++++++++++++IMG CONTAINER++++++++++++++\n\tvar imageContainer = Ti.UI.createView({\n\t\theight:170,\n\t\twidth:170,\n\t\ttop:0,\n\t\tcenter:{x:'50%'}\n\t});\n\tareaBottom.add(imageContainer);\n\n\tvar imagePreview = Ti.UI.createImageView({\n\t\timage:(editMode) ? data.imgObject : null,\n\t\tbackgroundColor:style.whiteTransparentBackground,\n\t\tborderRadius:(Ti.Platform.getOsname() == \"android\") ? 100 : 50,\n\t\twidth:100,\n\t\theight:100,\n\t\tcenter:{x:'50%',y:'50%'},\n\t\ttype:\"object\"\n\t});\n\timageContainer.add(imagePreview);\n\timagePreview.addEventListener(\"singletap\", addPhoto);\n\t\n\tvar imagePreviewBorder = Ti.UI.createView({\n\t\tborderRadius:(Ti.Platform.getOsname() == \"android\") ? 130 : 65,\n\t\tborderWidth:3,\n\t\tborderColor:'#ffffff',\n\t\twidth:130,\n\t\theight:130,\n\t\ttouchEnabled:false,\n\t\tcenter:{x:'50%',y:'50%'}\n\t});\n\timageContainer.add(imagePreviewBorder);\n\t\n\tvar imgIcon = createInfoIcon({\n\t\tright:\"10%\",\n\t\ttop:20,\n\t\ttext:L('infoImage'),\n\t\twin:areaBottom\n\t});\n\t\n\tvar addIcon = Titanium.UI.createButton({\n\t\ttop:5,\n\t\tright:0,\n\t\theight:35,\n\t\twidth:35,\n\t\ttitle: '\\u002B',\n\t\tbackgroundColor:'transparent',\n\t\tstyle: Titanium.UI.iPhone.SystemButtonStyle.PLAIN,\n\t\tcolor: '#ffffff',\n\t\tselectedColor: '#994c616e',\n\t\tfont: {fontFamily: style.iconFontFamily, fontSize: '20sp'},\n\t});\n\timageContainer.add(addIcon);\n\taddIcon.addEventListener(\"singletap\", addPhoto);\t\n\t\n\t// ++++++++++++++FUNCTIONS++++++++++++++\n\t/*\n\t * addPhoto\n\t * shows dialog to choose a source of the images\n\t * camera or library\n\t */\n\tfunction addPhoto (e) {\t\n\t\tvar options = Ti.UI.createAlertDialog({\n\t\t\ttitle:(e.source.type == \"invoice\") ? L('chooseImageSource','Bitte Bildquelle für die Rechnung auswählen') : L('chooseImageSource','Bitte Bildquelle auswählen'),\n\t\t\tbuttonNames: [L('Library', 'Bibliothek'), L('Camera', 'Kamera'), L('Cancel','Abbrechen')],\n\t\t\ttype:e.source.type\n\t\t});\n\t\toptions.show();\n\t\toptions.addEventListener(\"click\", addPhotoDialogHandler);\n\t}\n\t\n\tfunction addPhotoDialogHandler (e) {\n\t\tvar win = Titanium.UI.createWindow({\n\t\t\torientationModes: [Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT, Titanium.UI.PORTRAIT]\n\t\t});\n\t\tvar dummyView = Titanium.UI.createView({\n\t\t\tleft: 130,\n\t\t\tbottom: 200\n\t\t});\n\t\twin.add(dummyView);\n\t\twin.addEventListener(\"open\", function() {\n\t\twin.orientationModes = [Titanium.UI.PORTRAIT];//[Titanium.UI.LANDSCAPE_LEFT, Titanium.UI.LANDSCAPE_RIGHT, Titanium.UI.PORTRAIT];\n\t\t\tswitch (e.index) {\n\t\t\t\tcase 1:\n\t\t\t\tif (Ti.Platform.osname != \"android\"){\n\t\t\t\t\tTi.Media.showCamera({\n\t\t\t\t\t\tsuccess : function(event) {\n\t\t\t\t\t\t\tvar obj = {\n\t\t\t\t\t\t\t\timage:event.media,\n\t\t\t\t\t\t\t\ttype:e.source.type\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\taddImage(obj);\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcancel: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsaveToPhotoGallery : false,\n//\t\t\t\t\t\tallowEditing : true,\n\t\t\t\t\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tTi.Media.showCamera({\n\t\t\t\t\t\tsuccess : function(event) {\n\t\t\t\t\t\t\tvar obj = {\n\t\t\t\t\t\t\t\timage:event.media,\n\t\t\t\t\t\t\t\ttype:e.source.type\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\taddImage(obj);\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcancel: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\t\tbreak;\n\t\n\t\t\t\tcase 0:\n\t\t\t\tif (Ti.Platform.osname != \"android\"){\n\t\t\t\t\tTi.Media.openPhotoGallery({\n\t\t\t\t\t\tsuccess : function(event) {\n\t\t\t\t\t\t\tvar obj = {\n\t\t\t\t\t\t\t\timage:event.media,\n\t\t\t\t\t\t\t\ttype:e.source.type\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\taddImage(obj);\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcancel: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tallowEditing : true,\n\t\t\t\t\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tTi.Media.openPhotoGallery({\n\t\t\t\t\t\tsuccess : function(event) {\n\t\t\t\t\t\t\tvar obj = {\n\t\t\t\t\t\t\t\timage:event.media,\n\t\t\t\t\t\t\t\ttype:e.source.type\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\taddImage(obj);\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcancel: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function () {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\twin.close();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\twin.close();\n\t\t\t}\n\t\t});\n\t\twin.open();\n\t}\n\t\n\tfunction addImage(obj) {\n\t\t//@TODO: check if image has height and width\n\t\tif (obj.type == \"invoice\"){\n\t\t\tinvoiceFlag.title = '\\uE207';\n\t\t\tobjData.imgInvoice = obj.image;\t\n\t\t} else {\n\t\t\timagePreview.image = obj.image;\n\t\t\tobjData.imgObject = obj.image;\n\t\t}\n\t\tobj.image = null;\n\t\tobj.file = null;\n\t}\n\n\treturn self;\n}", "title": "" }, { "docid": "2c3ef7073a7c1594c607f23776075e26", "score": "0.5381176", "text": "updatee(){\r\n let spac = document.getElementById(\"spacee\");\r\n fetch('https://tester3145.herokuapp.com/collection/lessons/:id' , {\r\n method: 'PUT',\r\n headers: {\r\n 'Content-Type' : 'application/json',\r\n },\r\n body: JSON.stringify({\r\n \"space\":\"space\" - space\r\n })\r\n }).then(response => response.json())\r\n .then(responseJSON => {\r\n console.log('Successfully updated:', responseJSON);\r\n })\r\n\r\n spac.innerHTML = space;\r\n }", "title": "" }, { "docid": "d133c8fd74db94bb398400d95e0720b2", "score": "0.53793824", "text": "function buildModifyUI(person_data){\n \n var html =\"<p12><input id='name' type='text' value='\" + person_data.name + \"'/>\";\n html += \"<input id='address' type='text' value='\" + person_data.address + \"'/>\";\n html += \"<input id='age' type='text' value='\" + person_data.age + \"'/>\";\n html += \"<input type='button' value='Update' id='update'/>\";\n html += \"<input type='button' value='Delete' id='delete'/>\";\n \n \n \n $(\"body\").html(html);\n \n $(\"#delete\").click(function(){\n \n $.ajax({\n method:'DELETE',\n url:'http://localhost:3000/persons/id=' + person_data._id + '/username=' + localStorage['username']\n }).done(function(data){location.reload(true)});\n });\n \n $(\"#update\").click(function(){\n console.log(\"Update pressed\");\n var temp = {\n id:person_data._id,\n name:$(\"#name\").val(),\n address:$(\"#address\").val(),\n age:$(\"#age\").val()\n }\n \n $.ajax({\n method:\"PUT\",\n url:'http://localhost:3000/persons',\n dataType:'json',\n data:temp\n }).done(function(data){\n console.log(\"update response received\");\n location.reload(true)\n });\n });\n}", "title": "" }, { "docid": "8379ec55dca957aa71d52a2ad89b96e5", "score": "0.5377555", "text": "function ArticleEditCtrl($scope, $routeParams, Article, $http) {\n // $http({method: 'GET', url: 'http://localhost:3003/api/articles/'+$routeParams.articleId}).success(function(data) {\n // $scope.article = data;\n // });\n $scope.article = Article.get({articleId: $routeParams.articleId});\n // $scope.update = function(article) {\n // var arr = new Array();\n // // arr['article'] = [];\n // // A: object to array conversion\n // $.map(article, function (value, key) { return arr[key] = value; });\n // // var params = new Array();\n // // $.map(arr, function (value, key) { console.log(value); return params['article'][key] = value; });\n // // params['article'] = arr;\n // // console.log(arr['article']['name']);\n // // article.$save({port: ':3003', articleId: $routeParams.articleId});\n\n // // $.ajax({\n // // url: 'http://localhost:3003/api/articles/'+$routeParams.articleId,\n // // type: \"PATCH\",\n // // data: arr,\n // // }).done(function() {\n // // console.log(\"saved\", $scope.article);\n // // }).fail(function(jqXHR, textStatus) {\n // // alert( \"Request failed: \" + textStatus );\n // // });\n // article.$save();\n // // $http({method: 'PATCH', url: 'http://localhost:3003/api/articles/'+$routeParams.articleId, params: arr }).success(function(data) {\n // // article.$save();\n // // $scope.article = data;\n // // });\n // };\n\n $scope.save = function() {\n \n //Create the forum object to send to the back-end\n var article = new Article($scope.article); \n // var array = [];\n // array['article'] = new Array();\n // $.map(article, function(k, v) {\n // return array[v] = k;\n // });\n\n // console.log(array);\n article.$save({articleId: $routeParams.articleId}, function() {\n $scope.article = Article.get({articleId: $routeParams.articleId});\n }, function(response) {\n $scope.errors = response.data.errors;\n });\n\n // $http({method: 'PATCH', url: 'http://localhost:3003/api/articles/'+$routeParams.articleId, \n // headers: {\n // \"X-Requested-With\": \"XMLHttpRequest\",\n // 'Accept': 'application/json, text/plain, */*'\n // }\n // }).success(function(data) {\n // $scope.article = data;\n // });\n\n // $.ajax({\n // url: 'http://localhost:3003/api/articles/'+$routeParams.articleId,\n // type: \"PATCH\",\n // // data: aticle,\n // }).done(function() {\n // console.log(\"saved\", $scope.article);\n // }).fail(function(jqXHR, textStatus) {\n // alert( \"Request failed: \" + textStatus );\n // });\n }\n}", "title": "" }, { "docid": "4c1da8b701f34fc065b3c2e0fb70d489", "score": "0.5374447", "text": "function updateSlideView() {\n\n\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"db/getPyramidPath.php\",\n\t\tdataType: \"json\",\n\t\tdata: { slide: statusObj.curSlide() },\n\t\tsuccess: function(data) {\n\n\t\t\t\t// Zoomer needs '.dzi' appended to the end of the filename\n\t\t\t\tpyramid = \"DeepZoom=\"+data[0]+\".dzi\";\n\t\t\t\tviewer.open(IIPServer + pyramid);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "82a8a06cae1c4b41f9a62577930454a9", "score": "0.53732234", "text": "function updateViews () {\n\t\tfor (var i in cities) updateView(views[i], cities[i]);\n\t}", "title": "" }, { "docid": "8368cdcbdae40cbe4c7d131841c6295f", "score": "0.537196", "text": "patchDataJSON(data) {\n this.data._r = data;\n // update the details and the view\n const indexNewPosition = this.getIndex({ x: this.data._x, y: this.data._y });\n this.data._details[indexNewPosition]._c = this.data._r._c;\n this.data._details[indexNewPosition]._t = this.data._r._t;\n this.data._details[indexNewPosition]._z = this.data._r._z;\n if (this.data._details[indexNewPosition]._nvt === null) {\n this.data._details[indexNewPosition]._nvt = false;\n }\n this.data._view[indexNewPosition] = this.data._r._c;\n this.data._global[indexNewPosition] = this.data._r._c;\n // dont forget to rebuild the neighbours (its usually done in the constructor)\n this.buildNeighbours();\n }", "title": "" }, { "docid": "3c950a7a352c1487098f6e5d01c30f93", "score": "0.5365757", "text": "function update_json(id){\n\n // No updating the data\n fetch(`/emails/${id}`,{\n method:\"PUT\",\n body:JSON.stringify({\n read:true\n })\n })\n .catch(error=> console.error(error));\n\n return false;\n}", "title": "" }, { "docid": "1b815d826f43b44f7c4094b8e3f5d3f4", "score": "0.5353655", "text": "update(req, res) {\n\n }", "title": "" }, { "docid": "5360897559689ddb9140c339254e123c", "score": "0.5336564", "text": "function updateProduct() {\n let manufacturer = document.getElementById(\"mfr\").value;\n let phoneID = document.getElementById( \"model_id\").value;\n let dataFieldIDs =[\"model_id\", \"model_name\", \"release_date\", \"weight_g\", \"display_size_inch\",\n \"resolution\", \"camera\", \"battery_capacity\", \"operating_system\", \"os_version\", \"category\"];\n let jsonBody =\"{\\\"\";\n for(let i in dataFieldIDs){\n let fieldValue = document.getElementById(dataFieldIDs[i]).value;\n if(fieldValue.length > 0) {\n jsonBody += dataFieldIDs[i] + \"\\\":\\\"\" + fieldValue + \"\\\",\\\"\";\n }\n }\n jsonBody = jsonBody.substring(0, jsonBody.length -2)\n jsonBody += \"}\";\n\n let xhrPut = new XMLHttpRequest();\n xhrPut.onreadystatechange = function () {\n if (xhrPut.readyState == 4 && xhrPut.status == 200) {\n console.log(xhrPut.responseText);\n }\n };\n\n xhrPut.open(\"PUT\", `/api/v1/manufacturers/${manufacturer}/${phoneID}` ,true);\n xhrPut.setRequestHeader(\"Content-type\", \"application/json\");\n xhrPut.send(jsonBody);\n}", "title": "" }, { "docid": "fee25045c9abb7a2a034a8d036e359cf", "score": "0.5331607", "text": "function editReview() {\r\n //Create a new review object\r\n var review = new Object();\r\n review.comment = document.getElementById(\"editComment\").value;\r\n review.rating = getUserRating(); //Retrieve review id of review from localStorage\r\n review.image_url = document.getElementById(\"editUploaded\").innerHTML;\r\n\r\n var review_id = localStorage.getItem(\"review_id\");\r\n //Create a PUT Request to the URL '/review/:id’\r\n var request = new XMLHttpRequest();\r\n request.open(\"PUT\", \"/review/\" + review_id, true);\r\n request.setRequestHeader(\"Content-Type\", \"application/json\");\r\n //On retrieved of data from backend, display a message and reload page\r\n request.onload = function () {\r\n alert(request.responseText);\r\n location.reload();\r\n };\r\n request.send(JSON.stringify(review));\r\n}", "title": "" }, { "docid": "cce3b5350fe279143759d067d54537c7", "score": "0.5325922", "text": "function viewpagesUpdate(request, response) {\r\n viewpagesDao.viewpagesUpdate(request)\r\n .then(function(results) {\r\n sendJSONresponse(response, 200, results);\r\n }, function(error) {\r\n sendJSONresponse(response, 404, error);\r\n });\r\n}", "title": "" }, { "docid": "6748e24f47426e34a54ee14a18384597", "score": "0.53230894", "text": "patchServer(){\n let data = {\n \"light\": this.light,\n \"curtain_height\": this.curtain,\n \"temp\": this.temp\n };\n this.updateDB(this.id, data);\n }", "title": "" }, { "docid": "fac36b4c7b150a276026ad73c5840212", "score": "0.53216386", "text": "update(new_stat_list) {\n this.stat = new_stat_list;\n this.view.updateView(this);\n }", "title": "" }, { "docid": "919037aa726926f30631b93f4ef9f2fb", "score": "0.53212106", "text": "todoModify(todoApiModel) {\n let todoJson = JSON.stringify(todoApiModel);\n\n return (\n axios\n .put(this.URL, todoJson)\n //현재 URL로 바디에 todoJson전달\n .then((response) => (response && response.data) || null)\n );\n }", "title": "" }, { "docid": "434aa32da786631300f5082364a7f20d", "score": "0.53183174", "text": "function updateResponseModalView(jsonObj) {\r\n\tresult = \"\";\r\n\tif (jsonObj.status == \"SUCCESS\") {\r\n\t\tvar item = jsonObj.list[0];\r\n\t\tvar subject = item.subject;\r\n\t\tvar content = item.content;\r\n\t\tvar response = item.response;\r\n\t\t\r\n\t\t$(\"input.uid\").val(item.uid);\r\n\t\t\r\n\t\t$(\"div#responseModalView h4.modal-title\").html(\"\");\r\n\t\t$(\"div#responseModalView h4.modal-title\").html(subject);\r\n\t\t\r\n\t\t$(\"div#responseModalView div.requestModalContent p\").html(\"\");\r\n\t\t$(\"div#responseModalView div.requestModalContent p\").html(content);\r\n\t\t\r\n\t\t$(\"div#responseModalView div.requestModalResponse p\").html(\"\");\r\n\t\t$(\"div#responseModalView div.requestModalResponse p\").html(response);\r\n\t\treturn true;\r\n\t} else {\r\n\t\talert(\"문의가 삭제되거나 없습니다.\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\treturn false;\r\n}", "title": "" }, { "docid": "9cb7093a7d97b326cfe8bb88ddd5eb61", "score": "0.531451", "text": "function patchingTweets (res, req) {\n var jsonObjectTweet = store.select('tweets', req.param.id);\n var newJsonOpjectTweet = req.body;\n \n if(jsonObjectTweet !== undefined){\n Object.assign(jsonObjectTweet, newJsonOpjectTweet);\n res.status(200).json(jsonObjectTweet);\n }else{\n res.status(404).send('Invalid id !');\n }\n}", "title": "" }, { "docid": "380edfbfc8367a17b46b2a1aa2093e87", "score": "0.53080916", "text": "function updateKitchen(){\n\n //build the obj to send to the api\n var kitchen = {\n 'parent_site': $scope.parentSite,\n 'description': $scope.kitchenEditDesc,\n 'hours': $scope.kitchenEditHours,\n 'kitchen_condition': $scope.kitchenEditCond,\n 'seating_capacity': $scope.kitchenEditCap\n };\n\n //Call the shelter update in the api\n $http.put('webapi/kitchen/update', kitchen)\n .then(function(response){\n //clear all edit fields\n $scope.kitchenEditDesc = null;\n $scope.kitchenSite = null;\n $scope.kitchenEditHours = null;\n $scope.kitchenEditCond = null;\n $scope.kitchenEditCap = null;\n\n //Handle the response\n if(response.status === 200){\n //hide everything\n hideAllOptions();\n //show the success message\n $scope.successMessage = true;\n }else{\n hideAllOptions();\n $scope.nonSuccessMessage = true;\n }\n });\n }", "title": "" }, { "docid": "a7e99595743dc377aa025203ed86d339", "score": "0.53023064", "text": "function changeQuantity(basketItemId, basketItemQuant) {\n updatedBasketItem = {};\n updatedBasketItem.id = basketItemId;\n var correctId = \"#quantityInput\" + basketItemId\n updatedBasketItem.quantity = JSON.parse($(correctId).val());\n console.log(JSON.stringify(updatedBasketItem));\n $.ajax({\n url: 'tier3/basketItems/',\n type: 'PUT',\n data: JSON.stringify(updatedBasketItem),\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n statusCode: {\n 200: function() {\n console.log('Quantity changed');\n location.reload();\n }\n } \n });\n}", "title": "" }, { "docid": "50021a5373217e087cf59832b0093059", "score": "0.53010577", "text": "handleUpdateView(id) {\n this.loadGenresWithIds(id); \n }", "title": "" }, { "docid": "a2ff1aeeaae88aa56d011fca1634a629", "score": "0.52969885", "text": "updateRp(data) {\n //this.setState({rps: JSON.parse(data)});\n this.update();\n }", "title": "" }, { "docid": "fcf1e318a7ec6571208431ef0a1979e6", "score": "0.5296476", "text": "function updateTask() {\n $.ajax({\n type: 'PUT',\n url: '/tasks',\n success: getData\n });\n}", "title": "" }, { "docid": "288a352efb81655b6304521e74748c26", "score": "0.5296427", "text": "function importInView(data) {\n $('#view').html(data);\n }", "title": "" }, { "docid": "7e5a6b2637a59e8361397f3936e054a3", "score": "0.5295314", "text": "function update() {\n data.update();\n\n // update display\n navigation.update(current_graph); //add current_graph to update to change selecetors depending on view\n current_graph.update()\n}", "title": "" }, { "docid": "93962541de1620d27f2bc82564a8aa89", "score": "0.5293226", "text": "function updateView() {\n document.getElementById('counter').innerText = store.getState().counter;\n document.getElementById('error').innerText = store.getState().error;\n}", "title": "" }, { "docid": "d767da47d61909ec612afb7b5cdaac1c", "score": "0.529169", "text": "updateView(view) {\n if (view === this.state.view) {\n return;\n }\n\n if ('edit' === this.state.view) {\n this.setState({\n 'loading': true\n });\n\n // Set a timeout so that the loading state is propagated before the optimizer runs\n setTimeout(() => {\n // If we're going from edit to another view, then run the optimization\n this.optimizeMods(this.props.mods);\n this.setState({\n 'view': view,\n 'loading': false\n });\n }, 0);\n } else {\n this.setState({\n 'view': view\n });\n }\n }", "title": "" }, { "docid": "0d214e3f9df40e0353d7337681ed31b9", "score": "0.5285851", "text": "function updateTviJson(tvi, json) {\n\tvar vm = json.valMul || 1;\n\tjson.in2050 = tvi.endVal / vm;\n\tjson.ctrlPts = [{ x: tvi.nowCtrl.x, y: tvi.nowCtrl.y / vm }, { x: tvi.endCtrl.x, y: tvi.endCtrl.y / vm }];\n}", "title": "" }, { "docid": "289869ac4a3b6b3c263970d06dca0dbf", "score": "0.5282463", "text": "function addDataToView(response){\n\n\t\t//Se obtienen los datos enviados desde index_view formato JSON\n\t\tvar result = JSON.parse(response);\n\n\t\tvar postsNew = result.posts;//Nuevos posteos a agregar a la lista posts de angularJs (ya sea los posteos de los usuarios o de las compañias)\n\n\n\n\n\t\t// Datos de posteos de FOTOS PROBADAS\n\n\n\n\t\t\n\t\t// Usuarios de los posteos de fotos probadas\n\t\tvar usersOfTestedPosts = result.usersOfTestedPosts;\n\n\t\t//Relacion entre prenda y foto (no es la prenda en si)\n\t\t// {id posteo: lista 1 solo objeto relacion prenda-foto (TestedGarmentPhoto_Garment)}\n\t\tvar garmentsTestedPhotos = result.garmentsTestedPhotos;\n\n\n\t\t//prendas\n\t\t// {id de prenda: lista de 1 sola prenda }\n\t\tvar garmentsOfTestedPosts = result.garmentsOfTestedPosts;\n\n\t\t//comentarios de las fotos de usuarios\n\t\tvar commentsOfTestedPosts = result.commentsOfTestedPosts;\n\n\t\t//usuarios de los comentarios\n\t\t// # {clave: id de posteo, valor: lista de 1 usuario (UserSite)}\n\t\tvar commentsUsersOfTestedPosts = result.commentsUsersOfTestedPosts;\n\n\t\t//Likes a los posteos de los usuarios\n\t\t// {postId: lista de likes a posteos de usuarios }\n\t\tvar likesToPhotos = result.likesToPhotos; \n\n\t\t//Fotos de perfil de los usuarios de los comentarios\n\t\t// {clave: id de usuario, valor: lista de UserSite (un solo objeto) }\n\t\tvar profilePhotosUsersOfComments = result.profilePhotosUsersOfComments; \n\n\t\t// Likes a los comentarios de las fotos probadas\n\t\tvar likesToCommentsOfTestedPhotos = result.likesToCommentsOfTestedPhotos; \n\n\t\t// usuarios de los likes a los comentarios de las fotos probadas\n\t\tvar usersOfLikesToCommentsOfTestedPhotos = result.usersOfLikesToCommentsOfTestedPhotos; \n\n\n\t\t// Se itera sobre cada POSTEO\n\n\n\t\t// Se verifica si es que existen posteos \n\t\tif(postsNew.length>0){\n\n\t\t\t// Se itera sobre cada posteo\n\t\t\tfor(var i=0;i<postsNew.length;i++){\n\n\t\t\t\t//Diccionario que se agrega a la lista posts de angular (del template) por cada posteo enviado por la vista index_view\n\t\t\t\tvar postObject = {}; \n\n\t\t\t\t// Cada poteo\n\t\t\t\tvar post = postsNew[i];\n\n\t\t\t\t// Si es que el psoteo es una foto probada de un usuario\n\t\t\t\tif(post.model.includes(\"testedgarmentphoto\")){\n\n\t\t\t\t\t//servicio llamado testedPost (ubicado en archivo testedPostService.js) cuya funcion getPostObjetc genera el objeto final que se agregará a la lista posts\n\t\t\t\t\tpostObject = testedPost.getPostObject(garmentsOfTestedPosts,post,usersOfTestedPosts,likesToPhotos,myId,garmentsTestedPhotos,commentsOfTestedPosts,commentsUsersOfTestedPosts,profilePhotosUsersOfComments,likesToCommentsOfTestedPhotos);\n\n\t\t\t\t}\n\n\n\t\t\t\t// Se agrega finalmente el objeto postObject a la lista posts (denomidada postsList en este archivo)\n\n\t\t\t\t$scope.$apply(function(){\n\n\t\t\t\t\tif(typeof $scope.postsList == \"undefined\"){\n\n\t\t\t\t\t\t$scope.postsList = [postObject];\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$scope.postsList.push(postObject);\n\n\t\t\t\t\t};\n\n\t\t\t\t});\n\n\t\t\t};\n\n\t\t};\n\n\t}", "title": "" }, { "docid": "3a85e158994531e38da83f65a69244e1", "score": "0.52819204", "text": "handleUpdate() {\n const UPDATEURL = `/gups/${this.state.id.value}`;\n\n const data = {\n region: this.state.region,\n country: this.state.country,\n bu: this.state.bu,\n gup: this.state.gup,\n site: this.state.site,\n location: this.state.location,\n contact: this.state.contact,\n bandwidth: this.state.bandwidth,\n pcs: this.state.pcs\n };\n\n var formBody = [];\n for (var property in data) {\n var encodedKey = encodeURIComponent(property);\n var encodedValue = encodeURIComponent(data[property]);\n formBody.push(encodedKey + \"=\" + encodedValue);\n }\n formBody = formBody.join(\"&\");\n\n\n fetch(UPDATEURL, {\n method: 'put',\n headers: {\n 'Accept' : 'application/json',\n 'Content-Type' : 'application/x-www-form-urlencoded'\n },\n body: formBody\n });\n \n this.setState({ open: false });\n\n }", "title": "" }, { "docid": "5b1da441d17ba4090dbc923919b5181e", "score": "0.5276721", "text": "function updateUserVersion(userId, updatedVersion) {\n var d = {\n \"field_362\": updatedVersion\n };\n $.ajax({\n url: \"https://api.knack.com/v1/objects/object_4/records/\" + userId,\n type: \"PUT\",\n headers: window.knackApiHeaders,\n data: JSON.stringify(d),\n success: function (data) {\n location.reload(true);\n },\n error: function (request, error) {\n console.log(error);\n }\n });\n }", "title": "" } ]
d245ccc49315737105ab65dd7e3bbde9
helper function for prettyprinting
[ { "docid": "ae0d0453a450175d9a4acb3173fbd23b", "score": "0.0", "text": "log_matrix(m) {\n for (let r = 0; r < m.length; r++) {\n let row = '';\n for (let c = 0; c < m[r].length; c++) {\n row += `${m[r][c]}, `;\n }\n console.log(row);\n }\n console.log('\\n');\n }", "title": "" } ]
[ { "docid": "f9de94f2795854d7ac3df14bcbebf9d2", "score": "0.7112284", "text": "pretty(indent_str = \" \") {\r\n return this._pretty(0, indent_str).join(\"\");\r\n }", "title": "" }, { "docid": "10c4855de01f79b10e2ef90e3375a614", "score": "0.71048206", "text": "function pretty(a) \n{\n\treturn '<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"100%\" class=\"EWTitle\" nowrap>' + a + '</td></tr>' +\n\t\t '<tr><td nowrap></td></tr></table>';\n}", "title": "" }, { "docid": "bb235d2dd09fb1fc4c42019d64239c7f", "score": "0.6722565", "text": "function prettify(obj) {\r\n return JSON.stringify(obj, null, 3);\r\n}", "title": "" }, { "docid": "888c8e818e68907c7c7d26b3e27530ba", "score": "0.6621598", "text": "function prettyPrint(x) {\n return util.inspect(x, opts);\n}", "title": "" }, { "docid": "781798d9a3b990608a0ce3a08ed526d7", "score": "0.6556126", "text": "text(pretty) {\n let printer = new Printer(this.store);\n if (pretty) printer.indent = \" \";\n printer.print(this);\n return printer.output;\n }", "title": "" }, { "docid": "1973f5669db3593453a52f010e3495b5", "score": "0.65395284", "text": "pretty() {\r\n let out = [\"Parser choices:\"];\r\n for (const [k, v] of dict_items(this.choices())) {\r\n out.push(format(\"\\t- %s -> %s\", k, v));\r\n }\r\n\r\n out.push(format(\"stack size: %s\", this.parser_state.state_stack.length));\r\n return out.join(\"\\n\");\r\n }", "title": "" }, { "docid": "d3c11bdb4e136c78f40a25d7242644a9", "score": "0.6536901", "text": "function pretty_print(sample_input){\n\n\t// lvl used to print --\n\tvar lvl = 0;\n\n\t// Helper function to traverse the tree\n\tfunction traversal(member, lvl){\n\n\t\t// print the name\n\t\tif(lvl < 1){\n\t\t\tconsole.log(member['name']); // This if statement was add because of \">\"\n\t\t} else{\n\t\t\tconsole.log(\"--\".repeat(lvl) + \"> \" + member['name']);\n\t\t}\n\n\t\t// Iterates and recurse until it gets to all children \n\t\tfor(var j=0; j<member['children'].length; j++){\n\t\t\ttraversal(member['children'][j], lvl+1);\n\t\t}\n\t\t\n\n\t}\n\n\t// First iteration and traversal\n\tfor(var i=0; i<sample_input.length; i++){\n\t\ttraversal(sample_input[i], lvl);\n\t}\n\n}", "title": "" }, { "docid": "815516f27703652c5b60529e0736042d", "score": "0.65356", "text": "function prettyPrint(node,options){return new printer_1.Printer(options).printGenerically(node);}", "title": "" }, { "docid": "5602b496add34af5b2d5e0c93e1cd291", "score": "0.6433026", "text": "function prettyFormat( record, schema, indent )\n{\n var result = \"\";\n if (\"title\" in schema)\n result += indent + schema.title + \"\\n\";\n\n if (\"properties\" in schema) {\n var schema_properties = schema.properties;\n for (var property in record) {\n if (property in schema_properties) {\n var schema_entry = schema_properties[property];\n var ptype = ((\"type\" in schema_entry) ? schema_entry[\"type\"] : \"undefined\");\n var title = ((\"title\" in schema_entry) ? schema_entry[\"title\"] : ptype);\n if (ptype == \"boolean\") {\n result += indent + \" \" + title + \": \" + (record[property]?\"true\":\"false\") + \"\\n\";\n }\n if (ptype == \"string\" || ptype == \"integer\" || ptype == \"number\" || ptype == \"any\")\n result += indent + \" \" + title + \": \" + record[property] + \"\\n\";\n else if (ptype == \"array\") {\n var a = record[property];\n if (a.length) {\n result += indent + \" \" + title + \": [\\n\";\n var array_schema = schema_entry[\"items\"];\n for (var i = 0 ; i < a.length ; i++ ) {\n result += prettyFormat( a[i], array_schema, indent + \" \");\n if (i < a.length - 1)\n result += indent + \" ---- \";\n }\n result += \"]\\n\";\n }\n else {\n result += indent + \" \" + title + \": []\\n\";\n }\n }\n else if (ptype == \"object\") {\n result += prettyFormat( record[property], schema_entry, indent + \" \");\n }\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "bb8fad942da3298de31e55471bb86752", "score": "0.637409", "text": "function prettyFormat(val, options) {\n if (options) {\n validateOptions(options);\n\n if (options.plugins) {\n const plugin = findPlugin(options.plugins, val);\n\n if (plugin !== null) {\n return printPlugin(plugin, val, getConfig(options), '', 0, []);\n }\n }\n }\n\n const basicResult = printBasicValue(\n val,\n getPrintFunctionName(options),\n getEscapeRegex(options),\n getEscapeString(options)\n );\n\n if (basicResult !== null) {\n return basicResult;\n }\n\n return printComplexValue(val, getConfig(options), '', 0, []);\n}", "title": "" }, { "docid": "d9cab6042c66b6dd27d5d028ebc927c4", "score": "0.6346505", "text": "function prettyPrint(node, options) {\n \t return new printer_1.Printer(options).printGenerically(node);\n \t}", "title": "" }, { "docid": "62b1c510b3b7262c495c92922f5b30e5", "score": "0.6314048", "text": "toPrettyString (indent) {\n indent = Util.default(indent, 0);\n\n let outString = furtherLine(Util.formatProp(this, 'name'));\n outString += furtherLine(this.templateName);\n\n const SKIP_PROPS = [\n 'name',\n 'templateName',\n 'id',\n 'parent',\n 'components'\n ];\n\n for (let prop in this) {\n if (! prop || Util.contains(SKIP_PROPS, prop)) {\n continue;\n }\n\n // outString += furtherLine(' ' + Util.formatProp(this, prop));\n }\n\n const headCount = this.headCount();\n if (headCount) {\n outString += furtherLine(` ${Util.commaNumber(headCount)} personnel`);\n }\n\n const weight = this.getWeight();\n if (weight) {\n outString += furtherLine(` ${Util.commaNumber(weight)} kg`);\n }\n\n const speed = this.getSpeed();\n if (speed) {\n // outString += furtherLine(` Mobility Rating: ${speed}`);\n }\n\n const stealth = this.getStealth();\n if (stealth) {\n // outString += furtherLine(` Stealth Rating: ${stealth}`);\n }\n\n if (this.components.length > 0) {\n outString += furtherLine(' w/');\n for (let component of this.components) {\n outString += component.toPrettyString(indent + 4);\n }\n }\n\n return outString;\n\n function furtherLine (text/*, indent*/) {\n return text ?\n Util.repeat(' ', indent) + text + '\\n' :\n '';\n }\n }", "title": "" }, { "docid": "ca68d0fafeaa0852659e4a5a81a6b8e1", "score": "0.6270504", "text": "function printPretty(actors, movies){\n\tvar string = \"\";\n\tconsole.log(movies);\n\tfor (var i=0;i<actors.length-1;i++){\n\t\tconsole.log(i);\n\t\tstring += actors[i] + \" and \" + actors[i+1] + \" worked with each other in \" + movies[i] + \". <br>\";\n\t}\n\treturn string;\n}", "title": "" }, { "docid": "bd3c5e1ef00311575cf6c0eb92818055", "score": "0.6267814", "text": "function prettify(input){\n var output = Math.round(input * 1000000)/1000000;\n\treturn output;\n}", "title": "" }, { "docid": "b7d80005702d1c0fbda92c82b532a0df", "score": "0.62602663", "text": "function prettyString(json) {\n // preserve the look of arrays in the display\n Object.keys(json).forEach((k) => {\n if(Array.isArray(json[k])) {\n json[k] = '[' + json[k].join('~') + ']';\n }\n });\n // line breaks for booleans and \",\" etc.\n return JSON.stringify(json).replace(/e,/g,'e<br/>').replace(/\",\"/g,'<br/>').replace(/[{}\"]/g,'').replace(/~/g,', ').replace(/:/g,'=');\n }", "title": "" }, { "docid": "347fa4c04d52e0c5892d742a8f6e1202", "score": "0.62391275", "text": "function prettyPrint() {\n var ugly = document.getElementById('myTextArea').value;\n var obj = JSON.parse(ugly);\n var pretty = JSON.stringify(obj, undefined, 4);\n document.getElementById('myTextArea').value = pretty;\n}", "title": "" }, { "docid": "85211fd19c5ccd6b166aaaa6badfe492", "score": "0.623233", "text": "get pretty() {\n return `${this.prettyValue}${this.prettySuit}`\n }", "title": "" }, { "docid": "0f5fead38766121f6169be88d4d84c2f", "score": "0.61863345", "text": "function prettify(input){\r\n\tvar output = Math.round(input * 1000000)/1000000;\r\n\treturn output;\r\n}", "title": "" }, { "docid": "6495ebd8aa5d7549bb21d97f4abdbedd", "score": "0.6185647", "text": "function printer_friendly() {\n\n }", "title": "" }, { "docid": "97971c691e8ea0d12d7df254dee4b5aa", "score": "0.61735773", "text": "function prettify() {\n function syntaxHighlight(json) {\n \tif(json && json !== \"\"){\n \t\tjson = JSON.stringify(JSON.parse(json),undefined,4);\n \t\tjson = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n \t\tjson = json.replace(/(\"(\\\\u[a-zA-Z0-9]{4}|\\\\[^u]|[^\\\\\"])*\"(\\s*:)?|\\b(true|false|null)\\b|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)/g, function (match) {\n \t\t\tif (/^\"/.test(match)) {\n \t\t\t\tif (/:$/.test(match)) {\n \t\t\t\t\tmatch = '<span class=\"json-key\">' + match.replace(/\"/g,\"\") + '</span>';\n \t\t\t\t}else{\n \t\t\t\t\tmatch = match.replace(/\"/g,\"\");\n \t\t\t\t}\n \t\t\t}\n \t\t\treturn match;\n \t\t});\n \t\tjson = json.substring(1,json.length -1);\n \t\treturn json;\n \t}\n \telse {\n \t\treturn \"\";\n \t}\n }\n return syntaxHighlight;\n }", "title": "" }, { "docid": "835299ed6545dc9413cf9c0dba13b778", "score": "0.6128312", "text": "function prettyPrint(node, options) {\n\t return new printer_1.Printer(options).printGenerically(node);\n\t}", "title": "" }, { "docid": "14edd0554b6652b1b1945b2a08764864", "score": "0.6085523", "text": "function exportText()\n{\n const padding = ' '; // 35 whitespaces\n\n const display = (found, obj) => {\n\tvar res = accumulate(found, obj);\n\tObject.keys(res).sort().forEach(p => {\n\t var left = p + ': ';\n\t var pad = padding.slice(left.length);\n\t console.log(left + pad + res[p]);\n\t});\n };\n\n console.log('# db props');\n display(byName, props.database);\n console.log('# srv props');\n display(byName, props.server);\n console.log('# db paths');\n display(byPath, props.database);\n console.log('# srv paths');\n display(byPath, props.server);\n}", "title": "" }, { "docid": "461a864c6087fd8c637d4c0e7f2363eb", "score": "0.60510087", "text": "function prettify(acceleration) {\n return 'Acceleration X: ' + acceleration.x + '<br>' +\n 'Acceleration Y: ' + acceleration.y + '<br>' +\n 'Acceleration Z: ' + acceleration.z + '<br>' +\n 'Timestamp: ' + acceleration.timestamp + '<br>' +\n '<hr />';\n }", "title": "" }, { "docid": "442d08b887ca80b0064f261bf5478484", "score": "0.60310745", "text": "function PrettyPrint(props) {\n return (\n <code>\n {JSON.stringify(props.value, null, 2)}\n </code>\n );\n}", "title": "" }, { "docid": "5cb5d584c977472b6e658df9872d7c0a", "score": "0.60112196", "text": "function prettyPrint (value) {\r\n return (JSON && JSON.stringify) ? JSON.stringify(value) : value;\r\n }", "title": "" }, { "docid": "0c32ae3e6ca512f87153409e8b957db1", "score": "0.59985906", "text": "function makePretty(html) {\n return html_beautify(html, {\n 'wrap_line_length': 0,\n unformatted: ['a', 'abbr', 'area', 'audio', 'b', 'bdi', 'bdo', 'cite', 'data', 'datalist', 'del', 'dfn', 'em', 'i', 'input', 'ins', 'kbd', 'keygen', 'map', 'mark', 'math', 'meter', 'noscript', 'output', 'progress', 'q', 'ruby', 's', 'samp', 'select', 'small', 'span', 'strong', 'sub', 'sup', 'template', 'time', 'u', 'var', 'wbr', 'text', 'acronym', 'address', 'big', 'dt', 'ins', 'small', 'strike', 'tt', 'pre'],\n extra_liners: []\n });\n }", "title": "" }, { "docid": "17da565573e3f9b84fbe266b91e2f776", "score": "0.5984749", "text": "function printPretty(root, level, indentSpace) {\n var h = maxHeight(root);\n var nodesInThisLevel = 1;\n \n var branchLen = 2 * (parseInt(Math.pow(2.0, h)) - 1) - (3 - level) * parseInt(Math.pow(2.0, h - 1)); // eq of the length of branch for each node of each level\n var nodeSpaceLen = 2 + (level + 1) * parseInt(Math.pow(2.0, h)); // distance between left neighbor node's right arm and right neighbor node's left arm\n var startLen = branchLen + (3 - level) + indentSpace; // starting space to the first node to print of each level (for the left most node of each level only)\n \n nodesQueue = [];\n nodesQueue.push(root);\n for (var r = 1; r < h; r++) {\n printBranches(branchLen, nodeSpaceLen, startLen, nodesInThisLevel, nodesQueue);\n out += '\\n'\n branchLen = branchLen / 2 - 1;\n nodeSpaceLen = nodeSpaceLen / 2 + 1;\n startLen = branchLen + (3 - level) + indentSpace;\n printNodes(branchLen, nodeSpaceLen, startLen, nodesInThisLevel, nodesQueue);\n out += '\\n'\n \n for (var i = 0; i < nodesInThisLevel; i++) {\n var currNode = nodesQueue.shift();\n \n if (currNode) {\n nodesQueue.push(currNode.left);\n nodesQueue.push(currNode.right);\n } else {\n nodesQueue.push(null);\n nodesQueue.push(null);\n }\n }\n nodesInThisLevel *= 2;\n }\n \n printBranches(branchLen, nodeSpaceLen, startLen, nodesInThisLevel, nodesQueue);\n out += '\\n'\n printLeaves(indentSpace, level, nodesInThisLevel, nodesQueue);\n out += '\\n'\n console.log(out);\n out = \"\";\n}", "title": "" }, { "docid": "89f33153f89d988b5287e1d14581cfe4", "score": "0.59813064", "text": "function prettyPrint (value) {\n return (JSON && JSON.stringify) ? JSON.stringify(value) : value;\n }", "title": "" }, { "docid": "89f33153f89d988b5287e1d14581cfe4", "score": "0.59813064", "text": "function prettyPrint (value) {\n return (JSON && JSON.stringify) ? JSON.stringify(value) : value;\n }", "title": "" }, { "docid": "f10634515c59388dc1174d649041b57b", "score": "0.5949142", "text": "function formatOut(obj) {\n if(obj.text.length > 200) {\n obj.text = obj.text.slice(0, 200);\n }\n\n //obj.code = \" `\" + obj.code + \"` \";\n return obj.text + ' \\n' + obj.code;\n}", "title": "" }, { "docid": "f8dd79c4cd70a37a026196e2f736f069", "score": "0.59474885", "text": "function dump_props(obj, obj_name) {\n var result = \"\";\n console.log('obj', obj);\n for (var i in obj) {\n result += obj_name + \".\" + i + \" = \" + obj[i] + \"<br>\";\n console.log('return', result );\n }\n result += \"<hr>\";\n return result;\n \n}", "title": "" }, { "docid": "c41014c2f60fc6bf397e899303990b61", "score": "0.5896448", "text": "function print(expr) {\r\n document.writeln(\"<p style='white-space:pre'>\" + get_display(expr) + \"</p>\")\r\n}", "title": "" }, { "docid": "990598c89930e5cea1fdc56a683587a1", "score": "0.5894794", "text": "function prettyPrint(ascii){\n\t\t\tconsole.log(buildAsciiWord(ascii));\n\t\t\t$('#output').text(buildAsciiWord(ascii));\n\t\t\t/*document.getElementById(\"output\").innerHTML=buildAsciiWord(ascii);*/\n\t\t}", "title": "" }, { "docid": "3280a8dbacb2c4e9c90311934b57a676", "score": "0.58783054", "text": "_stringifyObj(obj, indent) {\n if (!(obj instanceof Object)) {\n if (typeof obj !== \"undefined\" && obj.toString) {\n return obj.toString();\n }\n else {\n return \"\";\n }\n }\n let text = \"{\\n\";\n for (let prop of Object.keys(obj)) {\n let val = obj[prop];\n let attr = prop.replace(/([A-Z])/g, m => \"-\"+m.toLowerCase());\n val = val.reduce ? val.reduce((acc, item) =>\n acc + \" \" + this._stringifyObj(item, indent + \" \"), \"\") :\n val.rgbaString ? val.rgbaString : val.toString();\n val = val.replace(/\\s+/, \" \");\n if (val.substr(-2,1) !== \"}\") {\n text += `${indent} ${attr}: ${val};\\n`;\n }\n else {\n text += `${indent} ${attr} ${val}`;\n }\n }\n text += `${indent}}\\n`;\n return text;\n }", "title": "" }, { "docid": "89f4a92c8166f914d6468783363ff882", "score": "0.58687156", "text": "function print(str, indent, inline) {\n var lines = str.split('\\n');\n lines.forEach(function (line, i) {\n if (line && (inline && i > 0 || !inline)) {\n process.stdout.write(' '.repeat(indent));\n }\n\n var nl = i === lines.length - 1 ? '' : '\\n';\n process.stdout.write(\"\" + line + nl);\n });\n} // Print the AST in a nicely formatted tree format for debuggin", "title": "" }, { "docid": "3ea06b6d2a61046af720475e8f3debdb", "score": "0.5860981", "text": "function print_r(object){\r\n var maxIterations = 1000;\r\n // Max depth that Dumper will traverse in object\r\n var maxDepth = -1;\r\n var iterations = 0;\r\n var indent = 1;\r\n var indentText = \" \";\r\n var nl = \"\\n\";\r\n // Holds properties of top-level object to traverse - others are ignored\r\n var properties = null;\r\n\r\n function pad(len){\r\n var s = \"\";\r\n for (var i=0; i<len; i++){\r\n s += indentText;\r\n }\r\n return s;\r\n }\r\n\r\n function inspect(o){\r\n var level = 1;\r\n var indentLevel = indent;\r\n var r = \"\";\r\n if (arguments.length>1 && typeof(arguments[1])==\"number\"){\r\n level = arguments[1];\r\n indentLevel = arguments[2];\r\n if (o == object){\r\n return \"[original object]\";\r\n }\r\n } else {\r\n iterations = 0;\r\n object = o;\r\n // If a list of properties are passed in\r\n if (arguments.length>1){\r\n var list = arguments;\r\n var listIndex = 1;\r\n if (typeof(arguments[1])==\"object\"){\r\n list = arguments[1];\r\n listIndex = 0;\r\n }\r\n for (var i=listIndex; i<list.length; i++){\r\n if (properties == null){ properties = {}; }\r\n properties[list[i]]=1;\r\n }\r\n }\r\n }\r\n // Just in case, so the script doesn't hang\r\n if (iterations++>maxIterations){ return r +\"\\n[Max Iterations Reached]\"; }\r\n\r\n if (maxDepth != -1 && level > (maxDepth+1)){\r\n return \"...\";\r\n }\r\n // undefined\r\n if (typeof(o)==\"undefined\"){\r\n return \"[undefined]\";\r\n }\r\n // NULL\r\n if (o==null){\r\n return \"[null]\";\r\n }\r\n // DOM Object\r\n if (o==window){\r\n return \"[window]\";\r\n }\r\n if (o==window.document){\r\n return \"[document]\";\r\n }\r\n // FUNCTION\r\n if (typeof(o)==\"function\"){\r\n return \"[function]\";\r\n }\r\n // BOOLEAN\r\n if (typeof(o)==\"boolean\"){\r\n return (o)?\"true\":\"false\";\r\n }\r\n // STRING\r\n if (typeof(o)==\"string\"){\r\n return \"'\" + o + \"'\";\r\n }\r\n // NUMBER\r\n if (typeof(o)==\"number\"){\r\n return o;\r\n }\r\n if (typeof(o)==\"object\"){\r\n if (typeof(o.length)==\"number\" ){\r\n // ARRAY\r\n if (maxDepth != -1 && level > maxDepth){\r\n return \"[ ... ]\";\r\n }\r\n r = \"[\";\r\n for (var i=0; i<o.length;i++){\r\n if (i>0){\r\n r += \",\" + nl + pad(indentLevel);\r\n } else {\r\n r += nl + pad(indentLevel);\r\n }\r\n r += inspect(o[i],level+1,indentLevel-0+indent);\r\n }\r\n if (i > 0){\r\n r += nl + pad(indentLevel-indent);\r\n }\r\n r += \"]\";\r\n return r;\r\n } else {\r\n // OBJECT\r\n if (maxDepth != -1 && level > maxDepth){\r\n return \"{ ... }\";\r\n }\r\n r = \"{\";\r\n var count = 0;\r\n for (i in o){\r\n if (o==object && properties!=null && properties[i]!=1){\r\n // do nothing with this node\r\n } else {\r\n try {\r\n if (typeof(o[i]) != \"unknown\"){\r\n var processAttribute = true;\r\n // Check if this is a DOM object, and if so, if we have to limit properties to look at\r\n if ( o.ownerDocument || o.tagName || (o.nodeType && o.nodeName)){\r\n processAttribute = false;\r\n if (i==\"tagName\" || i==\"nodeName\" || i==\"nodeType\" || i==\"id\" || i==\"className\"){\r\n processAttribute = true;\r\n }\r\n }\r\n if (processAttribute){\r\n if (count++>0){\r\n r += \",\" + nl + pad(indentLevel);\r\n } else {\r\n r += nl + pad(indentLevel);\r\n }\r\n r += \"'\" + i + \"' : \" + inspect(o[i],level+1,indentLevel-0+i.length+6+indent);\r\n } else {\r\n //r += \"'\" + i + \"' : \" + typeof(o[i]);\r\n }\r\n }\r\n } catch(e) {\r\n //alert( print_r(e) )\r\n }\r\n }\r\n }\r\n if (count > 0){\r\n r += nl + pad(indentLevel-indent);\r\n }\r\n r += \"}\";\r\n return r;\r\n }\r\n }\r\n }\r\n return inspect(object);\r\n}", "title": "" }, { "docid": "7f192e4fe569795480a8124046f86a11", "score": "0.5855666", "text": "getDump(indent = '') {\n let result = indent + ts.SyntaxKind[this.node.kind] + ': ';\n if (this.prefix) {\n result += ' pre=[' + this._getTrimmed(this.prefix) + ']';\n }\n if (this.suffix) {\n result += ' suf=[' + this._getTrimmed(this.suffix) + ']';\n }\n if (this.separator) {\n result += ' sep=[' + this._getTrimmed(this.separator) + ']';\n }\n result += '\\n';\n for (const child of this.children) {\n result += child.getDump(indent + ' ');\n }\n return result;\n }", "title": "" }, { "docid": "f0f54f5caecf9920c3d51dd845d6649a", "score": "0.58543646", "text": "function prettyPrintJSON(template_json){\n\tvar str = \"\"\n\tfor (field in template_json) {\n\t\tif (typeof template_json[field] == 'object'){\n\t\t\tstr += prettyPrintJSON(template_json[field]) + '<tr><td></td><td></td></tr>';\n\t\t} else {\n\t\t\tstr += '<tr><td class=\"key_td\">'+field+'</td><td class=\"value_td\">'+template_json[field]+'</td></tr>';\n\t\t};\n\t};\n\treturn str;\n}", "title": "" }, { "docid": "424aa8fdbdc830a8bfeaf9c16efe92a5", "score": "0.58486307", "text": "function prettyPrint(input, options, pad) {\n if (pad === void 0) { pad = ''; }\n // sensible option defaults\n var defaultOptions = {\n indent: '\\t',\n singleQuotes: true\n };\n var combinedOptions = __assign(__assign({}, defaultOptions), options);\n var tokens;\n if (combinedOptions.inlineCharacterLimit === undefined) {\n tokens = {\n newLine: '\\n',\n newLineOrSpace: '\\n',\n pad: pad,\n indent: pad + combinedOptions.indent\n };\n }\n else {\n tokens = {\n newLine: '@@__PRETTY_PRINT_NEW_LINE__@@',\n newLineOrSpace: '@@__PRETTY_PRINT_NEW_LINE_OR_SPACE__@@',\n pad: '@@__PRETTY_PRINT_PAD__@@',\n indent: '@@__PRETTY_PRINT_INDENT__@@'\n };\n }\n var expandWhiteSpace = function (string) {\n if (combinedOptions.inlineCharacterLimit === undefined) {\n return string;\n }\n var oneLined = string\n .replace(new RegExp(tokens.newLine, 'g'), '')\n .replace(new RegExp(tokens.newLineOrSpace, 'g'), ' ')\n .replace(new RegExp(tokens.pad + '|' + tokens.indent, 'g'), '');\n if (oneLined.length <= combinedOptions.inlineCharacterLimit) {\n return oneLined;\n }\n return string\n .replace(new RegExp(tokens.newLine + '|' + tokens.newLineOrSpace, 'g'), '\\n')\n .replace(new RegExp(tokens.pad, 'g'), pad)\n .replace(new RegExp(tokens.indent, 'g'), pad + combinedOptions.indent);\n };\n if (seen.indexOf(input) !== -1) {\n return '\"[Circular]\"';\n }\n if (input === null ||\n input === undefined ||\n typeof input === 'number' ||\n typeof input === 'boolean' ||\n typeof input === 'function' ||\n typeof input === 'symbol' ||\n isRegexp(input)) {\n return String(input);\n }\n if (input instanceof Date) {\n return \"new Date('\" + input.toISOString() + \"')\";\n }\n if (Array.isArray(input)) {\n if (input.length === 0) {\n return '[]';\n }\n seen.push(input);\n var ret = '[' + tokens.newLine + input.map(function (el, i) {\n var eol = input.length - 1 === i ? tokens.newLine : ',' + tokens.newLineOrSpace;\n var value = prettyPrint(el, combinedOptions, pad + combinedOptions.indent);\n if (combinedOptions.transform) {\n value = combinedOptions.transform(input, i, value);\n }\n return tokens.indent + value + eol;\n }).join('') + tokens.pad + ']';\n seen.pop();\n return expandWhiteSpace(ret);\n }\n if (isObj(input)) {\n var objKeys_1 = __spreadArrays(Object.keys(input), (getOwnEnumPropSymbols(input)));\n if (combinedOptions.filter) {\n objKeys_1 = objKeys_1.filter(function (el) { return combinedOptions.filter && combinedOptions.filter(input, el); });\n }\n if (objKeys_1.length === 0) {\n return '{}';\n }\n seen.push(input);\n var ret = '{' + tokens.newLine + objKeys_1.map(function (el, i) {\n var eol = objKeys_1.length - 1 === i ? tokens.newLine : ',' + tokens.newLineOrSpace;\n var isSymbol = typeof el === 'symbol';\n var isClassic = !isSymbol && /^[a-z$_][a-z$_0-9]*$/i.test(el.toString());\n var key = isSymbol || isClassic ? el : prettyPrint(el, combinedOptions);\n var value = prettyPrint(input[el], combinedOptions, pad + combinedOptions.indent);\n if (combinedOptions.transform) {\n value = combinedOptions.transform(input, el, value);\n }\n return tokens.indent + String(key) + ': ' + value + eol;\n }).join('') + tokens.pad + '}';\n seen.pop();\n return expandWhiteSpace(ret);\n }\n input = String(input).replace(/[\\r\\n]/g, function (x) { return x === '\\n' ? '\\\\n' : '\\\\r'; });\n if (!combinedOptions.singleQuotes) {\n input = input.replace(/\"/g, '\\\\\"');\n return \"\\\"\" + input + \"\\\"\";\n }\n input = input.replace(/\\\\?'/g, '\\\\\\'');\n return \"'\" + input + \"'\";\n}", "title": "" }, { "docid": "8b4226e1779c59fb7f1839d3f3c2014c", "score": "0.58427876", "text": "dump(input, inline, indent, exceptionOnInvalidType, objectEncoder = null) {\n if (inline == null) { inline = 0; }\n if (indent == null) { indent = 0; }\n if (exceptionOnInvalidType == null) { exceptionOnInvalidType = false; }\n let output = '';\n\n if (typeof (input) === 'function') {\n return output;\n }\n\n const prefix = (indent ? Utils.strRepeat(' ', indent) : '');\n\n if ((inline <= 0) || (typeof (input) !== 'object') || input instanceof Date || Utils.isEmpty(input)) {\n output += prefix + Inline.dump(input, exceptionOnInvalidType, objectEncoder);\n\n } else {\n let value, willBeInlined;\n if (input instanceof Array) {\n for (value of Array.from(input)) {\n willBeInlined = (((inline - 1) <= 0) || (typeof (value) !== 'object') || Utils.isEmpty(value));\n\n output +=\n prefix +\n '- ' +\n this.dump(value, inline - 1, (willBeInlined ? 0 : indent + this.indentation), exceptionOnInvalidType, objectEncoder) +\n (willBeInlined ? \"\\n\" : '');\n }\n\n } else {\n for (let key in input) {\n value = input[key];\n willBeInlined = (((inline - 1) <= 0) || (typeof (value) !== 'object') || Utils.isEmpty(value));\n\n output +=\n prefix +\n Inline.dump(key, exceptionOnInvalidType, objectEncoder) + ':' +\n (willBeInlined ? ' ' : \"\\n\") +\n this.dump(value, inline - 1, (willBeInlined ? 0 : indent + this.indentation), exceptionOnInvalidType, objectEncoder) +\n (willBeInlined ? \"\\n\" : '');\n }\n }\n }\n\n return output;\n }", "title": "" }, { "docid": "2f3353b0583f831eeaf197b619c44a85", "score": "0.5827642", "text": "function pretty() {\n\t$('.audio').css({\"margin-right\":\"5px\", \"margin-top\":\"2px\"});\n\t$('.word_title').css({\"color\":\"#D03071\", \"font-size\":\"10pt\", \"font-weight\":\"bold\", \"clear\":\"both\"});\n\t$('.pronounce').css({\"font-style\":\"italic\", \"display\":\"inline\", \"margin-top\":\"5px\"});\n\t$('.phanloai').css({\"color\":\"#D03071\",\"clear\":\"both\", \"font-weight\":\"bold\", \"border-top\":\"1px solid #666\", \"border-bottom\":\"1px solid #666\", \"background\":\"#eee\", \"margin\":\"5px\", \"padding\":\"3px\"});\n\t$('.list1').css({\"list-style-type\":\"circle\", \"background\":\"none\", \"padding\":\"0px\", \"margin-left\":\"30px\", \"margin-bottom\":\"15px\"});\n\t$('.list1 li').css({\"list-style-type\":\"circle\",\"background\":\"none\", \"padding\":\"0px\"});\n}", "title": "" }, { "docid": "09dfcb336ee673daddef37fb3e892904", "score": "0.58136743", "text": "function makePretty (p) {\n\t var dep = p[0]\n\t var depname = p[1]\n\t var dir = dep.path\n\t var has = p[2]\n\t var want = p[3]\n\t var latest = p[4]\n\t var type = p[6]\n\t var deppath = p[7]\n\n\t if (!npm.config.get('global')) {\n\t dir = path.relative(process.cwd(), dir)\n\t }\n\n\t var columns = [ depname,\n\t has || 'MISSING',\n\t want,\n\t latest,\n\t deppath\n\t ]\n\t if (long) columns[5] = type\n\n\t if (npm.color) {\n\t columns[0] = color[has === want || want === 'linked' ? 'yellow' : 'red'](columns[0]) // dep\n\t columns[2] = color.green(columns[2]) // want\n\t columns[3] = color.magenta(columns[3]) // latest\n\t }\n\n\t return columns\n\t}", "title": "" }, { "docid": "1b74765b72182db0e825aa20ac950f5a", "score": "0.5790284", "text": "function sprintUnderLine() {\r\n return \"-------------------------------------------------------------------------\"\r\n}", "title": "" }, { "docid": "32173b51014e9a7cd73f2f58c598c836", "score": "0.57673424", "text": "function addIndentation(indent) {\r\n\r\n indent += 1;\r\n var str = \"\";\r\n\r\n for (var i = 0; i < indent; i++)\r\n str += \"\\t\";\r\n\r\n return str;\r\n\r\n}", "title": "" }, { "docid": "59e421e1239b1e19235f96b1bbfeebd9", "score": "0.5759837", "text": "function dump(arr,level) {\n var dumped_text = \"\";\n if (!level) level = 0;\n\n //The padding given at the beginning of the line.\n var level_padding = \"\";\n for(var j=0;j<level+1;j++) level_padding += \" \";\n\n if (typeof(arr) == 'object') { //Array/Hashes/Objects\n for(var item in arr) {\n var value = arr[item];\n\n if (typeof(value) == 'object') { //If it is an array,\n dumped_text += level_padding + \"'\" + item + \"' ...\\n\";\n dumped_text += dump(value,level+1);\n } else {\n dumped_text += level_padding + \"'\" + item + \"' => \\\"\" + value + \"\\\"\\n\";\n }\n }\n } else { //Stings/Chars/Numbers etc.\n dumped_text = \"===>\"+arr+\"<===(\"+typeof(arr)+\")\";\n }\n return dumped_text;\n}", "title": "" }, { "docid": "07ca45667de247bdd6b1486b887fdde1", "score": "0.5729153", "text": "function format() {\n}", "title": "" }, { "docid": "2e8dba9448bd2f3a4eafeaf95a86eb05", "score": "0.5723826", "text": "function print_r(theObj){\r\n var stmp = \"\";\r\n if(theObj.constructor == Array ||\r\n theObj.constructor == Object){\r\n stmp += \"<ul>\";\r\n for(var p in theObj){\r\n if(theObj[p].constructor == Array||\r\n theObj[p].constructor == Object){\r\n\t\t\tstmp += \"<li>[\"+p+\"] => \"+typeof(theObj)+\"</li>\";\r\n \tstmp += \"<ul>\";\r\n \tstmp += print_r(theObj[p]);\r\n \tstmp += \"</ul>\";\r\n } else {\r\n\t\t\tstmp += \"<li>[\"+p+\"] => \"+theObj[p]+\"</li>\";\r\n }\r\n }\r\n stmp += \"</ul>\";\r\n }\r\n return stmp;\r\n}", "title": "" }, { "docid": "df4610167cfe7307fd79c42082af9b60", "score": "0.5721631", "text": "function prettyPrintPowers(powers, level) {\n\tvar result = \"\";\n\tif (powers.length == 0) {\n\t\treturn result;\n\t}\n\tresult += \"<strong>Level \" + level + \"</strong><br><br>\";\n\tresult += \"<ul>\";\n\tfor (var i = 0; i < powers.length; i++) {\n\t\tvar power = powers[i];\n\t\tresult += \"<li>\";\n\t\tresult += power.name;\n\t\tresult += \"</li>\";\n\t\t// var power = powers[i];\n\t\t// result += \"<strong>\" + power.name + \"</strong><br>\";\n\t\t// result += power.description;\n\t\t// result += \"<br><br>\";\n\t}\n\tresult += \"</ul>\";\n\treturn result;\n}", "title": "" }, { "docid": "395a29dfb545bf3697d0a78e20ebbe95", "score": "0.57105815", "text": "function pretty(x) {\n if (x.type) {\n return {id: x.id, type: x.type};\n } else if (x.length) {\n return x.map(pretty);\n } else {\n return x;\n }\n }", "title": "" }, { "docid": "892d806bf94a814b5c1c670520beaad8", "score": "0.56914467", "text": "function dump(arr,level) {\n\tvar dumped_text = \"\";\n\tif(!level) {\n level = 0;\n }\n\n\t//The padding given at the beginning of the line.\n\tvar level_padding = \"\";\n\tfor(var j=0;j<level+1;j++) {\n level_padding += \" \";\n }\n\n\tif(typeof(arr) == 'object') { //Array/Hashes/Objects\n\t\tfor(var item in arr) {\n\t\t\tvar value = arr[item];\n\n\t\t\tif(typeof(value) == 'object') { //If it is an array,\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' ...\\n\";\n\t\t\t\tdumped_text += dump(value,level+1);\n\t\t\t} else {\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' => \\\"\" + value + \"\\\"\\n\";\n\t\t\t}\n\t\t}\n\t} else { //Stings/Chars/Numbers etc.\n\t\tdumped_text = \"===>\"+arr+\"<===(\"+typeof(arr)+\")\";\n\t}\n\treturn dumped_text;\n}", "title": "" }, { "docid": "ca68dd2050dde1f874861fd7bfef53ee", "score": "0.56799185", "text": "function printObjectProperties(val, config, indentation, depth, refs, printer) {\n var result = '';var keys$$1 = _Object$keys(val).sort();var symbols = getSymbols(val);if (symbols.length) {\n keys$$1 = keys$$1.filter(function (key) {\n return !isSymbol(key);\n }).concat(symbols);\n }if (keys$$1.length) {\n result += config.spacingOuter;var indentationNext = indentation + config.indent;for (var i = 0; i < keys$$1.length; i++) {\n var key = keys$$1[i];\n var name = printer(key, config, indentationNext, depth, refs);\n var value = printer(val[key], config, indentationNext, depth, refs);\n\n result += indentationNext + name + ': ' + value;\n\n if (i < keys$$1.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n }", "title": "" }, { "docid": "8d2d754fbd4355c6678963ef4d277f05", "score": "0.56796205", "text": "function formattedJSON(jobj,output_to) {\n\tvar result_str = \"\";\n\tif(output_to == \"file\"){\t\t\t\t\t\n\t\tresult_str = JSON.stringify(jobj, null, '\\t');\n\t\tresult_str = result_str.replace(/\\t/g, \" \");\n\t\tresult_str = result_str.replace(/\\n/g, \"\\n\");\n\t}\n\telse {\n\t\tresult_str = JSON.stringify(jobj, null, '\\t');\n\t\tresult_str = result_str.replace(/\\t/g, \"&nbsp;&nbsp;\");\n\t\tresult_str = result_str.replace(/\\n/g, \"<br>\");\t\t\t\t\n\t}\n\treturn result_str;\t\t\t\t\t\n}", "title": "" }, { "docid": "a9a097502179f4566a7ded443c02be8b", "score": "0.5670889", "text": "function printASTIndent(node, tabVal){\n\n if(typeof tabVal === 'undefined'){\n tabVal = 0;\n }\n var tabs = \"\";\n for(var i = 0; i < tabVal; i++){\n tabs= tabs.concat(\" \");\n }\n var result = \"\";\n for(var param in node){\n if (node.hasOwnProperty(param)){\n var curNode;\n if(typeof node[param] === 'object' && node[param] !== null){\n curNode ='\\n' + printASTIndent(node[param], tabVal+1);\n result +=tabs + param +\":\" + curNode;\n\n }\n else{\n curNode = node[param];\n result +=tabs + param +\":\" + curNode + '\\n';\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "925091a62cdaa8950614283909a8aeda", "score": "0.5669372", "text": "function prettyPrintCharacter() {\n\tvar result = \"\";\n\tresult += \"<h1>\" + _character.name + \"</h1>\";\n\tresult += \"<p><strong>Player: </strong>\" + _character.player + \"</p>\";\n\tresult += \"<h2>Background/Bio</h2>\";\n\tresult += \"<p>\" + _character.bio + \"</p>\";\n\t\n\tresult += \"<h2>Stats</h2>\";\n\n\tresult += \"<p><strong>Class:</strong> \";\n\tresult += _character.characterClass == \"None\" ? \"TBC\" : _character.characterClass.name;\n\tresult += \"</p>\";\n\tif (_character.characterClass.id == \"class_journeyman\") {\n\t\tresult += \"<p><strong>Skill Focus: </strong>\";\n\t\tvar sf = findById(data._skills, _character.skillFocus);\n\t\tresult += _character.skillFocus == \"None\" ? \"TBC\" : sf.name;\n\t\tresult += \"</p>\";\n\t}\n\tif (_character.characterClass.id == \"class_mage\") {\n\t\tresult += \"<p><strong>Primary Rite:</strong> \";\n\t\tresult += _character.primaryRite == \"None\" ? \"TBC\" : data._rites[_character.primaryRite].name;\n\t\tresult += \"</p>\";\n\t\tresult += \"<p><strong>Secondary Rite:</strong> \";\n\t\tresult += _character.secondaryRite == \"None\" ? \"TBC\" : data._rites[_character.secondaryRite].name;\n\t\tresult += \"</p>\";\n\t}\n\n\tresult += \"<p><strong>Background #1:</strong> \";\n\tresult += _character.background[1] == \"None\" ? \"None\" : _character.background[1].name;\n\tresult += \"</p>\";\n\tresult += \"<p><strong>Background #2:</strong> \";\n\tresult += _character.background[2] == \"None\" ? \"None\" : _character.background[2].name;\n\tresult += \"</p>\";\n\n\tresult += \"<h3>Skills</h3>\";\n\tif (_character.level1.length > 0) {\n\t\tresult += \"<strong>Level 1</strong>\" + prettyListLevelSkills(_character.level1);\n\t\tif (_character.level2.length > 0) {\n\t\t\tresult += \"<strong>Level 2</strong>\" + prettyListLevelSkills(_character.level2);\n\t\t\tif (_character.level3.length > 0) {\n\t\t\t\tresult += \"<strong>Level 3</strong>\" + prettyListLevelSkills(_character.level3);\n\t\t\t\tif (_character.level4.length > 0) {\n\t\t\t\t\tresult += \"<strong>Level 4</strong>\" + prettyListLevelSkills(_character.level4);\n\t\t\t\t\tif (_character.level5.length > 0) {\n\t\t\t\t\t\tresult += \"<strong>Level 5</strong>\" + prettyListLevelSkills(_character.level5);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tresult += \"None yet :(\";\n\t}\n\n\tresult += \"<p><strong>Experience: </strong>\" + _character.spentXP + \"/\" + _character.availableXP + \"</p>\";\n\n\tresult += \"<h3>Combat</h3>\";\n\tresult += \"<p><strong>Body Hits: </strong>\" + _character.hits + \"</p>\";\n\tresult += \"<p><strong>Armour Hits: </strong>\" + _character.armour + \"</p>\";\n\n\treturn result;\n}", "title": "" }, { "docid": "aee3c5a4e122f6a5018015ed0ea7c4c2", "score": "0.56654507", "text": "pretty() {\n return JSON.stringify(this.query, null, 4);\n }", "title": "" }, { "docid": "1593e23d0e9fb5cb0215d5cf7a800d9e", "score": "0.56631875", "text": "function dump(arr,level) {\n\tvar dumped_text = \"\";\n\tif(!level) level = 0;\n\n\t// Padding au début de la ligne\n\tvar level_padding = \"\";\n\tfor(var j=0;j<level+1;j++) level_padding += \" \";\n\n\tif(typeof(arr) == 'object') { //Array/Hashes/Objects\n\t\tfor(var item in arr) {\n\t\t\tvar value = arr[item];\n\n\t\t\tif(typeof(value) == 'object') { //If it is an array,\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' ...\\n\";\n\t\t\t\tdumped_text += dump(value,level+1);\n\t\t\t} else {\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' => \\\"\" + value + \"\\\"\\n\";\n\t\t\t}\n\t\t}\n\t} else { //Strings/Chars/Numbers etc.\n\t\tdumped_text = \"===>\"+arr+\"<===(\"+typeof(arr)+\")\";\n\t}\n\treturn dumped_text;\n}", "title": "" }, { "docid": "f2da98d1b66c219421698e059dba7a53", "score": "0.56413186", "text": "function printValues(obj) {\n var section = \"\";\n for (var k in obj) {\n let text = \"\" + obj[k];\n if (text.startsWith('<')) {\n section = section + text;\n } else {\n section = section + \"<p>\" + text + \"</p>\";\n }\n }\n return section;\n}", "title": "" }, { "docid": "bbd99d2bd8c8e146b846ddc35b3fcd08", "score": "0.56317914", "text": "function prettyPrintValue(value) {\n return JSON.stringify(value);\n}", "title": "" }, { "docid": "71821add44f0e4d1444509b6d8ee7adc", "score": "0.5628565", "text": "function printJsonAsHTML(someObj, indentLvl=0) {\n // console.log('linesRemainToProcess=',linesRemainToProcess);\n let finalStrHTMLarr = \"\";\n let textSizeSwitch = true;\n let margin = indentLvl * 20;\n let textStartSize = 18;\n let textSize = textStartSize - indentLvl;\n for (let i in someObj) {\n if( someObj.hasOwnProperty(i) ) {\n if (typeof someObj[i] === 'object') {\n if (Array.isArray(someObj[i]) === true) { // beginning of array\n finalStrHTMLarr += \"<p style='margin-left: \"+margin+\"px; font-size: \"+textSize+\"px;'>\"+i+\": \" + \"(arr length=\" + someObj[i].length + \")\" + \"</p>\";\n linesRemainToProcess -= 1;\n if (linesRemainToProcess < 1) {\n // skip it\n } else {\n finalStrHTMLarr += printJsonAsHTML(someObj[i], indentLvl+1);\n }\n } else { // non-array obj\n finalStrHTMLarr += \"<p style='margin-left: \"+margin+\"px; font-size: \"+textSize+\"px;'>\"+i+\": \" + \"(obj length=\" + Object.keys(someObj[i]).length + \")\" + \"</p>\";\n linesRemainToProcess -= 1;\n if (linesRemainToProcess < 1) {\n // skip it\n } else {\n finalStrHTMLarr += printJsonAsHTML(someObj[i], indentLvl+1);\n }\n }\n } else if (typeof someObj[i] === 'string') {\n finalStrHTMLarr += \"<p style='margin-left: \"+margin+\"px; font-size: \"+textSize+\"px;'>\"+i+\": '\" + \"<span class='greenString'>\" + someObj[i] + \"</span>\" + \"'\" + \"</p>\";\n linesRemainToProcess -= 1;\n } else if (typeof someObj[i] === 'number') {\n finalStrHTMLarr += \"<p style='margin-left: \"+margin+\"px; font-size: \"+textSize+\"px;'>\"+i+\": \" + \"<span class='redNum'>\" + someObj[i] + \"</span>\" + \"</p>\";\n linesRemainToProcess -= 1;\n } else {\n console.log('undefined type');\n }\n } else {\n console.log(\"someObj.hasOwnProperty(i) = false\");\n }\n } // for\n return finalStrHTMLarr;\n } // printJsonAsHTML", "title": "" }, { "docid": "76e045eff29b47a78cf60513f0100609", "score": "0.56127274", "text": "function makeCardsPretty() {\n var data = dbFC.getData(\"/\");\n var houseOfCards = \"\";\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n console.log(\"Q: \" + data[key].front + \"\\nA: \" + data[key].back + \"\\n---------\");\n }\n }\n }", "title": "" }, { "docid": "33fc226893083ff2aedd057ca968e7f6", "score": "0.56105196", "text": "function print(str, indent, inline) {\n\t var lines = str.split('\\n');\n\n\t for(var i=0; i<lines.length; i++) {\n\t if(lines[i]) {\n\t if((inline && i > 0) || !inline) {\n\t for(var j=0; j<indent; j++) {\n\t process.stdout.write(' ');\n\t }\n\t }\n\t }\n\n\t if(i === lines.length-1) {\n\t process.stdout.write(lines[i]);\n\t }\n\t else {\n\t process.stdout.write(lines[i] + '\\n');\n\t }\n\t }\n\t }", "title": "" }, { "docid": "7d96d60d77cd07e4fc8a5008ab8bbd17", "score": "0.56039447", "text": "function printPyretStack(stack, verbose) {\n if (stack === undefined) return \" undefined\";\n if (!verbose) {\n stack = stack.filter(function(val) { return val instanceof Array && val.length == 7; });\n }\n var stackStr = stack.map(function(val) {\n if (val instanceof Array && val.length == 7) {\n return (val[0] + \": line \" + val[1] + \", column \" + val[2]);\n } else if (val) {\n return JSON.stringify(val);\n }\n });\n return \" \" + stackStr.join(\"\\n \");\n }", "title": "" }, { "docid": "1814649fe3fcde9212c509fdf5af2cb0", "score": "0.56028724", "text": "function prettify(heading) {\n return 'Heading: ' + heading.magneticHeading;\n }", "title": "" }, { "docid": "ed716adcaac0364ab0817bfd183a4f55", "score": "0.5599035", "text": "function printListItems(list, config, indentation, depth, refs, printer) {\n var result = '';if (list.length) {\n result += config.spacingOuter;var indentationNext = indentation + config.indent;for (var i = 0; i < list.length; i++) {\n result += indentationNext + printer(list[i], config, indentationNext, depth, refs);if (i < list.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }result += config.spacingOuter + indentation;\n }return result;\n } // Return properties of an object", "title": "" }, { "docid": "fec011d1516940d43d533f80ae3078c4", "score": "0.558936", "text": "function IpadicFormatter() {\n\t}", "title": "" }, { "docid": "f9901e62923e535680ff3f69abd3147d", "score": "0.5588427", "text": "function weirdFormatting() {\n // it ends on the next line intentionally\n }", "title": "" }, { "docid": "cba5915eef5ca3433090a31497fc4820", "score": "0.5564675", "text": "inspect(opts = {}) {\n const options = {\n indent: 0,\n ...opts,\n };\n\n let indentation = '';\n for (let i = 0; i < options.indent; i++) {\n indentation += ' ';\n }\n\n return `${indentation}(NullPatch)\\n`;\n }", "title": "" }, { "docid": "801dca9653914e512ac3d1ab16b2189f", "score": "0.5548299", "text": "function prettify(position) {\n return 'Latitude: ' + position.coords.latitude + '<br />' +\n 'Longitude: ' + position.coords.longitude + '<br />' +\n '<hr />' ;\n }", "title": "" }, { "docid": "b0693728578112862fe42d0fa6ca438e", "score": "0.55440414", "text": "function printObjectProperties(val, config, indentation, depth, refs, printer) {\n var result = '';\n var keys = getKeysOfEnumerableProperties(val);\n\n if (keys.length) {\n result += config.spacingOuter;\n var indentationNext = indentation + config.indent;\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var name = printer(key, config, indentationNext, depth, refs);\n var value = printer(val[key], config, indentationNext, depth, refs);\n result += indentationNext + name + ': ' + value;\n\n if (i < keys.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n }", "title": "" }, { "docid": "d4d7ad4e157e3d612603f55f9ee3ba7e", "score": "0.554237", "text": "function dump(obj) {\n var output = '<ul>';\n for (var key in obj) {\n if (typeof (obj[key]) === 'object') {\n output += '<li>' + key + ' : ' + dump(obj[key]) + '</li>';\n } else {\n output += '<li>' + key + ' : ' + obj[key] + '</li>';\n }\n }\n output += '</ul>';\n return output;\n}", "title": "" }, { "docid": "5826c886280682a977ab162ca4373501", "score": "0.55326015", "text": "function prettyPrintJSON(template_json,padding,weight, border_bottom,padding_top_bottom){\n var str = \"\"\n if (!template_json){ return \"Not defined\";}\n if (!padding) {padding=0};\n if (!weight) {weight=\"bold\";}\n if (!border_bottom) {border_bottom = \"1px solid #CCCCCC\";}\n if (!padding_top_bottom) {padding_top_bottom=6;}\n var field = null;\n\n if (template_json.constructor == Array){\n for (field = 0; field < template_json.length; ++field){\n str += prettyPrintRowJSON(field,template_json[field],padding,weight, border_bottom,padding_top_bottom);\n }\n } else {\n for (field in template_json) {\n str += prettyPrintRowJSON(field,template_json[field],padding,weight, border_bottom,padding_top_bottom);\n }\n }\n return str;\n}", "title": "" }, { "docid": "8054500355fad03869bb222cbabaa6c4", "score": "0.55300134", "text": "function prettyToken(token) {\n switch (token) {\n case BOM:\n return '<BOM>';\n case DOCUMENT:\n return '<DOC>';\n case FLOW_END:\n return '<FLOW_END>';\n case SCALAR:\n return '<SCALAR>';\n default:\n return JSON.stringify(token);\n }\n}", "title": "" }, { "docid": "40eb0b7da894261ad5c498384ea6fff7", "score": "0.551658", "text": "function dump(arr,level) {\n\tvar dumped_text = \"\";\n\tif(!level) level = 0;\n\tvar level_padding = \"\";\n\tfor(var j=0;j<level+1;j++) level_padding += \" \";\n\n\tif(typeof(arr) == 'object') { //Array/Hashes/Objects\n\t\tfor(var item in arr) {\n\t\t\t\n\t\t\tvar value = arr[item];\n\t\t\tif(typeof(value)==\"function\")continue;\n\t\t\tif(typeof(value) == 'object') { //If it is an array,\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' ...\\n\";\n\t\t\t\tdumped_text += dump(value,level+1);\n\t\t\t} else {\n\t\t\t\tdumped_text += level_padding + \"'\" + item + \"' => \\\"\" + value + \"\\\"\\n\";\n\t\t\t}\n\t\t}\n\t} else { //Stings/Chars/Numbers etc.\n\t dumped_text = \"===>\"+arr+\"<===(\"+typeof(arr)+\")\";\n\t}\n\treturn dumped_text;\n}", "title": "" }, { "docid": "39167cd23dbe0a980a645b163b9be742", "score": "0.551554", "text": "function printObjectProperties(val, config, indentation, depth, refs, printer) {\n var result = '';\n var keys$$1 = _Object$keys(val).sort();\n var symbols = getSymbols(val);\n\n if (symbols.length) {\n keys$$1 = keys$$1.filter(function (key) {\n return !isSymbol$1(key);\n }).concat(symbols);\n }\n\n if (keys$$1.length) {\n result += config.spacingOuter;\n\n var indentationNext = indentation + config.indent;\n\n for (var i = 0; i < keys$$1.length; i++) {\n var key = keys$$1[i];\n var name = printer(key, config, indentationNext, depth, refs);\n var value = printer(val[key], config, indentationNext, depth, refs);\n\n result += indentationNext + name + ': ' + value;\n\n if (i < keys$$1.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n}", "title": "" }, { "docid": "12316faedd196a79028ad9a0cf5a3528", "score": "0.55104786", "text": "function dumpObject(node) {\n function w(str, width) {\n const tmp = str + \" \";\n return tmp.substr(0, width);\n }\n return Object.entries(node).map((key, value) =>\n \" \" + w(key, 30) + \" : \" + ((value === null) ? null : value.toString())\n ).join(\"\\n\");\n}", "title": "" }, { "docid": "7debe007c2d6f9a897f9c070aa710780", "score": "0.5505794", "text": "prettyPrint(){\n let map = this.getAttributesValuesKeysMap();\n if(map.length < 1){\n console.log(\"Map des attributs vide\");\n }else{\n map.forEach(attribute => {\n console.log(`Valeurs pour l'attribut '${attribute}' :`);\n map[attribute].forEach(value => {\n console.log(`\\t${value}`) ;\n });\n });\n }\n }", "title": "" }, { "docid": "cba210955a0dbd92b673e6688675501e", "score": "0.55025", "text": "function dump(variable, level) \n{\n var dumped_text = \"\";\n if(!level) level = 0;\n \n var padding = \"\"; //padding at the beginning of the line\n for(var j=0; j<level+1; j++) \n padding += \" \";\n \n if(typeof(variable) == 'object') //Object or array? \n {\n for(var item in variable) //loop thru all properties \n {\n var value = variable[item]; //get property value\n \n if(typeof(value) == 'object') //Object or array?\n {\n dumped_text += padding + \"'\" + item + \"' ...\\n\";\n dumped_text += dump(value, level+1); //recursive call\n } \n else\n dumped_text += padding + \"'\" + item + \"' => \\\"\" + value + \"\\\"\\n\";\n }\n } \n else //string or numeric \n dumped_text = \"===> \"+variable+\" <===(\"+ typeof(variable) +\")\";\n\n return dumped_text;\n}", "title": "" }, { "docid": "2400d73308cd6508ecd90d29888b556f", "score": "0.5497232", "text": "function makeCardsPretty() {\n var data = dbCC.getData(\"/\");\n var houseOfCards = \"\";\n for (key in data) {\n if (data.hasOwnProperty(key)) {\n console.log(\"Full text: \" + data[key].fullText + \"\\nCloze deletion: \" + data[key].cloze + \"\\nPartial text: \" + data[key].partial + \"\\n---------\");\n }\n }\n }", "title": "" }, { "docid": "f97692e3e885ac10bb9b1e00e17a9312", "score": "0.5489684", "text": "function notSoPrettyPrintQuery(query) {\n return print(query)\n .replace(/\\n/g, ' ') // replace newlines with a space\n .replace(/\\s\\s+/g, ' ') // replace multiple spaces with a single space\n .replace(/(^\\s|\\s$)/, ''); // trim\n}", "title": "" }, { "docid": "2fb8ad3d4ace153731cf8cb3898213c5", "score": "0.547893", "text": "function printObjectProperties(val, config, indentation, depth, refs, printer) {\n let result = '';\n const keys = getKeysOfEnumerableProperties(val);\n\n if (keys.length) {\n result += config.spacingOuter;\n const indentationNext = indentation + config.indent;\n\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const name = printer(key, config, indentationNext, depth, refs);\n const value = printer(val[key], config, indentationNext, depth, refs);\n result += indentationNext + name + ': ' + value;\n\n if (i < keys.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n}", "title": "" }, { "docid": "dc0308810a9d30534a23d9575e098188", "score": "0.54726636", "text": "function printObject(obj) {\n\tconst ind = ' '\n\tlet output = ''\n\tif (!(obj instanceof Array)) {\n\t\tObject.keys(obj).forEach(function (key) {\n\t\t\toutput += '\\n '+key+': '+printValueType(obj[key])+','\n\t\t})\n\t\toutput = '{\\n '+output.slice(0,-1).trim()+'\\n}'\n\t} else {\n\t\tobj.forEach(function (num, i) {\n\t\t\toutput += '\\n '+printValueType(obj[i])+','\n\t\t})\n\t\toutput = '[\\n '+output.slice(0,-1).trim()+'\\n]'\n\t}\n\tif (output.length < 50) output = output.replace(/\\s+/g, ' ')\n\treturn output\n\t\t.split('\\n')\n\t\t.map(function (s) {return ind + s})\n\t\t.join('\\n')\n\t\t.trim()\n}", "title": "" }, { "docid": "6550d2b64a2f923e5b38b0eff24391d3", "score": "0.54673976", "text": "function prettyPrintResultList(resultList) {\n const writer = makePrettyWriter();\n resultList.forEach((reader) => {\n writer.writeValues(reader);\n });\n console.log(decodeUtf8(writer.getBytes()));\n}", "title": "" }, { "docid": "19067dc2521a896885942d27e5588d65", "score": "0.54603845", "text": "function dump(object, showTypes) {\r\n\tvar dump = '';\r\n\tvar st = typeof showTypes == 'undefined' ? true : showTypes;\r\n\tdump += (/string|number|undefined|boolean/.test(typeof(object)) || object == null) ? object : recurse(object, typeof object);\r\n\r\n\treturn dump;\r\n\r\n\tfunction recurse(o, type) {\r\n\t\tvar i;\r\n\t\tvar j = 0;\r\n\t\tvar r = '';\r\n\t\ttype = _dumpType(o);\r\n\t\tswitch (type) {\t\t\r\n\t\t\tcase 'regexp':\r\n\t\t\t\tvar t = type;\r\n\t\t\t\tr += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n\t\t\t\tr += '<tr><td colspan=\"2\"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>RegExp: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>'; \r\n\t\t\t\tj++;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'date':\r\n\t\t\t\tvar t = type;\r\n\t\t\t\tr += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n\t\t\t\tr += '<tr><td colspan=\"2\"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>Date: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>'; \r\n\t\t\t\tj++;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'function':\r\n\t\t\t\tvar t = type;\r\n\t\t\t\tvar a = o.toString().match(/^.*function.*?\\((.*?)\\)/im); \r\n\t\t\t\tvar args = (a == null || typeof a[1] == 'undefined' || a[1] == '') ? 'none' : a[1];\r\n\t\t\t\tr += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n\t\t\t\tr += '<tr><td colspan=\"2\"' + _dumpStyles(t,'td-value') + '><table' + _dumpStyles('arguments','table') + '><tr><td' + _dumpStyles('arguments','td-key') + '><i>Arguments: </i></td><td' + _dumpStyles(type,'td-value') + '>' + args + '</td></tr><tr><td' + _dumpStyles('arguments','td-key') + '><i>Function: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o + '</td></tr></table>'; \r\n\t\t\t\tj++;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'domelement':\r\n\t\t\t\tvar t = type;\r\n\t\t\t\tr += '<table' + _dumpStyles(t,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(t,'th') + '>' + t + '</th></tr>';\r\n\t\t\t\tr += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Name: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeName.toLowerCase() + '</td></tr>'; \r\n\t\t\t\tr += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Type: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeType + '</td></tr>'; \r\n\t\t\t\tr += '<tr><td' + _dumpStyles(t,'td-key') + '><i>Node Value: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.nodeValue + '</td></tr>'; \t\t\t\t\t\r\n\t\t\t\tr += '<tr><td' + _dumpStyles(t,'td-key') + '><i>innerHTML: </i></td><td' + _dumpStyles(type,'td-value') + '>' + o.innerHTML + '</td></tr>'; \r\n\t\t\t\tj++;\r\n\t\t\t\tbreak;\t\t\r\n\t\t}\r\n\t\tif (/object|array/.test(type)) {\r\n\t\t\tfor (i in o) {\r\n\t\t\t\tvar t = _dumpType(o[i]);\r\n\t\t\t\tif (j < 1) {\r\n\t\t\t\t\tvar info = '';\r\n\t\t\t\t\tif (type == \"array\")\r\n\t\t\t\t\t\tinfo = ' (' + o.length + ')';\r\n\t\t\t\t\tr += '<table' + _dumpStyles(type,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(type,'th') + '><div class=\"PASDTableHeader\">' + type + info + '</div></th></tr>';\r\n\t\t\t\t\tj++;\t \r\n\t\t\t\t}\r\n\t\t\t\tif (typeof o[i] == 'object' && o[i] != null) { \r\n\t\t\t\t\tr += '<tr><td' + _dumpStyles(type,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + recurse(o[i], t) + '</td></tr>';\t\r\n\t\t\t\t} else if (typeof o[i] == 'function') {\r\n\t\t\t\t\tr += '<tr><td' + _dumpStyles(type ,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + recurse(o[i], t) + '</td></tr>'; \t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tr += '<tr><td' + _dumpStyles(type,'td-key') + '>' + i + (st ? ' [' + t + ']' : '') + '</td><td' + _dumpStyles(type,'td-value') + '>' + o[i] + '</td></tr>'; \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (j == 0) {\r\n\t\tr += '<table' + _dumpStyles(type,'table') + '><tr><th colspan=\"2\"' + _dumpStyles(type,'th') + '>' + type + ' [empty]</th></tr>'; \t\r\n\t\t}\r\n\t\tr += '</table>';\r\n\t\treturn r;\r\n\t};\t\r\n}", "title": "" }, { "docid": "60a2b57c9af083795dc0b07022ff3a8a", "score": "0.5454925", "text": "function Formatter() {}", "title": "" }, { "docid": "83553fb4b69b4f3f0585e9c5f3af82a4", "score": "0.544973", "text": "function _fmt (f) {\n\n var ret_str;\n var args = arguments; // capture _fmt arguments for use in in-line fns below\n var len = args.length; // count of _fmt arguments\n\n // Object not a format string w args?\n if (typeof f !== \"string\")\n {\n ret_str = inline_stringify_array ([], 0);\n }\n else\n {\n var i = 1; // increment for each replaced token\n var mxd = MAX_PP_DEPTH; // default max depth for %K\n\n // Do the format string token replacement:\n ret_str = String (f).replace (format_regexpr, token_replacer_fn);\n\n // Any unused parameters following the format string?\n if (i < len)\n {\n ret_str = inline_stringify_array ([ret_str], i);\n }\n }\n\n return ret_str;\n\n\n function inline_stringify_array (objs, ix0) {\n\n for (var j = ix0; j < len; j++)\n {\n objs.push (JSON.stringify (args[j]));\n }\n\n return objs.join (\", \");\n };\n\n\n function token_replacer_fn (x) {\n\n if (x === \"%%\") return \"%\";\n\n if (i >= len) return x; // in this case we have no parameter to replace token with\n\n if (x.length > 2)\n {\n mxd = x.substring (2); // extract the max depth count from the token\n x = x.substring (0, 2); // remove the max depth count from the token\n }\n\n switch (x)\n {\n case \"%s\": return String (args[i++]);\n case \"%d\": return Number (args[i++]);\n case \"%j\": return JSON.stringify (args[i++]); // built-in JSON in-line (minified) stringify\n case \"%J\": return JSON.stringify (args[i++], 0, 4); // built-in JSON indented stringify\n case \"%k\": return _stringify (args[i++], \"\", 0, mxd, false); // custom JSON stringify, depth control\n case \"%K\": return _stringify (args[i++], \"\", 0, mxd, true); // custom JSON stringify, depth control, sorted\n default : return x;\n }\n };\n}", "title": "" }, { "docid": "f26a73a80829a4896b779525f2fd8dc9", "score": "0.5428428", "text": "function prettyPrint(string) {\n return string\n .replaceAll(regularExpressions.and, '&and;')\n .replaceAll(regularExpressions.or, '&or;')\n .replaceAll(regularExpressions.not, '&sim;')\n .replaceAll(regularExpressions.then, '&rarr;')\n .replaceAll(regularExpressions.xor, '&oplus;')\n .replaceAll(regularExpressions.equals, '&equiv;')\n .replaceAll('(', '&lpar;')\n .replaceAll(')', '&rpar;')\n}", "title": "" }, { "docid": "bb5ddaeacecc9f3c61ea566b08b5450e", "score": "0.54216343", "text": "function getPrettyDate() {\n var d = new Date();\n var prettyDate;\n var numberDate = d.getDate();\n if (numberDate < 10) {\n prettyDate = '0' + d.getDate();\n }\n else {\n prettyDate = d.getDate();\n };\n var prettyMonth;\n var numberMonth = d.getMonth()+1;\n if (numberMonth < 10) {\n prettyMonth = \"0\" + numberMonth;\n }\n else {\n prettyMonth = numberMonth;\n };\n var year = d.getFullYear();\n var hours = d.getHours();\n var prettyMinutes;\n var numberMinutes = d.getMinutes();\n if (numberMinutes < 10) {\n prettyMinutes = '0' + d.getMinutes();\n }\n else {\n prettyMinutes = d.getMinutes();\n }\n var date = prettyDate + '.' + prettyMonth + '.' + year + ' ' + hours + ':' + prettyMinutes;\n return date;\n}", "title": "" }, { "docid": "83e5f3f94517c8b77cb41a01ffb10ef5", "score": "0.54202443", "text": "function parseTabs() {\n\tvar tabs = \"\";\n\n\tif(verbose) {\n\t\tfor(var j = 0; j < numTabs; j++) {\n\t\t\ttabs += tab;\n\t\t}\n\t}\n\n\treturn tabs;\n}", "title": "" }, { "docid": "9e76426a6dbbde9063b717d3ec18e531", "score": "0.5406728", "text": "function debug_dump(obj) {\n let eltz = [];\n let empties = [];\n let funx = [];\n for(let k in obj) {\n let v = obj[k];\n if (v === null) empties.push(k);\n else if(v == \"\") empties.push(k);\n else if(typeof(v) == \"function\") funx.push(k);\n else eltz.push(`${k}: <${typeof(v)}> ${String(v)}`);\n }\n let output = [\n `<${typeof(obj)}> ${String(obj)}\\n\\t`,\n eltz.join(\"\\n\\t\"),\n \"\\n\\tfunctions:\\n\\t\",\n funx.join(', '),\n \"\\n\\tempties:\\n\\t\",\n empties.join(\", \")\n ]\n \n console.log(output.join(\"\"));\n}", "title": "" }, { "docid": "0d58ee15785225692c3267f388126882", "score": "0.54047877", "text": "beautifyType(type) {\n // for cases {}\n if (type.length < 3) {\n return type\n }\n return type\n .replace(/\\{/gi, '{\\n ')\n .replace(/,/gi, ',\\n')\n .replace(/}/gi, '\\n}\\n')\n }", "title": "" }, { "docid": "bfc056afb2b0e3010c22439b82652032", "score": "0.5387986", "text": "function printListItems(list, config, indentation, depth, refs, printer) {\n var result = '';\n\n if (list.length) {\n result += config.spacingOuter;\n var indentationNext = indentation + config.indent;\n\n for (var i = 0; i < list.length; i++) {\n result += indentationNext;\n\n if (i in list) {\n result += printer(list[i], config, indentationNext, depth, refs);\n }\n\n if (i < list.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n }", "title": "" }, { "docid": "1e195112e41db7b667599622b6fe4021", "score": "0.5386908", "text": "function pretty(buf) {\n if (!Buffer.isBuffer(buf)) {\n return buf\n }\n var ret = buf.toString('hex')\n if (ret.length % 2)\n return '0x0' + ret\n else\n return '0x' + ret\n}", "title": "" }, { "docid": "15dd263a50f82e7b6bfa3d6800db808a", "score": "0.53830296", "text": "function dumpObj(obj, prefix = \"\") {\n if (obj && obj.constructor.name === \"Object\") {\n if (getObjPropertiesCount(obj) === 0) {\n console.log(\"{}\");\n } else {\n console.log(\"{\");\n for (let k in obj) {\n if (obj.hasOwnProperty(k)) {\n console.logPut(prefix + \" \" + k + \": \");\n dumpObj(obj[k], prefix+\" \");\n }\n }\n console.log(prefix+\"}\");\n }\n } else if (obj && obj.constructor.name === \"Array\") {\n if (obj.length === 0) {\n console.log(\"[]\");\n } else {\n console.log(\"[\");\n for (let i = 0; i < obj.length; ++i) {\n console.logPut(\" \" + prefix);\n dumpObj(obj[i], prefix+\" \")\n }\n console.log(prefix+\"]\");\n }\n } else if (obj && obj.constructor.name === \"Uint8Array\") {\n console.log(\"Uint8Array, len = \" + obj.length);\n } else if (obj && obj.constructor.name === \"String\") {\n console.log('\"' + obj.toString() + '\"');\n } else if (obj && obj.constructor.name === \"Number\") {\n console.log(obj.toString());\n } else if (obj && obj.constructor.name === \"Boolean\") {\n console.log(obj.toString());\n }\n else if (obj)\n console.log(obj.constructor.name + \" => \" + obj.toString());\n else\n console.log(obj);\n}", "title": "" }, { "docid": "0a8a1b4f11965bb0a42b3646079a9d69", "score": "0.538019", "text": "function dump(v, howDisplay, recursionLevel) {\n howDisplay = (typeof howDisplay === 'undefined') ? \"alert\" : howDisplay;\n recursionLevel = (typeof recursionLevel !== 'number') ? 0 : recursionLevel;\n\n\n var vType = typeof v;\n var out = vType;\n\n switch (vType) {\n case \"number\":\n /* there is absolutely no way in JS to distinguish 2 from 2.0\n so 'number' is the best that you can do. The following doesn't work:\n var er = /^[0-9]+$/;\n if (!isNaN(v) && v % 1 === 0 && er.test(3.0))\n out = 'int';*/\n case \"boolean\":\n out += \": \" + v;\n break;\n case \"string\":\n out += \"(\" + v.length + '): \"' + v + '\"';\n break;\n case \"object\":\n //check if null\n if (v === null) {\n out = \"null\";\n\n }\n //If using jQuery: if ($.isArray(v))\n //If using IE: if (isArray(v))\n //this should work for all browsers according to the ECMAScript standard:\n else if (Object.prototype.toString.call(v) === '[object Array]') {\n out = 'array(' + v.length + '): {\\n';\n for (var i = 0; i < v.length; i++) {\n out += repeatString(' ', recursionLevel) + \" [\" + i + \"]: \" +\n dump(v[i], \"none\", recursionLevel + 1) + \"\\n\";\n }\n out += repeatString(' ', recursionLevel) + \"}\";\n }\n else { //if object\n sContents = \"{\\n\";\n cnt = 0;\n for (var member in v) {\n //No way to know the original data type of member, since JS\n //always converts it to a string and no other way to parse objects.\n sContents += repeatString(' ', recursionLevel) + \" \" + member +\n \": \" + dump(v[member], \"none\", recursionLevel + 1) + \"\\n\";\n cnt++;\n }\n sContents += repeatString(' ', recursionLevel) + \"}\";\n out += \"(\" + cnt + \"): \" + sContents;\n }\n break;\n }\n\n if (howDisplay == 'body') {\n var pre = document.createElement('pre');\n pre.innerHTML = out;\n document.body.appendChild(pre)\n }\n else if (howDisplay == 'alert') {\n alert(out);\n }\n\n return out;\n}", "title": "" }, { "docid": "f075b5f630879c8982812de84ee43c82", "score": "0.53768677", "text": "function prettyPrintSkill(skill) {\n\tvar result = \"\";\n\tresult += \"<strong>\" + skill.name + \"</strong><br><br>\";\n\tresult += skill.description;\n\tif (skill.preReqs) {\n\t\tresult += \"<br><br>\";\n\t\tresult += \"<i><strong>Prerequisites: </strong>\";\n\t\tif (skill.preReqs.and) {\n\t\t\tfor (var i = 0; i < skill.preReqs.and.length; i++) {\n\t\t\t\tvar s = findById(data._skills, skill.preReqs.and[i]);\n\t\t\t\tif (s == null) {break;}\n\t\t\t\tresult += s.name;\n\t\t\t\tif (i < skill.preReqs.and.length - 1) {\n\t\t\t\t\tresult += \" <strong>and</strong> \";\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (skill.preReqs.or) {\n\t\t\tfor (var i = 0; i < skill.preReqs.or.length; i++) {\n\t\t\t\tvar s = findById(data._skills, skill.preReqs.or[i]);\n\t\t\t\tif (s == null) {break;}\n\t\t\t\tresult += s.name;\n\t\t\t\tif (i < skill.preReqs.or.length - 1) {\n\t\t\t\t\tresult += \" <strong>or</strong> \";\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (skill.preReqs.not) {\n\t\t\tfor (var i = 0; i < skill.preReqs.not.length; i++) {\n\t\t\t\tvar s = findById(data._skills, skill.preReqs.not[i]);\n\t\t\t\tif (s == null) {break;}\n\t\t\t\tresult += \"<strong>not</strong> \" + s.name;\n\t\t\t\tif (i < skill.preReqs.not.length - 1) {\n\t\t\t\t\tresult += \" and \";\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresult += \"None\";\n\t\t}\n\t\tresult += \"</i>\";\n\t}\n\tif (skill.freeMiracle) {\n\t\tresult += \"<br><br><strong>Free Miracle of Level \" + skill.freeMiracle + \"</strong>\";\n\t}\n\tif (skill.free) {\n\t\tresult += \"<br><br><strong>Free!</strong>\";\n\t}\n\t\n\n\treturn result;\n}", "title": "" }, { "docid": "175126f7084eec02b2fe3ff791c7d53b", "score": "0.5369051", "text": "function printIteratorValues(iterator, config, indentation, depth, refs, printer) {\n var result = '';\n var current = iterator.next();\n\n if (!current.done) {\n result += config.spacingOuter;\n var indentationNext = indentation + config.indent;\n\n while (!current.done) {\n result += indentationNext + printer(current.value, config, indentationNext, depth, refs);\n current = iterator.next();\n\n if (!current.done) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n }", "title": "" }, { "docid": "981909bd0c17e839f46dacb08cb1952c", "score": "0.53642786", "text": "indentString(cols) {\n let result = \"\";\n if (this.facet(EditorState.indentUnit).charCodeAt(0) == 9) while (cols >= this.tabSize) {\n result += \"\\t\";\n cols -= this.tabSize;\n }\n\n for (let i = 0; i < cols; i++) result += \" \";\n\n return result;\n }", "title": "" }, { "docid": "069e1915602a92f6ca4199c6d00a1fd3", "score": "0.53633", "text": "function printListItems(list, config, indentation, depth, refs, printer) {\n var result = '';\n\n if (list.length) {\n result += config.spacingOuter;\n\n var indentationNext = indentation + config.indent;\n\n for (var i = 0; i < list.length; i++) {\n result += indentationNext + printer(list[i], config, indentationNext, depth, refs);\n\n if (i < list.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n}", "title": "" }, { "docid": "e4e9a73a3165aa4303796c680164da98", "score": "0.5360915", "text": "function dump(v, howDisplay, recursionLevel) {\n howDisplay = (typeof howDisplay === 'undefined') ? \"alert\" : howDisplay;\n recursionLevel = (typeof recursionLevel !== 'number') ? 0 : recursionLevel;\n\n\n var vType = typeof v;\n var out = vType;\n\n switch (vType) {\n case \"number\":\n /* there is absolutely no way in JS to distinguish 2 from 2.0\n so 'number' is the best that you can do. The following doesn't work:\n var er = /^[0-9]+$/;\n if (!isNaN(v) && v % 1 === 0 && er.test(3.0))\n out = 'int';*/\n case \"boolean\":\n out += \": \" + v;\n break;\n case \"string\":\n out += \"(\" + v.length + '): \"' + v + '\"';\n break;\n case \"object\":\n //check if null\n if (v === null) {\n out = \"null\";\n\n }\n //If using jQuery: if ($.isArray(v))\n //If using IE: if (isArray(v))\n //this should work for all browsers according to the ECMAScript standard:\n else if (Object.prototype.toString.call(v) === '[object Array]') { \n out = 'array(' + v.length + '): {\\n';\n for (var i = 0; i < v.length; i++) {\n out += repeatString(' ', recursionLevel) + \" [\" + i + \"]: \" + \n dump(v[i], \"none\", recursionLevel + 1) + \"\\n\";\n }\n out += repeatString(' ', recursionLevel) + \"}\";\n }\n else { //if object \n sContents = \"{\\n\";\n cnt = 0;\n for (var member in v) {\n //No way to know the original data type of member, since JS\n //always converts it to a string and no other way to parse objects.\n sContents += repeatString(' ', recursionLevel) + \" \" + member +\n \": \" + dump(v[member], \"none\", recursionLevel + 1) + \"\\n\";\n cnt++;\n }\n sContents += repeatString(' ', recursionLevel) + \"}\";\n out += \"(\" + cnt + \"): \" + sContents;\n }\n break;\n }\n\n if (howDisplay == 'body') {\n var pre = document.createElement('pre');\n pre.innerHTML = out;\n document.body.appendChild(pre)\n }\n else if (howDisplay == 'alert') {\n alert(out);\n }\n\n return out;\n}", "title": "" }, { "docid": "3ab251d0c35038b8af51a8af23c5cacf", "score": "0.53601307", "text": "function printIteratorEntries(iterator, config, indentation, depth, refs, printer, // Too bad, so sad that separator for ECMAScript Map has been ' => '\n // What a distracting diff if you change a data structure to/from\n // ECMAScript Object or Immutable.Map/OrderedMap which use the default.\n separator) {\n if (separator === void 0) {\n separator = ': ';\n }\n\n var result = '';\n var current = iterator.next();\n\n if (!current.done) {\n result += config.spacingOuter;\n var indentationNext = indentation + config.indent;\n\n while (!current.done) {\n var name = printer(current.value[0], config, indentationNext, depth, refs);\n var value = printer(current.value[1], config, indentationNext, depth, refs);\n result += indentationNext + name + separator + value;\n current = iterator.next();\n\n if (!current.done) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n }", "title": "" }, { "docid": "ea77915763fa5cbcb1a3479f1827346d", "score": "0.5355915", "text": "function TEST(input) {\n\tconsole.log(prettyPasteV2(input));\n}", "title": "" } ]
ff8998213b50af283b50fc3c64bd229a
Function declarations A function that will randomly return either 'Rock', 'Paper' or 'Scissors'. Using this function in the game makes the computer play
[ { "docid": "555c7b9f8ec66b72ff55c843f3678db6", "score": "0.83065844", "text": "function computerPlay () {\n \n possibleComputerChoices = [\"rock\", \"paper\", \"scissors\"];\n \n computerChoiceIndex = Math.floor(Math.random() * possibleComputerChoices.length); \n \n computerChoice = possibleComputerChoices[computerChoiceIndex];\n \n return computerChoice; //return the computerChoice as the value of this function\n\n}", "title": "" } ]
[ { "docid": "25962496169530a28765af6ac7bf7e3d", "score": "0.8781202", "text": "function computerPlay(){\n\tlet compChoice = Math.floor(Math.random()*3) + 1;\n\tif(compChoice == 1){\n\t\treturn 'Rock';\n\t} else if(compChoice == 2){\n\t\treturn 'Paper';\n\t}\n\treturn 'Scissors';\n}", "title": "" }, { "docid": "1701205b5ffcd580dea520e983e7584f", "score": "0.86229026", "text": "function computerPlay() {\r\n let choices = ['Rock', 'Paper', 'Scissors']\r\n return choices[Math.floor(Math.random() * choices.length)]\r\n}", "title": "" }, { "docid": "2b142181ef0ede149dbfc754a2b1a22a", "score": "0.85981303", "text": "function computerPlay() {\n let r = \"rock\";\n let p = \"paper\";\n let s = \"scissor\";\n let randomNum = Math.floor(Math.random() * 3) +1;\n if (randomNum == 1) {\n return (r);\n } else if (randomNum == 2) {\n return(p);\n } else {\n return (s);\n }\n}", "title": "" }, { "docid": "031d47af871b28172b18d4ede84e8c2c", "score": "0.8596531", "text": "function computerPlay(){\n let computerHand=Math.floor(Math.random()*3);\n return (computerHand===0) ? 'Rock' : (computerHand===1) ? 'Paper' : 'Scissors';\n }", "title": "" }, { "docid": "b6abb2f9ba1d201a89c422f7303fbd2b", "score": "0.85731024", "text": "function computerPlay() {\n let rockPaperScissor = ['rock', 'paper', 'scissors'];\n return rockPaperScissor[Math.floor(Math.random() * rockPaperScissor.length)];\n}", "title": "" }, { "docid": "69cc3ccfafabccb127068b9c7c0847b7", "score": "0.85694796", "text": "function computerPlay() {\n let seed = Math.floor(Math.random() * 3);\n if (seed == 0) {\n return \"Rock\"\n }\n else if (seed == 1) {\n return \"Paper\"\n }\n else {\n return \"Scissors\"\n }\n}", "title": "" }, { "docid": "15ad290f57508e9657bdf2354826cf08", "score": "0.8553868", "text": "function computerPlay() {\n\tvar RPS = [\"Rock\", \"Paper\", \"Scissors\"];\n\tvar random = RPS[Math.floor(Math.random() * RPS.length)];\n\treturn random.toLowerCase();\n}", "title": "" }, { "docid": "d7db6a42def74a8c13c31318392c2624", "score": "0.8553712", "text": "function computerPlay () {\n let rnd = Math.floor((Math.random() * 3) + 1);\n\n switch(rnd){\n case 1:\n return \"Rock\";\n break;\n case 2:\n return \"Paper\";\n break;\n case 3:\n return \"Scissors\";\n break;\n }\n}", "title": "" }, { "docid": "756176e77b7eec8df8c3b7c83c6eadec", "score": "0.85533667", "text": "function computerPlay(){\n let rand = Math.floor(Math.random()*3);\n return (rand==1) ? \"rock\" : (rand==2) ? \"paper\" : \"scissors\";\n}", "title": "" }, { "docid": "eee7edacc51ef57214bcc41159ceabbe", "score": "0.85480714", "text": "function computerPlay() {\n let choice = getRandom(3);\n if (choice == 0) {\n return \"rock\";\n } else if (choice == 1) {\n return \"paper\";\n } else {\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "ceed029cc0543a9e9ec38e6c9e06c330", "score": "0.8540088", "text": "function computerPlay() {\n let choices = ['rock', 'paper', 'scissors'];\n return choices[Math.floor(Math.random() * choices.length)];\n}", "title": "" }, { "docid": "03943d06efb8e4f1cead1eda0132ab5a", "score": "0.8532549", "text": "function computerPlay() {\n let choice = Math.floor(3*Math.random());\n if (choice == 1) {\n return 'rock'\n } else if (choice == 2) {\n return 'paper'\n } else {\n return 'scissors'\n }\n}", "title": "" }, { "docid": "05b8606af264335bec745faed1754bf7", "score": "0.8526903", "text": "function computerPlay() {\n let gameChoices = ['rock', 'paper', 'scissor']\n return gameChoices[Math.floor(Math.random() *3)];\n}", "title": "" }, { "docid": "e7759df4ebf0cb2d7549f4ee6ba4805f", "score": "0.85192466", "text": "function computerPlay() {\n//computerSelector takes one of three random values: = Randomly select 0,1,2 \n x = Math.floor(Math.random() * 3);\n// IF computerSelector = 0\n if (x == 0) {\n // THEN computerSelection = \"Rock\"\n return \"Rock\";\n// IF computerSelector = 1\n } else if (x == 1){\n // THEN computerSelection = \"Paper\"\n return \"Paper\";\n//IF computerSelector = 2\n } else {\n // THEN computerSelection = \"Scissors\"\n return \"Scissors\";\n }\n//END\n}", "title": "" }, { "docid": "1cc0ea4766d0869ffd12548f6bc406c3", "score": "0.8512692", "text": "function computerPlay() {\n let computerChoice = Math.floor(Math.random() * 3);\n\n switch (computerChoice) {\n case 0:\n return 'Rock';\n case 1:\n return 'Paper';\n case 2:\n return 'Scissors';\n }\n}", "title": "" }, { "docid": "069b079035f91520dd75a2971b2fbf48", "score": "0.8492663", "text": "function computerPlay() {\r\n let rps = [\"rock\", \"paper\", \"scissors\"];\r\n let getRandomChoices = Math.floor(Math.random() * 3);\r\n return rps[getRandomChoices];\r\n}", "title": "" }, { "docid": "c74a0f5d66e5b71469fd206d2c6bc34c", "score": "0.8490618", "text": "function computerPlay(){\n // Generate a random number between 1 and 3\n let random_number = Math.ceil(Math.random() * 3); \n // Use that to choose either Rock, Paper, or Scissors\n switch(random_number) {\n case 1:\n return 'rock';\n case 2:\n return 'paper';\n case 3:\n return 'scissors';\n }\n}", "title": "" }, { "docid": "8b93db635fed6a9d0fe33a1155dc68dd", "score": "0.848627", "text": "function computerPlay() {\n const gamechoices = ['rock', 'paper', 'scissors']\n const compChoice = Math.round(Math.random() * 2)\n return gamechoices[compChoice].toLowerCase();\n}", "title": "" }, { "docid": "73d405a5de73facdf72681027a48e32d", "score": "0.84821016", "text": "function computerPlay() {\n const num = Math.floor(Math.random() * 3); // Random number to determine which case to return.\n\n switch(num) {\n case 0:\n return 'rock';\n break;\n case 1:\n return 'paper';\n break;\n case 2:\n return 'scissors';\n break;\n default:\n console.error('computerPlay() error!');\n }\n}", "title": "" }, { "docid": "ada4b4292c93cfbc2b972d533291131b", "score": "0.8471055", "text": "function computerPlay() {\n let choices = [\"Rock\", \"Paper\", \"Scissors\"];\n let randomNumber = Math.floor(Math.random() * choices.length);\n return choices[randomNumber];\n}", "title": "" }, { "docid": "74a1e8074ea1db9c0ee85189414d5602", "score": "0.8458575", "text": "function computerPlay() {\n let comPlay;\n comPlay = Math.random();\n if(comPlay < .33) {\n return \"rock\";\n }else if(comPlay < .66) {\n return \"paper\";\n } else {\n return \"scissors\";\n }\n }", "title": "" }, { "docid": "6d1fe28c2a7a0ed4c7a589ba2b47c6d2", "score": "0.84584624", "text": "function computerPlay() {\n let hand = Math.floor(Math.random() * 3);\n if (hand === 0) {\n return 'Rock';\n } else if (hand === 1) {\n return 'Paper';\n } else {\n return 'Scissors';\n }\n}", "title": "" }, { "docid": "26ed620267fa3db0dcd59cadc2d82e07", "score": "0.84491795", "text": "computerPlay () {\n const computerSelection = (Math.floor(Math.random() * 3))\n switch (computerSelection) {\n case 0:\n return 'paper'\n case 1:\n return 'rock'\n case 2:\n return 'scissors'\n default:\n }\n }", "title": "" }, { "docid": "98a08232f3107c480b2077ca2f237b83", "score": "0.8444331", "text": "function computerPlay() {\n randomGameValue = Math.floor(Math.random() * 3);\n if (randomGameValue == \"0\") {\n return \"rock\";\n }\n else if (randomGameValue == \"1\") {\n return \"paper\";\n }\n else {\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "9eb0ce209c4701529a95ec9a78fc49cf", "score": "0.84326726", "text": "function computerPlay() {\n const Choices = [\"Rock\", \"Paper\", \"Scissors\"];\n return Choices[Math.floor(Math.random() * 3)];\n}", "title": "" }, { "docid": "838612d1ab1f84bd727a4c7e2e08681d", "score": "0.8422655", "text": "function computerPlay() {\n const selection = Math.floor(Math.random() * 3);\n switch (selection) {\n case 0:\n return rock;\n case 1:\n return paper;\n case 2:\n return scissors;\n default:\n return null;\n }\n}", "title": "" }, { "docid": "44b0dc3df01f41d17e3cd82c6e5fa072", "score": "0.8414056", "text": "function computerPlay() {\n switch (\n Math.floor(Math.random() * 3) //Random int from scaling for 3 choices\n ) {\n case 0:\n return \"rock\";\n case 1:\n return \"paper\";\n case 2:\n return \"scissors\";\n default:\n alert(\"Something went wrong!\");\n }\n}", "title": "" }, { "docid": "6097a7c201e8f7afacde3f4b94f1cf00", "score": "0.8411516", "text": "function computerPlay() {\n let play = Math.floor(Math.random() * 3) + 1;\n if (play == 1) {\n return \"rock\";\n } else if (play == 2) {\n return \"paper\";\n } else {\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "6eaad3bd6047d45c56cc0e75a53aff96", "score": "0.84114224", "text": "function computerPlay() {\n let choices = [\"rock\", \"paper\", \"scissors\"];\n computerSelection = choices[getRandomInteger(0,3)];\n return;\n}", "title": "" }, { "docid": "7407e7c8d48afeff7bd8786967d90447", "score": "0.8408801", "text": "function computerPlay(){\n // Randomly select either Rock, Paper, Scissors\n let computerChoices = [\"Rock\", \"Paper\", \"Scissors\"];\n let randomNumber = Math.floor(Math.random() * 3);\n // Return selected choice\n return computerChoices[randomNumber];\n}", "title": "" }, { "docid": "4f22a1cae159da492ae0f9c9f9340a32", "score": "0.84087205", "text": "function computerPlay() {\n\t var randomChoice = Math.floor(Math.random() * Math.floor(3));\n\t computer = (randomChoice === 2) ? \"rock\" : (randomChoice === 1) ? \"paper\" : \"scissors\";\n\t return computer;\n}", "title": "" }, { "docid": "4ffa3d6127b2db931f7298b70c233666", "score": "0.8407394", "text": "function computerPlay() {\n let computerChoices = ['rock','paper','scissors'];\n let computerRandomResult = computerChoices[Math.floor(Math.random() * computerChoices.length)];\n return computerRandomResult;\n }", "title": "" }, { "docid": "0ce36650e7f8e8e3f7d0f3d3b8b68bcb", "score": "0.8407054", "text": "function computerPlay() {\n let choices = ['Rock', 'Scissors', 'Paper'];\n let index = Math.floor(Math.random() * choices.length);\n return choices[index]\n}", "title": "" }, { "docid": "8991ff67e087ce5da74b49e562a6597b", "score": "0.84008133", "text": "function computerPlay () {\n let float = Math.floor(Math.random() * 3);\n if (float === 0) {\n return('rock')\n }\n else if (float === 1) {\n return('paper')\n }\n else {\n return('scissors');\n }\n }", "title": "" }, { "docid": "48be154e7f836829a5536ccc597863c7", "score": "0.8389232", "text": "function computerPlay() {\n let choiceArray = [`Rock`, \n `Paper`, \n `Scissors`]\n const randomChoice = choiceArray[\n Math.floor(Math.random() * (choiceArray.length))];\n return randomChoice\n}", "title": "" }, { "docid": "db88c24c77d259b3c77126937efd9897", "score": "0.83775103", "text": "function computerPlay()\n{\n let hand = [`rock`, `paper`, `scissors`];\n\n let choice = hand[Math.floor(Math.random() * hand.length)];\n\n return choice;\n}", "title": "" }, { "docid": "34c11fc87b93887bee1f8f02d2147751", "score": "0.83644754", "text": "function computerPlay() {\n let randomNum = Math.floor(Math.random() * 3);\n if (randomNum === 0) {\n return \"rock\";\n }\n else if (randomNum === 1) {\n return \"paper\";\n }\n else {\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "ee679fef7ca7e16261cf7d933a3b12fb", "score": "0.8361821", "text": "function computerPlay(){\n let play = Math.floor(Math.random() *3);\n\n if(play === 0){\n return \"rock\";\n } else if(play === 1){\n return \"paper\";\n } else if(play === 2){\n return \"scissors\";\n } else{\n return \"Something went terribly wrong.\"\n }\n }// end computerPlay function", "title": "" }, { "docid": "2b845c41b1e7ba0809039fec32a7905d", "score": "0.8357451", "text": "function computerPlay(){\n const selections = ['rock', 'paper', 'scissors'];\n return selections[Math.floor(Math.random()*selections.length)];\n\n}", "title": "" }, { "docid": "39b92a2defdfc868858a3cdc0d0e68e2", "score": "0.83424145", "text": "function computerPlay(){ \n let number = Math.floor(Math.random()*3) \n if (number ===0){\n return \"Rock\"\n }\n else if (number ===1){\n return \"Paper\"\n } \n else { \n return \"Scissors\"\n }\n}", "title": "" }, { "docid": "0253fc843a263d91c92c9d8a23c3c9d6", "score": "0.83149314", "text": "function computerPlay() {\n let choices = ['rock', 'scissors', 'paper'];\n let index = Math.floor(Math.random() * choices.length);\n return choices[index]\n}", "title": "" }, { "docid": "14cc4180f84413190574a7cb88baf313", "score": "0.83011025", "text": "function computerPlay(){\n let random = Math.floor(Math.random()*3);\n switch(random){\n case(0):\n return \"rock\";\n break;\n case(1):\n return \"paper\";\n break;\n default:\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "244fc0cb63c121771f8bd95a76d28aac", "score": "0.8292975", "text": "function computerPlay(){\n let rpsChoice = [ \"Rock\", \"Paper\", \"Scissors\"];\n let randomIndex = Math.floor(Math.random()*rpsChoice.length);\n return rpsChoice[randomIndex];\n\n}", "title": "" }, { "docid": "ad10b7655254aeaf1410ccfdc51f7bcc", "score": "0.82678235", "text": "fun() {\n const inte = Math.floor(Math.random() * 3) //this Math.random returns any of three random value which is R or S or P .\n if (inte === 0) {\n return 'R' // return R which is rock.\n } else if (inte === 1) {\n return 'S' // return S which is scissor.\n } else {\n return 'P' // return P which is paper.\n }\n }", "title": "" }, { "docid": "ac497de4707c77502126084120ad8b9a", "score": "0.8267207", "text": "function computerPlay() {\n // Random number between 1 and 3 \n let choice = Math.floor((Math.random() * 3) + 1);\n switch (choice) {\n case 1:\n return \"rock\";\n break;\n case 2:\n return \"paper\";\n break;\n case 3:\n return \"scissors\"\n break;\n }\n}", "title": "" }, { "docid": "70bc742d427f47450ba80ac1064b38ec", "score": "0.82622755", "text": "function computerPlay() {\n const choice = [\"ROCK\", \"PAPER\", \"SCISSORS\"]; \n return choice[Math.floor(Math.random() * choice.length)];\n}", "title": "" }, { "docid": "07e58b80f6d275c9dd50c9362fa9e6f8", "score": "0.8241899", "text": "function computerPlay() {\n const gameChoices = ['rock', 'paper', 'scissors'];\n\n function getRandomInt(max) {\n return Math.floor(Math.random() * Math.floor(max));\n }\n\n computerSelection = gameChoices[getRandomInt(3)];\n return computerSelection;\n}", "title": "" }, { "docid": "a6a8b207fb52daf41d5f1c8087a7007e", "score": "0.82362956", "text": "function computerPlay() {\n const computerOption = Math.floor(Math.random() * 3) + 1;\n if (computerOption === 1) {\n return \"ROCK\";\n } else if (computerOption === 2) {\n return \"PAPER\";\n } else if (computerOption === 3) {\n return \"SCISSORS\";\n }\n}", "title": "" }, { "docid": "74e28f1c3de02189292001d9af2c05d4", "score": "0.8221983", "text": "function computerPlay (){\n let result = Math.floor((Math.random() * 3) + 1);\n\n switch (result){\n case 1:\n result = 'rock';\n break;\n\n case 2:\n result = 'paper';\n break;\n \n case 3:\n result = 'scissors';\n break;\n }\n varComputerSelection = result;\n return varComputerSelection;\n}", "title": "" }, { "docid": "ceb2cb8c2300336cc696daee1a4474c5", "score": "0.8210335", "text": "function computerPlay() {\n const number = Math.floor(Math.random() * 1000);\n if (number % 3 === 0) {\n return \"rock\";\n }\n if (number % 3 === 1) {\n return \"paper\";\n }\n return \"scissors\";\n}", "title": "" }, { "docid": "b3212ccf2a3e1fdf41f5f2dd24651c87", "score": "0.8201928", "text": "function computerChoice() {\n var value = Math.floor(Math.random() * 3); ;\n if (value == 0) {\n return \"rock\";\n } else if (value == 1) {\n return \"paper\";\n } else {\n return \"scissor\"\n }\n}", "title": "" }, { "docid": "82f58abd2d15da2eef42c56570bf69d2", "score": "0.8167203", "text": "function computerPlay()\n{\n let randInt = randomInt(1, 3); // generate a random integer between 1 and 3\n switch (randInt) // select corresponding move\n {\n case 1: return \"rock\"; break;\n case 2: return \"paper\"; break;\n case 3: return \"scissors\"; break;\n }\n}", "title": "" }, { "docid": "5767fb9996772329dde411055d0c1a95", "score": "0.8145545", "text": "function computerPlay() {\n const randomNumber = Math.trunc(Math.random() * 3 + 1);\n let computerPlayResult;\n if (randomNumber === 1) {\n return (computerPlayResult = \"ROCK\");\n } else if (randomNumber === 2) {\n return (computerPlayResult = \"PAPER\");\n } else {\n return (computerPlayResult = \"SCISSORS\");\n }\n}", "title": "" }, { "docid": "382237fc370905b54443b11ecf459691", "score": "0.8143595", "text": "function computerPlay(){\n const options = ['rock', 'paper', 'scissors'];\n return options[Math.floor(Math.random()* options.length)];\n}", "title": "" }, { "docid": "fea17a21d8c83454e371154d3828f724", "score": "0.81344676", "text": "function computerPlay() {\n let choice = Math.random() * 10;\n choice = Math.round(choice);\n if (choice < 3.33) {\n choice = \"Rock\";\n } else if (choice < 6.66) {\n choice = \"Paper\";\n } else {\n choice = \"Scissors\";\n }\n elcomputer.innerText = \"Computer's decision: \" + choice;\n return choice;\n}", "title": "" }, { "docid": "a12d2e77f029742923d3ec98e3cd9786", "score": "0.8128709", "text": "function computerPlay() {\n const choices = [\"button--rock\", \"button--paper\", \"button--scissors\"];\n let randomNumber = Math.floor(Math.random() * 3);\n return choices[randomNumber];\n}", "title": "" }, { "docid": "bc9c537f701128de0b8609b06d2d4969", "score": "0.81098336", "text": "function computerChoice() {\n var choice = Math.random();\n if (choice < 0.34) {\n \tchoice = \"Rock\";\n } else if(choice <= 0.67) {\n \tchoice = \"Paper\";\n } else {\n \tchoice = \"Scissors\";\n }\n return choice;\n}", "title": "" }, { "docid": "fd2a675137e6a651b9ea86512d1a315a", "score": "0.80970937", "text": "function compPick() {\n computer = Math.round((Math.random()*3)+1);\n if (computer == 1) {\n compPlay = \"rock\";\n }\n else if (computer == 2) {\n compPlay = \"paper\";\n }\n else {\n compPlay = \"scissors\";\n } \n}", "title": "" }, { "docid": "e45d6be8324ccf7def93c5ad9dc9583c", "score": "0.8085906", "text": "function rockPaperScissors (playerChoice) {\n let computerResult = \"undecided\";\n let computerChoice = Math.floor(Math.random() * (4 -1)+ 1);\n if (computerChoice === 1) {\n computerResult = \"rock\";\n if (playerChoice === \"paper\") {\n console.log(\"The computer selected rock, so the player wins!\")\n }else if (playerChoice === \"scissors\") {\n console.log(\"The computer selected rock, so the player loses!\")\n }else if (playerChoice === \"rock\") {\n console.log(\"Both player and computer selected rock, it's a tie!\")\n }\n }else if (computerChoice === 2) {\n computerResult = \"paper\";\n if (playerChoice === \"paper\") {\n console.log(\"Both player and computer selected paper, it's a tie!\")\n }else if (playerChoice === \"scissors\") {\n console.log(\"The computer selected paper, so the player wins!\")\n }else if (playerChoice === \"rock\") {\n console.log(\"The computer selected paper, so the player loses!\")\n }\n }else if (computerChoice === 3) {\n computerResult = \"scissors\";\n if (playerChoice === \"paper\") {\n console.log(\"The computer selected scissors, so the player loses!\")\n }else if (playerChoice === \"scissors\") {\n console.log(\"Both player and computer selected scissors, it's a tie!\")\n }else if (playerChoice === \"rock\") {\n console.log(\"The computer selected scissors, so the player wins!\")\n }\n }\n}", "title": "" }, { "docid": "733027efa36f6563370321f141fb11e3", "score": "0.80826133", "text": "function rockPaperScissors(){\n let random = Math.random()\n if(random < .33){\n return \"rock\"\n }else if(random < .66){\n return \"paper\"\n }else{\n return \"scissors\"\n }\n}", "title": "" }, { "docid": "daa8540786dce32a5eb5ecba5ed9c612", "score": "0.80554223", "text": "function computerChoice() {\n const number = Math.random();\n if (number > 0.66) return \"rock\";\n else if (number > 0.33) return \"paper\";\n else return \"scissors\";\n}", "title": "" }, { "docid": "de3790fe40ef5c0a51a96182c8eefedf", "score": "0.80544704", "text": "function rockPaperScissors(myPick) {\n let computerPick = Math.floor(Math.random() * 3);\n if (computerPick === 0) {\n computerPick = 'scissors';\n } else if (computerPick === 1) {\n computerPick = 'rock';\n } else if (computerPick === 2) {\n computerPick = 'paper';\n }\n console.log('our pick: ', myPick, 'their pick: ', computerPick);\n if (myPick === 'scissors') {\n if (computerPick === 'scissors') {\n return 'You tied!';\n } else if (computerPick === 'paper') {\n return 'You win!';\n } else if (computerPick === 'rock') {\n return 'You lose!';\n }\n } else if (myPick === 'rock') {\n if (computerPick === 'rock') {\n return 'You tied!';\n } else if (computerPick === 'scissors') {\n return 'You win!';\n } else if (computerPick === 'paper') {\n return 'You lose!';\n }\n } else if (myPick === 'paper') {\n if (computerPick === 'paper') {\n return 'You tied!';\n } else if (computerPick === 'rock') {\n return 'You win!';\n } else if (computerPick === 'scissors') {\n return 'You lose!';\n }\n }\n}", "title": "" }, { "docid": "7f55bc1976ef02e6f44350506ed55ea5", "score": "0.80410206", "text": "function computerPlay() {\n\n // Create a random number between 1 and 3 inclusive\n function getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1) + min);\n }\n\n // Create a variable from the random number\n\n var choiceInt = getRandomInt(1,3);\n\n // Variable for the choice to return\n var choice; \n \n // Return Rock, Paper or Scissors, depending on the number\n if (choiceInt == 1) {\n choice = \"rock\";\n }\n else if (choiceInt == 2) {\n choice = \"paper\";\n }\n else if (choiceInt == 3) {\n choice = \"scissors\";\n }\n\n // Show error message if choice is not between 1 and 3\n else {\n choice = \"Error\";\n console.log(\"Error in the computerPlay() function\");\n }\n\n return choice;\n}", "title": "" }, { "docid": "f2e2cb57ecdc67bca1c2be7865186e9f", "score": "0.80164295", "text": "function computerPlay () {\n let options = [\"rock\", \"paper\", \"scissors\"];\n let random = Math.floor(Math.random () * 3)\n return options[random];\n}", "title": "" }, { "docid": "075432c116f7ef7ce7c14d8784ed0957", "score": "0.7981568", "text": "function computerPlay() {\n\n let computerMath = Math.floor((Math.random()*3) + 1);\n let computerChoice = \"\";\n if (computerMath == 1) {\n computerChoice = \"r\";\n } else if (computerMath == 2) {\n computerChoice = \"p\";\n } else {\n computerChoice = \"s\";\n }\n\n return computerChoice;\n}", "title": "" }, { "docid": "ea3c9553c81487a1a7e784ea9a8952a9", "score": "0.7952493", "text": "function computerPlay(){\n let options = ['rock', \"paper\", \"scissors\"];\n let index = Math.floor(Math.random()*options.length);\n let selected = options[index];\n return selected;\n}", "title": "" }, { "docid": "1ea7137a152ebab2850d9caac9b03bc6", "score": "0.7945063", "text": "function computerPlay() {\n\n let weaponToChoose = [ 'rock', 'paper', 'scissor' ];\n weaponImageComputer.classList.add('won');\n \n return weaponToChoose[Math.floor( Math.random() * weaponToChoose.length )] ;\n \n}", "title": "" }, { "docid": "d3cd0fb51b3fdd9328c69452489b352c", "score": "0.7939563", "text": "function randomPlay() {\n var randomNumber = Math.random();\n if (randomNumber < 0.33) {\n return \"rock\";\n } else if (randomNumber < 0.66) {\n return \"paper\";\n } else {\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "a49b7b4169751620ffbb1ac1314634fd", "score": "0.79326534", "text": "function simulateComputerPlayer() {\n /* Generate a random number between 1 & 3\n ** Math is a built in JavaScript library that has utility functions to do math stuff\n ** e.g. Round numbers both up and down, Generate Random Numbers, etc\n ** The next line of code uses these functions by executing\n ** a) Math.random() //Generates a random number between zero and one i.e. it has lots of numbers after the decimial place 0.34156865\n ** b) Math.random() * 2 // Multiplies the random number by 2 with all those digits after the decimal place\n ** c) Math.round(result from the previous two ) //Rounds the number generated to a whole number i.e. gets rid of the decimal part\n ** d) (result of the previous 3) plus 1 - if we didn't do this we would have a random number between 0 and 2\n */\n var randNum = (Math.round(Math.random() * 2)) + 1;\n\n /* Let 1 equal Rock\n ** Let 2 equal Paper\n ** Let 3 equal Scissors */\n if (randNum === 1) {\n return 'Rock';\n } else if (randNum === 2) {\n return 'Paper';\n } else if (randNum === 3) {\n return 'Scissors';\n }\n }", "title": "" }, { "docid": "3ec5ef8f102905e591d1d45f46bcf584", "score": "0.7924782", "text": "function computerPlay() {\n const options = [\"rock\", \"paper\", \"scissors\"];\n let randomNum = Math.floor(Math.random()*3); \n return options[randomNum];\n}", "title": "" }, { "docid": "c6d2a2bd855be7e425a5c9135b6b319d", "score": "0.79143953", "text": "function computerPlay() {\n let computerRandomNum = getRandomInt(3);\n switch (computerRandomNum) {\n case 0:\n return computerSelection = \"rock\";\n break;\n case 1:\n return computerSelection = \"paper\";\n break;\n case 2:\n return computerSelection = \"scissors\";\n break;\n default:\n console.log(\"Oops. Something went wrong.\")\n }\n}", "title": "" }, { "docid": "2bfab122ace08e93f07950d316a415b5", "score": "0.7907912", "text": "function computerChooses() {\ncomputerChoice = Math.random();\nif (computerChoice < 0.34) {\n computerChoice = \"rock\";\n} \nelse if(computerChoice <= 0.67) {\n computerChoice = \"paper\";\n} \nelse {\n computerChoice = \"scissors\";\n}\nreturn computerChoice;\n}", "title": "" }, { "docid": "48ac8dfc15e83556779a1d934abc0566", "score": "0.7895211", "text": "function computerPlay() {\n\n let list = ['Rock', 'Paper', 'Scissors'];\n\n let randomNumber = Math.floor(Math.random() * 3);\n let selection = list[randomNumber];\n\n return selection;\n}", "title": "" }, { "docid": "8bcd2cf5a9c3c600df35b9f65afa5163", "score": "0.78891844", "text": "function computerPlay() {\n //create an array with three strings, rock, paper, and scissors\n const compPlay = [\"rock\", \"paper\", \"scissors\"];\n //use a random number generator to produce a number between 0 and 2\n let spot = Math.floor(Math.random() * 3);\n //return the element at that randomly generated spot\n return compPlay[spot];\n}", "title": "" }, { "docid": "3f3caf2232537d088fca95363e2cbd87", "score": "0.7881346", "text": "function playRound(playerSelection){\n const computerSelection = computerPlay();\n \n if(playerSelection == \"Paper\" && computerSelection == \"Paper\" || playerSelection == \"Rock\" && computerSelection == \"Rock\" || playerSelection == \"Scissors\" && computerSelection == \"Scissors\") {\n draw(playerSelection);\n } else if(playerSelection== \"Paper\" && computerSelection == \"Rock\" || playerSelection== \"Scissors\" && computerSelection == \"Paper\" || playerSelection== \"Rock\" && computerSelection == \"Scissors\"){\n win(playerSelection, computerSelection);\n } else {\n lose(playerSelection, computerSelection);\n }\n}", "title": "" }, { "docid": "159c7c264917deb4d75e0171179a00a0", "score": "0.78810155", "text": "function rockPaperScissors(computer) {\r\n if (computer === 0) {\r\n return \"rock\";\r\n };\r\n if (computer === 1) {\r\n return \"paper\";\r\n };\r\n if (computer === 2) {\r\n return \"scissors\";\r\n };\r\n}", "title": "" }, { "docid": "9b566d5cb87d83c2bece7faf25b927cb", "score": "0.7870949", "text": "function compChoice() {\n var computerChoice = Math.random();\n\n if (computerChoice < 0.34) {\n computerChoice = \"Rock\";\n } else if (computerChoice <= 0.67) {\n computerChoice = \"Paper\";\n } else {\n computerChoice = \"Scissors\";\n }\n\n return computerChoice;\n }", "title": "" }, { "docid": "b33c5481b53801c6b8753b2695d9076b", "score": "0.78378004", "text": "function compMove () {\n var play = Math.floor(Math.random() * 3);\n if (play === 0) {\n return 'rock';\n } else if (play === 1) {\n return 'paper';\n } else if (play === 2) {\n return 'scissor';\n }\n}", "title": "" }, { "docid": "6c7ecde979794864955ced3db8b4cf63", "score": "0.7837015", "text": "function randomChoice() {\n let compChoice = Math.ceil(Math.random() * 3);\n if (compChoice === 1) {\n return \"rock\";\n } else if (compChoice === 2) {\n return \"paper\";\n } else {\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "f712a2b525c4c6d6fb429f94ab70eb7b", "score": "0.78361", "text": "function play(userChoice){\r\n //declaring computer choice\r\n //assigning to random number between 1 and 3\r\n var computerChoice = Math.floor(1 + Math.random() * 3);\r\n //assigning numbers 1-3 to rock, paper, or scissors\r\n // 1= rock\r\n if (computerChoice == 1) {\r\n computerChoice = \"rock\";\r\n //2 = paper\r\n } else if (computerChoice == 2) {\r\n computerChoice = \"paper\";\r\n //3 = scissors \r\n } else {\r\n computerChoice = \"scissors\";\r\n }\r\n //printing results\r\n document.getElementById(\"choices\").innerHTML = \"You choose: \"+ userChoice +\", Computer choose: \"+computerChoice;\r\n //calling compareChoices to decide winner\r\n document.getElementById(\"winner\").innerHTML = compareChoices(computerChoice, userChoice);\r\n\r\n}", "title": "" }, { "docid": "531b436339d23692408c9f3ca02bf409", "score": "0.7823213", "text": "function rps(yourChoice) {\r\n var choices = ['rock', 'paper', 'scissors'];\r\n var choiceNum = Math.floor(Math.random() * (3 - 0)) + 0;\r\n var compChoice = choices[choiceNum];\r\n if (yourChoice === 'rock' && compChoice === 'scissors' || yourChoice === 'scissors' && compChoice === 'paper' || yourChoice === 'paper' && compChoice === 'rock') {\r\n console.log('You WIN against ' + compChoice);\r\n }\r\n else if (yourChoice === 'rock' && compChoice === 'rock' || yourChoice === 'scissors' && compChoice === 'scissors' || yourChoice === 'paper' && compChoice === 'paper') {\r\n console.log('Its a TIE!!');\r\n }\r\n else {\r\n console.log('You LOSE against ' + compChoice);\r\n }\r\n\r\n}", "title": "" }, { "docid": "9659ed70d180e30f57110e87c15bdead", "score": "0.7812668", "text": "function choseRock() {\n let computerChoice = randomChoice();\n alert(computerChoice);\n if (computerChoice === \"rock\") {\n alert(\"Draw! Play again!\");\n } else if (computerChoice === \"paper\") {\n alert(\"You lose!\");\n } else {\n alert(\"You win!\");\n }\n}", "title": "" }, { "docid": "cc086a41cec09ccadd263eb2989b8cf4", "score": "0.77967364", "text": "function computerPlay(computerResult) {\n let computerNum = Math.floor(Math.random() * 3);\n if (computerNum == 0) {\n computerResult = \"rock\";\n } else if (computerNum == 1) {\n computerResult = \"paper\";\n } else if (computerNum == 2) {\n computerResult = \"scissors\";\n }\n console.log(\"Computer chose: \" + computerResult);\n return computerResult;\n}", "title": "" }, { "docid": "b2d5cb22c47a2ddf19808cb71b6b9d12", "score": "0.7784895", "text": "function playRound(playerSelection, computerSelection) {\n switch(computerSelection){\n case 'rock':\n if(playerSelection == 'paper'){\n result = 'win'; return result;\n }else if(playerSelection == \"scissors\"){\n result = 'lose'; return result;\n }else{\n result = 'tied'; return result;\n }\n break;\n case 'paper':\n if(playerSelection == 'rock'){\n result = 'lose'; return result;\n }else if(playerSelection == \"scissors\"){\n result = 'win'; return result;\n }else{\n result = 'tied'; return result;\n }\n break;\n case 'scissors':\n if(playerSelection == 'rock'){\n result = 'lose'; return result;\n }else if(playerSelection == 'paper'){\n result = 'win'; return result; \n }else{\n result = 'tied'; return result; \n }\n }\n}", "title": "" }, { "docid": "16d5be72c1d6d9b2378773f1db7580df", "score": "0.7783896", "text": "function getComputerChoice() {\r\n let randomNum = Math.floor(Math.random() * 3) + 1;\r\n let computerChoice;\r\n\r\n if (randomNum == 1) {\r\n computerChoice = \"rock\";\r\n } else if (randomNum == 2) {\r\n computerChoice = \"paper\"\r\n } else {\r\n computerChoice = \"scissors\";\r\n }\r\n\r\n return computerChoice;\r\n}", "title": "" }, { "docid": "aede3b2e0d4d83c329624918b3107f9f", "score": "0.77763426", "text": "function chooseRock() {\r\n console.log('You chose rock.');\r\n switch (aiChoice) {\r\n case 1:\r\n rpsGame();\r\n break;\r\n case 2:\r\n alert('Paper beats rock. You lose.');\r\n gameResults.push('You lose.');\r\n break;\r\n case 3:\r\n alert('Rock smashes scissors! You win!');\r\n gameResults.push('You win!');\r\n break;\r\n default:\r\n alert('How do you mess up this game?!?');\r\n }\r\n }", "title": "" }, { "docid": "b0e8f2c05fee193119dcdcb875ea3a5d", "score": "0.7765929", "text": "function playRound(playerSelection,computerSelection){\n if(playerSelection == 'rock' && computerSelection == 'rock'){\n return \"Game tie\";\n }else if(playerSelection == 'rock' && computerSelection == 'paper'){\n return \"Computer Wins\";\n }else if(playerSelection == 'rock' && computerSelection == 'scissor'){\n return \"You Win\";\n }else if(playerSelection == 'paper' && computerSelection == 'rock'){\n return \"You Win\";\n }else if(playerSelection == 'paper' && computerSelection == 'paper'){\n return \"Game tie\";\n }else if(playerSelection == 'paper' && computerSelection == 'scissor'){\n return \"Computer Wins\";\n }else if(playerSelection == 'scissor' && computerSelection == 'scissor'){\n return \"Game tie\";\n }else if(playerSelection == 'scissor' && computerSelection == 'paper'){\n return \"You Win\";\n }else if(playerSelection == 'scissor' && computerSelection == 'rock'){\n return \"Computer Wins\";\n }\n}", "title": "" }, { "docid": "b63fcf2d60ccf483f37a371a178a300e", "score": "0.77207834", "text": "function computerPlay(){\n const number = Math.floor(Math.random() * 3);\n if( number % 3 === 0){\n return \"rock\";\n } \n else if(number & 3 === 1){\n return \"paper\";\n }\n else{\n return \"scissors\";\n }\n}", "title": "" }, { "docid": "850b5f5dedaf5797b42eff314d061812", "score": "0.76951313", "text": "function playRound(playerSelection, computerSelection) {\n //process inputs to account for case\n playerSelection.toLowerCase()\n computerSelection.toLowerCase()\n\n //logic to decide who wins\n if (playerSelection === computerSelection) {\n return \"tie\"\n } else{\n if (playerSelection === \"rock\"){//handle rock\n if (computerSelection === \"paper\"){\n return \"lose\"\n }else{\n return \"win\"\n }\n }else if(playerSelection === \"paper\"){\n if (computerSelection ===\"rock\"){\n return \"win\"\n }else{\n return \"lose\"\n }\n }else{\n if(computerSelection === \"paper\"){\n return \"win\"\n }else{\n return \"lose\"\n }\n }\n }\n\n}", "title": "" }, { "docid": "850b5f5dedaf5797b42eff314d061812", "score": "0.76951313", "text": "function playRound(playerSelection, computerSelection) {\n //process inputs to account for case\n playerSelection.toLowerCase()\n computerSelection.toLowerCase()\n\n //logic to decide who wins\n if (playerSelection === computerSelection) {\n return \"tie\"\n } else{\n if (playerSelection === \"rock\"){//handle rock\n if (computerSelection === \"paper\"){\n return \"lose\"\n }else{\n return \"win\"\n }\n }else if(playerSelection === \"paper\"){\n if (computerSelection ===\"rock\"){\n return \"win\"\n }else{\n return \"lose\"\n }\n }else{\n if(computerSelection === \"paper\"){\n return \"win\"\n }else{\n return \"lose\"\n }\n }\n }\n\n}", "title": "" }, { "docid": "67a9660ae9c6668a65ce0f283e7a6b01", "score": "0.7693871", "text": "function getComputerChoice(){\r\n let luckNum = Math.floor(Math.random()*3);\r\n \r\n switch(luckNum){\r\n case 0:\r\n return 'rock';\r\n break;\r\n case 1:\r\n return 'paper';\r\n break;\r\n case 2:\r\n return 'scissors';\r\n break; \r\n }\r\n \r\n}", "title": "" }, { "docid": "48573b13d5bd1a0ee7272819b5c52bc7", "score": "0.7693204", "text": "function playRound(playerSelection) {\n let computerSelection = computerPlay()\n let result = \"\"\n\n if ((playerSelection == 'rock' && computerSelection == 'scissors') ||\n (playerSelection == 'paper' && computerSelection == 'rock') ||\n (playerSelection == 'scissors' && computerSelection == 'paper')) {\n result = \"You win\"\n }\n else if (playerSelection == computerSelection) {\n result = \"You draw\"\n }\n else {\n result = \"You lose\"\n }\n document.getElementById('result').textContent = result\n return\n}", "title": "" }, { "docid": "d00f859bbdc4919ffefc8c25396f727f", "score": "0.7687795", "text": "function chosePaper() {\n let computerChoice = randomChoice();\n alert(computerChoice);\n if (computerChoice === \"paper\") {\n alert(\"Draw! Play again!\");\n } else if (computerChoice === \"scissors\") {\n alert(\"You lose!\");\n } else {\n alert(\"You win!\");\n } \n}", "title": "" }, { "docid": "7d0b1d3d9e7cec83bccddb00bee16a5b", "score": "0.76869136", "text": "function rpsRound() {\n //pulling the random choice from the computer\n const computerSelection = computerPlay();\n //using a window prompt to get a choice from the user - making it lowercase\n let playerSelection = prompt('Rock, Paper or Scissors?');\n playerSelection = playerSelection.toLowerCase();\n\n\n if (playerSelection === 'scissors' && computerSelection === 'paper' ||\n playerSelection === 'rock' && computerSelection === 'scissors' ||\n playerSelection === 'paper' && computerSelection === 'rock') {\n alert(`You win! ${playerSelection} beats ${computerSelection}!`);\n return 'win';\n } else if (computerSelection === playerSelection) {\n alert(`Try again! You both picked ${playerSelection}!`);\n return 'draw';\n } else if (playerSelection !== 'rock' || playerSelection !== 'paper' || playerSelection !== 'scissors') {\n alert('Sorry, try again.')\n return 'fail'\n } else {\n alert(`You lose! ${computerSelection} beats ${playerSelection}!`);\n return 'loss';\n }\n}", "title": "" }, { "docid": "fdf3c9aec101ca6801a9e0ec7e69334d", "score": "0.7675699", "text": "function createComputerPlayer() {\r\n let randomNumber = Math.floor(Math.random() * 10)\r\n if(randomNumber <= 3) {\r\n return 'rock';\r\n } else if(randomNumber <= 6) {\r\n return 'paper';\r\n } else {\r\n return 'scissors';\r\n }\r\n}", "title": "" }, { "docid": "52b8380fb45eb5e17f1205d2cdde4b4d", "score": "0.76724136", "text": "function computerPlay(){\n let randHand = Math.random() * 3;\n if (randHand > 2){\n return 2;\n }\n else if( randHand > 1){\n return 1;\n }\n else {\n return 0;\n }\n}", "title": "" }, { "docid": "db42d974431baa272e2be8a0145c2665", "score": "0.7668896", "text": "function choseScissors() {\n let computerChoice = randomChoice();\n alert(computerChoice);\n if (computerChoice === \"scissors\") {\n alert(\"Draw! Play again!\");\n } else if (computerChoice === \"rock\") {\n alert(\"You lose!\");\n } else {\n alert(\"You win!\");\n } \n}", "title": "" }, { "docid": "9167814c4200388e708aec8c64e029de", "score": "0.7666988", "text": "function rockpaperscissors(){\n alert(\"BATTLE!\")\n let choice1 = prompt(\"rock, paper or scissors?\");\n let computerChoice = Math.random();\n if (computerChoice <0.34){\n choice2 = \"rock\";\n }else if(computerChoice <=0.67){\n choice2 = \"paper\";\n }\n else{\n choice2 = \"scissors\";\n } \n\n random(choice1,choice2);\n}", "title": "" }, { "docid": "645d2d771a5c50736eb22fbd9c8db5b5", "score": "0.7664899", "text": "function playRound(){\n\t\tvar arr = ['ROCK','PAPER','SCISSOR'];\n var playerSelection = playerPlay(arr);\n var computerSelection = computerPlay(arr);\n\t\tconsole.log(\"player = \", playerSelection);\n\t\tconsole.log(\"computer = \", computerSelection);\n\t\tvar compareSelection = compareBothChoices(playerSelection + computerSelection);\n\t\t\n\t\tif(playerSelection === computerSelection) return \"same\";\n\t\tif(playerSelection === false) return \"invalid input\";\n\t\tif(playerSelection === compareSelection) return \"Player Wins\";\n\t\tif(computerSelection === compareSelection) return \"Computer Wins\";\n}", "title": "" }, { "docid": "4b80f718645b5b33f789b0a2494a2303", "score": "0.7662527", "text": "function rockPaperScissors(num) {\n // 1 = rock, 2 = paper, 3 = scissors\n if (num > 3 || num < 1) {\n throw new Error ('choose a valid number');\n }\n let choice = Math.floor(Math.random()*3) + 1;\n if (choice === num) {\n return 'draw';\n }\n if (choice === 1 && num === 2) {\n return 'You win';\n }\n if (choice === 2 && num === 3) {\n return 'You win';\n } \n if (choice === 3 && num === 1) {\n return 'You win';\n }\n return 'You lose';\n}", "title": "" } ]
82c51a48f5d81267d28abe6abadcf7bc
3) Create a function named addTax that will accept an array like your myPizzaOrder array as a parameter. The function will insert an element into the array between the 2nd and 3rd element in the array that is equal to the 2nd element multiplied by 0.0925 and rounded to the nearest penny (ie 0.95, 0.79, 0.42, etc). The function should return the array. =========== Hint: find the method that will allow you to set the decimals.
[ { "docid": "752de3ae75cf207266f3c64ac41ca2c4", "score": "0.7731131", "text": "function addTax(arr){\n arr.splice(2, 0, (Math.round(arr[1]*0.0925*100))/100);\n return arr;\n}", "title": "" } ]
[ { "docid": "356f8be7c13d16d184bdb0f07117e163", "score": "0.70821965", "text": "function add_tax(amount)\n{\n return Math.round(113.0 * amount) / 100.0;\n}", "title": "" }, { "docid": "91c7da5235fa08d14123a694eb6e284e", "score": "0.64592755", "text": "function calculateTotPrice(totListPrice, tax)\n{\n var taxAmt = 0;\n\n var totPrice = 0;\n\n taxAmt = (totListPrice * tax) / 100;\n\n totPrice = parseFloat(totListPrice) + parseFloat(taxAmt);\n\n return totPrice;\n}", "title": "" }, { "docid": "c502f748db0ca279152c92e2ef3f9972", "score": "0.64409965", "text": "function pricePlusTax(item) {\nvar finalPrice = item += (item * TAX_RATE);\nreturn finalPrice;\n}", "title": "" }, { "docid": "6cefb097ff82d8a52d3bf4225beeae80", "score": "0.6366322", "text": "function caltax({amount = 100, tax=.25,tip=.10} = {}){\r\n return amount + (amount * tax) + (amount * tip);\r\n}", "title": "" }, { "docid": "6ea48062d256ac1c92b06018a7f5b073", "score": "0.6339657", "text": "function taxCalculator(itemPrice) {\n var tax = itemPrice * .085; \n var taxedFixeToTwoDecimalPlaces = tax.toFixed(2);\n var taxNumber = parseInt(taxedFixeToTwoDecimalPlaces);\n\n return taxNumber;\n\n}", "title": "" }, { "docid": "c1bf4c5ed4314c3fd14842f07ee70906", "score": "0.63183814", "text": "function taxCalculator(amount, taxrate){\n return amount + (amount * taxrate);\n}", "title": "" }, { "docid": "f38235eea16788a8d1dbd1247c49c693", "score": "0.6293964", "text": "function viporder (starterPrice,maindishPrice,dessertPrice,beveragePrice) {\n let jafer = starterPrice + maindishPrice + dessertPrice + beveragePrice;\n console.table(\"Receide =\"+jafer.toFixed(2)+\"€\");\n \n}", "title": "" }, { "docid": "1a8e21ae1c2cec55985cebbd478503f6", "score": "0.6264005", "text": "function taxFunc(){\n return orders.price = orders.price * orders.tax\n}", "title": "" }, { "docid": "f7003857347cb85e3ff90bc90fb7e228", "score": "0.62607723", "text": "function tax( price, percent ) {\r\n return parseFloat(( price * percent / 100 ).toFixed( 2 ));\r\n}", "title": "" }, { "docid": "07b0a2b82918544d835f89b93de21af3", "score": "0.6243194", "text": "function getTax() {\n return getSubTotal(orderCount) * tax;\n}", "title": "" }, { "docid": "dfd4a44f1dd7dd3691bda0a94d8cf388", "score": "0.62213624", "text": "function extraPizza(pizza){\n var extraPizza = (guest * 3) / 3.5;\n console.log(\"You will need to order a total of \" + extraPizza + \" Pizzas for all guests.\"); //added a parameter to come up with the total for all pizzas needing to be ordered.\n}", "title": "" }, { "docid": "2ff7b283a1375736f9c04d34e38a8608", "score": "0.6193069", "text": "function chge_tot(sub_tax, tip){\n var tot_amt = document.getElementById(\"total-amt\");\n var new_tot = (sub_tax+(sub_tax*tip)).toFixed(2);\n tot_amt.innerHTML = new_tot;\n}", "title": "" }, { "docid": "03ff09b2cb2153e63e9888f27bbb78b9", "score": "0.6174776", "text": "function tipCalc({ total = 100, tip = 0.15, tax = 0.13 }) {\n return total + (tip * total) + (tax * total);\n}", "title": "" }, { "docid": "9acabb1727ce259673864afc0d8fbf96", "score": "0.61572784", "text": "function tax_on_item(amount, tax_rate)\n{\n return Math.round(tax_rate * amount) / 100.0;\n}", "title": "" }, { "docid": "8d96c045dcb6b3a4cf0c5b2d8b2e21ee", "score": "0.6118006", "text": "function tipCalcArgsOrder(total, tip=0.15, tax = 0.13){\n}", "title": "" }, { "docid": "d23167cb595f18941abfdae8f90adac3", "score": "0.6063702", "text": "function calculateBill(total, tax = 0.12, tip = 0.15) {\n return total + (total * tax) + (total * tip);\n}", "title": "" }, { "docid": "05d2a06702720962900436492a62167e", "score": "0.6041322", "text": "function calculateTax(){\n\treturn calculatePay()*.15;\n}", "title": "" }, { "docid": "6c6ca5e40bb478225a4492fe77cf0198", "score": "0.6014398", "text": "function calculateTax(salary, savings, taxPercent = 5) {\n console.log((salary + savings) * (taxPercent / 100));\n}", "title": "" }, { "docid": "650cfc66525d865c1b682eaf036ea0e3", "score": "0.60112333", "text": "function returnTax(amount) {\n return amount * TAX_RATE;\n \n }", "title": "" }, { "docid": "9c299b22f6244e766c37b835654d14df", "score": "0.6010165", "text": "calcTax() {\n const rate = 0.032;\n\n let tax = this.total * rate;\n tax = tax.toFixed(2);\n this.tax = parseFloat(tax);\n }", "title": "" }, { "docid": "2a6537a7454e2df1bdeceb86ea000169", "score": "0.59611416", "text": "function adjustPrices(price) {\n return price.toFixed(2);\n}", "title": "" }, { "docid": "583c4b1994bb8516824918a9e5c22b36", "score": "0.5954938", "text": "function calculatePrice(price,tax,discount=10){\n taxablePrice = price - (price * (discount / 100))\n priceWithTax = taxablePrice + (taxablePrice * (tax / 100));\n return priceWithTax;\n }", "title": "" }, { "docid": "f6d60eb4d12183accdda72063cdf947b", "score": "0.59358865", "text": "function tip(price) {\n let tip = price * 1.1;\n let totalPrice = price + tip;\n\n totalPrice = `R$ ${totalPrice.toFixed(2)}`;\n tip = `R$ ${tip.toFixed(2)}`;\n console.log(`The waiter's tip is ${tip} and total price is ${totalPrice}`);\n}", "title": "" }, { "docid": "4f81a1be1512a869d5f3888c8549d18c", "score": "0.5922494", "text": "function calcCountyTax(sales)\n{\n return sales * .02;\n}", "title": "" }, { "docid": "8f2f0874be8c48319629d154598ca6c6", "score": "0.590894", "text": "function calculateTax(value) {\n let result = value * 1.1;\n\n return result;\n}", "title": "" }, { "docid": "cd95dee5f97ac2403da710f7163442a4", "score": "0.5894052", "text": "function solve(meal_cost, tip_percent, tax_percent) {\n // Write your code here\n let mealCost = meal_cost;\n let tipPercent = tip_percent;\n let taxPercent = tax_percent;\n\n // tip = 12 and 12/100 x 20 = 2.4\n let tip = (mealCost / 100) * tipPercent;\n // console.log(tip);\n\n // tax = 8 and 8/100 x 20 = 0.96\n let tax = (mealCost / 100) * taxPercent;\n // console.log(tax);\n\n // total_cost = meal_cost + tip + tax = 12 + 2.4 + 0.96 = 15.36\n let totalCost = Math.round(mealCost + tip + tax);\n // console.log(totalCost);\n\n // round(total_cost) = 15 (rounded total_cost to the nearest integer)\n return totalCost;\n}", "title": "" }, { "docid": "56a2a6a7c9a69b025aade67717a19263", "score": "0.58934844", "text": "function calculateTax(amount, taxPercentage){\n //ensuring that users enters the correct value or data type\n if(typeof(amount) === \"number\" && (typeof(taxPercentage) === \"number\")){\n //declaring and assigning variables\n \n var taxPerc = taxPercentage/100;//calculate tax percentage\n var payableAmount = amount * taxPerc;\n //calculating amount to be paid\n var taxAmount = payableAmount * 100;//outputing tax amount\n var calc = [taxAmount];\n\n console.log(calc + \" kobo\");\n } \n else {\n console.log(\"input numerical values\");\n }\n\n}", "title": "" }, { "docid": "59df8e8aa870f92ba63a0a8eca4c1790", "score": "0.5892911", "text": "priceWithTax() {\n // purchase tax is additive\n return this.price + (this.price * FRUIT_ITEM_TAX);\n }", "title": "" }, { "docid": "dee1d9c2a46429936d01163acc22b883", "score": "0.58584785", "text": "function computeTax(tendered, tax){\n\n if(isNaN(tax)){\n tax = .075;\n }\n else{\n tax = tax/100;\n }\n\n // tendered = x * (tax + 1)\n x = tendered * (tax);\n return x;\n}", "title": "" }, { "docid": "16f2ed338625a515417756704bed005d", "score": "0.5844189", "text": "function tax(amt){\n // calculate tax\n amt = amt * TAX_RATE + amt;\n return amt; \n }", "title": "" }, { "docid": "866c9f50cbc43f1f6640d5bb211f413b", "score": "0.5843055", "text": "function AddTax(subtotal){\n\t\treturn total;\n\t}", "title": "" }, { "docid": "66a5409b49e8f7ba5c8ef295fbfa9283", "score": "0.58337754", "text": "function pushMoney(fruitArray, fruitPrice){\n fruitArray.push(fruitPrice);\n return fruitArray;\n}", "title": "" }, { "docid": "77589e8f17902535a119910a1b639a02", "score": "0.582265", "text": "function updateTax(){\n let subtotal = parseFloat($(\"#subtotal\").text());\n let tax = subtotal * 0.08;\n tax = tax.toFixed(2); // Set to 2 decimal places\n $(\"#tax\").html(`${tax}`);\n }", "title": "" }, { "docid": "e897f05a25a4401e16de16f9dab11708", "score": "0.5789", "text": "function price(){\n var precio=0;\n flights.forEach(vuelo => {\n precio+=vuelo.cost;\n });\n precio= precio/flights.length+1;\n precio=precio.toFixed(2);\n console.log(\"El precio medio de los vuelos es de \"+precio+\"€\");\n}", "title": "" }, { "docid": "08896c349359a436175e8030e890e987", "score": "0.5767495", "text": "function tipCalculator(mealPrice, taxRate = 0.13, tipRate = 0.15) {\n const totalBill = mealPrice * (1 + taxRate + tipRate);\n\n return `The total bill is $${totalBill.toFixed(2)}`;\n}", "title": "" }, { "docid": "f331953ee995c0aed7940e5a801b29ce", "score": "0.57598525", "text": "function anaCustomer(items, taxRate = 1.13) {\n if (!Array.isArray(items)) {\n console.log('Invalid input type!')\n return null\n }\n if (items.length === 0) {\n console.log('Your cart is empty!')\n return null\n }\n let total = 0\n let arrLuxury = []\n let arrCommon = []\n items.map(item => {\n total += item\n if (item > 1000) {\n arrLuxury.push(item)\n } else {\n arrCommon.push(item)\n }\n })\n total *= taxRate\n return [total, arrLuxury, arrCommon]\n}", "title": "" }, { "docid": "13aad98ae45fa268e3261e0b6694409a", "score": "0.5751242", "text": "function tax(cost) {\r\n //******* 5) try/catch\r\n try {\r\n y = parseFloat(cost);\r\n z = y * 1.0825;\r\n totalRounded2Places = z.toFixed(2);\r\n total = totalRounded2Places;\r\n // **** 6) Return value\r\n return total;\r\n } catch (e) {\r\n window.alert(e.toString);\r\n }\r\n}", "title": "" }, { "docid": "a972dd8cae48a3ce4bf1e90af9d6e91c", "score": "0.57499266", "text": "function addDeposit(amount) {\n return amount * 2.4;\n}", "title": "" }, { "docid": "ef9eb3952008d74aa4ee9f89b7b4bca5", "score": "0.57330906", "text": "function calculateBill(subtotal, tax = 0.13, tip = 0.15) {\n return subtotal + (subtotal * tax) + (subtotal * tip);\n }", "title": "" }, { "docid": "317574b7f7783a03c74c7a22207bc3cd", "score": "0.57181895", "text": "function withSalesTax(taxRate) {\n return function(price){\n return Number((price * taxRate).toFixed(2));\n }\n }", "title": "" }, { "docid": "300729a784aa2a9f46ed2749d0569357", "score": "0.5714148", "text": "function applyTaxToItems(user){\n const {cart} = user\n const taxRate = 0.3\n const updatedCart = cart.map(item => {\n return {\n name: item.name,\n price: item.price * taxRate + item.price\n }\n })\n return Object.assign({}, user, {cart: updatedCart})\n }", "title": "" }, { "docid": "d4ff778a5a051fa5af855e167e986a00", "score": "0.56974286", "text": "function getTotalOfTaxes( addResultsTo ){\r\n\tvar addTotalOfTaxes = document.getElementById( addResultsTo ); //get the id as a text\r\n\t//note: taxIs, will come from function returnCurrentTaxesOf( locationId ) everytime to add/remove items\r\n\tvar taxIs = returnCurrentTaxesOf( 'locationSelectedNumber' );\r\n\tvar subTotalIs = getTotalForMoreThanOneElement('.viewMyPriceForThisItem');\r\n\tvar taxTotal = ( ( taxIs/100 ) * subTotalIs ); //ex: ( 7.45/100 * 150 )+ 150 = 161.175.toFixed(2) ~ 161.18\r\n\t//add results to tax total:\r\n\taddTotalOfTaxes.innerText = taxTotal.toFixed(2);\r\n\t//return my total of taxes only:\r\n\treturn taxTotal.toFixed(2);\r\n}", "title": "" }, { "docid": "d3c59a9c04387af1c15c8006c4cb5c88", "score": "0.5696809", "text": "static getTax(amount, taxPercent){\n var totalPercent = 100 + taxPercent;\n return amount * taxPercent / totalPercent\n }", "title": "" }, { "docid": "ee60c91c9baf4e74b55a796920391154", "score": "0.56948066", "text": "function place_pizza_order(rid,tray,price) {\n var args = {\n rid: rid.toString(),\n em: 'detox27@gmail.com',\n tray: tray,\n //tip: '6.66',\n tip: (parseFloat(price,10)*.2).toFixed(2).toString(),\n first_name: 'Slammin',\n last_name: 'Sammy',\n phone: '6666666666',\n zip: '10036',\n addr: '1500 Broadway',\n city: 'New York',\n state: 'NY',\n card_name: 'Slammin Sammy',\n card_number: '4111111111111111',\n card_cvc: '123',\n card_expiry: '06/2006',\n card_bill_addr: '31 High Street',\n card_bill_city: 'New Brunswick',\n card_bill_state: 'NJ',\n card_bill_zip: '08901',\n card_bill_phone: '5555555555',\n delivery_date: 'ASAP'\n };\n ordrin_api.order_guest(args, function(error,data){\n if(error){\n console.log(error);\n }\n else{\n console.log('Order Successful');\n }\n\n });\n\n}", "title": "" }, { "docid": "753927152ac3681a59f7a901b714cf4d", "score": "0.5689403", "text": "function addToTotal(item, units) {\n total += Number((item.price * units).toFixed(2));\n\n $(\".total\").text(total);\n}", "title": "" }, { "docid": "9b7615efcbd63bc0f3a0205600aced5d", "score": "0.5677934", "text": "function receiptOutput (shoppingBasket) {\n for (var x = 0 ; x < shoppingBasket.length ; x++) {\n var shoppingItem = shoppingBasket[x];\n shoppingItem.taxTotal = shoppingItem.cost * (shoppingItem.salesTax + shoppingItem.importTax);\n shoppingItem.withTax = shoppingItem.cost + shoppingItem.taxTotal;\n console.log(\"1 \" + shoppingItem.item + \": $\" + shoppingItem.withTax.toFixed(2));\n }\n\n var taxes = 0;\n var totalCost = 0;\n for (var x = 0 ; x < shoppingBasket.length ; x++) {\n var shoppingItem = shoppingBasket[x];\n taxes += shoppingItem.taxTotal;\n totalCost += shoppingItem.withTax;\n }\n\n console.log(\"Sales Tax: $\" + (Math.round(taxes * 20) / 20).toFixed(2));\n console.log(\"Total Cost: $\" + totalCost.toFixed(2));\n\n\n}", "title": "" }, { "docid": "1767c280252cfe62c1cb1f0b60656970", "score": "0.5672058", "text": "function exerciseTwo() {\n const price = 5.99;\n const quantity = prompt('How many items would you like to purchase?');\n const afterTax = price * quantity * 1.13;\n console.log(`The total cost of your purchase is $${afterTax.toFixed(2)}`);\n }", "title": "" }, { "docid": "3c9010387c38674ffb32ed1e9690dc48", "score": "0.5651389", "text": "function ToGo (starterPrice,maindishPrice,dessertPrice,beveragePrice) {\n let driveIn = starterPrice + maindishPrice + dessertPrice + beveragePrice;\n console.table(\"To go, receide =\"+driveIn.toFixed(2)+\"€\");\n \n}", "title": "" }, { "docid": "52776d80f6d8edfdfe8eb1c9a81e2611", "score": "0.5645034", "text": "function tipCal(price) {\n let tip = price * .2;\n return tip;\n}", "title": "" }, { "docid": "53e307901d90ea9827a82a88b92a4e27", "score": "0.5644156", "text": "function calculateTotal() {\n const firstCount = getValue(\"first\");\n const economyCount = getValue(\"economy\");\n const totalPrice = firstCount * 150 + economyCount * 100;\n document.getElementById(\"total-price\").innerText = \"$\" + totalPrice;\n\n\n //tax Amount Calculation\n\n const tax = totalPrice * 10 / 100;\n document.getElementById(\"tax-amount\").innerText = \"$\" + tax;\n const grandTotal = totalPrice + tax;\n document.getElementById(\"total-amount\").innerText = \"$\" + grandTotal\n}", "title": "" }, { "docid": "9af80ee90dc8e90f24b455928a8839e9", "score": "0.5637818", "text": "function sumTotal(priceItem) {\n subtotal += parseFloat(priceItem);\n $('#subtotal').text(`$${subtotal.toFixed(2)}`);\n tax = (subtotal*9.6)/100;\n $('#tax').text(`$${tax.toFixed(2)}`);\n total = subtotal + tax;\n $('#total').text(`$${total.toFixed(2)}`);\n}", "title": "" }, { "docid": "6a7ef351d2aaa4c8cc4bb7ecc5d6d656", "score": "0.56300825", "text": "calculateBuyPriceAndAmount(orderBookAsks, tetherHeld, precision){\n\n var tetherTrack = tetherHeld;\n\n //loop through the order book and check for asks\n for(let i = 0; i < orderBookAsks.length; i++){\n // for(let i = 0; i < 1; i++){ //test\n\n //0 is price, 1 is quantity\n let currentAsk = orderBookAsks[i][0] * orderBookAsks[i][1];\n\n // let currentAmount = tetherHeld / orderBookAsks[i][0];//test\n // return [orderBookAsks[i][0], currentAmount];//test\n\n //Subtract from the current tether amount\n tetherTrack -= currentAsk;\n\n //tetherTrack is less than zero when there is enough supply to buy\n if(tetherTrack < 0){\n let currentAmount = tetherHeld / orderBookAsks[i][0];\n currentAmount = currentAmount.toFixed(precision);\n return [orderBookAsks[i][0], currentAmount];\n }\n }\n\n throw \"Unable to parse buy price\";\n }", "title": "" }, { "docid": "eb85afb28e04daac1aa6afefe147b102", "score": "0.5624245", "text": "function getTax(subtotal) {\n const taxElement = document.getElementById(\"tax\");\n const tax = subtotal * 0.1;\n taxElement.innerText = tax;\n return tax;\n}", "title": "" }, { "docid": "6d623b10b7bbcffd57ec04b195484613", "score": "0.56173223", "text": "function chge_subtot(del_sub, tip){\n var sub_amt = document.getElementById('subtotal-amt');\n var tax_amt = document.getElementById('tax-amt');\n\n var sub_num = parseFloat(sub_amt.innerHTML);\n var tax_num = parseFloat(tax_amt.innerHTML);\n\n const tax_mult = 0.04;\n\n var del_tax = del_sub*tax_mult\n\n sub_num=sub_num+del_sub\n tax_num=tax_num+del_tax\n\n sub_amt.innerHTML = sub_num.toFixed(2);\n tax_amt.innerHTML = tax_num.toFixed(2);\n chge_tot(sub_num+tax_num, tip);\n return (sub_num+tax_num);\n}", "title": "" }, { "docid": "25dbedf5494824a360beeac34c27528e", "score": "0.56020784", "text": "function priceChange() {\n\tfor (var i = 0; i < fruits.length; i++) {\n\t\tvar randomPrice = randomNumber(-.50, .50);\n\t\tvar currentPrice = fruits[i][1];\n\t\tvar newPrice = randomPrice + currentPrice;\n\t\tif (newPrice < .50) {\n\t\t\tnewPrice = .50;\n\t\t} else if (newPrice > 9.99) {\n\t\t\tnewPrice = 9.99;\n\t\t}\n\t\tfruits[i][1] = newPrice;\n\t}\n}", "title": "" }, { "docid": "86f17eda025bb1dc7938478d452496b6", "score": "0.5597769", "text": "function income2tax(income) {\n return 12*income*1.34*1368/3775.237;\n}", "title": "" }, { "docid": "abe54e044e8cc86d80cd41f1dee5d7b0", "score": "0.55968034", "text": "function Market(price) {\n var priceFlux = randomCurrency(-0.50, 0.50);\n\n\n for (var i = 0; i < fruitArray.length; i++) {\n priceFlux.toFixed(2);\n // Condition to determine prices within 50 cents\n if (priceFlux + fruitArray[i][1] < 0.50) {\n fruitArray[i][1] = 0.50;\n } else if (priceFlux + fruitArray[i][1] > 11.50) {\n fruitArray[i][1] = 11.50;\n } else {\n fruitArray[i][1] += priceFlux;\n }\n\n }\n console.log('New Price',fruitArray);\n return $('.appleLive').text('Current price: ' +'$' + (fruitArray[0][1]).toFixed(2)),\n $('.orangeLive').text('Current price: ' +'$' + (fruitArray[1][1]).toFixed(2)),\n $('.bananaLive').text('Current price: ' +'$' + (fruitArray[2][1]).toFixed(2)),\n $('.pearLive').text('Current price: ' +'$' + (fruitArray[3][1]).toFixed(2));\n}", "title": "" }, { "docid": "63f8df1bb8235d3a0cd0f1012c7e52e7", "score": "0.5593738", "text": "function calculateBill(bill, tax, tip) {\n if (tax === undefined) {\n tax = .15;\n }\n if (tip === undefined) {\n tip = .13;\n }\n return (bill + (bill * tax) + (bill * tip));\n}", "title": "" }, { "docid": "df61c1ded9804f46dede599f388aa328", "score": "0.55867934", "text": "function tst() {\n\t\tvar w = parseFloat(toppingTotal);\n\t\t//alert(\"variable w: \"+w);\n\t\tvar x = parseFloat(piePrice) + w;\n\t\tvar y = x * .06;\n\t\t\n\t\t//alert(\"variable y: \"+y);\n\t\tyy = y.toFixed(2);\n\t\tvar z = x + y;\n\t\t zz = z.toFixed(2);\n\t\tdocument.getElementById(\"tallySalesTax\").innerHTML = \"<i><strong>\"+yy+\"</strong></i>\";\n\t\tdocument.getElementById(\"tallyTotal\").innerHTML = \"<strong>$\"+zz+\"</strong>\";\n\t\t//alert(\"Sales Tax \" + y + \" Pie Price \" + x + \" Total Cost:$\" + zz); \n\t\t\t\t}", "title": "" }, { "docid": "4970d663cbbba88fd4a21ef09ff8d1e9", "score": "0.5571902", "text": "function calcStateTax(sales)\n{\n return sales * .04;\n}", "title": "" }, { "docid": "001964559b12d02bc7bf9980b6a49f39", "score": "0.55697006", "text": "function calcCost() {\r\n var div = document.getElementById(\"test\");\r\n\r\n //Pulls user selection from numPizzas index\r\n var pizzaPicker = document.getElementsByName(\"numPizzas\")[0];\r\n //Converts selection to number for calculation\r\n var numPizzas = parseInt(pizzaPicker.options[pizzaPicker.selectedIndex].text);\r\n\r\n var pizzaPrice = 10;\r\n var taxRate = 0.076;\r\n\r\n var subTotal = numPizzas * pizzaPrice;\r\n var taxes = subTotal * taxRate;\r\n var total = taxes + subTotal;\r\n\r\n div.innerHTML += `</br></br>Order Details:</br>Your subtotal: $ ${subTotal}.00\r\n </br> Taxes Charged: $ ${taxes} \r\n </br> Your total: $ ${total}`;\r\n}", "title": "" }, { "docid": "0afb307553413b307b8c98c3f439ba25", "score": "0.55656993", "text": "function priceChange() {\n\tfor (var i = 0; i < fruits.length; i++) {\n\t\tvar randomPrice = randomNumber(-50, 50) / 100;\n\t\tvar currentPrice = fruits[i][1];\n\t\tnewPrice = randomPrice + currentPrice;\n\t\t\n\t\t// fruits cannot go below 50 cents or above $9.99\n\t\tif (newPrice < .50) {\n\t\t\tnewPrice = .50;\n\t\t} else if (newPrice > 9.99) {\n\t\t\tnewPrice = 9.99;\n\t\t}\n\n\t\t// writing the new price to each fruit array\n\t\tfruits[i][1] = newPrice;\n\t\t\n\t\tconsole.log(fruits[i][0], newPrice);\n\n\t\t// display the fruits' new prices on the DOM\n\t\t$('#' + fruits[i][0] + 'Price').children().first().text('$' + (newPrice).toFixed(2));\n\t\t$\n\n\t}\n\t\n}", "title": "" }, { "docid": "9e58a624968dc097bd330261193240d7", "score": "0.55425125", "text": "function getTotalPrice(array) {\n let result = 0;\n array.forEach((element) => {\n console.log(Math.floor(element * 100));\n result += Math.floor(element * 100);\n });\n return `$${result / 100}`;\n}", "title": "" }, { "docid": "6a5fcfde932b5aa099876153c59fafe6", "score": "0.5541294", "text": "function taxFunction(truePercent){\r\n var rawTax = parseFloat(truePercent.slice(0, 1));\r\n var rawPointTax = \".\" + rawTax\r\n var finalTax = parseFloat(rawPointTax);\r\n return finalTax;\r\n }", "title": "" }, { "docid": "3c18b901cd594e372b037ea3d832678b", "score": "0.55371886", "text": "function calculateTax() {\n return payGrades[getCadre()].taxMultiplier * salary;\n}", "title": "" }, { "docid": "b245640d8185bb0b3f45f581f2d20ab3", "score": "0.5535271", "text": "addPizza(pizzaIn,sizeIn,crustIn) {\n let pizza = new Pizza(pizzaIn,sizeIn,crustIn);\n this.order.push(pizza);\n }", "title": "" }, { "docid": "78c3e0806c610b1d7b73abacfe4f397e", "score": "0.549826", "text": "calcTax() {\n let costGettingIncome, costGettingIncomePercentage, taxBase;\n \n if (elements.workContractCosts20.checked) {\n costGettingIncomePercentage = 0.2;\n } else if (elements.workContractCosts50.checked) {\n costGettingIncomePercentage = 0.5;\n }\n \n if (!elements.flatTax.checked) {\n costGettingIncome = Math.round(this.payment * costGettingIncomePercentage);\n taxBase = Math.round(this.payment - costGettingIncome);\n } else {\n taxBase = Math.round(this.payment);\n }\n\n this.PIT = Math.round(taxBase * 0.17);\n }", "title": "" }, { "docid": "c9fcafb143a8f092f58679cd957ccf7a", "score": "0.5495356", "text": "function tipCalc(newMealPrice, newTipRate) {\n return newMealPrice * newTipRate / 100;\n}", "title": "" }, { "docid": "4f30f28fc9c71f90e452f2eabb6d5447", "score": "0.5494981", "text": "function billTotal(subTotal){\nreturn subTotal + (subTotal * .15) + (subTotal * .095);\n}", "title": "" }, { "docid": "227a487ea960b4917e645346fb017a96", "score": "0.5493505", "text": "function taxCalculator(num1, state) {\n if (state == \"NY\") {\n num1 = 4 / 100 + 1;\n } else {\n num1 = 6.625 / 100 + 1;\n }\n sum = 100 * num1;\n return sum;\n}", "title": "" }, { "docid": "f375f5f1dc36bf06f9c420fae875199e", "score": "0.5483943", "text": "function changeAvgPrice(fruitName, fruitArray){\n for (var i = 0; i < fruitArray.length; i++){\n averagePrice += fruitArray[i];\n\n }\n averagePrice /= fruitArray.length;\n $('.' + fruitName + '-avg-price').text(\"$\" + averagePrice.toFixed(2));\n return averagePrice;\n\n}", "title": "" }, { "docid": "2350f7c50a49601a395c84a33aa17b73", "score": "0.54758507", "text": "function calculateTotal(product) {\r\n\r\n const phoneCount = getInputvalue('iphone');\r\n const macCount = getInputvalue('mac');\r\n const caseCount = getInputvalue('case');\r\n\r\n const totalCost = phoneCount * 999 + macCount * 1419 + caseCount * 59;\r\n document.getElementById(\"first-total\").innerText = \"$\" + totalCost;\r\n let getTax = document.getElementById(\"total-tax\").innerText;\r\n let totalTaxToInt = parseFloat(getTax);\r\n //console.log(totalTaxInt);\r\n const totalPrice = totalTaxToInt + totalCost;\r\n if(totalPrice>=5000){\r\n getTax = 50;\r\n document.getElementById(\"total-tax\").innerText = getTax;\r\n let totalTaxToInt = parseFloat(getTax);\r\n const totalPrice = totalTaxToInt + totalCost;\r\n document.getElementById(\"second-total\").innerText = \"$\" + totalPrice;\r\n }\r\n else{\r\n document.getElementById(\"second-total\").innerText = \"$\" + totalPrice;\r\n\r\n }\r\n}", "title": "" }, { "docid": "b232645e51a20cdf48345e5d788723b9", "score": "0.54741323", "text": "function receipt(bill, tax, tip){\n\tif (tax == 'ca') {\n\n\t\treturn (bill + (bill * 0.1) + tip); //! For California use \"ca\" on input info //\n\t} else if (tax == 'wa') {\n\t\treturn (bill + tip); //! For Seattle use \"wa\" on input info //\n\t} else {\n\t\treturn (bill + (bill * 0.08) + tip); //! For Others use anything else exept \"ca\" and \"wa\" on input info //\n\t}\n}", "title": "" }, { "docid": "fdc3c7a2eddf9e6b8a9808a2b5e0d91c", "score": "0.54737693", "text": "function updatePriceByProduct(productPrice, index){\n var a = document.getElementsByClassName('js-total');\n a[index].innerHTML = productPrice.toFixed(2) + \"$\";\n}", "title": "" }, { "docid": "b330bc7daf296a23413454beeed9004f", "score": "0.5468524", "text": "function tipCalc(bill){\n let tip=(bill* 0.2)\n return tip.toFixed(2)\n}", "title": "" }, { "docid": "092cc2f77a66033e7a3b6506104d4a4e", "score": "0.54637784", "text": "calculateTotal(taxRate = this.taxRate) {\n let totalInCart = this.items.reduce((accumulator, item) => {\n return accumulator + item.quantity * item.price;\n }, 0)\n return totalInCart * (1 - taxRate);\n }", "title": "" }, { "docid": "b765d7144ff02b9884fb9fae859da729", "score": "0.54517525", "text": "function getSummQuant(baggins) {\n var arr = new Array(2);\n arr[0] = 0;\n arr[1] = 0;\n for (var i = 0, n = baggins.length; i < n; i++) {\n arr[0] += +baggins[i].price; \n arr[1] += +baggins[i].quantity; \n }\n arr[0]= arr[0].toFixed(2);\n return arr;\n}", "title": "" }, { "docid": "a5b95dc18804c54d60b3dcd36c0346d9", "score": "0.54434305", "text": "function percentage(basicAmnt, tax, rowNum) {\n\tdebugger;\n\tvar taxAmnt = (basicAmnt/100) * tax;\n\ttaxAmnt = Math.round(taxAmnt * 100)/100;\n\tdocument.getElementById(\"TaxAmountId\"+rowNum).value = parseFloat(taxAmnt).toFixed(2);\n\tvar amntaftTx = parseFloat(basicAmnt) + parseFloat(taxAmnt);\n\tamntaftTx = Math.round(amntaftTx * 100)/100;\n\tdocument.getElementById(\"AmountAfterTaxId\"+rowNum).value = parseFloat(amntaftTx).toFixed(2);\n}", "title": "" }, { "docid": "695eea1df419f5b8d05f61a6e0b1be0b", "score": "0.54293126", "text": "function update_quantity(item)\r\n {\r\n var total = 0;\r\n for(var i = 0; i < 4; i++)\r\n {\r\n if(items[i].item == item)\r\n {\r\n let qty_name = item + \"_quantity\";\r\n let edit = document.getElementById(qty_name);\r\n items[i].quantity = edit.value;\r\n document.getElementById(item).className = \"badge badge-primary\";\r\n }\r\n total += items[i].quantity * items[i].price;\r\n\r\n }\r\n // Calculate the total amount for an order\r\n document.getElementById(\"total\").textContent = total.toFixed(2);\r\n document.getElementById(\"tax\").textContent = (total * 0.06).toFixed(2);\r\n document.getElementById(\"order-total\").textContent = (total + total * 0.06).toFixed(2); \r\n // Above line of code is not working.\r\n }", "title": "" }, { "docid": "4284cc20de83963f94ea4462e97fef74", "score": "0.54281646", "text": "function add(a, b, taxRate = 1.0) {\n let sum = a + b\n return sum\n}", "title": "" }, { "docid": "38d91ccf3e51426730324e7a1eb021e0", "score": "0.54096985", "text": "function tipCalculator(amount) {\n if (amount < 50) {\n return amount + (amount * 0.20);\n } else if (amount >= 50 && amount <= 200) {\n return amount + (amount * 0.15);\n } else if (amount > 200) {\n return amount + (amount * 0.10);\n }\n}", "title": "" }, { "docid": "ebcca033d9d633c1bcb0295c1cd63e72", "score": "0.5407129", "text": "function calculateTip(tipPercentage, billTotal) {\n var tipPercentage = tipPercentage\n var tipAmount = tipPercentage * billTotal;\n tipAmount = tipAmount.toFixed(2);\n return parseFloat(tipAmount);\n}", "title": "" }, { "docid": "07c38a57c888cdf28ff0f8563804ef88", "score": "0.5406855", "text": "function setPrices() {\n var total = 0;\n\n for (var i = 0; i < prices.length; i++) {\n let quantity = inputs[i].value;\n //let price = parseFloat(prices[i].textContent);\n let price = parseFloat(prices[0].textContent.replace(',', '.'));\n //totals[i].textContent = quantity * price;\n total += quantity * price;\n }\n\n $(\".total\").text(total.toString().replace(\".\", \",\"));\n}", "title": "" }, { "docid": "612e9c4ff5de4b1e82539f8629595ed3", "score": "0.5402918", "text": "function hotelTax(amount){\r\n\r\n const totalamount = {\r\n ashirwad_inn : amount + (amount * .30),\r\n blue_diamond : amount + (amount * .25),\r\n vishram_regency : amount + (amount * .20),\r\n choupaty : amount + (amount * 0)\r\n}\r\nreturn totalamount;\r\n}", "title": "" }, { "docid": "658937da767cbc82ea7e5586d4f6dcd1", "score": "0.5402501", "text": "function GSTpercentage(basicAmnt, tax, rowNum) {\n\tdebugger;\n\tvar taxAmnt = (basicAmnt/100) * tax;\n\ttaxAmnt = Math.round(taxAmnt * 100)/100;\n\tdocument.getElementById(\"GSTAmount\"+rowNum).value = parseFloat(taxAmnt).toFixed(2);\n\tvar amntaftTx = parseFloat(basicAmnt) + parseFloat(taxAmnt);\n\tamntaftTx = Math.round(amntaftTx * 100)/100;\n\tdocument.getElementById(\"AmountAfterTaxx\"+rowNum).value = parseFloat(amntaftTx).toFixed(2);\n}", "title": "" }, { "docid": "ed90b2ee63f7f49651c18aa5cb54f26a", "score": "0.540038", "text": "function pizzaSqInCost(price, area){\n //cost per inch = price/area\n var costPerIn = price/area;\n\n //Since this is a cost, round to 2 decimal places\n costPerIn = costPerIn.toFixed(2);\n\n return costPerIn;\n\n}", "title": "" }, { "docid": "c655ee7dd7a68abbe2dae52e134314c4", "score": "0.53815377", "text": "function getTotalOrderPrice(quantity, price, VAT) {\n let exVAT = quantity*price;\n// ? How do we know what 'VAT' is? \n return exVAT + (VAT*exVAT);\n}", "title": "" }, { "docid": "a752b938563d3802f218df05d2b082c0", "score": "0.5379527", "text": "function taxForOrder (params, cb) {\n let { zip, amount, mapquestKey } = params;\n\n if (!zip) {\n if (cb && typeof cb === 'function') cb(false);\n return;\n }\n\n // Get full location information (city, state) for the provided ZIP code\n let loc = zipcodes.lookup(zip);\n\n if (!loc) {\n if (cb && typeof cb === 'function') cb('could not lookup zip');\n return;\n }\n\n // Ensure our input amount is a two-decimal float\n if (amount) amount = parseFloat(amount);\n\n const isInt = amount % 1 === 0;\n\n if (amount && !isInt) amount = parseFloat(amount.toFixed(2));\n\n // Scaffold the beginnings of our output object\n let obj = { amount: amount, shipping: 0, order_total_amount: amount };\n\n // Join in augmented location information\n if (loc) obj = Object.assign(obj, loc);\n\n // Check expiration\n function checkExpiry () {\n if (taxrates && taxrates.expires && timestamp > + new Date(taxrates.expires)) {\n obj.expired = true;\n console.log('Tax rate table in npm library washington-state-sales-tax has expired');\n } else\n obj.expired = false;\n }\n\n // Callback to be executed after final tax rate is determined\n function afterSettled () {\n // Append jurisdictions object to output object\n var jurisdictions = { country: \"US\", state: \"WA\" };\n\n if (obj.county) jurisdictions.county = obj.county.toUpperCase();\n if (obj.city) jurisdictions.city = obj.city.toUpperCase();\n obj.jurisdictions = jurisdictions;\n\n // If we have a taxable amount\n if (amount) {\n if (obj.totalTaxRate) { // If we have a tax rate\n obj.rate = obj.totalTaxRate;\n obj.inferred = false;\n\n } else { // Fallback behavior: charge the 10.25% (maximum) rate for unspecified WA orders. You will need to refund this later.\n obj.inferredRate = 0.1025;\n obj.inferred = true;\n obj.rate = 0.1025;\n }\n\n obj.amount_to_collect = parseFloat((amount * obj.rate).toFixed(2));\n }\n\n if (cb && typeof cb === 'function') cb(obj);\n return;\n }\n\n // Assume our sales tax nexus is only Washington State.\n // Calculate sales tax for WA, US orders and no others.\n if (obj.country === 'US' && obj.state === 'WA') {\n obj.tax_source = \"destination\";\n obj.taxable_amount = amount;\n obj.freight_taxable = true;\n obj.has_nexus = true;\n\n // Add tax rate table expiry date to output\n if (taxrates && taxrates.expires) obj.expires = taxrates.expires;\n checkExpiry();\n\n // Exact city match\n if (taxrates && taxrates[obj.city]) {\n obj = Object.assign(obj, taxrates[obj.city]);\n obj.taxLocaleString = obj.city;\n afterSettled();\n\n // Exact city match plus space\n } else if (taxrates && taxrates[obj.city+' ']) {\n obj = Object.assign(obj, taxrates[obj.city+' ']);\n obj.taxLocaleString = obj.city;\n afterSettled();\n\n // Exact city match uppercase\n } else if (taxrates && taxrates[obj.city.toUpperCase()]) {\n obj = Object.assign(obj, taxrates[obj.city.toUpperCase()]);\n obj.taxLocaleString = obj.city;\n afterSettled();\n\n // Lookup county if mapquestKey provided\n } else if (mapquestKey) {\n var county, countyString, countyString2, countyString3;\n\n var url = `http://open.mapquestapi.com/geocoding/v1/address?key=${ mapquestKey }&location=${ obj.city },${ obj.state }}`;\n\n request.get(url).set('Content-Type', 'application/json').end((err, ress) => {\n if (ress && ress.body) {\n\n try {\n if (ress.body.results[0].locations[0].adminArea4Type === 'County') county = ress.body.results[0].locations[0].adminArea4;\n if (county) {\n countyString = county + ' Unincorp. Areas';\n countyString2 = county + ' County'.toUpperCase();\n countyString3 = county + ' County RTA'.toUpperCase();\n }\n\n if (taxrates[countyString]) {\n obj = Object.assign(obj, taxrates[countyString]);\n obj.taxLocaleString = countyString;\n\n } else if (taxrates[countyString2]) {\n obj = Object.assign(obj, taxrates[countyString2]);\n obj.taxLocaleString = countyString2;\n\n } else if (taxrates[countyString3]) {\n obj = Object.assign(obj, taxrates[countyString3]);\n obj.taxLocaleString = countyString3;\n\n } else if (taxrates[county]) {\n obj = Object.assign(obj, taxrates[county]);\n obj.taxLocaleString = county;\n\n } else if (taxrates[county.toUpperCase()]) {\n obj = Object.assign(obj, taxrates[county.toUpperCase()]);\n obj.taxLocaleString = county;\n }\n\n } catch(e){}\n\n if (county) obj.county = county;\n\n afterSettled();\n\n } else {\n afterSettled();\n }\n });\n } else {\n afterSettled();\n }\n\n } else {\n // Out of state (zero)\n checkExpiry();\n\n obj.freight_taxable = true;\n obj.amount_to_collect = 0;\n obj.taxable_amount = 0;\n obj.has_nexus = false;\n obj.rate = 0;\n\n if (cb && typeof cb === 'function') cb(obj);\n return;\n }\n}", "title": "" }, { "docid": "bc5e23ce2ecf7da5d0726eb87b7cd442", "score": "0.537724", "text": "function calcCoffee(orderValue, taxCodeValue, coffeeSizeValue, coffeeTempValue) {\n // Ensures all variables are declared here before they are used\n 'use strict';\n // Declares variables\n let purchaseAmount = 0;\n let taxRate = 0;\n let calcTax = 0;\n let total = 0;\n\n let orderName = ['hazelnut', 'regular_decaf', 'regular', 'americano', 'latte']\n let orderCost = [2.25, 2.50, 2.25, 2.75, 4.00]\n\n // orderName.forEach(element => {\n // if (orderValue == element) purchaseAmount = element\n // });\n for (var i = 0; i < orderName.length; i++) {\n if (orderValue == orderName[i]) {\n purchaseAmount = orderCost[i]\n break\n }\n }\n console.log(purchaseAmount)\n switch (taxCodeValue) {\n case \"glendale\":\n taxRate = .087;\n break;\n case \"peoria\":\n taxRate = .077;\n break;\n case \"phoenix\":\n taxRate = .09;\n break;\n }\n switch (coffeeSizeValue) {\n case \"small\":\n case \"medium\":\n case \"large\":\n total += .50;\n break;\n case \"extraLarge\":\n total += 1;\n break;\n }\n switch (coffeeTempValue) {\n case \"hot\":\n break;\n case \"cold\":\n total += .20;\n break;\n }\n console.log(total);\n\n if (!isNaN(purchaseAmount)) {\n calcTax = purchaseAmount * taxRate;\n total += parseFloat(purchaseAmount) + parseFloat(calcTax);\n console.log(total);\n taxOutputID.value = calcTax.toFixed(2);\n totalOutputID.value = total.toFixed(2);\n }\n if (!isNaN(total)) {\n var grandTotalCalc = function (totalInput) {\n grandTotal += totalInput;\n //return grandTotal;\n }\n grandTotalCalc(total);\n grandTotalOutputID.value = grandTotal.toFixed(2);\n }\n receiptButtonID.disabled = false;\n}", "title": "" }, { "docid": "e48e98648f5dd9475f808658809072e1", "score": "0.536564", "text": "static _totalWithTax(cost) {\n return cost + cost * Store.tax\n }", "title": "" }, { "docid": "21354160c913825ac890b31a131758a3", "score": "0.53640765", "text": "function pizzaSqInCost(area,price)\n {\n //Price / area\n var costPerSqIn = price/area;\n\n //We should round this number to 2 decimal places\n costPerSqIn = costPerSqIn.toFixed(2);\n\n return costPerSqIn;\n }", "title": "" }, { "docid": "74af7922cd72d3e8c705112bab22f838", "score": "0.53597516", "text": "function tipCalc(service, total) {\n var tipAmount;\n var newTotal;\n if (service == \"good\") {\n tipAmount = Math.floor((total * 0.20) * 100 ) / 100;\n } else if (service == \"fair\") {\n tipAmount = total * 0.15;\n } else if (service == \"bad\") {\n tipAmount = total * 0.10; \n } else {\n console.log(\"Enter service and total!\");\n return;\n }\n}", "title": "" }, { "docid": "9e8993e7adfb5d564b3ceda98f461ebb", "score": "0.5346618", "text": "function appendPizzaToOrder(pizza) {\n $(\"#order-display\").append(\n \"<div class='order-summary'><h5>\" + capitalize(pizza.size) + \" Pizza<em>$\" + prices[pizza.size] + \"</em></h5><ul></ul></div>\"\n );\n pizza.toppings.forEach(function(topping) {\n $(\".order-summary:last-of-type ul\").append(\"<li>\" + topping.name + \"<em>$\" + topping.cost + \"</em></li>\")\n });\n updateOrderTotal();\n}", "title": "" }, { "docid": "073beab99d9705f2d513d0d2abcca67e", "score": "0.53374594", "text": "function calculateTaxes(income) {\n if (income < 10000) {\n return (income * .05);\n } else if (income >10000 <20000) {\n return (income * .10);\n } else if (income > 20000) {\n return (income * 15);\n } \n}", "title": "" }, { "docid": "cab95532ceb31764b35140e6a71b0807", "score": "0.53297246", "text": "function addingTotalPrices(){\n\n\tvar priceItem = $(\".newPartPrice\");\n\tvar arrayAdditionPrice = []; \n\n\tfor(var i = 0; i < priceItem.length; i++){\n\n\t\t arrayAdditionPrice.push(Number($(priceItem[i]).val()));\n\t\t \n }\n \n // console.log(\"arrayAdditionPrice\", arrayAdditionPrice)\n\n\tfunction additionArrayPrices(totalSale, numberArray){\n\n\t\treturn totalSale + numberArray;\n\n\t}\n\n var addingTotalPrice = arrayAdditionPrice.reduce(additionArrayPrices);\n \n $(\"#newPartsTotalSell\").val(addingTotalPrice);\n $(\"#saleTotal\").val(addingTotalPrice);\n\t $(\"#newPartsTotalSell\").attr(\"totalSale\",addingTotalPrice);\n\n}", "title": "" }, { "docid": "e3979e4c523835ebeb0714230d64a318", "score": "0.53294134", "text": "function decimalAdd() {\n\tpoint.addEventListener(\"click\", function() {\n\t\tif (tempArray.includes(\".\") == false) {\n\t\t\ttempArray.push(point.value);\n\t\t\tdisplay.textContent = tempArray.join('');\n\t\t}\n\t})\n}", "title": "" }, { "docid": "d3d824db0433b8713653ba83bc1627d9", "score": "0.53216636", "text": "function currencyExhange(arr, a){\n\n}", "title": "" }, { "docid": "0d1fd97378328b085535f67e685d932d", "score": "0.53186756", "text": "function addItemToList(subtotal, dollarTip) {\n console.log(`Adding a $${subtotal} meal with a $${dollarTip} tip to shopping list`);\n STORE.subtotalAmount.push(subtotal);\n STORE.tipAmount.push(dollarTip);\n console.log(STORE);\n}", "title": "" }, { "docid": "aff81c97e5938280af6154c9381d1fba", "score": "0.5318213", "text": "function tip(billValue, tipFraction) {\n return billValue * tipFraction;\n}", "title": "" }, { "docid": "c2db6f0fc17225f0c7a855e2d649308d", "score": "0.5317012", "text": "function calculateTotal() {\n var subtotal = 0;\n var discount = 0;\n var tax = \"\";\n var taxList = new Object();\n var taxTotal = 0;\n var discountAmount = 0;\n var discountType = $(\"#discount_type\").val();\n var discountValue = $(\".discount_value\").val();\n var calculateTax = $(\"#calculate_tax\").val();\n\n $(\".quantity\").each(function (index, element) {\n var discountedAmount = 0;\n var amount = parseFloat(\n $(this).closest(\".item-row\").find(\".amount\").val()\n );\n\n if (isNaN(amount)) {\n amount = 0;\n }\n\n subtotal = (parseFloat(subtotal) + parseFloat(amount)).toFixed(2);\n });\n\n if (discountType == \"percent\" && discountValue != \"\") {\n discountAmount =\n (parseFloat(subtotal) / 100) * parseFloat(discountValue);\n discountedAmount = parseFloat(subtotal - discountAmount);\n } else {\n discountAmount = parseFloat(discountValue);\n discountedAmount = parseFloat(subtotal - parseFloat(discountValue));\n }\n\n $(\".quantity\").each(function (index, element) {\n var itemTax = [];\n var itemTaxName = [];\n subtotal = parseFloat(subtotal);\n\n $(this)\n .closest(\".item-row\")\n .find(\"select.type option:selected\")\n .each(function (index) {\n itemTax[index] = $(this).data(\"rate\");\n itemTaxName[index] = $(this).text();\n });\n var itemTaxId = $(this).closest(\".item-row\").find(\"select.type\").val();\n\n var amount = parseFloat(\n $(this).closest(\".item-row\").find(\".amount\").val()\n );\n\n if (isNaN(amount)) {\n amount = 0;\n }\n\n if (itemTaxId != \"\") {\n for (var i = 0; i <= itemTaxName.length; i++) {\n if (typeof taxList[itemTaxName[i]] === \"undefined\") {\n if (\n calculateTax == \"after_discount\" &&\n discountAmount > 0\n ) {\n var taxValue =\n (amount - (amount / subtotal) * discountAmount) *\n (parseFloat(itemTax[i]) / 100);\n\n if (!isNaN(taxValue)) {\n taxList[itemTaxName[i]] = parseFloat(taxValue);\n }\n } else {\n var taxValue = amount * (parseFloat(itemTax[i]) / 100);\n\n if (!isNaN(taxValue)) {\n taxList[itemTaxName[i]] = parseFloat(taxValue);\n }\n }\n } else {\n if (\n calculateTax == \"after_discount\" &&\n discountAmount > 0\n ) {\n var taxValue =\n parseFloat(taxList[itemTaxName[i]]) +\n (amount - (amount / subtotal) * discountAmount) *\n (parseFloat(itemTax[i]) / 100);\n\n if (!isNaN(taxValue)) {\n taxList[itemTaxName[i]] = parseFloat(taxValue);\n }\n } else {\n var taxValue =\n parseFloat(taxList[itemTaxName[i]]) +\n amount * (parseFloat(itemTax[i]) / 100);\n\n if (!isNaN(taxValue)) {\n taxList[itemTaxName[i]] = parseFloat(taxValue);\n }\n }\n }\n }\n }\n });\n\n $.each(taxList, function (key, value) {\n if (!isNaN(value)) {\n tax =\n tax +\n '<tr><td class=\"text-dark-grey\">' +\n key +\n '</td><td><span class=\"tax-percent\">' +\n decimalupto2(value).toFixed(2) +\n \"</span></td></tr>\";\n taxTotal = taxTotal + decimalupto2(value);\n }\n });\n\n if (isNaN(subtotal)) {\n subtotal = 0;\n }\n\n $(\".sub-total\").html(decimalupto2(subtotal).toFixed(2));\n $(\".sub-total-field\").val(decimalupto2(subtotal));\n\n if (discountValue != \"\") {\n if (discountType == \"percent\") {\n discount = (parseFloat(subtotal) / 100) * parseFloat(discountValue);\n } else {\n discount = parseFloat(discountValue);\n }\n }\n\n if (tax != \"\") {\n $(\"#invoice-taxes\").html(tax);\n } else {\n $(\"#invoice-taxes\").html(\n '<tr><td colspan=\"2\"><span class=\"tax-percent\">0.00</span></td></tr>'\n );\n }\n\n $(\"#discount_amount\").html(decimalupto2(discount).toFixed(2));\n\n var totalAfterDiscount = decimalupto2(subtotal - discount);\n\n totalAfterDiscount = totalAfterDiscount < 0 ? 0 : totalAfterDiscount;\n\n var total = decimalupto2(totalAfterDiscount + taxTotal);\n\n $(\".total\").html(total.toFixed(2));\n $(\".total-field\").val(total.toFixed(2));\n}", "title": "" } ]
c0d1e5f54a8f9b1afc4e13181c7391a6
A replacer that deals with non hex backslashes.
[ { "docid": "9946c5a3d8fd28aba490247ec53bd228", "score": "0.6660146", "text": "function normEscs(x) {\n var out = '';\n // x could be '\\\\' in which case we return '' or it could be '\\\\\\r\\n' in\n // which case we escape both.\n // In the normal case where the length is 2 we end up turning any special\n // characters like \\\\, \\\", and \\' into CSS escape sequences.\n for (var i = 1, n = x.length; i < n; ++i) {\n out += '\\\\' + x.charCodeAt(i).toString(16) + ' ';\n }\n return out;\n }", "title": "" } ]
[ { "docid": "0aff7bd141b5576c8c485a267c634576", "score": "0.6630999", "text": "function replaceBackslashes(str) {\n const slash = require(\"slash\");\n return slash(str);\n}", "title": "" }, { "docid": "9ad5b1d1344088dee1840be600c7907a", "score": "0.6573348", "text": "function escapeForRegexp(s){return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g,\"\\\\$1\").replace(/\\x08/g,\"\\\\x08\")}", "title": "" }, { "docid": "c71853d7d30017e3e25f5af7b2b72b72", "score": "0.64741623", "text": "function escapeForRegexp(s){return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g,'\\\\$1').replace(/\\x08/g,'\\\\x08');}", "title": "" }, { "docid": "99bc2c179bb31582dde1a1559b227f9e", "score": "0.64271", "text": "function forwardToTwoBackslashes(str){\n\treturn str.replace(/\\//g, \"\\\\\\\\\");\n}", "title": "" }, { "docid": "8277724f48dddd7db482f5cb244fd19c", "score": "0.6243308", "text": "_replaceEscapedChars(s) {\n return s\n .replaceAll(/\\\\x([0-9a-f]+);/ig, (_, n) => String.fromCharCode(parseInt(n, 16)))\n .replaceAll(/\\\\(.)/g, (_, c) => ESCAPE_SEQUENCES[c] || c);\n }", "title": "" }, { "docid": "ecd8eb32864374b0a18d62d7554dae31", "score": "0.62211525", "text": "function escapeBackslash(str) {\n\n\t\t\t\tif (str) {\n\t var arr = str.split(\"\\\\\");\n\t var newstr = arr.join(\"\\\\\\\\\");\n\n\t return newstr;\n\t\t\t\t} else return \"\";\n\n}", "title": "" }, { "docid": "bea990640dfbf20ea44b2fa7716d4bce", "score": "0.6207044", "text": "function replaceEscapes(s) {\n\t\t\t\t\treturn s.replace(/\\\\n/g, \"\\n\")\n\t\t\t\t\t\t.replace(/\\\\r/g, \"\\r\")\n\t\t\t\t\t\t.replace(/\\\\t/g, \"\\t\")\n\t\t\t\t\t\t.replace(/\\\\/g, \"\");\n\t\t\t\t}", "title": "" }, { "docid": "f7ac717bfca14c33766b619cdad8001b", "score": "0.6205486", "text": "function escapeRegExpCharacter (ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n }\n else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "b16abb69d293a6274d119392ee9a1400", "score": "0.6195684", "text": "function escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').replace(/\\x08/g, '\\\\x08');\n }", "title": "" }, { "docid": "18383e0b0611555fe2254adc5cdc3911", "score": "0.6152052", "text": "function fcn_addslashes(str) {\n\tif (str === null || str === undefined) {\n\t\treturn '';\n\t}\n\tstr = str.replace(/\\\\/g, '\\\\\\\\').replace(/\\u0008/g, '\\\\b').replace(/\\t/g, '\\\\t').replace(/\\n/g, '\\\\n').replace(/\\f/g, '\\\\f').replace(/\\r/g, '\\\\r').replace(/'/g, '\\\\\\'').replace(/\"/g, '\\\\\"');\n\treturn str.valueOf();\n}", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "e7a20e79a8a59a6d2e82f46257287d92", "score": "0.6144152", "text": "function escapeRegExpCharacter(ch, previousIsBackslash) {\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n if ((ch & ~1) === 0x2028) {\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\n } else if (ch === 10 || ch === 13) { // \\n, \\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\n }\n return String.fromCharCode(ch);\n }", "title": "" }, { "docid": "ac71eae1fe06378a58fc17de6a95d274", "score": "0.61293423", "text": "function unescape(value) {\n var prev = 0\n var index = value.indexOf(backslash)\n var escape = ctx[key]\n var queue = []\n var character\n\n while (index !== -1) {\n queue.push(value.slice(prev, index))\n prev = index + 1\n character = value.charAt(prev)\n\n // If the following character is not a valid escape, add the slash.\n if (!character || escape.indexOf(character) === -1) {\n queue.push(backslash)\n }\n\n index = value.indexOf(backslash, prev + 1)\n }\n\n queue.push(value.slice(prev))\n\n return queue.join('')\n }", "title": "" }, { "docid": "8874ddef2b1deb91db7531a606a9d9be", "score": "0.6116716", "text": "function regexEscape(string){\n\treturn String(string).replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').replace(/\\x08/g, '\\\\x08');\n}", "title": "" }, { "docid": "5d9c1b0be3c4b2823ee2fdac308959e4", "score": "0.6092017", "text": "function addSlashes(str) {\n return (str + '').replace(/[\\\\\"']/g, '\\\\$&').replace(/\\u0000/g, '\\\\0');\n}", "title": "" }, { "docid": "69594039eb579fec16531faadb5fb5fb", "score": "0.6074237", "text": "_parseEscaped(marker) {\n let value;\n if (value = this._accept(5 /* Backslash */, true)) {\n // saw a backslash, append escaped token or that backslash\n value = this._accept(0 /* Dollar */, true)\n || this._accept(4 /* CurlyClose */, true)\n || this._accept(5 /* Backslash */, true)\n || value;\n marker.appendChild(new Text(value));\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "9e3904ece08ad1c4e75f851966c703b0", "score": "0.60716975", "text": "function fxrUnescape(aString) {\r\n return aString.replace(/\\\\./g, function(str) {\r\n if (str == \"\\\\\\\\\") return \"\\\\\";\r\n if (str == \"\\\\n\") return \"\\n\";\r\n if (str == \"\\\\r\") return \"\\r\";\r\n if (str == \"\\\\t\") return \"\\t\";\r\n return str;\r\n });\r\n}", "title": "" }, { "docid": "32c46d536706e50149907a883b5eefc5", "score": "0.60686827", "text": "function escapeRegExpCharacter (ch, previousIsBackslash) {\r\n // not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\r\n if ((ch & ~1) === 0x2028) {\r\n return (previousIsBackslash ? 'u' : '\\\\u') + ((ch === 0x2028) ? '2028' : '2029');\r\n }\r\n else if (ch === 10 || ch === 13) { // \\n, \\r\r\n return (previousIsBackslash ? '' : '\\\\') + ((ch === 10) ? 'n' : 'r');\r\n }\r\n return String.fromCharCode(ch);\r\n}", "title": "" }, { "docid": "77a78a1b27466a984bf5e84dd52d8a85", "score": "0.6050536", "text": "function substituteEscapes(str){\n return str.replace(/(^|\\b|[^\\\\])\\\\'/g, \"$1'\")\n .replace(/(^|\\b|[^\\\\])\\\\\"/g, '$1\"')\n .replace(/(^|\\b|[^\\\\])\\\\b/g, \"$1\\b\")\n .replace(/(^|\\b|[^\\\\])\\\\f/g, \"$1\\f\")\n .replace(/(^|\\b|[^\\\\])\\\\n/g, \"$1\\n\")\n .replace(/(^|\\b|[^\\\\])\\\\r/g, \"$1\\r\")\n .replace(/(^|\\b|[^\\\\])\\\\t/g, \"$1\\t\")\n .replace(/(^|\\b|[^\\\\])\\\\v/g, \"$1\\v\")\n .replace(/\\\\\\\\/g, \"\\\\\");\n}", "title": "" }, { "docid": "e8b1c50559e3e1045805244a632c1873", "score": "0.6037025", "text": "function escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n}", "title": "" }, { "docid": "e8b1c50559e3e1045805244a632c1873", "score": "0.6037025", "text": "function escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n}", "title": "" }, { "docid": "e8b1c50559e3e1045805244a632c1873", "score": "0.6037025", "text": "function escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n}", "title": "" }, { "docid": "e8b1c50559e3e1045805244a632c1873", "score": "0.6037025", "text": "function escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n}", "title": "" }, { "docid": "e8b1c50559e3e1045805244a632c1873", "score": "0.6037025", "text": "function escapeForRegexp(s) {\n return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1').\n replace(/\\x08/g, '\\\\x08');\n}", "title": "" }, { "docid": "33fe601f74c007752f13743eb39529f5", "score": "0.59796023", "text": "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "title": "" }, { "docid": "33fe601f74c007752f13743eb39529f5", "score": "0.59796023", "text": "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "title": "" }, { "docid": "33fe601f74c007752f13743eb39529f5", "score": "0.59796023", "text": "function esc(v) { return \"\\\"\" + v.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\") + \"\\\"\"; }", "title": "" }, { "docid": "68b493bcd253cc7b2317c101ddd3e83e", "score": "0.5968756", "text": "static escapeTrailingBackslash(text)\n {\n if ('\\\\' === substr(text, -1))\n {\n let len = strlen(text);\n text = rtrim(text, '\\\\\\\\');\n text = text.replace(\"\\0\", '');\n text += \"\\0\".repeat(len - strlen(text));\n }\n\n return text;\n }", "title": "" }, { "docid": "cfc531f70ff20068ace6ab1689612415", "score": "0.59642357", "text": "function escape(value) {\n return value\n .split('')\n .map(function (character) {\n return '\\\\u' + character.charCodeAt(0).toString(16)\n })\n .join('')\n }", "title": "" }, { "docid": "f9cbdc536cccd4e7e95005728a818850", "score": "0.5951945", "text": "function e_sh(string) {\n\treturn string.replace(/(?=[^a-zA-Z0-9_.\\/\\-\\x7F-\\xFF\\n])/g, '\\\\').replace(/\\n/g, \"'\\n'\").replace(/^$/g, \"''\");\n}", "title": "" }, { "docid": "e503c69a8484aec3a00c56bee0bf482d", "score": "0.59470075", "text": "function escapeJsonPath$$1(str) {\n return str.replace(/~/g, \"~1\").replace(/\\//g, \"~0\");\n}", "title": "" }, { "docid": "099a4fa8973a7f601c9d7683a00551d8", "score": "0.5946518", "text": "function addSlashes(str) { \n // don't need apostrophe's because we use quotes for strings and JS handles apostrophe's correctly\n //str = str.replace(/'/g, \"\\\\'\");\n str = str.replace(/\\\\/g, \"\\\\\\\\\");\n str = str.replace(/\\\"/g, \"\\\\\\\"\");\n return str;\n}", "title": "" }, { "docid": "37dc7fc0f899f12f26d5a4cf4abb9bb0", "score": "0.58866036", "text": "function funescape(_, escaped, escapedWhitespace) {\n var high = \"0x\" + escaped - 0x10000; // NaN means non-codepoint\n // Support: Firefox\n // Workaround erroneous numeric interpretation of +\"0x\"\n\n return high !== high || escapedWhitespace ? escaped : // BMP codepoint\n high < 0 ? String.fromCharCode(high + 0x10000) : // Supplemental Plane codepoint (surrogate pair)\n String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);\n }", "title": "" }, { "docid": "a8124e484952131a74f09c9cc2cdff11", "score": "0.58853066", "text": "function escape(token) {\n return token.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}", "title": "" }, { "docid": "a8124e484952131a74f09c9cc2cdff11", "score": "0.58853066", "text": "function escape(token) {\n return token.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}", "title": "" }, { "docid": "bfe0b83423bfa7b0df5517a11831fd7a", "score": "0.587553", "text": "function fixPatternPathSeparators(pattern) {\n if (backslashPathSepAllowed()) {\n // if here \"\\\" means dir separator not escaped char\n return pattern.replace(/\\\\/g, \"/\");\n }\n // here \"\\\" means escaped char\n return pattern;\n}", "title": "" }, { "docid": "778e4f462c4f2a29ed9bdb3c868380f9", "score": "0.58727187", "text": "function _escape(s) {\n return s.replace(_escapeRegex, function (match) {\n switch (match) {\n case '\"':\n return '\\\\\"';\n\n case '\\\\':\n return '\\\\\\\\';\n\n case '\\n':\n return '\\\\n';\n\n case '\\r':\n return '\\\\r';\n }\n });\n}", "title": "" }, { "docid": "07983908574dff90d3a1e2004b36cff3", "score": "0.58514607", "text": "function aue() {\n stash += BACK_SLASH + c;\n escaped = false;\n}", "title": "" }, { "docid": "a45a4189220bac0ed5b67e1140791bda", "score": "0.5844574", "text": "function stripslashes(str) {\n\t\tstr=str.replace(/\\\\'/g,'\\'');\n\t\tstr=str.replace(/\\\\\"/g,'\"');\n\t\tstr=str.replace(/\\\\0/g,'\\0');\n\t\tstr=str.replace(/\\\\\\\\/g,'\\\\');\n\t\tstr=str.substring(1,str.length-1);\n\t\treturn str;\n\t}", "title": "" }, { "docid": "c6e3902190fd3d0f55604c7db3bd0f6b", "score": "0.58372986", "text": "function escapeValue(value) {\n return value.replace(/(\\r|\\n)/g, '\\\\$1');\n}", "title": "" }, { "docid": "58c6eff15d22b47f9af6de9213ca78f6", "score": "0.5824132", "text": "function reEsc (str) {\n return str.replace(/[\\^\\x5b\\x5d\\-\\\\]/g, '\\\\$&')\n .replace(/[*+(){}|$/.]/g, '[$&]')\n}", "title": "" }, { "docid": "4b6f03f8f45ead723847afe61a41b9a0", "score": "0.58135694", "text": "function regEscape(s) {\n\t return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1');\n\t}", "title": "" }, { "docid": "4b6f03f8f45ead723847afe61a41b9a0", "score": "0.58135694", "text": "function regEscape(s) {\n\t return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1');\n\t}", "title": "" }, { "docid": "4b6f03f8f45ead723847afe61a41b9a0", "score": "0.58135694", "text": "function regEscape(s) {\n\t return s.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1');\n\t}", "title": "" }, { "docid": "97354005a47084c43d920f178a1e26fd", "score": "0.58134085", "text": "function fix_slashes(pathname) {\n if (pathname.slice(-1) != '/') {\n return pathname + '/';\n }\n return pathname;\n}", "title": "" }, { "docid": "adbb8bc63cf6b3ebc33fb355d8c05996", "score": "0.5812006", "text": "function properSlashes(p) {\n var reg = /[cCdDeEfF]:/g;\n if (reg.test(p)) {\n p = p.replace(/\\//g,'\\\\');\n }\n return p;\n}", "title": "" }, { "docid": "56568306d97b16ea3be452b8c91ea105", "score": "0.5807761", "text": "function _escape(s) {\n return s.replace(_escapeRegex, function(match) {\n switch(match) {\n case '\"': return '\\\\\"';\n case '\\\\': return '\\\\\\\\';\n case '\\n': return '\\\\n';\n case '\\r': return '\\\\r';\n }\n });\n}", "title": "" }, { "docid": "56568306d97b16ea3be452b8c91ea105", "score": "0.5807761", "text": "function _escape(s) {\n return s.replace(_escapeRegex, function(match) {\n switch(match) {\n case '\"': return '\\\\\"';\n case '\\\\': return '\\\\\\\\';\n case '\\n': return '\\\\n';\n case '\\r': return '\\\\r';\n }\n });\n}", "title": "" }, { "docid": "24c9d6d7c6fe60e961eee129a552217b", "score": "0.5800262", "text": "function fix_slashes(pathname) {\r\n if (pathname.slice(-1) != '/') {\r\n return pathname + '/';\r\n }\r\n return pathname;\r\n}", "title": "" }, { "docid": "6fff6a9b0fce7bb6c875990d04e5d7b9", "score": "0.5790574", "text": "function escapeCsharpArgument(arg) {\n\tvar backslashes = 0\n\tvar out = ''\n\targ.split('').forEach(c => {\n\t\tif (c == '\\\\') {\n\t\t\t// Don't know if we need to double yet.\n\t\t\tbackslashes++\n\t\t} else if (c == '\"') {\n\t\t\t// Double backslashes.\n\t\t\tout += '\\\\'.repeat(backslashes * 2)\n\t\t\tbackslashes = 0\n\t\t\tout += \"\\\\\\\"\"\n\t\t} else {\n\t\t\t// Normal char\n\t\t\tif (backslashes > 0) {\n\t\t\t\tout += '\\\\'.repeat(backslashes)\n\t\t\t\tbackslashes = 0\n\t\t\t}\n\t\t\tout += c\n\t\t}\n\t})\n\t// Add remaining backslashes, if any.\n\tif (backslashes > 0)\n\t\tout += '\\\\'.repeat(backslashes)\n\tout += '\\\\'.repeat(backslashes)\n\treturn out\n}", "title": "" }, { "docid": "7e56cd6bbd47a973d83684c6bb468298", "score": "0.5788425", "text": "function overwriteEscapes()\n{\n\tif (_text.indexOf('\\\\|') > -1)\n\t{\n\t\t_text = _text.replace(/\\\\[\\\\|]/g, '..');\n\t}\n}", "title": "" }, { "docid": "14ae927ee897d6dbe17b126343d6dc47", "score": "0.5747766", "text": "function unicodeEscape(ch) { return '\\\\u' + ('0000' + ch.charCodeAt(0).toString(16)).slice(-4); }", "title": "" }, { "docid": "1afaa03fd16c36405ac28b32932270b6", "score": "0.57459193", "text": "function doubleBackslash(path){\n\treturn path.replace(/\\//, \"\").replace(/(.)/, \"$1:\").replace(/\\//g, \"\\\\\\\\\");\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "d6538c0ef4e6c411719ac8c1f2ce3169", "score": "0.57307553", "text": "function escape(data) {\n return data.replace(reEscapeChars, singleCharReplacer);\n}", "title": "" }, { "docid": "efcf07f15348b4256237cee1c2d607d1", "score": "0.5722599", "text": "function _fnEscapeRegex ( sVal )\n\t\t{\n\t\t\tvar acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\\\', '$', '^' ];\n\t\t var reReplace = new RegExp( '(\\\\' + acEscape.join('|\\\\') + ')', 'g' );\n\t\t return sVal.replace(reReplace, '\\\\$1');\n\t\t}", "title": "" }, { "docid": "efcf07f15348b4256237cee1c2d607d1", "score": "0.5722599", "text": "function _fnEscapeRegex ( sVal )\n\t\t{\n\t\t\tvar acEscape = [ '/', '.', '*', '+', '?', '|', '(', ')', '[', ']', '{', '}', '\\\\', '$', '^' ];\n\t\t var reReplace = new RegExp( '(\\\\' + acEscape.join('|\\\\') + ')', 'g' );\n\t\t return sVal.replace(reReplace, '\\\\$1');\n\t\t}", "title": "" }, { "docid": "b4b1f11ffc3a91d34be637ed3b398cb2", "score": "0.5702092", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n /* If the following character is not a valid escape,\n * add the slash. */\n\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n return queue.join('');\n }", "title": "" }, { "docid": "6548ff7735b407223defb962a749f784", "score": "0.5699865", "text": "function InsertEscapeSequence(str, ch) {\n str = str.replace(new RegExp(ch, 'g'), \"\\\\\" + ch);\n return str;\n}", "title": "" }, { "docid": "441f7a97480003abd43bbc84c4273a8f", "score": "0.56988853", "text": "function funescape(_, escaped, escapedWhitespace) {\n const high = parseInt(escaped, 16) - 0x10000;\n // NaN means non-codepoint\n return high !== high || escapedWhitespace\n ? escaped\n : high < 0\n ? // BMP codepoint\n String.fromCharCode(high + 0x10000)\n : // Supplemental Plane codepoint (surrogate pair)\n String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);\n}", "title": "" }, { "docid": "ffd2a11f7f99204af235aa707149a32a", "score": "0.5697562", "text": "checkEscapeChar(){\n\t\tif(!this.buffer.length) return;\n\t\tif(this.buffer[this.buffer.length - 1] === \"\\\\\"){\n\t\t\tthis.escaped = !this.escaped;\n\t\t}else{\n\t\t\tthis.escaped = false;\n\t\t}\n\t}", "title": "" }, { "docid": "54f3d2f4f661a4ba65e92101d19a5030", "score": "0.5687843", "text": "_escape (iri) {\n // More of a sanity check, really\n if (!iri || !/^\\w+:[^<> ]+$/.test(iri))\n throw new Error(`Invalid IRI: ${iri}`);\n return iri;\n }", "title": "" }, { "docid": "be6c9d4796861eafe4531d85f51b4f78", "score": "0.5680709", "text": "function addSlashes(encrypt_dec, strEncrypt, s_hash, s_key)\r\n\t{\r\n\t\treturn escapeString(stringToHex(encrypt_dec, strEncrypt, s_hash, s_key));\r\n\t}", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.5677144", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.5677144", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.5677144", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.5677144", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.5677144", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "309e15a59478eb148975205fd85c0916", "score": "0.5677144", "text": "function unescape(value) {\n var prev = 0;\n var index = value.indexOf('\\\\');\n var escape = ctx[key];\n var queue = [];\n var character;\n\n while (index !== -1) {\n queue.push(value.slice(prev, index));\n prev = index + 1;\n character = value.charAt(prev);\n\n /* If the following character is not a valid escape,\n * add the slash. */\n if (!character || escape.indexOf(character) === -1) {\n queue.push('\\\\');\n }\n\n index = value.indexOf('\\\\', prev);\n }\n\n queue.push(value.slice(prev));\n\n return queue.join('');\n }", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "d1c72ade1269fa66e734904d8cc84dbe", "score": "0.567046", "text": "function funescape( _, escaped, escapedWhitespace ) {\n\tvar high = \"0x\" + escaped - 0x10000;\n\t// NaN means non-codepoint\n\t// Support: Firefox\n\t// Workaround erroneous numeric interpretation of +\"0x\"\n\treturn high !== high || escapedWhitespace ?\n\t\tescaped :\n\t\t// BMP codepoint\n\t\thigh < 0 ?\n\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n}", "title": "" }, { "docid": "50aae51e50f14b57b18a17ade79932de", "score": "0.5667835", "text": "function escapedPath(path, testID) {\n\n if (testID !== 'shellScript') {\n return path.replace(/\\\\/g,'\\\\\\\\');\n }\n\n return path;\n}", "title": "" }, { "docid": "1224ea2ba4400b5b6c809d5e405855c4", "score": "0.5667277", "text": "function normalizeSlashes(value) {\n return value.replace(/\\\\/g, '/');\n}", "title": "" }, { "docid": "cd51b46a35588b14cc752143cb7bc713", "score": "0.565567", "text": "function funescape( _, escaped, escapedWhitespace ) {\r\n\tvar high = \"0x\" + escaped - 0x10000;\r\n\t// NaN means non-codepoint\r\n\t// Support: Firefox\r\n\t// Workaround erroneous numeric interpretation of +\"0x\"\r\n\treturn high !== high || escapedWhitespace ?\r\n\t\tescaped :\r\n\t\t// BMP codepoint\r\n\t\thigh < 0 ?\r\n\t\t\tString.fromCharCode( high + 0x10000 ) :\r\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\r\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\r\n}", "title": "" }, { "docid": "cd51b46a35588b14cc752143cb7bc713", "score": "0.565567", "text": "function funescape( _, escaped, escapedWhitespace ) {\r\n\tvar high = \"0x\" + escaped - 0x10000;\r\n\t// NaN means non-codepoint\r\n\t// Support: Firefox\r\n\t// Workaround erroneous numeric interpretation of +\"0x\"\r\n\treturn high !== high || escapedWhitespace ?\r\n\t\tescaped :\r\n\t\t// BMP codepoint\r\n\t\thigh < 0 ?\r\n\t\t\tString.fromCharCode( high + 0x10000 ) :\r\n\t\t\t// Supplemental Plane codepoint (surrogate pair)\r\n\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\r\n}", "title": "" }, { "docid": "f9f33cc0b3076862fd4868bc57e74938", "score": "0.56481713", "text": "tryParseEscape() {\n const begin = this.pos;\n\n const unicode = this.tryParseUnicodeEscape();\n if (unicode !== '') {\n const value = unicode.codePointAt(0);\n if (value === undefined) {\n throw new Error('BUG: invalid character');\n }\n return {\n type: 'Char',\n value,\n raw: this.source.slice(begin, this.pos),\n range: [begin, this.pos],\n };\n }\n\n this.pos++; // skip '\\\\'\n switch (this.current()) {\n case 't':\n this.pos++; // skip 't'\n return { type: 'Char', value: 0x09, raw: '\\\\t', range: [begin, this.pos] };\n case 'n':\n this.pos++; // skip 'n'\n return { type: 'Char', value: 0x0a, raw: '\\\\n', range: [begin, this.pos] };\n case 'v':\n this.pos++; // skip 'v'\n return { type: 'Char', value: 0x0b, raw: '\\\\v', range: [begin, this.pos] };\n case 'f':\n this.pos++; // skip 'f'\n return { type: 'Char', value: 0x0c, raw: '\\\\f', range: [begin, this.pos] };\n case 'r':\n this.pos++; // skip 'r'\n return { type: 'Char', value: 0x0d, raw: '\\\\r', range: [begin, this.pos] };\n case 'c': {\n this.pos++; // skip 'c'\n const c = this.current();\n let value = 0;\n if (isControl(c)) {\n this.pos++; // skip a-z or A-Z\n value = c.charCodeAt(0) % 32;\n } else {\n if (this.additional && !this.unicode) {\n this.pos--; // go back 'c'\n break;\n }\n throw new RegExpSyntaxError('invalid control escape');\n }\n return {\n type: 'Char',\n value,\n raw: this.source.slice(begin, this.pos),\n range: [begin, this.pos],\n };\n }\n case 'x': {\n this.pos++; // skip 'x'\n const value = this.tryParseHexDigitsN(2);\n if (value < 0) {\n this.pos--; // go back 'x'\n break;\n }\n return {\n type: 'Char',\n value,\n raw: this.source.slice(begin, this.pos),\n range: [begin, this.pos],\n };\n }\n case '0': {\n this.pos++; // skip '0'\n if (isDigit(this.current())) {\n this.pos--; // go back '0'\n break;\n }\n return { type: 'Char', value: 0, raw: '\\\\0', range: [begin, this.pos] };\n }\n case '':\n throw new RegExpSyntaxError('\\\\ at end of pattern');\n }\n\n // Legacy octal escape.\n if (this.additional && !this.unicode) {\n const octal = this.pos;\n const c0 = this.current();\n if ('0' <= c0 && c0 <= '3') {\n this.pos++;\n const c1 = this.current();\n if ('0' <= c1 && c1 <= '7') {\n this.pos++;\n const c2 = this.current();\n if ('0' <= c2 && c2 <= '7') {\n this.pos++;\n }\n }\n } else if ('4' <= c0 && c0 <= '7') {\n this.pos++;\n const c1 = this.current();\n if ('0' <= c1 && c1 <= '7') {\n this.pos++;\n }\n }\n if (octal !== this.pos) {\n const value = Number.parseInt(this.source.slice(octal, this.pos), 8);\n return {\n type: 'Char',\n value,\n raw: this.source.slice(begin, this.pos),\n range: [begin, this.pos],\n };\n }\n }\n\n // Identity escape.\n const c = this.current();\n const value = c.codePointAt(0);\n if (value === undefined) {\n throw new Error('BUG: invalid character');\n }\n if (this.unicode) {\n if (isSyntax(c) || c === '/') {\n this.pos += c.length; // skip any char\n return { type: 'Char', value, raw: `\\\\${c}`, range: [begin, this.pos] };\n }\n } else {\n if (this.additional) {\n if (c === 'c') {\n return { type: 'Char', value: 0x5c, raw: '\\\\', range: [begin, this.pos] };\n }\n if (this.names.size === 0 || c !== 'k') {\n this.pos += c.length; // skip any char\n return { type: 'Char', value, raw: `\\\\${c}`, range: [begin, this.pos] };\n }\n } else {\n if (!idContinue.has(value)) {\n this.pos += c.length; // skip any char\n return { type: 'Char', value, raw: `\\\\${c}`, range: [begin, this.pos] };\n }\n }\n }\n\n this.pos = begin;\n return null;\n }", "title": "" } ]
8f162415ca042b601c3ed15d0668f61d
db query functions file default logout procedure can be used to help prevent unauthorized access
[ { "docid": "7e016b45e6f8776041272340adc348ba", "score": "0.0", "text": "function logout(req, res) {\n req.session.loggedIn = false;\n req.session.destroy(); // remove session\n res.redirect('/'); // return to login screen\n}", "title": "" } ]
[ { "docid": "da24fda40da012adc1789c2643109617", "score": "0.7447077", "text": "function logout() {\n\n }", "title": "" }, { "docid": "299a5db29df3d5a19d3c94e0b2bd0e48", "score": "0.7034995", "text": "function logoutUser() {\n logout();\n }", "title": "" }, { "docid": "bf1043cf5f1ce93a953b265b7d5539d3", "score": "0.6977548", "text": "function logout() {\n return;\n }", "title": "" }, { "docid": "1c4f423e05b186e363c676bdb6dec2e2", "score": "0.69697833", "text": "logOut() {\n AuthService.logout();\n }", "title": "" }, { "docid": "55909b066abfc0b26de401ece15a4fe9", "score": "0.6908507", "text": "function logout() {\n\n showOrHideMenu();\n\n simpleLogout();\n\n }", "title": "" }, { "docid": "2c60525eb5e5909743b5b538f663ebee", "score": "0.68925786", "text": "function loggedOut(id){ \n return db.one(\"update users set isloggedout = false where id=$1\", [id])\n}", "title": "" }, { "docid": "1267e82e3408aeb0d9546dffc9da6285", "score": "0.681933", "text": "async logout(){\n }", "title": "" }, { "docid": "7f4c83c3c65acbd2e711b08824e1a3a0", "score": "0.68148893", "text": "function logOut() {\n Auth.logOut();\n }", "title": "" }, { "docid": "2def58df6b77144e25094fbd0b4901bf", "score": "0.67568386", "text": "logout() {\n console.log('The user logged out');\n }", "title": "" }, { "docid": "1799b0fe8800dd95114bef41584ef7d1", "score": "0.6728531", "text": "static clearAllLoginSessions() {\n let queryString = 'DELETE FROM activeusers *';\n\n db.query(queryString, null, (err, result) => {\n if (err) {\n console.log(err.message);\n }\n });\n }", "title": "" }, { "docid": "98f6400bbf82a13529be4c453dd4f449", "score": "0.67223734", "text": "function logoff(req, res, next){\n // *Reading the authentication headers:\n let token_header = req.get('Access-Token');\n let key_header = req.get('Access-Key');\n\n // *Removing the authentication credentials:\n pooler.query('delete from ?? where ?? = ? and ?? = ?', ['auth', 'token', token_header, 'key', key_header])\n .then(result => {\n // *Responding with 200 status:\n res.status(200)\n .end();\n })\n .catch(err => {\n // *If some error occured:\n // *Sending internal error response:\n res.status(500)\n .json({err_code: 'ERR_INTERNAL', err_message: 'Something went wrong'})\n .end();\n });\n}", "title": "" }, { "docid": "93c27219e4678ec8e26850e71db67180", "score": "0.66919315", "text": "function logoutAll() {\n return { type: LOG_OUT }\n}", "title": "" }, { "docid": "a669c94ab279acfec555c78ef6b492f6", "score": "0.667137", "text": "static logOut() {\n localStorage.removeItem(\"loggedIn\");\n }", "title": "" }, { "docid": "4891ca3fcfff3f3e095f5b5db4a75021", "score": "0.66644603", "text": "logout() {\n console.log(\"Logged Out\")\n }", "title": "" }, { "docid": "87cbe2052432af5173bc274bb67133bc", "score": "0.66611755", "text": "function deactivate() {\n //logout\n}", "title": "" }, { "docid": "422ebcc5da3af1ae84b4111c1a5a883a", "score": "0.66535276", "text": "function logOut() {\n\tloggedUserId(undefined);\n\tloadPage('login_page.html', setLoginAction);\n\t$('#indexNavWrapper').html('');\n}", "title": "" }, { "docid": "b613cfaa842b505537eaa9670d37d843", "score": "0.6651058", "text": "function logout()\n{\n\tserver.logout();\n}", "title": "" }, { "docid": "2f67a20bbac3a045e8dde2e0ddabcd6e", "score": "0.6650542", "text": "function simpleLogout() {\n\n removeUser();\n\n factory.user = null;\n factory.loggedIn = false;\n\n goToLogin();\n\n }", "title": "" }, { "docid": "f77eab041c5bab4e2d97d7d80f051759", "score": "0.664359", "text": "logoutHelp() {\n fbLogoutUser();\n }", "title": "" }, { "docid": "379faaaee39f17c4f6641fdf8bcfd4d6", "score": "0.6640847", "text": "function autoLogOut(username, password){\n\tvar stringQuery = \"UPDATE Users SET isSignedIn=0 WHERE username='\" + username + \"' AND password='\" + password +\"'\";\n\tconnection.query(stringQuery, function(err, data){\n\t\tif (err){\n\t\t\tconsole.error(err);\n\t\t}\n\t}) \n}", "title": "" }, { "docid": "ce2cfb919ae4528ad0bcb029a54f826c", "score": "0.66365176", "text": "logout() {\n authService.logout();\n }", "title": "" }, { "docid": "85b011a55678a54bf38c33dd9b950df0", "score": "0.66185576", "text": "function logout(){\n LoginService.logout();\n }", "title": "" }, { "docid": "3961782c0c11b9936d5855fee52cda49", "score": "0.65961003", "text": "applyLogout() {\n Store.changeProperties({\n isLogin: false,\n activeScreen: Screens.LOGIN\n });\n this.triggerEvent(\"onAuthChange\",[false]);\n }", "title": "" }, { "docid": "1c69c8b5cf484f17eb5ee3962bcb51c2", "score": "0.6586995", "text": "function logoutHandler() {\n signOut()\n }", "title": "" }, { "docid": "b22f6a2f0ff4bed8b456ec892ca4dbbe", "score": "0.6581302", "text": "async function logOut() {\n\tawait fetch(BASEURL + '/sessions/current', { method: 'DELETE' });\n}", "title": "" }, { "docid": "06d68ff0419b434ab1efc19131281a48", "score": "0.65798146", "text": "function log_off(token) {\n\n}", "title": "" }, { "docid": "b5c1e60134738fe2921bb889b6437f56", "score": "0.6572784", "text": "function logUserOut() {\n\twunderlist.settings.setString('logged_in', 'false');\n\tdeleteUserCredentials();\n}", "title": "" }, { "docid": "073b4e4503f659504a39b59892a68d5c", "score": "0.6569387", "text": "logOut(){\n sessionStorage.removeItem('accountType');\n msalInstance.logout();\n }", "title": "" }, { "docid": "7792b2a2e9759765d9cd331b51f62665", "score": "0.65544945", "text": "function main_logOut() {\r\n\tlogIt('main_logOut','', COL_INFO);\r\n\tfirebase.auth().signOut();\r\n}", "title": "" }, { "docid": "061b64843bf1dcf05e32dca11080aeee", "score": "0.65497327", "text": "onLogout(state) {\n\t\tstate.user = null\n\t\tstate.loadings.logout = false\n\t\tstate.errors.logout = null\n\t}", "title": "" }, { "docid": "5936675400cfba2b771e1cfdf1e9c2ec", "score": "0.6549091", "text": "logoutUsr({commit}){\n logoutUsr(commit);\n }", "title": "" }, { "docid": "d88352df461fbdb6b31f242d7ff653df", "score": "0.65481395", "text": "function logout() {\n //window.localStorage.clear();\n steroids.drawers.hideAll();\n showLogin();\n alert(\"You have logged out.\");\n}", "title": "" }, { "docid": "b30621d9efe4347a9b2f669307917a86", "score": "0.6538325", "text": "function doLogout ()\n{\n rememberedUser = false;\n $.cookie('didLogout', 'true');\n\t\n $.get(PM_URI + '/pm/cls', function () {\n getMenu();\n m_user = null;\n m_qStore = null;\n _resetMap();\n _resetState();\n _showPane(m_defaultViewSelector);\n }).error(function() { alert(\"ajax error logging out\"); });\n}", "title": "" }, { "docid": "633b401fe990956989b52c138323158a", "score": "0.65152216", "text": "function onLogout(){\n setCurrentUser(false)\n }", "title": "" }, { "docid": "3b1294536cf5d3e85f73a777a801aec7", "score": "0.651053", "text": "async doLogout() {\n // API calls to the dbserver\n\t\ttry {\n\t\t\tlet res = await fetch(API_URL + '/logout', {\n\t\t\t\tmethod: 'post',\n\t\t\t\theaders: {\n\t\t\t\t\t'Accept': 'application/json',\n\t\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n credentials: 'include'\n\t\t\t});\n\t\t\tlet result = await res.json();\n\t\t\tif (result && result.success) {\n this.setState({isLoggedIn: false});\n\t\t\t\tUserStore.isLoggedIn = false;\n\t\t\t\tUserStore.email = '';\n UserStore.firstName = '';\n UserStore.lastName = '';\n UserStore.flatName = '';\n UserStore.flatCode = '';\n\t\t\t}\n\t\t} catch(e) {\n\t\t\tconsole.log(e)\n\t\t}\n\t}", "title": "" }, { "docid": "8322c6fefb8c89ca3851a73026d0fbb3", "score": "0.64964205", "text": "[LOGOUT](state) {\n //clear state\n state.token = {}\n state.login = false\n state.logout = true\n //clear token\n clearToken()\n }", "title": "" }, { "docid": "da9c7b6026b33b6e1ee2643d2d3aed4d", "score": "0.6481172", "text": "function log_out(req, res)\n{\n\tvar query = req.body;\n\tvar response = new Object();\n\t\n\tif(query && query.mail)\n\t{\n\t database.view(\"view\",\"getOnlineUsers\",function(error,data){\n\t\t if(!error)\n\t\t\t {\n\t\t\t if(logout_userExists(query.mail, data.rows))\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t response.status = \"0\";\n\t\t\t\t\tresponse.message = \"Successfully logged out.\";\n\t\t\t\t\tres.send(JSON.stringify(response));\n\t\t\t\t\t\n\t\t\t\t\tupdateStatus(targetDoc,\"offline\");\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\tresponse.status = \"1\";\n\t\t\t\t\tresponse.message = \"The user doesn't exists in database or already offline.\";\n\t\t\t\t\tres.send(JSON.stringify(response));\n\t\t\t\t }\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tresponse.status = \"1\";\n\t\t\t\tresponse.message = \"An error occured while connecting to database.\";\n\t\t\t\tres.send(JSON.stringify(response));\n\t\t\t }\n\t\t });\n\t}\n\telse\n\t{\t\n\t\tresponse.status = \"1\";\n\t\tresponse.message = \"Log out failed. Data is missing.\";\n\t\tres.send(JSON.stringify(response));\n\t}\n}", "title": "" }, { "docid": "96bc38c4b6028c023a07e1bd29d3f3ba", "score": "0.64619863", "text": "logout () {\n this.adalContext.logOut()\n }", "title": "" }, { "docid": "e8a493ca30a833aecc22f1e0972383da", "score": "0.64590967", "text": "function logout(){\n\tTi.App.Properties.removeProperty('auth.std.data');\n}", "title": "" }, { "docid": "7af08bbb4da1b210a9ce4d2200f1a82d", "score": "0.64545393", "text": "async function funclogout() {\n setcheck(\"\");\n\n try {\n await logout();\n // history.push(\"/login\");\n } catch {\n setcheck(\"Failed to log out\");\n }\n }", "title": "" }, { "docid": "b3eafeeb129a49928e06e4b110e4cc4c", "score": "0.6454422", "text": "function logout() {\n hideNavbarContextMenu();\n\n $http.get(apis.logout());\n if (store()) {\n localStorage.loggedIn = false;\n }\n\n $scope.aVars.user.loggedIn = false;\n }", "title": "" }, { "docid": "ab401232aa79654e054299ea3f6ab037", "score": "0.64531416", "text": "async handleLogout() {\n return localStorage.removeItem('drupal-oauth-token');\n }", "title": "" }, { "docid": "6d5f18e4b7bfdbf8baf7cbc26885cc85", "score": "0.6451463", "text": "function logout() {\n AuthenticationService.Logout();\n }", "title": "" }, { "docid": "73de6d74824616a9487c7bd7ba0bd9ef", "score": "0.6448458", "text": "function logOut(req, res){\n debugger\n req.session.destroy((err)=>{\n if (err){\n console.log(err)\n }\n })\n}", "title": "" }, { "docid": "8b1bf65b958a30af27626ff4b3e87b3a", "score": "0.6446941", "text": "function logout() {\n PDK.logout();\n }", "title": "" }, { "docid": "f735a4b986405a3b79e782f4c19105e5", "score": "0.644664", "text": "function Logout() {\n\tAPICall(\"logout\", {}, \"get\", function (d){\n\t\tlocalStorage.username = \"\";\n\t\tlocalStorage.passkey = \"\";\n\t\tlocalStorage.splash = \"\";\n\t\tlocalStorage.loggedIn = false;\n\t\tChangePage(\"welcome\", \"Neon\", function(np){\n\t\t\tSetMenuHighlight(\"home\");\n\t\t});\n\t}, fail);\n}", "title": "" }, { "docid": "4e81e15dd8df6aba2c3ed7b66fec837d", "score": "0.6438309", "text": "function logOut(req, res) {\r\r req.session.userLoggedIn = null;\r\r res.redirect(\"/\");\r\r}", "title": "" }, { "docid": "1a30aed08a33e042cc3c0f2a1c57b183", "score": "0.64260304", "text": "logOut({ commit }) {\n commit('SET_CURRENT_USER', null)\n }", "title": "" }, { "docid": "227e2398892a7b17e57985a4191c0320", "score": "0.6416744", "text": "function logOut(){\n checkConnection();\n window.localStorage.removeItem(\"session_city\"); \n window.localStorage.removeItem(\"session_custid\"); \n window.localStorage.removeItem(\"session_custname\"); \n window.localStorage.removeItem(\"session_mobilenum\");\n window.localStorage.removeItem(\"OTPVerified\");\n app.router.navigate('/');\n}", "title": "" }, { "docid": "38f877c66cd8b67175fc8c236695e51e", "score": "0.6404397", "text": "function logout() {\n setLogin(false);\n setuserName(\"\");\n }", "title": "" }, { "docid": "dde7210a332ac56df0d996c9d5da59eb", "score": "0.64036083", "text": "logOut() {\n this.props.dispatch(logout());\n this.props.dispatch(logoutSession(this.props.user));\n }", "title": "" }, { "docid": "6990d0ac96660712534ba195e634d3a2", "score": "0.6396436", "text": "function logout() {\n user = undefined;\n return user;\n }", "title": "" }, { "docid": "3b67b4638e43041f9fbe88074bbd0fcb", "score": "0.6394549", "text": "handleLogout() {\n this.props.logout(\"off\");\n this.props.setChoosenValue();\n this.props.logoutOnAdmin();\n this.props.logoutForSideNav();\n this.props.logoutForUpperMenu();\n }", "title": "" }, { "docid": "e63c7041fb6bc3f2b5dbf0d6ec21ab56", "score": "0.6392975", "text": "function logout() {\n userService.logout();\n return { type: userConstants.LOGOUT };\n}", "title": "" }, { "docid": "40cf2e044bf3173705c3674363b62534", "score": "0.6387103", "text": "logout() {\n if (sessionStorage.getItem('loggedUser')) {\n sessionStorage.removeItem('loggedUser');\n } else if (sessionStorage.getItem('loggedAdmin')) {\n sessionStorage.removeItem('loggedAdmin');\n }\n\n }", "title": "" }, { "docid": "05402a3212190db64c5b4e8fe86b1041", "score": "0.6381838", "text": "function logOut(){\n setToken(null);\n setCurrentUser(null);\n }", "title": "" }, { "docid": "beed992bd1496646296c8efc9749b75f", "score": "0.63759464", "text": "function unAuthorizedAccess(){\n alert('Unauthorized access. Kindly click ok button to sign in.')\n logout();\n }", "title": "" }, { "docid": "9cffbe551c35fb9be969e49d65e8511a", "score": "0.63617027", "text": "function logOutUser() {\n currentUserInfo = {};\n currentUserKey = \"\";\n displayLoggedOutNav();\n displayHomePage();\n}", "title": "" }, { "docid": "5718c27fa2d0389f4f1b7723cb2a7e11", "score": "0.6360662", "text": "logout({ commit }) {\n localStorage.removeItem(\"token\");\n localStorage.removeItem(\"expirationDate\");\n localStorage.removeItem(\"userId\");\n //add action log out step 2\n //commit mutation to clear the state\n commit(\"CLEAR_DATA\");\n //add action log out step 3\n //send user to signin route\n router.push({ name: \"signin\" });\n }", "title": "" }, { "docid": "66cc12576f86efb2ba83dfae5f9669cc", "score": "0.63590723", "text": "logout (uid) {\n // console.log('logout helper...', uid)\n clearUserData(app.get('redis'), app.get('downloads-path'), uid)\n .then(() => {\n console.log('clear user data (helper)', new Date())\n const pipeline = app.get('redis').pipeline()\n pipeline.del(`users:${uid}`)\n pipeline.zrem('users-refresh', uid)\n pipeline.publish('user:deleted', uid)\n return pipeline.exec()\n })\n }", "title": "" }, { "docid": "771478404cf8201f81ea64a0c1dfc551", "score": "0.63559306", "text": "logout() {\n Emitter.emit(Emitter.LOG_OFF);\n sessionStorage.removeItem('user');\n sessionStorage.removeItem('token');\n }", "title": "" }, { "docid": "593ccaef2d30aa19806902cbbaf85315", "score": "0.6351675", "text": "logout() {\n if (this.isAuthorizationEnabled()) {\n AuthLayerSvc.logout();\n }\n }", "title": "" }, { "docid": "c911bf93c86b96c28e75d78f101ebf20", "score": "0.6345259", "text": "Logout({ commit }) {\n commit('LOGOUT_USER'); \n storeWithExpiration.set('user.userInfo', {});\n storeWithExpiration.set('user.token', '');\n }", "title": "" }, { "docid": "fb08a12e8ed41a7dc4598d8bc7c18dac", "score": "0.63428867", "text": "handleLogout() {\n this._logout({ informServer: true });\n }", "title": "" }, { "docid": "bb9161fa706ad26bc4f13b7274b0b70f", "score": "0.6334727", "text": "function logout(){\n Auth.$unauth();\n $state.go('home');\n Users.currentUser = '';\n }", "title": "" }, { "docid": "e5f4916761d8798621d0f55dc4102f92", "score": "0.63317305", "text": "logout(req, res) {\n req.logout()\n return res.redirect('/login') \n }", "title": "" }, { "docid": "6d82aa6720973c8a921fd641a1d28a0a", "score": "0.6329117", "text": "logOut (redirect) {\n window.localStorage.removeItem(SESSION_KEY);\n store.commit('refresh');\n // router.replace(redirect);\n }", "title": "" }, { "docid": "ff193654f514897e9fe470eba53dae15", "score": "0.63235486", "text": "function doLogout() {\n doClear();\n notification.unbindAll();\n notification.disconnect();\n $('#hide-before-login, #signout').hide();\n $('#hide-after-login, #signin').show();\n}", "title": "" }, { "docid": "ccb5080f4b6b7aaedb085d121b6a4137", "score": "0.63213795", "text": "doLogout() {\n this.user = null;\n }", "title": "" }, { "docid": "c6a4669ec7845f31f9beb8bf06579785", "score": "0.63195586", "text": "logout() {\n let session = this.session\n delete this.session\n return this.writeCommand('logout', { sessionID: session })\n }", "title": "" }, { "docid": "42775894a38f1b2e58bac2cec668993a", "score": "0.6317688", "text": "static logout(req, dynamoDb, callback) {\n callback('cookie', '/', {cookie: 'id_token', value: '', options: {expires: new Date()}});\n }", "title": "" }, { "docid": "5783b821ce08922e5f69d9c8b659f482", "score": "0.6317305", "text": "logout () {\n this.props.mutate({ \n refetchQueries: [{ query: currentUser }],\n // update: (cache) => cache.writeQuery({\n // query: currentUser,\n // data: { currentUser: null },\n // })\n // update: cache => cache.reset()\n })\n .then( res => {\n this.props.client.resetStore();\n localStorage.setItem(\"mlToken\", res.data.logout.email);\n this.setState({ currentUser: null })\n })\n }", "title": "" }, { "docid": "ad2588e6521ab4db84b556a2a714b30c", "score": "0.63095194", "text": "logout(){\n\t\tActions.splash({type: ActionConst.RESET})\n\t}", "title": "" }, { "docid": "6603a3018fae577f2681fcdfdc684a13", "score": "0.6304302", "text": "function logout() {\n client.logout();\n window.location = \"#page-login\";\n }", "title": "" }, { "docid": "5ba90dfebfcd02b7bc1f53a78f294294", "score": "0.62880754", "text": "static logoutDatabase(param, request) {\n return new Promise(\n async (resolve) => {\n try {\n request.app.authenticationManager.destroySession(request.userSession);\n resolve(AnswerMessageService.logoutAnswer());\n } catch (e) {\n resolve(ErrorMessagesService.MongoDBErrorItemResponse(e));\n }\n },\n );\n }", "title": "" }, { "docid": "a9c18510541169cb77478bdf9bcd45be", "score": "0.6283798", "text": "function inpherapi_logout(callback) {\n return inpherapi_auth_post('/logout',{},next);\n function next(data) {\n\tsessionStorage.removeItem('username');\n\tsessionStorage.removeItem('auth_token');\n\tif (callback!==undefined) return callback(data);\n }\n}", "title": "" }, { "docid": "e8644d95687bc821f8d19093c09bea5d", "score": "0.6276235", "text": "function logout() {\n return {type: LOGOUT};\n}", "title": "" }, { "docid": "0d441e50da2be3579b2d8b8f760cc144", "score": "0.6274989", "text": "function logoutUser() {\n password = \"\";\n userID = 0;\n window.location = '/jQuery/components/login/login.template.client.html';\n }", "title": "" }, { "docid": "5b43b457a0c71b5667be052473d90da7", "score": "0.62732756", "text": "logout () {\r\n sessionStorage.removeItem(AUTH_KEY)\r\n this.user.authenticated = false\r\n }", "title": "" }, { "docid": "147bced09c46600209905f4f02c73d3f", "score": "0.6270433", "text": "function logout() {\n return baseService.makeApiCall(URLS.logoutUrl);\n}", "title": "" }, { "docid": "c8e560555af405e818c5b083477e027c", "score": "0.6262913", "text": "function logout() {\n userMenuModal.hide();\n $state.go(\"auth\");\n }", "title": "" }, { "docid": "672c95fed2f5249dca0deb0eb16a956e", "score": "0.625746", "text": "logout(req, res, successCallback, errorCallback) {\n }", "title": "" }, { "docid": "fe189c22b885c80e44f80c90d6e6c233", "score": "0.6252751", "text": "_handleLogout() {\n this._hide('logout', 'create-incident', 'status');\n this._show('login');\n document.getElementById('csp-vestec-current-user').innerText = '';\n\n this._disableAuthIntervalChecks();\n\n this._hideIncidentWindowContent();\n\n CosmoScout.vestecNE.updateEditor();\n }", "title": "" }, { "docid": "dd7e9858c1c86a6ab46e2192390c2104", "score": "0.62504137", "text": "logout (state) {\n state.auth.user = null\n state.auth.tokenExpires = null\n state.auth.isLoggedIn = false\n }", "title": "" }, { "docid": "a6eb4f2e5f01aaa8acefc54cabd4fdc0", "score": "0.624467", "text": "function logout() {\n\n Auth.logout();\n $state.go('login');\n }", "title": "" }, { "docid": "67cc48e810b13be324a405be7e66f132", "score": "0.62432194", "text": "function logOutUser() {\n localStorage.clear();\n}", "title": "" }, { "docid": "91618f9089cda1f0d8ff628567b265a0", "score": "0.62431586", "text": "function logOut() {\n var request = $http({\n method: \"get\",\n url: \"/logout\"\n });\n return( request.then( handleSuccess, handleError ) );\n }", "title": "" }, { "docid": "de8fd5d215ed778f416616d4fe027a00", "score": "0.62397754", "text": "signout(req, res, next) {\n req.logout();\n }", "title": "" }, { "docid": "a385a3d0ce1806221487617a862a4f63", "score": "0.62351567", "text": "async logout() {\n throw new utils_1.Exception('There is no concept of logout in basic auth', 500);\n }", "title": "" }, { "docid": "2c2975595fe3a9d6c8ad23dbb7623628", "score": "0.623454", "text": "function try_to_logout(){\n\t\tif (current_user)\n\t\t\tsetCurrentUser(null);\n\t\telse\n\t\t\tshow(config.afterLogout);\n\t}", "title": "" }, { "docid": "795a556eba81d988b771a3ef75c785fa", "score": "0.6231618", "text": "function logOff () {\n location.reload();\n}", "title": "" }, { "docid": "c3f8f8f4a11e78df105201dc8f608bbb", "score": "0.62287575", "text": "function logout() {\n\tlocalStorage.removeItem(\"user\");\n}", "title": "" }, { "docid": "d303e55b250120e3faec1462132fcf3a", "score": "0.62203354", "text": "function setLogout(){\n eraseCookie('authSuccess');\n eraseCookie('dismissKycDialogue');\n}", "title": "" }, { "docid": "81bad6e870441ed3f6e0f4cafa15cf12", "score": "0.6220054", "text": "function inactiveLogout()\n{\n\twindow.location = \"/login/logout\";\n}", "title": "" }, { "docid": "d4fd3a730cd3959968cd0675fa34fef7", "score": "0.6218772", "text": "function sessionLogout(req, res, next) {\n console.log('#sessionLogout()');\n\n // Get user credentials to do work\n keyPassManager.getUserCredentials(req, function(err, userCredentials) {\n\n // Handle error obtaining user credentials\n if (err) {\n console.log(\"sessionLogout: Unable to obtain the user credentials; err = \" + err.message + \".\");\n return next(err);\n } else {\n\n // Process the session logout\n processSessionLogout(req, res, next, userCredentials);\n\n }\n\n });\n\n}", "title": "" }, { "docid": "8f066b36c271afde2ce9ba083eb0095d", "score": "0.62170774", "text": "clientLogout({ commit }) {\n if (localStorage.getItem('x-authentication')) {\n localStorage.removeItem('x-authentication')\n localStorage.removeItem('profileStatus')\n }\n commit('common/SET_LOGIN_STATUS', {\n status: false,\n message: null,\n error: false\n })\n commit('common/SET_PROFILE_STATUS', null, { root: true })\n router.push({ name: 'login' })\n }", "title": "" }, { "docid": "24cff497eb0e45c4dba3ae88015f6df0", "score": "0.6201363", "text": "function logout()\n{\n\t// not deleting woven session cookie anymore, the guard realm needs it\n\t// the cookie does not contain anything about users' credentials\n\tvar cookies = document.cookie.split(\";\");\n\tfor (var i = 0 ; i < cookies.length; i++){\n\t\tdeleteCookie(cookies[i].split(\"=\")[0]);\n\t}\n\t// delete username and password cookies ('remember me' was checked)\n\t//deleteCookie('username');\n\t//deleteCookie('password');\n\n\trequestPage(\"GET\", '/admin/perspective-destroy', null);\n\tdocument.getElementById('signup').innerHTML = loginLinks;\n\twindow.location = '/home';\n}", "title": "" }, { "docid": "8583bde0104d9cfd93200350a9257812", "score": "0.6200562", "text": "async logOut() {\n // Invalidate the refresh token\n try {\n if (this._refreshToken !== null) {\n await this.fetcher.fetchJSON({\n method: \"DELETE\",\n path: routes.api().auth().session().path,\n tokenType: \"refresh\",\n });\n }\n }\n finally {\n // Forget the access and refresh token\n this.accessToken = null;\n this.refreshToken = null;\n }\n }", "title": "" }, { "docid": "8583bde0104d9cfd93200350a9257812", "score": "0.6200562", "text": "async logOut() {\n // Invalidate the refresh token\n try {\n if (this._refreshToken !== null) {\n await this.fetcher.fetchJSON({\n method: \"DELETE\",\n path: routes.api().auth().session().path,\n tokenType: \"refresh\",\n });\n }\n }\n finally {\n // Forget the access and refresh token\n this.accessToken = null;\n this.refreshToken = null;\n }\n }", "title": "" }, { "docid": "d9aa5d688cc302bed89b6f672b61b4eb", "score": "0.6199476", "text": "function Logout()\n{\n\t//get confirmation\n\tvar ruSure = confirm(\"Are you sure you want to Logout? This will clear all data on the app and you will need to reverify with Smartthings.\");\n\t\n\t//if they're sure.\n\tif(ruSure)\n\t{\n\t\t//clear the entire DB and global vars\n\t\tlocalStorage.clear();\n\t\tAccess_Token = null;\n\t\tAccess_Url = null;\n\t\tswitches_DB = null;\n\t\t\n\t\t//let the setup page run again\n\t\tsetupPageRan = false;\n\t\t\n\t\t//let the user know we just destroyed everything\n\t\talert(\"You have been logged out. All data is cleared.\");\n\t\t\n\t\t//redirect to setup page\n\t\ttau.changePage(\"setupPage\");\n\t}\n}", "title": "" }, { "docid": "5310bbd4d6e99d35771879da5c4960a1", "score": "0.6198678", "text": "logout() {\n this.model.unsetAuthData();\n window.location.reload();\n }", "title": "" } ]
3c0e24212bc6523ea778edf066e79de8
Time: O(nm) where n is size of arr1, m size of arr2 Space: O(n) n is the larger array
[ { "docid": "092a1cfc1f587d61e5776e20cc8328dd", "score": "0.0", "text": "function intersection2(arr1, arr2) {\n const set1 = new Set()\n for (let i = 0; i < arr1.length; i++) {\n set1.add(arr1[i])\n }\n const set2 = new Set()\n for (let i = 0; i < arr2.length; i++) {\n set2.add(arr2[i])\n }\n let count = 0\n for (let item1 of set1) {\n for (let item2 of set2) {\n if (item1 === item2) {\n count += 1\n }\n }\n }\n return count\n}", "title": "" } ]
[ { "docid": "3fdbd4acf076a935f9e97221f34959f2", "score": "0.7283548", "text": "function merge(arr1, arr2) {\n let i = 0, j = 0, k = 0, m = arr1.length, n = arr2.length;\n let sol = [];\n while (i < m && j < n) {\n if (arr1[i] <= arr2[j]) {\n sol.push(arr1[i]);\n i++;\n }\n else {\n sol.push(arr2[j]);\n j++;\n }\n }\n return sol.concat(arr1.slice(i)).concat(arr2.slice(j));\n}", "title": "" }, { "docid": "89dc31c0b284bff15b59196c9ff58268", "score": "0.72680813", "text": "function mergeArrayS2(arr1, arr2, n, m) {\n // Now traverse the array1 and if\n // arr2 first element\n // is less than arr1 then swap\n for (let i = 0; i < n; i++) {\n if (arr1[i] > arr2[0]) {\n // Swap\n let temp = arr1[i];\n arr1[i] = arr2[0];\n arr2[0] = temp;\n\n // After swapping we have to sort the array2\n // again so that it can be again swap with\n // arr1\n\n // We will store the firstElement of array2\n // and left shift all the element and store\n // the firstElement in arr2[k-1]\n let firstElement = arr2[0];\n\n let k;\n\n for (k = 1; k < m && arr2[k] < firstElement; k++) {\n arr2[k - 1] = arr2[k];\n }\n arr2[k - 1] = firstElement;\n }\n }\n\n // Read the arr1\n for (let i = 0; i < n; i++) {\n console.log(arr1[i] + \" \");\n }\n\n // Read the arr2\n for (let i = 0; i < m; i++) {\n console.log(arr2[i] + \" \");\n }\n}", "title": "" }, { "docid": "a4a6c7df4c03144a423db70eac89ec0f", "score": "0.713803", "text": "function similarArrays(arr1,arr2) {\r\n\tif(arr1.length != arr2.length){\r\n\t\treturn false;\r\n\t}\r\n\tlet rez=true;\r\n\tlet swaps=0;\r\n\tarr1.map((e,idx)=>{if(arr2.indexOf(e)!=idx){\r\n\t\tif(arr2.indexOf(e)===-1) rez=false;\r\n\t\tif(arr2.indexOf(e)>=0&&arr2.indexOf(e)<arr2.length) swaps +=1;\r\n\t\t}});\r\n\tif(swaps>2){\r\n\t\trez=false;\r\n\t}\r\n\treturn rez;\r\n}", "title": "" }, { "docid": "fd9452b245a5d849366ecb627f3e2032", "score": "0.706734", "text": "function mergeArrays(arr1, arr2) {\n let merged = [...arr1, ...arr2]; //O(n)\n merged.sort((a, b) => a - b); //O(n^2) || best case O(log(n))\n \n return merged;\n}", "title": "" }, { "docid": "a98d8f923fae34e9fc5fc3be642ab406", "score": "0.70364666", "text": "function merge(arr1, arr2) {\n let i = 0;\n let j = 0;\n let k = 0;\n let newArr = [];\n \n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] <= arr2[j]) {\n newArr[k] = arr1[i];\n i++;\n k++;\n } else {\n newArr[k] = arr2[j];\n j++;\n k++;\n }\n }\n \n if (i === arr1.length) {\n while (j < arr2.length) {\n newArr[k] = arr2[j];\n j++;\n k++;\n }\n } else if (j === arr2.length) {\n while (i < arr1.length) {\n newArr[k] = arr1[i];\n i++;\n k++;\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "29c563f9eecec2a745ce2e7fec71bcbb", "score": "0.6964568", "text": "function compareArrayUsingObjectForReducingTimeComplexity(arr1, arr2) {\n const map = {};\n for (let i = 0; i < arr1.length; i++) {\n if (!map[arr1[i]]) {\n const item = arr1[i];\n map[item] = true;\n }\n }\n for (let j = 0; j < arr1.length; j++) {\n\tif(map[arr2[j]]) {\n\t\treturn true;\n\t}\n }\n return false;\n}", "title": "" }, { "docid": "687d4cafc75a9bc4e87582bd0988557c", "score": "0.6922214", "text": "function merge(arr1, arr2) {\n let result = [];\n let len1 = arr1.length;\n let len2 = arr2.length;\n let i = 0;\n let j = 0;\n if (len1 === 0) return arr2;\n if (len2 === 0) return arr1;\n while (true) {\n if (i === len1 && j === len2) break;\n if (arr1[i] && arr2[j]) {\n if (arr1[i] <= arr2[j]) {\n result.push(arr1[i]);\n i += 1;\n } else {\n result.push(arr2[j]);\n j += 1;\n }\n } else {\n if (!arr1[i]) {\n result.push(arr2[j]);\n j += 1;\n } else {\n result.push(arr1[i]);\n i += 1;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "363345addb9d6537b918d20b1c985ea4", "score": "0.69083554", "text": "function diffArray(arr1, arr2) {\n function fn(acc,current){acc[current] = true; return acc;}\n var map1 = arr1.reduce(fn ,{});\n var map2 = arr2.reduce(fn ,{});\n return arr1.filter(el=>!map2[el]).concat(arr2.filter(el=>!map1[el]));\n \n}", "title": "" }, { "docid": "6c28cdfb5860a105dac494a904a01940", "score": "0.6839711", "text": "function merge2(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while (i < arr1.length) {\n results.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j]);\n j++;\n }\n return results;\n}", "title": "" }, { "docid": "db53420c4daaebe1edbb8c52c774f1fc", "score": "0.6821391", "text": "function Merge(arr1, arr2){\n let arr1Idx = 0, arr2Idx = 0, newArr = [], count = 0;\n while(count < (arr1.length + arr2.length)){\n if(arr1[arr1Idx] > arr2[arr2Idx] || arr1Idx === arr1.length){\n newArr.push(arr2[arr2Idx]);\n arr2Idx++;\n count++;\n }\n else{\n newArr.push(arr1[arr1Idx])\n arr1Idx++;\n count++;\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "4566035a56eab522b0c32503bac9fbd3", "score": "0.6792836", "text": "function merge(arr1, arr2) {\n let result = [];\n let i = 0;\n let j = 0;\n while(i < arr1.length) {\n if(j < arr2.length) {\n if(arr1[i] < arr2[j]) {\n result.push(arr1[i]);\n i++;\n }\n else {\n result.push(arr2[j]);\n j++;\n }\n continue;\n }\n result.push(arr1[i]);\n i++;\n }\n while(j < arr2.length) {\n result.push(arr2[j]);\n j++;\n }\n return result;\n}", "title": "" }, { "docid": "153d49d952d7c4ac8ac94d83688cc51a", "score": "0.6787842", "text": "function mergeTwoArr(arr1, arr2) {\tlet j = 0, i = 0\n\tlet maxArr= arr1.length >= arr2.length? arr1 : arr2\n\tconst merged = []\n\tlet newNum = null\n\twhile (true) {\n\t\tif (arr1[i] === undefined || arr2[j] === undefined) {\n\t\t\tnewNum = arr1[i] !== undefined? i : j\n\t\t\tbreak;\n\t\t}\n\t\tif (arr1[i] < arr2[j]) {\n\t\t\tmerged.push(arr1[i])\n\t\t\ti++\n\t\t}\n\t\telse if (arr2[j] < arr1[i]) {\n\t\t\tmerged.push(arr2[j])\n\t\t\tj++\n\t\t}\n\t\telse {\n\t\t\tmerged.push(arr1[i], arr2[j])\n\t\t\ti++\n\t\t\tj++\n\t\t}\n\t}\n\tif (newNum !== null) {\n\t\tmerged.push(...maxArr.splice(newNum))\n\t\treturn merged\n\t}\n}", "title": "" }, { "docid": "a05b46d9732003de8c69b5e09772f1c9", "score": "0.67670125", "text": "function combineArrs(arr1,arr2){\n newArr = []\n for(var i = 0, j = 0; i<arr1.length || j<arr2.length;){\n if(arr1[i]<=arr2[j]){\n newArr.push(arr1[i])\n i++\n }\n else if(arr2[j]<=arr1[i]){\n newArr.push(arr2[j])\n j++\n }\n else{\n if(i>=arr1.length){\n newArr.push(arr2[j])\n j++\n }\n else if(j>=arr2.length){\n newArr.push(arr1[i])\n i++\n }\n }\n }\n return newArr\n}", "title": "" }, { "docid": "9bde71b15d64180cf471f4dfbeeb4931", "score": "0.6766575", "text": "function merge(arr1, arr2) {\n let result = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] > arr2[j]) {\n result.push(arr2[j]);\n j++;\n } else {\n result.push(arr1[i]);\n i++;\n }\n }\n if (i < arr1.length) {\n for (let x = i; x < arr1.length; x++) {\n result.push(arr1[x]);\n }\n } else {\n for (let x = j; x < arr2.length; x++) {\n result.push(arr2[x]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "9bde71b15d64180cf471f4dfbeeb4931", "score": "0.6766575", "text": "function merge(arr1, arr2) {\n let result = [];\n let i = 0;\n let j = 0;\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] > arr2[j]) {\n result.push(arr2[j]);\n j++;\n } else {\n result.push(arr1[i]);\n i++;\n }\n }\n if (i < arr1.length) {\n for (let x = i; x < arr1.length; x++) {\n result.push(arr1[x]);\n }\n } else {\n for (let x = j; x < arr2.length; x++) {\n result.push(arr2[x]);\n }\n }\n return result;\n }", "title": "" }, { "docid": "c07d44453099d83071a7beb52e7f09e0", "score": "0.6762049", "text": "function merge(arr1, arr2){\n let results = [];\n let i = 0;\n let j = 0;\n while(i < arr1.length && j < arr2.length){\n if(arr2[j] > arr1[i]){\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j])\n j++;\n }\n }\n while(i < arr1.length) {\n results.push(arr1[i])\n i++;\n }\n while(j < arr2.length) {\n results.push(arr2[j])\n j++;\n }\n return results;\n}", "title": "" }, { "docid": "81416ba671cb73d54c4ec4b1835fb447", "score": "0.6760949", "text": "function mergeI(arr1, arr2) {\n const result = [];\n let i = 0;\n let j = 0;\n\n // while both arrays are not exhausted\n while (i < arr1.length && j < arr2.length) {\n // if arr1's element is less than arr2's element push arr1 element and increment i\n // else do the opposite\n if (arr1[i] < arr2[j]) {\n result.push(arr1[i]);\n i += 1;\n } else {\n result.push(arr2[j]);\n j += 1;\n }\n }\n\n // concat whichever array still has values, to result\n return result.concat(i === arr1.length ? arr2.slice(j) : arr1.slice(i));\n}", "title": "" }, { "docid": "ecc472fee9994c4189dba37aca0ad386", "score": "0.6736614", "text": "function merge(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n while(i < arr1.length && j < arr2.length){\n if(arr2[j] > arr1[i]){\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while(i < arr1.length){\n results.push(arr1[i])\n i++;\n }\n while(j < arr2.length){\n results.push(arr2[j])\n j++;\n }\n return results;\n}", "title": "" }, { "docid": "f7dbade43cec8e93b7023627afc444b6", "score": "0.6715655", "text": "function merge(arr1,arr2) {\n const results = [];\n // set pointers at beginning of both arrays\n let idx1 = 0;\n let idx2 = 0;\n // while there is still values to look at in BOTH arrays\n while (idx1 < arr1.length && idx2 < arr2.length) {\n // put smaller value into results array\n if (arr2[idx2] > arr1[idx1]) {\n results.push(arr1[idx1])\n // move idx1 pointer up by 1;\n idx1++\n }\n else {\n results.push(arr2[idx2]);\n idx2++;\n }\n // have merged into results as much as we can but now have hit the end of one the arrays so this while loop ends\n }\n \n // put all remaining values from the other array where pointer hasn't reached the end into the results array\n while (idx1 < arr1.length) {\n results.push(arr1[idx1])\n idx1++;\n }\n while (idx2 < arr2.length) {\n results.push(arr2[idx2])\n idx2++;\n }\n return results;\n}", "title": "" }, { "docid": "bd993187c654bd5002faa9a6e3e00ab9", "score": "0.6709942", "text": "function mergeSortedArr(arr1, arr2) {\n\tlet res = [];\n\tlet ind1 = 0;\n\tlet ind2 = 0;\n\tlet totalSize = arr1.length + arr2.length;\n\tlet counter = 0;\n\twhile (counter < totalSize) {\n\t\tif (arr1[ind1] < arr2[ind2] || !arr2[ind2]) {\n\t\t\tres.push(arr1[ind1])\n\t\t\tind1++;\n\t\t} else if (arr1[ind1] > arr2[ind2] || !arr1[ind1]) {\n\t\t\tres.push(arr2[ind2]);\n\t\t\tind2++;\n\t\t} else {\n\t\t\tres.push(arr1[ind1]);\n\t\t\tind1++;\n\t\t}\n\t\tcounter++;\n\t}\n\treturn res;\n}", "title": "" }, { "docid": "aa8627792308759dc4d052d749fe8be2", "score": "0.6696353", "text": "function merge(arr1, arr2) {\n let newArr = [];\n let i = 0;\n let j = 0;\n while(i < arr1.length && j < arr2.length) {\n if(arr2[j] > arr1[i]) {\n newArr.push(arr1[i]);\n i++;\n }\n else {\n newArr.push(arr2[j]);\n j++\n }\n }\n while(i < arr1.length) {\n newArr.push(arr1[i]);\n i++;\n }\n while(j < arr2.length) {\n newArr.push(arr2[j]);\n j++;\n }\n return newArr;\n}", "title": "" }, { "docid": "1fe7195b4bc2ae572f16ded9c53afab7", "score": "0.6675365", "text": "function merge(arr1, arr2) {\n let newArr = [];\n let point1 = 0;\n let point2 = 0;\n\n while (point1 < arr1.length && point2 < arr2.length) {\n if (arr1[point1] < arr2[point2]) {\n newArr.push(arr1[point1]);\n point1++;\n } else {\n newArr.push(arr2[point2]);\n point2++;\n }\n }\n if (point1 <= arr1.length || point2 <= arr2.length) {\n newArr = newArr.concat(arr1.slice(point1), arr2.slice(point2));\n }\n\n return newArr;\n}", "title": "" }, { "docid": "907c989658887de921251f7a1ea6c807", "score": "0.6668048", "text": "function merge(arr1, arr2){\n let results = []\n let i = 0;\n let j = 0;\n while(i < arr1.length && j < arr2.length){\n if(arr2[j] > arr1[i]){\n results.push(arr1[i]);\n i++;\n } else {\n results.push(arr2[j]);\n j++;\n }\n }\n while(i < arr1.length){\n results.push(arr1[i])\n i++;\n }\n while(j < arr2.length){\n results.push(arr2[j]);\n j++;\n }\n return results\n}", "title": "" }, { "docid": "810882333bc048d2326bcdec05bfc0f6", "score": "0.6641671", "text": "function similarArr(arr1, arr2) {\n for (var i = 0; i < arr1.length; i++) {\n for (var j = 0; j < arr1.length; j++) {\n var result = true;\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n for (var k = 0; k < arr1.length; k++) {\n if (arr1[k] != arr2[k]) {\n result = false;\n break;\n }\n }\n if (result) {\n return true;\n }\n arr1[j] = arr1[i];\n arr1[i] = temp;\n }\n }\n return false;\n }", "title": "" }, { "docid": "8f29a7b446c4f6a25604c8a84dfbde6c", "score": "0.66395515", "text": "function merge(arr1, arr2){\n\tvar newarray = [];\n\tvar oneidx = 0;\n\tvar twoidx = 0;\n\twhile(oneidx < arr1.length && twoidx < arr2.length){\n\t\t\tif(arr1[oneidx]<arr2[twoidx]){\n\t\t\t\tnewarray.push(arr1[oneidx]);\n\t\t\t\toneidx++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewarray.push(arr2[twoidx]);\n\t\t\t\ttwoidx++;\n\t\t\t}\n\t}\n\tif(oneidx < arr1.length){\n\t\tfor(var i=oneidx; i<arr1.length; i++){\n\t\t\tnewarray.push(arr1[i]);\n\t\t}\n\t}\n\telse {\n\t\tfor(var i=twoidx; i<arr2.length; i++){\n\t\t\tnewarray.push(arr2[i])\n\t\t}\n\t}\n\treturn newarray;\n}", "title": "" }, { "docid": "0329ea80b421d6b3b3be0b815b99aee9", "score": "0.6639385", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) { // O(n)\n const el1 = arr1[i]; // O(1)\n for (let j = 0; j < arr2.length; j++) { // O(n) but nested in another O(n)\n const el2 = arr2[j]; // O(1)\n if (el1 === el2) return true; // O(1)\n }\n }\n return false;\n}", "title": "" }, { "docid": "48280d6c71ce722cc339c6b8739c59f0", "score": "0.66363883", "text": "function arrDiff(arr1, arr2) {\n var arrays = [arr1, arr2].sort((a, b) => a.length - b.length);\n var smallSet = new Set(arrays[0]);\n\n return arrays[1].filter(x => !smallSet.has(x));\n}", "title": "" }, { "docid": "0953a4ca84749b51db33f52e917e6f80", "score": "0.66075885", "text": "function mergeArray2( ary1, ary2 ) {\n let newArray = ary1.concat( ary2 );\n\n let bucket = new Array( 7 ).fill( 0 );\n for ( let i = 0, len = newArray.length;i < len;i++ ) {\n bucket[newArray[i]]++\n }\n let ary = [];\n for ( let i = 0;i < bucket.length;i++ ) {\n while ( bucket[i] > 0 ) {\n ary.push( i );\n bucket[i]--;\n }\n }\n return ary;\n}", "title": "" }, { "docid": "73125d2b42569678f1501e8ee431f62a", "score": "0.6603359", "text": "function mergeArrays(arr1, arr2) {\n\tlet results = [];\n\tlet i = 0;\n\tlet j = 0;\n\n\twhile(i < arr1.length && j < arr2.length) {\n\t\tif(arr2[j] > arr1[i]) {\n\t\t\tresults.push(arr1[i]);\n\t\t\ti++;\n\t\t} else {\n\t\t\tresults.push(arr2[j]);\n\t\t\tj++;\n\t\t}\n\t}\n\n\twhile(i < arr1.length) {\n\t\tresults.push(arr1[i]);\n\t\ti++;\n\t}\n\n\twhile(j < arr2.length) {\n\t\tresults.push(arr2[j]);\n\t\tj++;\n\t}\n\n\treturn results;\n}", "title": "" }, { "docid": "1bc7e02f161806a4b3aacb521405c473", "score": "0.6602019", "text": "function mergeArray(arr1, arr2) {\n let results = [];\n let i = 0;\n let j = 0;\n\n // loop that runs while i < arr1.length && j < arr2.length\n while (i < arr1.length && j < arr2.length) {\n if (arr2[j] > arr1[i]) {\n results.push(arr1[i]); // Push the smaller value to results\n i++; // After we push arr[i], move i up \n } else {\n // If arr2[j] < arr1[i]\n results.push(arr2[j]);\n j++;\n }\n }\n\n // Once we hit the end length for one of them, \n // merge the remaining of either array to the end\n while (i < arr1.length) {\n results.push(arr1[i])\n i++;\n }\n while (j < arr2.length) {\n results.push(arr2[j])\n j++;\n }\n\n return results;\n}", "title": "" }, { "docid": "48a82e12c39982a78d354134ce6ca9fb", "score": "0.65786433", "text": "function checkIdenticalArray2(arr1, arr2){\n let n1 = arr1.length;\n let n2 = arr2.length;\n\n if(n1 !== n2){\n console.log(\"array is not identical\");\n return;\n }\n arr1.sort();\n arr2.sort();\n let i, p1 = 0, p2 = 0;\n for(i=0; i<n1; i++){\n if(arr1[p1++] !== arr2[p2++]){\n console.log(\"array is not identical\");\n return;\n }\n }\n console.log(\"array is identical\");\n}", "title": "" }, { "docid": "5f327db33d86a503166a4a1abc6fb779", "score": "0.6574688", "text": "function diffArray(arr1, arr2) {\n \n let first = [...arr1]; // create new copy of arr1. let first = arr1 will pass by reference since it's an object.\n let second = [...arr2]; // create new copy of arr2\n\n // check if arr1 is empty\n if (arr1.length === 0) return arr2;\n else {\n let newArr = arr1.reduce((accumulator, currentValue) => {\n if (second.includes(currentValue)){\n \n second.splice(second.indexOf(currentValue), 1);\n first.splice(first.indexOf(currentValue), 1);\n }\n return first.concat(second);\n }, []);\n\n return newArr;\n }\n \n}", "title": "" }, { "docid": "202946b54a06442d20adf9d20563b934", "score": "0.656737", "text": "function both(arr1, arr2) {\n var newArr = [];\n for (var i = 0; i < arr1.length; i++) {\n for (var j = 0; j < arr2.length; j++) {\n if (arr1[i] === arr2[j]) {\n newArr.push(arr1[i]);\n }\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "47664debaf0bbad2814e80781720f991", "score": "0.6554525", "text": "function checkIdenticalArray3(arr1, arr2){\n let n1 = arr1.length;\n let n2 = arr2.length;\n\n if(n1 !== n2){\n console.log(\"array is not identical\");\n return;\n }\n\n let map = new Map();\n let i, value, flag = false;\n for(i=0; i<n1; i++){\n value = map.get(arr1[i]) ? map.get(arr1[i]) : 0;\n map.set(arr1[i], value + 1);\n }\n for(i=0; i<n2; i++){\n map.set(arr2[i], map.get(arr2[i]) - 1);\n }\n\n for(let value of map.values()){\n if(value !== 0){\n flag = true;\n }\n }\n if(flag)\n console.log(\"array is not identical\");\n else\n console.log(\"array is identical\");\n}", "title": "" }, { "docid": "7f72e8c8e4e78d050212661b3fbbd0e9", "score": "0.6551805", "text": "function merge(arr1, arr2){\n //create an empty array, take a look at the smallest values in each array\n let res = [];\n let i = 0 , j = 0;\n while(i < arr1.length && j < arr2.length){\n if(arr1[i] < arr2[j]){\n res.push(arr1[i]);\n i++\n }else{\n res.push(arr2[j]);\n j++;\n }\n }\n //append the rest of one of the array\n if( i < arr1.length){\n res = [...res, ...arr1.slice(i)];\n }\n else if(j < arr2.length){\n res = [...res, ...arr2.slice(j)];\n }\n return res;\n}", "title": "" }, { "docid": "0067b20c2c2eed8ced248f333e084277", "score": "0.6547827", "text": "function mergeTwoArrays(arr1, arr2) {\n let pointerOne = 0;\n let pointerTwo = 0;\n let result = [];\n\n while (pointerOne < arr1.length && pointerTwo < arr2.length) {\n if (arr1[pointerOne] <= arr2[pointerTwo]) {\n result.push(arr1[pointerOne]);\n pointerOne++;\n }\n else {\n result.push(arr2[pointerTwo]);\n pointerTwo++;\n }\n }\n\n while (pointerOne < arr1.length) {\n result.push(arr1[pointerOne]);\n pointerOne++;\n }\n\n\n while (pointerTwo < arr2.length) {\n result.push(arr2[pointerTwo]);\n pointerTwo++\n }\n\n return result;\n}", "title": "" }, { "docid": "3a023bb0dc095af069cfd175b5d195a6", "score": "0.6546969", "text": "function mergeTwo(arr1, arr2) {\n let merged = [];\n let index1 = 0;\n let index2 = 0;\n let current = 0;\n\n while (current < (arr1.length + arr2.length)) {\n\n let isArr1Depleted = index1 >= arr1.length;\n let isArr2Depleted = index2 >= arr2.length;\n\n if (!isArr1Depleted && (isArr2Depleted || (arr1[index1] < arr2[index2]))) {\n merged[current] = arr1[index1];\n index1++;\n } else {\n merged[current] = arr2[index2];\n index2++;\n }\n\n current++;\n }\n\n return merged;\n}", "title": "" }, { "docid": "12a2b19e23b5085f8281308581f32070", "score": "0.6532774", "text": "function diffArray1(arr1, arr2) {\n let diff=[]\n for(let num of arr1){\n if(arr2.indexOf(num)<0){\n diff.push(num)\n }\n }\n for(let num of arr2){\n if(arr1.indexOf(num)<0){\n diff.push(num)\n }\n }\n return diff\n}", "title": "" }, { "docid": "2fd486cf7610cc2334cf6b02c642a36b", "score": "0.65171105", "text": "function merge(nums1, m, nums2, n) {\n nums1.length = m;\n let pointer1 = 0;\n let pointer2 = 0;\n\n while (pointer1 < m && pointer2 < n) {\n if (nums2[pointer2] >= nums1[pointer1]) {\n pointer1++;\n } else {\n while (m > pointer1) {\n nums1[m] = nums1[m - 1];\n m--;\n }\n nums1[m] = nums2[pointer2];\n pointer2++;\n }\n m = nums1.length;\n }\n\n while (n > pointer2) {\n nums1.push(nums2[pointer2]);\n pointer2++;\n }\n}", "title": "" }, { "docid": "332541011bd3240df85eb0032d9a16fa", "score": "0.6515875", "text": "function merge(arr1, arr2) {\n var result = []; \n while (arr1.length && arr2.length) {\n if(arr1[0] <= arr2[0]) {\n result.push(arr1.shift());\n } else {\n result.push(arr2.shift());\n }\n }\n return result.concat(arr1, arr2);\n}", "title": "" }, { "docid": "8ec1f1e7fccda3c7b072e8be58c8f5d6", "score": "0.64992106", "text": "function mergeSortedArrays2(arr1, arr2){\n const arr3 = []\n let arr1item = arr1[0]\n let arr2item = arr2[0]\n let i = 1\n let j = 1\n\n if(arr1.length===0){\n return arr2\n }\n if(arr2.length===0){\n return arr1\n }\n\n while(arr1item || arr2item) {\n // if array 2 item doesnt exist as index out of bounds happen as num of ele are diff in both arr\n\n // We have undefined at the end which will always happen since one of our arrays ran out of elements before we finished merging.\n\n if (!arr2item || arr1item < arr2item) {\n arr3.push(arr1item);\n arr1item = arr1[i];\n i++;\n } else {\n arr3.push(arr2item);\n arr1item = arr2[j];\n j++;\n }\n }\n return mergeSortedArrays2;\n}", "title": "" }, { "docid": "a004e0826807eb0329a73f3929ec8b83", "score": "0.6495757", "text": "function compareTwoArray_(arr1, arr2){\n arr1.sort();\n arr2.sort(); \n if(arr1. length !== arr2.length) return false;\n for(let i = 0; i < arr1.length; i++){\n if(arr1[i] !== arr2[i]) return false;\n }\n return true;\n }", "title": "" }, { "docid": "2602674b0b9883ad2a95c67a735f0006", "score": "0.6492685", "text": "function merge(arr1, arr2) {\n //make a new array and have two value pointers\n let res = [],\n i = 0,\n j = 0;\n\n //sorting the first array.\n if (arr1.length > 1) {\n let min = 0;\n for (let i = 0; i < arr1.length; i++) {\n if (i !== min) {\n if (arr1[i] < arr1[min]) {\n //also swap the elements\n [arr1[i], arr1[min]] = [arr1[min], arr1[i]];\n //change the minimum\n min = i;\n }\n }\n }\n }\n\n //sorting the second array.\n if (arr2.length > 1) {\n let min = 0;\n for (let i = 0; i < arr2.length; i++) {\n if (i !== min) {\n if (arr2[i] < arr2[min]) {\n //also swap the elements\n [arr2[i], arr2[min]] = [arr2[min], arr2[i]];\n //change the minimum\n min = i;\n }\n }\n }\n }\n\n //Value comparison.\n while (i < arr1.length && j < arr2.length) {\n if (arr1[i] < arr2[j]) {\n res.push(arr1[i]);\n i++;\n } else {\n res.push(arr2[j]);\n j++;\n }\n }\n\n //pushing the rest of arr1.\n while (i < arr1.length) {\n res.push(arr1[i]);\n i++;\n }\n\n //pushing the rest of arr2.\n while (j < arr2.length) {\n res.push(arr2[j]);\n j++;\n }\n\n return res;\n}", "title": "" }, { "docid": "f536e7710f1048b667bf2f34ebca3321", "score": "0.64876586", "text": "function unionSortedArraysDedupe(arr1, arr2) {\r\n let i = 0;\r\n let j = 0;\r\n let newArr = [];\r\n while(i<arr1.length && j < arr2.length){\r\n if(arr1[i] < arr2[j]){\r\n i++;\r\n } else if(arr1[i] > arr2[j]){\r\n j++;\r\n } else{\r\n if(newArr[newArr.length-1]!=arr1[i]){\r\n newArr.push(arr1[i]);\r\n }\r\n i++; j++;\r\n }\r\n }\r\n return newArr;\r\n }", "title": "" }, { "docid": "5ca62ff68e8c60cc5c2349da11c8c383", "score": "0.6470147", "text": "function diff(arr1, arr2) {\n var newArr = [];\n for(var i=0;i<arr1.length;i++){\n if(!contains(arr2,arr1[i])){\n newArr.push(arr1[i]);\n }\n }\n for(var j=0;j<arr2.length;j++){\n if(!contains(arr1,arr2[j])){\n newArr.push(arr2[j]);\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "949ea73902450d23a47481ef819a74b3", "score": "0.64656407", "text": "function merge(arr1, arr2) {\n //create an empty array to return\n const output = [];\n //look at the smallest values in each input array\n let i = 0;\n let j = 0;\n //while there are still values to look at.....\n while (i < arr1.length && j < arr2.length) {\n //if the value in the first array is smaller than the value in the second array,push the value in the first array into output array and move on to the next value in the first array\n if (arr2[j] > arr1[i]) {\n output.push(arr1[i]);\n i++;\n } else {\n //if the value in the larger than the value in the second array, push the value in the second array into our output array and move on to the next value in the second array\n output.push(arr2[j]);\n j++;\n }\n }\n //once we exhause one array, push in all remaining values from the other array\n while (i < arr1.length) {\n output.push(arr1[i]);\n i++;\n }\n while (j < arr2.length) {\n output.push(arr2[j]);\n j++;\n }\n return output;\n}", "title": "" }, { "docid": "952dc4778e27bd3fb6e801cfb4ed8321", "score": "0.6440476", "text": "function merge(arr1, arr2) {\n\n const newArr = [];\n for (const element1 of arr1) {\n shiftPush(arr2, element1, newArr);\n newArr.push(element1);\n }\n /* now arr1 is finiehed, need to check for any remaing elements of arr2 and push them to end */\n for (const element2 of arr2) {\n newArr.push(element2);\n }\n return newArr;\n}", "title": "" }, { "docid": "603ef793eb1534cc00af44f8087c783a", "score": "0.6440061", "text": "function uniqueArrayIntersection(arr1, arr2) {\n \n var map = {};\n var intersect = [];\n \n for (var i = 0; i < arr1.length; i++) {\n \n map[arr1[i]] = 1;\n \n }\n \n for (var k = 0; k < arr2.length; k++) {\n \n if (map[arr2[k]] === 1) {\n \n intersect.push(arr2[k]);\n map[arr2[k]]++;\n \n }\n \n }\n \n return intersect;\n \n}", "title": "" }, { "docid": "83c23fa8b808a42adf0ba733f9992eeb", "score": "0.64331055", "text": "function mergeArr(arr1, arr2){\n return [...arr1, ...arr2].sort((a,b) => a - b);\n }", "title": "" }, { "docid": "a95f283a6b24ba62397f0f3e1c7945f4", "score": "0.6432752", "text": "function f5(arr1, arr2) {\n let result = [...arr1, ...arr2].sort((a, b) => a - b);\n\n for (let i = 0; i < result.length; i++) {\n if (result[i + 1] === result[i]) {\n result.splice(i, 1);\n i = 0;\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "59ad77fe0966ab3fe8e22dd09cb6a317", "score": "0.64287925", "text": "function merger(arr1, arr2){\n let i = 0, j = 0, mergedArr = [];\n while (i < arr1.length && j < arr2.length){\n if (arr1[i] > arr2[j]) mergedArr.push(arr2[j++]);\n else mergedArr.push(arr1[i++]);\n }\n while (i < arr1.length){\n mergedArr.push(arr1[i++]);\n }\n while (j < arr2.length){\n mergedArr.push(arr2[j++]);\n }\n return mergedArr;\n }", "title": "" }, { "docid": "446c4deacd368a1fe41649679d515664", "score": "0.6409601", "text": "function intersection(arr1, arr2) {\n let newArr = [];\n let idx1 = 0;\n let idx2 = 0;\n //if an input array is empty, return empty array\n if (arr1.length <= 0 || arr2.length <= 0){\n return newArr;\n }\n while (arr1.length > 0 && arr2.length>0){\n if (arr1[idx1] < arr2[idx2]){idx1++;}\n else if (arr1[idx1] > arr2[idx2]){idx2++;}\n }else{\n if (newArr[newArr.length-1] !== arr1[idx1]){\n newArr.push(arr1[idx1]);\n }\n idx1++;\n idx2++;\n }\n }", "title": "" }, { "docid": "776abb328fb39103a7c1adbf46ee7a2c", "score": "0.63978565", "text": "function intersection(arr1, arr2) {\n let i = 0;\n let j = 0; \n\n let len1 = arr1.length;\n let len2 = arr2.length; \n\n let results = []; \n\n while (i < len1 && j < len2) {\n // walk the smaller value forward\n if (arr1[i] < arr2[j]) {\n i++;\n } else if (arr1[j] > arr2[j]) {\n j++;\n // if they're equal\n } else {\n // check if results already have duplicates\n if (result[result.length - 1] !== arr1[i]) {\n result.push(arr1[i]);\n } else {\n i++;\n j++;\n }\n }\n }\n\n return results;\n}", "title": "" }, { "docid": "98d8677868516f09a1cabdf5f6148285", "score": "0.63933045", "text": "function diffArray(arr1, arr2) {\n let newArr = [];\n let checkArray = function(a1, a2)\n {\n let newArr = [];\n for (let i = 0; i < a1.length; i++)\n {\n if (!a2.includes(a1[i]))\n newArr.push(a1[i]);\n }\n return newArr;\n }\n newArr = checkArray(arr1, arr2).concat(checkArray(arr2, arr1));\n return newArr;\n }", "title": "" }, { "docid": "d6a804114a3094748fd64546633eabfd", "score": "0.63890755", "text": "function mergeArrays(arr1, arr2) {\n let merged = arr1.concat(arr2)\n let sorted = merged.sort((a, b) => a - b );\n let filtered = sorted.filter((element, index, arr) => {\n return !index || element !== arr[index -1]\n })\n filtered\n}", "title": "" }, { "docid": "fd6a974d694fa3410ac2f0248a1c1160", "score": "0.6388237", "text": "function diffArray(arr1, arr2) {\n let newArr1 = arr1.filter(function(x) {\n if (arr2.indexOf(x) === -1) {\n return x\n } //Finding unique value of 1st array\n });\n let newArr2 = arr2.filter(function(y) {\n if (arr1.indexOf(y) === -1) {\n return y\n } //Finding unique value of 2nd array\n });\n return newArr1.concat(newArr2)\n}", "title": "" }, { "docid": "5a0df651e306b5d3926f6dd7feecf57b", "score": "0.63860196", "text": "function diffArrays(A,B){\n var M = A.length, N = B.length, c = 0, C = [];\n\t for (var i = 0; i < M; i++){\n\t \tvar j = 0, k = 0;\n\t while (B[j] !== A[ i ] && j < N) j++;\n\t while (C[k] !== A[ i ] && k < c) k++;\n\t if (j == N && k == c) C[c++] = A[ i ];\n\t }\n\t return C;\n\t}", "title": "" }, { "docid": "5c324f01a98b2bcc6568b264c69c0756", "score": "0.63711226", "text": "function mergeArrays(arr1, arr2) {\n return [...new Set([...arr1, ...arr2])].sort((a, b)=> a - b)\n}", "title": "" }, { "docid": "93a2c1bef8368a0fb6caec6402700f5a", "score": "0.63677806", "text": "function intersect(arr1, arr2) {\r\n let result = [];\r\n\r\n for (let i = 0; i < arr1.length; i++) {\r\n for (let j = 0; j < arr2.length; j++) {\r\n if (Array.isArray(arr1[i]) && Array.isArray(arr2[j])) {\r\n\r\n // If the two arrays are equal in length (Condition 1) AND the union set is the same size (Condition 2)\r\n // Condition 1: not only a requirement for array equality, but also saves an expensive recursive call (see: short-circuit evaluation)\r\n // Condition 2: if the intersection contains the same number of elements as the (equal length) member sets, the arrays represent identical sets\r\n if (arr1[i].length === arr2[j].length && intersect(arr1[i], arr2[j]).length === arr1[i].length) \r\n result.push(arr1[i]);\r\n\r\n // Type-strict equality ensures that if arr1[i] OR arr2[i] is of a reference type, the equality fails\r\n } else if (arr1[i] === arr2[j]) result.push(arr1[i]);\r\n }\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "b2ed9e9aff357307334ee0539c4a6b35", "score": "0.63652766", "text": "function getBiggestArr(arr1, arr2) {\n var arrSize = 0;\n if (arr1.length > arr2.length) {\n arrSize = arr1.length;\n } else if (arr1.length < arr2.length) {\n arrSize = arr2.length;\n } else {\n arrSize = arr1.length;\n }\n return arrSize;\n}", "title": "" }, { "docid": "69bebdde593145754e6d4ffb505c7ed1", "score": "0.63642573", "text": "function diffArray(arr1, arr2) {\n\tvar combo = arr1.concat(arr2) // joins both the arrays\n\n\treturn combo.filter(function (num) {\n\t\tif (arr1.indexOf(num) === -1 || arr2.indexOf(num) === -1) {\n\t\t\treturn num;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d46e333d32cbb8af9109a5d75ca3961b", "score": "0.63617855", "text": "function intersect_arrays(arr1, arr2) {\n // place holder arr for matching values\n var common = [];\n var i = 0;\n var j = 0;\n // while i is less than length of arr1 and arr 2\n while (i < arr1.length\n && j < arr2.length)\n {\n // compare values of 2 indexes in 2 arrays\n if (arr1[i] === arr2[j]) {\n // if its not in common then push\n\n if(){ //check for index of arr in if\n common.push(arr1[i]);\n }\n //common[common.length-1]\n i++;\n j++;\n }\n // increase i\n else if(arr1[i] < arr2[j]) {\n i++;\n }\n // increament j\n else {\n j++;\n }\n }\n // return the placeholder arr\n return common;\n }", "title": "" }, { "docid": "7760d3732a298929ec48dd4af014bfd7", "score": "0.6353229", "text": "function merge(arr1, arr2) {\n let index1 = 0, index2 = 0;\n let merged = [];\n\n while (index1 < arr1.length && index2 < arr2.length) {\n if (arr1[index1] < arr2[index2]) {\n merged.push(arr1[index1]);\n index1++;\n } else {\n merged.push(arr2[index2]);\n index2++;\n }\n }\n\n if (index1 === arr1.length) {\n let temp = arr2.slice(index2);\n merged = merged.concat(temp);\n } else {\n let temp = arr1.slice(index1);\n merged = merged.concat(temp);\n }\n return merged;\n }", "title": "" }, { "docid": "efb834b3f640a633ed0a981b359023bd", "score": "0.6351867", "text": "function diff(arr1, arr2)\n{\n\tlet different = [];\n\t\n\tarr1.map((i) => {\n\t\t\n\t\tif(arr2.indexOf(i) === -1)\n\t\t{\n\t\t\tdifferent.push(i);\n\t\t}\n\t});\n\t\n\tarr2.map((i) => {\n\t\t\n\t\tif(arr1.indexOf(i) === -1)\n\t\t{\n\t\t\tdifferent.push(i);\n\t\t}\n\t});\n\t\n\treturn different;\n}", "title": "" }, { "docid": "e03b67161778df405fb45ece4b58f20e", "score": "0.634501", "text": "function diffArray(arr1, arr2) {\n let a1 = arr1.filter(x => !arr2.includes(x));\n let a2 = arr2.filter(x => !arr1.includes(x));\n return a1.concat(a2);\n}", "title": "" }, { "docid": "4ed137722eb473f3483ad63a9d6015a5", "score": "0.63438976", "text": "function diffArray(arr1, arr2) {\n var newArr = [];\n \n var onlyInFirst = [];\n var onlyInSecond = [];\n\n onlyInFirst = arr1.filter(function isUnic1(val) {\n \n return arr2.indexOf(val) < 0;\n \n });\n\n onlyInSecond = arr2.filter(function isUnic2(val) {\n \n return arr1.indexOf(val) < 0;\n\n });\n\n return onlyInSecond.concat(onlyInFirst);\n}", "title": "" }, { "docid": "a1fd99b266f16b942421e999040e1607", "score": "0.6337981", "text": "function diffArray(arr1, arr2) {\n let combinedArr = [...arr1, ...arr2];\n let part1 = combinedArr.filter((el) => !arr1.includes(el));\n let part2 = combinedArr.filter((el) => !arr2.includes(el));\n return part1.concat(...part2);\n}", "title": "" }, { "docid": "4743174518e1c8f181030a518bc3a83f", "score": "0.63351625", "text": "function unionArr (arr1, arr2) {\n let object = {}\n let result = []\n let twoInOneArr = arr1.concat(arr2)\n\n twoInOneArr.forEach(function (number) {\n if (!object[number]) { object[number] = 0 };\n object[number] += 1\n })\n\n for (let key in object) {\n if (object[key] <= 2) {\n result.push(key)\n }\n }\n return result\n}", "title": "" }, { "docid": "ac20d938275e51353ea56918049ed02d", "score": "0.63312984", "text": "function diffArray(arr1, arr2) {\n return arr1.filter(element => !arr2.includes(element)).concat(arr2.filter(element => !arr1.includes(element)))\n}", "title": "" }, { "docid": "0e077886ebea31bdf5db26812e0dd501", "score": "0.6327557", "text": "function diffArray(arr1, arr2) {\n return arr1\n .filter(el => !arr2.includes(el))\n .concat(\n arr2.filter(el => !arr1.includes(el))\n )\n}", "title": "" }, { "docid": "a035a62e75f495e88521de1ad75af0be", "score": "0.6323317", "text": "function arrayDiff(a1, a2) {\n var o1={}, o2={}, diff=[], i, len, k;\n for (i=0, len=a1.length; i<len; i++) { o1[a1[i]] = true; }\n for (i=0, len=a2.length; i<len; i++) { o2[a2[i]] = true; }\n for (k in o1) { if (!(k in o2)) { diff.push(k); } }\n //for (k in o2) { if (!(k in o1)) { diff.push(k); } }\n return diff;\n}", "title": "" }, { "docid": "13621a15cb57545eb40548f9e48f2dc5", "score": "0.63209003", "text": "function merge(arr1, arr2) {\n let mergedArr = []\n while (arr1.length > 0 && arr2.length > 0) {\n arr1[0] < arr2[0]\n ? mergedArr.push(arr1.shift())\n : mergedArr.push(arr2.shift())\n }\n mergedArr.push(arr1.concat(arr2))\n return mergedArr.flat()\n}", "title": "" }, { "docid": "171a736f2ccd9c6e8819bf1e4c8f7a32", "score": "0.6318232", "text": "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~ ~array1[i] !== ~ ~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "title": "" }, { "docid": "875fe7fcf5e6c008fd7f2848433471fb", "score": "0.6318003", "text": "function unionSort (arr1, arr2) {\n let newArray = []; var i = 0; var j = 0; \n while (i != arr1.length && j != arr2.length) {\n if (arr1[i] < arr2[j]) {\n newArray.push(arr1[i]);\n i++;\n }\n else if (arr1[i] > arr2[j]) {\n newArray.push(arr2[j]);\n j++;\n }\n else if (arr1[i] == arr2[j]) {\n newArray.push(arr1[i]);\n i++;\n j++;\n }\n }\n if (i < arr1.length) {\n for (var x = i; x < arr1.length; i++) {\n newArray.push(arr1[x]);\n }\n }\n if (j < arr2.length) {\n for (var a = j; a < arr2.length; a++) {\n newArray.push(arr2[a]);\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "e047298360871c0a0a02778f3bab680c", "score": "0.63163084", "text": "function similar(arr1, arr2) {\r\nvar arr = arr1.concat(arr2);\r\nvar results = [];\r\nfor (var i = 0; i<arr.length; i++) {\r\n if((results.indexOf(arr[i]) == -1) && (arr.indexOf(arr[i], i + 1) != -1)) {\r\n results.push(arr[i]);\r\n }\r\n}\r\n return results;\r\n}", "title": "" }, { "docid": "1509d6d79f4db5e0c28d7defc0cb42fe", "score": "0.6310829", "text": "function merge(arr1, arr2) {\n let jointArr = []\n for(let i = 0; i < arr1.length; i++){\n jointArr.push(arr1[i])\n }\n for(let i = 0; i < arr2.length; i++){\n jointArr.push(arr2[i])\n }\n return jointArr.sort((a,b) => a-b)\n}", "title": "" }, { "docid": "e59dd4c01f5d37aefe1d1f80488b722e", "score": "0.6302363", "text": "function arraysMatching(arr1, arr2) {\n if (arr1.length !== arr2.length) { return false; }\n\n let cache = {};\n for (let i = 0; i < arr1.length; i++) {\n if (cache[arr1[i]] === undefined) {\n cache[arr1[i]] = 1;\n } else {\n cache[arr1[i]]++;\n }\n }\n\n for (let j = 0; j < arr2.length; j++) {\n if (cache[arr2[j]] === undefined || cache[arr2[j]] === 0) { return false; }\n cache[arr2[j]]--;\n }\n return true;\n}", "title": "" }, { "docid": "6d23dfdd2f58107ffb8d5440d565c263", "score": "0.6298405", "text": "function mergeSortedArray(a1, a2) {\n var i=0,\n j=0,\n newArr=[];\n while(i<a1.length && j<a2.length){\n if(a1[i]>=a2[j]){\n newArr.push(a2[j]);\n j+=1;\n }else{\n newArr.push(a1[i]);\n i+=1;\n }\n }\n if(i>a1.length && j < a2.length){\n return newArr.concat(a2.splice(j,a2.length));\n }else if(i<a1.length && j > a2.length){\n return newArr.concat(a1.splice(i,a1.length));\n }else{\n return newArr;\n }\n}", "title": "" }, { "docid": "7615eedecb0acf14afa09ea42bea6aae", "score": "0.62968636", "text": "function symDiff(arr1, arr2) {\n var results = []; // make empty array for symmetric differences of the arrays\n\n arr1.forEach(function(i) {\n if (arr2.indexOf(i) < 0 && results.indexOf(i) < 0) { // cycle through array and add into results array if the items are only in arr1\n results.push(i);\n }\n });\n\n arr2.forEach(function (i) {\n if (arr1.indexOf(i) < 0 && results.indexOf(i) < 0) { // cycle through array and add into results array if the items are only in arr2\n results.push(i);\n }\n });\n\n return results;\n }", "title": "" }, { "docid": "f17af356436ff2f798cf7ac3921f30ef", "score": "0.62946814", "text": "function merge(arr1, arr2) {\n let merged = [];\n while (arr1.length || arr2.length) {\n let ele1 = arr1.length ? arr1[0] : Infinity;\n let ele2 = arr2.length ? arr2[0] : Infinity;\n let next;\n if (ele1 < ele2) {\n next = arr1.shift();\n } else {\n next = arr2.shift();\n }\n merged.push(next);\n }\n\n return merged;\n}", "title": "" }, { "docid": "a24346d56e9e31335feded1973e8c61d", "score": "0.62923616", "text": "function diffArray(arr1, arr2) {\n var newArr = [];\n\n // ---- using two for eachs\n arr1.forEach(ele => {\n if (!arr2.includes(ele)) {\n newArr.push(ele)\n }\n });\n\n arr2.forEach(ele => {\n if (!arr1.includes(ele)) {\n newArr.push(ele)\n }\n });\n\n return newArr;\n}", "title": "" }, { "docid": "ced72df5e259a279acb934091f4b4739", "score": "0.62882", "text": "function diffArray(arr1, arr2) {\n var newArr = [];\n for (let i = 0; i < arr1.length; i++) {\n if (arr2.indexOf(arr1[i]) == -1) newArr.push(arr1[i]);\n }\n for (let i = 0; i < arr2.length; i++) {\n if (arr1.indexOf(arr2[i]) == -1) newArr.push(arr2[i]);\n }\n return newArr;\n}", "title": "" }, { "docid": "66bec4ac11d715e13dbdbc46f0320aaf", "score": "0.6287613", "text": "function merge(arr1, arr2) {\n let mergedArr = [];\n let pointer1 = 0; // pointer for arr1\n let pointer2 = 0; // pointer for arr2\n\n while (pointer1 < arr1.length && pointer2 < arr2.length) {\n if (arr1[pointer1] < arr2[pointer2]) {\n mergedArr.push(arr1[pointer1]);\n pointer1++;\n } else {\n mergedArr.push(arr2[pointer2]);\n pointer2++;\n }\n }\n\n while (pointer1 < arr1.length) {\n mergedArr.push(arr1[pointer1]);\n pointer1++;\n }\n\n while (pointer2 < arr2.length) {\n mergedArr.push(arr2[pointer2]);\n pointer2++;\n }\n\n return mergedArr;\n}", "title": "" }, { "docid": "da583d38bf57cbf9a504c6e0c0377b83", "score": "0.62847686", "text": "function merger(arr1, arr2){\n let i = 0, j = 0, mergedArr = [];\n\n while (i < arr1.length && j < arr2.length){\n if (arr1[i] > arr2[j]){\n mergedArr.push(arr2[j++])\n } else{\n mergedArr.push(arr1[i++]);\n }\n }\n\n while (i < arr1.length){\n mergedArr.push(arr1[i++]);\n }\n while (j < arr2.length){\n mergedArr.push(arr2[j++]);\n }\n\n return mergedArr;\n}", "title": "" }, { "docid": "f023601b7ac1c0766a8a31c4c0620bc8", "score": "0.6283943", "text": "function merge(array1, array2) {\n let copy1 = array1.slice();\n let copy2 = array2.slice();\n let result = [];\n\n while (copy1.length > 0 && copy2.length > 0) {\n result.push(copy1[0] <= copy2[0] ? copy1.shift() : copy2.shift());\n }\n\n return result.concat(copy1.length === 0 ? copy2 : copy1);\n}", "title": "" }, { "docid": "66842e8a4d29c12bf4ed00a379efad0d", "score": "0.6281894", "text": "function mergeSortedArraysAgain(arr1, arr2) {\n return arr1.concat(arr2).sort((a, b) => a - b);\n}", "title": "" }, { "docid": "86abafb4ffe875e1eb359249cdd3dd7a", "score": "0.62695867", "text": "function diffArray(arr1, arr2) {\n\n let newArr = [];\n\n for(let i = 0; i < arr2.length; i++){\n if(arr1.find(obj => obj == arr2[i]) == undefined){\n \tnewArr.push(arr2[i]);\n }\n }\n \n for(let i = 0; i < arr1.length; i++){\n \tif(arr2.find(obj => obj == arr1[i]) == undefined){\n \tnewArr.push(arr1[i]);\n }\n }\n\n return newArr;\n}", "title": "" }, { "docid": "3411d41ed7f835decc0a62ae57c60da7", "score": "0.6269405", "text": "function distance(arr1, arr2) {\n return arr2.map(function(el, i) {\n return Math.abs(el - arr1[i]);\n });\n}", "title": "" }, { "docid": "f7f84b9f5533f07a295a1a19252c24a4", "score": "0.6262581", "text": "function diffArray(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter((n) => !arr1.includes(n) || !arr2.includes(n));\n}", "title": "" }, { "docid": "2cf0afdf023f7fdc74dcab6ba418d8b6", "score": "0.62595665", "text": "function merge(sortedArr1, sortedArr2) {\n \"use strict\";\n let pointer1 = 0;\n let pointer2 = 0;\n let res = [];\n\n while (pointer1 < sortedArr1.length && pointer2 < sortedArr2.length) {\n if (sortedArr1[pointer1] < sortedArr2[pointer2]) {\n res.push(sortedArr1[pointer1]);\n pointer1++;\n } else {\n res.push(sortedArr2[pointer2]);\n pointer2++;\n }\n }\n\n while (pointer1 < sortedArr1.length) {\n res.push(sortedArr1[pointer1]);\n pointer1++;\n }\n\n while (pointer2 < sortedArr2.length) {\n res.push(sortedArr2[pointer2]);\n pointer2++;\n }\n return res;\n}", "title": "" }, { "docid": "ce1d870965437da20665aa4a808b8d0f", "score": "0.6256765", "text": "function unordered_intersection(arr1, arr2){\n // Like I mentioned, the secret sauce here is a dictionary\n let dict= {};\n // and of course, we need to push the relevant values into an array\n let inter = [];\n\n // Step 1 is relatively simple:\n\n // For each element in arr1, add a key value pair to the dictionary\n // where the key is the element of the array we're looking at,\n // and the value is true. This will come into play later\n for(let i = 0; i < arr1.length; i++) {\n dict[arr1[i]] = true;\n }\n\n // Now, we need to loop through the second array\n for(let i = 0; i < arr2.length; i++) {\n // If there is a key value pair in the dictionary with a key of\n // the element of the array we're looking at, it means it's part of the \n // intersection!\n if(dict[arr2[i]] == true){\n // So we push it into our return array\n inter.push(arr2[i]);\n // And, to avoid duplicate entries being added into our return array,\n // let's flip the value in the dictionary to false.\n dict[arr2[i]] = false;\n }\n }\n\n return inter;\n}", "title": "" }, { "docid": "7813a89d6fe412a22574c8210aaf0876", "score": "0.6256439", "text": "function mergeArrays (arr1, arr2){\n let newArray = [...arr1, ...arr2];\n let left = newArray[0];\n let right = newArray[newArray.length - 1];\n // while (right > left){\n // while (left < right){\n // left++;\n // }\n // while (right > left){\n // right--;\n // }\n // if (right < left){\n // swap(left, right);\n // }\n // left++;\n // right++;\n // }\n\n return newArray.sort(function (a,b){return a - b;});\n}", "title": "" }, { "docid": "e67921b24ecd5d0565fa543c33737f71", "score": "0.6253437", "text": "function diffArray(arr1, arr2) {\n\tvar result = [];\n\n\tfor (var i = 0; i < arr1.length; i++) {\n\t\tif (arr2.indexOf(arr1[i]) === -1) {\n\t\t\tresult.push(arr1[i]);\n\t\t}\n\t}\n\n\tfor (var j = 0; j < arr2.length; j++) {\n\t\tif (arr1.indexOf(arr2[j]) === -1) {\n\t\t\tresult.push(arr2[j]);\n\t\t}\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "4b38c6fafe7d0c201f97f97dd55024c1", "score": "0.62489057", "text": "function diffArray(arr1, arr2) {\n\tlet newArr = [];\n\tarr1.forEach(item => {\n\t\tif (!arr2.includes(item)) {\n\t\t\tnewArr.push(item);\n\t\t}\n\t});\n\tarr2.forEach(item => {\n\t\tif (!arr1.includes(item)) {\n\t\t\tnewArr.push(item);\n\t\t}\n\t});\n\treturn newArr;\n}", "title": "" }, { "docid": "7ebd09e3dfc83399ed895301e5e74b70", "score": "0.6233965", "text": "function findMedianSortedArrays(nums1, nums2) {\n let i1 = 0;\n let i2 = 0;\n let totalLength = nums1.length + nums2.length;\n let target1 = Math.floor((totalLength - 1) / 2);\n let target2 = Math.floor(totalLength / 2);\n let val1 = 0;\n let val2 = 0;\n let pos = 0;\n while (i1 < nums1.length || i2 < nums2.length) {\n if (i1 < nums1.length) {\n if (i2 < nums2.length && nums2[i2] < nums1[i1]) {\n if (pos == target1) {\n val1 = nums2[i2];\n }\n if (pos == target2) {\n val2 = nums2[i2];\n }\n i2 += 1;\n } else {\n if (pos == target1) {\n val1 = nums1[i1];\n }\n if (pos == target2) {\n val2 = nums1[i1];\n }\n i1 += 1;\n }\n } else if (i2 < nums2.length) {\n if (pos == target1) {\n val1 = nums2[i2];\n }\n if (pos == target2) {\n val2 = nums2[i2];\n }\n i2 += 1;\n }\n pos = pos + 1;\n if (pos > target2) {\n break;\n }\n }\n return (val1 + val2) / 2;\n}", "title": "" }, { "docid": "4f23f6208a7cde3c888303ac237172fc", "score": "0.62325054", "text": "function diffArray(arr1, arr2) {\n\tlet newArr = [];\n\tlet array = arr1.concat(arr2).sort();\n\n\tfor (let item of array) {\n\t\tif (item !== array[array.indexOf(item) + 1]) {\n\t\t\tnewArr.push(item);\n\t\t}\n\t}\n\treturn newArr;\n}", "title": "" }, { "docid": "348f14d8a99bb3ad46e437da35b4da1c", "score": "0.6226989", "text": "function mergeSortedArrays(arr1, arr2){\n if(arr1.length===0){\n return arr2\n }\n if(arr2.length===0){\n return arr1\n }\n\n const arr3 = arr1.concat(arr2)\n return arr3.sort((arr1,arr2) => arr1-arr2)\n}", "title": "" }, { "docid": "eeb646c5ca15703e251f0e313d2cd2f5", "score": "0.6225766", "text": "function compareArrays(array1, array2) {\n var len = Math.min(array1.length, array2.length),\n lengthDiff = Math.abs(array1.length - array2.length),\n diffs = 0,\n i;\n for (i = 0; i < len; i++) {\n if (~~array1[i] !== ~~array2[i]) {\n diffs++;\n }\n }\n return diffs + lengthDiff;\n }", "title": "" }, { "docid": "2d5892cd53c460d25403b6e1dbeb15eb", "score": "0.62254375", "text": "function intersect(arr1,arr2){\n var newArr = [];\n var start = 0;\n for(let i=0;i<arr1.length;i++){\n for(let j=start;j<arr2.length;j++){\n if(arr1[i]==arr2[j]){\n newArr.push(arr1[i]);\n start = j+1\n break\n }\n }\n }\n return newArr\n}", "title": "" }, { "docid": "c04c44bdcf89e5ffc607db7a64d8ab2d", "score": "0.62245655", "text": "function diffArray(arr1, arr2) {\n // const newArr = [];\n\n // for (let i = 0; i < arr1.length; i++) {\n // for (let j = 0; j < arr2.length; j++) {\n // if (arr1[i] === arr2[j]) {\n // newArr.push(arr1[i]);\n // }\n // union.push(arr2[j]);\n // }\n // }\n // return newArr;\n\n const union = []; // unique arr with elements from two arrays\n\n const union2 = new Set([...arr1, ...arr2]);\n // console.log(\">>>\", union2);\n // this ECMA6 set does the below by single line\n\n for (let i = 0; i < arr1.length; i++) {\n if (!union.includes(arr1[i])) {\n union.push(arr1[i]);\n }\n }\n\n for (let i = 0; i < arr2.length; i++) {\n if (!union.includes(arr2[i])) {\n union.push(arr2[i]);\n }\n }\n // return union;\n\n const symDiff = [];\n\n for (let i = 0; i < union.length; i++) {\n let curr = union[i];\n\n if (arr1.includes(curr) && !arr2.includes(curr)) {\n symDiff.push(curr);\n } else if (!arr1.includes(curr) && arr2.includes(curr)) {\n symDiff.push(curr);\n }\n }\n return symDiff;\n}", "title": "" }, { "docid": "6b00e89b9b56cc29a93947e7e5809fc2", "score": "0.6209962", "text": "function merge(arr1, arr2) { // arr1 and arr2 are two sorted arrays\n var sortedArr = []; \n while (arr1.length != 0 && arr2.length != 0) {\n if (arr1[0].fitness > arr2[0].fitness) {\n if ((arr1[0].fitness) > bestGenome.fitness) { // Highest to lowest sorting\n bestGenome = arr1[0]; \n }\n sortedArr.push(arr1.shift()); \n } else {\n sortedArr.push(arr2.shift());\n }\n }\n while (arr1.length != 0) {\n sortedArr.push(arr1.shift());\n }\n while (arr2.length != 0) {\n sortedArr.push(arr2.shift());\n }\n return sortedArr;\n }", "title": "" } ]
c0b049fd3e51421929211a2e04d66ef9
Computes an "ideal" category based on the absolute bar thickness or, if undefined or null, uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This mode currently always generates bars equally sized (until we introduce scriptable options?).
[ { "docid": "979a68d93ef19f4aa7316c327b590809", "score": "0.6180315", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" } ]
[ { "docid": "e591baace59f20a7cd3b99026add433d", "score": "0.6311267", "text": "function computeFitCategoryTraits(index,ruler,options){var thickness=options.barThickness;var count=ruler.stackCount;var curr=ruler.pixels[index];var size,ratio;if(helpers.isNullOrUndef(thickness)){size=ruler.min*options.categoryPercentage;ratio=options.barPercentage;}else{// When bar thickness is enforced, category and bar percentages are ignored.\n// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n// and deprecate barPercentage since this value is ignored when thickness is absolute.\nsize=thickness*count;ratio=1;}return{chunk:size/count,ratio:ratio,start:curr-size/2};}", "title": "" }, { "docid": "37a7576b7487e1861265dcab08aa13b3", "score": "0.63038397", "text": "function computeFitCategoryTraits(index,ruler,options){var thickness=options.barThickness;var count=ruler.stackCount;var curr=ruler.pixels[index];var min=helpers$1.isNullOrUndef(thickness)?computeMinSampleSize(ruler.scale,ruler.pixels):-1;var size,ratio;if(helpers$1.isNullOrUndef(thickness)){size=min*options.categoryPercentage;ratio=options.barPercentage;}else{// When bar thickness is enforced, category and bar percentages are ignored.\n// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n// and deprecate barPercentage since this value is ignored when thickness is absolute.\nsize=thickness*count;ratio=1;}return{chunk:size/count,ratio:ratio,start:curr-size/2};}", "title": "" }, { "docid": "f59decfe97b24a178ad1339cfc33b572", "score": "0.6303677", "text": "function computeFitCategoryTraits(index, ruler, options) {\n \tvar thickness = options.barThickness;\n \tvar count = ruler.stackCount;\n \tvar curr = ruler.pixels[index];\n \tvar min = helpers$1.isNullOrUndef(thickness)\n \t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n \t\t: -1;\n \tvar size, ratio;\n\n \tif (helpers$1.isNullOrUndef(thickness)) {\n \t\tsize = min * options.categoryPercentage;\n \t\tratio = options.barPercentage;\n \t} else {\n \t\t// When bar thickness is enforced, category and bar percentages are ignored.\n \t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n \t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n \t\tsize = thickness * count;\n \t\tratio = 1;\n \t}\n\n \treturn {\n \t\tchunk: size / count,\n \t\tratio: ratio,\n \t\tstart: curr - (size / 2)\n \t};\n }", "title": "" }, { "docid": "ea613aec61167c517c8e2701aab6c1e7", "score": "0.6276166", "text": "function computeFitCategoryTraits(index, ruler, options) {\r\n\tvar thickness = options.barThickness;\r\n\tvar count = ruler.stackCount;\r\n\tvar curr = ruler.pixels[index];\r\n\tvar size, ratio;\r\n\r\n\tif (helpers.isNullOrUndef(thickness)) {\r\n\t\tsize = ruler.min * options.categoryPercentage;\r\n\t\tratio = options.barPercentage;\r\n\t} else {\r\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\r\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\r\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\r\n\t\tsize = thickness * count;\r\n\t\tratio = 1;\r\n\t}\r\n\r\n\treturn {\r\n\t\tchunk: size / count,\r\n\t\tratio: ratio,\r\n\t\tstart: curr - (size / 2)\r\n\t};\r\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "77d810a15d02987062dad5c745e79d0d", "score": "0.61936396", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar min = helpers$1.isNullOrUndef(thickness)\n\t\t? computeMinSampleSize(ruler.scale, ruler.pixels)\n\t\t: -1;\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "7c71f0b3f595985511ec3fbc69799b8f", "score": "0.61592805", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "7c71f0b3f595985511ec3fbc69799b8f", "score": "0.61592805", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "7c71f0b3f595985511ec3fbc69799b8f", "score": "0.61592805", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "7c71f0b3f595985511ec3fbc69799b8f", "score": "0.61592805", "text": "function computeFitCategoryTraits(index, ruler, options) {\n\tvar thickness = options.barThickness;\n\tvar count = ruler.stackCount;\n\tvar curr = ruler.pixels[index];\n\tvar size, ratio;\n\n\tif (helpers$1.isNullOrUndef(thickness)) {\n\t\tsize = ruler.min * options.categoryPercentage;\n\t\tratio = options.barPercentage;\n\t} else {\n\t\t// When bar thickness is enforced, category and bar percentages are ignored.\n\t\t// Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n\t\t// and deprecate barPercentage since this value is ignored when thickness is absolute.\n\t\tsize = thickness * count;\n\t\tratio = 1;\n\t}\n\n\treturn {\n\t\tchunk: size / count,\n\t\tratio: ratio,\n\t\tstart: curr - (size / 2)\n\t};\n}", "title": "" }, { "docid": "6a43b163d4055090265de8f38da6365d", "score": "0.60098654", "text": "function computeFlexCategoryTraits(index,ruler,options){var pixels=ruler.pixels;var curr=pixels[index];var prev=index>0?pixels[index-1]:null;var next=index<pixels.length-1?pixels[index+1]:null;var percent=options.categoryPercentage;var start,size;if(prev===null){// first data: its size is double based on the next point or,\n// if it's also the last data, we use the scale size.\nprev=curr-(next===null?ruler.end-ruler.start:next-curr);}if(next===null){// last data: its size is also double based on the previous point.\nnext=curr+curr-prev;}start=curr-(curr-Math.min(prev,next))/2*percent;size=Math.abs(next-prev)/2*percent;return{chunk:size/ruler.stackCount,ratio:options.barPercentage,start:start};}", "title": "" }, { "docid": "736504ac1e0d48c58b6edee1ad944241", "score": "0.59348345", "text": "function computeFlexCategoryTraits(index,ruler,options){var pixels=ruler.pixels;var curr=pixels[index];var prev=index>0?pixels[index-1]:null;var next=index<pixels.length-1?pixels[index+1]:null;var percent=options.categoryPercentage;var start,size;if(prev===null){// first data: its size is double based on the next point or,\n// if it's also the last data, we use the scale end extremity.\nprev=curr-(next===null?ruler.end-curr:next-curr);}if(next===null){// last data: its size is also double based on the previous point.\nnext=curr+curr-prev;}start=curr-(curr-prev)/2*percent;size=(next-prev)/2*percent;return{chunk:size/ruler.stackCount,ratio:options.barPercentage,start:start};}", "title": "" }, { "docid": "3d1c3243d64a3c096fefadb49e2d0b45", "score": "0.5894733", "text": "function computeFlexCategoryTraits(index, ruler, options) {\r\n\tvar pixels = ruler.pixels;\r\n\tvar curr = pixels[index];\r\n\tvar prev = index > 0 ? pixels[index - 1] : null;\r\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\r\n\tvar percent = options.categoryPercentage;\r\n\tvar start, size;\r\n\r\n\tif (prev === null) {\r\n\t\t// first data: its size is double based on the next point or,\r\n\t\t// if it's also the last data, we use the scale end extremity.\r\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\r\n\t}\r\n\r\n\tif (next === null) {\r\n\t\t// last data: its size is also double based on the previous point.\r\n\t\tnext = curr + curr - prev;\r\n\t}\r\n\r\n\tstart = curr - ((curr - prev) / 2) * percent;\r\n\tsize = ((next - prev) / 2) * percent;\r\n\r\n\treturn {\r\n\t\tchunk: size / ruler.stackCount,\r\n\t\tratio: options.barPercentage,\r\n\t\tstart: start\r\n\t};\r\n}", "title": "" }, { "docid": "fdb47ac0f4d624a56bda961de114ef58", "score": "0.584715", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n \tvar pixels = ruler.pixels;\n \tvar curr = pixels[index];\n \tvar prev = index > 0 ? pixels[index - 1] : null;\n \tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n \tvar percent = options.categoryPercentage;\n \tvar start, size;\n\n \tif (prev === null) {\n \t\t// first data: its size is double based on the next point or,\n \t\t// if it's also the last data, we use the scale size.\n \t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n \t}\n\n \tif (next === null) {\n \t\t// last data: its size is also double based on the previous point.\n \t\tnext = curr + curr - prev;\n \t}\n\n \tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n \tsize = Math.abs(next - prev) / 2 * percent;\n\n \treturn {\n \t\tchunk: size / ruler.stackCount,\n \t\tratio: options.barPercentage,\n \t\tstart: start\n \t};\n }", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "f3816b5b6d717b91f00fa20a5b66a7b5", "score": "0.5820868", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale size.\n\t\tprev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - (curr - Math.min(prev, next)) / 2 * percent;\n\tsize = Math.abs(next - prev) / 2 * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "07db81e36bb035bcd20d3dd0614664b6", "score": "0.5819418", "text": "function getBarDimensions(filteredData, accessSeriesData, accessor, c, scale, chartWidth) {\n\n // minimum scale distance between any two adjacent bars visible within the current domain.\n var width,\n minRangeMargin = null,\n domainExtent = null,\n gap = 0,\n outerGap = 0\n\n\n if( scale.rangeBand ) {\n width = c.width === 'auto' ? scale.rangeBand() : c.width\n if( debug)\n console.log( 'getBarDimmensions scale.rangeBand width ' + width + ', domain ' + JSON.stringify(scale.domain()) + ', range ' + JSON.stringify(scale.range()))\n // gap isn't known with range bands\n } else {\n var scaleDomain = scale.domain(),\n // Find the data indices (across all series) for what's visible with current domain.\n indicesExtents = filteredData.map(function(s) { return trait.chart.utils.dataIndicesExtentForDomainExtent(accessSeriesData(s), accessor, scaleDomain) }),\n // Get the minimum distance between bar centers across all data in all series\n minDistanceX = d3.min(filteredData, function(s, i) { return trait.chart.utils.minDistanceBetween(accessSeriesData(s), indicesExtents[i], accessor, scale) })\n\n width = c.width === 'auto' ? Math.max(1, Math.floor(minDistanceX * (1 - c.gap))) : c.width\n gap = Math.round(width * c.gap)\n outerGap = Math.floor(width * c.outerGap)\n\n // Get the minimun distance between bar centers across all data in all series\n var rangeExtent = rangeExtentOfBarsAndOuterGap(filteredData, indicesExtents, accessSeriesData, accessor, scale, width, gap, outerGap, c.justification),\n min = rangeExtent[0],\n max = rangeExtent[1]\n //console.log( \"minDistanceX: \" + minDistanceX + \" width: \" + width + \" rangeExtent: \" + rangeExtent)\n\n if( min < 0 || max > chartWidth ) {\n\n if( c.insets === INSETS_INSET_RANGE ) {\n // Careful, one bar may be within chart and one bar off chart.\n var totalWidth = Math.max(max, chartWidth) - Math.min(0, min),\n scaleItDown = chartWidth / totalWidth\n\n if( c.width === 'auto' ) {\n width = Math.max(1, Math.floor(width * scaleItDown))\n gap = Math.round(width * c.gap)\n outerGap = Math.floor(width * c.outerGap)\n }\n\n if( c.insets === INSETS_INSET_RANGE ) {\n rangeExtent = rangeExtentOfBarsAndOuterGap(filteredData, indicesExtents, accessSeriesData, accessor, scale, width, gap, outerGap, c.justification)\n min = rangeExtent[0]\n max = rangeExtent[1]\n\n if( min < 0 || max > chartWidth ) {\n minRangeMargin = {}\n if( min < 0 )\n minRangeMargin.left = 1 - min\n if( max > chartWidth )\n minRangeMargin.right = max - chartWidth\n }\n }\n } else if( c.insets === INSETS_EXTEND_DOMAIN ) {\n var domainMin = min < 0 ? scale.invert(min) : scaleDomain[0] ,\n domainMax = max > chartWidth ? scale.invert(max) : scaleDomain[ scaleDomain.length - 1]\n domainExtent = [domainMin, domainMax]\n }\n\n }\n\n }\n\n var offset = barOffsetForJustification(c.justification, width, gap)\n\n //console.log( \"barDimensions: width, gap, offset: \" + width + \", \" + gap + \", \" + offset)\n\n return {\n width: width,\n gap: gap,\n outerGap: outerGap,\n offset: offset,\n domainExtent: domainExtent,\n minRangeMargin: minRangeMargin\n }\n }", "title": "" }, { "docid": "519c6f36acd69376a92f6fcc88eb42bb", "score": "0.5769398", "text": "function normalizeBars(gd, sa, sieve) {\n var fullLayout = gd._fullLayout;\n var calcTraces = sieve.traces;\n var sLetter = getAxisLetter(sa);\n var sTop = fullLayout.barnorm === 'fraction' ? 1 : 100;\n var sTiny = sTop / 1e9; // in case of rounding error in sum\n var sMin = sa.l2c(sa.c2l(0));\n var sMax = fullLayout.barmode === 'stack' ? sTop : sMin;\n\n function needsPadding(v) {\n return (\n isNumeric(sa.c2l(v)) &&\n ((v < sMin - sTiny) || (v > sMax + sTiny) || !isNumeric(sMin))\n );\n }\n\n for(var i = 0; i < calcTraces.length; i++) {\n var calcTrace = calcTraces[i];\n var fullTrace = calcTrace[0].trace;\n var pts = [];\n var allBarBaseAboveZero = true;\n var padded = false;\n\n for(var j = 0; j < calcTrace.length; j++) {\n var bar = calcTrace[j];\n\n if(bar.s !== BADNUM) {\n var scale = Math.abs(sTop / sieve.get(bar.p, bar.s));\n bar.b *= scale;\n bar.s *= scale;\n\n var barBase = bar.b;\n var barTop = barBase + bar.s;\n\n bar[sLetter] = barTop;\n pts.push(barTop);\n padded = padded || needsPadding(barTop);\n\n if(bar.hasB) {\n pts.push(barBase);\n padded = padded || needsPadding(barBase);\n }\n\n if(!bar.hasB || !(bar.b > 0 && bar.s > 0)) {\n allBarBaseAboveZero = false;\n }\n }\n }\n\n fullTrace._extremes[sa._id] = Axes.findExtremes(sa, pts, {\n tozero: !allBarBaseAboveZero,\n padded: padded\n });\n }\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "2a058bb1bb05a5c9411e6bc68c2cc644", "score": "0.57403964", "text": "function computeFlexCategoryTraits(index, ruler, options) {\n\tvar pixels = ruler.pixels;\n\tvar curr = pixels[index];\n\tvar prev = index > 0 ? pixels[index - 1] : null;\n\tvar next = index < pixels.length - 1 ? pixels[index + 1] : null;\n\tvar percent = options.categoryPercentage;\n\tvar start, size;\n\n\tif (prev === null) {\n\t\t// first data: its size is double based on the next point or,\n\t\t// if it's also the last data, we use the scale end extremity.\n\t\tprev = curr - (next === null ? ruler.end - curr : next - curr);\n\t}\n\n\tif (next === null) {\n\t\t// last data: its size is also double based on the previous point.\n\t\tnext = curr + curr - prev;\n\t}\n\n\tstart = curr - ((curr - prev) / 2) * percent;\n\tsize = ((next - prev) / 2) * percent;\n\n\treturn {\n\t\tchunk: size / ruler.stackCount,\n\t\tratio: options.barPercentage,\n\t\tstart: start\n\t};\n}", "title": "" }, { "docid": "1a8ed5b6522ecacc67aee101e7192ada", "score": "0.56178004", "text": "function prepareBarLength(itemModel,symbolRepeat,layout,opt,output){\nvar valueDim=opt.valueDim;\nvar symbolBoundingData=itemModel.get('symbolBoundingData');\nvar valueAxis=opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\nvar zeroPx=valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\nvar pxSignIdx=1-+(layout[valueDim.wh]<=0);\nvar boundingLength;\n\nif(isArray(symbolBoundingData)){\nvar symbolBoundingExtent=[\nconvertToCoordOnAxis(valueAxis,symbolBoundingData[0])-zeroPx,\nconvertToCoordOnAxis(valueAxis,symbolBoundingData[1])-zeroPx];\n\nsymbolBoundingExtent[1]<symbolBoundingExtent[0]&&symbolBoundingExtent.reverse();\nboundingLength=symbolBoundingExtent[pxSignIdx];\n}else\nif(symbolBoundingData!=null){\nboundingLength=convertToCoordOnAxis(valueAxis,symbolBoundingData)-zeroPx;\n}else\nif(symbolRepeat){\nboundingLength=opt.coordSysExtent[valueDim.index][pxSignIdx]-zeroPx;\n}else\n{\nboundingLength=layout[valueDim.wh];\n}\n\noutput.boundingLength=boundingLength;\n\nif(symbolRepeat){\noutput.repeatCutLength=layout[valueDim.wh];\n}\n\noutput.pxSign=boundingLength>0?1:boundingLength<0?-1:0;\n}", "title": "" }, { "docid": "cc9de400c1baaf9bcfe77e0733d407ab", "score": "0.5561485", "text": "function _default(specContext) {\n const {\n insight,\n specColumns,\n specViewOptions\n } = specContext;\n const {\n language\n } = specViewOptions;\n const bandProps = {\n orientation: 'horizontal',\n groupby: {\n column: specColumns.y,\n defaultBins: _defaults.defaultBins,\n maxbinsSignalName: _constants.SignalNames.YBins,\n maxbinsSignalDisplayName: specContext.specViewOptions.language.YMaxBins,\n maxbins: _defaults.maxbins\n },\n minBandWidth: _defaults.minBarBandWidth,\n showAxes: true\n };\n const x = {\n title: null\n };\n const axisScales = {\n x,\n y: {\n title: specColumns.y && specColumns.y.name\n },\n z: {\n title: specColumns.z && specColumns.z.name\n }\n };\n const layouts = [{\n layoutClass: _band.Band,\n props: bandProps\n }];\n\n if (insight.totalStyle === 'sum-strip-percent') {\n x.aggregate = 'percent';\n x.title = language.percent;\n const stripProps = {\n addPercentageScale: true,\n sortOrder: 'ascending',\n orientation: 'horizontal',\n size: specColumns.size,\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n } else {\n const aggProps = {\n niceScale: true,\n dock: 'left',\n globalAggregateMaxExtentSignal: 'aggMaxExtent',\n globalAggregateMaxExtentScaledSignal: 'aggMaxExtentScaled',\n sumBy: specColumns.size,\n showAxes: true\n };\n layouts.push({\n layoutClass: _aggregateContainer.AggregateContainer,\n props: aggProps\n });\n\n switch (insight.totalStyle) {\n case 'sum-treemap':\n {\n x.aggregate = 'sum';\n x.title = language.sum;\n const treemapProps = {\n corner: 'top-left',\n size: specColumns.size,\n treeMapMethod: specViewOptions.language.treeMapMethod,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _treemap.Treemap,\n props: treemapProps\n });\n break;\n }\n\n case 'sum-strip':\n {\n x.aggregate = 'sum';\n x.title = language.sum;\n const stripProps = {\n sortOrder: 'ascending',\n orientation: 'horizontal',\n size: specColumns.size,\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n break;\n }\n\n case 'count-strip':\n {\n x.aggregate = 'count';\n x.title = language.count;\n const stripProps = {\n sortOrder: 'ascending',\n orientation: 'horizontal',\n size: specColumns.size,\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n break;\n }\n\n default:\n {\n x.aggregate = 'count';\n x.title = language.count;\n const squareProps = {\n sortBy: specColumns.sort,\n fillDirection: 'down-right',\n z: specColumns.z,\n maxGroupedUnits: aggProps.globalAggregateMaxExtentSignal,\n maxGroupedFillSize: aggProps.globalAggregateMaxExtentScaledSignal\n };\n layouts.push({\n layoutClass: _square.Square,\n props: squareProps\n });\n break;\n }\n }\n }\n\n return {\n axisScales,\n layouts,\n specCapabilities: {\n countsAndSums: true,\n percentage: true,\n roles: [{\n role: 'y',\n binnable: true,\n axisSelection: specColumns.y && specColumns.y.quantitative ? 'range' : 'exact',\n signals: [_constants.SignalNames.YBins]\n }, {\n role: 'z',\n allowNone: true\n }, {\n role: 'color',\n allowNone: true\n }, {\n role: 'sort',\n allowNone: true\n }, {\n role: 'size',\n allowNone: true,\n excludeCategoric: true,\n signals: [_constants.SignalNames.TreeMapMethod]\n }, {\n role: 'facet',\n allowNone: true,\n signals: [_constants.SignalNames.FacetBins]\n }, {\n role: 'facetV',\n allowNone: true,\n signals: [_constants.SignalNames.FacetVBins]\n }]\n }\n };\n}", "title": "" }, { "docid": "00ca8695f538e5fc062e69d8c70e076c", "score": "0.5466749", "text": "function measure() {\n\t\t\n\t\t// Call our validate routine and make sure all component properties have been set\n\t\tviz.validate();\n\t\t\n\t\t// Get our size based on height, width, and margin\n\t\tsize = vizuly2.util.size(scope.margin, scope.width, scope.height, scope.parent);\n\t\t\n\t\t//If we have fixed bar width then we will override the width of the component\n\t\tif (scope.barWidth != 'auto') {\n\t\t\tbarWidth = scope.barWidth;\n\t\t\tbarPadding = calculateBarPadding(scope.barPadding, barWidth);\n\t\t\tgroupWidth = (scope.layout == vizuly2.viz.layout.STACKED) ? (barWidth + barPadding) : (barWidth + barPadding) * scope.data.length;\n\t\t\tgroupPadding = calculateGroupPadding(scope.groupPadding, groupWidth);\n\t\t\tsize.width = (groupWidth + groupPadding) * scope.data[0].length;\n\t\t\tsize.left = (size.measuredWidth - size.width)/2;\n\t\t\tsize.right = size.left;\n\t\t}\n\t\telse {\n\t\t\t// The width of each group of bars for a given data point and all of series\n\t\t\tgroupWidth = (size.width / scope.data[0].length) * .9;\n\t\t\tgroupPadding = calculateGroupPadding(scope.groupPadding, groupWidth);\n\t\t\tgroupWidth = groupWidth - groupPadding;\n\t\t\t// The width of an individual bar for a given data point a single series\n\t\t\tbarWidth = (scope.layout == vizuly2.viz.layout.STACKED) ? groupWidth : (groupWidth / scope.data.length);\n\t\t\tbarPadding = calculateBarPadding((scope.layout == vizuly2.viz.layout.STACKED) ? 0 : scope.barPadding, barWidth);\n\t\t\tif (barPadding > barWidth) barPadding = barWidth-2;\n\t\t\tbarWidth = barWidth - barPadding;\n\t\t}\n\t\t\n\t\t\n\t\t// If we don't have a defined x-scale then determine one\n\t\tif (scope.xScale == 'undefined') {\n\t\t\tscope.xScale = vizuly2.util.getTypedScale(viz.x()(scope.data[0][0]));\n\t\t}\n\t\t\n\t\t// Set our domains for the yScale (categories)\n\t\t// Assumes ordinal scale if we have a string, otherwise min and max will do;\n\t\tif (typeof scope.x(scope.data[0][0]) == 'string') {\n\t\t\tscope.xScale.domain(scope.data[0].map(function (d) {\n\t\t\t\treturn scope.x(d);\n\t\t\t}));\n\t\t}\n\t\telse {\n\t\t\tscope.xScale.domain([\n\t\t\t\td3.min(scope.data[0],\n\t\t\t\t function (d) {\n\t\t\t\t\t return scope.x(d);\n\t\t\t\t }),\n\t\t\t\td3.max(scope.data[0], function (d) {\n\t\t\t\t\treturn scope.x(d);\n\t\t\t\t})\n\t\t\t]);\n\t\t}\n\t\t\n\t\t// This assumes all series share the same key value for the x-axis and are ordered accordingly.\n\t\tstackSeries = [];\n\t\tvar stackKeys = [];\n\t\t\n\t\tscope.data.forEach(function (series, i) {\n\t\t\tstackKeys.push('series' + i);\n\t\t})\n\t\t\n\t\tfor (var columnIndex = 0; columnIndex < scope.data[0].length; columnIndex++) {\n\t\t\tvar row = {};\n\t\t\tscope.data.forEach(function (series, i) {\n\t\t\t\trow['series' + i] = {}\n\t\t\t\trow['series' + i].data = series[columnIndex];\n\t\t\t})\n\t\t\tstackSeries.push(row);\n\t\t}\n\t\t\n\t\tvar offset = (scope.layout == vizuly2.viz.layout.STACKED) ? d3.stackOffsetDiverging : vizuly2.util.stackOffsetBaseline;\n\t\t\n\t\t// The d3.stack handles all of the d.x and d.y measurements for various stack layouts - we will let it do its magic here\n\t\tstack = d3.stack()\n\t\t .value(function (d, i) {\n\t\t\t var datum = d[i].data;\n\t\t\t return scope.y(datum);\n\t\t })\n\t\t .keys(stackKeys)\n\t\t .offset(offset);\n\t\t\n\t\t// Apply the stack magic to our data - note this is a destructive operation and assumes certain properties can be mutated (x, x0, y, y0)\n\t\tstackSeries = stack(stackSeries);\n\t\t\n\t\t// We set our xScale domain based on whether we have a stacked or clustered layout\n\t\tscope.yScale.domain([\n\t\t\tMath.min(0, d3.min(stackSeries, function (series) { return d3.min(series, function (d) { return (scope.layout == vizuly2.viz.layout.STACKED && stackSeries.length > 1) ? d[0] : d[1]; })})),\n\t\t\td3.max(stackSeries, function (series) { return d3.max(series, function (d) { return d[1]; })})\n\t\t]);\n\t\t\n\t\t// Set our ranges for each scale\n\t\tscope.yScale.range([size.height, 0]);\n\t\t\n\t\tseriesOffset = 0;\n\t\t\n\t\tvar xScaleOffset = 0;\n\t\t\n\t\tif (typeof scope.xScale.clamp != 'undefined') {\n\t\t\tseriesOffset = (groupWidth + groupPadding)/2;\n\t\t\txScaleOffset = groupWidth;\n\t\t}\n\t\t\n\t\tscope.xScale.range([0, size.width - xScaleOffset]);\n\t\t\n\t\tscope.xAxis.scale(scope.xScale);\n\t\tscope.yAxis.scale(scope.yScale);\n\t\t\n\t\tscope.xAxis.tickFormat(scope.xTickFormat).tickSize(-size.height);\n\t\tscope.yAxis.tickFormat(scope.yTickFormat).tickSize(-size.width).ticks(5);\n\t\t\n\t\tscope.size = size;\n\t\t\n\t\t// Tell everyone we are done making our measurements\n\t\tscope.dispatch.apply('measured', viz);\n\t}", "title": "" }, { "docid": "adf32863e18b0565ae27b92ca5d35f85", "score": "0.54568905", "text": "function _default(specContext) {\n const {\n insight,\n specColumns,\n specViewOptions\n } = specContext;\n const {\n language\n } = specViewOptions;\n const bandProps = {\n orientation: 'vertical',\n groupby: {\n column: specColumns.x,\n defaultBins: _defaults.defaultBins,\n maxbinsSignalName: _constants.SignalNames.XBins,\n maxbinsSignalDisplayName: specContext.specViewOptions.language.XMaxBins,\n maxbins: _defaults.maxbins\n },\n minBandWidth: _defaults.minBarBandWidth,\n showAxes: true\n };\n const y = {\n title: null\n };\n const axisScales = {\n x: {\n title: specColumns.x && specColumns.x.name\n },\n y,\n z: {\n title: specColumns.z && specColumns.z.name\n }\n };\n const layouts = [{\n layoutClass: _band.Band,\n props: bandProps\n }];\n\n if (insight.totalStyle === 'sum-strip-percent') {\n y.aggregate = 'percent';\n y.title = language.percent;\n const stripProps = {\n addPercentageScale: true,\n sortOrder: 'descending',\n orientation: 'vertical',\n size: specColumns.size,\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n } else {\n const aggProps = {\n niceScale: true,\n dock: 'bottom',\n globalAggregateMaxExtentSignal: 'aggMaxExtent',\n globalAggregateMaxExtentScaledSignal: 'aggMaxExtentScaled',\n sumBy: specColumns.size,\n showAxes: true\n };\n layouts.push({\n layoutClass: _aggregateContainer.AggregateContainer,\n props: aggProps\n });\n\n switch (insight.totalStyle) {\n case 'sum-treemap':\n {\n y.aggregate = 'sum';\n y.title = language.sum;\n const treemapProps = {\n corner: 'bottom-left',\n size: specColumns.size,\n treeMapMethod: specViewOptions.language.treeMapMethod,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _treemap.Treemap,\n props: treemapProps\n });\n break;\n }\n\n case 'sum-strip':\n {\n y.aggregate = 'sum';\n y.title = language.sum;\n const stripProps = {\n sortOrder: 'descending',\n orientation: 'vertical',\n size: specColumns.size,\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n break;\n }\n\n case 'count-strip':\n {\n y.aggregate = 'count';\n y.title = language.count;\n const stripProps = {\n sortOrder: 'descending',\n orientation: 'vertical',\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n break;\n }\n\n default:\n {\n y.aggregate = 'count';\n y.title = language.count;\n const squareProps = {\n sortBy: specColumns.sort,\n fillDirection: 'right-up',\n z: specColumns.z,\n maxGroupedUnits: aggProps.globalAggregateMaxExtentSignal,\n maxGroupedFillSize: aggProps.globalAggregateMaxExtentScaledSignal\n };\n layouts.push({\n layoutClass: _square.Square,\n props: squareProps\n });\n break;\n }\n }\n }\n\n return {\n axisScales,\n layouts,\n specCapabilities: {\n countsAndSums: true,\n percentage: true,\n roles: [{\n role: 'x',\n binnable: true,\n axisSelection: specColumns.x && specColumns.x.quantitative ? 'range' : 'exact',\n signals: [_constants.SignalNames.XBins]\n }, {\n role: 'z',\n allowNone: true\n }, {\n role: 'color',\n allowNone: true\n }, {\n role: 'sort',\n allowNone: true\n }, {\n role: 'size',\n allowNone: true,\n excludeCategoric: true,\n signals: [_constants.SignalNames.TreeMapMethod]\n }, {\n role: 'facet',\n allowNone: true,\n signals: [_constants.SignalNames.FacetBins]\n }, {\n role: 'facetV',\n allowNone: true,\n signals: [_constants.SignalNames.FacetVBins]\n }]\n }\n };\n}", "title": "" }, { "docid": "350e8f38c5967f5630d720adf5e3a6b3", "score": "0.5445359", "text": "function maybeScaleInterval(interval) {\n\t if (!self.hasBounds()) return interval;\n\t\n\t var maxLength = config.get('histogram:maxBars');\n\t var approxLen = duration / interval;\n\t var scaled = undefined;\n\t\n\t if (approxLen > maxLength) {\n\t scaled = calcAuto.lessThan(maxLength, duration);\n\t } else {\n\t return interval;\n\t }\n\t\n\t if (+scaled === +interval) return interval;\n\t\n\t decorateInterval(interval);\n\t return _lodash2['default'].assign(scaled, {\n\t preScaled: interval,\n\t scale: interval / scaled,\n\t scaled: true\n\t });\n\t }", "title": "" }, { "docid": "6b9c39ff624850024d501fcd4e0cb14f", "score": "0.54202616", "text": "function initializeBars(comparable) {\n// We create a new element using jQuery. We can style it in CSS using the .bar-chart class.\n $('.sandbox').append('<div class=\"bar-chart\"></div>');\n\n// We reduce our comparable to yearly totals\n yearTotals = _.map(comparable, function(obj,iter){\n var valueArray = _.pluck(obj.stats, \"value\");\n return (_.reduce(valueArray, function(memo,num) { return memo + num})/valueArray.length).toFixed(2);\n }); //_.map\n\n// For each of this yearly totals, create a bar in our new bar chart.\n $.each(yearTotals, function(key,value){\n $('.bar-chart').append('<div class=\"bar\" data-index=\"'+comparable[key].id+'\" data-value=\"'+value+'\"><span><em>' + comparable[key].id + ':</em> <strong>' + commafy(value) + '</strong></span></div>');\n }); //each yearTotals\n//////// Step 1A: Make the length of each bar relative to its $ spent\n relativeBarWidths();\n\n//////// Step 1B: Drop another level of metrics in: a breakdown of the yearly spend\n createLegend(comparable);\n applyCategories(comparable);\n\n//////// Step 1C: Make the width of each category proportional to \n setCategoryWidths();\n setCategoryRatios(comparable);\n\n}", "title": "" }, { "docid": "df668fabaf4ec4b415388dec9cda61d6", "score": "0.53839946", "text": "function plotDistribution(binSize, minWeight, bins, label, $dist, title) {\n let $bars = $dist.children('.bars').html('');\n let binWidth = $bars.width() / bins.length;\n let maxValue = bins.reduce(mmax);\n $dist.children('.header').html(title);\n bins.forEach((n, i) => {\n $('<div></div>')\n .css({\n height: '0%',\n width: binWidth + 'px',\n left: (i*binWidth) + 'px'\n })\n .attr('data-height', (100*n/maxValue) + '%')\n .append('<div class=\"x-label\">' + \n (minWeight + i*binSize).toFixed(2) + label + \n ' - ' + \n (minWeight + (i+1)*binSize).toFixed(2) + label + '</div>')\n .append('<div class=\"y-label\"><div>' + n + '<div></div>')\n .appendTo($bars);\n });\n setTimeout(function() {\n // Set actual height of each bar appropriately once rendered.\n $bars.children().each((i, bar) => {\n console.log(bar);\n $(bar).css('height', $(bar).attr('data-height'))\n });\n }, 50);\n\n}", "title": "" }, { "docid": "38288159f9ed749b488823b42e3e2382", "score": "0.5381071", "text": "function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\n ];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\n boundingLength = symbolBoundingExtent[pxSignIdx];\n }\n else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n }\n else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n }\n else {\n boundingLength = layout[valueDim.wh];\n }\n\n output.boundingLength = boundingLength;\n\n if (symbolRepeat) {\n output.repeatCutLength = layout[valueDim.wh];\n }\n\n output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\n }", "title": "" }, { "docid": "38288159f9ed749b488823b42e3e2382", "score": "0.5381071", "text": "function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) {\n var valueDim = opt.valueDim;\n var symbolBoundingData = itemModel.get('symbolBoundingData');\n var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis());\n var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0));\n var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0);\n var boundingLength;\n\n if (zrUtil.isArray(symbolBoundingData)) {\n var symbolBoundingExtent = [\n convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx,\n convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx\n ];\n symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse());\n boundingLength = symbolBoundingExtent[pxSignIdx];\n }\n else if (symbolBoundingData != null) {\n boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx;\n }\n else if (symbolRepeat) {\n boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx;\n }\n else {\n boundingLength = layout[valueDim.wh];\n }\n\n output.boundingLength = boundingLength;\n\n if (symbolRepeat) {\n output.repeatCutLength = layout[valueDim.wh];\n }\n\n output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0;\n }", "title": "" }, { "docid": "4691ba171112b325c2ba58239f15d823", "score": "0.5367396", "text": "function generateBar(chartDivId, dataParams, ticksLabels, chartTitle, widthRatio=0.5, axisOverride=null, onrendered_func=null) {\n if (axisOverride) {\n var axis = axisOverride;\n } else {\n var axis = {\n rotated: true,\n x: {\n type: 'category',\n categories: ticksLabels\n }\n };\n }\n return c3.generate({\n bindto: chartDivId,\n data: dataParams,\n bar: {\n width: {\n ratio: widthRatio // this makes bar width 50% of length between ticks\n }\n },\n axis: axis,\n title: {\n text: chartTitle\n },\n onrendered: onrendered_func\n });\n}", "title": "" }, { "docid": "108ad92de87139649954681aad7a90a3", "score": "0.53531986", "text": "makeIdealScaleGivenSpace(aPixels) {\n let facet = this.faceter;\n // build a scale and have it grow the edges based on the span\n let scale = pv.Scales.dateTime(facet.oldest, facet.newest);\n\n const Span = pv.Scales.DateTimeScale.Span;\n const MS_MIN = 60 * 1000,\n MS_HOUR = 60 * MS_MIN,\n MS_DAY = 24 * MS_HOUR,\n MS_WEEK = 7 * MS_DAY,\n MS_MONTHISH = 31 * MS_DAY,\n MS_YEARISH = 366 * MS_DAY;\n const roughMap = {};\n roughMap[Span.DAYS] = MS_DAY;\n roughMap[Span.WEEKS] = MS_WEEK;\n // we overestimate since we want to slightly underestimate pixel usage\n // in enoughPix's rough estimate\n roughMap[Span.MONTHS] = MS_MONTHISH;\n roughMap[Span.YEARS] = MS_YEARISH;\n\n const minBarPix = this._MIN_BAR_SIZE_PX + this._BAR_SPACING_PX;\n\n let delta = facet.newest.valueOf() - facet.oldest.valueOf();\n let span, rules, barPixBudget;\n // evil side-effect land\n function enoughPix(aSpan) {\n span = aSpan;\n // do a rough guestimate before doing something potentially expensive...\n barPixBudget = Math.floor(aPixels / (delta / roughMap[span]));\n if (barPixBudget < minBarPix + 1) {\n return false;\n }\n\n rules = scale.ruleValues(span);\n // + 0 because we want to over-estimate slightly for niceness rounding\n // reasons\n barPixBudget = Math.floor(aPixels / (rules.length + 0));\n delta = scale.max().valueOf() - scale.min().valueOf();\n return barPixBudget > minBarPix;\n }\n\n // day is our smallest unit\n const ALLOWED_SPANS = [Span.DAYS, Span.WEEKS, Span.MONTHS, Span.YEARS];\n for (let trySpan of ALLOWED_SPANS) {\n if (enoughPix(trySpan)) {\n // do the equivalent of nice() for our chosen span\n scale.min(scale.round(scale.min(), trySpan, false));\n scale.max(scale.round(scale.max(), trySpan, true));\n // try again for paranoia, but mainly for the side-effect...\n if (enoughPix(trySpan)) {\n break;\n }\n }\n }\n\n // - Figure out our labeling strategy\n // normalize the symbols into an explicit ordering\n let spandex = ALLOWED_SPANS.indexOf(span);\n // from least-specific to most-specific\n let labelTiers = [];\n // add year spans in all cases, although whether we draw bars depends on if\n // we are in year mode or not\n labelTiers.push({\n rules: span == Span.YEARS ? rules : scale.ruleValues(Span.YEARS, true),\n // We should not hit the null member of the array...\n label: [{ year: \"numeric\" }, { year: \"2-digit\" }, null],\n boost: span == Span.YEARS,\n noFringe: span == Span.YEARS,\n });\n // add month spans if we are days or weeks...\n if (spandex < 2) {\n labelTiers.push({\n rules: scale.ruleValues(Span.MONTHS, true),\n // try to use the full month, falling back to the short month\n label: [{ month: \"long\" }, { month: \"short\" }, null],\n boost: false,\n });\n }\n // add week spans if our granularity is days...\n if (span == Span.DAYS) {\n let numDays = delta / MS_DAY;\n\n // find out how many days we are talking about and add days if it's small\n // enough, display both the date and the day of the week\n if (numDays <= this._MAX_DAY_COUNT_LABEL_DISPLAY) {\n labelTiers.push({\n rules,\n label: [{ day: \"numeric\" }, null],\n boost: true,\n noFringe: true,\n });\n labelTiers.push({\n rules,\n label: [{ weekday: \"short\" }, null],\n boost: true,\n noFringe: true,\n });\n } else {\n // show the weeks since we're at greater than a day time-scale\n labelTiers.push({\n rules: scale.ruleValues(Span.WEEKS, true),\n // labeling weeks is nonsensical; no one understands ISO weeks\n // numbers.\n label: [null],\n boost: false,\n });\n }\n }\n\n return { scale, span, rules, barPixBudget, labelTiers };\n }", "title": "" }, { "docid": "7636c68ad38556e1c5daa611c704adfb", "score": "0.5302996", "text": "function bar_cross(bar_env,a,method_name) {\n var barPadding = .015; // Space between bars\n var topScale = 1.2; // Multiplicative factor to assign space at top within graph - currently removed from implementation\n var plotXaxis = true;\n\n // Data\n var keys = Object.keys(bar_env.plotvalues);\n var yVals = new Array;\n var ciUpperVals = new Array;\n var ciLowerVals = new Array;\n var ciSize;\n\n var xVals = new Array;\n var yValKey = new Array;\n\n if (bar_env.nature === \"nominal\") {\n var xi = 0;\n for (var i = 0; i < keys.length; i++) {\n if (bar_env.plotvalues[keys[i]] == 0) {\n continue;\n }\n yVals[xi] = bar_env.plotvalues[keys[i]];\n xVals[xi] = xi;\n if ($private) {\n if (bar_env.plotvaluesCI) {\n ciLowerVals[xi] = bar_env.plotValuesCI.lowerBound[keys[i]];\n ciUpperVals[xi] = bar_env.plotValuesCI.upperBound[keys[i]];\n }\n ciSize = ciUpperVals[xi] - ciLowerVals[xi];\n }\n yValKey.push({y: yVals[xi], x: keys[i]});\n xi = xi + 1;\n }\n yValKey.sort((a, b) => b.y - a.y); // array of objects, each object has y, the same as yVals, and x, the category\n yVals.sort((a, b) => b - a); // array of y values, the height of the bars\n ciUpperVals.sort((a, b) => b.y - a.y); // ?\n ciLowerVals.sort((a, b) => b.y - a.y); // ?\n } else {\n for (var i = 0; i < keys.length; i++) {\n yVals[i] = bar_env.plotvalues[keys[i]];\n xVals[i] = Number(keys[i]);\n if ($private) {\n if (bar_env.plotvaluesCI) {\n ciLowerVals[i] = bar_env.plotvaluesCI.lowerBound[keys[i]];\n ciUpperVals[i] = bar_env.plotvaluesCI.upperBound[keys[i]];\n }\n ciSize = ciUpperVals[i] - ciLowerVals[i];\n }\n }\n }\n\n if ((yVals.length > 15 & bar_env.numchar === \"numeric\") | (yVals.length > 5 & bar_env.numchar === \"character\")) {\n plotXaxis = false;\n }\n var minY=d3.min(yVals);\n var maxY = d3.max(yVals); // in the future, set maxY to the value of the maximum confidence limit\n var minX = d3.min(xVals);\n var maxX = d3.max(xVals);\n var x_1 = d3.scale.linear()\n .domain([minX - 0.5, maxX + 0.5])\n .range([0, width_cross]);\n\n var invx = d3.scale.linear()\n .range([minX - 0.5, maxX + 0.5])\n .domain([0, width_cross]);\n\n var y_1 = d3.scale.linear()\n // .domain([0, maxY])\n .domain([0, maxY])\n .range([0, height_cross]);\n\n var xAxis = d3.svg.axis()\n .scale(x_1)\n .ticks(yVals.length)\n .orient(\"bottom\");\n\n var yAxis = d3.svg.axis()\n .scale(y_1)\n .orient(\"left\");\n\n var plotsvg1 = d3.select(plot_b)\n .append(\"svg\")\n .attr(\"id\",\"plotsvg1_id\")\n .style(\"width\", width_cross + margin_cross.left + margin_cross.right) //setting height to the height of #main.left\n .style(\"height\", height_cross + margin_cross.top + margin_cross.bottom)\n .style(\"margin-left\",\"20px\")\n .append(\"g\")\n .attr(\"transform\", \"translate(0,\" + margin_cross.top + \")\");\n\n var rectWidth = x_1(minX + 0.5 - 2 * barPadding); //the \"width\" is the coordinate of the end of the first bar\n plotsvg1.selectAll(\"rect\")\n .data(yVals)\n .enter()\n .append(\"rect\")\n .attr(\"id\",\"path2\")\n .attr(\"x\", function (d, i) {\n return x_1(xVals[i] - 0.5 + barPadding);\n })\n .attr(\"y\", function (d) {\n return y_1(maxY - d);\n })\n .attr(\"width\", rectWidth)\n .attr(\"height\", function (d) {\n return y_1(d);\n })\n .attr(\"fill\", \"#fa8072\");\n\n if (plotXaxis) {\n plotsvg1.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height_cross + \")\")\n .call(xAxis);\n }\n\n plotsvg1.append(\"text\")\n .attr(\"x\", (width_cross / 2))\n .attr(\"y\", margin_cross.top + padding_cross-10)\n .attr(\"text-anchor\", \"middle\")\n .text(bar_env.name)\n .style(\"text-indent\",\"20px\")\n .style(\"font-size\",\"12px\")\n .style(\"font-weight\",\"bold\");\n\n if(isNaN(a)|| a===0) {\n x_cord2 = equimass_bar(bar_env, keys.length);\n for (var i = 0; i < keys.length - 1; i++) {\n plotsvg1.append(\"line\")\n .attr(\"id\", \"line2\")\n .attr(\"x1\", x_1(x_cord2[i] ))\n .attr(\"x2\", x_1(x_cord2[i] ))\n .attr(\"y1\", y_1(0))\n .attr(\"y2\", y_1(maxY))\n .style(\"stroke\", \"#212121\")\n .style(\"stroke-dasharray\", \"4\");\n }\n }\n else {\n if (method_name === \"equidistance\") {\n var upper_limit1 = maxX;\n var lower_limit1 = minX;\n var diff1 = upper_limit1 - lower_limit1;\n var buffer1 = diff1 / a;\n var x_cord1 = [];\n var push_data1 = lower_limit1;\n for (var i = 0; i < a - 1; i++) {\n push_data1 = push_data1 + buffer1;\n x_cord1.push(push_data1);\n plotsvg1.append(\"line\")\n .attr(\"id\", \"line2\")\n .attr(\"x1\", x_1(x_cord1[i]))\n .attr(\"x2\", x_1(x_cord1[i]))\n .attr(\"y1\", y_1(0))\n .attr(\"y2\", y_1(maxY))\n .style(\"stroke\", \"#0D47A1\")\n .style(\"stroke-dasharray\", \"4\");\n }\n } else if (method_name===\"equimass\") {\n var x_cord2 = [];\n x_cord2 = equimass_bar(bar_env, a);\n for (var i = 0; i < a - 1; i++) {\n plotsvg1.append(\"line\")\n .attr(\"id\", \"line2\")\n .attr(\"x1\", x_1(x_cord2[i] ))\n .attr(\"x2\", x_1(x_cord2[i] ))\n .attr(\"y1\", y_1(0))\n .attr(\"y2\", y_1(maxY))\n .style(\"stroke\", \"#0D47A1\")\n .style(\"stroke-dasharray\", \"4\");\n }\n }\n }\n }", "title": "" }, { "docid": "8759ff67fb7a876ceffd3ce6aa97eb11", "score": "0.5285938", "text": "_bar(value, total) {\n\n const percent = Math.min(value / total, 1);\n const width = 25;\n const n_filled = Math.floor(width * percent);\n const n_blank = width - n_filled;\n const filled = chalk.cyan(figures.hamburger.repeat(n_filled));\n const blank = ' '.repeat(n_blank);\n\n return `|${filled}${blank}| ${Math.round(percent * 100)}%`;\n\n }", "title": "" }, { "docid": "74b12e2fe5a16eb9cf9c3543d3bb4b6c", "score": "0.528533", "text": "function myBars(data) {\n //console.log(data);\n\n // get refrence to html canvas element\n let art1 = document.getElementById('chartBar');\n // get ref to 2d drawing context inside the canvas\n let context1 = art1.getContext('2d');\n\n // now can establish some useful values\n let startX = art1.width;\n let bottomY = art1.height;\n let maxVal = getMax(data);\n let scaleY = bottomY / maxVal;\n let scaleX = startX / (data.length);\n let i, height, lastX = 0;\n\n // loop thru and draw some axis scale lines\n for (i = 0; i <= maxVal; i = i + maxVal / 10) {\n context1.beginPath();\n context1.moveTo(0, i * scaleY);\n context1.lineTo(startX, i * scaleY);\n context1.strokeStyle = \"blue\";\n context1.stroke();\n\n // draw text for each axis scale line\n context1.fillStyle = \"dark green\";\n context1.font = \"bold 20px sans-serif\";\n context1.fillText(maxVal - i, 0, (i * scaleY) - 2);\n }\n\n // loop thru each data array element and draw rect scaled\n for (i = 0; i < data.length; i++) {\n // set fill color\n context1.fillStyle = data[i].color;\n context1.globalAlpha = 0.7;\n // calc height of rect using scale\n height = data[i].info * scaleY;\n // draw rect\n context1.fillRect(lastX, bottomY - height, scaleX, height);\n lastX += scaleX;\n }\n}", "title": "" }, { "docid": "82ffdf7323e7e365c3b2b0ef8e410ebb", "score": "0.5275456", "text": "function drawBars(ID, maxVal, options, data) {\n //Append a container to the allData div for the bar being drawn\n $(\".allData\").append(\"<div class=data\" + ID + \"></div>\");\n //Set the bar to be displayed inline-block as the bars must be side by side\n $(\".data\" + ID).css({\n \"display\" : \"inline-block\",\n \"background-color\" : options[14]\n });\n\n function makeBottomBar(ID, i, data, options){\n $(\".dataBar\" + ID + i).css({\n \"border-top\" : \"1px solid black\",\n \"border-left\" : \"1px solid black\",\n \"border-right\" : \"1px solid black\",\n //Uncomment the line underneath to have equal width bars\n //\"width\": (options[22] / (data.length + 1)), //Determine the width of each bar based on the width of the chart area\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n \"position\" : \"relative\",\n \"background-color\" : options[15] // Change later in the options\n });\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n\n function makeTopBar(ID, i, data, options){\n $(\".dataBar\" + ID + i).css({\n \"border\" : \"1px solid black\",\n //Uncomment the line underneath to have equal width bars\n //\"width\": (options[22] / (data.length + 1)), //Determine the width of each bar based on the width of the chart area\n \"width\" : (data[ID][i]), //Width based on the numeric value of bar\n \"position\" : \"relative\",\n \"background-color\" : options[16] // Change later in the options\n });\n $(\".dataPoint\" + i).css({\n \"position\" : \"absolute\",\n \"left\" : \"50%\",\n \"color\" : options[17],\n \"font-size\" : options[18]\n });\n }\n \n //for each datapoint in the bar, draw the bar (data for a single bar must be sorted from lowest-highest)\n for (var i = 1; i < data[ID].length; i++) {\n $(\".data\" + ID).prepend(\"<div class=dataBar\" + ID + i + \"><div class=dataPoint\" + i + \">\" + data[ID][i] + \"</div></div>\");\n if(i % 2 !== 0){ // BOTTOM BAR MAKING FUNCTION RUNNING\n makeBottomBar(ID, i, data, options)\n }else{ // TOP BAR MAKING FUNCTION RUNNING\n makeTopBar(ID, i, data, options)\n }\n\n //Set the dataPoint to display at either the top, middle or bottom of the bar\n if (options[19] === \"top\") {\n $(\".dataPoint\" + i).css(\"top\", \"5%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, 0%)\");\n } else if (options[19] === \"middle\") {\n $(\".dataPoint\" + i).css(\"top\", \"50%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -50%)\");\n } else {\n $(\".dataPoint\" + i).css(\"bottom\", \"0%\");\n $(\".dataPoint\" + i).css(\"transform\", \"translate(-50%, -10%)\");\n }\n //For multiple values, we calculate the remaining height needed to add above the currently drawn values to get the correct height of the bar\n var heightVal = (data[ID][i] / maxVal) * options[21];\n //console.log(heightVal + \" outside\");\n for (var j = 1; j < i; j++) {\n heightVal = (((data[ID][j] / maxVal) * options[21]) - heightVal) * (-1);\n //console.log(heightVal);\n }\n $(\".dataBar\" + ID + i).css(\"height\", heightVal);\n }\n $(\".data\" + ID).css(\"border-bottom\", \"1px solid black\");\n //add the space between each bar\n $(\".allData\").append(\"<div class=barSpace></div>\");\n }", "title": "" }, { "docid": "70cfedb22fc44aba25c86f10139cc0a7", "score": "0.5264653", "text": "function _default(specContext) {\n const {\n insight,\n specColumns,\n specViewOptions\n } = specContext;\n const axisScales = {\n x: {\n title: specColumns.x && specColumns.x.name\n },\n y: {\n title: specColumns.y && specColumns.y.name\n },\n z: {\n title: specColumns.z && specColumns.z.name\n }\n };\n const hBandProps = {\n excludeEncodingRuleMap: true,\n orientation: 'horizontal',\n groupby: {\n column: specColumns.y,\n defaultBins: _defaults.defaultBins,\n maxbinsSignalName: _constants.SignalNames.YBins,\n maxbinsSignalDisplayName: specContext.specViewOptions.language.YMaxBins,\n maxbins: _defaults.maxbins\n },\n minBandWidth: _defaults.minBarBandWidth,\n showAxes: true\n };\n const vBandProps = {\n excludeEncodingRuleMap: true,\n orientation: 'vertical',\n groupby: {\n column: specColumns.x,\n defaultBins: _defaults.defaultBins,\n maxbinsSignalName: _constants.SignalNames.XBins,\n maxbinsSignalDisplayName: specContext.specViewOptions.language.XMaxBins,\n maxbins: _defaults.maxbins\n },\n minBandWidth: _defaults.minBarBandWidth,\n showAxes: true\n };\n const aggProps = {\n onBuild: null,\n aggregation: null,\n sumBy: specColumns.size\n };\n const layouts = [{\n layoutClass: _band.Band,\n props: vBandProps\n }, {\n layoutClass: _band.Band,\n props: hBandProps\n }, {\n layoutClass: _aggregateSquare.AggregateSquare,\n props: aggProps\n }];\n\n switch (insight.totalStyle) {\n case 'sum-treemap':\n {\n aggProps.aggregation = 'sum';\n const treemapProps = {\n corner: 'bottom-left',\n size: specColumns.size,\n treeMapMethod: specViewOptions.language.treeMapMethod,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _treemap.Treemap,\n props: treemapProps\n });\n break;\n }\n\n case 'sum-strip':\n {\n aggProps.aggregation = 'sum';\n const stripProps = {\n sortOrder: 'ascending',\n orientation: 'vertical',\n size: specColumns.size,\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n break;\n }\n\n case 'count-strip':\n {\n aggProps.aggregation = 'count';\n const stripProps = {\n sortOrder: 'ascending',\n orientation: 'vertical',\n sort: specColumns.sort,\n z: specColumns.z\n };\n layouts.push({\n layoutClass: _strip.Strip,\n props: stripProps\n });\n break;\n }\n\n default:\n {\n aggProps.aggregation = 'count';\n const squareProps = {\n sortBy: specColumns.sort,\n fillDirection: 'right-down',\n z: specColumns.z,\n maxGroupedUnits: null,\n maxGroupedFillSize: null\n };\n\n aggProps.onBuild = (aggMaxExtent, aggMaxExtentScaled) => {\n squareProps.maxGroupedUnits = aggMaxExtent;\n squareProps.maxGroupedFillSize = aggMaxExtentScaled;\n };\n\n layouts.push({\n layoutClass: _square.Square,\n props: squareProps\n });\n break;\n }\n }\n\n return {\n axisScales,\n layouts,\n specCapabilities: {\n countsAndSums: true,\n roles: [{\n role: 'x',\n binnable: true,\n axisSelection: specColumns.x && specColumns.x.quantitative ? 'range' : 'exact',\n signals: [_constants.SignalNames.XBins]\n }, {\n role: 'y',\n binnable: true,\n axisSelection: specColumns.y && specColumns.y.quantitative ? 'range' : 'exact',\n signals: [_constants.SignalNames.YBins]\n }, {\n role: 'z',\n allowNone: true\n }, {\n role: 'color',\n allowNone: true\n }, {\n role: 'sort',\n allowNone: true\n }, {\n role: 'size',\n allowNone: true,\n excludeCategoric: true,\n signals: [_constants.SignalNames.TreeMapMethod]\n }, {\n role: 'facet',\n allowNone: true,\n signals: [_constants.SignalNames.FacetBins]\n }, {\n role: 'facetV',\n allowNone: true,\n signals: [_constants.SignalNames.FacetVBins]\n }]\n }\n };\n}", "title": "" }, { "docid": "d5ce3080b47725ba4a8480bee9b8acf4", "score": "0.52587044", "text": "function makeBar(dataFile,label){\n // create color for bars\nvar colorbrewer = {Spectral: {\n 2: [\"#fc8d59\",\"#99d594\"],\n 3: [\"#fc8d59\",\"#ffffbf\",\"#99d594\"],\n 4: [\"#d7191c\",\"#fdae61\",\"#abdda4\",\"#2b83ba\"],\n 5: [\"#d7191c\",\"#fdae61\",\"#ffffbf\",\"#abdda4\",\"#2b83ba\"],\n 6: [\"#d53e4f\",\"#fc8d59\",\"#fee08b\",\"#e6f598\",\"#99d594\",\"#3288bd\"],\n 7: [\"#d53e4f\",\"#fc8d59\",\"#fee08b\",\"#ffffbf\",\"#e6f598\",\"#99d594\",\"#3288bd\"],\n 8: [\"#d53e4f\",\"#f46d43\",\"#fdae61\",\"#fee08b\",\"#e6f598\",\"#abdda4\",\"#66c2a5\",\"#3288bd\"],\n 9: [\"#d53e4f\",\"#f46d43\",\"#fdae61\",\"#fee08b\",\"#ffffbf\",\"#e6f598\",\"#abdda4\",\"#66c2a5\",\"#3288bd\"],\n 10: [\"#9e0142\",\"#d53e4f\",\"#f46d43\",\"#fdae61\",\"#fee08b\",\"#e6f598\",\"#abdda4\",\"#66c2a5\",\"#3288bd\",\"#5e4fa2\"],\n 11: [\"#9e0142\",\"#d53e4f\",\"#f46d43\",\"#fdae61\",\"#fee08b\",\"#ffffbf\",\"#e6f598\",\"#abdda4\",\"#66c2a5\",\"#3288bd\",\"#5e4fa2\"],\n 15: [\"#1e77b3\",\"#1E774B\",\"#AEC6E8\",\"#FF7F0D\",\"#FEBB78\",\"#2B9F2C\",\"#98DE8A\",\"#D52628\",\"#9367BD\",\"#C4B0D5\",\"#BCBC21\",\"#DBDB8D\", \"#17BECE\", \"#9EDAE5\", \"#C7C7C7\"]\n}};\n\nvar margin = {top: 20, right: 10, bottom: 30, left: 100},\n width = 1200 - margin.left - margin.right,\n height = 500 - margin.top - margin.bottom;\n\nvar title = d3.select(\"body\").append(\"g\")\n.append(\"div\")\n.attr(\"id\",\"daTitle\")\n .append(\"text\") \n .style(\"font-size\", \"25px\") \n .text(label);\n\nvar tooltip = d3.selectAll(\"body\")\n .append(\"div\")\n .attr(\"align\",\"center\")\n .attr('class', 'tooltip'); \n\nvar x = d3.scaleBand()\n .rangeRound([0, width * (15 / 18)], .05).padding(.2);\n\n// var x = d3.scaleBand()\n// .rangeRound([0, width], .05).padding(0.1);\n\nvar y = d3.scaleLinear()\n .range([height, 0]);\n\n// var y =d3.scaleLinear()\n// .range([height, 0]);\n\nvar legend_y = d3.scaleBand()\n .range([height / 2, 0], .01);\n\nvar color = d3.scaleOrdinal()\n\nvar xAxis = d3.axisBottom()\n .scale(x)\n .tickSize(0,0,0)\n .tickPadding(6);\n\nvar yAxis = d3.axisLeft()\n .scale(y) \n .tickFormat(d3.format(\".0%\"))\n .tickSize(0,0,0)\n .tickPadding(0);\n// make bar svg\nvar svg = d3.select(\"body\").append(\"svg\")\n\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .attr(\"id\",\"the_SVG_ID\")\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\nd3.csv(dataFile, function(error, data) {\n var categories = d3.keys(data[0]).filter(function(key) { return key !== \"Sample\"; });\n var categories_shift = categories;\n console.log(categories);\n color.domain(categories);\n color.range(colorbrewer.Spectral[categories.length]);\n\n data.forEach(function(d) {\n var y0 = 0;\n d.genes = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; });\n d.genes.forEach(function(d) { d.y0 /= y0; d.y1 /= y0; });\n });\n // data.sort(function(a, b) { return b.genes[0].y1 - a.genes[0].y1; });\n\n x.domain(data.map(function(d) { return d.Sample; }));\n\n legend_y.domain(data[0].genes.map(function(d) { return d.name; }));\n\n svg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis);\n\n var rotate = function(arr){\n var temp = arr.shift();\n arr.push(temp);\n }\n \n var sample = svg.selectAll(\".sample\")\n .data(data)\n .enter().append(\"g\")\n .attr(\"class\", \"sample\")\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.Sample) + \",0)\"; });\n\n sample.selectAll(\"rect\")\n .data(function(d) { return d.genes; })\n .enter().append(\"rect\")\n .attr(\"width\", x.bandwidth())\n .attr(\"y\", function(d) { return y(d.y1); })\n .attr(\"height\", function(d) { return y(d.y0) - y(d.y1); })\n .style(\"fill\", function(d) { return color(d.name);})\n\n .on(\"mouseover\", function(d) {\n \n console.log(d.y1 - d.y0);\n var texxt = d.y1 - d.y0;\n texxt = texxt.toFixed(3);\n return tooltip.style(\"visibility\", \"visible\").text(' [ ' + texxt +' ]' +' [ ' + d.name +' ]' );\n \n \n })\n .on(\"mouseout\", function() {\n return tooltip.style(\"visibility\", \"hidden\");\n })\n .on(\"click\", function(d) {\n var gene_index = categories_shift.indexOf(d.name);\n console.log(d.y1 - d.y0);\n moveStuff(gene_index); \n });\n\n var legend = svg.append(\"g\")\n .attr(\"class\", \"legend\")\n\n .attr(\"x\", width - 3 * x.bandwidth())\n .attr(\"y\", 0)\n .attr(\"height\", height)\n .attr(\"width\", 3 * x.bandwidth());\n \n legend.selectAll(\"rect\")\n .data(data[0].genes)\n .enter().append(\"rect\")\n .attr(\"width\", x.bandwidth()/2)\n .attr(\"height\", 15)\n .attr(\"y\", function(d,i) { return legend_y(d.name); })\n .attr(\"x\", width - 2.75* x.bandwidth() )\n .style(\"fill\", function(d) { return color(d.name); })\n .on(\"click\", function(d) {\n // console.log(gene_index);\n var gene_index = categories_shift.indexOf(d.name);\n // console.log(gene_index);\n moveStuff(gene_index);\n\n });\n\n legend.selectAll(\"text\")\n .data(data[0].genes)\n .enter().append(\"text\")\n .on(\"mouseover\", function(d) {\n \n var descript = d.name;\n if (descript==\"Infection\"){descript =\" Certain infectious and parasitic diseases\"};\n if (descript==\"Cancer\"){descript =\" Neoplasms\"}; \n if (descript==\"Blood\"){descript =\" Diseases of the blood and blood-forming organs and certain disorders involving the immune mechanism\"}; \n if (descript==\"Metabolic\"){descript =\" Endocrine, nutritional and metabolic diseases\"}; \n \n if (descript==\"Nervous\"){descript =\" Diseases of the nervous system\"}; \n if (descript==\"Eye\"){descript =\" Diseases of the eye and adnexa\"};\n if (descript==\"Ear\"){descript =\" Diseases of the ear and mastoid process\"}; \n if (descript==\"Circulatory\"){descript =\" Diseases of the circulatory system\"}; \n if (descript==\"Respiratory\"){descript =\" Diseases of the respiratory system \"}; \n if (descript==\"Digestive\"){descript =\" Diseases of the digestive system \"}; \n if (descript==\"Skin\"){descript =\" Diseases of the skin and subcutaneous tissue\"}; \n if (descript==\"Musculoskeletal\"){descript =\" Diseases of the musculoskeletal system and connective tissue\"}; \n \n if (descript==\"Perinatal\"){descript =\" Conditions from the perinatal period / Pregnancy, childbirth and the puerperium\"}; \n if (descript==\"Deformations\"){descript =\" Congenital malformations, deformations and chromosomal abnormalities\"}; \n if (descript==\"Abnormal\"){descript =\" Congenital malformations, deformations and chromosomal abnormalities\"}; \n if (descript==\"External\"){descript =\" External causes of morbidity and mortality\"}; \n if (descript==\"Mental\"){descript =\" Mental and behavioural disorders\"}; \n if (descript==\"Genital\"){descript =\" Diseases of the genitourinary system\"}; \n\n\n return tooltip.style(\"visibility\", \"visible\").text('[ ' + d.name + ': ' + descript +']' );\n \n \n })\n .on(\"mouseout\", function() {\n return tooltip.style(\"visibility\", \"hidden\");\n })\n \n .attr(\"y\", function(d,i) { return legend_y(d.name) + legend_y.bandwidth()/2; })\n .attr(\"x\", width - 2*x.bandwidth() )\n\n .text(function(d) { return d.name; })\n .on(\"click\", function(d) {\n var gene_index = categories_shift.indexOf(d.name);\n moveStuff(gene_index);\n });\n\n var moveStuff = function(gene_index){\n categories_shift = categories;\n console.log(categories_shift);\n for (var i=0; i<gene_index; i++){\n rotate(categories_shift);\n console.log(categories_shift);\n }\n data.forEach(function(d) {\n var y0 = 0;\n d.genes = categories_shift.map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; });\n d.genes.forEach(function(d) { d.y0 /= y0; d.y1 /= y0; });\n })\n // data.sort(function(a, b) { return b.genes[0].y1 - a.genes[0].y1; });\n x.domain(data.map(function(d) { return d.Sample; }));\n legend_y.domain(data[0].genes.map(function(d) { return d.name; }));\n svg.select(\".x.axis\")\n .transition()\n .duration(1000)\n .call(xAxis);\n sample = svg.selectAll(\".sample\")\n .data(data)\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.Sample) + \",0)\"; });\n\n sample.selectAll(\"rect\")\n .data(function(d) { return d.genes; })\n .transition()\n .delay(function(d, i) { return i * 50; })\n .attr(\"y\", function(d) { return y(d.y1); })\n .attr(\"height\", function(d) { return y(d.y0) - y(d.y1); })\n .style(\"fill\", function(d) { return color(d.name);});\n\n legend.selectAll(\"rect\")\n .data(data[0].genes)\n .transition()\n .delay(function(d, i) { return i * 50; })\n .style(\"fill\", function(d) { return color(d.name); });\n\n legend.selectAll(\"text\")\n .data(data[0].genes)\n\n .transition()\n .delay(function(d, i) { return i * 50; })\n .text(function(d) { return d.name; });\n\n last_sample = data[data.length - 1];\n };\n \n console.log(data);\n console.log(data[data.length - 1].genes);\n var last_sample = data[data.length - 1];\n console.log( x(last_sample.Sample));\n svg.selectAll(\"text\")\n .data(last_sample.genes)\n .enter()\n .append(\"text\")\n .text(function(d) {\n return d.name;\n })\n .attr(\"x\", function(d) {\n return x(last_sample.Sample) + x.bandwidth() + 15;\n })\n .attr(\"y\", function(d) {\n return (y(d.y0) + y(d.y1)) / 2;\n })\n .attr(\"font-size\", \"11px\")\n .attr(\"fill\", \"black\");\n console.log(data[0].genes)\n \n});\n}", "title": "" }, { "docid": "e5ccc65887c893f9df6e782aa0eb2365", "score": "0.5258401", "text": "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = (0,_axisHelper__WEBPACK_IMPORTED_MODULE_2__.makeLabelFormatter)(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = zrender_lib_contain_text__WEBPACK_IMPORTED_MODULE_3__.getBoundingRect(labelFormatter({\n value: tickValue\n }), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var axisExtent = axis.getExtent();\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n // For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n // The jitter will cause that sometimes the displayed labels are\n // `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval // If the axis change is caused by chart resize, the cache should not\n // be used. Otherwise some hiden labels might not be shown again.\n && cache.axisExtent0 === axisExtent[0] && cache.axisExtent1 === axisExtent[1]) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n cache.axisExtent0 = axisExtent[0];\n cache.axisExtent1 = axisExtent[1];\n }\n\n return interval;\n}", "title": "" }, { "docid": "9b2ced0f35193df0c2df4320c4055525", "score": "0.52407944", "text": "function _calculateCategoryInterval(axis){\nvar params=fetchAutoCategoryIntervalCalculationParams(axis);\nvar labelFormatter=makeLabelFormatter(axis);\nvar rotation=(params.axisRotate-params.labelRotate)/180*Math.PI;\n\nvar ordinalScale=axis.scale;\nvar ordinalExtent=ordinalScale.getExtent();\n// Providing this method is for optimization:\n// avoid generating a long array by `getTicks`\n// in large category data case.\nvar tickCount=ordinalScale.count();\n\nif(ordinalExtent[1]-ordinalExtent[0]<1){\nreturn 0;\n}\n\nvar step=1;\n// Simple optimization. Empirical value: tick count should less than 40.\nif(tickCount>40){\nstep=Math.max(1,Math.floor(tickCount/40));\n}\nvar tickValue=ordinalExtent[0];\nvar unitSpan=axis.dataToCoord(tickValue+1)-axis.dataToCoord(tickValue);\nvar unitW=Math.abs(unitSpan*Math.cos(rotation));\nvar unitH=Math.abs(unitSpan*Math.sin(rotation));\n\nvar maxW=0;\nvar maxH=0;\n\n// Caution: Performance sensitive for large category data.\n// Consider dataZoom, we should make appropriate step to avoid O(n) loop.\nfor(;tickValue<=ordinalExtent[1];tickValue+=step){\nvar width=0;\nvar height=0;\n\n// Not precise, do not consider align and vertical align\n// and each distance from axis line yet.\nvar rect=_getBoundingRect(\nlabelFormatter(tickValue),params.font,'center','top');\n\n// Magic number\nwidth=rect.width*1.3;\nheight=rect.height*1.3;\n\n// Min size, void long loop.\nmaxW=Math.max(maxW,width,7);\nmaxH=Math.max(maxH,height,7);\n}\n\nvar dw=maxW/unitW;\nvar dh=maxH/unitH;\n// 0/0 is NaN, 1/0 is Infinity.\nisNaN(dw)&&(dw=Infinity);\nisNaN(dh)&&(dh=Infinity);\nvar interval=Math.max(0,Math.floor(Math.min(dw,dh)));\n\nvar cache=inner$6(axis.model);\nvar axisExtent=axis.getExtent();\nvar lastAutoInterval=cache.lastAutoInterval;\nvar lastTickCount=cache.lastTickCount;\n\n// Use cache to keep interval stable while moving zoom window,\n// otherwise the calculated interval might jitter when the zoom\n// window size is close to the interval-changing size.\n// For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n// The jitter will cause that sometimes the displayed labels are\n// `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\nif(lastAutoInterval!=null&&\nlastTickCount!=null&&\nMath.abs(lastAutoInterval-interval)<=1&&\nMath.abs(lastTickCount-tickCount)<=1\n// Always choose the bigger one, otherwise the critical\n// point is not the same when zooming in or zooming out.\n&&lastAutoInterval>interval\n// If the axis change is caused by chart resize, the cache should not\n// be used. Otherwise some hiden labels might not be shown again.\n&&cache.axisExtend0===axisExtent[0]&&\ncache.axisExtend1===axisExtent[1])\n{\ninterval=lastAutoInterval;\n}\n// Only update cache if cache not used, otherwise the\n// changing of interval is too insensitive.\nelse{\ncache.lastTickCount=tickCount;\ncache.lastAutoInterval=interval;\ncache.axisExtend0=axisExtent[0];\ncache.axisExtend1=axisExtent[1];\n}\n\nreturn interval;\n}", "title": "" }, { "docid": "6a195c6f3f3961848edfa5231b0e3dbf", "score": "0.52304256", "text": "function barChart(){\nvar margin = {top: 10, right: 10, bottom: 10, left: 10},\n width = 500,\n height = 100;\n\nvar x = d3.scale.ordinal()\n .rangeRoundBands([0, width], .1);\n\nvar y = d3.scale.linear()\n .rangeRound([height, 0]);\n\nvar color = d3.scale.ordinal()\n .range([\"#98abc5\", \"#8a89a6\", \"#7b6888\", \"#6b486b\", \"#a05d56\", \"#d0743c\", \"#ff8c00\"]);\n\nvar xAxis = d3.svg.axis()\n .scale(x)\n .orient(\"bottom\");\n\nvar yAxis = d3.svg.axis()\n .scale(y)\n .orient(\"left\")\n .tickFormat(d3.format(\".2s\"));\n\nvar x1 = 400, y1 = 400;\n\nvar Csvg = d3.select(\".barWrap\").append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n// .attr(\"transform\", \"translate(\" + x1 + \",\" + y1 + \")\")\n\n\n var typedump=[];\n for (var i =0; i<typeSum.length; i++){\n var barWidth = (typeSum[i][\"values\"][\"total_waste\"]/sum)*width //set width ratio\n if (i>=1){\n var prevBarWidth = d3.sum(typedump, function(d) {return d.barWidth})\n }\n else {\n var prevBarWidth = 0;\n }\n typedump.push({\"unit\": \"lead\", \"total_waste\": typeSum[i][\"values\"][\"total_waste\"], \"id\": typeSum[i][\"key\"], \"barWidth\": barWidth, \"prevBarWidth\": prevBarWidth})\n };\n console.log(typedump);\n\n/*\n color.domain(d3.keys(typedump.type));\n typedump.forEach(function(d) {\n console.log(d)\n var y0 = 0;\n d.cat = color.domain().map(function(name) { return {name: name, y0: y0, y1: y0 += +d[name]}; });\n d.total = d.cat[d.cat.length - 1].y1;\n });\n*/\n\n x.domain(typedump.map(function(d) { return d.unit; }));\n y.domain([0, d3.max(typedump, function(d) { return d.total; })]);\n\n Csvg.append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"y\", 105)\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(xAxis);\n\n/*\n svg.append(\"g\")\n .attr(\"class\", \"y axis\")\n .call(yAxis)\n .append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .text(\"Population\");\n\n\n var state = svg.selectAll(\".unit\")\n .data(typedump)\n .enter().append(\"g\")\n .attr(\"class\", \"g\")\n .attr(\"transform\", function(d) { return \"translate(\" + x(d.unit) + \",0)\"; });\n*/\n Csvg.selectAll(\"rect\")\n .data(typedump)\n .enter().append(\"rect\")\n .sort(function(a, b) { return b.barWidth - a.barWidth; })\n .attr(\"class\", function(d){\n return d.id;\n })\n .attr(\"x\", function(d) { return d.prevBarWidth; })\n .attr(\"y\", 0)\n .attr(\"width\", function(d){ return d.barWidth})\n .attr(\"height\", height)\n .style(\"fill\", \"blue\")\n //.on(\"mouseover\", highlight)\n //.on(\"mouseout\", dehighlight);\n\n\n}", "title": "" }, { "docid": "26beb6ef8b418b397fe2d7a319a54153", "score": "0.5221147", "text": "function drawBarChart(){\n var finalBarArray = [[\"Word\", \n \"Coordinating Conjunction\",\n \"Cardinal number\",\n \"Determiner\",\n \"Existential there\",\n \"Foreign Word\",\n \"Preposition\",\n \"Adjective\",\n \"Adjective, comparative\",\n \"Adjective, superlative\",\n \"List item marker\",\n \"Modal\",\n \"Noun, sing. or mass\",\n \"Proper noun, sing.\",\n \"Proper noun, plural\",\n \"Noun, plural\",\n \"Possessive ending\",\n \"Predeterminer\",\n \"Possessive pronoun\",\n \"Personal pronoun\",\n \"Adverb\",\n \"Adverb, comparative\",\n \"Adverb, superlative\",\n \"Particle\",\n \"Symbol\",\n \"to\",\n \"Interjection\",\n \"verb, base form\",\n \"verb, past tense\",\n \"verb, gerund\",\n \"verb, past part\",\n \"verb, present\",\n \"verb, present\",\n \"Wh-determiner\",\n \"Wh pronoun\",\n \"Possessive-Wh\",\n \"Wh-adverb\", { role: 'annotation' } ]];\n\n var wordsWithTags = [];\n topWords.forEach(function(topWord){\n var tagsCountArray = [\n [\"CC\", 0],\n [\"CD\", 0],\n [\"DT\", 0],\n [\"EX\", 0],\n [\"FW\", 0],\n [\"IN\", 0],\n [\"JJ\", 0],\n [\"JJR\", 0],\n [\"JJS\", 0],\n [\"LS\", 0],\n [\"MD\", 0],\n [\"NN\", 0],\n [\"NNP\", 0],\n [\"NNPS\", 0],\n [\"NNS\", 0],\n [\"POS\", 0],\n [\"PDT\", 0],\n [\"PRP$\", 0],\n [\"PRP\", 0],\n [\"RB\", 0],\n [\"RBR\", 0],\n [\"RBS\", 0],\n [\"RP\", 0],\n [\"SYM\", 0],\n [\"TO\", 0],\n [\"UH\", 0],\n [\"VB\", 0],\n [\"VBD\", 0],\n [\"VBG\", 0],\n [\"VBN\", 0],\n [\"VBP\", 0],\n [\"VBZ\", 0],\n [\"WDT\", 0],\n [\"WP\", 0],\n [\"WP$\", 0],\n [\"WRB\", 0]\n ];\n taggedWords.forEach(function(element){\n if(topWord.name == element[0]){\n tagsCountArray.find(function(e){\n if(e[0] == element[1])\n e[1]++;\n })\n }\n });\n wordsWithTags.push([topWord.name, tagsCountArray]);\n });\n \n var colors = getAllColorMappings();\n wordsWithTags.forEach(function(element, index){\n var returnArray = [element[0]];\n element[1].forEach(function(subelement){\n returnArray.push(subelement[1]);\n })\n returnArray.push(element[0]);\n finalBarArray.push(returnArray);\n })\n\n // Invoking the API functionality for drawing the chart\n var data = google.visualization.arrayToDataTable(finalBarArray);\n var view = new google.visualization.DataView(data);\n var options = {\n title: \"Top 10 words by occurance\",\n legend: { \n position: \"none\" \n },\n axes: {\n x: {\n 0: { side: 'top', label: 'Occurances'} // Top x-axis.\n }\n },\n isStacked: true,\n series: colors\n };\n\n var barChart = new google.visualization.BarChart(document.getElementById(\"barchart\"));\n barChart.draw(view, options);\n}", "title": "" }, { "docid": "e3a99c98f33985606e5ccdc3c3f39ecf", "score": "0.521071", "text": "calculateBars(frame) {\n const totalCount = frame.totalCount;\n let y = imageHeight;\n return _.chain(frame.colors)\n .filter(color => color.keep)\n .sortBy(color => -color.color[2])\n .map(color => {\n let height = (color.size / totalCount) * (1 * imageHeight);\n y = y - height;\n height += 1;\n return {height, y, color: color.color};\n }).value();\n }", "title": "" }, { "docid": "5c4c832b20cb0cb7f205f9a19ad85e31", "score": "0.51640975", "text": "function setCategoryWidths(){\n $('.bar').each(function(){\n var bar = $(this);\n var index = bar.attr('data-index');\n var relevantStats = _.findWhere(Region, {'id':index})['stats'];\n var barTotal = _.reduce(_.pluck(relevantStats, 'value'), function(memo,num){ return memo + num });\n $.each($(this).find('.stat'), function(stat_id,stat){\n $(stat).css({'width': $(stat).attr('data-value') / barTotal * 100 + \"%\"});\n })\n }) \n}", "title": "" }, { "docid": "698d1fc54864b2ea8647990af55568ac", "score": "0.5152074", "text": "function calculateCategoryInterval(axis){\nvar params=fetchAutoCategoryIntervalCalculationParams(axis);\nvar labelFormatter=makeLabelFormatter(axis);\nvar rotation=(params.axisRotate-params.labelRotate)/180*Math.PI;\nvar ordinalScale=axis.scale;\nvar ordinalExtent=ordinalScale.getExtent();// Providing this method is for optimization:\n// avoid generating a long array by `getTicks`\n// in large category data case.\n\nvar tickCount=ordinalScale.count();\n\nif(ordinalExtent[1]-ordinalExtent[0]<1){\nreturn 0;\n}\n\nvar step=1;// Simple optimization. Empirical value: tick count should less than 40.\n\nif(tickCount>40){\nstep=Math.max(1,Math.floor(tickCount/40));\n}\n\nvar tickValue=ordinalExtent[0];\nvar unitSpan=axis.dataToCoord(tickValue+1)-axis.dataToCoord(tickValue);\nvar unitW=Math.abs(unitSpan*Math.cos(rotation));\nvar unitH=Math.abs(unitSpan*Math.sin(rotation));\nvar maxW=0;\nvar maxH=0;// Caution: Performance sensitive for large category data.\n// Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\nfor(;tickValue<=ordinalExtent[1];tickValue+=step){\nvar width=0;\nvar height=0;// Not precise, do not consider align and vertical align\n// and each distance from axis line yet.\n\nvar rect=textContain.getBoundingRect(labelFormatter(tickValue),params.font,'center','top');// Magic number\n\nwidth=rect.width*1.3;\nheight=rect.height*1.3;// Min size, void long loop.\n\nmaxW=Math.max(maxW,width,7);\nmaxH=Math.max(maxH,height,7);\n}\n\nvar dw=maxW/unitW;\nvar dh=maxH/unitH;// 0/0 is NaN, 1/0 is Infinity.\n\nisNaN(dw)&&(dw=Infinity);\nisNaN(dh)&&(dh=Infinity);\nvar interval=Math.max(0,Math.floor(Math.min(dw,dh)));\nvar cache=inner(axis.model);\nvar axisExtent=axis.getExtent();\nvar lastAutoInterval=cache.lastAutoInterval;\nvar lastTickCount=cache.lastTickCount;// Use cache to keep interval stable while moving zoom window,\n// otherwise the calculated interval might jitter when the zoom\n// window size is close to the interval-changing size.\n// For example, if all of the axis labels are `a, b, c, d, e, f, g`.\n// The jitter will cause that sometimes the displayed labels are\n// `a, d, g` (interval: 2) sometimes `a, c, e`(interval: 1).\n\nif(lastAutoInterval!=null&&lastTickCount!=null&&Math.abs(lastAutoInterval-interval)<=1&&Math.abs(lastTickCount-tickCount)<=1// Always choose the bigger one, otherwise the critical\n// point is not the same when zooming in or zooming out.\n&&lastAutoInterval>interval// If the axis change is caused by chart resize, the cache should not\n// be used. Otherwise some hiden labels might not be shown again.\n&&cache.axisExtend0===axisExtent[0]&&cache.axisExtend1===axisExtent[1]){\ninterval=lastAutoInterval;\n}// Only update cache if cache not used, otherwise the\n// changing of interval is too insensitive.\nelse {\ncache.lastTickCount=tickCount;\ncache.lastAutoInterval=interval;\ncache.axisExtend0=axisExtent[0];\ncache.axisExtend1=axisExtent[1];\n}\n\nreturn interval;\n}", "title": "" }, { "docid": "26b313bf42a4ab743c4d2975a9291a24", "score": "0.5120199", "text": "function draw(){\n\tvar canvas = document.getElementById('canvas');\n\tif(canvas.getContext){\n\t\tvar ctx = canvas.getContext('2d');\n\t\tctx.fillStyle = STYLE;\n\t\t\n\t\tvar spacing = SPACE_SIZE * data.length + SPACE_SIZE;\t\n\t\tvar barWidth = (canvas.width - spacing)/data.length;\n\t\t\n\t\tvar maxHeight = 0;\n\t\tfor(var i=0; i<data.length; i++){\n\t\t\tif(data[i] > maxHeight){\n\t\t\t\tmaxHeight = data[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var i=0; i<data.length; i++){\n\t\t\tvar x = i * (barWidth + SPACE_SIZE) + SPACE_SIZE;\n\t\t\tvar y = canvas.height;\n\t\t\tvar barHeight = (data[i]/maxHeight) * canvas.height * -1;\n\t\t\tctx.fillRect(x,y,barWidth,barHeight);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "7a85fe0db83913152bdc8d56a2762606", "score": "0.51115113", "text": "function epwBarChart() {\n if (!epwBarChart.id) epwBarChart.id = 0;\n\n var margin = {top: 10, right: 10, bottom: 20, left: 10},\n x,\n y = d3.scale.linear().range([100, 0]),\n id = epwBarChart.id++,\n axis = d3.svg.axis().orient(\"bottom\"),\n brush = d3.svg.brush(),\n brushDirty,\n dimension,\n group,\n round;\n\n function chart(div) {\n var width = x.range()[1],\n height = y.range()[0];\n\n y.domain([0, group.top(1)[0].value]);\n\n div.each(function() {\n var div = d3.select(this),\n g = div.select(\"g\");\n\n // Create the skeletal chart.\n if (g.empty()) {\n div.select(\".title\").append(\"a\")\n .attr(\"href\", \"javascript:reset(\" + id + \")\")\n .attr(\"class\", \"reset\")\n .text(\"reset\")\n .style(\"display\", \"none\");\n\n g = div.append(\"svg\")\n .attr(\"width\", width + margin.left + margin.right)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n g.append(\"clipPath\")\n .attr(\"id\", \"clip-\" + id)\n .append(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n g.selectAll(\".bar\")\n .data([\"background\", \"foreground\"])\n .enter().append(\"path\")\n .attr(\"class\", function(d) { return d + \" bar\"; })\n .datum(group.all());\n\n g.selectAll(\".foreground.bar\")\n .attr(\"clip-path\", \"url(#clip-\" + id + \")\");\n\n g.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(0,\" + height + \")\")\n .call(axis);\n\n // Initialize the brush component with pretty resize handles.\n var gBrush = g.append(\"g\").attr(\"class\", \"brush\").call(brush);\n gBrush.selectAll(\"rect\").attr(\"height\", height);\n gBrush.selectAll(\".resize\").append(\"path\").attr(\"d\", resizePath);\n }\n\n // Only redraw the brush if set externally.\n if (brushDirty) {\n brushDirty = false;\n g.selectAll(\".brush\").call(brush);\n div.select(\".title a\").style(\"display\", brush.empty() ? \"none\" : null);\n if (brush.empty()) {\n g.selectAll(\"#clip-\" + id + \" rect\")\n .attr(\"x\", 0)\n .attr(\"width\", width);\n } else {\n var extent = brush.extent();\n g.selectAll(\"#clip-\" + id + \" rect\")\n .attr(\"x\", x(extent[0]))\n .attr(\"width\", x(extent[1]) - x(extent[0]));\n }\n }\n\n g.selectAll(\".bar\").attr(\"d\", barPath);\n });\n\n function barPath(groups) {\n var path = [],\n i = -1,\n n = groups.length,\n d;\n while (++i < n) {\n d = groups[i];\n path.push(\"M\", x(d.key), \",\", height, \"V\", y(d.value), \"h9V\", height);\n }\n return path.join(\"\");\n };\n\n function resizePath(d) {\n var e = +(d == \"e\"),\n x = e ? 1 : -1,\n y = height / 3;\n return \"M\" + (.5 * x) + \",\" + y\n + \"A6,6 0 0 \" + e + \" \" + (6.5 * x) + \",\" + (y + 6)\n + \"V\" + (2 * y - 6)\n + \"A6,6 0 0 \" + e + \" \" + (.5 * x) + \",\" + (2 * y)\n + \"Z\"\n + \"M\" + (2.5 * x) + \",\" + (y + 8)\n + \"V\" + (2 * y - 8)\n + \"M\" + (4.5 * x) + \",\" + (y + 8)\n + \"V\" + (2 * y - 8);\n };\n }\n\n brush.on(\"brushstart.chart\", function() {\n var div = d3.select(this.parentNode.parentNode.parentNode);\n div.select(\".title a\").style(\"display\", null);\n });\n\n brush.on(\"brush.chart\", function() {\n var g = d3.select(this.parentNode),\n extent = brush.extent();\n if (round) g.select(\".brush\")\n .call(brush.extent(extent = extent.map(round)))\n .selectAll(\".resize\")\n .style(\"display\", null);\n g.select(\"#clip-\" + id + \" rect\")\n .attr(\"x\", x(extent[0]))\n .attr(\"width\", x(extent[1]) - x(extent[0]));\n dimension.filterRange(extent);\n });\n\n brush.on(\"brushend.chart\", function() {\n if (brush.empty()) {\n var div = d3.select(this.parentNode.parentNode.parentNode);\n div.select(\".title a\").style(\"display\", \"none\");\n div.select(\"#clip-\" + id + \" rect\").attr(\"x\", null).attr(\"width\", \"100%\");\n dimension.filterAll();\n }\n });\n\n chart.margin = function(_) {\n if (!arguments.length) return margin;\n margin = _;\n return chart;\n };\n\n chart.x = function(_) {\n if (!arguments.length) return x;\n x = _;\n axis.scale(x);\n brush.x(x);\n return chart;\n };\n\n chart.y = function(_) {\n if (!arguments.length) return y;\n y = _;\n return chart;\n };\n\n chart.dimension = function(_) {\n if (!arguments.length) return dimension;\n dimension = _;\n return chart;\n };\n\n chart.filter = function(_) {\n if (_) {\n brush.extent(_);\n dimension.filterRange(_);\n } else {\n brush.clear();\n dimension.filterAll();\n }\n brushDirty = true;\n return chart;\n };\n\n chart.group = function(_) {\n if (!arguments.length) return group;\n group = _;\n return chart;\n };\n\n chart.round = function(_) {\n if (!arguments.length) return round;\n round = _;\n return chart;\n };\n\n return d3.rebind(chart, brush, \"on\");\n}", "title": "" }, { "docid": "b0ef5112e91a6a77d45e5f53fd59addc", "score": "0.5086046", "text": "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Polar is also calculated in assumptive linear layout here.\n // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n}", "title": "" }, { "docid": "b0ef5112e91a6a77d45e5f53fd59addc", "score": "0.5086046", "text": "function calculateCategoryInterval(axis) {\n var params = fetchAutoCategoryIntervalCalculationParams(axis);\n var labelFormatter = makeLabelFormatter(axis);\n var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI;\n var ordinalScale = axis.scale;\n var ordinalExtent = ordinalScale.getExtent(); // Providing this method is for optimization:\n // avoid generating a long array by `getTicks`\n // in large category data case.\n\n var tickCount = ordinalScale.count();\n\n if (ordinalExtent[1] - ordinalExtent[0] < 1) {\n return 0;\n }\n\n var step = 1; // Simple optimization. Empirical value: tick count should less than 40.\n\n if (tickCount > 40) {\n step = Math.max(1, Math.floor(tickCount / 40));\n }\n\n var tickValue = ordinalExtent[0];\n var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue);\n var unitW = Math.abs(unitSpan * Math.cos(rotation));\n var unitH = Math.abs(unitSpan * Math.sin(rotation));\n var maxW = 0;\n var maxH = 0; // Caution: Performance sensitive for large category data.\n // Consider dataZoom, we should make appropriate step to avoid O(n) loop.\n\n for (; tickValue <= ordinalExtent[1]; tickValue += step) {\n var width = 0;\n var height = 0; // Polar is also calculated in assumptive linear layout here.\n // Not precise, do not consider align and vertical align\n // and each distance from axis line yet.\n\n var rect = textContain.getBoundingRect(labelFormatter(tickValue), params.font, 'center', 'top'); // Magic number\n\n width = rect.width * 1.3;\n height = rect.height * 1.3; // Min size, void long loop.\n\n maxW = Math.max(maxW, width, 7);\n maxH = Math.max(maxH, height, 7);\n }\n\n var dw = maxW / unitW;\n var dh = maxH / unitH; // 0/0 is NaN, 1/0 is Infinity.\n\n isNaN(dw) && (dw = Infinity);\n isNaN(dh) && (dh = Infinity);\n var interval = Math.max(0, Math.floor(Math.min(dw, dh)));\n var cache = inner(axis.model);\n var lastAutoInterval = cache.lastAutoInterval;\n var lastTickCount = cache.lastTickCount; // Use cache to keep interval stable while moving zoom window,\n // otherwise the calculated interval might jitter when the zoom\n // window size is close to the interval-changing size.\n\n if (lastAutoInterval != null && lastTickCount != null && Math.abs(lastAutoInterval - interval) <= 1 && Math.abs(lastTickCount - tickCount) <= 1 // Always choose the bigger one, otherwise the critical\n // point is not the same when zooming in or zooming out.\n && lastAutoInterval > interval) {\n interval = lastAutoInterval;\n } // Only update cache if cache not used, otherwise the\n // changing of interval is too insensitive.\n else {\n cache.lastTickCount = tickCount;\n cache.lastAutoInterval = interval;\n }\n\n return interval;\n}", "title": "" }, { "docid": "b8365d5dde17c9388747fff829f11240", "score": "0.50599885", "text": "function calculateBase(groupItem) {\n var baseAxis = groupItem.axis;\n var seriesModels = groupItem.seriesModels;\n var seriesCount = seriesModels.length;\n var boxWidthList = groupItem.boxWidthList = [];\n var boxOffsetList = groupItem.boxOffsetList = [];\n var boundList = [];\n var bandWidth;\n\n if (baseAxis.type === 'category') {\n bandWidth = baseAxis.getBandWidth();\n } else {\n var maxDataCount_1 = 0;\n each(seriesModels, function (seriesModel) {\n maxDataCount_1 = Math.max(maxDataCount_1, seriesModel.getData().count());\n });\n var extent = baseAxis.getExtent();\n bandWidth = Math.abs(extent[1] - extent[0]) / maxDataCount_1;\n }\n\n each(seriesModels, function (seriesModel) {\n var boxWidthBound = seriesModel.get('boxWidth');\n\n if (!zrUtil.isArray(boxWidthBound)) {\n boxWidthBound = [boxWidthBound, boxWidthBound];\n }\n\n boundList.push([parsePercent(boxWidthBound[0], bandWidth) || 0, parsePercent(boxWidthBound[1], bandWidth) || 0]);\n });\n var availableWidth = bandWidth * 0.8 - 2;\n var boxGap = availableWidth / seriesCount * 0.3;\n var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;\n var base = boxWidth / 2 - availableWidth / 2;\n each(seriesModels, function (seriesModel, idx) {\n boxOffsetList.push(base);\n base += boxGap + boxWidth;\n boxWidthList.push(Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1]));\n });\n}", "title": "" }, { "docid": "678d99fad3d548369ce0934b79245849", "score": "0.50566435", "text": "monsterBarStyles() {\n\t\t\tif (this.monsterHealth <= 0) {\n\t\t\t\treturn { width: \"0%\" };\n\t\t\t}\n\t\t\treturn { width: this.monsterHealth + \"%\" };\n\t\t}", "title": "" }, { "docid": "409deac4149cc92145826362aabbb236", "score": "0.50500226", "text": "drawHorizontal() {\n this.drawing = true;\n const realWidth = this.container.clientWidth - this.padding.right - this.padding.left;\n const viewboxWidthScale = 100 / realWidth;\n const barCount = this.data.length;\n const textWidth = this.data.reduce((p, c) => Math.max(p, c.label !== undefined && c.label.length > 0 ? (20 + c.label.length * 7.5) * viewboxWidthScale : 0), 0); // 7.5 per char \n const barWidth = 100 - textWidth;\n const barHeight = this.barSize;\n\n if (this.adjustSize) {\n const height = (barCount + this.distance) * barHeight + this.padding.top + this.padding.bottom;\n this.container.style.height = `${height}px`;\n }\n\n const realHeight = this.container.clientHeight - this.padding.top - this.padding.bottom;\n const viewboxHeightScale = realHeight / 100;\n const barSpacing = Math.max(this.minDistance, this.distance === 'variable' ? (100 * viewboxHeightScale - (this.scale.visible ? 30 : 0)) / barCount - barHeight : this.distance);\n\n // Find max value\n let max = 0\n if(this.max === 'relative') {\n max = this.data.reduce((p, c) => Math.max(p, c.datasets.reduce((p, c) => p + c.value, 0)), 0);\n } else {\n max = this.max;\n }\n\n const valueMap = {};\n\n if(viewboxHeightScale <= 0) {\n clear(this.container);\n return;\n }\n \n this.svg = Draw.svg(`calc(100% - ${this.padding.right + this.padding.left}px)`, `calc(100% - ${this.padding.top + this.padding.bottom}px)`, 100, 100 * viewboxHeightScale);\n\n // Padding\n this.svg.style.paddingTop = this.padding.top;\n this.svg.style.paddingRight = this.padding.right;\n this.svg.style.paddingBottom = this.padding.bottom;\n this.svg.style.paddingLeft = this.padding.left;\n this.svg.style.boxSizing = \"initial\";\n\n // Draw scale\n const scaleStepSize = barWidth / Math.floor(max / this.scale.interval);\n\n if(this.scale.visible) {\n for(let i = 1; i < Math.floor(max / this.scale.interval); i++) { // Skip the first bar\n const line = Draw.rect(i * scaleStepSize, 30, 1 * viewboxWidthScale, realHeight, this.scale.color);\n this.svg.appendChild(line);\n }\n }\n\n // Draw data\n this.dataContainer = Draw.group();\n this.svg.appendChild(this.dataContainer);\n\n for (let i = 0; i < barCount; i++) {\n const label = this.data[i].label || \"\";\n\n const rx = barHeight / 2 * viewboxWidthScale;\n const ry = barHeight / 2;\n\n const background = Draw.path(\n `M ${textWidth + rx}, ${(this.scale.visible ? 30 : 0) + (i + 0.5) * barSpacing + i * barHeight} a ${rx},${ry} 0 0 0 0,${barHeight} h ${barWidth - rx * 2} a ${rx},${ry} 0 0 0 0,${-barHeight} z`,\n this.backgroundColor,\n {\"shape-rendering\": \"crispEdges\"}\n );\n this.dataContainer.appendChild(background);\n\n let x = 0; // width of the bar. Contains the position at which to draw the next rectangle\n\n for (let j = 0; j < this.data[i].datasets.length; j++) {\n const value = this.data[i].datasets[j].value || 0;\n const title = this.data[i].datasets[j].title || \"\";\n let color = this.data[i].datasets[j].color || \"\";\n\n if(color === \"\") {\n if(this.fixColorToTitle){\n if (!(title in valueMap)) { // sub-category has not be encountered before\n color = this.foregroundColors[Object.keys(valueMap).length % this.foregroundColors.length];\n valueMap[title] = color;\n } else {\n color = valueMap[title];\n }\n } else {\n color = this.foregroundColors[j % this.foregroundColors.length];\n }\n }\n\n const width = (barWidth * value / max);\n if(width > 0 && x < barWidth) {\n const foreground = Draw.path(\n createHorizontalBar(textWidth, (this.scale.visible ? 30 : 0) + (i + 0.5) * barSpacing + i * barHeight, rx, ry, width, x, barWidth),\n color,\n {\"shape-rendering\": \"crispEdges\"}\n );\n\n if (this.hover.visible) {\n foreground.addEventListener('mouseenter', evt => { this.showTooltip(true, foreground, value, title) });\n foreground.addEventListener(\"mouseleave\", evt => { this.showTooltip(false) });\n }\n \n if (x < barWidth) { // only draw the part if it would not overshoot\n this.dataContainer.appendChild(foreground);\n }\n \n x = x + width;\n } \n }\n\n const text = Draw.text(0, (this.scale.visible ? 30 : 0) + (i + 0.5) * (barSpacing + barHeight), label, this.textColor, this.font, { \"text-anchor\": \"start\", \"alignment-baseline\": \"central\", \"style\": \"user-select: none;\" });\n text.setAttribute(\"transform\", `scale(${viewboxWidthScale},1) translate(${parseFloat(text.getAttribute(\"x\")) / viewboxWidthScale - parseFloat(text.getAttribute(\"x\"))}, 0)`);\n this.dataContainer.appendChild(text);\n }\n\n // Draw scale text\n if(this.scale.visible) {\n const rect = Draw.rect(0, 0, 100, 30, \"white\");\n this.svg.appendChild(rect);\n for(let i = 1; i < Math.floor(max / this.scale.interval); i++) { // Skip the first bar\n const text = Draw.text(i * scaleStepSize, 20, i * this.scale.interval, this.textColor, this.font, { \"text-anchor\": \"middle\", \"style\": \"user-select: none;\" });\n text.setAttribute(\"transform\", `scale(${viewboxWidthScale},1) translate(${parseFloat(text.getAttribute(\"x\")) / viewboxWidthScale - parseFloat(text.getAttribute(\"x\"))}, 0)`);\n this.svg.appendChild(text);\n }\n }\n\n clear(this.container);\n this.tooltip = undefined;\n this.container.appendChild(this.svg);\n\n if(this.draggable) {\n let startPos;\n let currentTranslate = 0;\n \n this.svg.addEventListener('mousedown',e => startPos = e.clientY);\n this.svg.addEventListener(\"mousemove\", e => {\n if(startPos) {\n let newPos = currentTranslate + e.clientY - startPos;\n newPos = Math.min(0, newPos);\n newPos = Math.max(newPos, -Math.max(0, (this.scale.visible ? 30 : 0) + 0.5 * barSpacing + this.dataContainer.getBoundingClientRect().height - realHeight));\n\n this.dataContainer.style.transform = `translateY(${newPos}px)`;\n } else {\n currentTranslate = parseFloat(this.dataContainer.style.transform.replace(\"translateY(\", \"\").replace(\"px)\", \"\")) || 0;\n }\n });\n document.addEventListener('mouseup', () => startPos = undefined);\n }\n\n this.svg.addEventListener(\"wheel\", this.onScroll);\n this.drawing = false;\n }", "title": "" }, { "docid": "58856405b3a5a0e1c1354037184d0d04", "score": "0.5047983", "text": "function hideBars(variable) {\n var counterbars = 0;\n for (var i = 0; i < limitedVars.length; i++) {\n if (variable == limitedVars[i]) {\n d3.selectAll(\".bar-group-ph\").selectAll(\".category-ph.White\").attr(\"display\", \"none\")\n d3.selectAll(\".bar-group-ph\").selectAll(\".category-ph.Nonwhite\").attr(\"display\", \"none\")\n d3.selectAll(\".bar_ph\").select(\"svg\").attr(\"height\", 80)\n d3.selectAll(\".label\").select(\".svg2\").attr(\"height\", 38)\n counterbars += 1;\n }\n }\n if (counterbars === 0) {\n var bar_phHeight = (IS_PHONESM == true) ? 200 : 173;\n d3.selectAll(\".bar-group-ph\").selectAll(\".category-ph.White\").attr(\"display\", \"block\")\n d3.selectAll(\".bar-group-ph\").selectAll(\".category-ph.Nonwhite\").attr(\"display\", \"block\")\n d3.selectAll(\".bar_ph\").select(\"svg\").attr(\"height\", bar_phHeight)\n d3.selectAll(\".label\").select(\".svg2\").attr(\"height\", 130)\n\n }\n}", "title": "" }, { "docid": "9cd38063479cbac8d3cec6f3d3e98d30", "score": "0.5045438", "text": "function makeLinearBar_Number(data,cf,ID,height,width,questionWith_,uniqItemsCount){\n\t//console.log(\"ID for question \"+questionWith_+\" is \",ID)\n\tvar d3scale = d3.scale.linear()\n\t///// need to investigate this more !!!!! //////// \n\tvar min = d3.min(data, function(d) { return d[questionWith_];})\n\tvar max = d3.max(data, function(d) { return d[questionWith_];})\n\tvar prec = 1\n\tif (max - min > 10){\n\t\tprec = (max - min) / uniqItemsCount\n \t}\n \t// else if()}{}\n\td3scale = d3.scale.linear().domain([min,max])\n\t//d3scale = d3.scale.linear().domain([0, 100])\n\tvar Dim = cf.dimension(function(d){ return d[questionWith_];});\n\tvar dimGroup = Dim.group();\n\tvar barChart = dc.barChart(\"#\"+ID)\n\t\t\t//.renderLabel(true)\n\t\t\t.height(height)\n .width(width)\n .dimension(Dim)\n .group(dimGroup)\n .elasticY(true)\n ///// might need to get fancier with domain!!!!!!\n //.x(d3.scale.linear().domain([20, 70]))\n .x(d3scale)\n \t.xUnits(dc.units.fp.precision(prec));\n}", "title": "" }, { "docid": "d0a3a4af5be5e603414c05404fea5bf5", "score": "0.50346106", "text": "function RectWidth(d, plot) {\n if (plot.typeX === \"categorical\") {\n return plot.dom.width / (plot.lengthAtt1 - 1 - 1);\n }\n const index = Math.floor(d.index / plot.m);\n let dif;\n if (index < plot.binsAtt1.length - 1) {\n dif = Math.abs(plot.binsAtt1[index + 1] - plot.binsAtt1[index]);\n } else {\n dif = (1 / plot.lengthAtt1 * Math.abs(plot.binsAtt1[plot.lengthAtt1 - 1] - plot.binsAtt1[1])) * 5;\n }\n return (dif / plot.rangeAtt1 * plot.dom.cWidth) * 0.9;\n}", "title": "" }, { "docid": "13d911b4a5ab8d5d089685a6232e2108", "score": "0.50276726", "text": "function getBarchart(max, value, color, bgcolor, width, height, point, displayValue, displayAll) {\n if(!width) width = \"100%\";\n if(!height) height = 20;\n if(!color) color = \"#ff0000\";\n if(!bgcolor) bgcolor = \"orange\";\n if(!point) point = 0;\n if(!displayValue) displayValue = false;\n if(!displayAll) displayAll = false;\n\n var rate = max > 0 ? (parseInt(value) / max) * 100 : 0;\n\n var bar = '<table width=\"' + width + '\" cellpadding=\"0\" cellspacing=\"0\" style=\"table-layout:fixed;\">';\n bar += '<tr>';\n if(rate > 0) bar += '<td width=\"' + Math.ceil(rate) + '%\"><div style=\"height:' + (height/2 - 1) + 'px;background:' + color + ';filter:alpha(opacity=50);opacity:0.5;\"><!--ie--></div></td>';\n bar += '<td height=\"' + (height/2 - 1) + '\" bgcolor=\"' + bgcolor + '\"><!--ie--></td>';\n bar += '</tr>';\n bar += '<tr>';\n if(rate > 0) bar += '<td width=\"' + Math.ceil(rate) + '%\"><div style=\"height:' + (height/2 + 1) + 'px;background:' + color + ';filter:alpha(opacity=100);opacity:1;\"><!--ie--></div></td>';\n bar += '<td height=\"' + (height/2 + 1) + '\" bgcolor=\"' + bgcolor + '\"><!--ie--></td>';\n bar += '</tr>';\n bar += '<tr>';\n if(rate > 0) bar += '<td></td>';\n bar += '<td align=\"left\" class=\"_grp_container_\">'\n + ' <div style=\"position:relative;\">'\n + ' <div class=\"_grp_tip_\" style=\"position:absolute;top:-' + (height > 10 ? Math.round(height/2) + 5 : height) + 'px;left:1px;font-size:10px;font-family:굴림;\">'\n + '<nobr>' + (displayAll ? (displayValue ? value+ '(' + number_format(rate, point) + '%)' : number_format(rate, point) + '%') : \"\") + '</nobr>'\n + ' </div>'\n + ' </div>'\n + '</td>'\n + '</tr>'\n + '</table>';\n document.write(bar);\n}", "title": "" }, { "docid": "870fcd0f95a7b9860e9bc37cfac5d80c", "score": "0.5023241", "text": "function createHistogram(scores, options) { \n // need to generate bucket names differently for type == 'range'\n if(options.type == 'auto') { \n var counts = _.countBy(scores, x => { \n if(isNaN(x)) { return 0; }\n else { return Math.floor(x / options.bucketsize) * options.bucketsize; }\n });\n var keys = _.keys(counts);\n var nums = _.map(keys, x => parseInt(x, 10));\n var ordered = _.sortBy(nums, x => x);\n if(options.labels == 'exact') { \n return _.map(ordered, (x, i) => ({order: i, key: x, value: counts[x]}));\n } else if(options.labels == 'range') { \n return _.map(ordered, (x, i) => ({\n order: i, \n value: counts[x], \n key: x + \"-\" + (x+options.bucketsize-1)\n }));\n } else if(options.labels == 'decades') { \n return _.map(ordered, (x, i) => ({\n order: i,\n value: counts[x],\n key: x + \"'s\"\n }));\n }\n } else if(options.type == 'manual') {\n var counts = _.countBy(scores, x => { \n if(isNaN(x)) { x = 0; } // is this legal?\n for(var i = 0; i < options.buckets.length; i++) {\n var b = options.buckets[i];\n if(x >= b.min && x <= b.max) { \n return b.label;\n }\n }\n return \"uncategorized\";\n });\n\n var ordering = { \"uncategorized\": options.buckets.length };\n _.each(options.buckets, (b,i) => ordering[b.label] = i);\n\n return _.map(_.keys(counts), \n x => ({ order: ordering[x], key: x, value: counts[x] })\n );\n\n } else { \n throw \"type must be 'auto' or 'manual'\";\n }\n}", "title": "" }, { "docid": "53c2c2f90455641588afadf348b4745e", "score": "0.5017181", "text": "function setBarChartType() {\n if (windowWidth >= 1000) { verticalBarChart = true; }\n}", "title": "" }, { "docid": "3bc1940076df7e15bf88e0ae4729437a", "score": "0.5013396", "text": "function bar_postrender(chart, userOpts) {\n for (var s = 0; s < chart.series.length; s++) {\n var borderColor = chart.series[s].userOptions.borderColor;\n for (var d = 0; d < chart.series[s].points.length; d++) {\n if (chart.series[s].points[d].y != 0 && chart.series[s].visible) {\n var barcapWidth = 4;\n var lgth = chart.series[s].points[d].shapeArgs.width;\n var hgt = chart.series[s].points[d].shapeArgs.height;\n var xcor = (chart.plotTop + chart.plotHeight - chart.series[s].points[d].shapeArgs.x - lgth);\n var ycor = (chart.plotLeft + hgt);\n chart.renderer.rect(ycor, xcor, barcapWidth, lgth, 0)\n .attr({\n fill: borderColor,\n 'stroke-width': 1,\n stroke: borderColor,\n zIndex: 3,\n class: 'custom-remove bar-chart-rect'\n })\n .add();\n }\n }\n }\n }", "title": "" }, { "docid": "b4a1e6d9a0e2ce11785c093b3bacf94b", "score": "0.49994463", "text": "function getBarExtent() {\n var repExtent = getExtent(\"Representatives\"),\n electoralExtent = getExtent(\"Electoral Votes\");\n return [d3v3.min([repExtent[0], electoralExtent[0]]), d3v3.max([repExtent[1], electoralExtent[1]])];\n }", "title": "" }, { "docid": "56b67170f133cc3b14c4a5478f64d8ec", "score": "0.49898943", "text": "function calcBars() {\n var margin, space, barWidth, rects, nb, g, data;\n\n (function() {\n margin = 50;\n space = 10;\n barWidth = 20;\n\n nb = Math.floor((w - margin * 5) / (barWidth + space));\n margin = (w - (nb * (barWidth + space))) / 2;\n\n g = svg.append('g')\n .attr('id', 'bars');\n\n data = d3.range(nb).map(function(d) {\n var pos = Math.random() < .5 ? -1 : 1,\n height = 20 + Math.random() * (h / 2 - 20 - 20),\n h1 = 5 + Math.random() * (height / 2 - 10),\n h2 = 5 + Math.random() * (height / 2 - 10),\n h3 = height - h1 - h2;\n\n return {\n pos: pos,\n height: height,\n cumul: [h1, h2, h3]\n };\n });\n\n rects = g.selectAll('rect')\n .remove()\n .data(d3.range(nb * 3))\n .enter()\n .append('rect')\n .datum(function(d, i) {\n var opacity = 1.0;\n if (data[~~(i / 3)].pos < 0) {\n if (i % 3 === 1) {\n opacity = .6;\n } else if (i % 3 === 2) {\n opacity = .3;\n }\n } else {\n if (i % 3 === 1) {\n opacity = .6;\n } else if (i % 3 === 0) {\n opacity = .3;\n }\n }\n return {\n opacity: opacity,\n pos: data[~~(i / 3)].pos,\n height: data[~~(i / 3)].height\n };\n });\n\n step1();\n })();\n\n\n // small bars graph\n function step1() {\n var count = 0;\n\n rects\n .attr({\n opacity: 1.0,\n fill: 'white',\n y: h / 2,\n width: 8,\n height: 0\n })\n .attr('x', function(d, i) {\n return margin + space / 2 + (barWidth + space) * ~~(i / 3) + (i % 3) * 11;\n })\n .transition()\n .delay(function(d, i) {\n return i * 10;\n })\n .attr('height', function(d, i) {\n return data[~~(i / 3)].cumul[i % 3];\n })\n .attr('y', function(d, i) {\n return d.pos < 0 ? h / 2 - (data[~~(i / 3)].cumul[i % 3]) : h / 2;\n })\n .transition()\n .duration(300)\n .each('end', function() {\n count++;\n if (count === nb * 3) step2();\n });\n }\n\n // stack bars\n function step2() {\n var count = 0;\n\n rects\n .transition()\n .attr('y', function(d, i) {\n var y;\n if (d.pos < 0) {\n y = h / 2 - d.height;\n } else {\n y = h / 2;\n }\n for (var n = 0; n < i % 3; n++) {\n y += data[~~(i / 3)].cumul[n];\n }\n return y;\n })\n .transition()\n .attr('x', function(d, i) {\n return margin + space / 2 + (barWidth + space) * ~~(i / 3);\n })\n .attr('opacity', function(d) {\n return d.opacity;\n })\n .attr('width', barWidth)\n .transition()\n .duration(300)\n .each('end', function() {\n count++;\n if (count === nb * 3) step3();\n })\n }\n\n // large bars graph\n function step3() {\n var count = 0;\n\n rects\n .transition()\n .duration(300)\n .attr('height', function(d, i) {\n var _h = 0;\n if (d.pos < 0) {\n if (i % 3 === 0) {\n _h = Math.abs(d.height);\n }\n } else {\n if (i % 3 === 2) {\n _h = Math.abs(d.height);\n }\n }\n\n return _h;\n })\n .attr('y', function(d, i) {\n var _y = h / 2;\n if (d.pos < 0) {\n if (i % 3 === 0) {\n _y = h / 2 - d.height;\n }\n }\n return _y;\n })\n .each('end', function() {\n count++;\n if (count === nb * 3) step4();\n });\n }\n\n function step4() {\n var last = 0,\n count = 0;\n\n var sortedHeights = data.map(function(d) {\n return d.height * d.pos;\n }).sort(function(a, b) {\n return -(a - b);\n });\n\n rects\n .datum(function(d, i) {\n var index = sortedHeights.indexOf(d.height * d.pos);\n if (index == last) {\n index++;\n }\n last = index;\n return {\n orderedIndex: index\n }\n })\n .transition()\n .duration(500)\n .attr('x', function(d) {\n return margin + space / 2 + (barWidth + space) * d.orderedIndex;\n })\n .transition()\n .duration(300)\n .each('end', function() {\n count++;\n if (count === data.length) step5();\n });\n }\n\n // disapperaing large bars\n function step5() {\n var count = 0;\n\n rects\n .transition()\n .duration(300)\n .attr({\n y: h / 2,\n height: 0\n })\n .each('end', function() {\n count++;\n if (count === nb * 3) endStep();\n });\n }\n\n function endStep() {\n rects.remove();\n g.remove();\n\n anim3();\n }\n }", "title": "" }, { "docid": "a007c4b2f7ce46ce3deda6a922a09075", "score": "0.498592", "text": "function extended(dmin, dmax, m, width, label_width, Q, only_loose, w) {\n // ============================ SUBROUTINES =================================\n function simplicity_(q, Q, j, lmin, lmax, lstep)\n {\n var eps = 1E-12;\n var n = Q.length;\n for (var i = 0; i < Q.length; i++) {\n if (q == Q[i]) break;\n }\n var v = ((lmin % lstep) < eps || (lstep - (lmin % lstep)) < eps) \n && lmin <= 0 && lmax >=0 ? 1 : 0;\n return (1 - i/(n-1) - j + v);\n }\n\n function simplicity_max_(q, Q, j)\n {\n var n = Q.length;\n for (var i = 0; i < Q.length; i++) {\n if (q == Q[i]) break;\n }\n var v = 1;\n return(1 - i/(n-1) - j + v);\n }\n\n function coverage_(dmin, dmax, lmin, lmax)\n {\n var range = dmax-dmin;\n return(1 - 0.5 * \n (Math.pow(dmax-lmax,2)+Math.pow(dmin-lmin,2)) /\n Math.pow(0.1*range,2));\n }\n\n function coverage_max_(dmin, dmax, span)\n {\n var range = dmax - dmin;\n if(span > range) {\n var half2 = Math.pow((span-range)/2, 2);\n return (1 - half2 / Math.pow(0.1 * range,2));\n } else {\n return (1);\n }\n }\n\n function density_(k, m, dmin, dmax, lmin, lmax)\n {\n var r = (k-1) / (lmax-lmin);\n var rt = (m-1) / (Math.max(lmax,dmax)-Math.min(dmin,lmin));\n return(2 - Math.max( r/rt, rt/r ));\n }\n\n function density_max_(k, m) {\n return(k >= m ? 2 - (k-1)/(m-1) : 1);\n }\n\n function legibility_(lmin, lmax, lstep, width, label_width) {\n var width_max = lstep*width/(lmax-lmin);\n if (width_max < 10) return(-1E10);\n for (var l = lmin; l <= lmax; l += lstep) {\n var w = label_width(String(l));\n if (w > width_max) return(-1E10);\n }\n return(1);\n }\n\n function legibility_max_(lmin, lmax, lstep, width) {\n return(1);\n }\n\n // =============================== MAIN =====================================\n dmin = Number(dmin);\n dmax = Number(dmax);\n m = Number(m);\n kmax = Math.ceil(6*m);\n width = width ||100;\n label_width = label_width || function(f) { return 0;};\n Q = Q || [1, 5, 2, 2.5, 4, 3];\n only_loose = only_loose || false;\n w = w || [0.25, 0.2, 0.5, 0.05];\n var eps = 1E-12;\n\t\n if (dmin > dmax) {\n var temp = dmin;\n dmin = dmax;\n dmax = temp;\n }\n\n if(dmax - dmin < eps) {\n // if the range is near the floating point limit,\n // generate some equally spaced steps.\n var step = (dmax - dmin) / m;\n var labels = [];\n var label = dmin;\n for (var i = 0; i < m; ++i) {\n labels.push(label);\n label += step;\n }\n return(seq(from=dmin, to=dmax, length.out=m))\n }\n\n var n = Q.length;\n var best = {\n 'lmin' : dmin,\n 'lmax' : dmax,\n 'lstep' : (dmax - dmin),\n 'score' : -2\n };\n\t\n var j = 1;\n while(j < 1E3) {\n for(var q in Q)\n {\n var sm = simplicity_max_(q, Q, j);\n if((w[0]*sm+w[1]+w[2]+w[3]) < best.score) {\n j = 1E7;\n break;\n }\n // loop over tick count\n for (var k = 2; k < kmax; ++k) {\n var dm = density_max_(k, m); // C#: double dm = max_density(k/space, density);\n\n if((w[0]*sm+w[1]+w[2]*dm+w[3]) < best.score) break;\n \n delta = (dmax-dmin)/(k+1)/j/q;\n var z = Math.ceil(Math.log(delta)/Math.log(10));\n\n while(z < 1E6) {\t\t\t\n var step = j * q * Math.pow(10,z);\n\n var cm = coverage_max_(dmin, dmax, step*(k-1));\n\n if ((w[0]*sm+w[1]*cm+w[2]*dm+w[3]) < best.score) break;\n \n var min_start = Math.floor(dmax/step - (k-1))*j;\n var max_start = Math.ceil(dmin/step)*j;\n\n for (var start = min_start; start <= max_start; ++start) {\n var lmin = start * (step/j);\n var lmax = lmin + step*(k-1);\n\n var s = simplicity_(q, Q, j, lmin, lmax, step);\n var d = density_(k, m, dmin, dmax, lmin, lmax);\n var c = coverage_(dmin, dmax, lmin, lmax);\n\n if ((w[0]*s+w[1]*c+w[2]*d+w[3]) < best.score) continue;\n\n var l = legibility_(lmin, lmax, step, width, label_width);\n\n var score = w[0]*s + w[1]*c + w[2]*d + w[3]*l\n\n if(score > best.score && (!only_loose || (lmin <= dmin && lmax >= dmax))) {\n best = {\"lmin\" : lmin, \"lmax\" : lmax, \"lstep\" : step, \"score\" : score};\n }\n }\n z = z + 1;\n }\n }\n }\n j = j + 1;\n }\n\n // generate label positions\n var labels = [];\n for (var l = best.lmin; l <= best.lmax; l += best.lstep) {\n labels.push(l);\n }\n return(labels);\n}", "title": "" }, { "docid": "799e99915682f27f1aa55f8d993c6d3e", "score": "0.49778688", "text": "_getRandomBarHeight() {\n return Math.random() * ((this.state.graphHeight*2/3) - 0) + 0;\n }", "title": "" }, { "docid": "4b441fb2b5b52c50ffbfbfcecf5ad7cc", "score": "0.49742454", "text": "function getBars(props, moreProps) {\n\tvar baseAt = props.baseAt,\n\t fill = props.fill,\n\t stroke = props.stroke,\n\t yAccessor = props.yAccessor;\n\tvar xScale = moreProps.xScale,\n\t xAccessor = moreProps.xAccessor,\n\t plotData = moreProps.plotData,\n\t yScale = moreProps.chartConfig.yScale;\n\n\n\tvar getFill = (0, _utils.functor)(fill);\n\tvar getBase = (0, _utils.functor)(baseAt);\n\n\tvar widthFunctor = (0, _utils.functor)(props.width);\n\n\tvar width = widthFunctor(props, {\n\t\txScale: xScale,\n\t\txAccessor: xAccessor,\n\t\tplotData: plotData\n\t});\n\t/*\n const barWidth = Math.round(width);\n const offset = Math.round(barWidth === 1 ? 0 : 0.5 * barWidth);\n */\n\tvar offset = Math.floor(0.5 * width);\n\n\tvar bars = plotData.filter(function (d) {\n\t\treturn (0, _utils.isDefined)(yAccessor(d));\n\t}).map(function (d) {\n\t\tvar yValue = yAccessor(d);\n\t\tvar y = yScale(yValue);\n\n\t\tvar x = Math.round(xScale(xAccessor(d))) - offset;\n\t\tvar h = getBase(xScale, yScale, d) - yScale(yValue);\n\n\t\tif (h < 0) {\n\t\t\ty = y + h;\n\t\t\th = -h;\n\t\t}\n\n\t\treturn {\n\t\t\t// type: \"line\"\n\t\t\tx: x,\n\t\t\ty: Math.round(y),\n\t\t\theight: Math.round(h),\n\t\t\twidth: offset * 2,\n\t\t\tfill: getFill(d, 0),\n\t\t\tstroke: stroke ? getFill(d, 0) : \"none\"\n\t\t};\n\t});\n\n\treturn bars;\n}", "title": "" }, { "docid": "4b441fb2b5b52c50ffbfbfcecf5ad7cc", "score": "0.49742454", "text": "function getBars(props, moreProps) {\n\tvar baseAt = props.baseAt,\n\t fill = props.fill,\n\t stroke = props.stroke,\n\t yAccessor = props.yAccessor;\n\tvar xScale = moreProps.xScale,\n\t xAccessor = moreProps.xAccessor,\n\t plotData = moreProps.plotData,\n\t yScale = moreProps.chartConfig.yScale;\n\n\n\tvar getFill = (0, _utils.functor)(fill);\n\tvar getBase = (0, _utils.functor)(baseAt);\n\n\tvar widthFunctor = (0, _utils.functor)(props.width);\n\n\tvar width = widthFunctor(props, {\n\t\txScale: xScale,\n\t\txAccessor: xAccessor,\n\t\tplotData: plotData\n\t});\n\t/*\n const barWidth = Math.round(width);\n const offset = Math.round(barWidth === 1 ? 0 : 0.5 * barWidth);\n */\n\tvar offset = Math.floor(0.5 * width);\n\n\tvar bars = plotData.filter(function (d) {\n\t\treturn (0, _utils.isDefined)(yAccessor(d));\n\t}).map(function (d) {\n\t\tvar yValue = yAccessor(d);\n\t\tvar y = yScale(yValue);\n\n\t\tvar x = Math.round(xScale(xAccessor(d))) - offset;\n\t\tvar h = getBase(xScale, yScale, d) - yScale(yValue);\n\n\t\tif (h < 0) {\n\t\t\ty = y + h;\n\t\t\th = -h;\n\t\t}\n\n\t\treturn {\n\t\t\t// type: \"line\"\n\t\t\tx: x,\n\t\t\ty: Math.round(y),\n\t\t\theight: Math.round(h),\n\t\t\twidth: offset * 2,\n\t\t\tfill: getFill(d, 0),\n\t\t\tstroke: stroke ? getFill(d, 0) : \"none\"\n\t\t};\n\t});\n\n\treturn bars;\n}", "title": "" }, { "docid": "a46219fcc17581856ff16ee4657aed16", "score": "0.49623024", "text": "function computeBarPixelThickness(positionBinding, datasets, barWidthDimension) {\n var barPixelThickness;\n var positionScale = positionBinding.scale;\n if (positionScale instanceof Scales.Category) {\n barPixelThickness = positionScale.rangeBand();\n }\n else {\n var positionAccessor_1 = positionBinding.accessor;\n var numberBarAccessorData = d3.set(Utils.Array.flatten(datasets.map(function (dataset) {\n return dataset.data().map(function (d, i) { return positionAccessor_1(d, i, dataset); })\n .filter(function (d) { return d != null; })\n .map(function (d) { return d.valueOf(); });\n }))).values().map(function (value) { return +value; });\n numberBarAccessorData.sort(function (a, b) { return a - b; });\n var scaledData = numberBarAccessorData.map(function (datum) { return positionScale.scale(datum); });\n var barAccessorDataPairs = d3.pairs(scaledData);\n barPixelThickness = Utils.Math.min(barAccessorDataPairs, function (pair, i) {\n return Math.abs(pair[1] - pair[0]);\n }, barWidthDimension * Bar._SINGLE_BAR_DIMENSION_RATIO);\n barPixelThickness *= Bar._BAR_THICKNESS_RATIO;\n }\n return barPixelThickness;\n}", "title": "" }, { "docid": "0912161e25aa569328807af1edb4936b", "score": "0.4958741", "text": "function createBarChart(data){\nvar number = 0;\nvar totalDistance = 0.0; //Add together all Distances to find average\nvar singleDistance = 0.0; //Distance of each ride\nvar averageDistance = 0.0;//Average overall Distance\nvar count = data.length;\nvar miles = [\"0\",\"0.1\",\"0.2\", \"0.3\", \"0.4\", \"0.5\", \"0.6\", \"0.7\", \"0.8\", \"0.9\", \"1.0\" ,\"1.2\",\n\"1.4\",\"1.6\",\"1.8\",\"2.0\",\"2.5\",\"3\", \"3+\"]; // Array of different distances\nvar distance = [\"Amount of riders\",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];//19 length used to add each rider\n for(var i = 1; i < data.length-1; i ++){\n singleDistance = getDistanceFromLatLonInKm(parseFloat(data[i][5]), parseFloat(data[i][6]), parseFloat(data[i][8]), parseFloat(data[i][9]));\n //Some values were incorrect and returning NaN so I decided it best to just continue.\n if(isNaN(singleDistance)){\n count --;\n continue;\n }\n totalDistance += parseFloat(singleDistance);\n\n //Switch case to add each rider to the distance array based on the length of their ride\n switch(true) {\n case singleDistance <= 0:\n distance[1] ++;\n break;\n\n case singleDistance < 0.1 && singleDistance >= 0:\n distance[2] ++;\n break;\n\n case singleDistance < 0.2 && singleDistance >= 0.1:\n distance[3] ++;\n break;\n\n case singleDistance < 0.3 && singleDistance >= 0.2:\n distance[4] ++;\n break;\n\n case singleDistance < 0.4 && singleDistance >= 0.3:\n distance[5] ++;\n break;\n\n case singleDistance < 0.5 && singleDistance >= 0.4:\n distance[6] ++;\n break;\n\n case singleDistance < 0.6 && singleDistance >= 0.5:\n distance[7] ++;\n break;\n\n case singleDistance < 0.7 && singleDistance >= 0.6:\n distance[8] ++;\n break;\n\n case singleDistance < 0.8 && singleDistance >= 0.7:\n distance[9] ++;\n break;\n\n case singleDistance < 0.9 && singleDistance >= 0.8:\n distance[10] ++;\n break;\n\n case singleDistance < 1 && singleDistance >= 0.9:\n distance[11] ++;\n break;\n\n case singleDistance < 1.2 && singleDistance >= 1:\n distance[12] ++;\n break;\n\n case singleDistance < 1.4 && singleDistance >= 1.2:\n distance[13] ++;\n break;\n\n case singleDistance < 1.6 && singleDistance >= 1.4:\n distance[14] ++;\n break;\n\n case singleDistance < 1.8 && singleDistance >= 1.6:\n distance[15] ++;\n break;\n\n case singleDistance < 2 && singleDistance >= 1.8:\n distance[16] ++;\n break;\n\n case singleDistance < 2.5 && singleDistance >= 2:\n distance[17] ++;\n break;\n\n case singleDistance < 3 && singleDistance >= 2.5:\n distance[18] ++;\n break;\n\n default:\n distance[19] ++;\n break;\n }\n }\n\naverageDistance = parseFloat(totalDistance)/count;\n\n//First Bar Chart\nvar chart = c3.generate({\n padding: { //Stops graph from being cut off on the right side\n right: 20\n },\n bindto: '#barChart',\n data: {\n columns: [distance\n ],\n type: 'bar'\n },\n\n bar: {\n width: {\n ratio: 0.5\n }\n },\n axis: {\n rotated: true, // sideways bar chart\n x: {\n type: 'category',\n categories:miles,\n label:{\n text: 'Miles',\n position: 'outer-middle' // Miles text easier to identify\n },\n }\n },\n grid: {\n x: {\n lines: [ //Creates the red average distance line\n {value: averageDistance + 5.5,class: 'avgDist', text: 'Average Distance: ' + averageDistance.toFixed(2) + ' Miles'}\n ]\n }\n }\n});\n}", "title": "" }, { "docid": "f4fa9de29fd36400b5ab5783b5ac6396", "score": "0.4951054", "text": "_getThumbGap() {\n if (this.disabled) {\n return DISABLED_THUMB_GAP;\n }\n if (this._isMinValue() && !this.thumbLabel) {\n return this._isActive ? MIN_VALUE_ACTIVE_THUMB_GAP : MIN_VALUE_NONACTIVE_THUMB_GAP;\n }\n return 0;\n }", "title": "" } ]
547289875f6562da2fa2c557cfd34f58
spin reticle to green cross to show we can shoot
[ { "docid": "d95bf13610250d939d8b9dd7aaaba02c", "score": "0.6946503", "text": "startShoot(delta){\n if(delta>1)delta = 1;\n this.cross.rotation.z = (1-delta)*Math.PI/4;\n this.elements.forEach( element => {\n element.material.color.r = (1-delta)*255;\n element.material.color.g = delta * 255;\n })\n if(delta<1)this.future(10).startShoot(delta+0.1);\n }", "title": "" } ]
[ { "docid": "30e32f07dfe89dbbbdc815825f896d0e", "score": "0.66756755", "text": "stopShoot(delta){\n if(delta>1)delta = 1;\n this.cross.rotation.z = delta*Math.PI/4;\n this.elements.forEach( element => {\n element.material.color.g = (1-delta)*255;\n element.material.color.r = delta * 255;\n })\n if(delta<1)this.future(10).stopShoot(delta+0.1);\n }", "title": "" }, { "docid": "438266bdbc154a42c9dd980ebc63e3b0", "score": "0.65789515", "text": "spinRight() {}", "title": "" }, { "docid": "805be6b5ee8a6136f569af52d917d278", "score": "0.638551", "text": "function shoot() {\n\tif (curBall.dx == 0 && curBall.dy == 0) {\n\t\tcurBall.dx = Math.sin(radians(-rabbitAngle))/2;\n\t\tcurBall.dy = Math.cos(radians(-rabbitAngle))/2;\n\t}\n}", "title": "" }, { "docid": "ae209f424b23703d3ff5fa5b554bc28d", "score": "0.6043901", "text": "function startSpin()\n {\n theWheel.stopAnimation(false);\n theWheel.rotationAngle = theWheel.rotationAngle % 360;\n theWheel.startAnimation();\n }", "title": "" }, { "docid": "ae209f424b23703d3ff5fa5b554bc28d", "score": "0.6043901", "text": "function startSpin()\n {\n theWheel.stopAnimation(false);\n theWheel.rotationAngle = theWheel.rotationAngle % 360;\n theWheel.startAnimation();\n }", "title": "" }, { "docid": "acd4619ff0ed8d3527f2e58da8727601", "score": "0.6029572", "text": "function spin(id, i, j) {\n\tvar wait = (i*100)+(j*100);\n\tif (i == 0 || j == 0) wait - 100;\n\tsetTimeout(function() {document.getElementById(\"piece \" + id).classList.add(\"spin\");}, wait);\n}", "title": "" }, { "docid": "233cde5b660f7e5c924f4a8eea320ac4", "score": "0.6008857", "text": "spin(){\n // blaster.onDecoded.add(start, this);\n\n // can we spin the wheel?\n if(canSpin){ \n // resetting text field\n win.stop();\n\n blaster.onDecoded.add(start, this);\n blaster.play();\n\n prizeText.text = \"\";\n if(cnt ==2 ){\n showPoint.text = \"\";\n point = 0;\n cnt = 1;\n // showRound.text = '';\n }else{\n cnt += 1;\n\n }\n console.log(cnt);\n showRound.text = 'ครั้งที่ '+cnt;\n\n\n \n // the wheel will spin round from 2 to 4 times. This is just coreography\n var rounds = game.rnd.between(2, 3);\n var rounds = 10;\n // then will rotate by a random number from 0 to 360 degrees. This is the actual spin\n var degrees = game.rnd.between(0, 360);\n // console.log(degrees);\n // before the wheel ends spinning, we already know the prize according to \"degrees\" rotation and the number of slices\n prize = slices - 1 - Math.floor(degrees / (360 / slices));\n // now the wheel cannot spin because it's already spinning\n // console.log(prize);\n canSpin = false;\n // animation tweeen for the spin: duration 3s, will rotate by (360 * rounds + degrees) degrees\n // the quadratic easing will simulate friction\n // var spinTween = game.add.tween(wheel).to({\n // angle: 360 * rounds + degrees\n // }, 5000, Phaser.Easing.Quadratic.Out, true);\n // once the tween is completed, call winPrize function\n var spinTween = game.add.tween(wheel).to({\n angle: 360 * rounds + degrees\n }, 5000, Phaser.Easing.Quadratic.Out, true);\n \n (spinTween.onComplete.add(this.winPrize, this));\n\n\n }\n }", "title": "" }, { "docid": "3a29785f9af19b352e6a097bd577fc76", "score": "0.59940886", "text": "function shoot() {\n // Color 3# shoot scope\n console.log(`${targetTank} SHOOT!`);\n }", "title": "" }, { "docid": "96658b4d8d63151cb2812674ce8594e1", "score": "0.5935402", "text": "function Update() {\n\t//Spin(speed, axis);\n}", "title": "" }, { "docid": "5352dea15c9777a1b816f6843826827f", "score": "0.59334123", "text": "rollcutTo(a) {\n roll = a.r;\n // shot\n shot = { timeline: { p: { paused: true, repeat: 0 },\n actors: {\n 'lens~rotation': [{ dur: 0, p: { z: roll } }]\n }\n } //tl\n }; //shot\n animation.perform(shot);\n }", "title": "" }, { "docid": "fb78560fa9c7a80ac9c2f3452a68e83b", "score": "0.5920895", "text": "function drawThrowBottle() {\r\n if (bottleThrowTime) {\r\n let timePassed = new Date().getTime() - bottleThrowTime;\r\n let gravity = Math.pow(9.81, timePassed / 300);\r\n\r\n thrownBottle_x = 150 + timePassed * 0.3;\r\n\r\n thrownBottle_y = 300 - (timePassed * 0.6 - gravity);\r\n\r\n let base_image = new Image();\r\n base_image.src = currentrotateBottleImage;\r\n\r\n if (base_image.complete) {\r\n baseImage_Bottle(base_image);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "5cd2be8bc52780250e90632f94305354", "score": "0.5913544", "text": "shot() {\n if (!this.alive) {\n return;\n }\n this.alive = false;\n\n this.stopAndClearTimeline();\n this.timeline.add(() => {\n this.state = 'shot';\n sound.play('quak', _noop);\n });\n\n this.timeline.to(this.position, DEATH_ANIMATION_SECONDS, {\n y: this.options.maxY,\n ease: 'Linear.easeNone',\n delay: 0.3,\n onStart: () => {\n this.state = 'dead';\n },\n onComplete: () => {\n sound.play('thud', _noop);\n this.visible = false;\n }\n });\n\n }", "title": "" }, { "docid": "b359e93510469d7595fdeaf6d984d4bf", "score": "0.58942837", "text": "function glow(point) {\n\t point.animate(\n\t {\n\t r: 1\n\t },\n\t 220,\n\t function() {\n\t point.animate(\n\t {\n\t r: radiusSensePoint\n\t },\n\t 300\n\t );\n\t }\n\t );\n\t }", "title": "" }, { "docid": "30232da6f733f937422621b708d8b7ae", "score": "0.5890162", "text": "function slash(){\nisAttacking = true ;\nanimation.CrossFade(\"CastSpellA\");\nyield WaitForSeconds (animation[\"CastSpellA\"].length);\nisAttacking = false ;\n}", "title": "" }, { "docid": "92e69a4a3e8df38c31f5c813889c6da2", "score": "0.5866953", "text": "function moveBottle() {\r\n setInterval(function () {\r\n if (isThrowing) {\r\n let index = rotateBottleIndex % rotateBottle.length;\r\n\r\n currentrotateBottleImage = rotateBottle[index];\r\n\r\n rotateBottleIndex = rotateBottleIndex + 1;\r\n }\r\n }, 100);\r\n}", "title": "" }, { "docid": "04bee23dd0179ee18733799ed5f728f4", "score": "0.58111316", "text": "function draw() {\r\n background(backgroundImg);\r\n Engine.update(engine);\r\n \r\n ground.display();\r\n platform.display();\r\n \r\n cannonBase1.display();\r\n angle=map(mouseX,0,700,-2.4,-1.8);//map the mouse movement to angle\r\n cannonGun=new Cannon(220,200,18,55,angle);\r\n cannonGun.display();\r\n // cannonBall.display(); \r\n cannonDome.display();\r\n cannonBase2.display(); \r\n arc(200,200,35,35,-3.14 ,0)\r\n \r\n canshot.display();\r\n \r\n textSize(15);\r\n stroke(125,100,25);\r\n fill(25,0,250);\r\n text('Press \"DOWN\" Arrow to ... FIRE',50,25);\r\n text('Press \"SPACE\" Arrow to ... RELOAD',50,50);\r\n \r\n //reload the gun \r\n if (keyIsPressed===true){\r\n if(keyCode === 32){\r\n Matter.Body.setPosition(cannonBall.body,{x:200,y:180});\r\n flag=\"loaded\"; \r\n canshot.attach(cannonBall.body);\r\n load();//initialise the parameters for trajectory\r\n }\r\n }\r\n \r\n\r\n //firing the gun\r\n if (keyIsDown(DOWN_ARROW)) {\r\n flag=\"launched\";\r\n canshot.shoot();\r\n pct += step;\r\n if (pct < 2.0) {\r\n y = beginY + pct * distY;\r\n x = beginX + pow(pct, exponent) * distX;\r\n }\r\n fill(255,0,0);\r\n ellipse(x, y, 15, 15); \r\n \r\n } \r\n\r\n for (let i = 0; i < bombCount; i++) { // we create the drops \r\n var bomb = bombsA[i];\r\n bomb.fall(); // sets the shape and speed of drop\r\n bomb.show(); // render drop\r\n } \r\n }", "title": "" }, { "docid": "1cbbaa77121f4cf0b44d501969767bfe", "score": "0.5801413", "text": "function addSpin() {\n frameLength -= spinValue;\n if (frameLength < 5)\n frameLength = 5;\n else if (frameLength > 100)\n frameLength = 100;\n doSpin();\n}", "title": "" }, { "docid": "ee7719cbf68e04e5f8ea3734431de392", "score": "0.5800228", "text": "function simonTurn() {\n on = false;\n if (press == turn) {\n clearInterval(myInterval);\n cpuTurn = false;\n removeColor();\n on = true;\n }\n if (cpuTurn) {\n removeColor();\n setTimeout(() => {\n if (cpuSeq[press] == 1) one();\n if (cpuSeq[press] == 2) two();\n if (cpuSeq[press] == 3) three();\n if (cpuSeq[press] == 4) four();\n press++;\n }, 250);\n }\n}", "title": "" }, { "docid": "8d57ec8b3a7ad06addb698249287cc34", "score": "0.5794506", "text": "function rollReturn()\n{ \n \n if (shuttle.rollAngle >= 0.5)\n {\n shuttle.rollAngle -= 0.4;\n shuttle.cameraAltitude += 0.5;\n setTimeout(function () {rollReturn()}, 30);\n }\n else if (shuttle.rollAngle <= -0.5)\n {\n shuttle.rollAngle += 0.4;\n shuttle.cameraAltitude -= 0.5;\n setTimeout(function () {rollReturn()}, 30); \n }\n else\n {\n shuttle.rollAngle = 0;\n }\n}", "title": "" }, { "docid": "7fdd4f6fd7a4d9fb418c1260b05ac86a", "score": "0.5791215", "text": "function spin() {\n rand = Math.floor(Math.random() * 38);\n var position = createWheel(rand);\n return position;\n}", "title": "" }, { "docid": "26e9d0fafa33ba7bf3cb6df26f775995", "score": "0.5775802", "text": "function shoot(speed) {\n if (speed === undefined) {\n debugger;\n }\n\n if (gIsLaserInSky) {\n return;\n }\n else {\n gIsLaserInSky = true\n blinkLaser({i: gGamerPos.i-1, j: gGamerPos.j}, speed);\n }\n}", "title": "" }, { "docid": "4f97bbf3fb13b357295efe06b30366dd", "score": "0.5773528", "text": "function startSpin() {\n setSpinning(true);\n // Ensure that spinning can't be clicked again while already running.\n if (wheelSpinning === false) {\n // Based on the power level selected adjust the number of spins for the wheel, the more times is has\n // to rotate with the duration of the animation the quicker the wheel spins.\n if (wheelPower === 1) {\n theWheel.animation.spins = 3;\n } else if (wheelPower === 2) {\n theWheel.animation.spins = 8;\n } else if (wheelPower === 3) {\n theWheel.animation.spins = 15;\n }\n\n // Disable the spin button so can't click again while wheel is spinning.\n // document.getElementById('spin_button').src = \"http://dougtesting.net//elements/images/examples/spin_off.png\";\n // document.getElementById('spin_button').className = \"\";\n\n // Begin the spin animation by calling startAnimation on the wheel object.\n theWheel.startAnimation();\n\n // Set to true so that power can't be changed and spin button re-enabled during\n // the current animation. The user will have to reset before spinning again.\n wheelSpinning = true;\n }\n }", "title": "" }, { "docid": "49aeac81df89dcf8201c8e2d675e320d", "score": "0.5763764", "text": "spin(){\n // can we spin the wheel?\n if(canSpin){\n canSpin = false;\n if(!onCanSpin){throw new Error('Wheel need onCanSpin prop.');}\n onCanSpin(game, slices, (function(_this) {\n return function(err, _degrees, _prize, _canSpin) {\n if(err==null&&_canSpin){\n if(showRes){\n // resetting text field\n prizeText.text = \"\";\n }\n // the wheel will spin round from 2 to 4 times. This is just coreography\n var rounds = game.rnd.between(2, 4);\n\n\n\n // then will rotate by a random number from 0 to 360 degrees. This is the actual spin\n var degrees = _degrees;\n // before the wheel ends spinning, we already know the prize according to \"degrees\" rotation and the number of slices\n prize = _prize;\n // now the wheel cannot spin because it's already spinning\n\n // animation tweeen for the spin: duration 3s, will rotate by (360 * rounds + degrees) degrees\n // the quadratic easing will simulate friction\n var spinTween = game.add.tween(wheel).to({\n angle: 360 * rounds + degrees\n }, 3000, Phaser.Easing.Quadratic.Out, true);\n // once the tween is completed, call winPrize function\n spinTween.onComplete.add(_this.winPrize, _this);\n }\n };\n })(this));\n\n }\n }", "title": "" }, { "docid": "d4de6608f2a8c076afe5e3bbd31faf86", "score": "0.5756031", "text": "function drawTank() {\n\ttank.style.opacity = \"100\";\n\ttank.style.left = turret.left + \"px\";\n\ttank.style.top = turret.top + \"px\";\n}", "title": "" }, { "docid": "c217680e444c9c5c3185281d6a0ca817", "score": "0.57558715", "text": "hitShield(bullet, shield){\n bullet.disableBody(true, true);\n console.log('hit shine');\n\n}", "title": "" }, { "docid": "f7e3d5996b4aded242c217748ec124a0", "score": "0.5745155", "text": "function turnRotation(){\n // the player has the first go\n console.log(\"fireball throw\");\n if(enemYAttack==true||playerPickShield==true){\n if(enemyfireBallSpawnX<knightPositionX)\n {\n enemyfireBallSpawnX++;\n }\n if(enemyfireBallSpawnY<knightPositionY)\n {\n enemyfireBallSpawnY++;\n }\n if(enemyfireBallSpawnX.x>knightPositionX)\n {\n enemyfireBallSpawnX--;\n }\n if(enemyfireBallSpawnY>knightPositionY)\n {\n enemyfireBallSpawnY--;\n }\n }\n \n \n}", "title": "" }, { "docid": "ca846b326fa5045b8f2b5b82d1ccb49a", "score": "0.57415324", "text": "function superShoot() {\n if (gSuperShootCounter === 0) {\n return;\n }\n else {\n gIsSuperShoot = true;\n gSuperShootCounter--;\n shoot(SUPER_LASER_SPEED);\n return;\n }\n}", "title": "" }, { "docid": "e1db3cb39d59df929e9582eedc32bbb6", "score": "0.5718229", "text": "function draw() {\n\tbackground(0);\n\tstroke(255);\n\tstrokeWeight(5);\n\tnoFill();\n\n\n\n\tif (start > 300){\n\t\tfill(150,100,50); // color pink\n\t\tif (start > width){\n\t\t\tspeed = speed - 3\n\t\t}\n\t}\n\tif (start < 299) {\n\t\tfill(89,12,44); // color camo green\n\t\t if (start == 0) {\n\t\t \tspeed = speed + 3\n\t\t}\n\t}\n\tellipse(start,200,120,120); // circle starting point 300px\n\tstart = start + speed;\n\n}", "title": "" }, { "docid": "5301f24f45dd753337ea04064a5e3a26", "score": "0.56983596", "text": "function Start () {\n\tvar bullet = GetComponent.<Rigidbody>();\n\t//Spin the bullet counter-clockwise\n\tbullet.AddTorque(Vector3(0,0,5));\n\tbullet.AddForce(Vector3(0,0,6000));\n\tDestroy(gameObject,12f);\n}", "title": "" }, { "docid": "2fcbdf88aa323cc554c093d2b88b5993", "score": "0.5682488", "text": "function shoot() {\n if (this.canShoot()) {\n this.play(\"shoot\", false);\n timeSinceLastShot = 0;\n currentMunition--;\n spawnOrb(this.pos, this.getViewDirection());\n }\n }", "title": "" }, { "docid": "c4e3de1a34dee63a126bb6f1a0d3d6ea", "score": "0.5656967", "text": "spinWheel () {\n\n // can we spin the wheel?\n if (this.canSpin && attempts > 0) {\n buyFuelHuman = false\n buyFuelMarket = false\n ufoChoice = false\n this.removeAttempts(1)\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n if(sound === true){\n this.sound.play('spinsound');\n }\n\n // resetting text field\n this.prizeText.setText('')\n this.prizeDescText.setText('')\n if (this.iconBig !== undefined) { this.iconBig.destroy() }\n\n redefineDegrees()\n this.createWheel()\n\n // the wheel will spin round for some times. This is just coreography\n const rounds = Phaser.Math.Between(gameOptions.wheelRounds.min, gameOptions.wheelRounds.max)\n\n // then will rotate by a random amount of degrees picked among the allowed degrees. This is the actual spin\n const degrees = Phaser.Utils.Array.GetRandom(this.allowedDegrees)\n\n // then will rotate back by a random amount of degrees\n const backDegrees = Phaser.Math.Between(gameOptions.backSpin.min, gameOptions.backSpin.max)\n\n // before the wheel ends spinning, we already know the prize\n let prizeDegree = 0\n\n // looping through slices\n for (let i = gameOptions.slices.length - 1; i >= 0; i--) {\n // adding current slice angle to prizeDegree\n prizeDegree += gameOptions.slices[i].degrees\n\n // if it's greater than the random angle...\n if (prizeDegree > degrees) {\n // we found the prize\n var prize = i\n break\n }\n }\n\n // now the wheel cannot spin because it's already spinning\n this.canSpin = false\n\n // animation tweeen for the spin: duration 3s, will rotate by (360 * rounds + degrees) degrees\n // the quadratic easing will simulate friction\n this.tweens.add({\n\n // adding the wheel container to tween targets\n targets: [this.wheelContainer],\n\n // angle destination\n angle: 360 * rounds + degrees + backDegrees,\n\n // tween duration\n duration: Phaser.Math.Between(gameOptions.rotationTimeRange.min, gameOptions.rotationTimeRange.max),\n\n // tween easing\n ease: 'Cubic.easeOut',\n\n // callback scope\n callbackScope: this,\n\n // function to be executed once the tween has been completed\n onComplete: function (tween) {\n // another tween to rotate a bit in the opposite direction\n this.tweens.add({\n targets: [this.wheelContainer],\n angle: this.wheelContainer.angle - backDegrees,\n duration: Phaser.Math.Between(gameOptions.rotationTimeRange.min, gameOptions.rotationTimeRange.max) / 2,\n ease: 'Cubic.easeIn',\n callbackScope: this,\n onComplete: function (tween) {\n // displaying prize text\n this.prizeText.setText(gameOptions.slices[prize].text)\n this.iconBig = this.add.sprite(1500, 350, 'icons', gameOptions.slices[prize].iconFrame)\n this.iconBig.setScale(3.5, 3.5)\n\n switch (prize) {\n case 0 : { // EARTH\n if(sound === true){\n this.sound.play('earthsound');\n }\n this.prizeDescText.setText('Home sweet home...\\nThe spaceport offer your some fuel (+2 fuel)\\nDo you want to buy even more ?\\n300 resources = 1 fuel\\n (buy using \"B\")')\n buyFuelHuman = true\n attempts += 2\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n this.canSpin = true\n break\n }\n case 1 : { // UFO\n if(sound === true){\n this.sound.play('ufosound');\n }\n this.prizeDescText.setText('Should we be scared?\\nYou hear a strange voice whisper : \\n\"FUEL OR RESOURCES?\"\\n(F for Fuel, R for resources)')\n ufoChoice = true\n \n //turnOver = true\n break\n }\n case 2 : { // OUT OF SOLAR SYSTEM\n if(sound === true){\n this.sound.play('outsound');\n }\n const rand = Math.floor(Math.random() * Math.floor(4))\n switch(rand){\n case 0 :{\n this.prizeDescText.setText('You find some pretty agressive alien ships !\\nBut your ship is better.\\n You destroy them and scrap some resources\\n(+500 resources)')\n points += 500\n this.pointText.setText(points + ' points')\n break\n }\n case 1 :{\n this.prizeDescText.setText('You find some pretty agressive alien ships !\\nThey are too strong for you.\\n You flee, using a lot of fuel\\n(-1 fuel)')\n this.removeAttempts(1)\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n break\n }\n case 2 :{\n this.prizeDescText.setText('You find a really frendly alien ship.\\n\"Take this human\"\\n \"it will be more useful to you\".\\n(+1 fuel and + 250 resources)')\n points += 250\n attempts += 1\n this.pointText.setText(points + ' points')\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n break\n }\n case 3 :{\n this.prizeDescText.setText('You find a market station.\\nThey sell fuel for really cheap !\\n150 resources = 1 fuel\\n (buy using \"B\")')\n buyFuelMarket = true\n break\n }\n }\n this.canSpin = true\n break\n }\n case 3 : { // BLACKHOLE\n if(sound === true){\n this.sound.play('blackholesound');\n }\n const rand = Math.floor(Math.random() * Math.floor(3))\n switch(rand){\n case 0 :{\n this.prizeDescText.setText('You got a little bit too close of a blackhole\\nYou had to eject some resources to lighten your ship\\n(-100 resources)')\n this.removePoints(100)\n this.pointText.setText(points + ' points')\n break\n }\n case 1 :{\n this.prizeDescText.setText('You got too close of a blackhole!\\nYou had to eject some resources to lighten your ship\\nYou also used a lot of fuel\\n(-150 resources and -1 fuel)')\n this.removePoints(150)\n this.removeAttempts(1)\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n this.pointText.setText(points + ' points')\n break\n }\n case 2 :{\n this.prizeDescText.setText('You got way too close of a blackhole!!!\\nYou had to eject a lot resources to lighten your ship\\nYou also used a lot of fuel\\n(-300 resources and -1 fuel)')\n this.removePoints(300)\n this.removeAttempts(1)\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n this.pointText.setText(points + ' points')\n break\n }\n }\n this.canSpin = true\n break\n }\n case 4 : { // MARS\n if(sound === true){\n this.sound.play('marssound');\n }\n marsChoice = true\n let amount = 0\n if(points >= 100){\n this.prizeDescText.setText('On Mars, you play a betting game with an Alien\\nPlease choose how much you want to bet : ')\n\n this.firstChoice = this.add.text(300, 420, '100', {\n font: 'bold 24px Arial',\n align: 'center',\n color: 'white'\n })\n this.firstChoice.setInteractive({ useHandCursor: true })\n this.firstChoice.on('pointerdown', () => this.marsSelect(100))\n\n let color = points >= 200 ? 'white' : 'grey';\n\n this.secondChoice = this.add.text(350, 420, '200', {\n font: 'bold 24px Arial',\n align: 'center',\n color: color\n })\n if(points >= 200){\n this.secondChoice.setInteractive({ useHandCursor: true })\n this.secondChoice.on('pointerdown', () => this.marsSelect(200))\n }\n\n color = points >= 500 ? 'white' : 'grey';\n\n this.thirdChoice = this.add.text(400, 420, '500', {\n font: 'bold 24px Arial',\n align: 'center',\n color: color\n })\n if(points >= 500){\n this.thirdChoice.setInteractive({ useHandCursor: true })\n this.thirdChoice.on('pointerdown', () => this.marsSelect(500))\n }\n\n this.lastChoice = this.add.text(450, 420, \"all : \" + points, {\n font: 'bold 24px Arial',\n align: 'center',\n color: 'white'\n })\n this.lastChoice.setInteractive({ useHandCursor: true })\n this.lastChoice.on('pointerdown', () => this.marsSelect(points))\n\n if(!marsChoice){\n this.canSpin = true\n }\n }\n else{\n this.prizeDescText.setText(\"On Mars, an alien is playing a betting game\\nBut you don't have enough resources to bet...\")\n this.canSpin = true\n }\n \n break\n }\n case 5 : { // SUN\n if(sound === true){\n this.sound.play('sunsound');\n }\n this.prizeDescText.setText('You find some useful raw resources next to the sun\\nYou also use some solar energy as fuel.\\n(+1 fuel and +300 resources)')\n\n points += 300\n this.pointText.setText(points + ' points')\n attempts += 1\n this.attemptsLeftText.setText(attempts + ' remaining attempts')\n this.canSpin = true\n break\n }\n }\n\n this.pointText.setText(points + ' points')\n\n \n }\n })\n }\n })\n }\n if (this.canSpin && attempts === 0) {\n this.prizeText.setText(\"It's the end of your interstellar trip !\\nPlease enter 3 letters for you name\")\n this.prizeDescText.setText('Points : ' + points)\n this.nameTextA = this.add.text(860, 800, '_', {\n font: 'bold 60px Arial',\n align: 'center',\n color: 'white'\n })\n this.nameTextB = this.add.text(920, 800, '_', {\n font: 'bold 60px Arial',\n align: 'center',\n color: 'white'\n })\n this.nameTextC = this.add.text(980, 800, '_', {\n font: 'bold 60px Arial',\n align: 'center',\n color: 'white'\n })\n this.input.keyboard.on('keydown', function (input) {\n if (this.nameTextA.text === '_' && input.key >= 'a' && input.key <= 'z') {\n this.nameTextA.setText(input.key.toUpperCase())\n return\n } else if (this.nameTextB.text === '_' && input.key >= 'a' && input.key <= 'z') {\n this.nameTextB.setText(input.key.toUpperCase())\n return\n } else if (this.nameTextC.text === '_' && input.key >= 'a' && input.key <= 'z') {\n this.nameTextC.setText(input.key.toUpperCase())\n scoreJson.scores.push({letter1: this.nameTextA.text, letter2: this.nameTextB.text, letter3: this.nameTextC.text, score:points});\n this.scene.start('EndScene', { name: this.nameTextA.text + this.nameTextB.text + this.nameTextC.text })\n return\n }\n }, this)\n attempts = -1\n }\n }", "title": "" }, { "docid": "9bc35425424675b3932837bd71c9ee11", "score": "0.56553817", "text": "function setupAndSpin() {\n for (var i = 0; i < 3; ++i) {\n speeds[i] = Math.random() + 1; \n finalPositions[i] = Math.floor(Math.random() * 3) * imageHeight;\n }\n spin();\n leverTrigger();\n }", "title": "" }, { "docid": "17406e936686c58146db345e32c4b32a", "score": "0.5639201", "text": "function spinspinspin(time) {\n var phase1 = phasing * time;\n var phase2 = 2 * phasing * time;\n\n var scale = 0.4 + .75 * (1 + Math.cos(scaling * time));\n\n var spacing = diameter;// * (1 + .2 * Math.sin(breathing * time));\n\n var x0 = radius + width/2 - (.5*N) * Math.sqrt(3)/2 * spacing;\n var y0 = height/2 - N * (3/8) * spacing;\n\n for (var r = 0; r < N; ++r)\n for (var g = 0; g < N-r; ++g) {\n var b = N - (r+g);\n assert(r + g + b === N);\n\n // (x,y) from http://www.redblobgames.com/grids/hexagons/#hex-to-pixel\n var cx = x0 + (r + g/2) * Math.sqrt(3)/2 * spacing;\n var cy = y0 + g * .75 * spacing;\n // TODO: morph between these color schemes\n if (false) {\n drawPieSlice(cx, cy, r/N, time, 'rgb(c,0,0)', 0);\n drawPieSlice(cx, cy, g/N, time, 'rgb(0,c,0)', tau/3);\n drawPieSlice(cx, cy, b/N, time, 'rgb(0,0,c)', -tau/3);\n } else {\n drawPieSlice(scale, cx, cy, r/N, time, 'rgba(c,c,0,.2)', 0);\n drawPieSlice(scale, cx, cy, g/N, time, 'rgba(0,c,c,.2)', phase1);\n drawPieSlice(scale, cx, cy, b/N, time, 'rgba(c,0,c,.2)', phase2);\n }\n }\n}", "title": "" }, { "docid": "11a7cd2be7c486c5b0b565ef2504d818", "score": "0.5622685", "text": "function animateSpin() {\n animationDetails.angle += 4;\n $(\"#shape\").css(\"transform\", `rotate(${animationDetails.angle}deg)`);\n }", "title": "" }, { "docid": "2587f33125e7f6ed6037f7ebc3ae6e0e", "score": "0.5613441", "text": "walk() {\r\n \tlet vx = random(-1, 1);\r\n\t \tlet vy = random(-1, 1);\r\n\t \tthis.x += vx;\r\n\t \tthis.y += vy;\r\n\r\n\t\t// Stay on the screen\r\n\t\tthis.x = constrain(this.x, this.size/2, width - this.size/2);\r\n\t\tthis.y = constrain(this.y, this.size/2, height - this.size/2);\r\n \t}", "title": "" }, { "docid": "547334b859c372176e86ead1a698dd31", "score": "0.5613135", "text": "tickTarget() {\n if (this.target && this.target.exists) {\n let angle = aim.angle(this, this.target)\n if (angle === \"fail\") {\n angle = this.getTarget()\n }\n this.targetrot = angle || this.targetrot + 0.01\n } else {\n this.targetrot += 0.01\n this.getTarget()\n } \n }", "title": "" }, { "docid": "33ff12f50e906f165a648f321b415548", "score": "0.5607765", "text": "function draw() {\n // bkg.pulse();\n temp = tempSlider.value();\n system.run()\n}", "title": "" }, { "docid": "8c411d59b815c532d5052f0bc137ce35", "score": "0.56040376", "text": "function draw() {\n background(0)\n look();\n contact();\n go();\n push();\n rect(20, 150, 15, 75)\n fill(66, 135, 245)\n pop();\n line(250, 0, 250, 400)\n \n translate(width / 2, height / 2);\n rotate(PI / 5.0); \n rect(150, -200, 15, 75);\n\n }", "title": "" }, { "docid": "f04c4a50f94bfb8c8b8d3309175e6c76", "score": "0.56014913", "text": "shootBall() {\n // initial shot attributes\n const initBackspinRPM = 3000;\n const initSpinAngle = 0;\n // Initial velocity\n this.state.velocity = calculateInitialVelocity(\n this.state.speedMPH,\n SceneParams.SMASH,\n this.state.verticalAngleDegrees,\n this.state.horizontalAngleDegrees\n );\n\n // Initial spin\n this.state.angVelocity = calculateInitialSpin(\n initBackspinRPM,\n initSpinAngle\n );\n\n this.state.shot = true;\n }", "title": "" }, { "docid": "b226cd7db6c86caaf59e81021c7f77b5", "score": "0.5600611", "text": "async wiggle() {\n await this.delay(1000)\n Servo.setDutyCycle(this.pin, 0)\n await this.delay(250)\n Servo.setDutyCycle(this.pin, 1)\n await this.delay(150)\n Servo.setOff(this.pin)\n }", "title": "" }, { "docid": "27adddabb7516131203e2d715724dc21", "score": "0.5596632", "text": "shoot() {\n\n }", "title": "" }, { "docid": "286cbe01cad6fcbea8653ccf62cf845a", "score": "0.5595503", "text": "function spin(color,amount){var hsl=tinycolor(color).toHsl();var hue=(hsl.h+amount)%360;hsl.h=hue<0?360+hue:hue;return tinycolor(hsl);}// Combination Functions", "title": "" }, { "docid": "045ec4f89a6726f17e99cf628908b4dd", "score": "0.5590594", "text": "function turnFan() {\n const imgSpin = document.getElementsByClassName(\"img-spin\");\n turn += 5;\n imgSpin[0].style.transform = \"rotate(\" + (turn % 360) + \"deg)\";\n}", "title": "" }, { "docid": "d4925b5d9f2e5c9fd54ca0e45fc41302", "score": "0.5589004", "text": "function mouseUp() {\n shooting = false;\n}", "title": "" }, { "docid": "28492be1b927df39f2c809d593db01fd", "score": "0.5561833", "text": "function spin()\n{\n\t// spinnerElement.css(\"animation-duration\", Math.exp(-speed)*20000 + 'ms');\n\t// console.log(Math.exp(-speed)*10000);\n\tspeed += .1;\n\t// console.log(speed);\n\tscore += 1;\n\tupdateScore();\n\t\n\tadjustSpeed();\n\n}", "title": "" }, { "docid": "29ec2cc4c005e597d647e472fd58fe8e", "score": "0.5561748", "text": "function spin()\r\n{\r\n isSpinning = true;\r\n var colSpeed = new Array();\r\n\t\r\n for (var i = 0; i < TOTAL_COLS; i++)\r\n {\r\n if (i == 0)\r\n colSpeed[i] = utilities.randomFromTo(15, 30);\r\n else\r\n colSpeed[i] = utilities.randomFromTo(spinSpeed[i-1]+5, 30);\r\n }\r\n \r\n for (var i = 0; i < TOTAL_COLS; i++)\r\n {\r\n if (i == 0)\r\n spinDuration[i] = utilities.randomFromTo(3, 10);\r\n else \r\n spinDuration[i] = utilities.randomFromTo(spinDuration[i-1]+1, 15);\r\n }\r\n\r\n for (var row = 0; row < TOTAL_ROWS; row++)\r\n {\r\n for (var col = 0; col < TOTAL_COLS; col++)\r\n {\r\n blocks[row][col].velY = colSpeed[col];\r\n }\r\n }\r\n \r\n for(var i = 0; i < lineButtons.length; i++)\r\n lineButtons[i].isActive = false;\r\n for(var i = 0; i < betButtons.length; i++)\r\n betButtons[i].isActive = false;\r\n} // end spin", "title": "" }, { "docid": "357d50f8c6225cb5701b4750d55c24b2", "score": "0.5560858", "text": "function draw() {\n background(220); //Set background color\n drawGround();\n if(run) {\n drawRobot();\n checkFinish();\n }\n}", "title": "" }, { "docid": "255bb98ad4b8cca1d642fbae76e6bc25", "score": "0.555713", "text": "function splash(e) {\n if (e.pageX == undefined) { // IE rocks\n e.pageX = e.clientX + document.documentElement.scrollLeft;\n e.pageY = e.clientY + document.documentElement.scrollTop;\n }\n animate(sprites.blood, e.pageX, e.pageY, 100);\n}", "title": "" }, { "docid": "748f2f02e77356c3a5b42f1f51eedc85", "score": "0.5555779", "text": "function megaShoot() {\n gIsMegaShoot = true;\n gMegaShootCount--;\n shoot(MEGA_LASER_SPEED);\n return;\n}", "title": "" }, { "docid": "852c0a7176cb47e06f66a5824de939c3", "score": "0.5541619", "text": "function sick() {\n window.sickInt = setInterval(function() {\n sickTime += 1;\n //console.log(sickTime)\n },1000)\n beep();\n window.sick = true;\n window.skull.visible = true;\n stage.update();\n }", "title": "" }, { "docid": "093a3a40000d6017acb5ac776053ef5a", "score": "0.55330104", "text": "function draw() { \n paintCircle(random(640), random(400), random(3) + 1);\n line(i * 20, 0, 0, 400 - i * 14);\n line(640 - i * 20, 399, 639, i * 14);\n \n i++;\n if (i > 31) {\n i = 0;\n color++;\n \n if (color > 15) {\n \tclearInterval(timer);\n \treturn;\n\t\t}\n\t\t\n setColor(color);\n }\n}", "title": "" }, { "docid": "cb277d326153611192cf37e840fa66eb", "score": "0.5529484", "text": "function Shoot (power : float){\n\tshooting = true;\n\t\n\t//play the sound of the cannon blast in a new object to avoid interfering\n\t//with the current sound assignment and loop setup\n\tAudioSource.PlayClipAtPoint(throwSound, transform.position);\n\t\n\t//create a ball, assign the newly created ball to a var called pFab\n\tvar pFab : Rigidbody = Instantiate(ball, spawnPos.position, spawnPos.rotation);\n\t\n\t//find the forward direction of the object assigned to the spawnPos variable\n\tvar fwd : Vector3 = spawnPos.forward;\n\tpFab.AddForce(fwd * power * shotForce);\n\t\n\tthePower = 0;\n\t\n\t//allow shooting to occur again\n\tshooting = false;\n}", "title": "" }, { "docid": "2575276d8aee25daf25ab8b7b5119b07", "score": "0.5529297", "text": "function ballPowerUpCollide() {\r\n powerUp.visible = false;\r\n ball.fill = powerUpColor;\r\n console.log(\"Power Up acquired! You can smash through bricks now.\");\r\n}", "title": "" }, { "docid": "9b419d09bfba66c6665b4a72c51c3792", "score": "0.5523912", "text": "function shoot() {\n if(!coolDownStatus) {\n coolDownStatus = 1;\n if(!local) {\n setBit(1, 0, 1);\n console.log('shoot');\n priorityWrite(charVal);\n setTimeout(function() {\n setBit(1,0,0);\n console.log('shoot off');\n priorityWrite(charVal);\n }, 50);\n }\n coolDown();\n }\n}", "title": "" }, { "docid": "9e72a1cbfe94a1f74a6c1946d38057f9", "score": "0.5512529", "text": "StartScreenBob() {\n this.body.allowGravity = false;\n this.tween = this.scene.tweens.add({\n targets: this,\n y: this.y + 20,\n duration: 1500,\n ease: 'Sine.inOut',\n yoyo: true,\n repeat: -1\n });\n\n this.waiting = true;\n }", "title": "" }, { "docid": "834084524999ff3fca3a7ecc689de1b9", "score": "0.55115646", "text": "shoot() {\n }", "title": "" }, { "docid": "196fddc309f223106a248308af6b136d", "score": "0.5508484", "text": "function spinWheel(){ degrees+=120; $('.spinWheel').css('transform', 'rotate(' + degrees + 'deg)'); }", "title": "" }, { "docid": "67d21f6ad4240632ba16c81424669f62", "score": "0.5506604", "text": "function startSpin()\n {\n if (wheelPower == 0) {\n alert(\"Select power level for the wheel first!\");\n }\n // Ensure that spinning can't be clicked again while already running.\n if (wheelSpinning == false && wheelPower > 0)\n {\n // Based on the power level selected adjust the number of spins for the wheel, the more times is has\n // to rotate with the duration of the animation the quicker the wheel spins.\n if (wheelPower == 1)\n {\n theWheel.animation.spins = 3;\n }\n else if (wheelPower == 2)\n {\n theWheel.animation.spins = 8;\n }\n else if (wheelPower == 3)\n {\n theWheel.animation.spins = 15;\n }\n\n // Disable the spin button so can't click again while wheel is spinning.\n document.getElementById('spin_button').src = \"../../../static/assets/images/wheel_stuff/spin_off.png\";\n document.getElementById('spin_button').className = \"\";\n\n // Begin the spin animation by calling startAnimation on the wheel object.\n theWheel.startAnimation();\n\n // Set to true so that power can't be changed and spin button re-enabled during\n // the current animation. The user will have to reset before spinning again.\n wheelSpinning = true;\n }\n }", "title": "" }, { "docid": "11f5cee28956330f0e0a7f977a9f0f0d", "score": "0.54966193", "text": "function showerEffect(ctx){\n \n if(flow===false){\n flow=true;\n showerX+=2;\n }\n else{\n flow=false;\n showerX-=2;\n } \n}", "title": "" }, { "docid": "2864f6b550b28308393a1147a5fefd64", "score": "0.54952025", "text": "function draw(){\r\n background(20, 20, 20, 22);\r\n for(var i = 0; i < Boids.length; i++){\r\n Boids[i].run();\r\n chaser.run();\r\n }\r\n}", "title": "" }, { "docid": "bc7c3ae9291d69dac07fced75548c08d", "score": "0.5494645", "text": "function blink(times : int)\n{\n\t//blink only if you can be hit\n\tif(!invincible)\n\t{\n\t\tisBlinking = true;\n\t\tvar state : boolean = false; //the current state of rendered or not rendered\n\t\tinvincible = true; //make the player temporarily invincible\n\t\twhile(times > 0)\n\t\t{\n\t\t\tstate = !state; //flip the state every iteration\n\t\t\t\n\t\t\tif(blinkSaber)\n\t\t\t\tsaberHalf.renderer.enabled = state;\n\t\t\telse if(blinkSaberLeft)\n\t\t\t\tsaberHalfLeft.renderer.enabled = state;\n\t\t\trenderer.enabled = state; //set the renderer to display every other time\n\t\t\tyield WaitForSeconds(.15);\n\t\t\ttimes--;\n\t\t}\n\t\tinvincible = false;\n\t\tisBlinking = false;\n\t\trenderer.enabled = true;\n\t}\n}", "title": "" }, { "docid": "8886ebb140317088c280f07e8e5ca213", "score": "0.5487992", "text": "shootLaser(){\n this.laserSFX.play();\n let laser = new Laser(this);\n }", "title": "" }, { "docid": "e0d1b7c050680549f58df69559a4aa83", "score": "0.5480776", "text": "function draw() {\n//making the background black\nbackground(0)\n//tinting and drawing the image\ntint(r,g, b)\nimage(img, x, y)\n//adding the xspeed and the yspeed to x and y\nx += xspeed\ny += yspeed\n//testing if it is on the edge\nif (x + img.width >= width || x == 0) {\nxspeed = -xspeed\n//this is to make the color change\nr = random(100, 256)\ng = random(100, 256)\nb = random(100, 256)\n}\nif (y + img.height >= height || y == 0) {\nyspeed = -yspeed\n//this is to make the color change\nr = random(100, 256)\ng = random(100, 256)\nb = random(100, 256)\n}\n}", "title": "" }, { "docid": "ad43579d01cb4b9138dced81416ac7ac", "score": "0.5475644", "text": "function shoot() {\n if (!ball.dead || ship.dead)\n return;\n\n ball.dead = false;\n ball.position.x = ship.position.x;\n ball.position.y = utilities.getWaveHeight(partials, ship.position.x) - ship.position.y + 100;\n ball.velocity.x = ball.speed * Math.sin(ship.rotation + Math.PI / 4);\n ball.velocity.y = ball.speed * Math.cos(ship.rotation + Math.PI / 4);\n }", "title": "" }, { "docid": "5c481d60e801df485bd69a26215a43d4", "score": "0.54604775", "text": "function draw() {\r\n //Hintergrund mit ein wenig alpha für den Trail\r\n background(0, 25);\r\n\r\n //Immer eine Rakete erzeugen wenn der Randomwert kleiner als 0.05 ist (60FPS) ~4% wahrscheinlichkeit\r\n if (random(1) < 0.04) {\r\n //Neue Rakete in der Raketen Array hinzufügen\r\n rockets.push(new Rocket(random(width), height));\r\n }\r\n\r\n //Raketen Array Rückwärts durchgehen, da es sonst Probleme beim Splicen geben kann\r\n for (var i = rockets.length - 1; i >= 0; i--) {\r\n rockets[i].applyForce(Gravity);\r\n rockets[i].update();\r\n rockets[i].show();\r\n\r\n //Splicen wenn Rakete \"fertig\" ist, Splicen = Element aus dem Array entfernen\r\n if (rockets[i].done())\r\n rockets.splice(i, 1);\r\n }\r\n\r\n}", "title": "" }, { "docid": "80bd98b41e2ad4e82db9631bd8f9c4f3", "score": "0.5459988", "text": "function speedCarOne(car,rangeOfSpeed,y){\n j = ~~(Math.random()*rangeOfSpeed+5);\n ctx.drawImage(car,j+i,y,75,40);\n i=i+j;\n //console.log(\"this is i \"+i);\n }", "title": "" }, { "docid": "5b6b79c4cf554991f2a3a4193712c635", "score": "0.54533213", "text": "function autoSpin () {\n // spin();\n autoSpinHas = false;\n if ( model.getBet() > 0 ) {\n if ( model.getBet() <= model.getCredits() ) {\n spin();\n model.setBalance(model.getBalance() - model.getWager());\n updateFinanceFields();\n wonView.showGoodLuckMsg();\n startSpinSound();\n gameServices.autoSpin.next();\n } else {\n gameServices.showOkDialog(\"spinWarningLowCredits\",\"You do not have enough credits to place bet.\");\n gameServices.autoSpin.cancel();\n gameServices.notifyGameEnd();\n enableUI();\n }\n } else {\n gameServices.showOkDialog(\"spinWarningMinBet\",\"You must bet at least one credit on at least one line to spin.\");\n gameServices.autoSpin.cancel();\n gameServices.notifyGameEnd();\n enableUI();\n }\n }", "title": "" }, { "docid": "23c4e8a36f6f9fe847900f79cbf39a46", "score": "0.545207", "text": "function spin(currentTime) {\n $('#message').html(\"drum roll, please...\");\n if (!startTime) {\n startTime = currentTime;\n }\n var elapsedTime = currentTime - startTime || 0;\n // drag factor will approach zero to slow down animation\n var dragFactor = (totalSpinTime - elapsedTime) * \n (totalSpinTime - elapsedTime) / totalSpinTime;\n for (var i = 0; i < 3; ++i) {\n $('#reel' + i).scrollTop(\n (speeds[i] * dragFactor + finalPositions[i]) % totalHeight);\n }\n if (elapsedTime < totalSpinTime) {\n requestAnimationFrame(spin);\n } else {\n startTime = null;\n check();\n }\n }", "title": "" }, { "docid": "9fa659ab72cfcb52f55a869980254ccf", "score": "0.54506785", "text": "function invincibleShipThrustFill() {\n context.fillStyle = \"rgb(\" +\n Math.floor(Math.random() * (255 - 100) + 100) + \" ,\" +\n Math.floor(Math.random() * (255 - 100) + 100) + \" ,\" +\n Math.floor(Math.random() * (255 - 100) + 100) + \")\";\n}", "title": "" }, { "docid": "d0444bc9dee1f97a1ad0051cca7bfaba", "score": "0.54396236", "text": "function randomSpin(){\n var randomizeSpot = Math.floor(Math.random() * 38);\n var generatedSpot = createWheel(randomizeSpot);\n return generatedSpot;\n}", "title": "" }, { "docid": "c78621cfa91d0ed4b58129b0a51582b1", "score": "0.54313076", "text": "SendEvent(EHarbor());\n }\n\n // if got to end\n if (penNextTarget==NULL) {\n // stop\n StopSailing();\n return;\n }\n\n // get properties from marker\n FLOAT fSpeed = penTarget->m_fSpeed;\n if (fSpeed>=0) {\n m_fSpeed = fSpeed;\n }\n FLOAT fRotation = penTarget->m_fRotation;\n if (fRotation>=0) {\n m_fRotation = fRotation;\n }\n FLOAT fAcceleration = penTarget->m_fAcceleration;\n if (fAcceleration>=0) {\n m_fAcceleration = fAcceleration;\n }\n\n m_fOriginalRockingV = m_fRockingV;\n m_fOriginalRockingA = m_fRockingA;\n\n FLOAT fRockingV = penTarget->m_fRockingV;\n if (fRockingV>=0) {\n m_fNextRockingV = fRockingV;\n } else {\n m_fNextRockingV = m_fRockingV;\n }\n FLOAT fRockingA = penTarget->m_fRockingA;\n if (fRockingA>=0) {\n m_fNextRockingA = fRockingA;\n } else {\n m_fNextRockingA = m_fRockingA;\n }\n m_tmRockingChange = penTarget->m_tmRockingChange;\n m_tmRockingChangeStart = _pTimer->CurrentTick();\n\n // remember next marker as current target\n m_penTarget = penNextTarget;\n SetMovingSpeeds();\n }\n\n void StartSailing()\n {\n m_bMoving = TRUE;\n // calculate velocities towards marker\n SetMovingSpeeds();\n }", "title": "" }, { "docid": "84363e68b3fead2bebeffbc494506e9a", "score": "0.5424614", "text": "create(){\r\n this.bg = this.add.sprite(this.halfWidth, this.halfHeight, \"background\");\r\n this.wheel = this.add.sprite(this.halfWidth, this.halfHeight + (20 * dpr), \"wheel\").setInteractive();\r\n\r\n this.wheel.on(\"pointerdown\", this.spin, this);\r\n }", "title": "" }, { "docid": "e4bc75a07596424b482ba05c51cbee39", "score": "0.54231006", "text": "function shoot() {\n data.totalStars += data.totalMPS;\n data.totalCurrent += data.totalMPS;\n update();\n}", "title": "" }, { "docid": "61ea7cad16cb76f01605fde268e06e18", "score": "0.5419533", "text": "shoot() {\n document.dispatchEvent(new Event('actionStart'));\n this.pointList = this.getPointList(this);\n requestAnimationFrame(this.drawStep.bind(this));\n }", "title": "" }, { "docid": "59aeaec339bb41492f98e6f6fe9d11fd", "score": "0.5414038", "text": "function REctangle(){\n NewRectangle.visible=true;\n NewRectangle.addImage(PUrectangle);\n NewRectangle.scale = 0.2;\n a=3;\n }", "title": "" }, { "docid": "c08181a8deb7d10689520786e8453c19", "score": "0.5390072", "text": "function game() {\n px+=xv;\n py+=yv;\n if(px<0) {\n px= tc-1;\n }\n if(px>tc-1) {\n px= 0;\n }\n if(py<0) {\n py= tc-1;\n }\n if(py>tc-1) {\n py= 0;\n }\n asd.fillStyle=\"black\";\n asd.fillRect(0,0,canv.width,canv.height);\n\n asd.fillStyle=\"blue\";\n for(var i=0;i<trail.length;i++) {\n asd.fillRect(trail[i].x*gs,trail[i].y*gs,gs-2,gs-2);\n if(trail[i].x==px && trail[i].y==py) {\n tail = 5;\n }\n }\n trail.push({x:px,y:py});\n while(trail.length>tail) {\n trail.shift();\n }\n\n if(bx==px && by==py) {\n tail++;\n bx=Math.floor(Math.random()*tc);\n by=Math.floor(Math.random()*tc);\n }\n asd.fillStyle=\"yellow\";\n asd.fillRect(bx*gs,by*gs,gs-2,gs-2);\n}", "title": "" }, { "docid": "51cb2e9e39776c60920abbc74333947f", "score": "0.53890157", "text": "turnSnakeRight() {\r\n this.slitherer_.turnRight();\r\n }", "title": "" }, { "docid": "7e179eb765adc62d6b538947560fc0ea", "score": "0.5387875", "text": "function Shoot() {\n\n\t//Add fireRate and current time to nextFire\n\tnextFire = Time.time + fireRate;\n\t\n\t//Instantiate the projectile\n\tvar clone = Instantiate (projectile, transform.position, transform.rotation);\n\t\t\n\t//Name the clone \"Shot\" ::: this name will appear in the Hierarchy View when you Instantiate the object\n\tclone.name = \"Shot\";\n\t\n\t//Add speed to the target\n\tclone.GetComponent.<Rigidbody>().velocity = transform.TransformDirection (Vector3.forward * Velocity);\n\t\n}", "title": "" }, { "docid": "79f60de8b2d38a3c9fa088ef44788c09", "score": "0.53876305", "text": "function hitShutter(){\n digitalWrite(PIN_SHUTTER, 1);\n setTimeout(function(){\n digitalWrite(PIN_SHUTTER, 0);\n },300); //button press duration\n}", "title": "" }, { "docid": "feaf5ba9f52c2e4d5498cf73fb0b8ac2", "score": "0.5385674", "text": "shake() {\n \n this.x = random(this.homex-this.rA, this.homex + this.rA);\n this.y = random(this.homey-this.rA, this.homey + this.rA);\n this.theta = random(-PI / this.a, PI / this.a);\n \n }", "title": "" }, { "docid": "88c27649efdfe99e67126926401758d9", "score": "0.53775144", "text": "function angleShooter(name, value) {\n robot.rotator.run_to_position(value, 50);\n}", "title": "" }, { "docid": "83d963735823dbbfb52e1cd7b03ecb2b", "score": "0.53774685", "text": "async putBackTool() {\n await this.farmbot.moveAbsolute({\n x: this.water_nozzle.x + 150,\n y: this.water_nozzle.y,\n z: 0,\n });\n\n await this.farmbot.moveAbsolute({\n x: this.water_nozzle.x + 150,\n y: this.water_nozzle.y,\n z: this.water_nozzle.z - 2,\n });\n\n await this.farmbot.moveAbsolute({\n x: this.water_nozzle.x,\n y: this.water_nozzle.y,\n z: this.water_nozzle.z - 2,\n });\n\n await this.farmbot.moveAbsolute({\n x: this.water_nozzle.x,\n y: this.water_nozzle.y,\n z: 0,\n });\n\n await this.farmbot.moveAbsolute({\n x: 0,\n y: 100,\n z: 0,\n });\n }", "title": "" }, { "docid": "5fddd3b005d0def5dbf0500eddb117c2", "score": "0.5375724", "text": "function drawTurret(x, y,startAngle, endAngle, radius, color) {\n\tcontext.beginPath();\n\tcontext.strokeStyle = color;\n\tcontext.arc(x, y, radius, startAngle, endAngle); \n\tcontext.lineWidth = 3;\n\tcontext.stroke();\n}", "title": "" }, { "docid": "513f0d0a0b7585d6f951d4498b772fbe", "score": "0.5366633", "text": "function spawnRedleaf(){\n\n if (frameCount % 80 === 0) {\n red=createSprite(0,0,40,40);\n red.addImage(\"red\",redimg)\n red.scale = 0.1;\n red.velocityY=3;\n red.x = Math.round(random(10,100));\n red.depth = rabbit.depth\n rabbit.depth = red.depth + 1\n \n }\n\n\n}", "title": "" }, { "docid": "77b6fbcfdf24665e732da3a1c1925c20", "score": "0.53659374", "text": "function drop() {\n eraseTetromino();\n while (!collides(currentTetromino.tetromino, currentTetromino.x, currentTetromino.y + 1)) {\n currentTetromino.y++;\n }\n drawTetromino();\n }", "title": "" }, { "docid": "5ef29290b4144d3b04b91ef88658397d", "score": "0.53657085", "text": "function draw() {\n\n // Move the felt image down by increasing its y position\n feltTextureImageY += 1;\n // Move the comb image to the left by increasing the x position\n combTextureImageX ++;\n\n // Display the felt image\n image(feltTextureImage,feltTextureImageX,feltTextureImageY);\n // Display the comb image\n image(combTextureImage,combTextureImageX,combTextureImageY);\n\n // Move the clown by moving it 1/10th of its current distance from the mouse\n\n // Calculate the distance in X and in Y\n var xDistance = mouseX - clownImageX;\n var yDistance = mouseY - clownImageY;\n // Add 1/10th of the x and y distance to the clown's current (x,y) location\n clownImageX = clownImageX + xDistance/10;\n clownImageY = clownImageY + yDistance/10;\n\n // Display the clown image\n image(clownImage,clownImageX,clownImageY);\n // Calculates the distance between soupX&Y and mouseX&Y\n var xDistanceSoup = mouseX - soupImageX;\n var yDistanceSoup = mouseY - soupImageY;\n // add 1/40th of the x and y distance from the soups current location\n soupImageX = soupImageX + xDistanceSoup/80;\n soupImageY = soupImageY + yDistanceSoup/80;\n\n // Display the soup yum yum\n image(soupImage,soupImageX,soupImageY);\n\n // Keeps the shrimp moving with the mouse\n shrimpImageX = mouseX;\n shrimpImageY = mouseY;\n // Display the crustacean\n image(shrimpImage,shrimpImageX,shrimpImageY);\n}", "title": "" }, { "docid": "53f1334255503f4ab3ea54e850d43e92", "score": "0.53651273", "text": "step() {\n // Sets an initial speed of 1px per ms\n const t = (Date.now() - this.lastUpdated);\n\n // Add Gravity vectory\n this.displacement.add(Victor(0, 0.01))\n\n const new_position = Victor(0, 0)\n .add(this.position)\n .add(this.displacement.clone().multiplyScalar(t))\n .unfloat();\n\n // Overwrite with a white pixel\n ctx.fillStyle=\"white\";\n ctx.fillRect(this.position.x, this.position.y, 1, 1);\n // Draw a blue pixel\n ctx.fillStyle=\"blue\";\n ctx.fillRect(new_position.x, new_position.y, 1, 1);\n\n this.position = new_position;\n this.lastUpdated = Date.now()\n }", "title": "" }, { "docid": "6602798efcddb318276ef4ee53a8e450", "score": "0.5363032", "text": "function spinningBox() {\n rotateX(x);\n rotateY(y);\n rotateZ(z);\n box(boxWidth, boxHeight, boxDepth);\n}", "title": "" }, { "docid": "3fb5c28b75123598ed0db16a84e073ec", "score": "0.5362179", "text": "shake() {\n this.x += random(-2,2);\n this.y += random(-2,2);\n this.theta += random(-0.1, 0.1);\n }", "title": "" }, { "docid": "b00446a906964b1971df6ec57ec1f618", "score": "0.5359811", "text": "turnSnakeLeft() {\r\n this.slitherer_.turnLeft();\r\n }", "title": "" }, { "docid": "3dbd49757aed9840daa7684702764f07", "score": "0.53574836", "text": "function freeze () {\n if(current.some(index => squares[currentPosition + index + width].classList.contains('taken'))){\n current.forEach(index => squares[currentPosition + index].classList.add('taken'));\n // start a new Tetromino falling\n generateShape();\n }\n }", "title": "" }, { "docid": "aee8682b370f4eb9d0726346ccb5cd00", "score": "0.53560245", "text": "function shoot(){\n\tif(logging)\n\t\tconsole.log(\"shoot; Shoottime: \" + (game.time.now > nextShoot) + \"; NotAlive: \" + !shootingBox_Sprite.alive);\n\n\t// if we are allowed to shoot and there are shootingBoxes (should always be true)\n\tif (game.time.now > nextShoot && !shootingBox_Sprite.alive)\n\t{\n\t\tshootCounter++;\n\t\tshootCounterTmp++;\n\n\t\tnextShoot = game.time.now + shootRate;\n\n\t\t// if we swap, do not allow new shoots\n\t\tif(shootCounter%shootsTilLine == 0) {\n\t\t\tif(logging)\n\t\t\t\tconsole.log(\"locked\");\n\t\t\tnextShoot = game.time.now + 2000;\n\t\t}\n\n\t\tshootingBox_Sprite.hasCollided = false;\n\t\tshootingBox_Sprite.reset(pointer_Sprite.x, pointer_Sprite.y);\n\t\tshootingBox_Sprite.loadTexture(myBox_Sprite.key);\n\t\tshootingBox_Sprite.frame = currentShootingBox;\n\n\t\t// calculate \"mouse\" position on top by angle\n\t\tvar posX = Math.tan(rotation) * shootingBox_Sprite.y;\n\t\ttmpPointer.x = posX + pointer_Sprite.x;\n\t\ttmpPointer.y = 0;\n\n\t\tgame.physics.arcade.moveToPointer(shootingBox_Sprite, 1800, tmpPointer);\n\n\t\tcurrentShootingBox = getValidColor(false, true);\n\t\tmyBox_Sprite.loadTexture('boxCollection' + Number(colorOn));\n\t\tmyBox_Sprite.frame = currentShootingBox;\n\t}\n}", "title": "" }, { "docid": "4d2ee26c5e99cfa4f3f6e1d0161e84a3", "score": "0.5352662", "text": "function deployShield(){\r\n\t\r\n\tif(score >=5000){\r\n\t\thasShield = true;\r\n\t\tgetShieldActive.play();\r\n\t}\r\n\telse{\r\n\t\tgetShieldNotReady.play();\r\n\t\tconsole.log(\"NEGATIVE\");\t\r\n\t}\r\n}", "title": "" }, { "docid": "91d749d3f5e22fb3ee9a3bc6a4a5322d", "score": "0.534313", "text": "function start() {\r\n\r\n //make projectile appear\r\n ctx.drawImage(projectile, positionCannon, shooting, 80, 80);\r\n\r\n //if didn't reach top end of box, move 1px\r\n if (shooting !==20){\r\n //clear previous image\r\n ctx.clearRect(positionCannon, shooting, 80, 80);\r\n shooting--;\r\n ctx.drawImage(projectile, positionCannon, shooting, 80, 80);\r\n\r\n //if hit\r\n //if left edge of projectile is between edges of target\r\n if (shooting == 21) { \r\n if ( ( (positionCannon <= Number(positionVirus[score]) )\r\n && (Number(positionVirus[score]) <= (positionCannon+80) ) )\r\n || ( (positionCannon <= Number(positionVirus[score]+80) )\r\n && (Number(positionVirus[score]+80) <= (positionCannon+80) ) ) ){\r\n //update score\r\n score++;\r\n document.getElementById(\"score\").innerHTML=\"Viruses destroyed: \" + score + \" /10\";\r\n //clear old target\r\n ctx.clearRect(positionVirus[score-1], 20, 80, 80);\r\n //generate new target\r\n ctx.drawImage(target, positionVirus[score] , 20, 80, 80);\r\n\r\n if (score == 10){\r\n document.getElementById(\"game\").style.display = \"none\";\r\n document.getElementById(\"reload\").style.display = \"block\";\r\n }\r\n }\r\n else {console.log(\"prout\");}\r\n\r\n }\r\n\r\n }\r\n\r\n //if reached, stop interval\r\n else {\r\n clearInterval(animation);\r\n ctx.clearRect(positionCannon, 20, 80, 80);\r\n }\r\n }", "title": "" }, { "docid": "42287211884144dfb767f77888854428", "score": "0.53345364", "text": "function rover(x)\n {\n fill(220);\n ellipse(x+20,310,20)\n ellipse(x+80,310,20)\n ellipse(x+50,310,20)\n quad(x,290,x+100,290,x+100,300,x,300);\n quad(x+80,240,x+90,240,x+90,290,x+80,290);\n quad(x+70,230,x+100,230,x+100,240,x+70,240);\n quad(x+25,260,x+30,260,x+30,290,x+25,290);\n ellipse(x+80,235,6)\n ellipse(x+90,235,6)\n\n }", "title": "" }, { "docid": "f12652d2c3831574fb51547f1dc2b288", "score": "0.532743", "text": "function deplaceTricycle() {\n xTricycle += sens * pasTricycle;\n if (sens == 1) {\n if (xTricycle >= maxTricycle) {\n xTricycle = maxTricycle;\n sens = -1;\n tricycle = retour;\n if (seq == 4) {\n seq = 5;\n }\n }\n } else {\n if (xTricycle <= minTricycle) {\n xTricycle = minTricycle;\n sens = 1;\n tricycle = aller;\n if (seq == 4) {\n seq = 5;\n }\n }\n }\n image(tricycle, xTricycle, yTricycle);\n}", "title": "" }, { "docid": "ef86015c3813d99cd2c98290dc522cad", "score": "0.53272444", "text": "function draw() {\n\n //clear out background\n background(255, 0, 255);\n\n //create a new drop on a 1% chance\n if(Math.random() < .05) {\n rainManager.createDrop();\n }\n\n rainManager.update();\n}", "title": "" }, { "docid": "41d800a5286e2fa2cc3e0e9ba1fd4b45", "score": "0.53267133", "text": "function crater() {\n for (a = 0; a < 2 * M_PI; a += 4 * deg) {\n for (gr = 0; gr < Acr; gr++) {\n px = parseInt(Acx + cos(a) * gr);\n py = parseInt(Acy + sin(a) * gr);\n vptr = parseInt(px + 360 * py);\n //asm:\n al = p_background[vptr];\n tgr = gr << 4;\n ah = al & tgr;\n cl = lave;\n ah = ah >> cl;\n al = al - ah;\n if (al < 0) {\n al = 0;\n }\n p_background[vptr] = al;\n //end asm\n }\n //more asm:\n //WTF: todo look at\n ax = 62; //was 0x013E\n p_background[vptr] = ax;\n //end asm\n if (crays && !RANDOM(crays)) {\n b = (2 + RANDOM(2)) * Acr;\n if (Acy - b > 0 && Acy + b < 179) {\n for (gr = Acr + 1; gr < b; gr++) {\n px = parseInt(Acx + cos(a) * gr);\n py = parseInt(Acy + sin(a) * gr);\n vptr = parseInt(px + 360 * py);\n //asm:\n al = p_background[vptr] + Acr;\n if (al > 0x3e) {\n al = 0x3e;\n }\n if (al < 0) {\n al = 0;\n }\n p_background[vptr] = al;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "a51117182886d2d63653158b6c151e7d", "score": "0.5319283", "text": "function pendown() { turtle.penDown = true; }", "title": "" }, { "docid": "558eb96dd7383dba1f3979edbb77e430", "score": "0.53175104", "text": "function drawCollectable(t_collectable)\n{\n //ruby\n fill(240,0,0);\n quad(t_collectable.pos_x-10, t_collectable.pos_y,\n t_collectable.pos_x, t_collectable.pos_y -t_collectable.size/2,\n t_collectable.pos_x+10, t_collectable.pos_y,\n t_collectable.pos_x, t_collectable.pos_y +t_collectable.size/2);\n //shiny center circle\n fill(218,225,19,240);\n ellipse(t_collectable.pos_x,t_collectable.pos_y,t_collectable.size/3);\n noStroke();\n \n}", "title": "" } ]
d8c4bccc6a7eae5d8d1a0fa815c7eb3d
additional functions for events
[ { "docid": "5d90318c07411ff2812df60bc4f53f7a", "score": "0.0", "text": "function history() {\n\t\tconst operations = [];\n\n\t\treturn function (expression, answer, historyBlock) {\n\t\t\tconst expObject = { expression: expression, answer: answer };\n\t\t\toperations.push(expObject);\n\t\t\thistoryBlock.textContent = \"\";\n\t\t\toperations.forEach((obj, index) => {\n\t\t\t\tconst expElem = document.createElement(\"p\");\n\t\t\t\tconst answerElem = document.createElement(\"p\");\n\t\t\t\texpElem.textContent = `${index + 1}) ${obj.expression}`;\n\t\t\t\tanswerElem.textContent = obj.answer;\n\t\t\t\thistoryBlock.append(expElem);\n\t\t\t\thistoryBlock.append(answerElem);\n\t\t\t});\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "5f7fd974c9f35c2efe07cf88b6527044", "score": "0.75554854", "text": "_addEvents () {\n\n }", "title": "" }, { "docid": "2b3b41097d1d97322da9140e50295517", "score": "0.726781", "text": "_bindEvents()\n {\n \n }", "title": "" }, { "docid": "4a1a553b270d579b202bc384d879b06f", "score": "0.7208103", "text": "wireUpEvents() { }", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.718021", "text": "function EventHandlers() {}", "title": "" }, { "docid": "8a06ca2b68983ed60b88dde17d477af4", "score": "0.70998025", "text": "bindEvent() {}", "title": "" }, { "docid": "cdf90275b78eafec18713dd94684bc3e", "score": "0.706138", "text": "function InternalEvent(){}", "title": "" }, { "docid": "95b577bc2dbea65d7d2c01d03ce51c95", "score": "0.7033755", "text": "function Events(){}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "cba9b3bf174257539223fa1ac3a83ab8", "score": "0.70334005", "text": "function Events() {}", "title": "" }, { "docid": "09edd80d28b61550a99d46199191f2a7", "score": "0.6972884", "text": "function Event () {}", "title": "" }, { "docid": "bab1c3ab0212407315eb045405256f16", "score": "0.6875264", "text": "function InternalEvent() {}", "title": "" }, { "docid": "bab1c3ab0212407315eb045405256f16", "score": "0.6875264", "text": "function InternalEvent() {}", "title": "" }, { "docid": "bab1c3ab0212407315eb045405256f16", "score": "0.6875264", "text": "function InternalEvent() {}", "title": "" }, { "docid": "3963a07f542c3c657f2479bc3f4970b7", "score": "0.6872802", "text": "function Events() { }", "title": "" }, { "docid": "3963a07f542c3c657f2479bc3f4970b7", "score": "0.6872802", "text": "function Events() { }", "title": "" }, { "docid": "e88818ffd217ae2d471a9c0e2120ca1f", "score": "0.68554515", "text": "registerEvents() {\n\t\tthis.getScore();\n\t\tthis.cardEvents();\n\t}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.6836459", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.6836459", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "dc4614837716c00b4fda57e865c5a831", "score": "0.6790869", "text": "addEvents() {\n this.addEvent(document, 'click', 'onDocumentClick');\n this.addEvent(this.$wrapper, 'keydown', 'onKeyDown');\n this.addEvent(this.$toggleButton, 'click', 'onToggleButtonClick');\n this.addEvent(this.$clearButton, 'click', 'onClearButtonClick');\n this.addEvent(this.$dropboxContainer, 'click', 'onDropboxContainerClick');\n this.addEvent(this.$dropboxCloseButton, 'click', 'onDropboxCloseButtonClick');\n this.addEvent(this.$optionsContainer, 'scroll', 'onOptionsScroll');\n this.addEvent(this.$options, 'click', 'onOptionsClick');\n this.addEvent(this.$options, 'mouseover', 'onOptionsMouseOver');\n this.addEvent(this.$options, 'touchmove', 'onOptionsTouchMove');\n }", "title": "" }, { "docid": "89da091d485e66e055c66266e5b4fc39", "score": "0.6745606", "text": "registerEvents() {\n this.registerButtonEvent();\n this.registerFrontLayerEvent();\n }", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.6744452", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.6744452", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.6744452", "text": "handleEvent() {}", "title": "" }, { "docid": "e51fb0837094c99a3bfc46cbf8a398f4", "score": "0.6744013", "text": "function events() {\n // event for clicking on ortholog count\n $('.show-reaction' + self.pref).unbind('click');\n $('.show-reaction' + self.pref).click(function () {\n const id = $(this).data('id');\n if (tabWidget.hasTab(id)) {\n tabWidget.showTab(id);\n return;\n }\n tabWidget.addTab({\n tab: id,\n content: 'Coming soon!',\n canDelete: true,\n show: true,\n });\n });\n $('.show-gene' + self.pref).unbind('click');\n $('.show-gene' + self.pref).click(function () {\n const id = $(this).data('id');\n if (tabWidget.hasTab(id)) {\n tabWidget.showTab(id);\n return;\n }\n tabWidget.addTab({\n tab: id,\n content: 'Coming soon!',\n canDelete: true,\n show: true,\n });\n });\n }", "title": "" }, { "docid": "e3b720371ff2411314f28863807bcb60", "score": "0.6698754", "text": "_events() {\n \tthis._addInitHandler();\n }", "title": "" }, { "docid": "5c785c3db98df873476dff4549f42eed", "score": "0.6642808", "text": "registerEvents() {\n\t\tthis.registerSwitchEvents();\n\t\tthis.registerUsersChange();\n\t\tthis.registerAutofillTime();\n\t\tthis.registerPopoverButtonsClickEvent();\n\t}", "title": "" }, { "docid": "5508e4e1dc5d378a456f9c7b50f1aa9c", "score": "0.66259", "text": "function register_event_handlers()\n {\n\n\n }", "title": "" }, { "docid": "d254086f252372aabfcdb6cef1c243a8", "score": "0.6603513", "text": "handleEvent(node, eventName, callback, locals) {\n if (!_.includes(['blur', 'focus', 'change', 'click'], eventName)) {\n super.handleEvent(node, eventName, callback, locals);\n }\n }", "title": "" }, { "docid": "defcc68ed0d49bb427a3ef2bc8b545dc", "score": "0.66005886", "text": "handleEvent(event) {\n switch (event.type) {\n case 'click':\n this._evtClick(event);\n break;\n case 'lm-dragenter':\n this._evtDragEnter(event);\n break;\n case 'lm-dragleave':\n this._evtDragLeave(event);\n break;\n case 'lm-dragover':\n this._evtDragOver(event);\n break;\n case 'lm-drop':\n this._evtDrop(event);\n break;\n default:\n return;\n }\n }", "title": "" } ]
015e820a9551cac930087352c41e5498
Resets the current search value
[ { "docid": "018b14c5591b2d9af1a1dd49b93a8f26", "score": "0.0", "text": "_reset(focus) {\n this._formControl.setValue('');\n if (focus) {\n this._focus();\n }\n }", "title": "" } ]
[ { "docid": "e412af38544a2ae623b4dcd37debd0c0", "score": "0.83444774", "text": "function resetSearch(){\n setSearching(false);\n }", "title": "" }, { "docid": "f3390c0b05506572be4d1846ff6c420e", "score": "0.79071116", "text": "function resetSearch(){\n setSearchField(\"all\");\n setSearchText(\"\");\n setShowResults(false);\n }", "title": "" }, { "docid": "c633c4b340558853e712a297f70ffa13", "score": "0.78532356", "text": "function resetSearch() {\n ctrl.searchQuery = '';\n $timeout(makeSearch);\n }", "title": "" }, { "docid": "c633c4b340558853e712a297f70ffa13", "score": "0.78532356", "text": "function resetSearch() {\n ctrl.searchQuery = '';\n $timeout(makeSearch);\n }", "title": "" }, { "docid": "906bb23276b91d694351045951aff513", "score": "0.7710899", "text": "function clear() {\n self.searchText = '';\n search();\n }", "title": "" }, { "docid": "62337baaefd6d65f284842da80a3aa80", "score": "0.7708685", "text": "function reset() {\n vm.search = [];\n getReasonsList(1, '');\n } //END reset()", "title": "" }, { "docid": "365a7b6da37b33c4ef36408cfd898487", "score": "0.7617069", "text": "function clearValue () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occour when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n // Reset our variables\n ctrl.index = 0;\n ctrl.matches = [];\n $scope.searchText = '';\n\n // Per http://www.w3schools.com/jsref/event_oninput.asp\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('input', true, true, { value: $scope.searchText });\n elements.input.dispatchEvent(eventObj);\n\n elements.input.focus();\n }", "title": "" }, { "docid": "365a7b6da37b33c4ef36408cfd898487", "score": "0.7617069", "text": "function clearValue () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occour when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n // Reset our variables\n ctrl.index = 0;\n ctrl.matches = [];\n $scope.searchText = '';\n\n // Per http://www.w3schools.com/jsref/event_oninput.asp\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('input', true, true, { value: $scope.searchText });\n elements.input.dispatchEvent(eventObj);\n\n elements.input.focus();\n }", "title": "" }, { "docid": "b5b22019e4f90c696634598b5ecb0e4b", "score": "0.7601065", "text": "function resetSearch() {\n setSearch(\"\");\n $(\"#search_text\").val(\"\");\n $(\"#reset-search\").hide();\n refreshProjectsData();\n}", "title": "" }, { "docid": "fa66bce054ab4524aa5f9cf36bf19085", "score": "0.7563934", "text": "function clearValue () {\n\t // Set the loading to true so we don't see flashes of content.\n\t // The flashing will only occour when an async request is running.\n\t // So the loading process will stop when the results had been retrieved.\n\t setLoading(true);\n\n\t // Reset our variables\n\t ctrl.index = 0;\n\t ctrl.matches = [];\n\t $scope.searchText = '';\n\n\t // Per http://www.w3schools.com/jsref/event_oninput.asp\n\t var eventObj = document.createEvent('CustomEvent');\n\t eventObj.initCustomEvent('input', true, true, { value: $scope.searchText });\n\t elements.input.dispatchEvent(eventObj);\n\n\t elements.input.focus();\n\t }", "title": "" }, { "docid": "fa9323a9f9a5505a81f5b58bf1b598ea", "score": "0.75476265", "text": "clearSearch() {\n this.searchTerm = '';\n this.pendingMappings = angular.copy(this.cachedPendingMappings_);\n }", "title": "" }, { "docid": "c3708980f74f18bede67a14bba9b54e9", "score": "0.7505881", "text": "function clearSearch() {\n $scope.searchInput = '';\n searchAndUpdateView();\n }", "title": "" }, { "docid": "430d5b14a249f24a55ae404e60ba362d", "score": "0.7488727", "text": "function reset() {\n vm.search = [];\n getSubjectsList(1, '');\n }//END reset()", "title": "" }, { "docid": "7620d787686d8316a2e30650fcbf350b", "score": "0.74871296", "text": "function _resetSearchInput() {\n if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {\n ctrl.search = EMPTY_SEARCH;\n //reset activeIndex\n if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {\n ctrl.activeIndex = ctrl.items.indexOf(ctrl.selected);\n }\n }\n }", "title": "" }, { "docid": "7620d787686d8316a2e30650fcbf350b", "score": "0.74871296", "text": "function _resetSearchInput() {\n if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {\n ctrl.search = EMPTY_SEARCH;\n //reset activeIndex\n if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {\n ctrl.activeIndex = ctrl.items.indexOf(ctrl.selected);\n }\n }\n }", "title": "" }, { "docid": "48377e3486936a7757236357f0ba4b2e", "score": "0.7474758", "text": "function reset() {\n vm.search = [];\n getBudgetsList(1,'');\n }//END reset()", "title": "" }, { "docid": "073f81802414ca863e5c53abcaedccfe", "score": "0.7428514", "text": "function reset() {\n vm.search = [];\n getCategoriesList(1,'');\n }", "title": "" }, { "docid": "c813983170f05a331c2d89511df8c477", "score": "0.74239343", "text": "function _resetSearchInput() {\n if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {\n ctrl.search = EMPTY_SEARCH;\n //reset activeIndex\n if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {\n ctrl.activeIndex = _findIndex(ctrl.items, function(item){\n return angular.equals(this, item);\n }, ctrl.selected);\n }\n }\n }", "title": "" }, { "docid": "714b81a4e17a39ce954d47c094463a33", "score": "0.74010986", "text": "function _resetSearchInput() {\n if (ctrl.resetSearchInput) {\n ctrl.search = EMPTY_SEARCH;\n //reset activeIndex\n if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {\n ctrl.activeIndex = _findIndex(ctrl.items, function(item){\n return angular.equals(this, item);\n }, ctrl.selected);\n }\n }\n }", "title": "" }, { "docid": "389057e1442bf5c71d7661eecfe1cde1", "score": "0.73805326", "text": "function _resetSearchInput() {\n if (ctrl.resetSearchInput || (ctrl.resetSearchInput === undefined && uiSelectConfig.resetSearchInput)) {\n ctrl.search = EMPTY_SEARCH;\n //reset activeIndex\n if (ctrl.selected && ctrl.items.length && !ctrl.multiple) {\n ctrl.activeIndex = _findIndex(ctrl.items, function(item){\n return angular.equals(this, item);\n }, ctrl.selected);\n }\n }\n }", "title": "" }, { "docid": "fec74b0470b427e8bd0a27d8f99d2591", "score": "0.73379964", "text": "function umResetSearch()\r\n{\r\n\tvar InputBox = document.getElementById(\"umSearchInputText\");\r\n\tif (InputBox) InputBox.value = \"\";\r\n\r\n\tumMapState.ResetSearch();\r\n\tumDeleteLocations();\r\n\r\n\tumGetMarkers(umMapState);\r\n\tumUpdateLink();\r\n}", "title": "" }, { "docid": "da7b72c1a5a8315b14b60a7e5346ea5e", "score": "0.7336782", "text": "function reset() {\n vm.search = [];\n getSkillsList(1,'');\n }//END reset()", "title": "" }, { "docid": "846904f6b38ec2771fceab1c287d0eb9", "score": "0.7214854", "text": "function resetSearchForm() {\n if(filter.type === \"search\") {\n document.getElementById(\"search\").value = \"\";\n document.getElementById(\"search\").placeholder = \"Search All cards\";\n }\n}", "title": "" }, { "docid": "a4a607f9d145bf54f7221dc2391a6c45", "score": "0.72133327", "text": "function resetSearch() {\r\n\r\n // Svuoto la lista di film e serie.\r\n $(\"#movies-list\").html(\"\");\r\n $(\"#series-list\").html(\"\");\r\n\r\n // Pulisco il campo di input.\r\n $(\"#search-media\").val(\"\");\r\n }", "title": "" }, { "docid": "abb949b25f0e5d9d75de765f92fb9a6c", "score": "0.7192119", "text": "function clearValue () {\n\t clearSelectedItem();\n\t clearSearchText();\n\t }", "title": "" }, { "docid": "4cba49d2e5aa5a815ffd17e604548638", "score": "0.71914077", "text": "function reset() {\n vm.search = [];\n getProjectList(1, '');\n } //END reset()", "title": "" }, { "docid": "264aa48ddb20a99a12a7b4e244836467", "score": "0.719083", "text": "function searchclear() {\n document.search.nasaInclude.value = '';\n}", "title": "" }, { "docid": "46cfdd9e9f8d52f189952dc2b6b274b5", "score": "0.7187099", "text": "function clearValue () {\n clearSelectedItem();\n clearSearchText();\n }", "title": "" }, { "docid": "46cfdd9e9f8d52f189952dc2b6b274b5", "score": "0.7187099", "text": "function clearValue () {\n clearSelectedItem();\n clearSearchText();\n }", "title": "" }, { "docid": "46cfdd9e9f8d52f189952dc2b6b274b5", "score": "0.7187099", "text": "function clearValue () {\n clearSelectedItem();\n clearSearchText();\n }", "title": "" }, { "docid": "46cfdd9e9f8d52f189952dc2b6b274b5", "score": "0.7187099", "text": "function clearValue () {\n clearSelectedItem();\n clearSearchText();\n }", "title": "" }, { "docid": "46cfdd9e9f8d52f189952dc2b6b274b5", "score": "0.7187099", "text": "function clearValue () {\n clearSelectedItem();\n clearSearchText();\n }", "title": "" }, { "docid": "46cfdd9e9f8d52f189952dc2b6b274b5", "score": "0.7187099", "text": "function clearValue () {\n clearSelectedItem();\n clearSearchText();\n }", "title": "" }, { "docid": "15db732a87b16ddbcdd36f3d68abdafc", "score": "0.7181751", "text": "function clearInputField() {\n ctrl.searchQuery = '';\n }", "title": "" }, { "docid": "15db732a87b16ddbcdd36f3d68abdafc", "score": "0.7181751", "text": "function clearInputField() {\n ctrl.searchQuery = '';\n }", "title": "" }, { "docid": "6b33f0cc36d77164795a18ec82da490c", "score": "0.7167977", "text": "onResetSearch() {\n\n\t\t$(\".catalog-filter-search .value\").on(\"keyup\", ev => {\n\t\t\tconst val = $(ev.currentTarget).val() !== \"\" ? \"visible\" : \"hidden\";\n\t\t\t$(\".reset .symbol\", $(ev.currentTarget).closest(\".catalog-filter-search\")).css(\"visibility\", val);\n\t\t});\n\n\t\t$(\".catalog-filter-search .reset\").on(\"click\", ev => {\n\t\t\tconst input = $(ev.currentTarget).parents(\".catalog-filter-search\").find(\".value\");\n\n\t\t\t$(\".symbol\", ev.currentTarget).css(\"visibility\", \"hidden\");\n\t\t\tinput[0].focus();\n\t\t\tinput.val(\"\");\n\n\t\t\treturn false;\n\t\t});\n\t}", "title": "" }, { "docid": "609bc7757975bf7a2ede9026c9049a78", "score": "0.7138208", "text": "'click .reset'(event){\n event.preventDefault();\n Session.set(\"searchValue\", \"\");\n }", "title": "" }, { "docid": "710b5592b6df31ba1b08d6403a16252a", "score": "0.7128659", "text": "function serchclr(){\n $(\"#searchtxt\").val(\"\");\n \n}", "title": "" }, { "docid": "994e475a181084024e290e8d95212350", "score": "0.7119917", "text": "function resetSearch(child, parent) {\n\t\tif($(child).closest(parent).find('.search_data').val() != 0) {\n\t\t\t$(child).closest(parent).find('.search_data').val('');\n\t\t}\n\t}", "title": "" }, { "docid": "c0db64b6ca0f27d5b51961429e03f619", "score": "0.7108866", "text": "function reset() {\n vm.search = [];\n getPackagesList(1,'');\n }//END reset()", "title": "" }, { "docid": "45fb81d3befcc05db53ce5e01d359ccf", "score": "0.7095314", "text": "function clearResults(){\n let textField = document.querySelector('#search');\n textField.value = \"\";\n resultsItr('');\n}", "title": "" }, { "docid": "40a4e9f062f93662acf11a39244518eb", "score": "0.7075457", "text": "_clearInput() {\n this._searchInput.value = '';\n }", "title": "" }, { "docid": "54543746b9b0cc3b09b642bbaffe002f", "score": "0.7064051", "text": "function resetSearchConditions() {\n\t\t$(\"#txtUsersId\").val(\"\");\n\t\t$(\"#txtUsersName\").val(\"\");\n\t\t$(\"#cbbStatus\").val(STATUS_NO_SELECT);\n\t}", "title": "" }, { "docid": "1b8248d176de93b2e2f227143bef3917", "score": "0.6991967", "text": "reset() {\n this._model.resetActualValue();\n this._view.resetFilterValue(this._model.actualValue)\n }", "title": "" }, { "docid": "e1431a60f7a1841e58850fcf53dfba20", "score": "0.6986629", "text": "function clearSearchResult() {\n _my.resultSelector.html(_blankText);\n }", "title": "" }, { "docid": "c27c059c7fc3115d6e2ae6c2e7d3ee2c", "score": "0.69840246", "text": "function clearSearch() {\n try {\n $rootScope.search_result = [];\n }\n catch (err) {\n console.error(`Clear search results problem: ${err}`);\n }\n }", "title": "" }, { "docid": "49270928b1aeb6ace4dd53c3493ccc01", "score": "0.698163", "text": "function clearSearch() {\n $(\"#series-search\")[0].value = \"\";\n $(\"#results-header\").empty();\n $(\"#search-results\").empty();\n}", "title": "" }, { "docid": "002e6d2b1e8c09c34292f3a945d55793", "score": "0.6977866", "text": "function clearValue () {\n $scope.searchText = '';\n select(-1);\n\n // Per http://www.w3schools.com/jsref/event_oninput.asp\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('input', true, true, {value: $scope.searchText});\n elements.input.dispatchEvent(eventObj);\n\n elements.input.focus();\n }", "title": "" }, { "docid": "84825c976b5e7dc5eb22f696781e77c1", "score": "0.69737804", "text": "reset() {\n\n this.model.selected = [];\n this.filter.clear(this.model);\n this.container.querySelector('.lazy-select-header__filter-input').value = '';\n this.container.querySelector('.lazy-select-list').innerHTML = '';\n this.screenUpdate();\n }", "title": "" }, { "docid": "de3c856b476f5b45244e2ff62ac0ef2e", "score": "0.6933252", "text": "function searchReset () {\n students.hide();\n $('.pagination').remove();\n $('#sorry').remove();\n searchResults = [];\n}", "title": "" }, { "docid": "ce3fdedea1b5865cd0fa797cf3564341", "score": "0.69324476", "text": "clearAllFilter() {\n this.objSearchForm.reset(this.initialSearchFormValue);\n this.arrFilteredItems = [];\n this.strSortBy = 'Recommented';\n }", "title": "" }, { "docid": "4bc9ec3f7e6da49db9eaef3ed8050cf1", "score": "0.68852353", "text": "clearSearch(e){\n\t\te.target.value = ''\n\t}", "title": "" }, { "docid": "862ded44997ca2a5ca1c116b474071b3", "score": "0.68556213", "text": "reset() {\n this.list = [];\n this.lookup_name = '';\n this.clearSelection();\n this.clear();\n this.clearCache();\n }", "title": "" }, { "docid": "27d6edfc7e2bafe3e514fb574665c828", "score": "0.6828774", "text": "reset() {\n this.filtered_ = null;\n }", "title": "" }, { "docid": "014d5f65072b83a8d3fa8347b4269c51", "score": "0.68264335", "text": "resetFilterInputEl() {\n this.filterInputElValue = this.getFormattedSelection();\n }", "title": "" }, { "docid": "febbd53fad8e264f07e0e0f2057ab0e6", "score": "0.6815735", "text": "clearSearch(event){\n this.searchText='';\n }", "title": "" }, { "docid": "cd85906d4e39b7836bf6484630797888", "score": "0.6815183", "text": "function clearSearch() {\n $('#dog-input').clear();\n }", "title": "" }, { "docid": "aa4de5f5ca478fc4019831dd71e4cca5", "score": "0.68150306", "text": "function clearSearchText () {\n\t // Set the loading to true so we don't see flashes of content.\n\t // The flashing will only occur when an async request is running.\n\t // So the loading process will stop when the results had been retrieved.\n\t setLoading(true);\n\n\t $scope.searchText = '';\n\n\t // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n\t // But some browsers are not detecting it properly, which means that we have to trigger the event.\n\t // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n\t // The `change` event is a good alternative and is supported by all supported browsers.\n\t var eventObj = document.createEvent('CustomEvent');\n\t eventObj.initCustomEvent('change', true, true, { value: '' });\n\t elements.input.dispatchEvent(eventObj);\n\n\t // For some reason, firing the above event resets the value of $scope.searchText if\n\t // $scope.searchText has a space character at the end, so we blank it one more time and then\n\t // focus.\n\t elements.input.blur();\n\t $scope.searchText = '';\n\t elements.input.focus();\n\t }", "title": "" }, { "docid": "006914f71571b6e34433b418ed69b3bf", "score": "0.6809967", "text": "function clearSearch() {\n var form = document.forms['searchform'];\n form.name.value = \"\";\n form.country.selectedIndex = 0;\n form.active.selectedIndex = 0;\n form.mode.selectedIndex = 0;\n changeMode();\n form.iata.value = \"\";\n form.icao.value = \"\";\n form.alias.value = \"\";\n form.callsign.value = \"\";\n form.iatafilter.checked = true;\n form.alid.value = \"\";\n}", "title": "" }, { "docid": "e81487281027208f46d9039f2496becb", "score": "0.68009096", "text": "function clearField(){\n searchy.value = \"\"\n}", "title": "" }, { "docid": "672b7725d228b4d86efa40e71827ebff", "score": "0.6798201", "text": "function cleanSearch() {\n document.querySelector(\"#SearchValue\").value = \"\";\n}", "title": "" }, { "docid": "50fc4065f632f7b4c131a033153780f7", "score": "0.67978233", "text": "function clearInputValue( ){\n\tif (document.getElementById(\"glossfield\").value.indexOf(\"term to search\") > -1){\n\t\tdocument.getElementById(\"glossfield\").value = \"\";\n\t\tdocument.getElementById(\"glossfield\").focus();\n\t}\n}", "title": "" }, { "docid": "2028d5d80e5417c6a3b9458c2999aaed", "score": "0.6797513", "text": "function resetSearch() {\n pageNum = 1; \n $scope.followers = []; \n $scope.userFound = false; \n $scope.showFollowers = false; \n $scope.showNoFollowers = false; \n $scope.showLoadMore = false; \n $scope.showError = false;\n $scope.numFollowers = 0; \n }", "title": "" }, { "docid": "88808710c21926c17e9b6936d99f8f76", "score": "0.67906034", "text": "function resetResults() {\n previousDealers = [];\n $searchResultsContainer.html(\"\");\n $searchResults.hide();\n //remove overflow-y if there are no search results\n $scrollPane.removeClass(HAS_SEARCH_RESULTS_CLASS);\n\n if (bingMap) {\n bingMap.reset();\n }\n }", "title": "" }, { "docid": "ae347411d8ad2daf62f78d19f2a82c73", "score": "0.67851526", "text": "function clearSearchInputAndMore() {\n var el = document.getElementById(\"searchInput\");\n el.value = \"\";\n el.focus();\n Clear.disableClearIcon();\n List.clearListedResults();\n Map.clearHighlightedStates();\n }", "title": "" }, { "docid": "a9cd400030167c7c7dd8401a4a015249", "score": "0.67826307", "text": "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "title": "" }, { "docid": "a9cd400030167c7c7dd8401a4a015249", "score": "0.67826307", "text": "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "title": "" }, { "docid": "a9cd400030167c7c7dd8401a4a015249", "score": "0.67826307", "text": "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "title": "" }, { "docid": "a9cd400030167c7c7dd8401a4a015249", "score": "0.67826307", "text": "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "title": "" }, { "docid": "a9cd400030167c7c7dd8401a4a015249", "score": "0.67826307", "text": "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "title": "" }, { "docid": "a9cd400030167c7c7dd8401a4a015249", "score": "0.67826307", "text": "function clearSearchText () {\n // Set the loading to true so we don't see flashes of content.\n // The flashing will only occur when an async request is running.\n // So the loading process will stop when the results had been retrieved.\n setLoading(true);\n\n $scope.searchText = '';\n\n // Normally, triggering the change / input event is unnecessary, because the browser detects it properly.\n // But some browsers are not detecting it properly, which means that we have to trigger the event.\n // Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.\n // The `change` event is a good alternative and is supported by all supported browsers.\n var eventObj = document.createEvent('CustomEvent');\n eventObj.initCustomEvent('change', true, true, { value: '' });\n elements.input.dispatchEvent(eventObj);\n\n // For some reason, firing the above event resets the value of $scope.searchText if\n // $scope.searchText has a space character at the end, so we blank it one more time and then\n // focus.\n elements.input.blur();\n $scope.searchText = '';\n elements.input.focus();\n }", "title": "" }, { "docid": "abca70e829667ae427caa07cdda9d0ca", "score": "0.6717924", "text": "async ResetFilters() {\n document.getElementById(\"input_text_safe_search\").value = \"\";\n this.props.SetSearchString(\"\");\n this.props.SetSelectedFolder(null);\n }", "title": "" }, { "docid": "abca70e829667ae427caa07cdda9d0ca", "score": "0.6717924", "text": "async ResetFilters() {\n document.getElementById(\"input_text_safe_search\").value = \"\";\n this.props.SetSearchString(\"\");\n this.props.SetSelectedFolder(null);\n }", "title": "" }, { "docid": "759d9e8313deacf988c99d8982e0ae43", "score": "0.6712898", "text": "function reset() {\n frank_global.cateIndex = 0;\n frank_global.pagging = 0;\n frank_global.onSearch = false;\n frank_global.infiniteScrollLocker = false;\n}", "title": "" }, { "docid": "9689cc608bb5824213c13eb20ebda01e", "score": "0.6712501", "text": "function clearInput() { \n document.getElementById(\"search\").value = \"\";\n}", "title": "" }, { "docid": "4da7e8cf38b6aa600893fe566396a450", "score": "0.67037135", "text": "function _reset() {\n _selection = -1;\n _suggestions = [];\n _autocomplete.innerHTML = '';\n }", "title": "" }, { "docid": "632e100c61076de66a948ee626ac8e8e", "score": "0.66757184", "text": "function clearSearch() {\n // console.log(\"calling clear search\")\n $(\"#trainName\").val(\"\")\n $(\"#destination\").val(\"\")\n $(\"#firstTrain\").val(\"\")\n $(\"#frequency\").val(\"\")\n\n}", "title": "" }, { "docid": "3e033a54298b9a3e23e62099bb087531", "score": "0.6651406", "text": "function clearResults(){\n setJobLocationFilter(\"\")\n setJobTypeFilter(\"\")\n setjobSkillFilter(\"\")\n setFilteredResults([])\n }", "title": "" }, { "docid": "b6943ef50bc7118908664d2bc95b1561", "score": "0.6633756", "text": "function clear(index, componentId) {\n SearchVars.set(generateId(index, componentId), {\n 'searching' : false,\n 'searchingDone' : false,\n 'total' : 0,\n 'currentValue' : '',\n 'searchResults' : []\n });\n\n inputCache = '';\n }", "title": "" }, { "docid": "f28e6c9083ad21202b8b5a76b0f67423", "score": "0.6620667", "text": "function clearSearch() {\n jQuery(\"#search-term\").val(\"\");\n searchListings();\n jQuery(\"#clearSearch\").fadeOut(\"slow\");\n}", "title": "" }, { "docid": "29bac4575973f7a1cf711965b0da8dce", "score": "0.6618932", "text": "function clearInputFrom() {\n $(\"#search-input-from\").val('');\n // $('#interim_span').val();\n $('#interim_span').text('');\n $('#final_span').text('');\n\n }", "title": "" }, { "docid": "5963e51270b301efebc21e155ee37e61", "score": "0.6618801", "text": "resetQueryResults() {\n this.queryResults = [];\n }", "title": "" }, { "docid": "c4d80c93ad26b8f370cf43069105237e", "score": "0.6582447", "text": "change_to_search_again(){\n \n this.get_queryparam_and_set_state(); \n\n }", "title": "" }, { "docid": "e12a3914953618180eb18e16c976af83", "score": "0.65635806", "text": "function reset() {\n\n for(var rSet in $scope.resultSets) {\n $scope.resultSets[rSet].searchResults = [];\n $scope.resultSets[rSet].facets = [];\n $scope.resultSets[rSet].selectedFacets = [];\n $scope.resultSets[rSet].rowStartIndex = 0;\n $scope.resultSets[rSet].totalResults = 0;\n $scope.resultSets[rSet].moreResults = false;\n\n }\n\n\n\n }", "title": "" }, { "docid": "0a2278c590811366aa5aee16421365b2", "score": "0.6560915", "text": "function resetInput(){\n //svuoto l'input\n $('.input-search').val('');\n //svuoto il html per la prossima ricerca\n $('.container').empty();\n}", "title": "" }, { "docid": "9b53cda109f3a00527cf0e4d911f2179", "score": "0.6553059", "text": "clearSearch(){\n clearTimeout(this.state.currentSearch);\n }", "title": "" }, { "docid": "ffb05e3bc805e2e24793b4b846fb43b9", "score": "0.6548917", "text": "function clearResults() {\n\t\t\tvar results = document.getElementById(\"results\").value = \"\";\n\t\t\tvar d20 = document.getElementById(\"d20\").value = \"\";\n\t\t}", "title": "" }, { "docid": "12c0cf13123af1cbdf26b4fc3644e10f", "score": "0.6544654", "text": "_reset() {\r\n\t\tthis._value = -1;\r\n\t}", "title": "" }, { "docid": "09946d209eb60034a506c41a6e176f38", "score": "0.6541191", "text": "function setup_search(){\n\n var searchDefaultText = $(\".clear-on-focus\").attr(\"value\");\n\n $(\".clear-on-focus\").focus(function(){\n if($(this).attr(\"value\") == searchDefaultText) $(this).attr(\"value\", \"\");\n });\n $(\".clear-on-focus\").blur(function(){\n if($(this).attr(\"value\") == \"\") $(this).attr(\"value\", searchDefaultText);\n });\n}", "title": "" }, { "docid": "697b19c3654cd5dd0e6afc4baf9a9100", "score": "0.6537837", "text": "resetAllFilters() {\n this.filterDropDownValues('');\n }", "title": "" }, { "docid": "97015f43a453e30b868fd490543ef6e8", "score": "0.65348876", "text": "_reset() {\n this._current = null;\n this._cursor = null;\n this._options = [];\n this._original = null;\n this._query = '';\n this._subsetMatch = false;\n this._typeMap = {};\n this._orderedTypes = [];\n }", "title": "" }, { "docid": "87c774ed94dbd625b76e5ad97dd7859c", "score": "0.65330756", "text": "function Clear_Search()\n{\n\tdocument.getElementById(\"criteria_type_1\").value = \"application_id\";\n\tdocument.getElementById(\"criteria_type_2\").value = \"\";\n\tdocument.getElementById(\"search_deliminator_1\").value = \"is\";\n\tdocument.getElementById(\"search_deliminator_2\").value = \"is\";\n\tdocument.getElementById(\"search_criteria_1\").value = \"\";\n\tdocument.getElementById(\"search_criteria_2\").value = \"\";\n}", "title": "" }, { "docid": "2f59194239e6f5ade3e3408fb4ca6b15", "score": "0.65255207", "text": "function Reset() {\n $(\"#todate\").val(startdate);\n $(\"#fromdate\").val(enddate);\n $(\"#ddlReqStatus\").val('');\n $(\"#ddlApprovalStatus\").val('');\n $('#ddlRequisitionBy').val('ALL');\n $('#Search').val('');\n FilterContent();\n}", "title": "" }, { "docid": "375099d5f846a8c956c8fa1813b75b4e", "score": "0.65239483", "text": "clearQuery() {\n this.setQuery('');\n }", "title": "" }, { "docid": "f97b8ea4414bb18423d0a034303b7a11", "score": "0.6504808", "text": "clear() {\n this.inputEl.value = \"\";\n this.query = \"\";\n }", "title": "" }, { "docid": "d5bf477e9fc9c4a0bdc6ec0548ce3449", "score": "0.64908653", "text": "function resetPossibleResults(){\n\tthis.possibleResults.length = 0;\n\tthis.resultsCount = 0;\n}", "title": "" }, { "docid": "ebc6cf56ff838627da22376118ccd509", "score": "0.6490396", "text": "resetQuery() {\n\t\tthis.setState({\n\t\t\tdisplayAttendees: this.state.allAttendees,\n\t\t\tsearchQuery: ''\n\t\t});\n\t}", "title": "" }, { "docid": "5a47cac542883486b8345331f8af503a", "score": "0.6487878", "text": "function resetSearchConditions() {\n\t\t$(\"#cbbFarmName\").val(STATUS_NO_SELECT);\n\t\t// clear combobox\n\t\t$(\"#cbbAreaName\").empty();\n\t\t$(\"#cbbBlockId\").empty();\n\t\t// disable combobox\n\t\t$(\"#cbbAreaName\").prop(\"disabled\", true);\n\t\t$(\"#cbbBlockId\").prop(\"disabled\", true);\n\t\t$(\"#txtBlockName\").val(\"\");\n\t}", "title": "" }, { "docid": "61be3dc61ead7ef055f1b09fbfb15349", "score": "0.6484074", "text": "function clearAll() {\n clearSearch();\n\t\t\tresetAll();\n\t\t\tsetFocusAcc();\n\t\t}", "title": "" }, { "docid": "93a7c68a0154ebbdaa1c6d22e043067f", "score": "0.6478121", "text": "function ClearFilter() {\n var searchTextField = document.getElementById('textField');\n searchTextField.value = \"\";\n SearchPageLogic();\n }", "title": "" }, { "docid": "3968783fa08b4cfab248da0c2ad94cde", "score": "0.64694065", "text": "function resetResults() {\n results = {\n pageNumber: 1,\n perPage: parseInt($('#resultsNumber').val()),\n total: null,\n showing: null\n };\n }", "title": "" } ]
2aef6c3e8aa2922c7ad03be975bb15e2
Resets idCounter to 0. Used for SSR.
[ { "docid": "cbb10d35288ae0cf641a4c562e722ef4", "score": "0.87036854", "text": "function resetIdCounter() {\n idCounter = 0;\n }", "title": "" } ]
[ { "docid": "a3bdcb6cfe656fbfe7d1d2694d6a93f2", "score": "0.86074674", "text": "function resetIdCounter() {\n idCounter = 0;\n}", "title": "" }, { "docid": "a3bdcb6cfe656fbfe7d1d2694d6a93f2", "score": "0.86074674", "text": "function resetIdCounter() {\n idCounter = 0;\n}", "title": "" }, { "docid": "a3bdcb6cfe656fbfe7d1d2694d6a93f2", "score": "0.86074674", "text": "function resetIdCounter() {\n idCounter = 0;\n}", "title": "" }, { "docid": "9ba11fd87abad70416d21be3fd8a931d", "score": "0.8453161", "text": "function resetIdCounter() {\n idCounter = 42;\n }", "title": "" }, { "docid": "dd64c43b3e1e35df95cc1d2746a9d9f6", "score": "0.7797727", "text": "function resetIds(counter) {\n if (counter === void 0) { counter = 0; }\n _global[CURRENT_ID_PROPERTY] = counter;\n}", "title": "" }, { "docid": "dd64c43b3e1e35df95cc1d2746a9d9f6", "score": "0.7797727", "text": "function resetIds(counter) {\n if (counter === void 0) { counter = 0; }\n _global[CURRENT_ID_PROPERTY] = counter;\n}", "title": "" }, { "docid": "dd64c43b3e1e35df95cc1d2746a9d9f6", "score": "0.7797727", "text": "function resetIds(counter) {\n if (counter === void 0) { counter = 0; }\n _global[CURRENT_ID_PROPERTY] = counter;\n}", "title": "" }, { "docid": "dd64c43b3e1e35df95cc1d2746a9d9f6", "score": "0.7797727", "text": "function resetIds(counter) {\n if (counter === void 0) { counter = 0; }\n _global[CURRENT_ID_PROPERTY] = counter;\n}", "title": "" }, { "docid": "dd64c43b3e1e35df95cc1d2746a9d9f6", "score": "0.7797727", "text": "function resetIds(counter) {\n if (counter === void 0) { counter = 0; }\n _global[CURRENT_ID_PROPERTY] = counter;\n}", "title": "" }, { "docid": "675070d2214e400c860928a3666171df", "score": "0.7435562", "text": "resetRefreshCounter() {\n this._currentRefreshId = -1;\n }", "title": "" }, { "docid": "be3202e9efd3e2570d9933803abbd206", "score": "0.72007287", "text": "function resetLastId() {\n\t lastId = 0;\n\t}", "title": "" }, { "docid": "e6e1873327838febbc34462dcb1e09ab", "score": "0.70387", "text": "function resetCounter() {\n $('#count').html(0);\n count = 0;\n}", "title": "" }, { "docid": "e1b52f510aa86e3d7ac39e082b4921ae", "score": "0.6916761", "text": "resetCounter() {\n this._beatCounter = 0;\n }", "title": "" }, { "docid": "2cb6ddf05a3964106b4f5e0b32bb7a7e", "score": "0.68931466", "text": "function resetId(context) {\n ids[context] = 0;\n}", "title": "" }, { "docid": "d2f817b97841fcaa45435476d7a8d1a2", "score": "0.67423457", "text": "setToZeroCounter(){\n this.memory.set(this.nameCounter, 0);\n this.memory.set(this.nameUpdateCounter, false);\n }", "title": "" }, { "docid": "277b85c1c655035a0a7f44be8f7dab1f", "score": "0.6735828", "text": "function resetCounter(){\n let prev_counter=--x_counter;\n x_counter=0;\n return `${prev_counter} and the counter reset now`;\n }", "title": "" }, { "docid": "d776e99aeee23ee2cc45b02ce870bab8", "score": "0.647137", "text": "resetVisibilityCounter() {\n this.visibilityCounter = -1;\n }", "title": "" }, { "docid": "4ee56e7aa68e34fc0fe45ccaf836945b", "score": "0.6429234", "text": "function resetComponentIds() {\n component.ids = {};\n }", "title": "" }, { "docid": "4a5a89d7faa9ae627d473ecc9ea42e9e", "score": "0.6414442", "text": "static get resetCounter() {\r\n Player.counter = 0\r\n }", "title": "" }, { "docid": "0453446ece357785f79baf5cdaa28276", "score": "0.6393268", "text": "function resetScoreCounter() {\n\tscoreCounter = 0;\n\t$(\"#score-counter\").html(scoreCounter);\n}", "title": "" }, { "docid": "2e8ddcf198c98e186699a4d4af5d6fec", "score": "0.6307243", "text": "function resetCounters(){\n\t\ttotalInternational = 0;\n\t\ttotalDomestic = 0;\n\t\ttotal = 0;\n\t}", "title": "" }, { "docid": "9c046e04462ae274b5393e62e3633e34", "score": "0.62958854", "text": "function resetCounter() \n{\n counter = 5;\n}", "title": "" }, { "docid": "69a79803fa2dcfaa1d833bc1bd307b8a", "score": "0.62666124", "text": "reset() {\n super.reset();\n this._duplicateId++;\n }", "title": "" }, { "docid": "5d861d3f5c7b09b0b803628b46d7b81e", "score": "0.6227466", "text": "_reset () {\n this.rid = Math.floor(Math.random() * 4294967295);\n this.sid = null;\n this.errors = 0;\n if (this._conn._sessionCachingSupported()) {\n window.sessionStorage.removeItem('strophe-bosh-session');\n }\n\n this._conn.nextValidRid(this.rid);\n }", "title": "" }, { "docid": "89b80996980d88c4736d9826f893bad8", "score": "0.62198645", "text": "reset(){\n\t\tthis.stop();\n\t\tthis._currentCount=0;\n\t}", "title": "" }, { "docid": "f8680094067436a2ab3292f469ae3682", "score": "0.6208176", "text": "function resetCounter(){\n turnCounter = 0;\n}", "title": "" }, { "docid": "95c0fc285d53235e6608a8931b535e83", "score": "0.6164522", "text": "function reset() {\n started = false; count = 0;\n return;\n }", "title": "" }, { "docid": "16fc07d249cf5e71fdb839180763efd5", "score": "0.6158074", "text": "function debugCounterReset(){\n debugCounter = (new Date()).getTime();\n}", "title": "" }, { "docid": "bbef6912e3e281dcf52603b27b96d7f4", "score": "0.6143071", "text": "function UpdateCounter() {\n var idLen = idList.length;\n\n var idText = Math.round($('.metaid').text());\n\n var idFront = idList.indexOf(idText)+1;\n\n $('.pagecounter').text(idFront+'/'+idLen);\n \n window.setTimeout( function() {\n $('body').removeClass('page-is-changing');\n }, 400\n );\n \n $( document ).unbind('ajaxComplete');\n \n console.log('Counter updated, page loaded');\n \n }", "title": "" }, { "docid": "12a5cb2067bb08935feb3926a6f558ea", "score": "0.61081314", "text": "function resetCount(){\n requestCount = 0;\n setTimeout(resetCount, 10000) //10000ms = 10s\n}", "title": "" }, { "docid": "28c52b834e040623a5a7ba9f38af788b", "score": "0.60722864", "text": "function resetCount(){\n counter = 0;\n moveCounter.textContent=counter;\n}", "title": "" }, { "docid": "2910cbf36ae0321aefb9c77eaf52ab87", "score": "0.6045392", "text": "static resetCount() {\n Point.count = undefined;\n }", "title": "" }, { "docid": "07c4d605a611314cf53de06b4b4408f2", "score": "0.603255", "text": "_reset() {\n this._id = null;\n this._values = null;\n }", "title": "" }, { "docid": "f86e4487400ca3f58ce7be225484f9d8", "score": "0.60147995", "text": "function clearContextId() {\n context.id = null;\n}", "title": "" }, { "docid": "faea983c3e8c072fb2ca87a452ef8710", "score": "0.6004394", "text": "function YAnButton_resetCounter()\n { var rest_val;\n rest_val = '0';\n return this._setAttr('pulseCounter',rest_val);\n }", "title": "" }, { "docid": "5d06458aaefa0ae638a9ac315569fe66", "score": "0.600292", "text": "reset() {\r\n \t\tthis.activeState = 'normal';\r\n \t\tthis.counter = 0;\r\n \t\tthis.max = 0;\r\n }", "title": "" }, { "docid": "113fc439ee34282e269e4878c7f45bcb", "score": "0.59765273", "text": "reset() {\n this.sampler.data.fill(0);\n\n this.patches = [];\n\n this.packer.clear();\n\n this.idPool.reset();\n }", "title": "" }, { "docid": "4b01161c5178b2de5d834710f22a8238", "score": "0.5970669", "text": "function resetTimer(){\n timeCounter = 0 ;\n timerSpan.textContent = timeCounter;\n }", "title": "" }, { "docid": "73223f90667ad0cb3d0003817fb56810", "score": "0.5943774", "text": "reset() {\n\t\tthis._index = 0;\n\t\tthis._state = this.STATE_IDLE;\n\t}", "title": "" }, { "docid": "2ed0022282dba0b939a8be8aa0625cdf", "score": "0.5886986", "text": "function reset() {\n for(let i= 0; i < imgCounter; i++){\n let elem = document.getElementById(i);\n elem.remove();\n \n }\n imgCounter = 0;\n \n}", "title": "" }, { "docid": "5ffb5055eaec3af626f3324f62853925", "score": "0.5859444", "text": "reset() {\n this.state = {\n requestsFinished: 0,\n requestsFailed: 0,\n requestsRetries: 0,\n requestsFailedPerMinute: 0,\n requestsFinishedPerMinute: 0,\n requestMinDurationMillis: Infinity,\n requestMaxDurationMillis: 0,\n requestTotalFailedDurationMillis: 0,\n requestTotalFinishedDurationMillis: 0,\n crawlerStartedAt: null,\n crawlerFinishedAt: null,\n statsPersistedAt: null,\n crawlerRuntimeMillis: 0,\n };\n\n this.requestRetryHistogram.length = 0;\n this.requestsInProgress.clear();\n this.instanceStart = Date.now();\n\n this._teardown();\n }", "title": "" }, { "docid": "3c8f8d3e273763dfcaded85bd415f647", "score": "0.58590513", "text": "function resetCounter()\r\n{\r\n\tdocument.getElementById(\"message\").innerHTML = 0;\r\n\tscore = 0;\r\n\t\r\n}", "title": "" }, { "docid": "61a154d25afecf992a0ffd9c3d6393a1", "score": "0.5856977", "text": "static resetNodeCount() {\n HIGHLIGHTED_NODE_COUNT = 0;\n }", "title": "" }, { "docid": "5164076e54a52aa7c5a2c0341e83fbad", "score": "0.5846276", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "f1f1824298604ff61eaee82dbbe85a49", "score": "0.58444977", "text": "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "title": "" }, { "docid": "cf88cbbb54b2071f89245b03162ba437", "score": "0.58351225", "text": "function reset() {\n _id_map2.default.clear();\n _object2.default.clearChangeQueue();\n}", "title": "" }, { "docid": "b08cde9e079f6a3c28cad55da3a59ca5", "score": "0.5817313", "text": "function reset() {\n // Empty the laps\n laps.count = 0;\n laps.element.innerHTML = '';\n\n // Re-initialize the data -> \"counter.main\" object\n init();\n\n // Reset the sub counter -> \"counter.sub\" object\n init('sub');\n\n watch = null;\n\n // Show/Hide the control buttons conditionally\n buttons.showHide();\n }", "title": "" }, { "docid": "1ffa47be9e6acc3e6a2efa8eb57de554", "score": "0.5812849", "text": "function startCount() {\n clearInterval(intervalId);\n intervalId = setInterval(decrement, 1000);\n }", "title": "" }, { "docid": "3945f035b8b3d9f821010249f3d56358", "score": "0.58023685", "text": "_reset() {\n\t\tthis._isRunning = false\n\t\tthis._timeIterator = 0\n\t}", "title": "" }, { "docid": "4a6e52d5db959270796589d6d7a0b456", "score": "0.580222", "text": "resetNodeIndex() {\n this.nodeIndex = 0;\n }", "title": "" }, { "docid": "9b9308328b4dd53b5020142f2d2f22e0", "score": "0.5799658", "text": "clear() {\n _converse.disco._identities = [];\n }", "title": "" }, { "docid": "80e208ec663803f6f1de8f19bb26c663", "score": "0.5792113", "text": "constructor() {\n this._idMap = {};\n this._nextId = 0;\n this._listener = null;\n }", "title": "" }, { "docid": "19f415010c20ab47ecfadd81df12d18a", "score": "0.5784453", "text": "flush() {\n this.count = 0;\n }", "title": "" }, { "docid": "2edf5bfae3728e9c6071ead69e25b733", "score": "0.57783973", "text": "function updateCounter() {}", "title": "" }, { "docid": "58a1bc33abad3a7d5be1b39825a4bafd", "score": "0.57688266", "text": "reset () {\n this.occurrences = Object.create(null);\n }", "title": "" }, { "docid": "3b4dd08927c2e1749f4a70e4948240ad", "score": "0.57570964", "text": "function intReset(){\n clearInterval(scoreId)\n clearInterval(intervalId);\n num = 5;\n number = 10;\n}", "title": "" }, { "docid": "290496b84f8832a074a69139c59e5586", "score": "0.5737915", "text": "function resetTotalVotes(id) {\n id = \"\" + id;\n db.collection(\"rooms\").doc(id).update({\n total_votes: 0\n })\n}", "title": "" }, { "docid": "e164ccaa8b0fbfa8046c4a8ca9393be4", "score": "0.57245624", "text": "reset(){\n\n // remove from localStore\n try {\n window.localStorage.removeItem( STORAGE_ID );\n } catch( e ) {}\n\n // clean volatile store\n this._store = new Map();\n\n }", "title": "" }, { "docid": "01624a6322e6ac58282e638c7ca4fa1d", "score": "0.5705402", "text": "function updateCounter() { }", "title": "" }, { "docid": "fcf62ebdfeec157314fac4cc737561b7", "score": "0.5696727", "text": "reset() {\n this[$retainerCount].clear();\n this[$recentlyUsed] = [];\n }", "title": "" }, { "docid": "29091ddec5fb389740b1c33277fbd479", "score": "0.5693161", "text": "function reset () {\n index = ~~(Math.random() * 0xffffff);\n for (var i = 0; i < 5; i++) PROCESS_UNIQUE[i] = Math.floor(Math.random() * 256);\n }", "title": "" }, { "docid": "eb37dccc7e6271da118e7ef85d65f08f", "score": "0.5688126", "text": "function reset() {\n i = -1;\n }", "title": "" }, { "docid": "9743dfed0f6d628e1492897104b1d369", "score": "0.5672632", "text": "dispose() {\n this.id = '';\n this.count = 0;\n this.material = null;\n this.requestList.length = 0;\n }", "title": "" }, { "docid": "e013c06c9b2164d29e0ec93f188fc5fa", "score": "0.56641984", "text": "reset() {\n this[$time] = 0;\n }", "title": "" }, { "docid": "27dc9cc0ed563fe22a315fd394fedfd9", "score": "0.5653896", "text": "reset() {\n this.currentElement = 0;\n }", "title": "" }, { "docid": "3f50d908e26de625e89da34356705e2c", "score": "0.5653654", "text": "initialize() {\n if(this.storage.items) return;\n this.storage.items = [];\n this.updateCounter();\n }", "title": "" }, { "docid": "d16d01b78b039a996286bd9ff6dd6b9b", "score": "0.56535935", "text": "function reset() {\n count = 0\n countDown = 10\n localStorage.counter = 0\n display.textContent = count\n btn.style.backgroundColor = \"#ff00ae\"\n btn.disabled = false;\n message.textContent = \"Go!\"\n clearInterval(interval)\n clearTimeout(timeOut)\n}", "title": "" }, { "docid": "2f594524500c0338007b797ee5dc21f3", "score": "0.5638025", "text": "function clickCountToZero() {\n clickCount = 0;\n document.getElementById(\"ClickCount\").innerHTML = \"\";\n}", "title": "" }, { "docid": "c056a60c581fbb696207e737924c4dff", "score": "0.5633594", "text": "function resetCountup() {\n\tresetCount(countupTimerState);\n}", "title": "" }, { "docid": "c83a8a4745de4d41523f7897248da332", "score": "0.5630301", "text": "resetRequests() {\n this._currentRequests = {};\n }", "title": "" }, { "docid": "a217127fee373ea396c83d58fdc42a1c", "score": "0.5623172", "text": "function reset() {\n stopTimerAndResetCounters();\n setParamsAndStartTimer(currentParams);\n dispatchEvent('reset', eventData);\n }", "title": "" }, { "docid": "20cdb7175b87b41a1657ac194a6308dd", "score": "0.5612323", "text": "function resetListenCount() {\n $.ajax({\n url: Routing.generate('resetSessionContextListenNumber'),\n async: false,\n type: 'PUT',\n dataType: 'json'\n });\n}", "title": "" }, { "docid": "c6bc835656a1e2eb8913e6f15a30edfd", "score": "0.56071347", "text": "reset() {\n for (let i = 0; i < this._models.length; ++i) {\n let model = this._models.data[i];\n model._viewID = -1;\n }\n }", "title": "" }, { "docid": "4bb2938876471ecda888d08d16434b6e", "score": "0.5606611", "text": "reset() {\r\n this.activeStateIndex = 0;\r\n }", "title": "" }, { "docid": "fa9032b85fca18d9b32f7a2fa0639640", "score": "0.5602655", "text": "clear () {\n this.total = 0;\n this.loaded = 0;\n }", "title": "" }, { "docid": "64fdb8e18b5610f96f95059ee8a75ce5", "score": "0.56015915", "text": "function ResettoZero() {\n LeftClickedCount = 0;\n RightClickedCount = 0;\n LeftSwipedCount = 0;\n RightSwipedCount = 0;\n Btn1PressCount = 0;\n Btn2PressCount = 0;\n Btn3PressCount = 0;\n}", "title": "" }, { "docid": "ad910ec08859d552053d4293f9897db0", "score": "0.5597008", "text": "function clear() {\n if (!!token.id) {\n clearTimeout(token.id);\n token.id = null;\n }\n }", "title": "" }, { "docid": "c1960f0452bf62b0a40246d2a25bad6d", "score": "0.5596332", "text": "function resetWaitCount(){\n waitCount = 0;\n //console.log(\"waitCount = \" + waitCount);\n }", "title": "" }, { "docid": "fb3c8d1c8a65fb953f77c2163c2bbec4", "score": "0.5594566", "text": "function clearRuntimeIndex() {\n shortIndex = null;\n}", "title": "" }, { "docid": "03b1ec0f3a47d5304d1ac147e40ae58f", "score": "0.5593405", "text": "function resetCounter () {\n\n\t\tgamesWon = 0;\n\t\tgamesLost = 0;\n\t\t$(\"#winlossCounter\").html(\"Wins: \" + gamesWon + \"&nbsp;&nbsp;Losses: \" + gamesLost);\n\t\tinitGame();\n\n\t} // end function resetCounter", "title": "" }, { "docid": "813a597dc39ab060b7a49bbf1abae39f", "score": "0.5593281", "text": "static incrementId(){\n this.id = this.getId() + 1;\n }", "title": "" }, { "docid": "9300d77568e728d804daf6ddad16af13", "score": "0.5578025", "text": "function resetCountdown() {\n refreshController.countdownInterval = 0;\n refreshCountdowner();\n window.clearInterval(refreshController.countdowner);\n}", "title": "" }, { "docid": "177aab10c7b3864909934ae821d37f07", "score": "0.5575666", "text": "function stopCount(){\n // Clears our \"counter\" interval. The interval name is passed to the clearInterval function.\n clearInterval(counter);\n }", "title": "" }, { "docid": "c2ff85579cc4b9c03d53ca8a8e5f97f2", "score": "0.5572608", "text": "function resetMoveCounter() {\n moveCounter.innerHTML = 0;\n numberOfMoves.innerHTML = 0;\n moves = 0;\n}", "title": "" }, { "docid": "dd552a0fb21c0a224a2d4fbd38acdee6", "score": "0.557181", "text": "getUniqueId() {\n return -++this.idCounter;\n }", "title": "" }, { "docid": "bc1fca7e4784a2c6c69f2221ff7390c9", "score": "0.5569249", "text": "reset() {\n\t\tthis.#keyslist.length = 0;\n\t}", "title": "" }, { "docid": "fcbb2a21ae01dff2b45e6cf8a026eded", "score": "0.55623233", "text": "reset() {\n // Shortcut\n const hasher = this._hasher; // Reset\n\n hasher.reset();\n hasher.update(this._iKey);\n }", "title": "" }, { "docid": "d3cc3b9fd0328b999b685a895b26386e", "score": "0.55605584", "text": "resetScore() {\n this.score.added = 0;\n this.score.current = 0;\n this.showScore(0);\n }", "title": "" }, { "docid": "6c70459a7e46583973f514080d229c26", "score": "0.5552951", "text": "function uiCounterReset() {\n document.getElementById(\"fps\").innerHTML = \"FPS: \" + fpsCounter;\n fpsCounter = 0;\n}", "title": "" }, { "docid": "b68e71fe4a59f65fb4c081dc16b96646", "score": "0.5541432", "text": "function Counter(){this.count=0;}", "title": "" }, { "docid": "259d0bf867f04fcfe4b36926910434f5", "score": "0.5538269", "text": "function resetCountdown() {\n\tresetCount(countdownTimerState);\n}", "title": "" }, { "docid": "5d4dce4cf3ee6a68100c404fe29dff54", "score": "0.55356896", "text": "_resetNodeIDs(aDocument, aIDs) {\n for (let id of aIDs) {\n let node = aDocument.getElementById(id);\n if (node) {\n node.id = \"\";\n }\n }\n }", "title": "" }, { "docid": "59a8ccaac7805ae9b89ccf5b23c54a98", "score": "0.55335504", "text": "function flushMap() {\n _identityMap = {};\n }", "title": "" }, { "docid": "dc733f261b620eda359360107bb25ab6", "score": "0.55198824", "text": "resetScore() {\n \n this.score = 0;\n }", "title": "" }, { "docid": "963972a32a2b63de651a95ccddf07e00", "score": "0.55193686", "text": "reset() {\n // Shortcut\n const hasher = this._hasher;\n\n // Reset\n hasher.reset();\n hasher.update(this._iKey);\n }", "title": "" }, { "docid": "5c100799ead64f4f9b81086f8b9fe577", "score": "0.55176425", "text": "function resetReflectionID() {\n REFLECTION_ID = 0;\n}", "title": "" }, { "docid": "cd8063af5d5a523629582f2ac12c33e8", "score": "0.55171096", "text": "function reset() {\n var now = Date.now(),\n dt = (now - lastTime) / 1000.0;\n update(dt);\n render();\n }", "title": "" }, { "docid": "4d689bc254c50373b6db96b59ddde05a", "score": "0.5508078", "text": "componentWillUnmount() {\n console.log('counter is removed');\n }", "title": "" }, { "docid": "7e88beabbec79696ef029be96a236cdf", "score": "0.5507763", "text": "startCounter() {\n this.counter = millis();\n }", "title": "" }, { "docid": "a1d815560bb033fe268dce7ed9255584", "score": "0.55055577", "text": "function clearCachedUserId() {\n extensionContext.globalState.update(\"cachedUserId\", undefined);\n console.log(\"After clearing cached id: \" +\n extensionContext.globalState.get(\"cachedUserId\"));\n}", "title": "" } ]
6d391640b11e637b2e7dbf81f4ea02d0
Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of nonstandard public properties
[ { "docid": "9e714957b99fe997dc1a1e0782ae60fd", "score": "0.0", "text": "function appendElement (hander,node) {\n if (!hander.currentElement) {\n hander.doc.appendChild(node);\n } else {\n hander.currentElement.appendChild(node);\n }\n}//appendChild and setAttributeNS are preformance key", "title": "" } ]
[ { "docid": "b5abf796641f79b86a4fe2101401e48d", "score": "0.6871182", "text": "static GetPropertyModifications() {}", "title": "" }, { "docid": "b95019876e0e9edc1d3493da7630026c", "score": "0.6220853", "text": "static get properties() {\r\n return {\r\n };\r\n }", "title": "" }, { "docid": "5ae25376f702a3ec7bb7aca992032543", "score": "0.61507326", "text": "static get properties() {\n return {\n \n };\n }", "title": "" }, { "docid": "37da4760f49a0eb7bc3fc7c2520f0bb6", "score": "0.6087486", "text": "function SchemaUtils() {\n // purely static object at the moment, nothing in the instances.\n }", "title": "" }, { "docid": "a83f65fe0fa5fa867f593d808288c8c0", "score": "0.5951983", "text": "static get properties() {\n return { ...super.properties };\n }", "title": "" }, { "docid": "b4164110fc499fe8971e445de32f5171", "score": "0.5882336", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "19c3d840059c7c9ef69e4c1409064e36", "score": "0.5765767", "text": "function prop_access() {\n \n}", "title": "" }, { "docid": "2cec2752cc34f2f668be2a5a02393bb9", "score": "0.57357883", "text": "static get properties() {\n return {};\n }", "title": "" }, { "docid": "fe06d2d78e8e26faee889df46103bcc7", "score": "0.5704194", "text": "ownProperties(){}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.5619156", "text": "function Utils() {}", "title": "" }, { "docid": "ca760a024ae5ae58a00636841f4b7aec", "score": "0.55962026", "text": "static get property(){}", "title": "" }, { "docid": "698439a146103637778f1649e28d4c80", "score": "0.55849844", "text": "static GetObjectField() {}", "title": "" }, { "docid": "43ff965c3063f616a30e394ca4639fe9", "score": "0.5570648", "text": "function DWRUtil() { }", "title": "" }, { "docid": "2db95764b63e17093bf3ef1701545644", "score": "0.5547982", "text": "function getInternalProperties(obj) {\n\t if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n\t return objCreate(null);\n\t}", "title": "" }, { "docid": "2db95764b63e17093bf3ef1701545644", "score": "0.5547982", "text": "function getInternalProperties(obj) {\n\t if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n\t return objCreate(null);\n\t}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.5539191", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "69bd595e2a0e49d4380dc91029c88bfd", "score": "0.55360997", "text": "function HelperFunctions (){}", "title": "" }, { "docid": "9930310f591fe68a86cdf1054548af7f", "score": "0.5534026", "text": "function util() {\n }", "title": "" }, { "docid": "2e3582a22a72c64130a4aa13afd3360c", "score": "0.55282915", "text": "function Helpers() {}", "title": "" }, { "docid": "af49eeb72569588d967bf840eb3d3d7d", "score": "0.55205953", "text": "get util(){return util;}", "title": "" }, { "docid": "b7d1fcc11b4b03b8f642f47e2543bee1", "score": "0.5505909", "text": "static get objectField() {}", "title": "" }, { "docid": "d7a1d85dcc2f80ae517828ebcb5a7fd4", "score": "0.5495854", "text": "static SetPropertyModifications() {}", "title": "" }, { "docid": "627a1ac02702dc5430690ace75bd221b", "score": "0.5482242", "text": "constructor() {\n this._class = undefined;\n this._rel = undefined;\n this._properties = undefined;\n this._entities = undefined;\n this._actions = undefined;\n this._links = undefined;\n }", "title": "" }, { "docid": "78597f57bfe525a049a3f013aeb93c38", "score": "0.5477466", "text": "function NativePropMethodFactory() {\r\n\t\r\n}", "title": "" }, { "docid": "682875cafec2073487cdddf5c978d681", "score": "0.5474863", "text": "get accessor_prop() { /* function body here */ }", "title": "" }, { "docid": "e1bb05d2f9886509440d8bd092d34950", "score": "0.5465774", "text": "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties',this))){this._classProperties=new Map();// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(superProperties!==undefined){superProperties.forEach((v,k)=>this._classProperties.set(k,v));}}}", "title": "" }, { "docid": "f40daca6bfa66473bd2078434230c4e9", "score": "0.5463006", "text": "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"_classProperties\",this))){this._classProperties=new Map;// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(void 0!==superProperties){superProperties.forEach((v,k)=>this._classProperties.set(k,v))}}}", "title": "" }, { "docid": "b30687e1b45542c6a0d350a5ebdcb4ea", "score": "0.5461476", "text": "static _ensureClassProperties(){// ensure private storage for property declarations.\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"_classProperties\",this))){this._classProperties=new Map;// NOTE: Workaround IE11 not supporting Map constructor argument.\nconst superProperties=Object.getPrototypeOf(this)._classProperties;if(superProperties!==void 0){superProperties.forEach((v,k)=>this._classProperties.set(k,v))}}}", "title": "" }, { "docid": "df76928db83cbcf9a3b9fabf06bbdaa6", "score": "0.54454184", "text": "getHelper() { return (path, tokens) => { if (tokens == null) { tokens = {}; } return this.get(path, tokens); }; }", "title": "" }, { "docid": "162d1864af20a03b564d1011a52f0c6a", "score": "0.54192543", "text": "static get properties() {\n return {\n foo: String,\n whales: Number,\n auth0Options: Object\n }\n }", "title": "" }, { "docid": "2c8e341ba44d7afea67318a0686a9085", "score": "0.5411614", "text": "get baseFields() {\n throw new Error('Property method \\'baseFields()\\' must be implemented.');\n }", "title": "" }, { "docid": "90571c288483c3ab513d441d7b6a8443", "score": "0.5397718", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map(); // NOTE: Workaround IE11 not supporting Map constructor argument.\n\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "90571c288483c3ab513d441d7b6a8443", "score": "0.5397718", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map(); // NOTE: Workaround IE11 not supporting Map constructor argument.\n\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "90571c288483c3ab513d441d7b6a8443", "score": "0.5397718", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map(); // NOTE: Workaround IE11 not supporting Map constructor argument.\n\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "f519383365e3977dc0df9482f3fd4c61", "score": "0.5386519", "text": "static getHelpers() {}", "title": "" }, { "docid": "8a3165e7fd1699566089a5af9b6e72ae", "score": "0.5384616", "text": "static get getProperty() {\n return this.prototype.getProperty;\n }", "title": "" }, { "docid": "6cbcd05e45993aa77aced666603ecdc6", "score": "0.53838056", "text": "function l(e,t,l,p,f,h){s=s||n(20);const d=(p?p+\".\":\"\")+e;p=p||\"\",t?Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){const e=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[d]){const n=Object.create(s.prototype,function(e){const t={};return Object.getOwnPropertyNames(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n),t[n].get?delete t[n]:t[n].enumerable=-1===[\"isNew\",\"$__\",\"errors\",\"_doc\",\"$locals\",\"$op\",\"__parentArray\",\"__index\",\"$isDocumentArrayElement\"].indexOf(n)})),t}(this));p||(n.$__[c]=this),n.$__.nestedPath=d,Object.defineProperty(n,\"schema\",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(n,r,{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(n,\"toObject\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return i.clone(e.get(d,null,{virtuals:o(this,\"schema.options.toObject.virtuals\",null)}))}}),Object.defineProperty(n,\"toJSON\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return e.get(d,null,{virtuals:o(e,\"schema.options.toJSON.virtuals\",null)})}}),Object.defineProperty(n,\"$__isNested\",{enumerable:!1,configurable:!0,writable:!1,value:!0});const a=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1});Object.defineProperty(n,\"$isEmpty\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(d,null,a)||{}).length}}),u(t,n,d,h),this.$__.getters[d]=n}return this.$__.getters[d]},set:function(e){e instanceof s&&(e=e.toObject({transform:!1}));(this.$__[c]||this).$set(d,e)}}):Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:function(){return this[a].call(this.$__[c]||this,d)},set:function(e){this.$set.call(this.$__[c]||this,d,e)}})}", "title": "" }, { "docid": "53272deecd31b521a69c67d209c650af", "score": "0.5380336", "text": "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "title": "" }, { "docid": "53272deecd31b521a69c67d209c650af", "score": "0.5380336", "text": "function getInternalProperties(obj) {\n if (hop.call(obj, '__getInternalProperties')) return obj.__getInternalProperties(secret);\n\n return objCreate(null);\n}", "title": "" }, { "docid": "ca9e61acf15c258597c4618071c4f40c", "score": "0.53783876", "text": "function AjaxGetters() {\n throw 'this class should not be instantiated';\n }", "title": "" }, { "docid": "1227ab4d597022ef7dbf62cedd14c6aa", "score": "0.5377843", "text": "static get properties() {\n return {\n queryParams: Object,\n route: Object,\n namespaces: Array,\n selected: {\n type: String,\n observer: '_onSelected',\n value: '',\n notify: true,\n },\n allNamespaces: {type: Boolean, value: false},\n user: String,\n selectedNamespaceIsOwned: {\n type: Boolean,\n readOnly: true,\n notify: true,\n value: false,\n },\n };\n }", "title": "" }, { "docid": "6b793071ce77f6a72363bfb6814d69eb", "score": "0.534809", "text": "static get properties () {\n return {\n // Simple public properties/attributes\n one: { type: String },\n two: { type: Boolean },\n three: { type: Array },\n // If the property is multiple words and thus camelCase, you can force the default linked attribute to be kebab-case like this:\n fooBarBaz: { type: String, attribute: 'foo-bar-baz' },\n // Setting `reflect: true` will automatically update the attribute value when the property is changed.\n // This way, if you use a CSS attribute selector like this `:host([enabled])`, you can have your styles react to property changes.\n enabled: { type: Boolean, reflect: true },\n // Private properties are prefixed with `_`\n // If it's described here, a change will trigger render().\n // Use state: true for private properties.\n _privateFoobar: { type: Boolean, state: true },\n };\n }", "title": "" }, { "docid": "89e5ec56d67c4d03019c1173d373e630", "score": "0.53469735", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map(); // NOTE: Workaround IE11 not supporting Map constructor argument.\n\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "59b23a360aee36047a97f4cf7f43dec8", "score": "0.53398854", "text": "function PolyfillUtil( ) {\n\tthis.keys = function( obj ) {\n\t\tvar keys = [];\n\n\t\tfor( var i in obj ) {\n\t\t\tif( obj.hasOwnProperty(i) ) {\n\t\t\t\tkeys.push( i );\n\t\t\t}\n\t\t}\n\t\treturn keys;\n\t}\n\n\tthis.from = function( obj ) {\n\t\tvar from = [];\n\n\t\tfor( var i = 0; i < obj.length; i++ )\n\t\t\tfrom.push( obj[ i ] );\n\n\t\treturn from;\n\t}\n\n\tthis.srcElement = function( obj ) {\n\t\treturn obj.srcElement ? obj.srcElement : obj.target;\n\t}\n\n\treturn {\n\t\tkeys : this.keys,\n\t\tfrom : this.from,\n\t\tsrcElement : this.srcElement\n\t};\n}", "title": "" }, { "docid": "3aec55187f86abe538e817049bc2412d", "score": "0.5329675", "text": "static get properties() {\n return {\n arrow: { type: String },\n text: { type: String },\n error: { type: Boolean }\n };\n }", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.53281516", "text": "function Util() {}", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.53281516", "text": "function Util() {}", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.53281516", "text": "function Util() {}", "title": "" }, { "docid": "b072cecbed0f2ab8e68e1051dd874591", "score": "0.53262126", "text": "function CarUtilityMixin() { }", "title": "" }, { "docid": "29c1cae0e5908b5ce9b9dd3bcf53c4de", "score": "0.5305529", "text": "persistentProperties() {\n //console.log('persistentProperties');\n if (! this._persistentProperties) {\n var validProperties = Object.keys(this).concat(Object.keys(this.constructor.prototype));\n //console.log('persistentProperties: new');\n this.constructor.persistentProperties();\n for (const p of this._persistentProperties) {\n if (validProperties.indexOf(p) < 0) {\n console.trace(`GraphObject.persistentProperties: property not found: '${p}'`, this);\n throw new Error(`GraphObject.persistentProperties: property not found: '${p}'`);\n }\n }\n }\n return (this._persistentProperties);\n }", "title": "" }, { "docid": "f845bcb69c176a43c6571f7e96faef5d", "score": "0.5268136", "text": "static get getPropertyNames() {\n return this.prototype.getPropertyNames;\n }", "title": "" }, { "docid": "a43380f0f5dde1edc10af70969f089fc", "score": "0.52618915", "text": "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==undefined){this._attributeToPropertyMap.set(attr,p);attributes.push(attr);}});return attributes;}", "title": "" }, { "docid": "84ee68dd9cdd00898facab1b720e7085", "score": "0.5257782", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "e4e31a23ae8d9979d538668a96e5c0a1", "score": "0.52524275", "text": "static createPropertiesForAttributes() {\n let a$ = this.observedAttributes;\n for (let i=0; i < a$.length; i++) {\n this.prototype._createPropertyAccessor(caseMap.dashToCamelCase(a$[i]));\n }\n }", "title": "" }, { "docid": "ab9b148c2cb38b939a5f0730512bd5bd", "score": "0.5246683", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "ab9b148c2cb38b939a5f0730512bd5bd", "score": "0.5246683", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "ab9b148c2cb38b939a5f0730512bd5bd", "score": "0.5246683", "text": "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "title": "" }, { "docid": "aa02566922a43c52bcf3b10a5b46748f", "score": "0.5231999", "text": "function Util() {\n}", "title": "" }, { "docid": "1cc4d37d1336bd80e89d5e04d97d419a", "score": "0.52298915", "text": "static get properties() {\n return {\n peli: { type: Object}\n };\n }", "title": "" }, { "docid": "1b4d5db31653cbb2f8d5342f0c0e2905", "score": "0.5226963", "text": "function CombatUtils() {}", "title": "" }, { "docid": "dac5c354c97ae866c6f78c4c45c3f547", "score": "0.52264565", "text": "function getSetMethod(){\n const baseObject = (function(){\n let _prop1 = 1987;\n return{\n prop2: 2000,\n get prop1(){\n return _prop1;\n },\n set prop1(_val){\n _prop1 = _val;\n }\n }\n })();\n\n console.log('BASE - DEFAULT', baseObject);\n console.log('PROP1 - BASE ', baseObject.prop1);\n baseObject.prop1 = 3000;\n console.log('PROP1 - CHANGE', baseObject.prop1);\n console.log('BASE - CHANGE', baseObject);\n}", "title": "" }, { "docid": "6ca36f288bf05488c245cf422fa27eb1", "score": "0.52257824", "text": "static GetStaticObjectField() {}", "title": "" }, { "docid": "cb287f2bfc33c2df2ad54a6f9ed0c77f", "score": "0.52079296", "text": "function ff(t,e){if(!e.has(t))throw new TypeError(\"attempted to get private field on non-instance\");return e.get(t)}", "title": "" }, { "docid": "b67184b071548ed587eb5f35f1e93f8e", "score": "0.5203839", "text": "constructor() {\n\n\t\t/**\n\t\t * Current set of helpers.\n\t\t * @type {null}\n\t\t * @private\n\t\t */\n\t\tthis._helpers = Object.create(builtInHelpers);\n\t}", "title": "" }, { "docid": "f83b6b6a880c29849620f8180d04b719", "score": "0.519687", "text": "get static(){ return this._static; }", "title": "" }, { "docid": "6377e1d0b4f4d7fa096a0a125814a19c", "score": "0.51946896", "text": "function dataUtils (){\n}", "title": "" }, { "docid": "0b7147145b11e82ecd68f861003332db", "score": "0.51864076", "text": "function _getPropertyPrivateName (m,_propertyPublicOrPrivateName) {\n\t\t\t\treturn (\n\t\t\t\t\t_getClass (m)._propertyPrivateNameLookup [_propertyPublicOrPrivateName] ||\n\t\t\t\t\t_propertyPublicOrPrivateName\n\t\t\t\t);\n\t\t\t}", "title": "" }, { "docid": "4c8685777f94ec2eba1fe019fa1f3f66", "score": "0.517868", "text": "static get is(){return this.hasOwnProperty(U)&&this[U]||(this[U]=W(this.name))}", "title": "" }, { "docid": "8edec3769259aaec5afac7cc010485e1", "score": "0.51762307", "text": "static /* 5.2 L meth */ get /* 5.3 L id */ getter() {}", "title": "" }, { "docid": "af3f35e069a1c5005c80def4b45a616b", "score": "0.51749337", "text": "static get properties() {\n return {\n subroute: Object,\n playerGuid: {\n type: String,\n },\n _routeData: Object,\n _gameRoomId: String,\n _gameRoom: Object,\n player: Object,\n _isGameRoomFull: {\n type: Boolean,\n value: false,\n },\n _dialogMessage: String,\n _fitDialogElementInto: Object,\n _board: Array,\n _isWinner: {\n type: Boolean,\n value: false,\n },\n _isGameFinished: {\n type: Boolean,\n value: false,\n },\n };\n }", "title": "" }, { "docid": "c55fd5c7d617bff6b37daac739e973e6", "score": "0.5173772", "text": "static get properties(){\n return {\n url: String,\n altText: String,\n imgWidth: Number\n };\n }", "title": "" }, { "docid": "65b071bae2afd2ddbb5def814caac24f", "score": "0.5171014", "text": "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(void 0!==attr){this._attributeToPropertyMap.set(attr,p);attributes.push(attr)}});return attributes}", "title": "" }, { "docid": "74ca80dab535168aeb92469f9c4391e4", "score": "0.51705325", "text": "function Helper(){}", "title": "" }, { "docid": "cf579ea131eefc1dc9fb9ba71ae42536", "score": "0.51699376", "text": "function KocoUtilities() {}", "title": "" }, { "docid": "80e04934f8492eec48fb94813dde8d03", "score": "0.51633567", "text": "static get observedAttributes(){// note: piggy backing on this to ensure we're finalized.\nthis.finalize();const attributes=[];// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\nthis._classProperties.forEach((v,p)=>{const attr=this._attributeNameForProperty(p,v);if(attr!==void 0){this._attributeToPropertyMap.set(attr,p);attributes.push(attr)}});return attributes}", "title": "" }, { "docid": "cddc22e4e86f7c6e8db582528261e65c", "score": "0.5156896", "text": "function repair_UNDERBAR_PROTO_accessors_USE_GLOBAL() {\n var gopd = Object.getOwnPropertyDescriptor;\n\n var oldDesc = gopd(Object.prototype, '__proto__');\n var oldGetter = oldDesc.get;\n var oldSetter = oldDesc.set;\n function newGetter() {\n if (this === null || this === void 0) {\n throw new TypeError('Cannot convert null or undefined to object');\n } else {\n return oldGetter.call(this);\n }\n }\n function newSetter(newProto) {\n if (this === null || this === void 0) {\n throw new TypeError('Cannot convert null or undefined to object');\n } else {\n oldSetter.call(this, newProto);\n }\n }\n Object.defineProperty(Object.prototype, '__proto__', {\n get: oldGetter ? newGetter : void 0,\n set: oldSetter ? newSetter : void 0\n });\n }", "title": "" }, { "docid": "cc1fa8f96c008d498baeb4314e48d878", "score": "0.51524013", "text": "function publicMethods(){\n return {\n getState: getState,\n initScrollbar: initScrollbar,\n destroyScrollbar: destroyScrollbar,\n refreshScrollbar: refreshScrollbar,\n };\n }", "title": "" }, { "docid": "8a09fa5e2b8d3aa0dd23f627118168db", "score": "0.5145888", "text": "static defineReferenceProperties(meta) {\n Object\n .values(meta.properties)\n .filter(prop => [enums_1.ReferenceType.ONE_TO_ONE, enums_1.ReferenceType.MANY_TO_ONE].includes(prop.reference) && (prop.inversedBy || prop.mappedBy))\n .forEach(prop => {\n Object.defineProperty(meta.prototype, prop.name, {\n set(val) {\n if (!('__data' in this)) {\n Object.defineProperty(this, '__data', { value: {} });\n }\n EntityHelper.defineReferenceProperty(prop, this, val);\n },\n });\n });\n meta.prototype[util_1.inspect.custom] = function (depth) {\n const ret = util_1.inspect(Object.assign({}, this), { depth });\n return ret === '[Object]' ? `[${meta.name}]` : meta.name + ' ' + ret;\n };\n }", "title": "" }, { "docid": "341dec073afba581e0adca853b880e02", "score": "0.5132505", "text": "static method(){}", "title": "" }, { "docid": "e5381955a3e28e23ffbd59aaad43f3b4", "score": "0.5123858", "text": "publicMethod() {\n return this.#privateMethod() + \" \" + this.#privateField;\n }", "title": "" }, { "docid": "ce04d7f56a837275b5b6e873ac758f4e", "score": "0.51234317", "text": "get contents() {\n\n let self = this;\n\n return {\n\n /**\n * Finds any codes or other facets that this property may contain\n */\n async facets() {\n let type = await self.type();\n return type ? type.contents.facets() : [];\n },\n\n /**\n * Finds any sub-properties that this property may directly contain\n */\n async containedProperties() {\n let type = await self.type();\n return type ? type.contents.containedProperties() : [];\n },\n\n /**\n * Finds parent types and the properties those types contain, e.g., {parentTypeQName: subProperty[]}\n */\n async inheritedProperties() {\n let type = await self.type();\n return type ? type.contents.inheritedProperties() : {};\n },\n\n async base() {\n let type = await self.type();\n if (type) return type.base();\n }\n\n }\n\n }", "title": "" }, { "docid": "1d06597516bd5c45b6b422e8c555fe48", "score": "0.5123329", "text": "static get properties() {\n\t\treturn {\n\t\t\t /**\n\t\t\t * Microsoft OAuth access token. typical returned from azure-oauth2\n\t\t\t */\n\t\t\tauthtoken : {\n\t\t\t\ttype : String,\n\t\t\t\tobserver : '_authCodeChanged'\n\t\t\t},\n\t\t\t /**\n\t\t\t * List of Microsoft Outlook events - meeting, appointments, reminders \n\t\t\t * for the current user populated by getList(). \n\t\t\t * This list is paged\n\t\t\t */\n\t\t\teventlist : {\n\t\t\t\ttype : Array,\n\t\t\t\treflectToAttribute : true,\n\t\t\t\tnotify : true\n\t\t },\n\t\t\t /**\n\t\t\t * Maximum number of user entries to return in a query\n\t\t\t */\n\t\t fetchsize : {\n\t\t\t\ttype : Number,\n\t\t\t\tvalue : 10,\n\t\t },\n\t\t\t /**\n\t\t\t * True if the User List has been successfully fetched and there are additional records to fetch\n\t\t\t */\n\t\t\thasnextpage : {\n\t\t\t\ttype : Boolean,\n\t\t\t\tvalue : false,\n\t\t\t\tnotify : true\n\t\t },\n\t\t /**\n\t\t * List of Microsoft Outlook time zone support on the Exchange server and available to the current user\n\t\t */\n\t\t outlookTimeZones : {\n\t\t\t type : Array,\n\t\t\t reflectToAttribute : true,\n\t\t\t notify : true\n\t\t },\n\t\t\t/**\n\t\t\t * Use this to specify the time zone for start and end times in the response. \n\t\t\t * If not specified, those time values are returned in UTC. Optional.\n\t\t\t * {\n\t\t\t * \t\tname : \"microsoft timezone name\",\n\t\t\t * abbr : \"Standard abbriviation\",\n\t\t\t * offset : \"offset from UTC\"\n\t\t\t * }\n\t\t\t */\n\t\t\ttimezone : {\n\t\t\t\ttype : Object,\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "abf83841cdabcfd8a62280b7a7c80376", "score": "0.51221704", "text": "function commonUtil() {\n}", "title": "" }, { "docid": "682dec3d3f6935df948fc9dceab53f9a", "score": "0.5116994", "text": "static get properties() {\n return {\n id: {\n attribute: 'tableid',\n type: String\n },\n subscriptions: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n prependTemplates: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n appendTemplates: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n headers: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n dataKeys: {\n type: Array,\n converter: value => value ? value.split(',') : []\n },\n remoteUrl: {\n attribute: 'remoteurl',\n type: String\n },\n storeDataKey: {\n attribute: 'storedatakey',\n type: String\n },\n derivation: {\n attribute: 'derivation',\n type: String\n },\n primaryKeyColumn: {\n attribute: 'primarykeycolumn',\n type: String\n }\n }\n }", "title": "" }, { "docid": "96005dc2e9317c023ce357eb9239b707", "score": "0.5109667", "text": "managedProperties() {\n return (this._managedProperties\n || this.constructor.managedProperties());\n }", "title": "" }, { "docid": "4250088f1cc320dabecea0a83b6fbf98", "score": "0.51087177", "text": "static get mTransientProperties() {\n return {\n \"cache.uncachedCalendar\": true,\n currentStatus: true,\n \"itip.transport\": true,\n \"imip.identity\": true,\n \"imip.account\": true,\n \"imip.identity.disabled\": true,\n organizerId: true,\n organizerCN: true,\n };\n }", "title": "" }, { "docid": "3a0187801abf4e87a63eb00bd138dfc1", "score": "0.5102918", "text": "function property(options){// tslint:disable-next-line:no-any decorator\nreturn(protoOrDescriptor,name)=>name!==undefined?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor);}", "title": "" }, { "docid": "5bad542c6a7aa91ca1dd44172f11788e", "score": "0.50921476", "text": "function H(e){return(t,i)=>i!==void 0?((r,o,s)=>{o.constructor.createProperty(s,r)})(e,t,i):Oa(e,t)}", "title": "" }, { "docid": "3024b5ceddb2a2584353e12877dbaa97", "score": "0.50902134", "text": "static get hasProperty() {\n return this.prototype.hasProperty;\n }", "title": "" }, { "docid": "0ce0b2246288ddf8f581d27607b3bf8b", "score": "0.5087656", "text": "function u(n,r,i){(i?Reflect.getOwnMetadataKeys(r,i):Reflect.getOwnMetadataKeys(r)).forEach(function(t){var e=i?Reflect.getOwnMetadata(t,r,i):Reflect.getOwnMetadata(t,r);i?Reflect.defineMetadata(t,e,n,i):Reflect.defineMetadata(t,e,n)})}", "title": "" }, { "docid": "4f09598da2414ca682f4a51c01982528", "score": "0.50861293", "text": "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=undefined;}", "title": "" }, { "docid": "76c7c00db61f91a40bcb4d8cd7fbd3b1", "score": "0.5085219", "text": "function _internals() {\n return {\n a: acc\n , b: brs\n , c: cnt\n , m: m\n , r: r\n , g: gnt\n };\n }", "title": "" }, { "docid": "bcbeb1ab8cf362660434494478dc0434", "score": "0.50797564", "text": "function property(options){// tslint:disable-next-line:no-any decorator\nreturn(protoOrDescriptor,name)=>name!==void 0?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor)}", "title": "" }, { "docid": "7568853888a0a48052b66ba1da4134b0", "score": "0.5077121", "text": "static get UserProperty() {\r\n return {\r\n USER_TYPE: \"User_Type\",\r\n };\r\n }", "title": "" }, { "docid": "8795e434c1e6ea2355718e727b07abe9", "score": "0.5075535", "text": "get Name() { return this.internal.Name; }", "title": "" }, { "docid": "807323040dac05d0af71f3426aac7819", "score": "0.5069756", "text": "static get properties() {\n return {\n data: {\n type: Object\n }\n };\n }", "title": "" }, { "docid": "ea2608861d030bd6cf62578bdb512572", "score": "0.50670373", "text": "function ActiveXAwarePropMethodFactory() {\r\n\t\r\n}", "title": "" }, { "docid": "195bda4ea604509f1f5d2501f062efcb", "score": "0.5057623", "text": "get keys(){ return Reflect.ownKeys(this).filter(key => !key.match(/__/)); }", "title": "" }, { "docid": "18c7a9ae6ef802960405568eaddf4186", "score": "0.5053538", "text": "getObjectRepresentation() {\n\n \t\tretVal = {};\n\n \t\tfor(let [property, value] of this._propertyRepository.entries())\n \t\t\tretVal[property] = value;\n\n\n \t\treturn retVal;\n \t}", "title": "" }, { "docid": "e9212cbfab0da0c89656dcebde631094", "score": "0.5053179", "text": "get subProperties() {\n\n return {\n\n /**\n * Adds this property to the specified type.\n * @param {string} typeQName\n * @param {string} [min]\n * @param {string} [max]\n * @param {string} [definition]\n */\n add: async (typeQName, min, max, definition) => {\n return this.release.subProperties.add(typeQName, this.qname, min, max, definition);\n },\n\n /**\n * Finds all sub-property relationships for which this property participates.\n * @param {import(\"../subproperty/index\").CriteriaType} [criteria] - Optional criteria by which to filter the results\n * @returns {Promise<import(\"../typedefs\").SubProperty[]>}\n */\n find: async (criteria={}) => {\n criteria.propertyQName = this.qname;\n let d = await this.dependencies();\n d.type\n return this.release.subProperties.find(criteria);\n }\n\n }\n }", "title": "" }, { "docid": "acb075004b7ac32e937a7d59d44f09ff", "score": "0.5040418", "text": "static get properties() {\n return {\n user: { type: Object }\n };\n }", "title": "" } ]
fc8f758e66a68c3b5604f0eb94645ab8
USEFULL FUNCTIONS// check if a raw belongs to a matrix for XYZ
[ { "docid": "d1e12df5390892cdf3fd92cbca15d757", "score": "0.0", "text": "function contains(points, onePoint) {\n for (var _i = 0, points_3 = points; _i < points_3.length; _i++) {\n var point = points_3[_i];\n if (mathis.geo.distance(point, onePoint) < 0.0001) {\n return true;\n }\n }\n return false;\n }", "title": "" } ]
[ { "docid": "aa3959622f03447e7947121673b990d8", "score": "0.67715275", "text": "canBePlacedInMatrix(x, y) {\r\n if ((x > this.width || x < 0) || (y > this.height || y < 0)) { // object is not in matrix\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "b7358b9a139e3e17c191fb341f5f83ec", "score": "0.6392136", "text": "has(point) {\r\n\t\tlet [x, y] = point.get;\r\n\t\treturn (!!this.matrix[y] && !!this.matrix[y][x]);\r\n\t}", "title": "" }, { "docid": "72c6bcb0a413be01919b7843333316b9", "score": "0.61662424", "text": "function has3D(mat) {\n return mat[2] !== 0 ||\n mat[6] !== 0 ||\n mat[14] !== 0;\n}", "title": "" }, { "docid": "ecab6522adaeb32c4c9c8a122c872120", "score": "0.59885657", "text": "checkColumnWise(cColumn){ \r\n for(var j=0;j<this.state.matrix[0].length;j++){\r\n if(this.state.matrix[j][cColumn] !== this.state.player){\r\n return false;\r\n }\r\n }\r\n return true; \r\n }", "title": "" }, { "docid": "4cebe8eb84d00287333d962c7ddcb7d8", "score": "0.59396595", "text": "getSlice(row_low,col_low,row_high = this.shape[0],col_high = this.shape[1]){\r\n if(row_low < this.shape[0]){\r\n if(col_low < this.shape[0]){\r\n if(row_low < row_high){\r\n if(col_low < col_high){\r\n if(row_high <= this.shape[0]){\r\n if(col_high <= this.shape[1]){\r\n let newData = [];\r\n let newShape = [row_high-row_low,col_high-col_low];\r\n for(let i=row_low;i<row_high;i++){\r\n for(let j=col_low;j<col_high;j++){\r\n newData.push(this.data[i][j]);\r\n }\r\n }\r\n return new Matrix(newData,newShape);\r\n }else{\r\n console.error(`Fourth parameter (col-upper-bound) must not be greater than number of columns! Received: ${col_high}; Shape: [${this.shape[0]},${this.shape[1]}]`);\r\n return false;\r\n }\r\n }else{\r\n console.error(`Third parameter (row-upper-bound) must not be greater than number of columns! Received: ${row_high}; Shape: [${this.shape[0]},${this.shape[1]}]`);\r\n return false;\r\n }\r\n }else{\r\n console.error(`Second parameter (col-lower-bound) must not be greater than upper bound! Received: ${col_low}; Shape: [${this.shape[0]},${this.shape[1]}]`);\r\n return false;\r\n }\r\n }else{\r\n console.error(`First parameter (row-lower-bound) must not be greater than upper bound! Received: ${row_low}; Shape: [${this.shape[0]},${this.shape[1]}]`);\r\n return false;\r\n }\r\n }else{\r\n console.error(`Column ${col_low} does not exist in this matrix!`);\r\n return false;\r\n }\r\n }else{\r\n console.error(`Row ${row_low} does not exist in this matrix!`);\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "4530d5ad3270426ad80ebc67a01791dc", "score": "0.59051484", "text": "hasTopLeft(type) {\n return this.row > 0 && this.col > 0 && grid[this.row - 1][this.col - 1] == type;\n }", "title": "" }, { "docid": "a1a47d1999d478c16ce5eac362d9d4aa", "score": "0.5872563", "text": "function check_array(x, y) {\n var A = new Matrix(x);\n var B = new Matrix(y);\n check_matrix(A,B);\n}", "title": "" }, { "docid": "0e08782e9c12f09a7bcc4e3a3d795295", "score": "0.5844694", "text": "checkRowWise(cRow){ \r\n for(let j=0;j<this.state.matrix[cRow].length;j++){\r\n if(this.state.matrix[cRow][j] !== this.state.player){\r\n return false;\r\n }\r\n }\r\n return true; \r\n }", "title": "" }, { "docid": "2078d200e195f29e10818b2acd55e5ea", "score": "0.58266574", "text": "function used_in_box(matrix, box_start_row, box_start_col, num) {\n for (let row = 0 + box_start_row; row < 3 + box_start_row; row++) {\n for (let col = 0 + box_start_col; col < 3 + box_start_col; col++) {\n if (matrix[row][col] == num) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "6db9c409bfd5100855fe4e4a64728a75", "score": "0.57976216", "text": "function trackExists(sample)\n{\n\tfor(var i = 0; i < matrix.length; i++)\n\t{\n\t\tif(matrix[i].sample === sample)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ca1f16360c523ee47767eddb20b435ee", "score": "0.579528", "text": "function checkHorizontal(matrix, target) {\n for (let i = 0; i < matrix[0].length; i++) {\n let result = '';\n for (const el of matrix) {\n result += el[i];\n // console.log(`${result}, ${i}`)\n console.log(result === target)\n if (result === target) {\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "708741c46a055167cf7f114888787949", "score": "0.57822627", "text": "function asm_matrix_same(x,y) {\n var i,n;\n if(!(x instanceof Array) || !(y instanceof Array)) { return false; }\n n = x.length;\n if(n !== y.length) { return false; }\n for(i=0;i<n;i++) {\n //if(x[i] === y[i]) { continue; }\n\t\tif( Math.abs(x[i] - y[i]) < 1e-9) { continue; } // !!!!!!!!!! by Gorkem !!!!!!!!!!!\n if(typeof x[i] === \"object\") { if(!asm_matrix_same(x[i],y[i])) return false; }\n else { return false; }\n }\n return true;\n}", "title": "" }, { "docid": "cd4492cfde26a41ff0c6fd127452950c", "score": "0.5771616", "text": "function is_identity_Matrix(matrix_data) {\r\n for (let i = 0; i < matrix_data.length; i++) \r\n {\r\n for (let j = 0; j < matrix_data.length; j++)\r\n {\r\n if (matrix_data[i][j] !== 1 && i === j || matrix_data[i][j] && i !== j)\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "4c2034c431673da362b04f5d32757192", "score": "0.5770859", "text": "checkCurrCol(col) {\n var mask = 1 << col;\n var row1 = (this.currVectors[0] & mask) >> col;\n var row2 = (this.currVectors[1] & mask) >> col;\n var row3 = (this.currVectors[2] & mask) >> col;\n return row1 + row2 + row3 === 3;\n }", "title": "" }, { "docid": "cb353a9300f63b73691c40a11c7497af", "score": "0.5756759", "text": "checkSpot(row, col) {\n let grid = this.rows;\n\n // Handles property undefined error\n if (row == -1) row = 0;\n\n if (grid[row][col] == 0) return true;\n return false;\n }", "title": "" }, { "docid": "0458150435d9473a98b8c5ffd9206ebf", "score": "0.57110244", "text": "function check_block(number,row,col,matrix) \n{\n\tlet bigrow=Math.floor(((row)/3))*3\n\tlet bigcol=Math.floor(((col)/3))*3 \n\tfor(let x=0;x<3;x++)\n\t{\n\t\tfor(let y=0;y<3;y++)\n\t\t{\n\t\t\tif(matrix[bigrow+x][bigcol+y]==number)\n\t\t\t{\n //return false if that number exists \n //in that 3X3\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "6f51f47c80bece728fc8890cd77e6426", "score": "0.5680944", "text": "isValidPosition(x,y){\n let valid = x>=0 && x<this.numberOfCols && y>=0 && y<this.numberOfRows;\n return valid \n }", "title": "" }, { "docid": "bcad0472d78390044a8a4fdc1576ca98", "score": "0.5665486", "text": "checkIfOnGrid(location, grid) {\n\t for(var i = 0; i < grid.length; i++) {\n\t for(var j = 0; j < grid[i].length; j++) {\n\t if(location == grid[i][j]) {\n\t return true;\n\t }\n\t }\n\t }\n\t\treturn false;\n\t}", "title": "" }, { "docid": "20382bc267365a92231e44f882fb74a0", "score": "0.5665052", "text": "function testRex_matrixResoulved_esUnidad(){\n\t\n\tvar correcto = true;\n\tvar variable;\n\n\tvariable = [[0],[2],[1]];\n\tif(matrixResoulved_esUnidad(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 1\");\n\t}\n\n\tvariable = [[0,3,2],[2],[2,1]];\n\tif(matrixResoulved_esUnidad(variable) != null){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 2\");\n\t}\n\n\tvariable = [[1,0,0],[0,1,0],[0,0,3]];\n\tif(matrixResoulved_esUnidad(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 3\");\n\t}\n\n\tvariable = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];\n\tif(!matrixResoulved_esUnidad(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 4\");\n\t}\n\n\treturn correcto;\n}", "title": "" }, { "docid": "9a842ba58c00c6543259f32ad6bea69a", "score": "0.564832", "text": "function searchMatrix(matrix, target) {\n let rows = matrix.length\n for (let i = 0; i < rows; i++) {\n let cols = matrix[i]\n for (let j = 0; j < cols.length; i++) {\n if (cols[j] === target) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "3e47704303128fcd426b80112b078025", "score": "0.56106263", "text": "function QR__coordOK(x) {\n\treturn (x >= 0 && x < this.dim);\n}", "title": "" }, { "docid": "2625139756da25ba25337937050a567c", "score": "0.560267", "text": "function user_check(frame,tiles) { //inputs: the frame, and tiles array, but this time no reordering and no rotations\n var n = tiles.length;\n //check top bottom\n for(i=0; i<n; i++){\n if((tiles[i].colors[1]+\" \"+tiles[i].colors[3])!==frame.pairs[i]) {\n return false;\n }\n }\n //check frame\n if((tiles[0].colors[0] !== frame.left) || (tiles[n-1].colors[2] !== frame.right)){\n return false;\n }\n //check side, side\n for(i=0; i<(n-1); i++){\n if(tiles[i].colors[2]!==tiles[i+1].colors[0]){\n return false;\n }\n }\n //all possible checked so return true\n return true;\n}", "title": "" }, { "docid": "232299fca5a26288ad48bd5adf59432f", "score": "0.5597571", "text": "function interpret() {\n\n\n for (var x = 0; x < width; x++) {\n for (var y = 0; y < height; y++) {\n\n var decodedCell = ca.getDecodedCell(x, y);\n if (decodedCell === 1) {\n //discard the x value. we just want to know whether a given row contains a living cell\n outputMatrix.setcell2d(0, y, 255);\n\n } else if (decodedCell === -1) {\n post(\"index does not exist\");\n post();\n }\n\n\n }\n\n\n }\n}", "title": "" }, { "docid": "064c5e9e34d1bf6fb04b95e7f61daf25", "score": "0.559003", "text": "function testRex_matrixResoulved_esCuadrada(){\n\t\n\tvar correcto = true;\n\tvar variable;\n\n\tvariable = [[0],[2],[1]];\n\tif(matrixResoulved_esCuadrada(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 1\");\n\t}\n\n\tvariable = [[0,3,2],[2],[2,1]];\n\tif(matrixResoulved_esCuadrada(variable) != null){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 2\");\n\t}\n\n\tvariable = [[0,0,2],[2,1,2],[1,2,2]];\n\tif(!matrixResoulved_esCuadrada(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 3\");\n\t}\n\n\treturn correcto;\n}", "title": "" }, { "docid": "97e8f3576eb5b486df0eb6a9e615ffdd", "score": "0.5571357", "text": "isComplete(i, j, pos_i, pos_j) {\n if (typeof pos_i !== 'undefined') {\n i = this.positions.get(pos_i);\n }\n if (typeof pos_j !== 'undefined') {\n j = this.positions.get(pos_j);\n }\n\n let v;\n for (let m = 0; m < i; m++) {\n for (let n = 0; n < j; n++) {\n v = this.matrix[m][n];\n if (v == null || isNaN(v)) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "fbc1707a3ff7ad691b2c319066c01e4e", "score": "0.55569327", "text": "canRotate(rotatedMatrix) {\n // go through every element in the piece (4x4)\n for (let j=0; j<rotatedMatrix.length; j++) {\n\n for (let i=0; i<rotatedMatrix[j].length; i++) {\n let value = rotatedMatrix[j][i];\n if ((value == 1)\n && (!this.board.matrix[j+this.pos.y]\n || !this.board.matrix[j+this.pos.y][i+this.pos.x]\n || this.board.matrix[j+this.pos.y][i+this.pos.x].value == 1)) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "9ecc223ba2bcf702ce724f821d644f51", "score": "0.5551321", "text": "function contains(mat,tab){\n //Prend deux parametre, un tableau(de tableau), donc une matrice, et un tableau.\n //Retourne vrai si ce tableau est un element ligne de la matrice, faux sinon.\n\n for(var i=0; i<mat.length; i++){\n \t//On parcour les lignes de la matrices\n\n if(\"\"+mat[i] == tab) return true; //On convertit en string pour la comparaisont, avec l'operateur concatenation +\n }\n\n return false;\n}", "title": "" }, { "docid": "4f44618326b5a07e436b0931b401a030", "score": "0.5545158", "text": "function defineInMatrix(x, y, matrixRange) {\r\n if (0 <= x <= matrixRange && 0 <= y <= matrixRange) {\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n }", "title": "" }, { "docid": "3b27c68b9849f2ce6042df6de2f24014", "score": "0.55391586", "text": "hasRasters () {\n return (['color', 'normal', 'custom'].indexOf(this.raster) > -1);\n }", "title": "" }, { "docid": "fd18ea5049c4d62efd116ebac8aa6681", "score": "0.55246186", "text": "function isSafe(mat, visited, x, y)\n{\n\treturn (x >= 0 && x < mat.length && y >= 0\n\t\t\t&& y < mat[0].length && mat[x][y] == 1\n\t\t\t&& !visited[x][y]);\n}", "title": "" }, { "docid": "68265afdef215ce71c23b94f4cc9c82f", "score": "0.55205995", "text": "function shipCheck(shipLocations, row, col, y, checkOrientation) {\n let res = false;\n let shipPart;\n for (let z = 0; z < y; z++) {\n checkOrientation == 'horizontal' ? shipPart = xArr[row][col + z] : shipPart = xArr[row + z][col]\n shipLocations.includes(shipPart) ? res = true : res\n }\n return res;\n}", "title": "" }, { "docid": "2883c71bf935c7b82f631bb4b3ae4965", "score": "0.5520053", "text": "function checkCorrect(){\r\n\t\tfor( let rowCount=0; rowCount<pieces_per_row; rowCount++ ){\r\n\t\t\tfor( let columnCount=0; columnCount<pieces_per_column; columnCount++ ){\r\n\t\t\t\tlet jigsawLastPosition = objs_jigsaw[rowCount][columnCount].lastPositionIndex.row + \"\" + objs_jigsaw[rowCount][columnCount].lastPositionIndex.col;\r\n\t\t\t\tif( objs_jigsaw[rowCount][columnCount].jigsawNumber !== jigsawLastPosition){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "title": "" }, { "docid": "ac7636c8bbfca8c41293b49aa1055c98", "score": "0.5503656", "text": "function positiveMatrix (input) {\n return input.every(function (row) {\n return Array.isArray(row) && row.every(function (num) {\n return num > 0;\n });\n });\n}", "title": "" }, { "docid": "44818a34a01034e946eea0d481ba31c0", "score": "0.5502307", "text": "function matrix(a) {\n for (let i = 0; i < a.length; i++) {\n for (let j = 0; j < a[0].length; j++) {\n if (j > i && a[i][j] !== 0) return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5c8bc3d9e0ef9c3d91b4ce05811e5370", "score": "0.550079", "text": "function is_illuminated(casillero){\n var i = casillero[0];\n var j = casillero[1];\n var casilla_real = tablero[i][j];\n if(casilla_real == \"L\" || casilla_real == \"I\" || casilla_real == \"XI\")\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "a912a98b6031696d46f5ea4f00c6cf33", "score": "0.5491452", "text": "function is_safe(matrix, num_of_row, num_of_column, num) {\n return !used_in_row(matrix, num_of_row, num)\n && !used_in_column(matrix, num_of_column, num)\n && !used_in_box(matrix, num_of_row - num_of_row % 3, num_of_column - num_of_column % 3, num);\n}", "title": "" }, { "docid": "db63e700c00b57d1d94776b61735a166", "score": "0.548999", "text": "containsXYZ(x, y, z) {\n return x >= this.low.x\n && y >= this.low.y\n && z >= this.low.z\n && x <= this.high.x\n && y <= this.high.y\n && z <= this.high.z;\n }", "title": "" }, { "docid": "8ae4077f764f13ef054b3081bc1090f9", "score": "0.5488847", "text": "function search_point(width, height, maxWidth, maxHeight, tbl) {\n for (var y=0; y < maxHeight; y++) {\n for (var x=0; x < maxWidth; x++) {\n if (check_matrix(x, y, width, height, maxWidth, tbl)) {\n fill_matrix(x, y, width, height, maxWidth, tbl);\n return {x:x, y:y};\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "1a4fd1f21bf256cc1cf964c542015e0f", "score": "0.5466408", "text": "function isMatrixValid(array) {\n let valid = true;\n for (let i = 0; i < array.length; i++) {\n for (let j = 0; j < array[i].length; j++) {\n if (isNaN(array[i][j])) {\n displayOutput(\"ERROR : Invalid value at \" + i + \" x \" + j, \"error\");\n valid = false;\n }\n }\n }\n return valid;\n}", "title": "" }, { "docid": "f4440824590a3d6d1bc44ab2ed2207fd", "score": "0.5466102", "text": "contains(mx, my) {\n return dist(mx, my, this.x, this.y) < this.r;\n }", "title": "" }, { "docid": "f4a7746cef98190de2c626002b88b660", "score": "0.54560256", "text": "checkRows() {\n if (this.board[0][0] === this.board[0][1] && this.board[0][1] === this.board[0][2] && this.board[0][0]) {\n return this.board[0][0];\n } else if (this.board[1][0] === this.board[1][1] && this.board[1][1] === this.board[1][2] && this.board[1][0]) {\n return this.board[1][0];\n } else if (this.board[2][0] === this.board[2][1] && this.board[2][1] === this.board[2][2] && this.board[2][0]) {\n return this.board[2][0];\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "38e68d3cfed021a43d7f9fdb2c64bee7", "score": "0.5453134", "text": "function check_number(number,row,col,matrix) \n{\n\treturn check_row(number,row,matrix) && check_col(number,col,matrix) && check_block(number,row,col,matrix);\n}", "title": "" }, { "docid": "e130dfe8bbee86ec39abea7499d99124", "score": "0.54509246", "text": "function used_in_box(arr, row, col, num) {\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < 3; j++) {\n if (arr[i + row][j + col] == num) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "0bdbc68b837f40f8df66505c1e89629c", "score": "0.54352045", "text": "function is_available_xy(x, y, th_front, th_back, th_top, th_bottom) {\n\n // Model the \"square\" as array of x,y points\n var xy_array = [];\n for(var d = (x - th_back); d <= (x + 50 + th_front); d = d + ARENA.BLOCK_SIZE) {\n for(var z = (y - th_top); z <= (y + th_bottom); z = z + ARENA.BLOCK_SIZE) {\n xy_array.push({\n x: d, \n y: z\n });\n }\n }\n\n // Test that none of the other worms are in the created square\n for(var i = 0; i < players.length; ++i) {\n for(var c = 0; c < xy_array.length; ++c) {\n if(players[i].occupies(xy_array[c].x, xy_array[c].y)) {\n return false;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "02f2eb87a40f6f95b1c70ce79596b95f", "score": "0.5407082", "text": "function _isTileAvailable({row: pRow, col: pCol}) {\n for (let userId in allCoordinates) {\n const {row: eRow, col: eCol} = allCoordinates[userId];\n if (pRow === eRow && pCol === eCol) return false;\n }\n return true;\n}", "title": "" }, { "docid": "82796c6391d5019cd6edaefa2aba58d0", "score": "0.54040724", "text": "isAtMapPosition(p1,p2){\n return this.getGridVector(p1).x === this.getGridVector(p2).x &&\n this.getGridVector(p1).y === this.getGridVector(p2).y;\n }", "title": "" }, { "docid": "dae6c92a39919b8ba2818f964d127328", "score": "0.5398585", "text": "function isCnpjMatriz( cnpj_ )\r\n\t{\r\n\t\t// Auxiliary variable\r\n\t\tvar suffix = \"\";\r\n\r\n\t\t// Remove all the cnpj mask\r\n\t\tcnpj = cnpj_.replace(/[^\\d]+/g,'');\r\n\r\n\t\t// Check if the informed CNOJ is valid\r\n\t\tif(cnpj == '') return false;\r\n\r\n\t\tif (cnpj.length != 14)\r\n\t\t\treturn false;\r\n\r\n\t\t// Eliminate the well known invalid CNPJs\r\n\t\tif ( cnpj == \"00000000000000\" || \r\n\t\t\tcnpj == \"11111111111111\" || \r\n\t\t\tcnpj == \"22222222222222\" || \r\n\t\t\tcnpj == \"33333333333333\" || \r\n\t\t\tcnpj == \"44444444444444\" || \r\n\t\t\tcnpj == \"55555555555555\" || \r\n\t\t\tcnpj == \"66666666666666\" || \r\n\t\t\tcnpj == \"77777777777777\" || \r\n\t\t\tcnpj == \"88888888888888\" || \r\n\t\t\tcnpj == \"99999999999999\" )\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Validate the CNPJ matrix indicator\r\n\t\tcnpj_length = (cnpj.length - 2);\r\n\t\tsuffix = cnpj.substring(8, cnpj_length);\r\n\r\n\t\t// Check if the informed CNPJ is related to matrix\r\n\t\tif ( suffix.localeCompare(\"0001\") == 0 )\r\n\t\t{\r\n\t\t\t// It's a matrix\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// It's a branch\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "fac150fa24bd3bf862f9311bda84aaef", "score": "0.5390028", "text": "checkCellForVictim(x, y) {\r\n return FIELD[y][x] === -1;\r\n }", "title": "" }, { "docid": "c8247c878f0262271ca790d26761fff8", "score": "0.538976", "text": "function UsedInRow(grid, row, num){\n for (var col = 0; col < N; col++)\n if (grid[row][col] == num)\n return true;\n return false;\n}", "title": "" }, { "docid": "0ae4a7931921be02f8afcc07e6033399", "score": "0.53772384", "text": "function isHorizontalReflection(grid){\n\t\t//check NW quad against its neighbor quads\n\t\tfor(var i=0;i<Math.floor(grid.length/2);i++){\n\t\t\tfor(var j=0;j<Math.floor(grid.length/2);j++){\n\t\t\t\t//check against NE quad\n\t\t\t\t//might be vertically symmetric\n\t\t\t\tif(grid[j][i]===grid[j][grid.length-i-1]){\n\t\t\t\t\t//may be coincidence check SW quad\n\t\t\t\t\t//is coincidence\n\t\t\t\t\tif(grid[j][i]===grid[grid.length-j-1][i]){\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t//not coincidence is vertically symmetric\n\t\t\t\t\telse{\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//is horizontal reflection\n\t\t\t\telse{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//todo: implement handling for perfectly symmetric map\n\t\treturn Error('failed to compute map symmetry');\n\t}", "title": "" }, { "docid": "44741a96fefcf923aa8a327f2c924af7", "score": "0.53745973", "text": "function canMove( side ){\r\n var maxFunc = side == 1 ? Math.max : Math.min;\r\n var rows = {}, x, y;\r\n for( var i=0, olength=object[or].length; i < olength; i++ ) {\r\n y = vpos + object[or][i][1];\r\n x = hpos + object[or][i][0] + side; // temporarily move the object sideways\r\n !isNaN(rows[y]) || ( rows[y] = x ); // get the leftmost/rightmost square in each row\r\n rows[y] = maxFunc( rows[y], x );\r\n }\r\n // Check if the leftmost/rightmost square is in an illegal position\r\n for( i in rows )\r\n if( rows[i] < 0 || rows[i] > HCOUNT-1 || Map[ rows[i] ][ i ] != 1 )\r\n return false;\r\n return true;\r\n}", "title": "" }, { "docid": "faf419a15e993e9c0ac15fe66cc9c586", "score": "0.53714347", "text": "checkDiagnolIncreasing(){\r\n for(var i=0,j=0;j<this.state.matrix[0].length;j++,i++){\r\n if(this.state.matrix[i][j] !== this.state.player){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "13666b57f155be4093b19fb3410e4ee1", "score": "0.5368298", "text": "isMember(target) {\n return this.arr.some(row => row.some(item => item === target));\n }", "title": "" }, { "docid": "8857608002c4c78a901aac1dbbc48be4", "score": "0.5362346", "text": "checkSolved() {\n const defaultOrientation = this.cubes[0][0][0].rotationAxis;\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n for (let x = 0; x < 3; x++) {\n for (let y = 0; y < 3; y++) {\n for (let z = 0; z < 3; z++) {\n if (this.cubes[x][y][z].rotationAxis[i][j] !== defaultOrientation[i][j]) {\n if (x === 1 && z === 1) {\n if (this.cubes[x][y][z].rotationAxis[1][j] !== defaultOrientation[1][j]) {\n return false;\n }\n } else if (x === 1 && y === 1) {\n if (this.cubes[x][y][z].rotationAxis[2][j] !== defaultOrientation[2][j]) {\n return false;\n }\n } else if (y === 1 && z === 1) {\n if (this.cubes[x][y][z].rotationAxis[0][j] !== defaultOrientation[0][j]) {\n return false;\n }\n } else {\n return false;\n }\n }\n }\n }\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "8ac71a189846c9215ba21fcaa5898ed2", "score": "0.5356276", "text": "checkArea(y, x){\n\t\tlet i = 0;\n\t\tlet j = 0;\n\t\t\n\t\tif (y < 0 || y > this.height || x < 0 || x > this.width) {\n\t\t\t//out of field\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tj = x;\n\t\tfor (i = y-1; i <= y+1; i++) {\n\t\t\tif (i >= 0 && i < this.height){ \n\t\t\t\tif (this.field[i][j] !== 1) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\ti = y;\n\t\t\n\t\tfor (j = x-1; j <= x+1; j++) {\n\t\t\tif (j >= 0 && j < this.width \n\t\t\t\t&& this.field[i][j] !== 1) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "2678c753468a524df952069bee6c2080", "score": "0.5355438", "text": "function isShip(coordinate){\n return lightCell(coordinate) == 'v';\n}", "title": "" }, { "docid": "a771d0eedd829903eff17aae7a867c21", "score": "0.53542656", "text": "containsPoint(point) { return this.containsXYZ(point.x, point.y, point.z); }", "title": "" }, { "docid": "ecf68cfb16af1a25343539b03d13e654", "score": "0.5333265", "text": "function isObjectInside2DArray( obj, array2D ){\r\n\t\tfor(let c=0, len=array2D.length; c<len; c++){\r\n\t\t\tfor(let c1=0, len1=array2D[c].length; c1<len1; c1++){\r\n\t\t\t\tif( obj === array2D[c][c1] ){\r\n\t\t\t\t\treturn { answer:true, dimension1:c, dimension2:c1 };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { answer:false };\r\n\t}", "title": "" }, { "docid": "07791f55d6ed2584a39425211d886433", "score": "0.53308064", "text": "function checkMatrix(arr){\n let rowSum = 0\n let colSum = 0\n let bool = true\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n if (i === 0) {\n rowSum += arr[i][j]\n } \n\n if (j === 0) {\n colSum += arr[i][j]\n }\n } \n }\n\n let currentRow = 0\n let currentCol = 0\n\n for (let n = 1; n < arr.length; n++) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n if (i === n) {\n currentRow += arr[i][j]\n } \n } \n }\n \n if (currentRow !== rowSum) {\n bool = false\n break\n }\n\n currentRow = 0\n }\n \n for (let n = 1; n < arr[0].length; n++) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n if (j === n) {\n currentCol += arr[i][j]\n } \n } \n }\n \n if (currentCol !== colSum) {\n bool = false\n break\n }\n\n currentCol = 0\n }\n\n console.log(bool)\n}", "title": "" }, { "docid": "cc04784162d5b45ba9b21b3c459e39ba", "score": "0.53258216", "text": "squareHasBeenVisited(colNum, rowNum) {\n const { visitedSquares } = this.state;\n\n for(let i = 0; i < visitedSquares.length; ++i) {\n if (colNum === visitedSquares[i][0] \n && rowNum === visitedSquares[i][1]) {\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "591a279a4872f9979cbe101f4fa1524f", "score": "0.53223443", "text": "function isValid(maze, row, col) {\n if (maze[row] !== undefined && maze[row][col] === 1) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "dd2978e15904c2c5331c672e5d54d2c7", "score": "0.5318933", "text": "function check(row, col, area){\r\n\tif(col == myMatrix.length - 1 && row == myMatrix[0].length - 1)\r\n\t\tconsole.log(\"Area:\", area); //Si llegamos al caso base (que es el ultimo lugar de la matriz)\r\n\tif(col+1<=myMatrix[0].length-1){ //Nuestro if para verificar si Hay celdas alrededor de un 1\r\n\t\tif(myMatrix[row][col] == 1 && (myMatrix[row-1][col]==1 || \r\n\t\t\tmyMatrix[row+1][col]==1 ||\r\n\t\t\tmyMatrix[row][col-1]==1 ||\r\n\t\t\tmyMatrix[row][col+1]==1 ||\r\n\t\t\tmyMatrix[row-1][col-1] == 1 ||\r\n\t\t\tmyMatrix[row+1][col+1] == 1 ||\r\n\t\t\tmyMatrix[row-1][col+1] == 1 ||\r\n\t\t\tmyMatrix[row+1][col-1] == 1)){\r\n\t\t\t\tarea += 1; //Si, si agregamos 1 al area\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tarea += 0;\r\n\t\t// console.log(myMatrix[row][col]);\r\n\t\tcheck(row,col+1, area); //Volvemos a iterar la funcion otra vez\r\n\t} else if (row+1<=myMatrix[1].length-1){\r\n\t\t\tif(myMatrix[row][col] == 1 && (myMatrix[row-1][col]==1 || //Otra vez el if \r\n\t\t\tmyMatrix[row+1][col]==1 ||\r\n\t\t\tmyMatrix[row][col-1]==1 ||\r\n\t\t\tmyMatrix[row][col+1]==1 ||\r\n\t\t\tmyMatrix[row-1][col-1] == 1 ||\r\n\t\t\tmyMatrix[row+1][col+1] == 1 ||\r\n\t\t\tmyMatrix[row-1][col+1] == 1 ||\r\n\t\t\tmyMatrix[row+1][col-1] == 1)){\r\n\t\t\t\tarea += 1; //Misma cosa\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\tarea += 0;\r\n\t\t// console.log(myMatrix[row][col]);\r\n\t\tcheck(row+1,1, area);\r\n\t} \r\n}", "title": "" }, { "docid": "863ee0156ad7bbb86063e923ef90dab7", "score": "0.5314771", "text": "function is_horizontal(fullmap) {\n const length = fullmap.length\n var check = true;\n for (let y = 0; check && length > y; y++) {\n for (let x = 0; check && length > x; x++) {\n\t\t\t\t\t\tif (fullmap[y][x] === fullmap[length - y -1][x]){\n\t\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcheck = false;\n\t\t\t\t\t\t}\n }\n }\n return check\n}", "title": "" }, { "docid": "266a4631a252e74dbecb7501da5ad7b7", "score": "0.5311281", "text": "function k$3(t,r){if(t.x===r.x&&t.y===r.y){if(t.hasZ){if(t.z!==r.z)return !1}else if(r.hasZ)return !1;if(t.hasM){if(t.m!==r.m)return !1}else if(r.hasM)return !1;return !0}return !1}", "title": "" }, { "docid": "18641fa04b65e1260532491e409d86f0", "score": "0.53099275", "text": "function used_in_column(matrix, num_of_column, num) {\n for (let row = 0; row < 9; row++) {\n if (num == matrix[row][num_of_column]) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "562f55095659b7493bca07cfda7479cf", "score": "0.5307447", "text": "__checkCollission(entity){\n if(entity.x == this.x && entity.y == this.y){\n return true\n }\n return false\n }", "title": "" }, { "docid": "9addd008f9222b9f8ad7ccb53cf2859a", "score": "0.5281606", "text": "function testRex_matrixResoulved_compararMatrices(){\n\t\n\tvar correcto = true;\n\tvar variable1, variable2, resultado;\n\n\tvariable1 = [[0],[2],[1]];\n\tvariable2 = [[0,6],[2,5],[1,5]];\n\tif(matrixResoulved_compararMatrices(variable1, variable2)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 1\");\n\t}\n\n\tvariable1 = [[0,2],[2,3],[1,4]];\n\tvariable2 = [[0],[2],[1]];\n\tif(matrixResoulved_compararMatrices(variable1, variable2)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 2\");\n\t}\n\n\tvariable1 = [[0],[2],[1]];\n\tvariable2 = [[0,2],[2],[1]];\n\tif(matrixResoulved_compararMatrices(variable1, variable2) != null){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 3\");\n\t}\n\n\tvariable1 = [[1],[2],[3]];\n\tvariable2 = [[3],[2],[1]];\n\tif(false){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 4\");\n\t}\n\n\tvariable1 = [[4,1],[4,3],[4,5]];\n\tresultado = [[4,1],[4,3],[4,5]];\n\tif(false){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 5\");\n\t}\n\n\treturn correcto;\n}", "title": "" }, { "docid": "db5f2eae432eceb41e526b7a11f286e0", "score": "0.5278187", "text": "function check_row(number,row,matrix) {\n\tfor (let i=0; i<matrix[0].length; i++) {\n\t\tif (matrix[row][i] == number) {\n //return false if that number exists \n //in that row\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "6587e9fad5dd20c977b8f0ee2b783f11", "score": "0.5270152", "text": "function checkThreeRow (a, b, c, marker) {\n \n var result = false;\n\n if (getSquare(a) === marker && getSquare(b) === marker && getSquare(c) === marker) {\n \n result = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "2aab5afcd37e968e6e59a7fec2a43ddb", "score": "0.526619", "text": "function isRow() {\n // iterat 3 times to check for the the 3 cols and 3 rows\n for (var i = 1; i <= 3; i++) {\n var row = $('#row'+i+' td');\n var col = $('.col'+i);\n \n if (onCheck(row)) {\n return true;\n }\n if(onCheck(col)) {\n return true\n } \n }\n\n // check for both left and right cross\n var rightCross = $('.rightCross');\n var leftCross = $('.leftCross');\n\n if (onCheck(rightCross)) {\n return true;\n }\n if(onCheck(leftCross)) {\n return true\n } \n\n return false;\n\n}", "title": "" }, { "docid": "00b9e199d8814c295e5bfb45ddadbfc2", "score": "0.52589065", "text": "function FindUnassignedLocation(grid) {\n var row, col;\n for (row = 0; row < N; row++){\n for (col = 0; col < N; col++){\n if (grid[row][col] == UNASSIGNED){\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "b5cbf673f5a9da714eb8f21a3e47050e", "score": "0.5258066", "text": "function testRex_matrixResoulved_sonEquidimensionales(){\n\t\n\tvar correcto = true;\n\tvar variable1, variable2;\n\n\tvariable1 = [[0],[2],[1]];\n\tvariable2 = [[0,6],[2,5],[1,5]];\n\tif(matrixResoulved_sonEquidimensionales(variable1, variable2)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 1\");\n\t}\n\n\tvariable1 = [[0,2],[2,3],[1,4]];\n\tvariable2 = [[0],[2],[1]];\n\tif(matrixResoulved_sonEquidimensionales(variable1, variable2)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 2\");\n\t}\n\n\tvariable1 = [[0],[2],[1]];\n\tvariable2 = [[0,2],[2],[1]];\n\tif(matrixResoulved_sonEquidimensionales(variable1, variable2) != null){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 3\");\n\t}\n\n\tvariable1 = ['algo',[2],[1]];\n\tvariable2 = [[0],[2],[1]];\n\tif(matrixResoulved_sonEquidimensionales(variable1, variable2) != null){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 4\");\n\t}\n\n\tvariable1 = [[0,2],[9,2],[4,1]];\n\tvariable2 = [[0,4],[2,6],[1,3]];\n\tif(!matrixResoulved_sonEquidimensionales(variable1, variable2)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 5\");\n\t}\n\n\treturn correcto;\n}", "title": "" }, { "docid": "f54ddca87876245e510fa9151ebfb67e", "score": "0.5250931", "text": "contains(x, y) {\n if (x >= this._offsetX && x <= this._offsetX + this._bitmapData.width * this._scaleX\n && y >= this._offsetY && y <= this._offsetY + this._bitmapData.height * this._scaleY) {\n var pixel = this._bitmapData.getAtPosition(Math.round((x - this._offsetX) / this._scaleX), Math.round((y - this._offsetY) / this._scaleY));\n return pixel.a != 0;\n }\n return false;\n }", "title": "" }, { "docid": "a90328d89ec23d9811960058ae0ca238", "score": "0.52483493", "text": "contains(x, y) {\n if (x >= this._offsetX && x <= this._offsetX + this._bitmapData.width * this._scaleX\n && y >= this._offsetY && y <= this._offsetY + this._bitmapData.height * this._scaleY) {\n var pixel = this._bitmapData.getAtPosition(Math.round((x - this._offsetX) / this._scaleX), Math.round((y - this._offsetY) / this._scaleY));\n return pixel.r != 0 && pixel.g != 0 && pixel.b != 0;\n }\n return false;\n }", "title": "" }, { "docid": "779bdafb7e782353555c091e56c4c7ef", "score": "0.52455854", "text": "checkmap() {\n let path = [];\n let tempv2 = [];\n for (let i = 1; i < this._matrixWidth + 1; i++) {\n for (let j = 1; j < this._matrixHeight + 1; j++) {\n if (this._matrix[i][j] !== 50)\n {\n for (let temp1 = 1; temp1 < this._matrixWidth + 1; temp1++) {\n for (let temp2 = 1; temp2 < this._matrixHeight + 1; temp2++) {\n if (i === temp1 && j === temp2)\n continue;\n if (this._matrix[i][j] === this._matrix[temp1][temp2]) {\n tempv2[0] = cc.v2(i, j);\n tempv2[1] = cc.v2(temp1, temp2);\n path = this.find(tempv2[0], tempv2[1], 0);\n if(path.length > 0)\n return path.length;\n }\n }\n }\n }\n }\n }\n return 0;\n }", "title": "" }, { "docid": "fd8c98e9f4aac2519f1c453eaa4b3cbc", "score": "0.52424145", "text": "isValidTile(row, col) {\n return row >= 0 && row < this.config.rows && col >= 0 && col < this.config.cols && this.tiles[row] != undefined && this.tiles[row][col] != undefined;\n }", "title": "" }, { "docid": "3acef2bcfb2a26ffd5dcd878f65e5761", "score": "0.52372", "text": "function checkSolved() {\n\n correctPos = 0;\n correctCubeOrientation(false);\n for (var c=0;c<54;c++) if ((c<9*(Math.floor(c/9)+1)) && (color[c]==colorO[Math.floor(c/9)])) correctPos++;\n correctCubeOrientation(true);\n if (correctPos==54) return true;\n else return false;\n\n}", "title": "" }, { "docid": "c09529d18eb78f5e6df10e642ad7521e", "score": "0.5231008", "text": "check(x, y) {\n if (x >= this.x - off*3 && x <= this.x + off*3 \n && y >= this.y - off*3 && y <= this.y + off*3) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "c180e8677fcf0e0e7e675bcefe6a4a6c", "score": "0.5226486", "text": "function is_sudoku_solved(matrix) \n{\n for (let i=0; i<matrix[0].length; i++) \n {\n if (!validateBlock(i,i,matrix)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "5e8f022866a09511733d3e3197ff6892", "score": "0.5218212", "text": "canMove(where) {\n // go through every element in the piece (4x4)\n for (let j=0; j<this.matrix.length; j++) {\n for (let i=0; i<this.matrix[j].length; i++) {\n let value = this.matrix[j][i];\n let newY = j+this.pos.y;\n let newX = i+this.pos.x+where;\n\n if (this.pos.y < -1\n || (value == 1\n && (newX < 0 || newX >= gridWidth\n || newY < 0 || newY >= gridHeight))\n || (value == 1 && this.pos.y >= 0\n && this.board.matrix[newY][newX].value == 1)) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "785811bd9654cd497453a4f1eda60005", "score": "0.5216975", "text": "isInViewer(x, y) {\n if (this.viewers != undefined && !this.control_all) {\n var width = this.WIDTH / this.cols;\n var height = this.HEIGHT / this.rows;\n var offset = this.canvasOffset();\n var relx = (x - offset.left);\n var rely = (y - offset.top);\n var r = this.rows - Math.floor(rely / height) - 1;\n var c = Math.floor(relx / width);\n if (r != this.row || c != this.col)\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "795251bd79431eb134b747b941d045d0", "score": "0.52140886", "text": "function colFull(prevCol){\n\t\n\tfor(let i=0; i<rows; i++){\n\t\tif(grid[i][prevCol]=='x')\n\t\t\treturn false;\n\t}\n\t\n\treturn true;\n\t\n}", "title": "" }, { "docid": "45b4feef1c91c2d37a4d0a2ed7fd459d", "score": "0.52111554", "text": "function checkMine(fieldID, mines) {\n var fieldIDStr = fieldID;\n var fieldIDArr = fieldIDStr.split(\"_\");\n var x = fieldIDArr[1] * 1;\n var y = fieldIDArr[2] * 1;\n\n //console.log(\"x: \" + x);\n //console.log(\"y: \" + y);\n //console.log(mines);\n\n if (mines[x][y] === 0) {\n return true;\n } else if (mines[x][y] === \"\") {\n return false;\n } else {\n return mines[x][y];\n }\n}", "title": "" }, { "docid": "ea2925dc3290a3bbb8856a8385c5596b", "score": "0.52079105", "text": "checkColumns() {\n if (this.board[0][0] === this.board[1][0] && this.board [1][0] === this.board[2][0] && this.board[0][0]) {\n return this.board[0][0];\n } else if (this.board[0][1] === this.board[1][1] && this.board[1][1] === this.board[2][1] && this.board[0][1]) {\n return this.board[0][1];\n } else if (this.board[0][2] === this.board[1][2] && this.board[1][2] === this.board[2][2] && this.board[0][2]) {\n return this.board[0][2];\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "f8d14e7964d0d2569b86d123a5070458", "score": "0.52055526", "text": "function checkPosition(x, y){\n for (var i=0; i<currentPositions.length; i++){\n if(currentPositions[i][0]===x && currentPositions[i][1]===y){\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "1ef0cf2508435e56de159c8f6212d743", "score": "0.5205109", "text": "isValidPosition (x, y) {\n if (x < 0) return false\n if (y < 0) return false\n if (x >= this.cols) return false\n if (y >= this.rows) return false\n\n return true\n }", "title": "" }, { "docid": "863f47d50eea654b5151414c2263d35c", "score": "0.52049214", "text": "function isInSquare(row, col, number, matrix) {\n var rowStart = row - row % 3;\n var colStart = col - col % 3;\n\n for (var i = rowStart; i < rowStart + 3; i++) {\n for (var j = colStart; j < colStart + 3; j++) {\n if (matrix[i][j] == number)\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "29dffc3706100c6bd29d52f5749e47e9", "score": "0.5203456", "text": "function used_in_row(matrix, num_of_row, num) {\n if (matrix[num_of_row].indexOf(num) == -1) {\n return false;\n }\n else {\n return true;\n }\n}", "title": "" }, { "docid": "ab77c9e52e5e0ac5e14f16703685b223", "score": "0.52005726", "text": "function testRex_matrixResoulved_esNula(){\n\t\n\tvar correcto = true;\n\tvar variable;\n\n\tvariable = [[0],[0],[1]];\n\tif(matrixResoulved_esNula(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 1\");\n\t}\n\t\n\tvariable = [[1,0],[1],[1]];\n\tif(matrixResoulved_esNula(variable) != null){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 2\");\n\t}\n\t\n\tvariable = [[0,00],[0,0],[0,1]];\n\tif(matrixResoulved_esNula(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 3\");\n\t}\n\t\n\tvariable = [[0],[00],[0]];\n\tif(!matrixResoulved_esNula(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 4\");\n\t}\n\t\n\tvariable = [[0,0],[0,0],[00,0]];\n\tif(!matrixResoulved_esNula(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 5\");\n\t}\n\t\n\tvariable = [[0,00],[0,0],[0,(1-1)]];\n\tif(!matrixResoulved_esNula(variable)){\n\t\tcorrecto = false;\n\t\tconsole.log(\"Falla test 6\");\n\t}\n\t\n\treturn correcto;\n}", "title": "" }, { "docid": "11103b625bce8eb1e4bcb3d1fee779af", "score": "0.5200174", "text": "function findBlock(positionX, positionY){\n\t\n\t// retrieve the block from the matrix\n\tvar appBlock = matrixBlock[positionX][positionY];\n\n\t// if the block is not already hit\t\n\tif(appBlock != null){\n\t\treturn true;\n\t}\n\t\n\treturn false;\n}", "title": "" }, { "docid": "fa7d80efc856ddb08a9b6b9fa02e4f5b", "score": "0.5200088", "text": "function positiveMatrix (input) {\n return input.every(item => {\n return Array.isArray(item) && item.every(num => {\n return num > -\n })\n });\n}", "title": "" }, { "docid": "14fd35e9cbcf2506b2e1e56118abdd9c", "score": "0.51952463", "text": "function isBrickAtColRow(col,row){\r\n if(col >=0 && col < brickCol &&\r\n row >=0 && row < brickRows){\r\n var brickIndexUnderCord = rowColToArrayIndex(col, row);\r\n return brickGrid[brickIndexUnderCord];\r\n }else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "95cd8ddff95164d0b381f658db4ca244", "score": "0.51793265", "text": "samePosition(other){\n return this.__row == other.__row && this.__col == other.__col;\n }", "title": "" }, { "docid": "e8ea5e949cec31940834f6f82da333b5", "score": "0.5177888", "text": "checkDiagonals() {\n if (this.board[0][0] === this.board[1][1] && this.board[1][1] === this.board[2][2] && this.board[0][0]) {\n return this.board[0][0];\n } else if (this.board[0][2] === this.board[1][1] && this.board[1][1] === this.board[2][0] && this.board[0][2]) {\n return this.board[0][2];\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "e59ab0697cd29db8f7a49eb3d8883e3c", "score": "0.51770395", "text": "function lineInCoordinatesBlocked(coordinates,sourceLeft,sourceTop,targetLeft,targetTop){if(sourceLeft==targetLeft){// check column (target is above. every time!)\nfor(var i in coordinates){if(coordinates[i].left==sourceLeft&&sourceTop>coordinates[i].top&&targetTop<coordinates[i].top){return true;}}}else if(sourceTop==targetTop&&sourceLeft>targetLeft){// check row to the left\nfor(var j in coordinates){if(coordinates[j].top==sourceTop&&sourceLeft>coordinates[j].left&&targetLeft<coordinates[j].left){return true;}}}else if(sourceTop==targetTop&&sourceLeft<targetLeft){// check row to the right\nfor(var k in coordinates){if(coordinates[k].top==sourceTop&&sourceLeft<coordinates[k].left&&targetLeft>coordinates[k].left){return true;}}}return false;}", "title": "" }, { "docid": "f0e47c9ff5608e0ffe368ccdee772d02", "score": "0.51658505", "text": "checkIfEmpty(coord) \n {\n return this.dataGrid[coord.y][coord.x] == 0;\n }", "title": "" }, { "docid": "79ead9a9deb8dfd7bcd08a2768168ec7", "score": "0.51654243", "text": "function isValid(x,y,n){\r\n if (x<1 || x >8 || y<1 || y> 8 || matrix[x-1][y-1]!=pblank || isCapture(x,y,n)!=true) {\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "cab9869a4b51fc570769fbcd72446c5a", "score": "0.51648504", "text": "function comparateMatrix(){\n let counter = 0;\n let finalMatrix =[\n ['1','2','3'],\n ['4','5','6'],\n ['7','8','']\n ]\n matrix.forEach((row,indexRow)=>{\n row.forEach((element,indexColum)=>{\n if(element == finalMatrix[indexRow][indexColum]){\n counter++\n }\n })\n })\n if(counter == 9){\n return true\n }else{\n return false\n }\n}", "title": "" }, { "docid": "093d52e4c0d4e3dad9421de42a9fc960", "score": "0.51581955", "text": "checkTile(pos) {\n\t\treturn this.tileAtPixelPos(pos);\n\t}", "title": "" }, { "docid": "f980fcd05ef858b9c01018e28913786a", "score": "0.51537156", "text": "fruitExists() {\n for (let r = 0; r < this.ROWS; r++)\n for (let c = 0; c < this.COLUMNS; c++)\n if (this.GRID[r][c] == 3) {\n return true;\n }\n\n return false;\n }", "title": "" }, { "docid": "08bf57af83fcd3a1b2a8208bc4f8eba8", "score": "0.5151919", "text": "isGridOpen(coord) {\n return this.grid[coord[1]][coord[0]] === 0;\n }", "title": "" } ]
d22ac1784172f71ebb4992832724aac6
Get data for suggestions
[ { "docid": "cfccecd5e0bdfcbe17be32abaca8827b", "score": "0.66032654", "text": "_getSuggestionsData(str) {\n\t\tconst searchText = str.trim().toLowerCase() || null;\n\t\t// If new search text is subset of previous search text use previously filtered dataset\n\t\tconst dataStore = (searchText && searchText.includes(this._previousSearchText)) ?\n\t\t\tthis._previousDataSet :\n\t\t\tthis._dataSet;\n\t\tconst out = searchText ?\n\t\t\tdataStore.filter(\n\t\t\t\t({\n\t\t\t\t\t[this._labelKey]: label,\n\t\t\t\t\t[this._valueKey]: value\n\t\t\t\t}) => !this.value.includes(value) &&\n\t\t\t\t`${label}|${this._shouldSerachValue ? value : ''}`.na().includes(searchText.na())\n\t\t\t) : [];\n\t\tthis._previousSearchText = searchText;\n\t\tthis._previousDataSet = out;\n\t\treturn out;\n\t}", "title": "" } ]
[ { "docid": "529a46d1942b407f579b87a149becdff", "score": "0.7471437", "text": "function getSuggestions() {\n let query = document.querySelector(\"input[name='search']\").value;\n if (query !== \"\") {\n fetch(LYRICS_API_BASE + \"/suggest/\" + query)\n .then(fetchSucceeded)\n .then(response => response.json())\n .then(showSuggestions)\n .catch(suggestionFailed);\n }\n }", "title": "" }, { "docid": "8ceffff1edf94b02fbaf74c769d60ee3", "score": "0.7224843", "text": "getSuggestion() {}", "title": "" }, { "docid": "d5b8fa74e8bf4b251090aa7e2d0361f5", "score": "0.6995157", "text": "suggestAttributes () {\n var options = {\n method: 'GET',\n url: this.url + '/admin/luke?numTerms=0&wt=json'\n };\n\n return this.backendSrv.datasourceRequest(options).then(this.mapToTextValue);\n }", "title": "" }, { "docid": "281405b90cefcba78631051e8a08ec2a", "score": "0.6800289", "text": "getMeteorData() {\n return {\n suggestions: Suggestions.find({}, {sort: {startTime: 1}}).fetch()\n }\n }", "title": "" }, { "docid": "c287f71cfd0221d862afe49c87e00577", "score": "0.66245514", "text": "function getSuggestions(req, res, next) {\n const nameRegex = new RegExp('^' + req.query.text , 'i');\n getDB().then((db, err) => {\n if (err) return next(err);\n db.collection('technologies')\n .find({'name' : nameRegex }, {'name' : 1, '_id' : 1})\n .sort({'name' : 1})\n .toArray((arrayError, data) => {\n if (arrayError) return next(arrayError);\n\n // return the data\n res.suggestions = data.map(function(tech){\n return { name: tech.name, id: tech._id };\n });\n db.close();\n return next();\n });\n return false;\n });\n return false;\n}", "title": "" }, { "docid": "500d50a9a4ef312033805c0e96f30d0c", "score": "0.6525369", "text": "function fetchSuggestions() {\n\n\tlet loadStr;\n\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: '/search/fetchResults',\n\t\tsuccess: function (ret) {\n\n\t\t\tglobalRes = ret.matches;\n\t\t\tglobalTags = ret.tags;\n\t\t\tglobalCurrUser = ret.currUser;\n\t\t\tsetVariables();\n\t\t\tdisplayResults(ret.matches);\n\n\t\t\t// calc user message\n\t\t\tif (ret.matches.length !== 0) {\n\t\t\t\tif (ret.matches.length > 1)\n\t\t\t\t\tloadStr = `<p class=\\\"ml-4 mb-3\\\">Showing ${ret.matches.length} suggestions</p>`;\n\t\t\t\telse\n\t\t\t\t\tloadStr = `<p class=\\\"ml-4 mb-3\\\">Showing ${ret.matches.length} suggestion</p>`;\n\t\t\t\t$('#filterStr').html(loadStr);\n\t\t\t} else {\n\t\t\t\t$('#filterStr').html('<h6 class=\\\"ml-4 mb-3\\\">No suggestions at this moment! Try an advanced search.</h6>');\n\t\t\t}\n\t\t},\n\t\terror: function () {\n\t\t\t$('#filterStr').html('<h5 class=\\\"ml-4 mb-3\\\">Error loading suggestions!</h5>');\n\t\t}\n\t});\n}", "title": "" }, { "docid": "fc971e945b23b1e7d5330380da0b8e39", "score": "0.65129364", "text": "function getSuburbData(val) {\r\n xhr.open(\"GET\", url + \"?\" + val.attr(\"name\") + \"=\" + val.val());\r\n xhr.responseType = \"json\";\r\n xhr.onload = function () {\r\n if (this.status == 200) {\r\n //set suggestions based on values returned from db\r\n val.autocomplete({\r\n source: this.response.data,\r\n });\r\n } else {\r\n console.log(\"bad request\");\r\n }\r\n };\r\n xhr.send();\r\n}", "title": "" }, { "docid": "dbe4cab448532d535244f0b841e9bc31", "score": "0.64907736", "text": "function getSuggestions(input) {\n return elasticClient.suggest({\n index: indexName,\n type: DOCUMENT_TYPE,\n body: {\n foodsSuggested: {\n text: input,\n completion: {\n field: \"title_suggest\",\n size: \"10\"\n }\n }\n }\n });\n}", "title": "" }, { "docid": "8515dd0fec9eb7e64b07428e0dc88e89", "score": "0.6482949", "text": "suggest(text, options) {\n return this.suggestWithCost(text, options).map((a) => a.word);\n }", "title": "" }, { "docid": "438552bfa3902b0e6748a718c7fd6842", "score": "0.64007556", "text": "function addAjaxResponseSuggestions(data) {\n // do something with the data here\n //add country to the suggestions array\n data.forEach((country) => {\n suggestions.push(country);\n });\n console.log(\"ajax suggestions: \", suggestions);\n showSuggestions();\n }", "title": "" }, { "docid": "dbffb870fcf55d1524e33ffbd2088361", "score": "0.62917864", "text": "get suggestions(){\n const { institutions } = this.props\n let arr = []\n for (let i of institutions){\n arr.push({id: i.id, value: i.name})\n }\n return arr\n }", "title": "" }, { "docid": "4fe609fc6af1421667b943c3a23fa359", "score": "0.6285154", "text": "function getList() {\n\t\tisLoading(true);\n\t\taxios\n\t\t\t.get(\n\t\t\t\t`https://cors-anywhere.herokuapp.com/http://lgapi-us.libapps.com/1.1/guides?site_id=8488&key=0b8da796b00334ae3471f60e6a10e8c6&search_terms=${searchTerm}&sort_by=relevance&expand=owner&status=1`\n\t\t\t)\n\n\t\t\t.then((res) => {\n\t\t\t\tsetList(res.data);\n\t\t\t\tconsole.log(res.data);\n\t\t\t\tconsole.log(searchTerm);\n\t\t\t})\n\t\t\t.then(() => isLoading(false));\n\t}", "title": "" }, { "docid": "6fe896e1802acd52f7d94eabaa1c247d", "score": "0.6280217", "text": "getSuggestions(query) {\n this.debounce = setTimeout(() => {\n this.keyword = query;\n this.suggestions = this.model.getAutoCompleteList(query);\n this.resultView.renderSuggetsion(this.suggestions, query); \n }, this.debounceDelay);\n }", "title": "" }, { "docid": "ab35847144588640f5c1132e460f74f7", "score": "0.6276417", "text": "handleList(d){\n\t\tvar documents =d.detail.xhr.response;\n\t\tthis.error = '';\n\t\tthis.suggestions = documents?documents.response.docs:[];\n\t}", "title": "" }, { "docid": "a41a5901d19c5f557afcd4904388ab19", "score": "0.6271177", "text": "function getSuggestions(value) {\n console.log(\"getSuggestions: \" + value);\n return handleAddressSearch(value);\n}", "title": "" }, { "docid": "5501027253d0a8b5e848cf1ad418cda0", "score": "0.6237066", "text": "async function getLabels() {\n //This fetches all the suggestion related to campus names, building names etc\n //and push them to suggestions variable\n var link = \"http://localhost:5000/getlabels\";\n await axios.get(link).then(res => {\n for (var i = 0; i < res.data.locationLabels.length; i++) {\n if (!res.data.locationLabels[i].label) {\n continue;\n }\n suggestions.push(res.data.locationLabels[i]);\n }\n });\n}", "title": "" }, { "docid": "62884623feafd3923bfbf95997a6999e", "score": "0.61800027", "text": "function getSuggestions(searchString,type) {\n if(searchString != '' || searchString != null) {\n var fullSearch = 'https://addressright.co.nz/autocomplete?api_key=278227_fie2iuwleqoEfrlu&term=' + searchString;\n $.get(fullSearch, function(data) {\n var suggestions = $.parseHTML(data);\n if(type == 'main')\n var target = $('ul#search-suggestions');\n else if(type == 'nav')\n var target = $('ul#search-suggestions-nav');\n updateSuggestions(target,suggestions,type);\n });\n }\n displaySuggestions(type);\n }", "title": "" }, { "docid": "b2542b3079e96b77111c440bc35cfc29", "score": "0.61616427", "text": "function getAutoCompleteSuggestions(start_chars) {\n\t// registering method for wikipedia opensearch call\n\tclient.registerMethod(\"jsonMethod\", \"https://en.wikipedia.org/w/api.php?action=opensearch&search=\" + start_chars + \"&limit=5&namespace=0&format=json\", \"GET\");\n\tclient.methods.jsonMethod(function(data) {\n\t\tcallbackAutoCompleteSuggestions(data);\n\t});\n}", "title": "" }, { "docid": "69e27d54de6bc492990700ae11794c31", "score": "0.61289126", "text": "function getSuggestion() {\n let url =\n \"https://api.themoviedb.org/3/trending/all/week?api_key=41852c5354f2d366f322d470d71ec51f&page=\" +\n page;\n fetch(url)\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statustext);\n })\n .then(responseJson => displaySuggestion(responseJson));\n}", "title": "" }, { "docid": "73b46ffaf37fdcb46dcb01b96b97c695", "score": "0.6123335", "text": "getData(){\n $.ajax(apiUrl(this.state.query), {\n dataType: \"json\",\n data: {\n origin: \"*\"\n },\n type: \"GET\",\n success: (data) => {\n console.log(data);\n this.setState({\n suggestions: data[1],\n title: data[0],\n description: data[2],\n links: data[3],\n fetchingData: false\n })\n },\n error: error => {\n console.log(error)\n this.setState({\n requestFailed: true,\n fetchingData: false\n })\n }\n });\n }", "title": "" }, { "docid": "ae3f35accef4f4018b0777adb2c142fc", "score": "0.61183906", "text": "onSuggestionsFetchRequested(value) {\n this.setState({\n suggestions: this.getSuggestions(value)\n });\n }", "title": "" }, { "docid": "d30fdb892a54253eb73dabb31f7a466a", "score": "0.61075294", "text": "function getNeedData(respData) {\r\n var gdata = respData;\r\n if (Object.keys(gdata).length === 0) {\r\n return;\r\n }\r\n\r\n vm.result.name = vm.searchInput;\r\n vm.result.queries = gdata.queries;\r\n var items = gdata.items;\r\n for (var i = 0; i < items.length; i++) {\r\n if (!items[i].hasOwnProperty(\"pagemap\") || !items[i].pagemap.hasOwnProperty('cse_image')) {\r\n continue;\r\n }\r\n var itemObj = {};\r\n itemObj.title = items[i].title;\r\n itemObj.htmlTitle = items[i].htmlTitle;\r\n itemObj.hide = false;\r\n // set a file name\r\n var splitChar = \"/\";\r\n itemObj.src = items[i].pagemap.cse_image[0].src;\r\n if (searchService.isSplit(itemObj.src, splitChar)) {\r\n itemObj.fileName = itemObj.src.split(splitChar).pop();\r\n }\r\n\r\n vm.result.items.push(itemObj);\r\n }\r\n }", "title": "" }, { "docid": "40af393e4dca987e0599aceaf8250db3", "score": "0.61047137", "text": "onSuggestionsFetchRequested({ value }) {\n // get the input value and trim them\n const inputValue = value.trim().toLowerCase();\n\n // only search for suggestions if input has more than 2 characters\n if (inputValue.length < 2) {\n this.setState({ suggestions: [] });\n } else {\n // get the events related with the text typed\n fetch(`http://localhost:3005/collector/events?name=${inputValue}`)\n .then((res) => {\n // if status is 204 set the return as an empty array\n if (res.status === 204) {\n return [];\n } else {\n return res.json();\n }\n }).then((result) => {\n this.setState({ suggestions: result });\n });\n };\n }", "title": "" }, { "docid": "b3db8a1b04fc021e85f3983fd0f7d673", "score": "0.6098698", "text": "onSuggestionsFetchRequested({ value }) {\n this.setState({\n suggestions: this.getSuggestions(value)\n });\n }", "title": "" }, { "docid": "8475af749c12d352153d468d779a924e", "score": "0.6097213", "text": "async function getAppData() {\n let suggestions = await firebase.database().ref('hitpause/suggestions').once('value').then(s => s.val());\n let traits = await firebase.database().ref('hitpause/traits').once('value').then(s => s.val());\n return { suggestions, traits };\n }", "title": "" }, { "docid": "5a139c2c3c72c08f91820bd2b909555f", "score": "0.60909235", "text": "function getData(id){\n\t$.ajax({\n\t\turl: 'https://api.upcontent.com/suggestions/' + id,\n\t\ttype: 'get',\n\t\tdataType: 'json',\n\t\theaders: {'Authorization', 'Bearer ' + token},\n\t\tsuccess: function(data){\n\t\t\tvar $selector = $('.page');\n\t\t\t$selector.find('.list-description').append(data.text)\n\t\t\t$selector.find('.article-source').append(data.article_url)\n\t\t\t$selector.find('.article-source').attr('href', data.article_url)\n\t\t\t$selector.find('.article-source').removeAttr('data-id')\n\t\t},\n\t\terror: function(data){\n\t\t\tconsole.log(\"oops!\");\n\t\t}\n\t})\n}", "title": "" }, { "docid": "32f693dc3c35b3c1a2e776c6a498d064", "score": "0.6082035", "text": "function suggestToList(response) {\n return _.map(response.suggestions, function (suggestion) {\n return _.pick(suggestion, ['text', 'magicKey']);\n });\n }", "title": "" }, { "docid": "952c0f7f1d28333f06937744dd102e44", "score": "0.6081045", "text": "function autocomplete(query, process) {\n $.getJSON( \"/api/users/autocomplete/\" + query, function(data) {\n var suggestions = [];\n $.each(data, function(key, val) {\n if(key == \"suggestions\") {\n for (var i = 0; i < val.length; i++) {\n suggestions.push(val[i]);\n };\n }\n });\n process(suggestions);\n });\n}", "title": "" }, { "docid": "cb591f654954acf13cfd5f8787929c2b", "score": "0.6066114", "text": "function callbackAutoCompleteSuggestions(result) {\n\tparsed_result = JSON.parse(result)[1];\n\t// print for debugging - remove this for use in production\n\tconsole.log(parsed_result);\n}", "title": "" }, { "docid": "854c57ccb6242758e1bb006c2d2384cf", "score": "0.60532725", "text": "function getRecommendations () {\n var request = {\n location: defaultCenter,\n radius: 5000,\n };\n var service = new google.maps.places.PlacesService ( map );\n service.nearbySearch ( request, callback );\n map.setCenter ( defaultCenter );\n searchType ( 'Recommendations' );\n }", "title": "" }, { "docid": "ccf262c178225e5dd3b33f89eb03a351", "score": "0.6052625", "text": "function getHelp() {\n if ($scope.HelpList == null) {\n $scope.HelpList = [{ type: \"loading\", value: \"loading autocomplete help.\" }];\n var data = { \"query\": \"*\" };\n $http.post('/DirectoryAPI.asmx/AutocompleteHelp', data, {\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(function (res) {\n var emps = [];\n angular.forEach(res.data.d, function (item) {\n emps.push({ \"type\": item.Type, \"value\": item.Value });\n });\n $scope.HelpList = emps;\n return $scope.HelpList;\n \n });\n }\n else {\n return $scope.HelpList;\n }\n return null;\n }", "title": "" }, { "docid": "54c282d4cec2b49c206ac7fb05fa7135", "score": "0.60165364", "text": "function getResult(title) {\n fetch(`${url}/suggest/${title}`)\n .then((res) => res.json())\n .then((data) => {\n showResult(data);\n });\n}", "title": "" }, { "docid": "aded1fb63a0ac2d13496467a55e5815f", "score": "0.6010756", "text": "onSuggestionsFetchRequested(value) {\n\n\t this.setState({\n\t suggestions: this.getSuggestions(value.value)\n\t });\n\t}", "title": "" }, { "docid": "68acf73d6c17318e9a17bc4654996de8", "score": "0.5995357", "text": "function suggestPlaces() {\n const searchTxt = document.getElementById('searchTxt').value;\n if (searchTxt!=\"\") {\n const suggestionBox = document.getElementById('suggestion');\n const request = new HttpClient(url1);\n request.get(\"?q=\"+searchTxt).then(function(response) {\n suggestionBox.innerHTML = \"\";\n for (i in response) {\n suggestionBox.innerHTML += '<span onclick=\"selectSuggestion(this.innerHTML)\">' + response[i].location + '</span>'; \n }\n });\n }\n else {\n document.getElementById('suggestion').innerHTML=\"\"; \n }\n\n }", "title": "" }, { "docid": "ba91696666622f056eed409faebbb9d2", "score": "0.5987791", "text": "onSuggestionsFetchRequested ({value}) {\n this.setState({\n suggestions: getSuggestions(value)\n });\n }", "title": "" }, { "docid": "a7499fa36214f21c516481dd45ead726", "score": "0.59706956", "text": "function populateSuggestions(results, suggest) {\n suggest(\n _(results).select(function (r) { return r.name; }).map(suggestionFromResult)\n );\n }", "title": "" }, { "docid": "9d5156832629109c79aead1e0d386cc6", "score": "0.59653795", "text": "constructor() {\n /**\n * Returns the suggested brands.\n * @member {module:models/Suggestion} brand_suggestions\n */\n this.brand_suggestions = undefined;\n\n /**\n * Returns the suggested categories.\n * @member {module:models/Suggestion} category_suggestions\n */\n this.category_suggestions = undefined;\n\n /**\n * Returns the suggested content.\n * @member {module:models/Suggestion} content_suggestions\n */\n this.content_suggestions = undefined;\n\n /**\n * Returns the suggested custom suggestions.\n * @member {module:models/Suggestion} custom_suggestions\n */\n this.custom_suggestions = undefined;\n\n /**\n * Returns the suggested products.\n * @member {module:models/Suggestion} product_suggestions\n */\n this.product_suggestions = undefined;\n\n /**\n * The query phrase to search for.\n * @member {String} query\n */\n this.query = undefined;\n }", "title": "" }, { "docid": "28daa5dd94150a82df832b043b5f092f", "score": "0.5962974", "text": "onSuggestionsFetchRequested({ value }) {\n this.props.fetchSuggestions(value);\n }", "title": "" }, { "docid": "a85a2077d79ce391cc45cec4276c61ae", "score": "0.5958273", "text": "placeSuggestions () {\n if (!this.focused) {\n return []\n }\n let suggestions = []\n if (this.localModel.nameIsCoord()) {\n const coords = this.localModel.getCoordsFromName()\n const rawCoordinatesPlace = new Place(coords[0], coords[1], this.localModel.placeName, { properties: { layer: 'rawCoordinate' } })\n rawCoordinatesPlace.rawCoordinate = true\n suggestions.push(rawCoordinatesPlace)\n }\n suggestions = suggestions.concat(this.localModel.suggestions)\n return suggestions\n }", "title": "" }, { "docid": "e543f291df4a22a507d05b0fadb6d2a6", "score": "0.59261996", "text": "function gotContent(data) { //FUNCTION REQ TO SHOW OPTIONS IN DYM\r\n console.log(data);\r\n optionsAvailable = data.query.search;\r\n alltitles = []\r\n optionsAvailable.forEach(element => {\r\n alltitles.push([element['title'], element['pageid']])\r\n })\r\n console.log(alltitles)\r\n allelements(alltitles)\r\n}", "title": "" }, { "docid": "f8494f07289014474ce594b602b84e81", "score": "0.5921671", "text": "async function getResults(e){\n e.preventDefault();\n\n const searchInput = document.querySelector('.recipe-input');\n const searchQuery = searchInput.value;\n let dataArr = await getData(searchQuery);\n\n prepareData(dataArr.hits);\n}", "title": "" }, { "docid": "446623ab5a588fc86718976611e48ddb", "score": "0.59193665", "text": "get suggestionURL() { return namespace(this).suggestionURL; }", "title": "" }, { "docid": "eb1552d961093becabdc72457517197a", "score": "0.59133494", "text": "async function fetchUsers() {\n const response = await fetch('/api/users/', {\n method: 'get',\n headers: { 'Content-Type': 'application/json' }\n });\n \n if (response.ok) {\n const data = await response.json();\n suggestUser(data); // populate suggestions\n } else {\n alert(response.statusText);\n }\n}", "title": "" }, { "docid": "c588406426f4415126c814fba3eb6ccc", "score": "0.5908596", "text": "onSuggestionsFetchRequested({ value })\n {\n this.setState({\n suggestions: this.getSuggestions(value)\n });\n }", "title": "" }, { "docid": "9b0166b4419a7d5909adb55de8e90dad", "score": "0.5907236", "text": "function update_suggestions(data) {\n var $target = $target, \n targetText = $target.text(),\n d = $target.editable('getCaretXY'),\n show_type = getTranslationMode(),\n count = 0,\n list = $('<dl/>');\n \n if (!data || !data.nbest) return;\n for (var i = 0; i < data.nbest.length; i++) {\n var match = data.nbest[i];\n // XXX: If prediction came from click in the middle of a token, then the\n // sentence is not updated; since the following condition does not match:\n // The prefix in the sentence does not match the prefix in the prediction.\n if (targetText.substr(0, d.pos) === match.target.substr(0, d.pos)) {\n if (show_type === match.author) {\n $target.editable('setText', match.target, match.targetSegmentation);\n\n if (match.priorities) {\n update_word_priorities($target, match.priorities);\n }\n \n // requests the server for new alignment and confidence info\n var query = {\n source: $source.editable('getText'),\n target: match.target,\n }\n if ($('#opt-alignments').is(':checked')) {\n $target.getAlignments(query);\n }\n if ($('#opt-confidences').is(':checked')) {\n $target.getConfidences(query);\n }\n } else if ($('#opt-suggestions').is(':checked')) {\n list.append($('<dt/>').text(match.author));\n list.append($('<dd/>').text(match.target.substr(d.pos)));\n count++;\n }\n }\n }\n\n if (count > 0 && $('#btn-epen > img').data('mode') !== 'epen') {\n var ofs = 50, pos = $target.offset(), siz = { width: $target.width() + ofs, height: $target.height() + ofs*2 };\n $('#suggestions').css({top: d.caretRect.bottom, left: d.caretRect.left - siz.width/2, visibility: 'visible'}).html(list);\n //$target.editable('setText', target, targetSegmentation);\n }\n else {\n $('#suggestions').css({'visibility': 'hidden'}).html('');\n }\n }", "title": "" }, { "docid": "204b41072b14b1273f6fdb31958a9987", "score": "0.5896212", "text": "function search(){\n const searchLink = `${apiUrl}/suggest/${searchItem.value}`;\n fetch(searchLink)\n .then(response => response.json())\n .then(songs => showResult(songs.data.slice(0,10)))\n .catch(e => {});\n }", "title": "" }, { "docid": "5043c7cd6e57b526d9e4e8b86cadbe69", "score": "0.5865268", "text": "function updateSuggestionsDisplay(suggestions,type) {\n var suggestionsArray = [];\n const RETURN_LIMIT = 5; // Limit the number of returned suggestions\n // Iterate and store each individual search response\n if(type=='main') {\n $.each($('ul#search-suggestions li'), function(index,item) {\n if(index < RETURN_LIMIT) {\n suggestionsArray.push('<li class=\"suggestion-result\" data-id=\"'+ item.id +'\">' + item.innerHTML + '</li>');\n }\n });\n } else if(type == 'nav') {\n $.each($('ul#search-suggestions-nav li'), function(index,item) {\n if(index < RETURN_LIMIT) {\n suggestionsArray.push('<li class=\"suggestion-result\" data-id=\"'+ item.id +'\">' + item.innerHTML + '</li>');\n }\n });\n }\n return suggestionsArray;\n }", "title": "" }, { "docid": "da05c61a04646b7b723c443236ab301f", "score": "0.5864836", "text": "constructor() {\n /**\n * The sorted list of suggested brands. This list can be empty.\n * @member {Array.<String>} brands\n */\n this.brands = undefined;\n\n /**\n * The sorted list of suggested categories. This list can be empty.\n * @member {Array.<module:models/SuggestedCategory>} categories\n */\n this.categories = undefined;\n\n /**\n * The sorted list of suggested content. This list can be empty.\n * @member {Array.<module:models/SuggestedContent>} content\n */\n this.content = undefined;\n\n /**\n * The sorted list of suggested custom suggestions. This list can be empty.\n * @member {Array.<String>} custom_suggestions\n */\n this.custom_suggestions = undefined;\n\n /**\n * The sorted list of suggested products. This list can be empty.\n * @member {Array.<module:models/SuggestedProduct>} products\n */\n this.products = undefined;\n\n /**\n * A list of suggested phrases. This list can be empty.\n * @member {Array.<module:models/SuggestedPhrase>} suggested_phrases\n */\n this.suggested_phrases = undefined;\n\n /**\n * A list of suggested terms. This list can be empty.\n * @member {Array.<module:models/SuggestedTerms>} suggested_terms\n */\n this.suggested_terms = undefined;\n }", "title": "" }, { "docid": "7dc78331b569bbeffe2b0e34a09c2592", "score": "0.5854933", "text": "function getValue() {\n\tvar textItem = document.getElementById(\"suggestions\");\n\treturn textItem.value;\n}", "title": "" }, { "docid": "5ee8bec71656f2a2d78e013b22296a94", "score": "0.58510655", "text": "function viewSuggestions() {\n \tif (localStorage.getItem(\"currUsername\") === null) {\n \t location.href=\"index.html\";\n \t}\n \tvar t = decodeURIComponent(location.search.substring(1));\n \tconsole.log(t);\n var returnArray = [];\n var boxSugRef = myDatabase.child(\"suggestion boxes/\"+localStorage.getItem(\"currUsername\")+\":\"+t+\"/suggestions\");\n boxSugRef.once(\"value\").then(function(snapshot) {\n snapshot.forEach(function(childSnapshot) {\n var suggestion = childSnapshot.child(\"suggestion\").val();\n returnArray.push(suggestion);\n });\n createSuggestionTable(t,returnArray);\n })\n console.log(returnArray);\n }", "title": "" }, { "docid": "904ced19b936a8501cedc7f3748ec867", "score": "0.5843056", "text": "function obtainData () {\n\trequest({\n\t\n\t\t\turl: String(\"http://ratings.food.gov.uk/enhanced-search/^/^/Type/7844/^/\"+ String(pageIndex) +\"/5000/json\"),\n\t\t\tmethod: \"GET\", \n\t\t\theaders: {\"x-api-version\": 2 }\n\t\t\t\n\t\t\t}, function(error, response, body) {\n\t\t\tvar res = {};\n\t\t\tif (error) {\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsingleEntry = JSON.parse(body); \n\t\t\t\twriteToJSON (singleEntry, main);\t\n\t\t\t};\n\t\t}\n\t);\n}", "title": "" }, { "docid": "703702b053f9b030c2b6d822dc6f255b", "score": "0.58378327", "text": "function getSearchOptions(data) {\n var optionsData = []\n if (data && data.length > 0) {\n for (var i = 0; i < data.length; i++) {\n optionsData.push(data[i][NAME_ATTR]);\n }\n console.log(optionsData.length)\n }\n initSearchBox(optionsData);\n }", "title": "" }, { "docid": "6848da230f39650597197024de60899c", "score": "0.5829485", "text": "function getDataFromApi(searchTerm, callback) {\n const settings = {\n q: searchTerm,\n from: '0',\n to: '12',\n app_id: 'cc3ee280',\n app_key: 'e93e9043178ce874680226c6ce8acc49',\n };\n $.getJSON(RECIPE_SEARCH_URL, settings, callback);\n}", "title": "" }, { "docid": "4f0213b9da73ebc6cd05807d4f0a5db4", "score": "0.58168674", "text": "function getTextCompletionQuestions() {\n \n $.get(\"/api/textcompletionq\", function(data) {\n textcompletionquestions = data;\n textcompletionquestionsoriginal = data;\n \n //loop through questions to get the correct answers\n displayQuestions();\n getCorrectAnswers();\n });\n }", "title": "" }, { "docid": "55458310351c4d7189b5435c80db84d6", "score": "0.58081794", "text": "function onResult(data) {\n setSearchResult(data.items || data.suggestions || data.results.items);\n }", "title": "" }, { "docid": "795e978d1abc2cd295c50749aa98d2c1", "score": "0.5798186", "text": "function autoComplete(query){\n\n $.ajax({\n url: \"https://api.tomtom.com/search/2/geocode/\" + query + \".json\",\n method: \"GET\",\n data:{\n key: \"begalCOpySZrKc5PeNb372wgWaNLv7oq\",\n limit: \"5\"\n },\n success: function (data) {\n console.log(data)\n if (data.results.length !== 0){\n $(\"#item-list\").append(\n '<ul class=\"\" style=\"display:block; position:absolute;\">'\n );\n for (var i = 0; i < data.results.length ; i++) {\n $(\"#search ul\").append(\"<li data-lat='\" + data.results[i].position.lat + \"' data-lon='\" + data.results[i].position.lon + \"'>\" + data.results[i].address.freeformAddress + \"</li>\");\n }\n $(\"#item-list\").append(\"</ul>\");\n }\n },\n \"error\": function () {\n alert(\"error\");\n } //end error\n }); //end ajax\n\n } // end function autoComplete", "title": "" }, { "docid": "e1f0af643b4c50909ef481ca149896d9", "score": "0.5778722", "text": "function getData(searchTerm, callback) {\n // Create variable to hold the apiUrl, an object for the query parameters and requirements.\n var apiUrl = 'https://www.googleapis.com/youtube/v3/search';\n var query = {\n q: searchTerm,\n part: 'snippet',\n key: 'AIzaSyBMm-e7xij-SURbVFOzlT8sKPWPhxxoUSU',\n maxResults: 25\n };\n // Call the jQuery $.getJSON to make the ajax call.\n $.getJSON(apiUrl, query, successCall);\n}", "title": "" }, { "docid": "926a7594923acf26485f8f97aead914e", "score": "0.57711434", "text": "function getData() {\r\n\t\t\tclearFilters();\r\n\t\t\tlistings();\r\n\t\t}", "title": "" }, { "docid": "9741e7691ff55b9653eef085ff661ebd", "score": "0.57695067", "text": "getInfo () {\n\n axios.get(`${API_URL}/schools/?field=${this.state.query}&n=10`) //the prefix/query/field should make the suggestions match the query (hopefully)\n .then((response) => {\n console.log(response);\n this.setState({\n suggested_schools: response.data // API returns an object named api_name_object; axios returns an object named data\n // =>api_name_object.data \n })\n })\n .catch(() => {\n console.log();\n this.setState({ error: true })\n })\n }", "title": "" }, { "docid": "f6aaaad0ba044c2f91bf429b622252eb", "score": "0.57691073", "text": "async function searchSongs(term) {\n const res = await fetch(`${apiURL}/suggest/${term}`);\n const data = await res.json();\n\n console.log(data);\n\n showData(data);\n}", "title": "" }, { "docid": "fa18a8f39d749fba2baf01aab548125a", "score": "0.5761324", "text": "function fetchSearchSuggestions(searchQuery) {\n let shuffled = _.shuffle(data);\n return _.slice(shuffled, 0, 2);\n}", "title": "" }, { "docid": "0586042367dee2eb9671815a2cde350c", "score": "0.5758828", "text": "function getSuggestions(inputValue) {\n suggestions = [];\n //if value is empty, empty suggestions & hide suggestionsContainer\n if (inputValue == \"\") {\n resetSuggestions();\n return;\n }\n //loop over all countries\n for (var i = 0; i < countries.length; i++) {\n //split country names with more than 1 word\n var splitCountryName = countries[i].split(\" \");\n\n //loop over each individual word of a name\n for (var j = 0; j < splitCountryName.length; j++) {\n //if input matches the start of a country (any word of the name)\n if (\n splitCountryName[j]\n .toLowerCase()\n .startsWith(inputValue.toLowerCase())\n ) {\n //add country to the suggestions array\n suggestions.push(countries[i]);\n }\n }\n //if array contains 4 elements stop searching\n if (suggestions.length > 3) {\n break;\n }\n }\n showSuggestions();\n }", "title": "" }, { "docid": "9b041109367eac9d90531fdfa27c7093", "score": "0.57540065", "text": "function getPersonsEmails() {\n createEventLogic.getPersonsEmails().then(function (response) { \n\n \n persondetails = response.data;\n \n// var userdata=[];\n \n \n\n\n\n// $.each( persondetails, function( key, value ) {\n \n\n// userdata.push(value.name);\n// }); \n \n $(\"#demo-input-local\").tokenInput(persondetails);\n\n\n\n\n //alert(JSON.stringify(userdata));\n// $( \"#demo-input-local\" ).autocomplete({\n// source: userdata\n// });\n\n\n appLogger.log(\"persons emails\" + JSON.stringify(persondetails));\n }, function (err) {\n appLogger.error('ERR', err);\n });\n }", "title": "" }, { "docid": "e624cf5c1030036b328632a7732182b3", "score": "0.57536787", "text": "function doAutocomplete(request){\n\tvar db = new TenantDatabase();\n\tvar issueArray = db.select(\"SELECT id , id as value, id||' - '||subject as label FROM ib_issues WHERE project_id='\"+request.pid+\"' AND id!='\"+request.issue_id+\"' AND (lower(id||' - '||subject) LIKE '%\"+request.term.toLowerCase()+\"%')\");\n\tvar displayList = [];\n\tfor (var i = 0; i < issueArray.data.length; i++) {\n\t\tdisplayList.push({\n\t\t\tid : issueArray.data[i].id,\n\t\t\tvalue : issueArray.data[i].value,\n\t\t\tlabel : issueArray.data[i].label\n\t\t});\n\t}\n\tvar jsonString = ImJson.toJSONString (displayList);\n\tvar response = Web.getHTTPResponse ();\n\tresponse.setContentType (\"application / json; charset = UTF-8\");\n\tresponse.sendMessageBodyString (jsonString);\n\t//return displayList;\n}", "title": "" }, { "docid": "7c122b194e6fcc9d8e39c48004fd171f", "score": "0.57516044", "text": "function getDataFromApi (searchTerm, callback) {\n\t\tvar object = {\n\t\t\tpart: 'snippet',\n\t\t\tkey: 'AIzaSyA1irBtJU79pBNkNC8g0HplNyy0Cd4TAhk',\n\t\t\tq: searchTerm\n\t\t}\n\n\t\t$.getJSON(endpoint, object, callback);\n\t}", "title": "" }, { "docid": "5a0ddbd933237ddc57682d63c23b49f7", "score": "0.5751564", "text": "static renderSuggestions(suggestions, { getItemProps, inputValue, highlightedIndex }) {\n return suggestions.map((suggestion, index) =>\n MUIPlacesAutocomplete.renderSuggestion(\n suggestion,\n { getItemProps, inputValue, isHighlighted: index === highlightedIndex },\n ))\n }", "title": "" }, { "docid": "1ad6f4498e361b0b83f5017223975799", "score": "0.57504874", "text": "get autocompleteOptions() {\n return this._searchText.pipe(\n map((txt) => txt.replace(\"name:\", \"\")),\n filter((txt) => txt.length),\n debounceTime(this.debounceInterval),\n distinctUntilChanged(),\n switchMap((txt) => this.autocomplete(txt))\n );\n }", "title": "" }, { "docid": "bca30354f21316ce0427f48efa03e339", "score": "0.5744982", "text": "function getDataFromApi(searchTerm, callback, endpointUrl) {\n var query = {\n \tpart: 'snippet',\n \tkey: 'insert your key here',\n q: searchTerm,\n }\n $.getJSON(endpointUrl, query, callback);\n}", "title": "" }, { "docid": "2987512c1309ff9cca7e480bbbeae359", "score": "0.5741675", "text": "getSuggestionValue(suggestion) {\n return suggestion.name;\n }", "title": "" }, { "docid": "2987512c1309ff9cca7e480bbbeae359", "score": "0.5741675", "text": "getSuggestionValue(suggestion) {\n return suggestion.name;\n }", "title": "" }, { "docid": "57633bbae16ac4f27207b2fde8d83a3a", "score": "0.5741279", "text": "function Suggestions(list, type)\n{\n\t// available types of suggestion\n\t// DIRECT means - suggestions are fetched for the mentioned term from server\n\tthis.DIRECT = 1;\n\t// FILTERED means - suggestions are extracted from a superset of cache and more can be fetched from the server\n\tthis.FILTERED = 2;\n\t// COMPLETE means - all suggestions are fetched for the mentioned term from server and ***NO MORE*** suggestions will come if we append any character on it\n\tthis.COMPLETE = 3;\n\n\tthis._list = null;\n\tthis.list(list, type);\n\n\treturn this;\n}", "title": "" }, { "docid": "5b9af0afd28dbd273fc53d7932d70f02", "score": "0.574038", "text": "function get_person_suggestions(people_getter, last, operators, autocomplete_operator) {\n if ((last.operator === \"is\" && last.operand === \"dm\") || last.operator === \"pm-with\") {\n // Interpret \"is:dm\" or \"pm-with:\" operator as equivalent to \"dm:\".\n last = {operator: \"dm\", operand: \"\", negated: false};\n }\n\n const query = last.operand;\n\n // Be especially strict about the less common \"from\" operator.\n if (autocomplete_operator === \"from\" && last.operator !== \"from\") {\n return [];\n }\n\n const valid = [\"search\", autocomplete_operator];\n let invalid;\n\n switch (autocomplete_operator) {\n case \"dm-including\":\n invalid = [{operator: \"stream\"}, {operator: \"is\", operand: \"resolved\"}];\n break;\n case \"dm\":\n case \"pm-with\":\n invalid = [\n {operator: \"dm\"},\n {operator: \"pm-with\"},\n {operator: \"stream\"},\n {operator: \"is\", operand: \"resolved\"},\n ];\n break;\n case \"sender\":\n case \"from\":\n invalid = [{operator: \"sender\"}, {operator: \"from\"}];\n break;\n }\n\n if (!check_validity(last, operators, valid, invalid)) {\n return [];\n }\n\n const persons = people_getter();\n\n const prefix = Filter.operator_to_prefix(autocomplete_operator, last.negated);\n\n const person_highlighter = make_person_highlighter(query);\n\n const objs = persons.map((person) => {\n const terms = [\n {\n operator: autocomplete_operator,\n operand: person.email,\n negated: last.negated,\n },\n ];\n\n if (\n last.negated &&\n (autocomplete_operator === \"dm\" || autocomplete_operator === \"pm-with\")\n ) {\n // In the special case of \"-dm\" or \"-pm-with\", add \"is:dm\" before\n // it because we assume the user still wants to narrow to direct\n // messages.\n terms.unshift({operator: \"is\", operand: \"dm\"});\n }\n\n return {\n description_html: prefix,\n search_string: Filter.unparse(terms),\n is_person: true,\n user_pill_context: highlight_person(person, person_highlighter),\n };\n });\n\n return objs;\n}", "title": "" }, { "docid": "03418757fa91fa78350628645f5c58b9", "score": "0.5739485", "text": "async function apiData() {\n const response = await fetch(\n `https://www.dictionaryapi.com/api/v3/references/thesaurus/json/${word}?key=${process.env.API_KEY}`\n );\n const data = await response.json();\n return data[0].shortdef;\n}", "title": "" }, { "docid": "d6bb8470436d81bfe63dc3b02cae1eea", "score": "0.5723832", "text": "loadOptions(inputValue) {\n if (inputValue.length < 2) {\n return Promise.resolve([]);\n }\n return axios.get('/api/autocomplete/', {\n params: {\n query: inputValue\n }\n })\n .then(function (response) {\n return response.data.suggestions.map(\n s => ({'value': s.name, 'label': s.name}));\n })\n .catch(function (error) {\n return [];\n });\n }", "title": "" }, { "docid": "9d6b57a562d0d7bdd2e5c0d5d3012075", "score": "0.5720203", "text": "function getDataFromApi(searchTerm, callback) {\n \t const request = {\n \t\tpart: 'snippet',\n \t\tkey: 'AIzaSyBYaKcbWdhwz6AZcyejQ835sSUiTWR8BAo',\n \t\tq: searchTerm,\n \t\tmaxResults: 25\n \t}\n $.getJSON(thinkfulTubeSearchURL, request, callback); \n}", "title": "" }, { "docid": "5d2df965d6ab6b327570540aa3dc03ad", "score": "0.56949717", "text": "function getSuggestionValue(suggestion) {\n return suggestion.name;\n}", "title": "" }, { "docid": "1630ba3ef319385d4169b9faca5f6beb", "score": "0.56942517", "text": "function dynamicloadforsuggestion(type) {\r\n\r\n $.ajax({\r\n url: idssearch_api + $(\".searchkeyword\").val(),\r\n type: 'GET',\r\n headers: {\r\n \"content-type\": 'application/json',\r\n \"Authorization\": \"Token \" + localStorage.wutkn\r\n },\r\n success: function(data) {},\r\n error: function(data) {\r\n $(\".loadericonsearch\").hide();\r\n $(\".suggestionlist\").empty().append('<div class=\"col-md-12 col-sm-12 col-xs-12 pr0\"><center><img src=\"img/assets/nodata.svg\" style=\"width:40%\"></center></div>');\r\n\r\n }\r\n }).done(function(data) {\r\n\r\n $(\".suggestionlist\").empty();\r\n\r\n if (data.first_name == undefined || data.first_name == \"undefined\") {\r\n\r\n $(\".suggestionlist\").empty().append('<div class=\"col-md-12 col-sm-12 col-xs-12 pr0\"><center><img src=\"img/assets/nodata.svg\" style=\"width:40%\"></center></div>');\r\n\r\n $(\".suggestioncount\").show().text(\"(\" + $(\".suggestionlist .resultsusers\").length + \")\");\r\n $(\".loadericonsearch\").hide();\r\n\r\n } else {\r\n\r\n // var data = dataJson['results'][i];\r\n\r\n var dyn_img = (data.userprofile.profile_pic == null) ? \"img/assets/coupleindex.svg\" : data.userprofile.profile_pic;\r\n\r\n var gender = (data.userdetails.gender == \"Male\") ? \"Mr. \" : \"Ms. \";\r\n var liked = (data.is_liked == true) ? \"actionactive\" : \"\";\r\n var shortlisted = (data.is_shortlisted == true) ? \"actionactive\" : \"\";\r\n var ignored = (data.is_ignored == true) ? \"actionactive\" : \"\";\r\n var usercity = (data.user_address == null) ? \"Not Mentioned\" : data.user_address.city.name;\r\n\r\n $(\".suggestionlist\").append('<div class=\"col-lg-2 col-md-2 col-sm-4 col-xs-6 resultsusers\"><div class=\"card card-2 text-center heightauto\"><div class=\"card__top\"><a class=\"pointer\" onclick=\"gotouserprofile(' + 1 + ',' + data.id + ')\" target=\"_blank\" style=\"background: url('+dyn_img+') top center / cover no-repeat;display: block;height: 140px;\"></a></div><div class=\"card__body p10\"><p class=\"username pointer newmatchusername1' + data.id + '\" onclick=\"gotouserprofile(' + 1 + ',' + data.id + ')\">' + gender + ' ' + data.first_name + ' ' + data.last_name + '</p><p class=\"livesin\">Lives in <span class=\"spanlivesin\">' + usercity + '</span></p></div><div class=\"card__bottom text-center ptb3\"><div class=\"card__action tooltipsection\"><a class=\"pointer social-icon social-icon--dribbble\" onclick=\"acceptanddenyusers(this,' + data.id + ',' + 2 + ',' + 1 + ')\"><i class=\"fa fa-heart hoverpink accepticon interests ' + liked + '\" aria-hidden=\"true\"></i><div class=\"shortlisttooltip\">Send Interest</div></a></div><div class=\"card__action tooltipsection\"><a class=\"pointer social-icon social-icon--dribbble\" onclick=\"acceptanddenyusers(this,' + data.id + ',' + 0 + ',' + 1 + ')\"><i class=\"fa fa-star hoverpink accepticon interests ' + shortlisted + '\" aria-hidden=\"true\"></i><div class=\"interesttooltip\">Shortlist</div></a></div><div class=\"card__action tooltipsection\"><a class=\"pointer social-icon social-icon--dribbble\" onclick=\"acceptanddenyusers(this,' + data.id + ',' + 1 + ',' + 1 + ')\"><i class=\"fa fa-thumbs-down hoverblack rejecticon reject ' + ignored + '\" aria-hidden=\"true\"></i><div class=\"declinetooltip\">Decline</div></a></div></div></div></div>');\r\n\r\n $(\".suggestioncount\").show().text(\"(\" + $(\".suggestionlist .resultsusers\").length + \")\");\r\n $(\".loadericonsearch\").hide();\r\n } //else cond ends here\r\n\r\n\r\n });\r\n\r\n} //list drivers fn ends here", "title": "" }, { "docid": "e1511347513b64affd1bc44eb5b905a2", "score": "0.5687964", "text": "renderSuggestions(query, suggestions, searchId) {\n const list = this.element.querySelector('.autocomplete__suggestions');\n\n // Using a token-like system to make sure only the newest query is resolved\n if (searchId !== this.searchId) {\n return;\n }\n\n const directSuggestions = [];\n const otherSuggestions = [];\n\n //Using regex and high-order functions for returning seaches based on index\n const searchRegex = new RegExp(\"^\" + query, \"i\");\n suggestions.forEach(currentSuggestion => {\n if (searchRegex.test(currentSuggestion)) {\n directSuggestions.push(currentSuggestion);\n } else {\n otherSuggestions.push(currentSuggestion);\n }\n });\n list.innerHTML = \"\";\n suggestions = directSuggestions.concat(otherSuggestions);\n suggestions.forEach(currentSuggestion => {\n const newLi = document.createElement(\"li\");\n newLi.classList.add(\"autocomplete__suggestion\");\n let innerHTML = currentSuggestion;\n const reg = new RegExp(query, 'gi');\n innerHTML = innerHTML.replace(reg, str => '<em>' + str + '</em>');\n newLi.innerHTML = innerHTML;\n list.appendChild(newLi);\n });\n\n // TODO: implement the rest of this method\n // Some things to consider:\n //\n\n // X2. `getSuggestions` will return ANY store that contained the query in alphabetical\n // order, you might want to consider ordering the returned suggestion by the index\n // of the match so that , \"Les Foo\", \"Les Nouvelles\" is considered a more direct match to the query\n // \"les\" than \"Charles David\", despite \"C\" being alphabetically before \"L\"\n\n\n // 1. Each item being added to `list` will need to have the class \".autocomplete__suggestion\"\n // to benefit from the styling applied in css/modules/autocomplete.less\n\n //\n // 3. You might want to wrap the bit of the suggestion that matches the query with an <em>\n // element and then add some CSS to style it. An example would be turning \"Les Nouvelles\"\n // into \"<em>Les</em> Nouvelles\" for the query \"les\".\n }", "title": "" }, { "docid": "b59ea700d9980c6721a64d75c60b0036", "score": "0.5686516", "text": "function librosPorAutor(autor){\n const URL=`http://openlibrary.org/search.json?author=${autor}`;\n request.get(URL, (error, request, body)=>{\n if(request.statusCode===200){\n JSON.parse(body)\n .docs\n .map((data)=>\n console.log(data.title_suggest)\n );\n\n }\n })\n}", "title": "" }, { "docid": "66f7409224a1fdbce972fe4b7ec53520", "score": "0.56765896", "text": "function getSuggestions(nearby, empty, campuses) {\n\t// send the get request\n\t$.get(rootURL + 'labs/filter/', {\n\t\t\t'nearby': nearby,\n\t\t\t'empty': empty,\n\t\t\t'campusesUnselected[]': campuses,\n\t\t\t'latitude': userLatitude,\n\t\t\t'longitude': userLongitude\n\t\t})\n\t\t.done(function (data) {\n // hide the loading icon when ready\n $('#busyAnimation').hide();\n\t\t\t// if successful, save the data received\n\t\t\tsuggestions = data;\n\t\t\t// if at least one room fits the criteria\n\t\t\tif (suggestions.length > 0) {\n\t\t\t\t// and an index to each of the JSONs\n\t\t\t\tfor (var i = 0; i < suggestions.length; i++) {\n\t\t\t\t\tsuggestions[i].index = i;\n\t\t\t\t}\n\n\t\t\t\t// load the first suggestion\n\t\t\t\tcurrentChoice = suggestions[0];\n\t\t\t\tloadChoice();\n if (suggestions.length==1){\n // don't remind the user they can swipe if they can't\n clearTimeout(idleReminder);\n }\n\t\t\t} else {\n\t\t\t\t$('.arrow').addClass('disabled');\n\t\t\t\talert('No rooms available fit that criteria. Try again. ');\n\t\t\t}\n\t\t})\n .fail(function(data){\n alert('Unable to get suggestions. \\n\\nCheck your internet connection and refresh the page. ');\n });\n // bring up the loading icon\n $('#busyAnimation').show();\n}", "title": "" }, { "docid": "132f28d82e37c9ce776f8e6e2695dfef", "score": "0.56718117", "text": "static getAllData(name) {\n // Last.fm AJAX Artist search settings\n var lastFmSearch = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=\" + name + \"&api_key=d4a380aaf885c9d212b299849e585e3f&format=json\",\n \"method\": \"POST\",\n };\n // Discogs AJAX artist search settings\n var discogsArtistSearch = {\n \"async\": true,\n \"method\": 'GET',\n \"url\": \"https://api.discogs.com/database/search?title=\" + name + \"&type=artist&filter_anv=0&key=vvmuhSnCQoHKeXcTQCyv&secret=fxEdBZefCGdxmBWQyJwjkhxoTFcyMmYF\",\n dataType: 'jsonp',\n crossDomain: true\n };\n var search = [lastFmSearch, discogsArtistSearch];\n return search;\n }", "title": "" }, { "docid": "06dcfed15c67390b605f102066a45ca5", "score": "0.5671601", "text": "constructor() {\n /**\n *\n * @member {Array.<module:models/Suggestion>} suggestions\n */\n this.suggestions = undefined\n }", "title": "" }, { "docid": "9ed896a3ce78fbc2e295f114c6b187af", "score": "0.56693363", "text": "function autoSubject(request, response, responseStyle) {\n\n var requestterm = request.term;\n\n requestterm = requestterm.replace(/\\-/g, \"\");\n requestterm = requestterm.replace(/ /g, \"%20\");\n\n var suggestIndex = currentSuggestIndex;\n var suggestReturn = suggestIndex + \"%2Cidroot%2Cauth%2Ctag%2Ctype%2Craw%2Cbreaker%2Cindicator\";\n\n var query = \"&query=\" + requestterm + \"&queryIndex=\" + suggestIndex + \"&queryReturn=\" + suggestReturn;\n query += \"&suggest=\" + subjectDB;\n var url = subjectProxy + query;\n\n $.ajax({\n type: \"GET\",\n url: url,\n dataType: \"jsonp\",\n jsonp: 'json.wrf',\n success: function (data) {\n\n var mr = [];\n var result = data.response.docs;\n\n for (var i = 0, len = result.length; i < len; i++) {\n \n var term = result[i][suggestIndex];\n var useValue = \"\"; \n if(responseStyle == undefined )\n useValue = result[i][\"auth\"];\n else \n\t\t\t\t\t useValue = responseStyle(result[i]); //responseStyle is a function to format the result to be put into the input box\n\t\t\t\t\t //responseStyle functions are below:\n\t\t\t\t\t // breakerStyle - includes special diacritic markings and tags\n\t\t\t\t\t // connexStyle - subdivisions labeled with $b-$z, surrounded by spaces\n\t\t\t\t\t // commonStyle - no modifications, some subdivisions indicated by --\n\t\t\t\t\t\t\n mr.push({\n label: term, //heading matched on \n value: useValue, //this gets inserted to the search box when an autocomplete is selected,\n idroot: result[i][\"idroot\"], //the fst number\n auth: result[i][\"auth\"], //authorized form of the heading, viewable -- format\n tag: result[i][\"tag\"], //heading tag, 1xx\n type: result[i][\"type\"], //auth= term is authorized form, alt= term is alternate (see also) form\n raw: result[i][\"raw\"], //authorized form of the heading, $a-z subdivision form\n breaker: result[i][\"breaker\"], //authorized form of the heading, marcbreaker coding for diacritics\n indicator: result[i][\"indicator\"] //heading first indicator \n });\n }\n response(mr);\n }\n });\n}", "title": "" }, { "docid": "f726381b3a045a636b60a24da8528866", "score": "0.5653612", "text": "function returnLocation(data, dfd) {\n data = JSON.parse(data);\n if (data && data.candidates && data.candidates.length) {\n dfd.resolve(data.candidates[0]);\n } else {\n dfd.resolve(null);\n }\n }", "title": "" }, { "docid": "cb79d7fb0310b0c97cc01457278ad0d4", "score": "0.56447864", "text": "function searchAutoComplete() {\n if(self.selectedChoice() == 'name') {\n autoCompleteSource(nameArr);\n } else {\n autoCompleteSource(addrArr);\n }\n}", "title": "" }, { "docid": "269c67dc2c3d264988739cd41ba25bee", "score": "0.5639577", "text": "function doGet() {\n $.get(\"/images/tag_suggestions/\" + text, function(data) {\n if ($(\"#suggestions\") != undefined) $(\"#suggestions\").remove();\n text_instance.parents(\".caption\").append(data);\n\n $(\".add_tag\").click(function() {\n text_instance.val($(this).html());\n $(\"#suggestions\").remove();\n return false;\n });\n });\n }", "title": "" }, { "docid": "763ebceb8a0ab60935e5de81c13f7b0e", "score": "0.56285334", "text": "function suggestLocation() {\n message[1].innerHTML = \"\"\n if(cityLatitude === undefined) {\n return message[1].innerHTML = \"You need to insert a location or allow geolocation!\"\n }\n map.setCenter({lat:cityLatitude, lng:cityLongitude});\n map.setZoom(10);\n\n limits = 20;\n\n let url= `https://browse.search.hereapi.com/v1/browse?at=${cityLatitude},${cityLongitude}&limit=${limits}&categories=350-3500-0304&apikey=${process.env.API_KEY}`;\n \n fetch(url) \n .then(res => {\n return res.json();\n })\n .then(body => {\n for(i=0; i < body.items.length;i++) {\n arraylakesLat[i] = body.items[i].access[0].lat;\n arraylakesLong[i] = body.items[i].access[0].lng;\n \n }\n return [arraylakesLong,arraylakesLat];\n }) \n .then(data => {\n addMarkersToMap(map);\n }\n )\n }", "title": "" }, { "docid": "7816ee06592337960a7295baacd07752", "score": "0.5615298", "text": "async function searchSongs(term){\n const res = await fetch(`${apiURL}/suggest/${term}`);\n const data = await res.json();\n showData(data);\n}", "title": "" }, { "docid": "153a191a1c0b47980942b3729715975a", "score": "0.5613037", "text": "renderSuggestion(suggestion) {\n return (\n <span>{suggestion.name}</span>\n );\n }", "title": "" }, { "docid": "a8d7579d4749865cabca9c844ebdd0b5", "score": "0.5612165", "text": "function findMatches() {\n if (!this.value) { \n suggestions.innerHTML = \"\";\n return; \n }\n const wordToMatch = this.value;\n const finalEndpoint = `${endpoint}&per_page=${pages}&with_people=${with_people}&with_paywall=${with_paywall}&c=${wordToMatch}&t=${new Date().getTime()}`;\n fetch(finalEndpoint)\n .then(blob => blob.json())\n .then(data => displayMatches(data));\n }", "title": "" }, { "docid": "eb0b8ef1859433633f5233b33f06d5a2", "score": "0.5611967", "text": "function getSuggestionsUsingOptions(){\n // get the list of campuses the user doesn't want\n var campuses=getUnselectedCampuses();\n var ids=[]\n // convert each id from the HTML id to the format needed by the backend, namely one of [‘Central’,‘Lauriston’,\"King's Buildings\", 'Holyrood', 'Other']\n for (i in campuses){\n var id=campuses[i];\n id = id.charAt(0).toUpperCase() + id.slice(1,id.indexOf('Checkbox'));\n if (id=='Kings'){\n id=\"King's Buildings\";\n }\n ids.push(id)\n }\n // if all campuses are unselected, return all campuses\n if (ids.length==5){\n ids = [];\n }\n // get the suggestions\n getSuggestions( $('#nearbyCheckbox').is(':checked'), $('#quietCheckbox').is(':checked'), ids);\n}", "title": "" }, { "docid": "f22f74914c02903777f19ddafd868133", "score": "0.5611444", "text": "function getResults() {\n\t\t\treturn new Promise(resolve => {\n\t\t\t\tlet url = \"https://dapitide.eokoe.com/api/data/chatbot?school_grade=\" + context.state.grade + \"&city_id=\" + context.state.city_id + \"&x=\" + context.state.tema\n\t\t\t\tconsole.log(url);\n\t\t\t\trequest(url, function (error, response, body) {\n\t\t\t\t\tlet data = JSON.parse(body);\n\t\t\t\t\tlet filtered = data.data.filter(element => {\n\t\t\t return element.subject === context.state.subject\n\t\t\t })\n\t\t\t\t\tresolve(filtered[0])\n\t\t\t\t\treturn filtered[0];\n\t\t\t })\n\t\t\t})\n\t\t}", "title": "" }, { "docid": "325175325e80c576099126dcb660df0e", "score": "0.560974", "text": "function update_suggested() {\n var props = current_alts;\n var show = false;\n\n jQuery(locator_suggestions).find('li').remove();\n\n for (var type in props) {\n if (type != \"_default\" && type != 'implicit') {\n locator_suggestions.appendChild(\n newNode(\n 'li',\n newNode(\n 'a',\n type + '=' + props[type],\n {\n href: '#' + type,\n name: '#' + type,\n click: use_suggestion\n }\n )\n )\n );\n show = true;\n }\n }\n\n if (show) {\n jQuery(locator_suggestions).show();\n } else {\n jQuery(locator_suggestions).hide();\n }\n }", "title": "" }, { "docid": "41344e006204c5bf9b3602361d727aa9", "score": "0.56019396", "text": "function get_suggestion() {\n var word_boxes = find_word_boxes();\n var word = \"\";\n for (var box of word_boxes) {\n if (box.value == \" \" || box.value ==\"\") {\n word = word.concat(\"?\");\n box.value = \"\"; // This is so that the placeholder will actually appear! (Otherwise, the space will fill the square instead.)\n }\n else {\n word = word.concat(box.value);\n }\n }\n if (word == old_word[0]) {\n old_word[1] = old_word[1] + 1;\n }\n else {\n old_word = [word, 0];\n }\n // The following is a first attempt at using the data_muse api. It sorta works. I think I am doing the accessing without any encryption which feels sorta dangerous. I think I need to alter it to some extent... Maybe I should just get a key, and then I can use the https (if that's what will make it work)\n\n \n clear_placeholders();\n var request = new XMLHttpRequest();\n request.open('GET', \"http://api.datamuse.com/words?sp=\".concat(word));\n suggested_word = \"\";\n request.onload = function() {\n var data = JSON.parse(this.response);\n try {\n suggested_word = data[old_word[1]].word.replace(/ /g, \"\"); // Remove white space after picking word\n }\n catch {\n suggested_word = word; \n }\n var k = 0;\n for (var box of word_boxes) {\n box.placeholder = suggested_word.substr(k, 1).toUpperCase();\n k += 1;\n }\n return suggested_word;\n }\n\n request.send();\n \n}", "title": "" }, { "docid": "60e111af76de8c73766ece56b4babaed", "score": "0.5592623", "text": "function suggest(data,name){\n\n\t\n\t\n\t//fetch a superhero and check if its name matches with the text int he input box\n\t//if yes, then show him in the suggestions\n\n\tif(name!=inputText.value)\n\t\treturn;\n\n\t\tconsole.log(data);\n\tif(data.response==='error'){\n\t\tsuggestions.innerHTML = '<div style=\"margin-top:40px; color:white;\">Try a different name!</div>';\n\t}\n\n\telse{\n\n\t\tsuggestions.innerHTML = null;\n\t\t\n\t\tfor(let i=0; i<data.results.length && i<10; i++){\n\n\t\t\t//create card for every suggestion\n\t\t\tvar item = document.createElement('div');\t\t\t\n\t\t\tvar itemImage = document.createElement('img');\n\t\t\tvar itemContainer = document.createElement('div');\n\t\t\tvar itemText = document.createElement('div');\n\t\t\tvar favButton = document.createElement('div');\n\t\t\tvar searchButton = document.createElement('div');\n\t\t\t\n\t\t\titem.classList.add('suggestion-item');\n\t\t\titemImage.classList.add('suggestion-item-image');\n\t\t\titemContainer.classList.add('suggestion-item-container');\n\t\t\tfavButton.classList.add('favButton');\n\t\t\tsearchButton.classList.add('searchButton');\n\n\t\t\t//display name of character\n\t\t\titemText.innerHTML = data.results[i].name;\n\t\t\titemContainer.appendChild(itemText);\n\n\t\t\t//display image of the character\n\t\t\titemImage.src = data.results[i].image.url;\n\t\t\titem.appendChild(itemImage);\t\t\t\n\n\t\t\t//check if any of the suggested characters are present in the Favourites list\n\t\t\t//according, display the Add to Fav/Remove from Fav button\n\n\t\t\tsearchButton.innerHTML = 'Search';\n\t\t\titemContainer.appendChild(searchButton);\n\n\t\t\tlet itemId = data.results[i].id;\n\n\t\t\tif(favList.includes(itemId)){\n\t\t\t\tfavButton.innerHTML = \"Remove from Favourites\";\n\t\t\t\tfavButton.classList.add('bg-red');\n\t\t\t}else{\n\t\t\t\tfavButton.innerHTML = \"Add to Favourites\";\n\t\t\t\tfavButton.classList.add('bg-green');\n\t\t\t}\n\t\t\titemContainer.appendChild(favButton);\n\n\t\t\t\n\t\t\titem.appendChild(itemContainer);\n\n\t\t\t//item.setAttribute('superheroId',data.results[i].id);\n\t\t\tfavButton.setAttribute('superheroId',data.results[i].id);\n\t\t\tsearchButton.setAttribute('superheroId',data.results[i].id);\n\n\t\t\tfavButton.setAttribute('divType','fav-btn');\n\t\t\tsearchButton.setAttribute('divType','search-btn');\n\n\t\t\tsuggestions.appendChild(item);\n\t\t}\n\n\t\tsuggestions.onclick = function(event){\n\n\t\t\tvar id = event.target.getAttribute('superheroId');\n\t\t\tvar div = event.target.getAttribute('divType');\t\t\t\n\n\t\t\t\n\t\t\t//handling favourites\n\n\t\t\tif(div==='fav-btn'){\n\n\t\t\t\tif(id===null)\n\t\t\t\t\treturn;\n\n\t\t\t\tif(favList.includes(id)){\n\t\t\t\t\tvar i = favList.indexOf(id);\n\t\t\t\t\tfavList.splice(i,1);\n\t\t\t\t\tevent.target.innerHTML = \"Add to Favourites\";\n\t\t\t\t\tevent.target.classList.add('bg-green');\n\t\t\t\t\tevent.target.classList.remove('bg-red');\n\t\t\t\t}else{\n\t\t\t\t\tfavList.push(id);\n\t\t\t\t\tevent.target.innerHTML = \"Remove from Favourites\";\n\t\t\t\t\tevent.target.classList.remove('bg-green');\n\t\t\t\t\tevent.target.classList.add('bg-red');\n\t\t\t\t}\n\n\t\t\t\tlocalStorage.setItem(\"favList\", JSON.stringify(favList));\n\t\t\t}\n\n\t\t\t//searching\n\t\t\telse if(div==='search-btn'){\n\t\t\t\tif(id===null)\n\t\t\t\treturn;\n\t\t\t\twindow.open(\"superhero.html?id=\"+id,\"_self\");\n\t\t\t}\n\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "e79fa6a2e3a9fc588bbc29a3dd258124", "score": "0.55902064", "text": "function getData() {\r\n\t\t\tclearFilters();\r\n//\t\t\tlistings();\r\n\t\t}", "title": "" }, { "docid": "68944143d03762d37fd38c3560a59af6", "score": "0.5585623", "text": "function querySearch (query) {\n $http({\n method: 'GET',\n url: \"/v1/api/users/search?q=\" + query\n }).then(function successCallback(response) {\n self.response = response.data || [];\n self.autoCompleteUsers = self.response.map(function (item) {\n return {\n value: item._id,\n display: item.topic\n };\n });\n },function errorCallback(response) {\n $scope.error = response.statusText; //TODO:\n });\n }", "title": "" }, { "docid": "49d5e49bf06eadda8129665878008c51", "score": "0.5584071", "text": "function gotSearch(data){\n console.log(data);\n let len = data[1].length;\n let index = floor(random(len));\n let title = data[1][index];\n title = title.replace(/\\s+/g, '_');\n createDiv(title);\n console.log('Querying:' + title);\n let url = contentUrl + title;\n loadJSON(url,gotContent,'jsonp');\n}", "title": "" }, { "docid": "0cfc57c8ea68f50ac17f9ae78694601c", "score": "0.5580116", "text": "function prepSearchData(data) {\n text = data[1] + '<br>'\n if (data[14]) { text+='<strong>Description: </strong>'+data[14] + '<br>'}\n if (data[4]) { text+='<strong>Avg Points: </strong>' + data[4] +'<br>'}\n if (data[13]) { text+='<strong>Total Favorites: </strong>' + data[13] + '<br>'}\n return text;\n}", "title": "" }, { "docid": "1f9414d8c0695064a02a274785250788", "score": "0.5579282", "text": "inflateSuggestion(suggestion) {\n\t\treturn {\n\t\t\ttext: suggestion.text,\n\t\t\tdescription: 'Predefined Condition\\n'+ suggestion.description,\n\t\t\ttype: 'value',\n\t\t\trightLabel: suggestion.description\n\t\t};\n\t}", "title": "" } ]
09ef7192b265443432d5905a873c044b
Called by templates to decrease redundancy
[ { "docid": "78eab7c30ce2ac9e615de4a897c74d53", "score": "0.0", "text": "function getVueOptions(name) {\n\tconst opt = {\n\t\tname: name,\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tperson: yaml.load(PERSON),\n\t\t\t\tterms: terms\n\t\t\t}\n\t\t},\n\t\tcomputed: {\n\t\t\tlang() {\n\t\t\t\tconst defaultLang = this.terms.en\n\t\t\t\tconst useLang = this.terms[this.person.lang]\n\n\t\t\t\t// overwrite non-set fields with default lang\n\t\t\t\tObject.keys(defaultLang)\n\t\t\t\t\t.filter(k => !useLang[k])\n\t\t\t\t\t.forEach(k => {\n\t\t\t\t\t\tconsole.log(k)\n\t\t\t\t\t\tuseLang[k] = defaultLang[k]\n\t\t\t\t\t})\n\n\t\t\t\treturn useLang\n\t\t\t},\n\n\t\t\tcontactLinks() {\n\t\t\t\tconst links = {}\n\n\t\t\t\tif (this.person.contact.github) links.github = `https://github.com/${this.person.contact.github}`\n\n\t\t\t\tif (this.person.contact.codefights) links.codefights = `https://codefights.com/profile/${this.person.contact.codefights}`\n\n\t\t\t\tif (this.person.contact.medium) links.medium = `https://medium.com/@${this.person.contact.medium}`\n\n\t\t\t\tif (this.person.contact.email) links.email = `mailto:${this.person.contact.email}`\n\n\t\t\t\tif (this.person.contact.linkedin) links.linkedin = `https://linkedin.com/in/${this.person.contact.linkedin}`\n\n\t\t\t\tif (this.person.contact.phone) links.phone = `tel:${this.person.contact.phone}`\n\n\t\t\t\treturn links\n\t\t\t}\n\t\t}\n\t}\n\treturn opt\n}", "title": "" } ]
[ { "docid": "edda1937949a08ecc9e27249168c45cb", "score": "0.61212194", "text": "beforeParseTemplate(){}", "title": "" }, { "docid": "7f0ccb1b98928a0110c5885131ae4a2b", "score": "0.583069", "text": "function DragHelperTemplate() { }", "title": "" }, { "docid": "7f0ccb1b98928a0110c5885131ae4a2b", "score": "0.583069", "text": "function DragHelperTemplate() { }", "title": "" }, { "docid": "2440a594a802511ba9dce7b3e6869008", "score": "0.5811568", "text": "function TemplateEngine() {\n}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.58051085", "text": "render() {}", "title": "" }, { "docid": "5a379b173a5ec0030a07308f3d73240b", "score": "0.5670804", "text": "template() {\n return '';\n }", "title": "" }, { "docid": "5a379b173a5ec0030a07308f3d73240b", "score": "0.5670804", "text": "template() {\n return '';\n }", "title": "" }, { "docid": "cd4956edd3e50f29f2d717d991052ae5", "score": "0.563876", "text": "Render() {}", "title": "" }, { "docid": "df77abd0ac53707d4caed00b4b5f7614", "score": "0.5608807", "text": "function TemplateFunctionDefinition() {\n}", "title": "" }, { "docid": "82f0ab4ed9b9f6501223afb2883e42f9", "score": "0.55848986", "text": "template()\n {\n return `Empty page. Override this.`\n }", "title": "" }, { "docid": "1857088220a02165860d10c6364d9216", "score": "0.5538877", "text": "function resetTemplates()\n\t{\n\t\tprocessed_templates = {};\n\t}", "title": "" }, { "docid": "c9dade818e7bedf0c076a0fa895bce78", "score": "0.55042505", "text": "preRender() {\n\t}", "title": "" }, { "docid": "19b11b0eff3483e0120986be4906f48f", "score": "0.5503887", "text": "function template() {\n\t\t//\tAttach click functionality\n\t\t\t$('#myDiv').click(handler_templateClick);\n\t\tif ($('#myDiv').length == 1) {\n\t\t\t//\tDo stuff only if myDiv exists\n\t\t};\t\n\t\t\n\t}", "title": "" }, { "docid": "f61a24a7d852e87f25a17c2380c55faf", "score": "0.5501668", "text": "function TemplateInstantiationRequest() {\n}", "title": "" }, { "docid": "533c69295b55f63a86e61e5b7fd71a95", "score": "0.5487011", "text": "getBodyTemplate() {\n throw new NotImplementedError();\n }", "title": "" }, { "docid": "ecb8eb647d85299108c9072ee3c24b7a", "score": "0.5471524", "text": "renderBefore() {}", "title": "" }, { "docid": "9e4dc5b4fe63ae9b7a996ba440f2b0bd", "score": "0.54666346", "text": "visitTemplateName(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "0363df2ccc2146021dbd227c1ba7a7b1", "score": "0.5459029", "text": "resolveRootAndTemplate() {\n const key = Object.keys(this.template).shift();\n this.root = Template.resolveStringNumber(this.resolveElement(key, this.template), this.template);\n \n if (Util.isFunction(this.template[key])) {\n this.template = this.template[key].call(this.root, this.root);\n } else {\n this.template = this.template[key];\n }\n }", "title": "" }, { "docid": "87f248ad448de1b253016d0ee9f9d2de", "score": "0.5438365", "text": "function r(){return r[\"taggedTmpl\"+(r.outputH?\"H\":\"\")].apply(null,arguments)}", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.54376674", "text": "render() {\n }", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.54285485", "text": "function render() {}", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.54285485", "text": "function render() {}", "title": "" }, { "docid": "697ec3b9889d75f63564c6dbce95a3a8", "score": "0.5415142", "text": "render() {\n\n\t}", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.53981763", "text": "render() { }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.53981763", "text": "render() { }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.53981763", "text": "render() { }", "title": "" }, { "docid": "d2595ef449c6f89b157d1adeb705334e", "score": "0.53981763", "text": "render() { }", "title": "" }, { "docid": "a4b4d493a50fadc2b3f3c4c44f2a4fe8", "score": "0.5388667", "text": "visitSimpleTemplateId(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "f73222d3c6b4dc3aa525cf9b2acaef9e", "score": "0.53800297", "text": "display () {\r\n return Template.fillTemplate(this.templateName, this);\r\n }", "title": "" }, { "docid": "760e4926a78f1a293b1306771fccde43", "score": "0.53641367", "text": "function loadTemplates(){\n\n}", "title": "" }, { "docid": "1b4cd3cfce46f96f72184134c53a019a", "score": "0.535093", "text": "function stampEveryTemplate() {\n\n\tsectionMain.innerHTML = '';\n\n\tif (form.value === 'animal') {\n\t\tstampTemplate(animal);\n\t} else if (form.value === 'vegetable'){\n\t\tstampTemplate(vegetable);\n\t} else if (form.value === 'user'){\n\t\tstampTemplate(user);\n\t} else {\n\t\tstampTemplate(icons);\n\t}\n\t\n}", "title": "" }, { "docid": "f9026c6ec3ae3d03a3352b301cba0487", "score": "0.5343368", "text": "template(kwargs) {\n let compiled_tpl,\n file_tpl = require('../templates/widgetsbar/single_node_info.html');\n\n compiled_tpl = _.template(file_tpl(kwargs));\n\n return compiled_tpl();\n }", "title": "" }, { "docid": "5c817623c7d6fb94b843384eaef21b24", "score": "0.5340444", "text": "visitTemplateId(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "5c817623c7d6fb94b843384eaef21b24", "score": "0.5340444", "text": "visitTemplateId(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "aa0d853a8ec0fd8edd196260bdaa1376", "score": "0.53357095", "text": "function TagHelper() {}", "title": "" }, { "docid": "32ac13d21d8086c89c8444285e35ff26", "score": "0.5321516", "text": "renderContent() { }", "title": "" }, { "docid": "4057fc1662c95479d9f804e8fbffbb32", "score": "0.53114486", "text": "render () { return ``; }", "title": "" }, { "docid": "dc7f3b556ecc66f75c88f6b05ae87f10", "score": "0.5304531", "text": "render() {\n return <TemplateBuilder\n type = {\n TEMPLATE.MAIN\n }\n data = {\n this.getData()\n }\n />;\n }", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.52866876", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.52866876", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.52866876", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.52866876", "text": "function TMP(){}", "title": "" }, { "docid": "71f84ccc1e3e500def02f0b333f25ec0", "score": "0.52866876", "text": "function TMP(){}", "title": "" }, { "docid": "be26718628809c87ee232804d894373a", "score": "0.5285153", "text": "static get onPostRender() {}", "title": "" }, { "docid": "740ebddd8dcff1b1bc7e1e6acbf69cda", "score": "0.5256725", "text": "init() {\n // Read the DOM to find all the templates, and make them available to the code\n $('.js_template').each((__, $el) => {\n const namespaceElements = $el.id.split('_');\n const id = namespaceElements.pop();\n\n // remove the prefix \"template\" that MUST be added to have clean HTML ids\n namespaceElements.shift();\n const namespace = getTemplateNamespace(namespaceElements);\n namespace[id] = new DOMTemplate($el.id);\n });\n }", "title": "" }, { "docid": "95293a6ee4e18ac67f3c53a63340ccd6", "score": "0.5254113", "text": "function blazorTemplatesReset(control){for(var i=0;i<control.annotations.length;i++){sf.base.resetBlazorTemplate((control.element.id+'_Annotation_'+i).replace(/[^a-zA-Z0-9]/g,''),'ContentTemplate');}//This reset the tooltip templates\nsf.base.resetBlazorTemplate(control.element.id+'_tooltipparent_template'+'_blazorTemplate','Template');//Datalabel templates reset\nsf.base.resetBlazorTemplate(control.element.id+'_DataLabel');}", "title": "" }, { "docid": "3dacb6f781a7f0319eea885f1fb4da72", "score": "0.5253152", "text": "function TemplateClassDefinition() {\n}", "title": "" }, { "docid": "f51a911c6e497333c655e489b4f8663d", "score": "0.524766", "text": "static set onPostRender(value) {}", "title": "" }, { "docid": "648c44c7b4baea231a23ee9b13934a4a", "score": "0.52322805", "text": "visitNormalTemplateBody(context) {\n const result = new Map();\n for (const templateStr of context.templateString()) {\n result.set(templateStr.normalTemplateString().text, undefined);\n }\n return result;\n }", "title": "" }, { "docid": "ee6b58fd25f6370e9628921783760f70", "score": "0.5231768", "text": "__initTemplateEngine() {\n this.templateEngine = Dot.process( { templateSettings: { strip: false }, path: 'views/' } );\n }", "title": "" }, { "docid": "b3144daaa2459ce6a516d56585fc1b04", "score": "0.5212989", "text": "function init_template() {\n $container_diagram = $(\"#container_diagram\");\n $container_inspector = $(\"#container_inspector\");\n $form_inspector = $(\"#form_inspector\");\n $position_people_list = $(\"#position_people_list\");\n $addPositionModel = $(\"#addPositionModel\");\n $editPositionPeopleModel = $(\"#editPositionPeopleModel\");\n $edit_position_people_form = $(\"#edit_position_people_form\");\n $ouTreeModel = $(\"#ouTreeModel\");\n company_id = $(\"#company_id\").val();\n company_name = $(\"#company_name\").val();\n ou_id = $(\"#ou_id\").val();\n ou_name = $(\"#ou_name\").val();\n hbtmp_position_form_view = Handlebars.compile($(\"#hbtmp_position_form_view\").html());\n hbtmp_position_add_view = Handlebars.compile($(\"#hbtmp_position_add_view\").html());\n hbtmp_position_people_form_view = Handlebars.compile($(\"#hbtmp_position_people_form_view\").html());\n hbtmp_position_people_list_view = Handlebars.compile($(\"#hbtmp_position_people_list_view\").html());\n }", "title": "" }, { "docid": "97381360cae64659bdd8209dbdb23cc9", "score": "0.5207577", "text": "function processTemplate2() {\n html = Mustache.render(template, data);\n $('#template-table-thread').html(html);\n}", "title": "" }, { "docid": "a43909c43510e83bfe2a0c4566bc7aa5", "score": "0.52051395", "text": "function compileTemplates() {\n window.templates = {};\n window.templates.common = Handlebars.compile($(\"#control-customize-template\").html());\n\n /* HTML Templates required for specific implementations mentioned below */\n\n window.templates.group = Handlebars.compile($(\"#group-template\").html());\n window.templates.textbox = Handlebars.compile($(\"#textbox-template\").html());\n window.templates.email = Handlebars.compile($(\"#email-template\").html());\n window.templates.textarea = Handlebars.compile($(\"#textbox-template\").html());\n window.templates.number = Handlebars.compile($(\"#number-template\").html());\n window.templates.date = Handlebars.compile($(\"#date-template\").html());\n window.templates.radiogroup = Handlebars.compile($(\"#combobox-template\").html());\n window.templates.array = Handlebars.compile($(\"#array-template\").html());\n window.templates.checkboxgroup = Handlebars.compile($(\"#combobox-template\").html());\n}", "title": "" }, { "docid": "02c92a96578a5f6ed50c8be5b480de00", "score": "0.52021563", "text": "beforeRender() {}", "title": "" }, { "docid": "ce93e60513953e9b5e1a6bc4d9606a7f", "score": "0.51995987", "text": "function render() {\n // TODO\n}", "title": "" }, { "docid": "3f489870a2de149f5eb62088f208c8e4", "score": "0.5198883", "text": "function RepeaterModifier() {}", "title": "" }, { "docid": "3f489870a2de149f5eb62088f208c8e4", "score": "0.5198883", "text": "function RepeaterModifier() {}", "title": "" }, { "docid": "a45c649fac28bf3865669af7ae17b5e8", "score": "0.5198121", "text": "static get TEMPLATE()\n {\n return 'template';\n }", "title": "" }, { "docid": "4fb9c52cbe911ca26d37b2ec6a8a6da0", "score": "0.5193247", "text": "function RepeaterModifier(){}", "title": "" }, { "docid": "d86a4fb65a21651351b0834c8d079d67", "score": "0.5192519", "text": "function ContentRender() {\n }", "title": "" }, { "docid": "b08246deaa408687d03c0441e048fa96", "score": "0.5183527", "text": "render(){return renderNotImplemented}", "title": "" }, { "docid": "4c5620f29ed65bcd7ad6ba971659ecda", "score": "0.5164474", "text": "_template() {\n return this._body;\n }", "title": "" }, { "docid": "96cabdb60955e8d12ce92a1c5ab08237", "score": "0.516447", "text": "sane(template,data) {\n return template.replace(/\\{(.*?)\\}/g, (fullmatch, varname) => {\n return this.sanitize(this.objPath(varname.split('.'), data));\n });\t\n }", "title": "" }, { "docid": "0d3beb3f33cf9039274b014676dde66a", "score": "0.51626", "text": "function GenericHandler() {}", "title": "" }, { "docid": "db1eb560c31ef09f0fb2fe437474d4ad", "score": "0.5160925", "text": "static init() {\n // TODO: This is being duplicated in various places; DRY with sugar method\n PhrasesetButton.TEMPLATE = DOM.require('#phrasesetButtonTemplate');\n PhrasesetButton.TEMPLATE.id = '';\n PhrasesetButton.TEMPLATE.hidden = false;\n PhrasesetButton.TEMPLATE.remove();\n }", "title": "" }, { "docid": "119330dd1ff2d4c98e5ef6fff62a5a6f", "score": "0.51572484", "text": "function blazorTemplatesReset(control) {\n for (var i = 0; i < control.annotations.length; i++) {\n sf.base.resetBlazorTemplate((control.element.id + '_Annotation_' + i).replace(/[^a-zA-Z0-9]/g, ''), 'ContentTemplate');\n } //This reset the tooltip templates\n\n\n sf.base.resetBlazorTemplate(control.element.id + '_tooltipparent_template' + '_blazorTemplate', 'Template'); //Datalabel templates reset\n\n sf.base.resetBlazorTemplate(control.element.id + '_DataLabel');\n }", "title": "" }, { "docid": "3a6fdb1b667c729ca11402ed263df6db", "score": "0.51265115", "text": "function processTemplates(widgets) {\n findObject(widgets, {\n prefix: \"_alfTemplateName\",\n processFunction: processTemplate\n });\n findObject(widgets, {\n prefix: \"templateModel\",\n processFunction: processNestedPages\n });\n}", "title": "" }, { "docid": "d5e4636a2ec0f44aa29813a80c334376", "score": "0.51232237", "text": "function IdentityProviderTemplatesPageConstants() {\n }", "title": "" }, { "docid": "47240005a68f3b8ff20884e665d06882", "score": "0.51129276", "text": "processTemplate(pTemplateHash,pTemplateData,pDefaultTemplate){var tmpTemplateFunction=this.getTemplateFunction(pTemplateHash);var tmpTemplateData=typeof pTemplateData==='undefined'?{}:pTemplateData;// This makes the function fairly laziliy loading.\nif(tmpTemplateFunction===false){// If the template doesn't exist, try to use the passed-in default and set that as the template.\n// Otherwise make it empty.\nthis.setTemplate(pTemplateHash,typeof pDefaultTemplate==='undefined'?'':pDefaultTemplate);tmpTemplateFunction=this.getTemplateFunction(pTemplateHash);}// Now process and return the underscore template.\nreturn tmpTemplateFunction(tmpTemplateData);}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "098b638b02e39c8926f6ae353a9592f6", "score": "0.5109772", "text": "function TMP() {}", "title": "" }, { "docid": "c76571e8ae07dfeace6cd2451716939b", "score": "0.5104262", "text": "get Template() {\n console.log('ToDo Template accessed')\n return `\n <li>\n <input type='checkbox' name='completed' onclick='app.controllers.todoCtrl.toggleTodoStatus(\"${this._id}\")' ${(this.completed ? 'checked' : '')}>\n ${this.description}\n <button type='button' onclick='app.controllers.todoCtrl.removeTodo(\"${this._id}\")'> X </button>\n\t\t</li>`\n\n }", "title": "" }, { "docid": "c2645d83428ab9302bbc709c1e852d67", "score": "0.50955206", "text": "postRender() {\n }", "title": "" }, { "docid": "e682fa466176e1acef27b267bd59bbd7", "score": "0.509472", "text": "function TView(){}", "title": "" }, { "docid": "cf5d3bb2850d4de587db46ff21dab7dd", "score": "0.5094127", "text": "template() {\n // If the template isn't empty string, JQX adds wrapper elements.\n return '';\n }", "title": "" }, { "docid": "5927470ac8dff5f391f9a1393eda6c58", "score": "0.50937253", "text": "function StaticContents( ){}", "title": "" }, { "docid": "3dc1116c450029d0a77ef4a8b4868af4", "score": "0.50864303", "text": "tpl(data) {\n return '<span class=\"cyCompartmentLumen\" >' + data.name + '</span>'; // your html template here \n }", "title": "" }, { "docid": "67b62e3d689c2dcba1d20e64979b8962", "score": "0.50842613", "text": "getTemplate() {\n return `<h1>Hello ${this.subject}!</h1>`;\n }", "title": "" }, { "docid": "05c6525535f688e2d69313c912461b57", "score": "0.50795716", "text": "constructor() {\n this.templateRegistry = {};\n }", "title": "" }, { "docid": "804c593f78e6aabde49897d6a5cd184b", "score": "0.5075601", "text": "rendered(templateName, value) {\n\t return value !== null && this.renderCache[templateName].hasOwnProperty(value) ? this.renderCache[templateName][value] : null;\n\t }", "title": "" }, { "docid": "1e444085a69f085e59784f318d67bda8", "score": "0.50687665", "text": "function displayTemplate2(template) {\n var src = template.firstChild.src;\n let name = template.dataset.name;\n displayCreatePage(src, name);\n }", "title": "" }, { "docid": "051d60d98c3649199d04f1747bd1ebd0", "score": "0.5068103", "text": "static get template() {\n return Object(_polymer_polymer__WEBPACK_IMPORTED_MODULE_4__[\"html\"])([_ecosml_app_html__WEBPACK_IMPORTED_MODULE_26___default.a]);\n }", "title": "" }, { "docid": "a4f1bd72f1b61ce90fe1d1a4bc70dc9d", "score": "0.506759", "text": "function doPageTemplateSubstitution (req, resp) {\n\n // Swap out the widget template.\n resp.json.regions.forEach((region) => {\n\n // If the region is a stack then we should have a client side template.\n if (region.structure === constants.stackStructure) {\n\n // First handle sub-region content\n region.regions.forEach((subregion) => {\n doRegionContentSubstitution(subregion)\n })\n }\n\n doRegionContentSubstitution(region)\n })\n}", "title": "" }, { "docid": "a4f1bd72f1b61ce90fe1d1a4bc70dc9d", "score": "0.506759", "text": "function doPageTemplateSubstitution (req, resp) {\n\n // Swap out the widget template.\n resp.json.regions.forEach((region) => {\n\n // If the region is a stack then we should have a client side template.\n if (region.structure === constants.stackStructure) {\n\n // First handle sub-region content\n region.regions.forEach((subregion) => {\n doRegionContentSubstitution(subregion)\n })\n }\n\n doRegionContentSubstitution(region)\n })\n}", "title": "" }, { "docid": "aafd5db24503e1ece08e86680bada036", "score": "0.50644475", "text": "static set onPreRender(value) {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.50545436", "text": "function TView() {}", "title": "" }, { "docid": "e73ec1305039667e5f47351e7c05415c", "score": "0.50545436", "text": "function TView() {}", "title": "" }, { "docid": "edd57dad9877cbb076f5a7611c429294", "score": "0.5052891", "text": "render() {\n throw new Error(\"Implement\");\n }", "title": "" }, { "docid": "c7a127b9ecda7a6703ef2d8ef9aaf872", "score": "0.5052657", "text": "__initTemplateEngine() {\n this.templateEngine = _dot2.default.process({ templateSettings: { strip: false }, path: 'views/' });\n }", "title": "" } ]
5cad0028925fb113f2d15ca87c1df660
This component represents a question row renderer in the Insert Survey page. It contains the buttons used to move up, move down and delete a question.
[ { "docid": "70045e675ef3c4d3c025cee9254e55c0", "score": "0.7071196", "text": "function InsertSurveyRow(props) {\n\n\tconst moveUp = () => {\n\t\tlet q = [...props.question];\n\t\tif (props.id === 0) {\n\t\t\tprops.setErrorMessage(\"The element is at the top\");\n\t\t} else {\n\t\t\t// Swap with the element before\n\t\t\tlet tmp = q[props.id];\n\t\t\tq[props.id] = q[props.id - 1];\n\t\t\tq[props.id - 1] = tmp;\n\t\t\tprops.setQuestion(q);\n\t\t\tprops.setErrorMessage(\"\");\n\t\t}\n\t};\n\n\tconst moveDown = () => {\n\t\tlet q = [...props.question];\n\t\tif (props.id + 1 === props.question.length) {\n\t\t\tprops.setErrorMessage(\"The element is at the bottom\");\n\t\t} else {\n\t\t\tlet tmp = q[props.id];\n\t\t\tq[props.id] = q[props.id + 1];\n\t\t\tq[props.id + 1] = tmp;\n\t\t\tprops.setQuestion(q);\n\t\t\tprops.setErrorMessage(\"\");\n\t\t}\n\t};\n\n\tconst handleDelete = () => {\n\t\tlet q = [...props.question];\n\t\tq.splice(props.id, 1);\n\t\tprops.setQuestion(q);\n\t};\n\n\tfunction renderItem() {\n\t\t// Closed question\n\t\tif (props.item.open === 0) {\n\t\t\treturn (\n\t\t\t\t<Row>\n\t\t\t\t\t<Col className=\"m-0 p-0\">\n\t\t\t\t\t\t<h2>\n\t\t\t\t\t\t\t{props.id + 1}. Closed question: {props.item.question}{\" \"}\n\t\t\t\t\t\t\t<Col>\n\t\t\t\t\t\t\t\t<Button variant=\"danger\" className=\"p-2\" onClick={handleDelete}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\twidth=\"28\"\n\t\t\t\t\t\t\t\t\t\theight=\"28\"\n\t\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"bi bi-trash align-items-center\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path d=\"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z\" />\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\td=\"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t\t\t</Button>{\" \"}\n\t\t\t\t\t\t\t\t<Button className=\"p-2\" variant=\"info\" onClick={moveUp}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\twidth=\"28\"\n\t\t\t\t\t\t\t\t\t\theight=\"28\"\n\t\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"bi bi-arrow-up\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\td=\"M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\tMove up\n\t\t\t\t\t\t\t\t</Button>{\" \"}\n\t\t\t\t\t\t\t\t<Button className=\"p-2\" onClick={moveDown}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\twidth=\"28\"\n\t\t\t\t\t\t\t\t\t\theight=\"28\"\n\t\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"bi bi-arrow-down\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\td=\"M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\tMove down\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<i>\n\t\t\t\t\t\t\tmin: {props.item.min}, max: {props.item.max}\n\t\t\t\t\t\t</i>\n\t\t\t\t\t\t<br></br>\n\t\t\t\t\t\tAnswers: <br></br>\n\t\t\t\t\t\t{props.item.answers.map((value, index) => (\n\t\t\t\t\t\t\t<i key={index}>\n\t\t\t\t\t\t\t\t{index + 1}. {value}\n\t\t\t\t\t\t\t\t<br></br>\n\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Col>\n\t\t\t\t</Row>\n\t\t\t);\n\t\t} else {\n\t\t\t// Open question\n\t\t\treturn (\n\t\t\t\t<Row>\n\t\t\t\t\t<Col className=\"justify-content-center m-0 p-0\">\n\t\t\t\t\t\t<h2>\n\t\t\t\t\t\t\t{props.id + 1}. Open question: {props.item.question}\n\t\t\t\t\t\t\t<Col>\n\t\t\t\t\t\t\t\t<Button variant=\"danger\" className=\"p-2\" onClick={handleDelete}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\twidth=\"28\"\n\t\t\t\t\t\t\t\t\t\theight=\"28\"\n\t\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"bi bi-trash align-items-center\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path d=\"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z\" />\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\td=\"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\tDelete\n\t\t\t\t\t\t\t\t</Button>{\" \"}\n\t\t\t\t\t\t\t\t<Button className=\"p-2\" variant=\"info\" onClick={moveUp}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\twidth=\"28\"\n\t\t\t\t\t\t\t\t\t\theight=\"28\"\n\t\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"bi bi-arrow-up\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\td=\"M8 15a.5.5 0 0 0 .5-.5V2.707l3.146 3.147a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 1 0 .708.708L7.5 2.707V14.5a.5.5 0 0 0 .5.5z\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\tMove up\n\t\t\t\t\t\t\t\t</Button>{\" \"}\n\t\t\t\t\t\t\t\t<Button className=\"p-2\" onClick={moveDown}>\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\twidth=\"28\"\n\t\t\t\t\t\t\t\t\t\theight=\"28\"\n\t\t\t\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"bi bi-arrow-down\"\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 16 16\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\t\t\t\t\t\t\td=\"M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1z\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\tMove down\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</Col>\n\t\t\t\t\t\t</h2>\n\n\t\t\t\t\t\t{props.item.required ? (\n\t\t\t\t\t\t\t<i>It is required.</i>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<i>It's not required.</i>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<i> Max {props.item.max} chars for the answer.</i>\n\t\t\t\t\t</Col>\n\t\t\t\t</Row>\n\t\t\t);\n\t\t}\n\t}\n\treturn (\n\t\t<ListGroup.Item className=\"container-fluid bg-light \">\n\t\t\t{renderItem()}\n\t\t</ListGroup.Item>\n\t);\n}", "title": "" } ]
[ { "docid": "679528b55f09e7bf280dbf2bce3dcdbf", "score": "0.60510397", "text": "function renderRow ( questionText, questionIndex ) { \n \n var questionRow = \"\";\n\n questionRow = `<div class=\"form-group\"><div class=\"row border mt-3 bg-light\"><div class=\"col-12 col-sm-6\"> ` + \n `<input type=\"text\" readonly class=\"form-control-plaintext\" id=\"question-${questionIndex}\"` +\n ` value=\"${questionText}\"></div>`;\n \n for ( var i = 1; i <= 5 ; i++) {\n questionRow += `<div class=\"col-1\"><div class=\"form-check form-check-inline\">` +\n ` <input class=\"form-check-input\" type=\"radio\" name=\"inlineRadioOptions${questionIndex}\"` +\n ` id=\"inlineRadio${questionIndex}-${i}\" value=\"${i}\"><label class=\"form-check-label\"` +\n ` for=\"inlineRadio${questionIndex}-${i}\">${i}</label></div></div>`;\n }\n\n questionRow += `</div><!-- End Row --></div>`;\n\n $(\"#questionHeader\").after(questionRow);\n\n }", "title": "" }, { "docid": "1a77071adae570a321573744758ade5b", "score": "0.5791851", "text": "render() {\n return (\n <div className=\"part1\">\n <div className=\"index\">\n {this.props.index+1}\n </div>\n\n {(this.props.editable && this.props.index>0)?(\n <button\n onClick = {() => this.props.moveUpQuestion(this.props.index)}\n disabled = {!this.props.editable}\n >&#8673;</button>\n ):null}\n\n {(this.props.editable && this.props.index<this.props.total-1)?(\n <button \n onClick = {() => this.props.moveDownQuestion(this.props.index)}\n disabled = {!this.props.editable}\n >&#8675;</button>\n ):null}\n </div>\n )\n }", "title": "" }, { "docid": "c984f7dc841b6a300030850eeba8e39d", "score": "0.57348937", "text": "function drawQuestionRow(priorQuestionNum, questionNum, roundNum, tRow, gridWidth, tooltipText, reviewNum, numRounds, roundPrefix, tBody) {\n // Determine if this question row belongs to a new round\n if (priorQuestionNum !== -1 && priorQuestionNum > questionNum) {\n ++roundNum;\n }\n // Update prior question index\n priorQuestionNum = questionNum;\n // Draw a \"Question: # \" Row that spans all columns\n let cell = tRow.insertCell();\n cell.colSpan = gridWidth;\n cell.className = \"tag_heat_grid_criterion\";\n addToolTip(cell, tooltipText);\n tRow.id = \"hg_row\" + questionNum + \"_\" + reviewNum;\n tRow.setAttribute(\"data-questionnum\", questionNum);\n if (numRounds > 1) {\n roundPrefix = \"Round \" + roundNum + \" -- \";\n }\n let text = document.createTextNode(roundPrefix + \"Question \" + questionNum);\n cell.appendChild(text);\n // Initialize new row to be used by the inner loop for reviews.\n tRow = tBody.insertRow();\n let reviewNumZeroIndex = reviewNum - 1;\n tRow.id = \"hg_row\" + questionNum + \"_\" + reviewNumZeroIndex;\n return { priorQuestionNum, tRow, roundNum };\n}", "title": "" }, { "docid": "157da1e0a465016b554ca5387c75c6e3", "score": "0.57066375", "text": "function ImportQuestion(question, editing=false, index=undefined){\n if(!editing){\n index = questionIndex\n var container = document.createElement('div')\n container.innerHTML =\n `<div class=\"d-flex wrap question-container\">\n <div class=\"col-10 displayed-title\">\n <h3 id=\"question-title-${index}\"></h3>\n </div>\n <div class=\"question-btn-box\">\n <button type=\"button\" class=\"btn edit\" data-toggle=\"tooltip\" data-placement=\"bottom\" id=\"edit-${index}\" \n title=\"Редктирай\" onclick=\"OpenQuestionEditor(true, getElementIndex(this))\">\n <img src=\"images/edit.svg\" class=\"image-sm\">\n </button>\n <button type=\"button\" class=\"btn btn-danger\" data-toggle=\"tooltip\" data-placement=\"bottom\" id=\"delete-${index}\" \n title=\"Изтрий\" onclick=\"RemoveQuestion(getElementIndex(this))\">\n <svg width=\"1em\" height=\"1em\" viewBox=\"0 0 16 16\" class=\"bi bi-trash\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z\"/>\n <path fill-rule=\"evenodd\" d=\"M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z\"/>\n </svg>\n </button>\n <button type=\"button\" class=\"btn duplicate\" data-toggle=\"tooltip\" data-placement=\"bottom\" id=\"duplicate-${index}\" \n title=\"Създай копие\" onclick=\"DuplicateQuestion(getElementIndex(this))\">\n <img src=\"images/file_copy.svg\" class=\"image-sm\">\n </button>\n <div class=\"break\"></div>\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"bottom\" id=\"moveup-${index}\" \n title=\"Премести нагоре\" onclick=\"MoveUp(getElementIndex(this))\">\n <img src=\"images/arrow_upward.svg\" class=\"image-sm\">\n </button>\n <button type=\"button\" class=\"btn btn-secondary\" data-toggle=\"tooltip\" data-placement=\"bottom\" id=\"movedown-${index}\" \n title=\"Премести надолу\" onclick=\"MoveDown(getElementIndex(this))\">\n <img src=\"images/arrow_downward.svg\" class=\"image-sm\">\n </button> \n </div>\n </div>\n <div class=\"answers-container\"></div>\n <div class=\"question-info\" id=\"question_info-${index}\"></div>\n <div class=\"question-category\" id=\"question_category-${index}\"></div>\n <div class=\"question-footer d-flex justify-content-between\">\n <div class=\"question-points\" id=\"points-${index}\"></div>\n <div id=\"mandatory-${index}\"></div>\n <div id=\"question_time-${index}\"></div>\n </div>`\n container.setAttribute('class', 'container displayed-question')\n container.setAttribute('id', `question-${index}`)\n questionIndex++\n document.getElementById('questions').appendChild(container)\n $('[data-toggle=\"tooltip\"]').tooltip({ trigger: \"hover\" })\n }\n else{\n var container = document.getElementById('question-'+index)\n let file_div = container.querySelector('.displayed-title .attached-file')\n if(file_div){\n file_div.parentElement.removeChild(file_div)\n }\n container.querySelector('.answers-container').innerHTML=''\n }\n container.setAttribute('type', question.type)\n container.setAttribute('mandatory', question.mandatory)\n container.setAttribute('points', question.points)\n container.setAttribute('question-time', question.time)\n container.setAttribute('question-info', question.info)\n container.setAttribute('question-category', question.category)\n container.setAttribute('case-sensitive', question.case_sensitive)\n container.setAttribute('character-limit', question.character_limit)\n container.setAttribute('print-lines', question.print_lines)\n container.querySelector('.displayed-title h3').innerHTML = question.title;\n if(question.hasOwnProperty('file')){\n let div_tag = document.createElement('div')\n div_tag.setAttribute('class', 'attached-file')\n if(question.file.type==\"image\"){\n let img = document.createElement('img')\n img.src = question.file.src\n img.name = question.file.name\n img.setAttribute('class', 'image-lg')\n div_tag.appendChild(img)\n }\n else{\n let a = document.createElement('a')\n a.href = question.file.src\n a.name = question.file.name\n a.setAttribute('download' ,'')\n a.innerText = question.file.name\n div_tag.appendChild(a)\n }\n\n container.querySelector('.displayed-title').appendChild(div_tag)\n }\n\n let answers_container = container.querySelector('.answers-container')\n if(question.type=='file'){\n let input = document.createElement('input')\n input.setAttribute('type', question.type)\n input.setAttribute('disabled', '')\n answers_container.appendChild(input)\n }\n else if(question.type=='text'){\n let input = document.createElement('input')\n input.setAttribute('type', question.type)\n input.setAttribute('disabled', '')\n input.setAttribute('placeholder', 'Отговор, въведен от попълващия')\n answers_container.appendChild(input)\n let wrapper = document.createElement('div')\n wrapper.textContent = 'Правилни отговори:'\n for(let i=0; i<question.answers.length; i++){\n answer_el = document.createElement('div')\n answer_el.classList.add('correct-answer')\n answer_el.innerHTML = `<i class=\"answer-text\">${question.answers[i].text}</i> - <span class=\"answer-points\">${question.answers[i].points}</span> точки`\n wrapper.appendChild(answer_el);\n }\n answers_container.appendChild(wrapper)\n }\n else if(question.type=='radio' || question.type=='checkbox'){\n for(let i=0; i<question.answers.length; i++){\n let wrapper = document.createElement('div')\n wrapper.setAttribute('class', 'form-check')\n wrapper.setAttribute('id', `question-${index}-answer-${i}`)\n\n let input = document.createElement('input')\n input.setAttribute('class', 'form-check-input')\n input.setAttribute('type', question.type)\n input.setAttribute('id', `question-${index}-displayedInput-${i}`)\n input.setAttribute('value', question.answers[i].correct)\n input.setAttribute('disabled', '')\n\n let label = document.createElement('label')\n label.setAttribute('class', 'form-check-label')\n label.setAttribute('for', `question-${index}-displayedInput-${i}`)\n let answer_text = document.createElement('div')\n answer_text.setAttribute('class', 'answer-text')\n answer_text.textContent = question.answers[i].text\n label.appendChild(answer_text)\n\n if(question.answers[i].hasOwnProperty('file')){\n let div_tag = document.createElement('div')\n div_tag.setAttribute('class', 'attached-file')\n if(question.answers[i].file.type==\"image\"){\n let img = document.createElement('img')\n img.src = question.answers[i].file.src\n img.name = question.answers[i].file.name\n img.setAttribute('class', 'image-lg')\n div_tag.appendChild(img)\n }\n else{\n let a = document.createElement('a')\n a.href = question.answers[i].file.src\n a.name = question.answers[i].file.name\n a.setAttribute('download' ,'')\n a.innerText = question.answers[i].file.name\n div_tag.appendChild(a)\n }\n label.appendChild(div_tag)\n }\n\n wrapper.appendChild(input)\n wrapper.appendChild(label)\n answers_container.appendChild(wrapper)\n }\n }\n if(question.info && question.info!='undefined'){\n container.querySelector('#question_info-'+index).textContent = 'Обяснение: '+question.info\n }\n else if(!question.info && container.querySelector('#question_info-'+index).textContent!=''){\n container.querySelector('#question_info-'+index).textContent=''\n }\n\n if(question.category && question.category!='undefined'){\n container.querySelector('#question_category-'+index).textContent = 'Категория: '+question.category\n }\n else if(!question.category && container.querySelector('#question_category-'+index).textContent!=''){\n container.querySelector('#question_category-'+index).textContent=''\n }\n container.querySelector('#points-'+index).textContent = question.points + ' точки'\n container.querySelector('#mandatory-'+index).textContent = question.mandatory ? 'Задължителен' : 'Незадължителен'\n container.querySelector('#question_time-'+index).textContent = question.time + ' секунди'\n\n questionIndex++\n $('#QuestionEditor').modal('hide')\n UpdateInfo()\n}", "title": "" }, { "docid": "5b67617b0cb0dea73c3403099b7096a6", "score": "0.5640188", "text": "function renderQuestionMultChoice(question_num, question_text, question_key, question_answers) {\n // If adding question show container\n if (quiz_container.style.display === 'none') {\n quiz_container.style.display = 'block';\n }\n\n // Increment the question added index for possible deletion later\n INITIAL_ORDER++;\n\n // Add a new row to display the question\n let tableRowDisplay = document.createElement('tr');\n tableRowDisplay.id = \"tableRow_\" + INITIAL_ORDER;\n quiz_display.appendChild(tableRowDisplay);\n\n let tableDisplay = document.createElement('td');\n tableDisplay.id = \"tableDisplay_\" + INITIAL_ORDER;\n tableRowDisplay.appendChild(tableDisplay);\n\n // Use the correct question_num value to track the question count\n let headerDisplay = document.createElement('h5');\n headerDisplay.innerText = \"Q\" + question_num;\n tableDisplay.appendChild(headerDisplay);\n\n let questionDisplay = document.createElement('i');\n questionDisplay.innerText = question_text;\n tableDisplay.appendChild(questionDisplay);\n\n // Loop to display the associated number of answer strings\n for (let i = 0; i < question_answers.length; i++) {\n let ansDisplay = document.createElement('li');\n ansDisplay.id = 'ansDisplay' + INITIAL_ORDER;\n \n // Add the checkbox to correct answer\n if (question_key == i) {\n ansDisplay.innerHTML = question_answers[i] + \" &#x2611\";\n }\n else {\n ansDisplay.innerHTML = question_answers[i];\n }\n\n // Render the formed answer\n tableDisplay.appendChild(ansDisplay);\n }\n\n // Display the delete button\n let tableDeleteDisplay = document.createElement('td');\n tableDeleteDisplay.id = \"tableDeleteDisplay_\" + INITIAL_ORDER;\n tableDeleteDisplay.innerHTML = \"<button>Delete</button>\";\n tableRowDisplay.appendChild(tableDeleteDisplay);\n tableDeleteDisplay.childNodes[0].classList = 'deleteBtn mdl-button mdl-js-button mdl-button--raised';\n\n // Delete button handler to remove the question for the quiz object and the DOM\n tableDeleteDisplay.childNodes[0].addEventListener('click', (e) => {\n e.preventDefault();\n\n // Find array index of the question to remove\n let qIndex = headerDisplay.innerText.substring(1, headerDisplay.innerText.length);\n qIndex--;\n\n // Remove the question from the quiz object\n quiz.questions.splice(qIndex, 1);\n\n // Remove the displayed question\n tableRowDisplay.remove();\n\n // Update the question count\n questionCount.textContent = --QUESTION_COUNT;\n\n // Remove the submit button if there are no questions\n if (QUESTION_COUNT === 0) {\n quiz_container.style.display = 'none';\n line.style.display = 'none';\n submitBtn.style.display = 'none';\n }\n else {\n // Update the Q numbers of remaining questions\n for (var i = 0, row; row = quiz_display.rows[i]; i++) {\n row.children[0].childNodes[0].innerText = `Q${i + 1}`;\n }\n }\n })\n}", "title": "" }, { "docid": "76b8b033c7bffd04399f15c6a609e2aa", "score": "0.5616697", "text": "row(...buttons) {\n this.inline_keyboard.push(buttons);\n return this;\n }", "title": "" }, { "docid": "6790d5da5c92f9dcaf7b70706fcdab12", "score": "0.55996186", "text": "row(...buttons) {\n this.keyboard.push(buttons);\n return this;\n }", "title": "" }, { "docid": "13ff7724aaea891c8dc0c991a9ba346a", "score": "0.5582553", "text": "function CreateRightSide(props) {\n let questions = [];\n let singleQuestion;\n\n let handleSurveyTitle = (event) => (props.setSurveyTitle(event.target.value));\n\n let swapQuestions = (verse, index) => {\n let temp;\n let list;\n list = [...props.questionList];\n index = parseInt(index);\n\n\n // swap with above\n if (verse === 0) {\n if (index - 1 < 0) {\n return;\n } else {\n temp = list[index - 1];\n list[index - 1] = list[index];\n list[index] = temp;\n props.setQuestionList(list);\n }\n } else {\n // swap with below\n if (index + 1 >= props.questionList.length) {\n return;\n } else {\n temp = list[index + 1];\n list[index + 1] = list[index];\n list[index] = temp;\n props.setQuestionList(list);\n }\n }\n }\n\n let deleteQuestion = (index) => {\n let list;\n list = [...props.questionList];\n\n // remove 1 element/s starting from index element\n list.splice(index, 1);\n props.setQuestionList(list);\n }\n\n // build questions\n for (let index in props.questionList) {\n singleQuestion = props.questionList[index];\n if (singleQuestion.max === -1) {\n // open question\n questions.push(<div key={index}>\n <Row >\n <Col sm={11}>\n <OpenQuestion singleQuestion={singleQuestion} setQuestionList={props.setQuestionList} questionList={props.questionList} index={index} /><br />\n </Col>\n <Col sm={1}>\n <Row>\n <Button className=\"btn btn-md switch-user-left\" variant=\"outline-primary\" onClick={() => { swapQuestions(0, index) }}>{arrowUp}</Button>\n </Row>\n <Row>\n <Button className=\"btn btn-md switch-user-left\" variant=\"outline-primary\" onClick={() => { swapQuestions(1, index) }}>{arrowDown}</Button>\n </Row>\n <Row>\n <Button className=\"btn btn-md switch-user-left\" variant=\"outline-danger\" onClick={() => { deleteQuestion(index) }}>{deleteIcon}</Button>\n </Row>\n <br />\n </Col>\n </Row>\n </div>)\n } else {\n // closed question\n questions.push(<div key={index}>\n <Row >\n <Col sm={11}>\n <ClosedQuestion singleQuestion={singleQuestion} setQuestionList={props.setQuestionList} questionList={props.questionList} index={index} /><br />\n </Col>\n <Col sm={1}>\n <Row>\n <Button className=\"btn btn-md switch-user-left\" variant=\"outline-primary\" onClick={() => { swapQuestions(0, index) }}>{arrowUp}</Button>\n </Row>\n <Row>\n <Button className=\"btn btn-md switch-user-left\" variant=\"outline-primary\" onClick={() => { swapQuestions(1, index) }}>{arrowDown}</Button>\n </Row>\n <Row>\n <Button className=\"btn btn-md switch-user-left\" variant=\"outline-danger\" onClick={() => { deleteQuestion(index) }}>{deleteIcon}</Button>\n </Row>\n </Col>\n\n </Row>\n </div>)\n }\n }\n // Form.Group \"Enter username here...\" textbox: position to the rigth of the container\n return (\n <React.Fragment>\n <Col sm={8} className=\"below-nav vheight-100\">\n <Row>\n <Col sm={8}>\n <Row>\n <Col className=\"form-element\" sm={4}>\n <h3>\n Survey Title\n </h3>\n </Col>\n <Col sm={7}><Form.Control onChange={handleSurveyTitle} value={props.surveyTitle} size=\"md\" placeholder=\"...\" /></Col>\n <Col sm={1}></Col>\n </Row>\n </Col>\n <Col sm={2}>\n <Row><Badge pill variant=\"danger\">{props.errorMessageTitle}</Badge></Row>\n <Row><Badge pill variant=\"danger\">{props.errorMessageAnswers}</Badge></Row>\n <Row><Badge pill variant=\"danger\">{props.errorMessageQuestions}</Badge></Row>\n </Col>\n <Col sm={2}>\n <Form.Group className=\"mb-3\">\n <Button className=\"btn btn-new-survey btn-md btn-block\" variant=\"outline-primary\" onClick={() => { props.checkFieldsAndSubmit() }}>SUBMIT</Button>\n </Form.Group>\n </Col>\n </Row>\n\n <ListGroup variant=\"flush\">\n {questions}\n </ListGroup>\n </Col>\n </React.Fragment>\n )\n}", "title": "" }, { "docid": "407db10f6e51745a1a6bbfded6ce7bb9", "score": "0.5489113", "text": "function add_question(question_data) {\n //create an id = max id existant + 1\n var row_id;\n $.each(question_data, function (key, val) {\n row_id = val;\n });\n var tbl_row = $(document).find(\".table-faq\").find(\"tr\");\n var tbl = \"\";\n tbl += '<tr row_id=\"' + row_id + '\">';\n tbl +=\n '<td ><div class=\"new_row_data faqQuestion bg-secondary rounded\" contenteditable=\"true\" edit_type=\"click\" col_name=\"faqQuestion\"></div></td>';\n tbl +=\n '<td ><div class=\"new_row_data faqAnswer bg-secondary rounded\" contenteditable=\"true\" edit_type=\"click\" col_name=\"faqAnswer\"></div></td>';\n tbl +=\n '<td ><div class=\"new_row_data faqLanguage bg-secondary rounded\" contenteditable=\"true\" edit_type=\"click\" col_name=\"faqLanguage\"></div></td>';\n //--->edit options > start\n tbl += \"<td>\";\n tbl += ' <a href=\"#\" class=\"btn btn-link btn_new\" row_id=\"' + row_id + '\" > Add Entry</a> | ';\n tbl += ' <a href=\"#\" class=\"btn btn-link btn_remove_new_entry\" row_id=\"' + row_id + '\"> Remove</a> ';\n tbl += \"</td>\";\n //--->edit options > end\n\n tbl += \"</tr>\";\n tbl_row.last().after(tbl);\n\n $(document).find(\".table-faq\").find(\"tr\").last().find(\".faqQuestion\").focus();\n }", "title": "" }, { "docid": "3a48ee47edd15e0e7c5a98cd087380d2", "score": "0.5438569", "text": "function RowRenderer(view) {\n\tthis.view = view;\n}", "title": "" }, { "docid": "8c345ca9d8345f895be07511d3a7fdcd", "score": "0.53907686", "text": "insertRowBelow() {\n this.activateMenu(\"Rows►\");\n this.clickMenu(this.menuItems.rowBelow);\n }", "title": "" }, { "docid": "cd45a8c0c98c563470f18e7d1456728a", "score": "0.5375691", "text": "function render(qIndex) {\n questionDiv.innerHTML = \"\";\n ulItem.innerHTML = \"\";\n // For loops to loop through all info in array\n for (var i = 0; i < questions.length; i++) {\n // Appends question title only\n var userQuestion = questions[qIndex].question;\n var userChoices = questions[qIndex].choices;\n questionDiv.textContent = userQuestion;\n };\n // New for each for choices\n userChoices.forEach(function (newItem) {\n var listItem = document.createElement(\"input\");\n listItem.type = \"button\";\n listItem.className =\"btn btn-primary\";\n listItem.style = \"width: 90%; margin-top: 20px; font-size: 15px; text-align:center;\";\n listItem.textContent = newItem;\n listItem.value = newItem;\n questionDiv.appendChild(ulItem);\n ulItem.appendChild(listItem);\n listItem.addEventListener(\"click\", (compare));\n });\n}", "title": "" }, { "docid": "3a65fc8aa6a06880b802d67fef304730", "score": "0.53537875", "text": "function addQuestion() {\n newQuestion = {survey:$('#title').val(),question:$('#question').val(),responses:$('#responses').val(),attribute:$('#question')};\n\n\n // Whenever we create a new question we want to display it for the user to see. To do this we make\n // a new div for the question. The div contains two sub-divs: a left div that shows the text of\n // the question and either a text field for the answer or a set of radio buttons for the answer,\n // and a right div that contains a 'Remove Question' button.\n var newDiv = $('<div>'),\n leftCol = $('<div>').addClass('col-sm-10');\n rightCol = $('<div>').addClass('col-sm-2');\n newPar = $('<p>'),\n radioDiv = $('<div>');\n\n newPar.text(newQuestion.question);\n leftCol.append(newPar);\n\n if(newQuestion.responses.length == 0) {\n radioDiv.append($('<input>').attr('type','text'));\n } else {\n var choices = newQuestion.responses.split(',');\n var n;\n for(n = 0;n < choices.length;n++) {\n var label = $('<label>').addClass('radio-inline');\n label.append($('<input>').attr('type','radio'));\n label.append(choices[n]);\n radioDiv.append(label);\n }\n }\n leftCol.append(radioDiv);\n leftCol.addClass('underline');\n\n // The event handler function for all of our 'Remove Question' buttons is the\n // same function, removeQuestion. The way we differentiate the different buttons\n // is by passing an option second parameter to the JQuery on method that sets up\n // the event handler. That second parameter passes additional data to the event\n // handler that contains the index of the question and the div containing the\n // question. The event handler will use that additional data to handle the remove.\n var removeButton = $('<button>').addClass('btn btn-primary');\n removeButton.text('Remove Question');\n removeButton.click({n:newQuestion.length-1,div:newDiv},removeQuestion);\n rightCol.append(removeButton);\n newDiv.append(leftCol);\n newDiv.append(rightCol);\n\n $('#questions').append(newDiv);\n}", "title": "" }, { "docid": "d0ec511c3fe3d6f8492e1a1d48d24246", "score": "0.5339445", "text": "function DrawRow(row, values, rowIndex){\n\t\t for(var i = 0; i < values.length; i++){\n\t\t var cell = row.insertCell(i);\n\t\t //This is where the object is made, any HTML element can work.\n\t\t cell.innerHTML = \"<input class='cell' type='button' id='\" + rowIndex + \".\" + i + \"' value='\" + values[i] + \"'>\";\n\t\t }\n\t\t}", "title": "" }, { "docid": "2c4c740623351fe50125ce94bbc8db78", "score": "0.5338036", "text": "function ItemRow(id, qty, name, icon_x, icon_y) {\n var parts = util.templateParts('item-row');\n parts['qty'].textContent = '' + qty;\n parts['icon'].style.backgroundPosition = '-' + icon_x + 'rem -' + icon_y + 'rem';\n parts['name'].textContent = name;\n\n widget.Element.call(this, parts['top']);\n\n this.id = id;\n this.qty = qty;\n this.quantityDiv = parts['qty'];\n}", "title": "" }, { "docid": "0f35d030403f968eed07857642b88a41", "score": "0.5301018", "text": "function renderQuestion() {\n var q = questionsArray[currentQuestion];\n\n questionDiv.innerHTML = \"<p>\" + q.question + \"</p>\";\n answerAButton.innerHTML = q.answerA;\n answerBButton.innerHTML = q.answerB;\n answerCButton.innerHTML = q.answerC;\n answerDButton.innerHTML = q.answerD;\n}", "title": "" }, { "docid": "d73653a2367cea414e243b8de28baef9", "score": "0.5278987", "text": "function renderQuestionFillBlank(question_num, question_text, question_key) {\n // If adding question show container\n if (quiz_container.style.display === 'none') {\n quiz_container.style.display = 'block';\n }\n\n // Increment the question added index for possible deletion later\n INITIAL_ORDER++;\n\n // Add a new row to display the question\n let tableRowDisplay = document.createElement('tr');\n tableRowDisplay.id = \"tableRow_\" + INITIAL_ORDER;\n quiz_display.appendChild(tableRowDisplay);\n\n let tableDisplay = document.createElement('td');\n tableDisplay.id = \"tableDisplay_\" + INITIAL_ORDER;\n tableRowDisplay.appendChild(tableDisplay);\n\n // Use the correct question_num value to track the question count\n let headerDisplay = document.createElement('h5');\n headerDisplay.innerText = \"Q\" + question_num;\n tableDisplay.appendChild(headerDisplay);\n\n let questionDisplay1 = document.createElement('i');\n questionDisplay1.innerText = `${question_text[0]} `;\n tableDisplay.appendChild(questionDisplay1);\n\n let ansDisplay = document.createElement('i');\n ansDisplay.innerText = `${question_key}`;\n ansDisplay.style.textDecoration = 'underline';\n tableDisplay.appendChild(ansDisplay);\n\n let questionDisplay2 = document.createElement('i');\n questionDisplay2.innerText = ` ${question_text[1]}`;\n tableDisplay.appendChild(questionDisplay2);\n\n // Display the delete button\n let tableDeleteDisplay = document.createElement('td');\n tableDeleteDisplay.id = \"tableDeleteDisplay_\" + INITIAL_ORDER;\n tableDeleteDisplay.innerHTML = \"<button>Delete</button>\";\n tableRowDisplay.appendChild(tableDeleteDisplay);\n tableDeleteDisplay.childNodes[0].classList = 'deleteBtn mdl-button mdl-js-button mdl-button--raised';\n\n // Delete button handler to remove the question for the quiz object and the DOM\n tableDeleteDisplay.childNodes[0].addEventListener('click', (e) => {\n e.preventDefault();\n\n // Find array index of the question to remove\n let qIndex = headerDisplay.innerText.substring(1, headerDisplay.innerText.length);\n qIndex--;\n\n // Remove the question from the quiz object\n quiz.questions.splice(qIndex, 1);\n\n // Remove the displayed question\n tableRowDisplay.remove();\n\n // Update the question count\n questionCount.textContent = --QUESTION_COUNT;\n\n // Remove the submit button if there are no questions\n if (QUESTION_COUNT === 0) {\n quiz_container.style.display = 'none';\n line.style.display = 'none';\n submitBtn.style.display = 'none';\n }\n else {\n // Update the Q numbers of remaining questions\n for (var i = 0, row; row = quiz_display.rows[i]; i++) {\n row.children[0].childNodes[0].innerText = `Q${i + 1}`;\n }\n }\n })\n}", "title": "" }, { "docid": "8852ba22445f1af8b73e5dbef3f52442", "score": "0.52578044", "text": "function addQuestions(id, number, points, question, rightAnswer, ...options) {\n // <div class=\"row\">\n var divRow = document.createElement(\"div\");\n divRow.classList.add(\"row\");\n\n // <div class=\"list-group\">\n var divListGroup = document.createElement(\"div\");\n divListGroup.classList.add(\"list-group\");\n\n // <li class=\"list-group-item\">\n var liQuestion = document.createElement(\"li\");\n liQuestion.classList.add(\"list-group-item\");\n\n // <h3>\n var questionContent = document.createTextNode(number + \".\" + question);\n var h3Question = document.createElement(\"h3\");\n h3Question.appendChild(questionContent);\n h3Question.setAttribute(\"onmouseover\", \"displayElement('modify-question-\" + number + \"');\" + \"displayElement('delete-question-\" + number + \"');\");\n h3Question.setAttribute(\"onmouseout\", \"hideElement('modify-question-\" + number + \"');\" + \"hideElement('delete-question-\" + number + \"');\");\n\n // <small></small>\n var pointContent = document.createTextNode(\"(\" + points + \"分)\");\n var smallPoint = document.createElement(\"small\");\n smallPoint.appendChild(pointContent);\n\n // <small></small>\n var smallModifyQuetion = document.createElement(\"small\");\n var aModifyQuestion = document.createElement(\"a\");\n aModifyQuestion.setAttribute(\"id\", \"modify-question-\" + number);\n aModifyQuestion.setAttribute(\"style\", \"display: none\");\n aModifyQuestion.classList.add(\"glyphicon\");\n aModifyQuestion.classList.add(\"glyphicon-pencil\");\n aModifyQuestion.setAttribute(\"onclick\", \"callModifyQuestionModel(\" + id + \", \" + number + \", \" + points + \");\");\n aModifyQuestion.setAttribute(\"href\", \"javascript:void(0)\");\n smallModifyQuetion.appendChild(aModifyQuestion);\n\n // <small></small>\n var smallDeleteQuetion = document.createElement(\"small\");\n var aDeleteQuestion = document.createElement(\"a\");\n aDeleteQuestion.setAttribute(\"id\", \"delete-question-\" + number);\n aDeleteQuestion.setAttribute(\"style\", \"display: none\");\n aDeleteQuestion.classList.add(\"glyphicon\");\n aDeleteQuestion.classList.add(\"glyphicon-trash\");\n aDeleteQuestion.setAttribute(\"onclick\", \"callDeleteQuestionModel(\" + id + \");\");\n aDeleteQuestion.setAttribute(\"href\", \"javascript:void(0)\");\n smallDeleteQuetion.appendChild(aDeleteQuestion);\n\n // </h3>\n h3Question.appendChild(smallPoint);\n h3Question.appendChild(smallDeleteQuetion);\n h3Question.appendChild(smallModifyQuetion);\n\n // </li>\n liQuestion.appendChild(h3Question);\n divListGroup.appendChild(liQuestion);\n\n var optionMark = new Array(\n 'A', 'B', 'C', 'D', 'E', 'F', 'G',\n 'H', 'I', 'J', 'K', 'L', 'M', 'N',\n 'O', 'P', 'Q', 'R', 'S', 'T',\n 'U', 'V', 'W', 'X', 'Y', 'Z');\n\n // add Question content\n var aQuestionContent = document.createElement(\"a\");\n var pureQuestionContent = document.createTextNode(question);\n aQuestionContent.setAttribute(\"id\", \"question-\" + number);\n aQuestionContent.setAttribute(\"style\", \"display: none\");\n aQuestionContent.appendChild(pureQuestionContent);\n divListGroup.appendChild(aQuestionContent);\n\n // add Question point\n var aQuestionPoint = document.createElement(\"a\");\n var pointValue = document.createTextNode(points + \"\");\n aQuestionPoint.setAttribute(\"id\", \"question-point-\" + number);\n aQuestionPoint.setAttribute(\"style\", \"display: none\");\n aQuestionPoint.appendChild(pointValue);\n divListGroup.appendChild(aQuestionPoint);\n\n // add option sum\n var aOptionSum = document.createElement(\"a\");\n var optionSumText = document.createTextNode(options.length + \"\");\n aOptionSum.setAttribute(\"id\", \"option-sum-\" + number);\n aOptionSum.setAttribute(\"style\", \"display: none\");\n aOptionSum.appendChild(optionSumText);\n divListGroup.appendChild(aOptionSum);\n\n // add options\n for (var i = 1; i <= options.length; i++) {\n var optionContent = document.createTextNode(optionMark[i - 1] + \".\" + options[i - 1]);\n var aOption = document.createElement(\"a\");\n aOption.appendChild(optionContent);\n aOption.setAttribute(\"id\", \"option-\" + number + \"-\" + i);\n aOption.setAttribute(\"href\", \"javascript:void(0)\");\n aOption.classList.add(\"list-group-item\");\n if (options[i - 1] == rightAnswer) {\n aOption.classList.add(\"list-group-item-success\");\n }\n divListGroup.appendChild(aOption);\n }\n\n divRow.appendChild(divListGroup);\n var divAddQuestion = document.getElementById(\"add-question\");\n divAddQuestion.parentNode.insertBefore(divRow, divAddQuestion);\n}", "title": "" }, { "docid": "bf268a34cf942c1b288435318d2d8234", "score": "0.5235542", "text": "function stdOptRow(question, btnName, btn1Label, btn2Label, enabled, wrapper) {\n // Display show/hide links\n var row = document.createElement(\"div\");\n row.className = \"cpiggy_rowDiv\";\n var label = document.createElement(\"div\");\n label.textContent = question;\n label.className = \"cpiggy_label\";\n var ctlDiv = document.createElement(\"div\");\n ctlDiv.className = \"cpiggy_ctlDiv\";\n var noDiv = document.createElement(\"div\");\n noDiv.className = \"cpiggy_ctl1\";\n var no = document.createElement(\"input\");\n no.type = \"radio\";\n no.name = btnName;\n no.value = \"false\";\n no.checked = true;\n noDiv.appendChild(no);\n var lbl = document.createElement(\"p\"); lbl.textContent = btn1Label; lbl.className = \"cpiggy_inline\";\n noDiv.appendChild(lbl);\n var yesDiv = document.createElement(\"div\");\n yesDiv.className = \"cpiggy_ctl2\";\n var yes = document.createElement(\"input\");\n yes.type = \"radio\";\n yes.name = btnName;\n yes.value = \"true\";\n yes.checked = enabled;\n yes.className = \"cpiggy_ctl2\";\n yesDiv.appendChild(yes);\n var lbl = document.createElement(\"p\"); lbl.textContent = btn2Label; lbl.className = \"cpiggy_inline\";\n yesDiv.appendChild(lbl);\n ctlDiv.appendChild(noDiv);\n ctlDiv.appendChild(yesDiv);\n row.appendChild(label);\n row.appendChild(ctlDiv);\n wrapper.appendChild(row);\n wrapper.appendChild(br);\n }", "title": "" }, { "docid": "74887e349db44e56c51bc7058551b77b", "score": "0.52341235", "text": "function renderQuestionTF(question_num, question_text, tfValue) {\n // If adding question show container\n if (quiz_container.style.display === 'none') {\n quiz_container.style.display = 'block';\n }\n\n // Increment the question added index for possible deletion later\n INITIAL_ORDER++;\n\n // Add a new row to display the question\n let tableRowDisplay = document.createElement('tr');\n tableRowDisplay.id = \"tableRow_\" + INITIAL_ORDER;\n quiz_display.appendChild(tableRowDisplay);\n\n let tableDisplay = document.createElement('td');\n tableDisplay.id = \"tableDisplay_\" + INITIAL_ORDER;\n tableRowDisplay.appendChild(tableDisplay);\n\n // Use the correct question_num value to track the question count\n let headerDisplay = document.createElement('h5');\n headerDisplay.innerText = \"Q\" + question_num;\n tableDisplay.appendChild(headerDisplay);\n\n let questionDisplay = document.createElement('i');\n questionDisplay.className = 'question-list';\n questionDisplay.innerText = question_text;\n tableDisplay.appendChild(questionDisplay);\n\n let ansTrueDisplay = document.createElement('li');\n ansTrueDisplay.id = 'ansTrueDisplay' + INITIAL_ORDER;\n ansTrueDisplay.innerHTML = \"True \" + (tfValue ? \"&#x2611\" : \"\");\n tableDisplay.appendChild(ansTrueDisplay);\n\n let ansFalseDisplay = document.createElement('li');\n ansFalseDisplay .id = 'ansFalseDisplay' + INITIAL_ORDER;\n ansFalseDisplay .innerHTML = \"False \" + (tfValue ? \"\" : \"&#x2611\");\n tableDisplay.appendChild(ansFalseDisplay);\n\n // Display delete button\n let tableDeleteDisplay = document.createElement('td');\n tableDeleteDisplay.id = \"tableDeleteDisplay_\" + INITIAL_ORDER;\n tableDeleteDisplay.innerHTML = \"<button>Delete</button>\";\n tableRowDisplay.appendChild(tableDeleteDisplay);\n tableDeleteDisplay.childNodes[0].classList = 'deleteBtn mdl-button mdl-js-button mdl-button--raised';\n\n // Delete button handler to remove the question for the quiz object and the DOM\n tableDeleteDisplay.childNodes[0].addEventListener('click', (e) => {\n e.preventDefault();\n\n // Find array index of the question to remove\n let qIndex = headerDisplay.innerText.substring(1, headerDisplay.innerText.length);\n qIndex--;\n\n // Remove the question from the quiz object\n quiz.questions.splice(qIndex, 1);\n\n // Remove the displayed question\n tableRowDisplay.remove();\n\n // Update the question count\n questionCount.textContent = --QUESTION_COUNT;\n\n // Remove the submit button if there are no questions\n if (QUESTION_COUNT === 0) {\n quiz_container.style.display = 'none';\n line.style.display = 'none';\n submitBtn.style.display = 'none';\n }\n else {\n // Update the Q numbers of remaining questions\n for (var i = 0, row; row = quiz_display.rows[i]; i++) {\n row.children[0].childNodes[0].innerText = `Q${i + 1}`;\n }\n }\n })\n}", "title": "" }, { "docid": "66a5288d9587cc2f1adf569d1df00cbd", "score": "0.52332604", "text": "onQuestionRowClickDelete(question_id,index){\n\t\treturn function (event) {\n\t\t\tvar data = new FormData();\t\t\t\n\t\t\tdata.append('json',JSON.stringify({question_id : question_id}));\n\t\t\tfetch (\"http://buzzle.chrysalis.world/buzzleConceptCards-api/index.php/client/deleteQuestion?key=htn6ASfBr4X7GF29uCciOPeDaysWjJMx\",{\n\t\t\t\tmethod:'POST',\n\t\t\t\tbody:data \n\t\t\t})\t\t\t\n .then(response => response.json())\n .then(json=>{ \n if(json['status'] == 'success'){\n\t\t\t\t\tconst questions = this.state.questions;\n\t\t\t\t\tquestions.splice(index, 1);\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tquestions:questions\n\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t\talert(json['message']);\n\t\t\t\t}\n })\n\t\t}.bind(this)\n\t}", "title": "" }, { "docid": "db157750b9992a26de70aad7dbddd3ab", "score": "0.5232136", "text": "function renderQuestion() {\n mainContentEl.innerHTML = \"\";\n\n if(currentQuestionIndex === questions.length) {\n renderEnd();\n }\n\n else {\n // Render question\n var questionEl = document.createElement(\"h2\");\n questionEl.textContent = questions[currentQuestionIndex].question;\n mainContentEl.append(questionEl);\n\n // Render list of answers\n var ul = document.createElement(\"ul\");\n mainContentEl.append(ul);\n\n // Loops through question bank and generates a button element for each choice\n for(var i = 0; i < questions[currentQuestionIndex].answers.length; i++) {\n\n var button = document.createElement(\"button\");\n button.classList.add(\"button\");\n if (questions[currentQuestionIndex].answers[i].correct) {\n button.setAttribute(\"correct\", true);\n }\n button.textContent = `${i+1}. ${questions[currentQuestionIndex].answers[i].text}`;\n\n button.addEventListener(\"click\", buttonClick);\n \n mainContentEl.appendChild(button);\n }\n\n currentQuestionIndex++; //increment currentQuestionIndex\n }\n}", "title": "" }, { "docid": "849d085d7ecc539bac0a0a9f2ad30c40", "score": "0.5221587", "text": "deleteRow(state, rowIndex) {\n state.currentQuestionInfo.rows.splice(rowIndex, 1);\n }", "title": "" }, { "docid": "ba8571a7839d2012fe46b274c40ca4f8", "score": "0.5220708", "text": "function renderQuestions(){\n document.querySelector('#question-header').textContent = questions[qIndex].q;\n document.querySelector('#button1').textContent = questions[qIndex].ch[0];\n document.querySelector('#button2').textContent = questions[qIndex].ch[1];\n document.querySelector('#button3').textContent = questions[qIndex].ch[2];\n document.querySelector('#button4').textContent = questions[qIndex].ch[3];\n}", "title": "" }, { "docid": "9e667c9dea1a335a5d7ee07a96188b69", "score": "0.5218413", "text": "render() {\n return (\n <div className=\"part3\">\n {(this.props.editable)?(\n <button \n onClick = {() => this.props.removeQuestion(this.props.index)}\n disabled = {!this.props.editable}\n >&#10007;</button>\n ):null}\n </div>\n )\n }", "title": "" }, { "docid": "149be72cf0c6a5d32b8aebb81bd51958", "score": "0.5191516", "text": "function Button({questions, qNum}){\n const btn = questions[qNum].answers.map((i, index) => (<button \n style={{backgroundColor: `${selected[qNum] === index+1? defaultColor : selectedColor}`}} \n onClick={(e) => handelAnswerClick(i.id, qNum)} \n key={index}>{i.answer}</button>\n ))\n return btn\n }", "title": "" }, { "docid": "005378187891c4b39c5d6c188801c6be", "score": "0.51874775", "text": "function renderQuestion() {\n tareas.innerHTML = `<div class=\"list-group-item\" id=\"w\" data-identificador=\"1\">\n <h5 class=\"mb-0\">\n ${Questions[control.page][0]}\n </h5>\n </div>\n \n <div class=\"list-group-item d-flex\" id=\"x\" data-identificador=\"2\">\n <h5 class=\"mb-0\">\n ${Questions[control.page][1]}\n </h5>\n </div>\n \n <div class=\"list-group-item d-flex\" id=\"y\" data-identificador=\"3\">\n <h5 class=\"mb-0\">\n ${Questions[control.page][2]}\n </h5>\n </div>\n \n <div class=\"list-group-item d-flex\" id=\"z\" data-identificador=\"4\">\n <h5 class=\"mb-0\">\n ${Questions[control.page][3]}\n </h5>\n </div>`;\n\n //Sort the list according to sort state in controller\n sortable.sort(control.order[control.page]);\n}", "title": "" }, { "docid": "01ce7e5df6e2b1343ef45ecdcba64d14", "score": "0.5185714", "text": "function createRootQTable(givenX, givenRootQText, givenRootQTime, givenRootQFeedback)\r\n{\r\n var rootQTable = document.createElement('table');\r\n rootQTable.setAttribute('border', 1);\r\n rootQTable.setAttribute('id', 'rootQTable' + givenX);\r\n rootQTable.setAttribute('class', 'rootQTable');\r\n\r\n //attributes for implemenation of data transfer to the data base\r\n rootQTable.setAttribute('data-x', givenX);\r\n\r\n //y-coordinate is always zero\r\n rootQTable.setAttribute('data-y', '0');\r\n rootQTable.setAttribute('data-xp', givenX);\r\n\r\n\r\n // add header row\r\n var headerRow = rootQTable.insertRow(0);\r\n\r\n //add cells to the row\r\n\r\n //add dragHandleCell\r\n var dragHandleCell = headerRow.insertCell(0);\r\n dragHandleCell.setAttribute('rowspan', 2);\r\n dragHandleCell.setAttribute('class', 'dragHandleCell');\r\n\r\n\r\n //this cell is initially inivisible\r\n\r\n //when 'edit root question order' is pressed, this should appear\r\n\r\n //add drag handle to it\r\n var dragHandle = document.createElement('button');\r\n dragHandle.setAttribute('class', 'dragHandleRoot');\r\n dragHandle.setAttribute('data-editMode', '0');\r\n dragHandle.setAttribute('onClick', 'editRootQOrder(this)');\r\n\r\n dragHandleCell.appendChild(dragHandle);\r\n\r\n var buttonCell = headerRow.insertCell(1);\r\n\r\n //button for deleting the question\r\n var deleteRootQButton = document.createElement('input');\r\n deleteRootQButton.setAttribute('class', 'deleteRootQButton');\r\n deleteRootQButton.setAttribute('type', 'button');\r\n deleteRootQButton.setAttribute('value', 'X');\r\n deleteRootQButton.setAttribute('data-x', givenX);\r\n deleteRootQButton.setAttribute('data-y', '0');\r\n deleteRootQButton.setAttribute('onClick', 'deleteRootQuestion(this)');\r\n\r\n\r\n //append the button to the cell\r\n buttonCell.appendChild(deleteRootQButton);\r\n buttonCell.setAttribute('class', 'buttonCell');\r\n\r\n var questionHeaderCell = headerRow.insertCell(2);\r\n questionHeaderCell.innerHTML = \"<th>Question</th>\";\r\n\r\n var timeLimitHeaderCell = headerRow.insertCell(3);\r\n timeLimitHeaderCell.innerHTML = \"<th>Time Limit</th>\";\r\n\r\n //another header for answers\r\n var answersHeaderCell = headerRow.insertCell(4);\r\n answersHeaderCell.innerHTML = \"<th> Answers </th>\"\r\n\r\n // add question Row\r\n var questionRow = rootQTable.insertRow(1);\r\n var indexCell = questionRow.insertCell(0);\r\n indexCell.setAttribute('class', 'indexCell');\r\n indexCell.innerHTML = \"Q\" + ( givenX + 1 );\r\n\r\n var questionCell = questionRow.insertCell(1);\r\n questionCell.setAttribute('class', 'questionCell');\r\n var questionField = document.createElement('textarea');\r\n questionField.setAttribute('type', 'text');\r\n questionField.setAttribute('class', 'questionField');\r\n questionField.setAttribute('placeholder', 'question *');\r\n questionField.setAttribute('required', true);\r\n questionField.setAttribute('oninvalid', \"this.setCustomValidity('Question must be filled')\");\r\n questionField.setAttribute('oninput',\"this.setCustomValidity('')\");\r\n questionField.setAttribute('maxlength', 100);\r\n questionField.setAttribute('name', \"questionField\");\r\n questionField.setAttribute('onkeydown', 'return (event.keyCode!=13);');\r\n\r\n\r\n\r\n if(givenRootQText != null)\r\n questionField.innerHTML = givenRootQText;\r\n\r\n questionCell.appendChild(questionField);\r\n\r\n var timeLimitCell = questionRow.insertCell(2);\r\n timeLimitCell.appendChild(createTimeLimitList(givenRootQTime));\r\n timeLimitCell.setAttribute('class', 'timeLimitCell');\r\n\r\n\r\n var answersCell = questionRow.insertCell(3);\r\n answersCell.appendChild(createAnswersTable(givenX, '0', givenRootQFeedback, true));\r\n\r\n //append the checkError p tag as well\r\n var checkErrorParag = document.createElement('p');\r\n checkErrorParag.setAttribute('class', 'checkErrorParag');\r\n checkErrorParag.style.display = \"block\";\r\n answersCell.appendChild(checkErrorParag);\r\n\r\n return rootQTable;\r\n}", "title": "" }, { "docid": "acd6bcb59914cf64b0b9e1db4da1da12", "score": "0.51669925", "text": "function showQuestion() {\n containerElement.innerHTML = \"\";\n const questionElement = document.createElement(\"h2\");\n questionElement.innerHTML = questions[currentQuestion].question;\n \n createRow(1, questionElement);\n\n let answerElement = \"\";\n \n for(let i=0; i < questions[currentQuestion].choices.length; i++){\n\n answerElement = document.createElement(\"button\");\n answerElement.setAttribute(\"class\", \"btn btn-info btn-block m-1\");\n answerElement.innerHTML = questions[currentQuestion].choices[i];\n createRow(1, answerElement)\n\n answerElement.addEventListener(\"click\", function(){\n questions[currentQuestion].userAnswer = questions[currentQuestion].choices[i];\n checkAnswer();\n switchQuestion();\n })\n }\n}", "title": "" }, { "docid": "2e74ab7cccd858c4b0719ab237323d4d", "score": "0.51633024", "text": "function deleteItem (e) {\n let theButtonClicked = e.currentTarget;\n let rowToDelete = theButtonClicked.closest(\".flexContainer\");\n rowToDelete.remove()\n // let parent = document.getElementById(\"bodyClass\");\n // parent.removeChild(rowToDelete);\n}", "title": "" }, { "docid": "be59895e69c2d3eba5e74c1277e6bbc7", "score": "0.5147434", "text": "function drawDelete() {\n drawButton(0.95, 0.7, 0.09, 0.09, '<', 'black', 'white');\n }", "title": "" }, { "docid": "905b1ad209413b06a3d64380f2a6b756", "score": "0.5115956", "text": "function render() {\n // clears existing content\n quizArea.innerHTML = \"\";\n answerArea.innerHTML = \"\";\n // append question \n var userQuestion = myQuestions[questionIndex].info;\n var userChoices = myQuestions[questionIndex].answers;\n quizArea.textContent = userQuestion;\n\n // new for each for question\n quizArea.appendChild(answerArea);\n userChoices.forEach(function (newItem) {\n var listItem = document.createElement(\"button\");\n listItem.textContent = newItem;\n answerArea.appendChild(listItem);\n listItem.addEventListener(\"click\", (compare));\n })\n}", "title": "" }, { "docid": "460679d65e26f6c6e91b06ba431e8740", "score": "0.510826", "text": "render() {\n const arrayOfFeedbackItems = this.props.feedbackArray.map( (feedback, index) => {\n return(\n <TableRow key={index}>\n <TableCell>{feedback.feeling}</TableCell>\n <TableCell>{feedback.understanding}</TableCell>\n <TableCell>{feedback.support}</TableCell>\n <TableCell>{feedback.comments}</TableCell>\n <TableCell>\n <button onClick={() => this.props.handleClickOpen(feedback.id)}>Delete</button>\n </TableCell>\n </TableRow>\n )\n })\n return (\n <TableBody>{arrayOfFeedbackItems}</TableBody>\n );\n }", "title": "" }, { "docid": "fe220693c636b0257c9380c73e200d3d", "score": "0.5084126", "text": "function QuestionOptionHorizontal({\n handleInputChange,\n title,\n tooltipConfig,\n tooltipId,\n questionConfig,\n value,\n isInvalid,\n isVisited,\n selectIdPrefix,\n}) {\n const questionItems = questionConfig.questions.map((question) => (\n <li\n key={question.value}\n className={value === question.value ? 'selected' : ''}\n >\n <input\n type=\"radio\"\n name={questionConfig.name}\n id={`${selectIdPrefix}${question.value}`}\n value={question.value}\n checked={value === question.value}\n onChange={handleInputChange}\n />\n\n { question.subTitle.length > 0 && (\n <div className=\"question-title-wrapper\">\n <div className=\"question-title\">\n <label htmlFor={`${selectIdPrefix}${question.value}`}>{question.title}</label>\n </div>\n <div className=\"question-subtitle\">\n <label htmlFor={`${selectIdPrefix}${question.value}`}>{question.subTitle}</label>\n </div>\n </div>\n )}\n\n { question.subTitle.length === 0 && (\n <label htmlFor={`${selectIdPrefix}${question.value}`}>{question.title}</label>\n )}\n </li>\n ));\n\n return (\n <div className=\"question-option-horizontal-container\">\n <TooltipQuestionHeading title={title} tooltipConfig={tooltipConfig} tooltipId={tooltipId} />\n <ul>\n {questionItems}\n </ul>\n\n <ValidationMessage isInvalid={isInvalid} isVisited={isVisited} validationMessage=\"Select a response to continue\" />\n </div>\n );\n}", "title": "" }, { "docid": "e488ee071c90321f6810258afa35d683", "score": "0.5083268", "text": "function renderQuestion() {\n mainContentEl.innerHTML = \"\";\n if (questionCount > 4){\n clearInterval(interval);\n timerEl.innerHTML = \"Time: \" + countDown;\n gameOver();\n }\n else {\n questionEl = document.createElement(\"h4\"); \n questionEl.innerText = questionArr[questionCount][\"question\"];\n mainContentEl.append(questionEl);\n divEl = document.createElement(\"div\");\n divEl.setAttribute(\"class\", \"btn-group-vertical\"); \n for (var i = 0; i < questionArr[questionCount][\"answers\"].length; i++){\n answersEl = document.createElement(\"button\"); \n answersEl.innerText = questionArr[questionCount][\"answers\"][i];\n answersEl.setAttribute(\"class\", \"btn-group-vertical\"); \n answersEl.setAttribute(\"data-index\", i);\n divEl.appendChild(answersEl);\n }\n mainContentEl.append(divEl);\n }\n}", "title": "" }, { "docid": "e83589032dba82c6cd25b107943c451a", "score": "0.50580645", "text": "function update_buttons(rowdelta)\r\n\t\t{\r\n\t\t\t// Update rows if a delta is provided\r\n\t\t\trows = rows + (rowdelta || 0);\r\n\t\t\t// Disable the add button if maxRows is set and we have that many rows\r\n\t\t\t// $add_btn.attr('disabled',(!options.maxRows || (rows < options.maxRows))?false:true);\r\n\t\t\t// Show remove button if we've added rows and allowDelete is set\r\n\t\t\t(options.allowDelete && (rows > 1))? $del_btn.show(): $del_btn.hide();\r\n\t\t}", "title": "" }, { "docid": "1850bfbac52b4bc9b5f33f3f5e645f93", "score": "0.50565803", "text": "add_row(index, name, value) {\n let row = new __WEBPACK_IMPORTED_MODULE_0__Table_row_js__[\"a\" /* default */](this.tbody, index, name, value);\n row.del = document.createElement('td');\n row.del__icon = document.createElement('span');\n row.del__icon.className = 'glyphicon glyphicon-trash float-right';\n\n row.del__icon.addEventListener('click', () => {\n this.del_row(row.index.innerHTML);\n });\n\n row.tr.onmousedown = e => {\n this.drag_el(e);\n };\n row.tr.onmousemove = e => {\n this.move_el(e);\n };\n row.tr.onmouseup = e => {\n this.drop_el(e);\n };\n\n document.onmouseup = e => {\n if (this.drag.avatar) {\n this.drag.avatar.rollback();\n this.drag = {};\n }\n };\n\n row.del.appendChild(row.del__icon);\n row.tr.appendChild(row.del);\n }", "title": "" }, { "docid": "b2e2b0b19703bd90bb92ce5a18b5e274", "score": "0.5055188", "text": "function addQuestion(e) {\r\n\t\r\n\tconst questionsContainer = e.target\r\n\t .parentElement\r\n\t .querySelector('.questions');\r\n\t\r\n\tconst questionId = questionsContainer\r\n .querySelectorAll('.question').length + 1;\r\n\t\r\n\tconst newQuestionName = `question_${questionId}`;\r\n\tconst newAnswerName = `answer_${questionId}_1`;\r\n\tconst newCheckboxName = `box_${questionId}_1`;\r\n\tconst newAnswersButtonName = `answerButton_question${questionId}`;\r\n\r\n\tconst newQuestionElement = document.createElement('input');\r\n\tconst newAnswerElement = document.createElement('input');\r\n\tconst newCheckboxElement = document.createElement('input');\r\n\tconst newAnswersButton = document.createElement('input');\r\n\tconst newAnswersContainer = document.createElement('div');\r\n\tconst newQuestionContainer = document.createElement('div');\r\n\t\r\n\tconst questionText = document.createElement('strong');\r\n\tconst answerText = document.createElement('strong');\r\n\tconst br = document.createElement('br');\r\n\t\r\n\tconst answersLoc = questionsContainer.getAttribute('id').split('_')[1];\r\n\t\r\n\tquestionText.innerHTML+=questionsContainer.getAttribute('id').split('_')[0]+questionId+\": \";\r\n\tanswerText.innerHTML+=answersLoc+\"1: \";\r\n\r\n\tnewQuestionElement.size = 45;\r\n\tnewQuestionElement.name = newQuestionName;\r\n\tnewQuestionElement.required = 'required';\r\n\tnewQuestionElement.type = 'text';\r\n\tnewQuestionElement.classList.add('questionInput');\r\n\t\r\n\tnewAnswerElement.size = 45;\r\n\tnewAnswerElement.name = newAnswerName;\r\n\tnewAnswerElement.required = 'required';\r\n\tnewAnswerElement.type = 'text';\r\n\tnewAnswerElement.classList.add('answer');\r\n\r\n\tnewCheckboxElement.type= 'checkbox';\r\n\tnewCheckboxElement.name = newCheckboxName;\r\n\tnewCheckboxElement.value = 'correct';\r\n\t\t\r\n\tnewAnswersButton.classList.add('answers');\r\n\tnewAnswersButton.type = 'button';\r\n\tnewAnswersButton.name = newAnswersButtonName;\r\n\tnewAnswersButton.value = questionsContainer.getAttribute('id').split('_')[2];\r\n\tnewAnswersButton.setAttribute('onclick','addAnswer(event);');\r\n\t\t\r\n\tnewAnswersContainer.classList.add('answers');\r\n\t\t\r\n\tnewAnswersContainer.appendChild(answerText);\r\n\tnewAnswersContainer.appendChild(newAnswerElement);\r\n\tnewAnswersContainer.appendChild(newCheckboxElement);\r\n\t\r\n\tnewQuestionContainer.classList.add('question');\r\n\t\t\r\n\tnewQuestionContainer.appendChild(questionText);\r\n\tnewQuestionContainer.appendChild(newQuestionElement);\r\n\tnewQuestionContainer.appendChild(newAnswersContainer);\r\n\tnewQuestionContainer.appendChild(newAnswersButton);\r\n\t\r\n\tquestionsContainer.appendChild(newQuestionContainer);\r\n\tquestionsContainer.appendChild(\"asd\");\r\n\r\n}", "title": "" }, { "docid": "54e7a903f73a7ae99601a4be8a444378", "score": "0.50549054", "text": "function EditSideBar(props) {\n const {\n url,\n currQno,\n quizQuestions,\n handleCardClick,\n addNewQuestion,\n handleDelete,\n } = props;\n return (\n <div className={styles.side_container}>\n {/* Create Clickable Card for each question */}\n <div className={styles.questions_list_container}>\n {quizQuestions && quizQuestions.map((q) => <QuestionCard url={url} quizID={q.quizID} currQno={currQno} key={q.qno} qno={q.qno} question={q.question} handleDelete={handleDelete} onClick={handleCardClick}>{' '}</QuestionCard>)}\n </div>\n <div className={styles.add_button}>\n <Button\n aria-label=\"add-question\"\n className={styles.edit_button}\n variant=\"contained\"\n color=\"primary\"\n onClick={addNewQuestion}\n >\n +\n </Button>\n </div>\n </div>\n );\n}", "title": "" }, { "docid": "2cf1e7aeb277662cbb24075e4b6526a1", "score": "0.5044789", "text": "function question() {\n\t\t// search ques[quesIndex] for question, corresponding answers, correct answer\n\t\tvar question = ques[quesIndex].question;\n\t\tvar answer = ques[quesIndex].answers;\n\n\t\t// append <p> class h4 question\n\t\t$(\".trivia\").append(openRow + \"<p class='h3 question'>\" + question + \"</p>\" + closeRow);\n\n\t\t// append <div> class answer\n\t\t\t// append the 4 answers\n\t\t\t// \t\t- for loop\n\t\t\t//\t\t- use button (class btn btn-secondary btn-lg answer) \n\t\tfor (var i = 0; i < 4; i++) {\n\t\t\t$(\".trivia\").append(openRow + \"<button class='btn btn-secondary btn-lg answers mb-2'>\" + answer[i] + \"</button>\" + closeRow);\n\t\t}\n\n\t\t// result = correct answer\n\t\tresult = ques[quesIndex].correct;\n\t}", "title": "" }, { "docid": "4f73d4c74ea037ff94f8b85bd8193b4c", "score": "0.50412136", "text": "render() {\n const feedback = this.props.feedback;\n return (\n <TableRow className={this.getRowClass()}>\n <TableCell>{feedback.feeling}</TableCell>\n <TableCell>{feedback.understanding}</TableCell>\n <TableCell>{feedback.support}</TableCell>\n <TableCell>{feedback.comments}</TableCell>\n <TableCell>\n <IconButton onClick={this.flag} color={this.getFlagIconColor()} aria-label=\"Flag\">\n <FlagIcon />\n </IconButton>\n </TableCell>\n <TableCell>\n <IconButton onClick={this.delete} aria-label=\"Delete\">\n <DeleteIcon />\n </IconButton>\n </TableCell>\n </TableRow>\n );\n }", "title": "" }, { "docid": "d5184ad0d7a9439a5fe2c1f98563f392", "score": "0.50394", "text": "function RowResizingTool() {\n\tgo.Tool.call(this);\n\tthis.name = \"RowResizing\";\n\n\tvar h = new go.Shape();\n h.geometryString = \"M0 0 H14 M0 2 H14\";\n h.desiredSize = new go.Size(14, 2);\n h.cursor = \"row-resize\";\n h.geometryStretch = go.GraphObject.None;\n h.background = \"rgba(255,255,255,0.5)\";\n h.stroke = \"rgba(30,144,255,0.5)\";\n /** @type {GraphObject} */\n\tthis._handleArchetype = h;\n\n /** @type {string} */\n\tthis._tableName = \"TABLE\";\n\n // internal state\n /** @type {GraphObject} */\n\tthis._handle = null;\n /** @type {Panel} */\n\tthis._adornedTable = null;\n}", "title": "" }, { "docid": "b2bd5b3877e5d03039e0f8a05fb6dc6d", "score": "0.5028031", "text": "function questionToCell(question, id) {\r\n const link = \"/q/\" + id.toString();\r\n return (\r\n <tr borderless=\"true\" key={id.toString()}>\r\n <td>\r\n <Link to={link}>\r\n {question}\r\n </Link>\r\n </td>\r\n </tr>\r\n );\r\n}", "title": "" }, { "docid": "bae93142a263c9f732fedf0b64b16af7", "score": "0.5025905", "text": "function rowButtons(id, traveler) {\n\treturn\t'<form>' +\n\t\t\t\t'<input type=\"button\" value=\"Edit\" onClick=\"javascript:editGo('+id+')\">' +\n\t \t\t'<input type=\"button\" value=\"Delete\" onClick=\"javascript:deleteGo('+id+', &quot;'+traveler+'&quot;)\">' +\n\t\t\t'</form>';\n}", "title": "" }, { "docid": "a624b57388bd5f310ba0834f0ac60690", "score": "0.50074947", "text": "function renderQuestion() {\n // console.log(questionsArray[questionNumber].question);\n h2QuestionBox.textContent = questionsArray[questionNumber].question;\n answerButtonA.textContent = questionsArray[questionNumber].choices[0];\n answerButtonB.textContent = questionsArray[questionNumber].choices[1];\n answerButtonC.textContent = questionsArray[questionNumber].choices[2];\n answerButtonD.textContent = questionsArray[questionNumber].choices[3];\n}", "title": "" }, { "docid": "2d1270be68f2c9e0dc280bb1f1acc251", "score": "0.49998796", "text": "newRow() {\n this.rows.forEach(row=>{\n row.root.scaling.scaleInPlace(.5);\n row.root.position.addInPlace(this.rowOffset.scale(1/(this.rows.length*2)));\n });\n this.unselectCurrent();\n this.currentRow().activeControl = this.activeControl;\n this.rowRoot = new BABYLON.TransformNode(\"HUD\"+this.rows.length);\n this.rowRoot.parent = this.root;\n \n this.elements = [];\n this.controls = [];\n this.textures = [];\n this.activeControl = null;\n this.speechInput.stop();\n this.speechInput = new SpeechInput();\n this.speechInput.onlyLetters = false;\n this.rows.push({root: this.rowRoot, elements: this.elements, controls: this.controls, textures: this.textures, speechInput: this.speechInput, activeControl: this.activeControl});\n }", "title": "" }, { "docid": "9b36bb768ddd0bea91890217a24bc85b", "score": "0.49766737", "text": "function questionDisplay(i) {\n questions[i].answers.forEach(function (arrItem) {\n questionContainer.textContent = questions[i].question;\n var answerBtn = document.createElement(\"button\");\n answerBtn.textContent = arrItem;\n answerBtn.classList = \"btn btn-outline-primary col-12 my-1\"\n answerContainer.append(answerBtn);\n });\n}", "title": "" }, { "docid": "1efe1b79c8529ac52f94df38fd83f57c", "score": "0.4971767", "text": "function makeQuestionBox(question, idx) {\n let container = document.createElement('div');\n container.setAttribute('id', `background-${idx}`)\n let questionTitle = document.createElement('div');\n questionTitle.innerText = question.question;\n container.appendChild(questionTitle);\n let choices = [question.a, question.b, question.c]\n let orderedList = document.createElement('ol'); // ordered list\n for(let i = 0; i < choices.length; i++) {\n let choice = document.createElement('li');\n choice.innerText = choices[i];\n orderedList.appendChild(choice);\n }\n container.appendChild(orderedList);\n//this creates the input elements, puts text inside the new submit answer button, and appends it all to the div\n let input = document.createElement('input');\n input.setAttribute('type', 'text');\n input.setAttribute('class', `submit`);\n container.appendChild(input);\n let submit = document.createElement('button');\n submit.setAttribute('class', `submit-answer ${idx}`);\n submit.innerText = 'Submit Answer';\n container.appendChild(submit)\n let background = document.querySelector('.background');\n background.appendChild(container);\n}", "title": "" }, { "docid": "60bc617b1b002a963932382dd1a65b80", "score": "0.49708724", "text": "function NewCategoryActionRow(props) {\n return <tr>\n <td colSpan=\"4\">\n <button \n disabled={props.showAddCategoryBlankFields} \n onClick={props.triggerAddNewCategory}>\n Add Category\n </button>\n </td>\n </tr>;\n}", "title": "" }, { "docid": "8b332c62ea905ff3959f8b78177d64b2", "score": "0.49689826", "text": "function removeRow (event) {\n // event is an object with details about the event ('click'), target is one of the properties\n console.log('event:', event)\n console.log('Clicked Remove button')\n // note: this might be a span if the button contains a span\n const clickedButton = event.target // get the clicked button\n console.log('clickedButton:', clickedButton)\n const parentDiv = getParent(clickedButton, 'ingredient-row') // the parent of the button that was clicked\n console.log('parentDiv:', parentDiv)\n dynamicRows.removeChild(parentDiv) // find the parent <div> of the button that was clicked and removed it\n}", "title": "" }, { "docid": "811742aac7ef6788720290509c303ef4", "score": "0.4968765", "text": "function renderProjQuestion(questionid, question, index){\n if(index%2==0){\n return \"<div class=\\\"row\\\">\\\n <div class=\\\"col-md-6\\\">\\\n <div class=\\\"row individual-qn\\\">\\\n <div class=\\\"col-md-9\\\"><h4 class=\\\"question-wrapper\\\" id=\\\"question\"+questionid+\"\\\">\"+question.question+\"</h4></div>\\\n <div class=\\\"col-md-3\\\"><h3><label class=\\\"label label-danger\\\">\"+question.votes+\" votes</label></h3></div>\\\n </div>\\\n </div>\";\n }\n //odd numbers means the question is in the second col, which is also the last col of the row\n else{\n return \"<div class=\\\"col-md-6\\\">\\\n <div class=\\\"row individual-qn\\\">\\\n <div class=\\\"col-sm-9 col-md-9\\\"><h4 class=\\\"question-wrapper\\\" id=\\\"question\"+questionid+\"\\\">\"+question.question+\"</h4></div>\\\n <div class=\\\"col-md-3\\\"><h3><label class=\\\"label label-danger\\\">\"+question.votes+\" votes</label></h3></div>\\\n </div>\\\n </div>\\\n </div>\";\n }\n}", "title": "" }, { "docid": "3e3df2c194916f9b11d1f69065a7c34e", "score": "0.4964952", "text": "getRow(index) {\n const { model, name } = this.props\n var row = [\n <TextInputField key={Math.floor(Math.random() * 10000) } name=\"vaccine_name\" model={ model[name][index] } hideLabel={true} />,\n <TextInputField key={Math.floor(Math.random() * 10000) } name=\"vaccination_doses\" model={ model[name][index] } keyboardType=\"numeric\" hideLabel={true} />,\n <Button key={ Math.floor(Math.random() * 10000) } title=\"-\" onPress={ () => this.removeRow(index) } />\n ]\n return row\n }", "title": "" }, { "docid": "34d7af3c8a4c382503c54ad18374eaf7", "score": "0.49571085", "text": "function renderQuestionContainer () {\n//checks if question number has been reached -- \nif (currentQuestion === questions.length) {\n displayResults ();\n} else { //display current question\n questionEl.innerHTML = questions[currentQuestion].question;\n\n //display answer choices\n // make a for loop to go through the current questions answer choices\n for(let i = 0; i < questions[currentQuestion].answers.length; i++) {\n // make answerChoices variable and create button element\n let answerChoices = document.createElement(\"button\");\n // take answerChoices variable set innerHTML to empty string\n answerChoices.innerHTML = \"\";\n // take answerChoices variable and add innerHTML the current loop's question text index number\n answerChoices.innerHTML = questions[currentQuestion].answers[i];\n // append the answerChoices to questionChoicesEl container\n questionChoicesEl.append(answerChoices);\n // take answerChoices variable and attach clickListener to each button and then if clicked call a function to check if answer correct\n answerChoices.onclick = compareResponse;\n };\n };\n}", "title": "" }, { "docid": "be257b3fa32dcda875c7b18910a5d7db", "score": "0.49544626", "text": "function addRow () {\n console.log('Clicked Add Ingredient button')\n const clone = row.cloneNode(true)\n clone.style.display = 'block'\n dynamicRows.appendChild(clone)\n const removeIngredientArray = clone.getElementsByClassName('remove-button')\n const removeIngredientButton = removeIngredientArray[0]\n console.log('removeIngredientButton:', removeIngredientButton)\n removeIngredientButton.addEventListener('click', removeRow)\n}", "title": "" }, { "docid": "33f0fa1730b4a19b7bac0646c6ae042f", "score": "0.49519396", "text": "handleAnswer (clueCell) {\n\t\t$(\n\t\t\t`<div>\n\t\t\t\tDid you get it right?<br>\n\t\t\t\t<button class='btn-sm btn-success'>Yes</button>\n\t\t\t\t<button class='btn-sm btn-danger'>No</button>\n\t\t\t</div>`\n\t\t).appendTo(clueCell);\n\t}", "title": "" }, { "docid": "722888e949433bb4fcfa598dc7a5a712", "score": "0.49486268", "text": "render() {\n let classname = MAIN_CLASS,\n refocusByClick, refocus, addRowBtn, addColBtn;\n const instance = this,\n props = instance.props,\n editable = props.editable,\n disabled = props.disabled,\n propsClassName = props.className;\n\n propsClassName && (classname+=' '+propsClassName);\n if (props.extendableY) {\n addRowBtn = (<Button buttonText=\"+\" className=\"add-row controll-btn\" disabled={disabled} onClick={instance.addRow} />);\n }\n if (props.extendableX && !props.columns) {\n addColBtn = (<Button buttonText=\"+\" className=\"controll-btn\" disabled={disabled} onClick={instance.addCol} />);\n }\n if ((editable===true) || (editable==='full')) {\n refocusByClick = instance.refocusByClick;\n refocus = instance.refocus;\n }\n return (\n <div className={classname}>\n <table className={props.tableClass}>\n {instance.generateHead()}\n <tbody\n onClick={refocusByClick}\n onKeyDown={refocus}>\n {instance.generateRows()}\n </tbody>\n </table>\n {addColBtn}\n {addRowBtn}\n </div>\n );\n }", "title": "" }, { "docid": "95fa1da438795fb6d603afc990a2a128", "score": "0.4943646", "text": "function InputNotes( options ) {\n // TODO see if bind() can be used in place of _self = this.\n // Note bind()'s lack of IE8 support.\n var _self = this;\n var _row = options.row;\n\n // Load our handlebar templates.\n var _template = require( '../../../templates/prepare-worksheets/input-notes.hbs' );\n var data = {text: _row.text, altText: _row.altText, placeholder: options.data.placeholder};\n\n var snippet = _template( data );\n\n // This appendChild could be replaced by jquery or similar if desired/needed.\n //var node = $(options.container).append($(snippet) );\n var node = _domHelper.appendChild( options.container, snippet, 'tbody' );\n\n\n // DOM references.\n var _textDOM = node.querySelector('.text-col');\n var _altTextInputDOM = node.querySelector('textarea');\n\n\n // Listen for updates to the text or grading buttons.\n _altTextInputDOM.addEventListener( 'keyup', _changedHandler );\n\n function _changedHandler() {\n _self.dispatchEvent( 'change', {row: _row, data: getState()} );\n }\n\n\n // @return [Object] The contents of the text input and the button grade.\n function getState() {\n return {\n text: _row.text,\n altText: _altTextInputDOM.value\n };\n }\n\n // @param state [Object] `text` and `altText` values.\n function setState(state) {\n var text = state.text === undefined ? '' : state.text;\n var altText = state.altText === undefined ? null : state.altText;\n _textDOM.innertext = text;\n _altTextInputDOM.value = altText;\n }\n\n // Expose instance's public methods.\n this.getState = getState;\n this.setState = setState;\n\n // Attach additional methods.\n _eventObserver.attach(this);\n}", "title": "" }, { "docid": "ee82b159f86e1dbf810aaaa9d809c044", "score": "0.49414045", "text": "get addItemButtons () { return $$('.line-item-add-adhoc-item') }", "title": "" }, { "docid": "c5117468029b249750f72a1837fc5ca3", "score": "0.49363047", "text": "function Row(props) {\n\t// create row markup and orderee markup\n\treturn(\n\t\t<div className={`row row-${props.num}`}>\n\t\t\t{props.groupedItems.map((rowItem, index) => <Orderee item={rowItem} type=\"image\" draggable={props.draggable} onDragStart={props.onDragStart.bind(this)} onDragOver={props.onDragOver.bind(this)} onDrop={props.onDrop.bind(this)} key={Utils.generateUID()} />)}\n\t\t</div>\n\t);\n}", "title": "" }, { "docid": "211c7a2609065776d796e04b96b4a69f", "score": "0.49302095", "text": "function renderQuiz() {\n quizArea.innerHTML = \"\";\n\n var questionText = document.createElement(\"h2\");\n questionText.textContent = questions[qIndex].clue;\n quizArea.appendChild(questionText);\n\n // assigns possible quiz options to variable\n var options = questions[qIndex].options\n\n // loops through possible answers in array in object at qIndex\n // these are appended into the quiz area just below the clue/question as buttons\n for (i = 0; i < options.length; i++) {\n var quizOption = document.createElement(\"button\");\n quizOption.textContent = options[i];\n quizArea.appendChild(quizOption);\n quizOption.addEventListener(\"click\", check);\n }\n}", "title": "" }, { "docid": "c3b3270f3020bf4871189a5288326733", "score": "0.4923587", "text": "function renderQuestionCheckAll(question_num, question_text, question_key, question_answers) {\n // If adding question show container\n if (quiz_container.style.display === 'none') {\n quiz_container.style.display = 'block';\n }\n\n // Increment the question added index for possible deletion later\n INITIAL_ORDER++;\n\n // Add a new row to display the question\n let tableRowDisplay = document.createElement('tr');\n tableRowDisplay.id = \"tableRow_\" + INITIAL_ORDER;\n quiz_display.appendChild(tableRowDisplay);\n\n let tableDisplay = document.createElement('td');\n tableDisplay.id = \"tableDisplay_\" + INITIAL_ORDER;\n tableRowDisplay.appendChild(tableDisplay);\n\n // Use the correct question_num value to track the question count\n let headerDisplay = document.createElement('h5');\n headerDisplay.innerText = \"Q\" + question_num;\n tableDisplay.appendChild(headerDisplay);\n\n let questionDisplay = document.createElement('i');\n questionDisplay.innerText = question_text;\n tableDisplay.appendChild(questionDisplay);\n\n // Loop to display the associated number of answer strings\n for (let i = 0; i < question_answers.length; i++) {\n let ansDisplay = document.createElement('li');\n ansDisplay.id = 'ansDisplay' + INITIAL_ORDER;\n \n // No boxes checked\n ansDisplay.innerHTML = question_answers[i]; \n\n // Add the checkbox to correct answers\n for (let j = 0; j < question_key.length; j++) {\n if (question_key[j] == i) {\n ansDisplay.innerHTML = question_answers[i] + \" &#x2611\";\n break;\n }\n else {\n ansDisplay.innerHTML = question_answers[i];\n }\n }\n\n // Render the formed answer\n tableDisplay.appendChild(ansDisplay);\n }\n\n // Display the delete button\n let tableDeleteDisplay = document.createElement('td');\n tableDeleteDisplay.id = \"tableDeleteDisplay_\" + INITIAL_ORDER;\n tableDeleteDisplay.innerHTML = \"<button>Delete</button>\";\n tableRowDisplay.appendChild(tableDeleteDisplay);\n tableDeleteDisplay.childNodes[0].classList = 'deleteBtn mdl-button mdl-js-button mdl-button--raised';\n\n // Delete button handler to remove the question for the quiz object and the DOM\n tableDeleteDisplay.childNodes[0].addEventListener('click', (e) => {\n e.preventDefault();\n\n // Find array index of the question to remove\n let qIndex = headerDisplay.innerText.substring(1, headerDisplay.innerText.length);\n qIndex--;\n\n // Remove the question from the quiz object\n quiz.questions.splice(qIndex, 1);\n\n // Remove the displayed question\n tableRowDisplay.remove();\n\n // Update the question count\n questionCount.textContent = --QUESTION_COUNT;\n\n // Remove the submit button if there are no questions\n if (QUESTION_COUNT === 0) {\n quiz_container.style.display = 'none';\n line.style.display = 'none';\n submitBtn.style.display = 'none';\n }\n else {\n // Update the Q numbers of remaining questions\n for (var i = 0, row; row = quiz_display.rows[i]; i++) {\n row.children[0].childNodes[0].innerText = `Q${i + 1}`;\n }\n }\n })\n}", "title": "" }, { "docid": "edb19285a4f087f1651c7f29873c5c3d", "score": "0.49217662", "text": "function createUpperRow() {\r\n const upperRow = createElement(\r\n \"div\",\r\n \" flex-wrap-reverse md: flex justify-around my-5 md:my-10 \"\r\n );\r\n const buttonDeleteAll = createElement(\r\n \"button\",\r\n \" border-2 border-gray-200 rounded-full bg-white px-4 md:px-6 shadow-lg mb-2 \",\r\n \"Delete All\"\r\n );\r\n buttonDeleteAll.id = \"btn-delete\";\r\n const buttonDeleteLast = createElement(\r\n \"button\",\r\n \" border-2 border-gray-200 rounded-full bg-white px-4 md:px-6 shadow-lg mb-2 \",\r\n \"Delete Last\"\r\n );\r\n buttonDeleteLast.id = \"btn-delete-last\";\r\n const textArea = createElement(\r\n \"textarea\",\r\n \" w-1/2 border-2 border-white rounded-lg shadow-lg focus:outline-none mb-2 \"\r\n );\r\n textArea.setAttribute(\"placeholder\", \"Enter todo...\");\r\n const buttonAdd = createElement(\r\n \"button\",\r\n \" border-2 border-gray-200 rounded-lg bg-white px-4 shadow-lg mb-2 \",\r\n \"Add\"\r\n );\r\n buttonAdd.id = \"btn-add\";\r\n upperRow.append(buttonDeleteAll, buttonDeleteLast, textArea, buttonAdd);\r\n return upperRow;\r\n}", "title": "" }, { "docid": "f51b28f2668788369f97434600abb5f3", "score": "0.49100524", "text": "render() {\n return (\n <div className=\"part1\">\n <div className=\"index\">\n <input\n type = \"checkbox\"\n name = \"is_correct\"\n value = {this.props.answer.is_correct}\n checked = {this.props.answer.is_correct}\n onChange = {(event) => this.props.changeAnswer(event, this.props.questIndex, this.props.index)}\n disabled = {!this.props.editable}\n />\n\n {'ABCDEFGH'.substring(this.props.index, this.props.index+1)}\n </div>\n\n <div className=\"index\">\n {(this.props.editable && this.props.index>0)?(\n <button \n onClick = {() => this.props.moveUpAnswer(this.props.questIndex, this.props.index)}\n disabled = {!this.props.editable}\n >&#8673;</button>\n ):null}\n\n {(this.props.editable && this.props.index<this.props.total-1)?(\n <button \n onClick = {() => this.props.moveDownAnswer(this.props.questIndex, this.props.index)}\n disabled = {!this.props.editable}\n >&#8675;</button>\n ):null}\n </div>\n </div>\n )\n }", "title": "" }, { "docid": "4f49132da624f666749f3bab809550df", "score": "0.49098682", "text": "function setUpQuestion(questionRow){\n //console.log('question row: ' + JSON.stringify(questionRow));\n \n \n //$('#question li:first-child').html(questionRow[\"question\"]); \n $('#question').html(questionRow[\"question\"]); \n \n var html=\"\";\n \n //get the options shuffled \n var optionsArray = shuffleOptions(questionRow['options']);\n console.log('optionsArray: ' + JSON.stringify(optionsArray));\n \n// <input class=\"\" type=\"radio\" name=\"session-choice\" id=\"optiona\" value=\"optiona\" data-iconpos=\"right\" />\n// <label class=\"\" data-role=\"button\" data-corners=\"false\" for=\"optiona\"><span class=\"question-opt\" ></span>Referring a Sick Baby</label>\n \n html += '<input type=\"radio\" name=\"radio-choice\" id=\"radio-choice-A\" value=\"A\" data-iconpos=\"right\" />';\n html += '<label for=\"radio-choice-A\" data-corners=\"false\"><span class=\"question-opt\" >A</span><span id=\"optiontext\">' + optionsArray[0] + '</span></label>';\n \n html += '<input type=\"radio\" name=\"radio-choice\" id=\"radio-choice-B\" value=\"B\" data-iconpos=\"right\" />';\n html += '<label for=\"radio-choice-B\" data-corners=\"false\"><span class=\"question-opt\" >B</span><span id=\"optiontext\">' + optionsArray[1] + '</span></label>';\n \n html += '<input type=\"radio\" name=\"radio-choice\" id=\"radio-choice-C\" value=\"C\" data-iconpos=\"right\" />';\n html += '<label for=\"radio-choice-C\" data-corners=\"false\"><span class=\"question-opt\" >C</span><span id=\"optiontext\">' + optionsArray[2] + '</span></label>';\n \n html += '<input type=\"radio\" name=\"radio-choice\" id=\"radio-choice-D\" value=\"D\" data-iconpos=\"right\" />';\n html += '<label for=\"radio-choice-D\" data-corners=\"false\"><span class=\"question-opt\" >D</span><span id=\"optiontext\">' + optionsArray[3] + '</span></label>';\n \n //set the answer text box \n $('#answer').val(questionRow['correct_option']);\n \n //set the tip text\n console.log('text: ' + questionRow['tiptext']);\n $('#tipcontent').html(questionRow['tiptext']);\n \n $(\"#options\").html(html);\n $(\"#question\").css('display','block');\n //$(\"#nextprev\").css('display','block');\n $(\"#questionpage\").trigger(\"create\");\n}", "title": "" }, { "docid": "2773c2aaecfe7c8869a26f574b1d29ce", "score": "0.49042642", "text": "function add_row()\r\n\t\t{\r\n\t\t\tvar $dup = $cpy.clone(options.copyHandlers);\r\n\t\t\t$dup.appendTo(obj);\r\n\t\t\tupdate_buttons(1);\r\n\t\t\tif (typeof(options.onAdd) == \"function\") options.onAdd($dup);\r\n\t\t\tif (!!options.focusFirst) $dup.find('input:first').focus();\r\n\t\t}", "title": "" }, { "docid": "7ceefe8d40218db7e0bf35747f6c6802", "score": "0.4900118", "text": "render() {\n var prev = this.comment.lines[0].parentNode.previousSibling;\n \n if (prev.dataset && prev.dataset.position) {\n this.el = prev;\n return;\n }\n\n this.el = document.createElement('tr');\n this.el.className = 'js-expandable-line';\n this.el.dataset.position = this.comment.start.index;\n\n var preview = `@@ ${this.comment.start.index + 1}-${this.comment.end.index + 1} @@ `;\n\n if (this.comment.lines[1]) {\n preview += `${this.comment.lines[1].text.replace(COMMENT_SYNTAX, '')}`;\n } else {\n preview += `${this.comment.lines[0].text.replace(COMMENT_SYNTAX, '')}`;\n }\n\n this.el.innerHTML = `\n <td class=\"blob-num blob-num-expandable\">\n <a class=\"diff-expander js-expand\" title=\"Expand\" aria-label=\"Expand\">\n <span class=\"octicon octicon-unfold\"></span>\n </a>\n </td>\n <td class=\"blob-code blob-code-hunk\">${preview}</td>\n `;\n this.hide();\n }", "title": "" }, { "docid": "78a8e756523f2f5892b43a49800c6185", "score": "0.4898073", "text": "function showQuestion(question) {\n if (currentQuestionIndex < questions.length) {\n currentQuestion.textContent = question.question\n question.answers.forEach(answer => {\n var button = document.createElement(\"button\");\n button.innerText = answer.text;\n button.value = answer.response;\n button.classList.add(\"btn\", \"btn-secondary\", \"btn-md\", \"m-1\", \"text-left\");\n button.addEventListener(\"click\", checkAnswer);\n answerGrid.appendChild(button);\n \n })\n\n }\n else {\n navigateToInput();\n }\n\n}", "title": "" }, { "docid": "a1b3bfff486cfa15325524ce47ee5671", "score": "0.48949465", "text": "function addQuestion() {\n\n optionCount = 1;\n\n templateStatus = true;\n let container = document.getElementById(\"quizDiv\");\n let questionDiv = document.createElement(\"div\");\n container.appendChild(questionDiv);\n\n questionDiv.setAttribute('id', 'containerquestion' + count);\n\n\n let parag = document.createElement(\"p\");\n let questionCount = \"Question \" + count;\n let nodeP = document.createTextNode(questionCount);\n parag.appendChild(nodeP);\n parag.setAttribute('class', \"questionNo\");\n parag.setAttribute('id', 'questionNo' + count);\n\n questionDiv.appendChild(parag);\n\n let questionBodyTextArea = document.createElement(\"TEXTAREA\");\n questionDiv.appendChild(questionBodyTextArea);\n\n let idTextArea = \"question\" + count + \"TextArea\";\n\n questionBodyTextArea.setAttribute(\"id\", idTextArea);\n questionBodyTextArea.setAttribute(\"class\", \"questTextArea\");\n\n\n let parag2 = document.createElement(\"p\");\n nodeP = document.createTextNode(\"Choices:*\");\n parag2.appendChild(nodeP);\n parag2.setAttribute('class', 'choiceHead');\n\n questionDiv.appendChild(parag2);\n let unordList = document.createElement(\"ul\");\n questionDiv.appendChild(unordList);\n unordList.setAttribute('id', 'choiceDiv' + count);\n let radioButtonNames = \"question\" + count;\n\n for (let position = 1; position <= 2; position++) {\n optionCount++;\n\n let list = document.createElement('li');\n\n let radInput = document.createElement('input');\n radInput.setAttribute('type', 'radio');\n radInput.setAttribute('name', radioButtonNames);\n\n let idRadioButtonInput = \"question\" + count + \"choice\" + position;\n radInput.setAttribute('id', idRadioButtonInput);\n radInput.setAttribute('class', \"radButton\");\n\n list.appendChild(radInput);\n unordList.appendChild(list);\n list.setAttribute('id', \"question\" + count + \"licontainer\" + position);\n\n let listDiv = document.getElementById(idRadioButtonInput).parentNode;\n let choiceTextArea = document.createElement(\"TEXTAREA\");\n listDiv.appendChild(choiceTextArea);\n\n idTextArea = \"question\" + count + \"choiceTextArea\" + position;\n choiceTextArea.setAttribute('id', idTextArea);\n choiceTextArea.setAttribute('class', 'choiceTextArea');\n }\n\n count++;\n}", "title": "" }, { "docid": "1df450e3b34a0296db3b1dff399de8c1", "score": "0.48894206", "text": "initiateMoveButton(handle, listWrapper, currentColumn, nextColumn, sign) {\n let button = document.createElement(\"button\");\n let text = document.createTextNode(sign);\n button.className = \"action\";\n button.appendChild(text);\n listWrapper.appendChild(button);\n if (!currentColumn.hasSelectedItems()) {\n button.setAttribute(\"disabled\", \"disabled\");\n }\n button.addEventListener(\"click\", function () {\n currentColumn.items.slice().forEach((item) => {\n if (item.selected) {\n let clone = item.node.cloneNode();\n while (item.node.firstChild) {\n clone.appendChild(item.node.lastChild);\n }\n nextColumn.addItem(item);\n nextColumn.list.appendChild(clone);\n currentColumn.removeItem(item);\n clone.addEventListener(\"click\", function () {\n handle.addSelectionEventToItem(handle, item, nextColumn, nextColumn.list.parentElement);\n });\n item.node = clone;\n item.selected = false;\n item.toggleSelectedClass();\n }\n });\n // Handle disabling and enabling of buttons\n let buttons = handle.wrapper.getElementsByTagName(\"button\");\n // Disable column buttons\n Array.prototype.forEach.call(buttons, function (btnItem) {\n btnItem.setAttribute(\"disabled\", \"disabled\");\n });\n });\n }", "title": "" }, { "docid": "30ed39d46b53ef1b3cc39dbc649d7975", "score": "0.4888567", "text": "render() {\n return (\n <div className=\"part3\">\n {(this.props.editable)?(\n <button \n onClick = {() => this.props.removeAnswer(this.props.questIndex, this.props.index)}\n disabled = {!this.props.editable}\n >&#10007;</button>\n ):null}\n </div>\n )\n }", "title": "" }, { "docid": "6d62c3bea46f1e1d1dec18888bb5bb05", "score": "0.48857975", "text": "function renderQuestions(questions) {\n\n var questionDisplay = $(\"<div>\");\n questionDisplay.addClass('questions');\n\n for (var i = 0; i < questions.length; i++) {\n\n console.log(questions[i].question);\n// =====================================for the answers\n\n var $h1 = $('<div>');\n\n $h1.text(questions[i].question);\n\n for (var j = 0; j < questions[i].choices.length; j++) {\n var $p = $(\"<p>\");\n $p.text(questions[i].choices[j]);\n $h1.append($p);\n// ===================================for the button \n var btnInput = $(\"<input>\");\n btnInput.attr('type', 'radio');\n btnInput.attr('name',i);\n btnInput.attr('answerIndex',j);\n $p.prepend(btnInput);\n }\n\n questionDisplay.append($h1);\n $('#question').append(questionDisplay);\n\n questionDisplay.append($h1);\n $('#question').append(questionDisplay);\n\n for (var c = 0; c < questions[i].correct.length; c++) {\n console.log(questions[i].correct[c]);\n }\n }\n $(\"input\").on(\"click\", function (event) {\n // console.log(this);\n var questionIndex = $(this).attr('name');\n console.log(questions[questionIndex]);\n var answerIndex = $(this).attr('answerIndex');\n console.log(answerIndex);\n console.log(questions[parseInt(questionIndex)].correct);\n console.log(questions[parseInt(questionIndex)].choices[answerIndex]);\n\n if (answerIndex === questions[parseInt(questionIndex)].correct){\n score++\n }\n else {\n WrongAnswers++\n }\n })\n}", "title": "" }, { "docid": "2c67c425e1d2c764d39468e7971f4f13", "score": "0.48853403", "text": "function showNextQuestion(index) {\n questionSection.innerHTML = ''\n\n var h1El = document.createElement('h1');\n h1El.innerText = questionsLink[index].question;\n questionSection.appendChild(h1El);\n\n var buttonOne = document.createElement('button')\n var buttonTwo = document.createElement('button')\n var buttonThree = document.createElement('button')\n var buttonFour = document.createElement('button')\n\n buttonOne.innerText = questionsLink[index].choices[0]\n buttonTwo.innerText = questionsLink[index].choices[1]\n buttonThree.innerText = questionsLink[index].choices[2]\n buttonFour.innerText = questionsLink[index].choices[3]\n\n buttonOne.addEventListener('click', checkAnswer)\n buttonTwo.addEventListener('click', checkAnswer)\n buttonThree.addEventListener('click', checkAnswer)\n buttonFour.addEventListener('click', checkAnswer)\n\n questionSection.appendChild(buttonOne)\n questionSection.appendChild(buttonTwo)\n questionSection.appendChild(buttonThree)\n questionSection.appendChild(buttonFour)\n}", "title": "" }, { "docid": "214e5018dc9f8e97d74b5a21425226fd", "score": "0.4880398", "text": "function generateQuestion() {\n questionTitle.textContent = questions[qIndex].question;\n optionBtn1.textContent = questions[qIndex].options[0];\n optionBtn2.textContent = questions[qIndex].options[1];\n optionBtn3.textContent = questions[qIndex].options[2];\n optionBtn4.textContent = questions[qIndex].options[3];\n}", "title": "" }, { "docid": "3334c243659fd537b54189ad7f27e9bc", "score": "0.4877694", "text": "function deleteItemOnDelBtn(){\n\t// Removes cells when [DELETE] is pressed\n\tkeyHandler.bindKey(46, function(evt){\n\t\tdeleteItem();\n\t});\n}", "title": "" }, { "docid": "a377a9caf104e11003aa02765f51b87a", "score": "0.4872076", "text": "createRow(state) {\n let row = new MatrixRow();\n state.currentQuestionInfo.rows.push(row)\n }", "title": "" }, { "docid": "8685e3fe8551954d889e30e613466906", "score": "0.48710394", "text": "function QuestionTable(props) {\r\n const questions = Array.from(props.questions);\r\n const rows = questions.map((question, index) => \r\n questionToCell(question, questions.length - index)\r\n );\r\n const table = (\r\n <Table responsive >\r\n <thead>\r\n <tr>\r\n <th>{props.title}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {rows}\r\n </tbody>\r\n </Table>\r\n );\r\n return table;\r\n}", "title": "" }, { "docid": "1594f33e5ac9713a936eb0e4c8073e80", "score": "0.4870903", "text": "function renderNextQuestion () {\n $('main').on('click', '.nextButton', function (event) {\n changeQuestionNumber();\n renderQuestion();\n userSelectAnswer();\n });\n }", "title": "" }, { "docid": "01b930992f555ce5aa3497a3904e3b2f", "score": "0.48646963", "text": "addRowsIntoModal() {\n // Get last index and + one\n const ID = this.getRowsFromModal().length + 1;\n // Create div and add classes\n const div = document.createElement('div');\n div.classList = 'row mt-2 inputs-row';\n div.dataset.rowID = this.getRowsFromModal().length + 1;\n // Inner HTML\n let html = `<div class=\"col-4\">\n <input class=\"form-control custom-form-input\" type=\"text\" placeholder=\"\" id=\"exercise-series-input-${ID}\">\n </div>\n <div class=\"col-4\">\n <input class=\"form-control\" type=\"text\" placeholder=\"\" id=\"exercise-reps-input-${ID}\">\n </div>\n <div class=\"col-4\"> \n <input class=\"form-control\" type=\"text\" placeholder=\"\" id=\"exercise-weight-input-${ID}\">\n </div>`;\n div.innerHTML = html;\n // Insert created div on certain position\n //this.form.insertBefore(div, this.span);\n this.form.insertBefore(div, document.querySelector('#modal-form').lastChild.nextSibling);\n this.hideRemoveButton();\n \n }", "title": "" }, { "docid": "5f6ebe2de87e950b1ac6f7685306bccb", "score": "0.48614004", "text": "renderResultRows(dateItems) {\n var self = this;\n return dateItems.map((data,index) =>{\n return (\n <tr key={index} data-item={data} onClick={(event) =>this.fetchDetails(event)}>\n <td data-title=\"id\">{data.id}</td>\n <td data-title=\"startdate\">{data.startdate}</td>\n <td data-title=\"enddate\">{data.enddate}</td>\n\t\t\t\t<td data-title=\"content\">\n\t\t\t\t\t\t<RaisedButton label=\"Edit\" primary={true} style={style} onClick={(event) => self.handleNoteEditClick(event,index)}/>\n\t\t\t\t\t\t<RaisedButton label=\"Delete\" primary={true} style={style} onClick={(event) => self.handleNoteDelClick(event,index)}/>\n\t\t\t\t</td>\n </tr>\n );\n });\n }", "title": "" }, { "docid": "9068d69af4afc24f92729e69529724ac", "score": "0.48606506", "text": "function renderRow(row) {\n var container = $('<div></div>').addClass('position');\n const allKeys = Object.keys(row);\n var renderedKeys = ['Position'];\n if (!isMobile()) {\n renderedKeys = [...renderedKeys, 'Location', 'Clearance'];\n }\n const renderedRows = renderedKeys.map(k => $('<p></p>').append(row[k]));\n container.append(renderedRows);\n const buttons = $('<div id=\"buttons\"></div>');\n const otherRows = filterObjectByKeys(\n row,\n k => !renderedKeys.includes(k) && row[k] != ''\n );\n if (Object.keys(otherRows).length > 1) {\n // indicate that this row is clickable\n container.addClass('clickable');\n // show expand button\n buttons.append('<img src=\"img/expand-01.svg\" alt=\"expand\" class=\"button-expand\">');\n // on click, render modal\n container.click(() => renderModal(row, otherRows));\n }\n // show email button\n if (!isMobile()) {\n buttons.append('<a href=\"mailto:careers@strategicmissionelements.com?subject=' + row['JobID'] + '\" target=\"_blank\"><img src=\"img/expand-03.svg\" alt=\"email\" class=\"button-email\"></a>')\n }\n container.append(buttons);\n return container;\n}", "title": "" }, { "docid": "775b703355d5cd48488d3d2f6d5fae9d", "score": "0.4858657", "text": "function SolverItem ($listContainer, data, events) {\n var self = this;\n\n self._$listContainer = $listContainer\n self._template = '\\\n<tr><td class=\"clickable-list-item\" data-solver-id=\"{{_id}}\" id=\"{{id}}\">\\\n {{name}}\\\n <button class=\"uk-button uk-button-danger uk-button-small remove-item\"><i class=\"uk-icon-minus-circle\"></i></button>\\\n</td></tr>';\n self._data = data;\n\n self._$item = $(render(self._template, data)).appendTo(self._$listContainer);\n\n if (!events)\n events = {}\n self._events = {\n click: events.click || default_event,\n del: events.del || default_event\n }\n\n self._$item.find('.remove-item').mouseover(function (ev) {\n ev.preventDefault();\n ev.stopPropagation();\n return false;\n })\n self._$item.find('.remove-item').click(function (ev) {\n ev.preventDefault();\n ev.stopPropagation();\n self._events.del(self._data)\n return false;\n })\n self._$item.click(function () {\n self._events.click(self._data);\n })\n}", "title": "" }, { "docid": "9b9bcc0c406eaf6b9f867747edf387ee", "score": "0.4854614", "text": "clickInteraction(questionsArray){\n $(\"#table-toggle\").removeAttr('disabled');\n document.getElementById(\"gameView\").addEventListener(\"click\",\n (e)=>{\n if(e.target.classList.contains(\"cell\")){\n const n = parseInt(e.target.id);\n const clickedQuestion = questionsArray[e.target.cellIndex][n];\n clickedQuestion.numberOfClicks++;\n if (clickedQuestion.numberOfClicks === 1){\n e.target.innerText = clickedQuestion.question;\n }\n if (clickedQuestion.numberOfClicks === 2){\n e.target.innerHTML = clickedQuestion.answer;\n }\n }\n });\n }", "title": "" }, { "docid": "558bf2c7b9b6e8faf0757e6aa8edcef9", "score": "0.48517236", "text": "function enableQuestion(questionNum) {\n destroyEditor(FEEDBACK_QUESTION_DESCRIPTION + '-' + questionNum);\n if (typeof richTextEditorBuilder !== 'undefined') {\n /* eslint-disable camelcase */ // The property names are determined by external library (tinymce)\n richTextEditorBuilder.initEditor('#' + FEEDBACK_QUESTION_DESCRIPTION + '-' + questionNum, {\n inline: true,\n fixed_toolbar_container: '#rich-text-toolbar-q-descr-container-' + questionNum\n });\n /* eslint-enable camelcase */\n }\n $('#' + FEEDBACK_QUESTION_DESCRIPTION + '-' + questionNum).removeClass('well');\n\n var $currentQuestionTable = $('#questionTable-' + questionNum);\n \n $currentQuestionTable.find('text,button,textarea,select,input')\n .not('[name=\"receiverFollowerCheckbox\"]')\n .not('.disabled_radio')\n .prop('disabled', false);\n \n $currentQuestionTable.find('.removeOptionLink').show();\n $currentQuestionTable.find('.addOptionLink').show();\n\n $currentQuestionTable.find('#rubricAddChoiceLink-' + questionNum).show();\n $currentQuestionTable.find('#rubricAddSubQuestionLink-' + questionNum).show();\n $currentQuestionTable.find('.rubricRemoveChoiceLink-' + questionNum).show();\n $currentQuestionTable.find('.rubricRemoveSubQuestionLink-' + questionNum).show();\n\n if ($('#generateOptionsCheckbox-' + questionNum).prop('checked')) {\n $('#mcqChoiceTable-' + questionNum).hide();\n $('#msqChoiceTable-' + questionNum).hide();\n $('#mcqOtherOptionFlag-' + questionNum).closest('.checkbox').hide();\n $('#msqOtherOptionFlag-' + questionNum).closest('.checkbox').hide();\n $('#mcqGenerateForSelect-' + questionNum).prop('disabled', false);\n $('#msqGenerateForSelect-' + questionNum).prop('disabled', false);\n } else {\n $('#mcqChoiceTable-' + questionNum).show();\n $('#msqChoiceTable-' + questionNum).show();\n $('#mcqOtherOptionFlag-' + questionNum).closest('.checkbox').show();\n $('#msqOtherOptionFlag-' + questionNum).closest('.checkbox').show();\n $('#mcqGenerateForSelect-' + questionNum).prop('disabled', true);\n $('#msqGenerateForSelect-' + questionNum).prop('disabled', true);\n }\n \n if ($('#constSumToRecipients-' + questionNum).val() === 'true') {\n $('#constSumOptionTable-' + questionNum).hide();\n $('#constSumOption_Option-' + questionNum).hide();\n $('#constSumOption_Recipient-' + questionNum).show();\n } else {\n $('#constSumOptionTable-' + questionNum).show();\n $('#constSumOption_Recipient-' + questionNum).hide();\n }\n \n $('#constSumOption_distributeUnevenly-' + questionNum).prop('disabled', false);\n \n if ($('#questionTable-' + questionNum).parent().find('input[name=\"questiontype\"]').val() === 'CONTRIB') {\n fixContribQnGiverRecipient(questionNum);\n setContribQnVisibilityFormat(questionNum);\n }\n \n $('#' + FEEDBACK_QUESTION_EDITTEXT + '-' + questionNum).hide();\n $('#' + FEEDBACK_QUESTION_SAVECHANGESTEXT + '-' + questionNum).show();\n $('#' + FEEDBACK_QUESTION_DISCARDCHANGES + '-' + questionNum).show();\n $('#' + FEEDBACK_QUESTION_EDITTYPE + '-' + questionNum).val('edit');\n $('#button_question_submit-' + questionNum).show();\n\n showVisibilityCheckboxesIfCustomOptionSelected($currentQuestionTable);\n}", "title": "" }, { "docid": "ea7da7e27a05a8cbc827300c5e454eed", "score": "0.484475", "text": "function drawThirdRow() {\n drawButton(0.05, 0.8, 0.09, 0.09, 'Z', 'black', 'white');\n drawButton(0.15, 0.8, 0.09, 0.09, 'X', 'black', 'white');\n drawButton(0.25, 0.8, 0.09, 0.09, 'C', 'black', 'white');\n drawButton(0.35, 0.8, 0.09, 0.09, 'V', 'black', 'white');\n drawButton(0.45, 0.8, 0.09, 0.09, 'B', 'black', 'white');\n drawButton(0.55, 0.8, 0.09, 0.09, 'N', 'black', 'white');\n drawButton(0.65, 0.8, 0.09, 0.09, 'M', 'black', 'white');\n }", "title": "" }, { "docid": "ad99630bec5bf1e620761e7c6749c01a", "score": "0.4842319", "text": "function renderNextQuestion () {\n $('main').on('click', '.nextButton', function (event) {\n changeQuestionNumber();\n renderQuestion();\n });\n}", "title": "" }, { "docid": "7fff0c3b63d3d0b5b4184539eb0a51ea", "score": "0.48411635", "text": "function drawFirstRow() {\n drawButton(0.05, 0.6, 0.09, 0.09, 'Q', 'black', 'white');\n drawButton(0.15, 0.6, 0.09, 0.09, 'W', 'black', 'white');\n drawButton(0.25, 0.6, 0.09, 0.09, 'E', 'black', 'white');\n drawButton(0.35, 0.6, 0.09, 0.09, 'R', 'black', 'white');\n drawButton(0.45, 0.6, 0.09, 0.09, 'T', 'black', 'white');\n drawButton(0.55, 0.6, 0.09, 0.09, 'Y', 'black', 'white');\n drawButton(0.65, 0.6, 0.09, 0.09, 'U', 'black', 'white');\n drawButton(0.75, 0.6, 0.09, 0.09, 'I', 'black', 'white');\n drawButton(0.85, 0.6, 0.09, 0.09, 'O', 'black', 'white');\n drawButton(0.95, 0.6, 0.09, 0.09, 'P', 'black', 'white');\n }", "title": "" }, { "docid": "33463a14ce436486053f8316a43329e9", "score": "0.48385444", "text": "function renderEditDeleteButtons(grid, object, value, node/*, options*/) {\n\t\t//REVIEW: why is columnButton not used?\n\t\tvar widgets = [], editorArgs = grid.editorArgs;\n\t\t/*jshint expr:true*/\n\t\teditorArgs.editPluginColumnClass && put(node, \".\" + editorArgs.editPluginColumnClass);\n\n\t\tif (editorArgs.edit) {\n\t\t\tvar canEdit = editorArgs.canEdit;\n\t\t\twidgets.push(createButton(grid, object, node, canEdit, \"Edit\"));\n\t\t}\n\n\t\tif (editorArgs.del) {\n\t\t\tvar canDelete = editorArgs.canDelete;\n\t\t\twidgets.push(createButton(grid, object, node, canDelete, \"Delete\"));\n\t\t}\n\n\t\tarray.forEach(widgets, function(widget) {\n\t\t\twidget.startup();\n\t\t});\n\t}", "title": "" }, { "docid": "7a20ccad724415de6fffe2859688a899", "score": "0.48253027", "text": "redrawDataTable() {\n // Add button method\n const myCRUDtAddButton = this.parentEl.querySelector(this.myCRUDtAddButton);\n myCRUDtAddButton.addEventListener('click', () => {\n this.rowEdit();\n });\n const myCRUDtheadrow = this.parentEl.querySelector(this.myCRUDtheadrow);\n const myCRUDtbody = this.parentEl.querySelector(this.myCRUDtbody);\n // render table columns\n for (const col of this.columns) {\n if (col.applTyp.includes('ident')) {\n this.ident = col.name;\n }\n if (!col.applTyp.includes('hidden')) {\n const th = document.createElement('th');\n myCRUDtheadrow.appendChild(th);\n th.innerText = col.title;\n }\n }\n const extrath = document.createElement('th');\n myCRUDtheadrow.appendChild(extrath);\n extrath.innerText = 'Действия';\n // render table rows\n for (const row of this.rows) {\n const tr = document.createElement('tr');\n tr.setAttribute('data-id', `Data_Row_${row[this.ident]}`);\n myCRUDtbody.appendChild(tr);\n for (const col of this.columns) {\n if (!col.applTyp.includes('hidden')) {\n const td = document.createElement('td');\n tr.appendChild(td);\n td.innerText = row[col.name];\n if (col.CSSclasses) {\n const cList = col.CSSclasses.split(' ');\n for (const cl of cList) {\n td.classList.add(cl);\n }\n }\n }\n }\n // extra column for action controls\n const extratd = document.createElement('td');\n tr.appendChild(extratd);\n extratd.classList.add('actionCol');\n // Edit Row button\n const CRUDEditButton = document.createElement('span');\n extratd.appendChild(CRUDEditButton);\n CRUDEditButton.classList.add('CRUDRowbtn', 'CRUDEditButton');\n CRUDEditButton.addEventListener('click', () => {\n for (const el of myCRUDtbody.children) {\n el.classList.remove('CurrentEditRecord');\n }\n tr.classList.add('CurrentEditRecord');\n this.rowEdit();\n });\n // Delete Row button\n const CRUDDeleteButton = document.createElement('span');\n extratd.appendChild(CRUDDeleteButton);\n CRUDDeleteButton.classList.add('CRUDRowbtn', 'CRUDDeleteButton');\n CRUDDeleteButton.addEventListener('click', () => {\n for (const el of myCRUDtbody.children) {\n el.classList.remove('CurrentEditRecord');\n }\n tr.classList.add('CurrentEditRecord');\n const doDelete = () => {\n // eslint-disable-next-line no-alert\n if (window.confirm('Внимание! Запись будет удалена!')) {\n const { identColumn, currentRecID } = this.getIDStructure();\n const recIndex = this.rows.findIndex((o) => o[identColumn] === currentRecID);\n // eslint-disable-next-line no-extra-boolean-cast\n if (typeof (recIndex) === 'number') {\n this.rows.splice(recIndex, 1);\n }\n this.statusClass = 'CRUDNeutral';\n this.statusText = 'Запись удалена';\n } else {\n this.statusClass = 'CRUDNeutral';\n this.statusText = 'Отказ от удаления';\n }\n this.bindToDOM();\n };\n setTimeout(doDelete, 200);\n });\n }\n }", "title": "" }, { "docid": "961f0d61f5bd85d28ad59410c4815c5b", "score": "0.48218754", "text": "function render(questionIndex) {\n //Clears out existing div data.\n quizGo.innerHTML = \"\";\n answerUl.innerHTML = \"\";\n //For loop for data in array.\n for (var i = 0; i < questions.length; i++) {\n var userQ = questions[questionIndex].question;\n var userC = questions[questionIndex].choices;\n quizGo.textContent = userQ;\n }\n\n userC.forEach(function (newBtn) {\n document.createElement(\"li\");\n var listItem = document.createElement(\"button\");\n listItem.textContent = newBtn;\n quizGo.appendChild(answerUl);\n answerUl.appendChild(listItem);\n //Event Listener - Comparison\n listItem.addEventListener(\"click\", (comparison))\n })\n}", "title": "" }, { "docid": "712f7d4ba2de43a37fb71861fbba6061", "score": "0.4813191", "text": "function createQuestionEls() {\n var questionEl = document.createElement(\"h2\");\n var answersEl = document.createElement(\"ol\");\n var rightOrWrong = document.createElement(\"p\");\n rightOrWrong.setAttribute(\"id\", \"rightWrongText\");\n\n quizBox.appendChild(questionEl);\n quizBox.appendChild(answersEl);\n\n for (var i = 0; i < 4; i++) {\n i\n var answersLiEl = document.createElement(\"li\");\n var answerBtnEl = document.createElement(\"button\");\n \n answerBtnEl.setAttribute(\"id\", i);\n answerBtnEl.addEventListener(\"click\", nextQuestion);\n answersLiEl.appendChild(answerBtnEl);\n\n quizBox.lastChild.appendChild(answersLiEl);\n }\n\n quizBox.appendChild(rightOrWrong);\n}", "title": "" }, { "docid": "0eb506d010a42155413c9ade8ed9cafe", "score": "0.48111454", "text": "cellButton(cell, row, enumObject, rowIndex) {\n return (\n <RoutinesTimeline cell={cell} row={row} rowIndex={rowIndex} />\n )\n }", "title": "" }, { "docid": "f468c7dc79ac6852416700dce0a82afe", "score": "0.48103487", "text": "function defaultRowRenderer(_ref) {\n var className = _ref.className,\n columns = _ref.columns,\n index = _ref.index,\n key = _ref.key,\n onRowClick = _ref.onRowClick,\n onRowDoubleClick = _ref.onRowDoubleClick,\n onRowMouseOut = _ref.onRowMouseOut,\n onRowMouseOver = _ref.onRowMouseOver,\n onRowRightClick = _ref.onRowRightClick,\n rowData = _ref.rowData,\n style = _ref.style;\n\n var a11yProps = { 'aria-rowindex': index + 1 };\n\n if (onRowClick || onRowDoubleClick || onRowMouseOut || onRowMouseOver || onRowRightClick) {\n a11yProps['aria-label'] = 'row';\n a11yProps.tabIndex = 0;\n\n if (onRowClick) {\n a11yProps.onClick = function (event) {\n return onRowClick({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowDoubleClick) {\n a11yProps.onDoubleClick = function (event) {\n return onRowDoubleClick({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowMouseOut) {\n a11yProps.onMouseOut = function (event) {\n return onRowMouseOut({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowMouseOver) {\n a11yProps.onMouseOver = function (event) {\n return onRowMouseOver({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowRightClick) {\n a11yProps.onContextMenu = function (event) {\n return onRowRightClick({ event: event, index: index, rowData: rowData });\n };\n }\n }\n\n return react__WEBPACK_IMPORTED_MODULE_1__[\"createElement\"](\n 'div',\n babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, a11yProps, {\n className: className,\n key: key,\n role: 'row',\n style: style }),\n columns\n );\n}", "title": "" }, { "docid": "703b78b74b7c966b632143041569c371", "score": "0.48081687", "text": "function displayQuestion() {\n setBlank();\n let currentQuestion = questions[index].title;\n mainCard.textContent = currentQuestion;\n currentChoices.textContent = \" \";\n questions[index].choices.forEach(function (choice, i) {\n let newBtn = document.createElement(\"button\");\n newBtn.setAttribute(\"class\", \"choice btn btn-primary btn-sm\");\n newBtn.setAttribute(\"style\", \"margin-right: 5px\");\n newBtn.setAttribute(\"value\", choice);\n newBtn.textContent = `${i + 1}. ${choice}`;\n newBtn.addEventListener(\"click\", nextQuestion);\n mainBody.appendChild(newBtn);\n });\n}", "title": "" }, { "docid": "577fe4919f5ac0e268f354920806787c", "score": "0.47992194", "text": "function deleteRow(event) {\n // retrieve the item that is being clicked on\n const item = event.target;\n // if the clicked item is the delete button\n if (item.classList[0] == \"delete-btn\") {\n // retrieve the rank row that is being deleted\n rankRow = item.parentElement;\n // remove the rank row\n rankRow.remove();\n // remove the rank item from local storage by passing in the rank row\n removeLocalItems(rankRow);\n }\n // update rank row colors accordingly based on ranking\n updateColor();\n}", "title": "" }, { "docid": "aaf9a0fccf9acd02e7c1a6bcc1051b21", "score": "0.47990552", "text": "function defaultRowRenderer(_ref) {\n var className = _ref.className,\n columns = _ref.columns,\n index = _ref.index,\n key = _ref.key,\n onRowClick = _ref.onRowClick,\n onRowDoubleClick = _ref.onRowDoubleClick,\n onRowMouseOut = _ref.onRowMouseOut,\n onRowMouseOver = _ref.onRowMouseOver,\n onRowRightClick = _ref.onRowRightClick,\n rowData = _ref.rowData,\n style = _ref.style;\n\n var a11yProps = { 'aria-rowindex': index + 1 };\n\n if (onRowClick || onRowDoubleClick || onRowMouseOut || onRowMouseOver || onRowRightClick) {\n a11yProps['aria-label'] = 'row';\n a11yProps.tabIndex = 0;\n\n if (onRowClick) {\n a11yProps.onClick = function (event) {\n return onRowClick({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowDoubleClick) {\n a11yProps.onDoubleClick = function (event) {\n return onRowDoubleClick({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowMouseOut) {\n a11yProps.onMouseOut = function (event) {\n return onRowMouseOut({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowMouseOver) {\n a11yProps.onMouseOver = function (event) {\n return onRowMouseOver({ event: event, index: index, rowData: rowData });\n };\n }\n if (onRowRightClick) {\n a11yProps.onContextMenu = function (event) {\n return onRowRightClick({ event: event, index: index, rowData: rowData });\n };\n }\n }\n\n return __WEBPACK_IMPORTED_MODULE_1_react__[\"createElement\"](\n 'div',\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, a11yProps, {\n className: className,\n key: key,\n role: 'row',\n style: style }),\n columns\n );\n}", "title": "" }, { "docid": "bbe2cc85d2f9d37fac7b993ae3bfad81", "score": "0.4796768", "text": "function GuiHorizontalListButton(x, y, size, selectionList, selected){\n\t// button variables\n this.x = x;\n this.x2= x;\n this.y = y;\n this.size = size;\n\t\n\t// enabled: if not enabled, the button will not be clickable\n\tthis.enabled = true;\n\t\n\t// default to normal mode (not highlighted nor depressed)\n\tthis.mode = GUI_BUTTON_NORMAL;\n\t\n\t// list of selection and the index of which is selected\n\tthis.selectionList = selectionList;\n\tthis.selected = selected;\n \n // function to create an inner button:\n // use the GuiButton object as a model to create a simplified inner button\n // that will be used as a part of the inner buttons of this button list.\n this.createInnerButton = function(x, id){\n // create the new button object\n var button = new GuiButton(\"\", x, this.y+5, this.size-10);\n button.width = Math.round((this.size-10)/2);\n button.selected = false;\n\t\tbutton.soundEnabled = false; // disable sound in this gui item\n button.right();\n // modify the buttons draw function to draw a simple rectangular object instead\n button.draw = function(ctx){\n ctx.save();\n var color;\n if(this.selected)\n color = \"#FF3300\";\n else if(this.mode == GUI_BUTTON_NORMAL)\n color = \"#3366FF\";\n else if(this.mode == GUI_BUTTON_HIGHLIGHTED)\n color = \"#33CCFF\";\n else\n color = \"#3300CC\";\n ctx.fillStyle = color;\n ctx.fillRect(this.x2, this.y, this.width, this.size);\n ctx.restore();\n }\n // modify the intersect function to this simpler version\n button.intersects = function(x, y){\n return (x > this.x && x < this.x + this.width &&\n y > this.y && y < this.y + this.size);\n }\n // set up the onClick event to register the click to the parent\n // (this button list)\n button.parent = this;\n button.id = id; // id is the index of this button\n button.onClick = function(){\n this.parent.innerButtonClicked(this.id);\n }\n return button;\n }\n \n // now create all inner buttons using the createInnerButton function\n\t//\tButton Styling Preferences:\n\tthis.buttonSpacing = 5;\n\tthis.buttonWidth = 5;\n this.innerButtons = new Array();\n var curX = this.x + this.buttonSpacing; // x-position of the current button\n for(var i=0; i<selectionList.length; i++){\n // create the new inner button with id as its index\n var button = this.createInnerButton(curX, i);\n // set it to selected if it is the selected index\n button.selected = (this.selected == i);\n this.innerButtons.push(button);\n // increment the x-position for the next button\n curX += (Math.round((this.size-10)/2) + this.buttonSpacing);\n }\n \n // set the width of this button to scale based on how many inner buttons\n // were added (curX represents the end position of the inner buttons)\n this.width = curX - this.x;\n\t\n // the event that is called by the inner buttons to register a click event\n // to the parent (this button list). When an inner button is clicked,\n // set it to the selected value, and de-select all other buttons. Then run the\n // regular onClick event.\n this.innerButtonClicked = function(id){\n for(var i=0; i<this.innerButtons.length; i++){\n if(i != id)\n this.innerButtons[i].selected = false;\n else{\n this.innerButtons[i].selected = true;\n this.selected = i;\n }\n }\n this.onClick(id);\n }\n \n\t// EVENT that occurs when this button is successfully clicked\n\tthis.onClick = function(selectionIndex){}\n\t\n\t/*** MOUSE MOVEMENT/ACTION EVENTS ***/\n\t// This button list will automatically check the mouse activity events\n // of its inner child buttons.\n\t// mouseover: called whenever the mouse moves\n\tthis.mousemove = function(x, y){\n\t\t// if this button list is moused over, set it to higlighted, and check\n // the mouseover event of all inner buttons.\n\t\tif(this.intersects(x, y)){\n\t\t\tthis.mode = GUI_BUTTON_HIGHLIGHTED;\n for(var i=0; i<this.innerButtons.length; i++)\n this.innerButtons[i].mousemove(x, y);\n }\n\t\t// otherwise, set it and all inner buttons to normal mode\n\t\telse{\n\t\t\tthis.mode = GUI_BUTTON_NORMAL;\n for(var i=0; i<this.innerButtons.length; i++)\n this.innerButtons[i].mode = GUI_BUTTON_NORMAL;\n }\n\t}\n\t// mousedown: called when the mouse button is pushed down\n\tthis.mousedown = function(x, y){\n\t\t// if the mouse button was pushed down over this button and this button is enabled,\n // check all inner buttons for mouse-down events\n\t\tif(this.intersects(x, y) && this.enabled){\n\t\t\tfor(var i=0; i<this.innerButtons.length; i++)\n this.innerButtons[i].mousedown(x, y);\n }\n\t}\n\t// mouseup: called when the mouse button is released (if it has already been pressed down\n\t//\tbefore)\n\tthis.mouseup = function(x, y){\n\t\t// check all inner buttons for the mouseup event if it occured on this button\n\t\tif(this.intersects(x, y)){\n\t\t\tfor(var i=0; i<this.innerButtons.length; i++)\n this.innerButtons[i].mouseup(x, y);\n\t\t}\n\t}\n \n\t// update function (called each frame, and sets up allignment as needed)\n this.update = function(){\n switch(this.position){\n case 1 : this.x2 = this.x; break;\n case 2 : this.x2 = this.x - (this.size / 2); break;\n case 3 : this.x2 = this.x - this.size; break;\n }\n }\n\t\n\t// DRAW FUNCTION:\n\t//\tdraw this button to the context (all graphics and designs go here)\n this.draw = function(ctx){\n\t\tctx.save();\n\t\t\n\t\t// coloring if the button is enabled\n\t\tif(this.enabled){\n\t\t\tif(this.mode == GUI_BUTTON_HIGHLIGHTED)\n\t\t\t\tctx.strokeStyle = \"#AAEE00\";\n\t\t\telse\n\t\t\t\tctx.strokeStyle = \"#559900\";\n\t\t\t// setup inside coloring based on button mode\n\t\t\tvar fillColor;\n\t\t\tif(this.mode == GUI_BUTTON_NORMAL)\n\t\t\t\tfillColor = \"#336699\";\n\t\t\telse\n\t\t\t\tfillColor = \"#3399CC\";\n\t\t\tctx.fillStyle = fillColor;\n\t\t}\n\t\t\n\t\t// coloring if the button is NOT enabled:\n\t\telse{\n\t\t\t// border\n\t\t\tctx.strokeStyle = \"#224422\";\n\t\t\t// inner fill color\n\t\t\tctx.fillStyle = \"#333333\";\n\t\t}\n\t\t\n\t\t// draw the button shape\n\t\tctx.lineWidth = 2;\n\t\tctx.beginPath();\n\t\t\tctx.rect(this.x2, this.y, this.width, this.size);\n\t\t\tctx.stroke();\n\t\t\tctx.globalAlpha = 0.4;\n\t\t\tctx.fill();\n\t\tctx.closePath();\n\t\tctx.globalAlpha = 1.0;\n \n // draw the buttons\n for(var i=0; i<this.innerButtons.length; i++){\n this.innerButtons[i].draw(ctx);\n }\n\t\t\n\t\t// draw the current selection text\n\t\tctx.fillStyle = \"#FFFF33\";\n\t\tctx.font = \"\" + Math.round(this.size/2) + \"px Arial\"\n\t\tctx.fillText(this.selectionList[this.selected],\n\t\t\t\tthis.x2 + this.width + 20,\n\t\t\t\tthis.y + 2*this.size/3);\n\t\t\n\t\tctx.restore();\n }\n\t\n\t// toggle enabled true or false with this option\n\tthis.setEnabled = function(enabled){\n\t\tthis.enabled = enabled;\n\t}\n\t\n\t// customized intersects function (because the button is bigger than the text)\n\tthis.intersects = function(x, y){\n\t\treturn (x > this.x2 && x < (this.x2 + this.width) &&\n\t\t\t\ty > this.y && y < (this.y + this.size));\n\t};\n}", "title": "" }, { "docid": "68ab15b174b7a65245fe7469a4e9f92b", "score": "0.47948077", "text": "function createQuestionElement(index) {\r\n var qElement = $('<div>', {\r\n id: 'question'\r\n });\r\n \r\n var header = $('<h2>Question ' + (index + 1) + ':</h2>');\r\n qElement.append(header);\r\n \r\n var question = $('<p>').append(questions[index].question);\r\n qElement.append(question);\r\n \r\n var radioButtons = createRadios(index);\r\n qElement.append(radioButtons);\r\n \r\n return qElement;\r\n }", "title": "" }, { "docid": "0494af25bedddc08b143c112ed81f957", "score": "0.47944993", "text": "function questionFormat(questionTitleText, questionNumber) {\n var divTitleRow = document.createElement(\"div\");\n var divTitleCol = document.createElement(\"div\");\n var divHRRow = document.createElement(\"div\");\n var divHRCol = document.createElement(\"div\");\n var divAnswerRow = document.createElement(\"div\");\n var divAnswerCol = document.createElement(\"div\");\n var correctWrongRow = document.createElement(\"div\");\n var formCheck1 = document.createElement(\"div\");\n var formCheck2 = document.createElement(\"div\");\n var formCheck3 = document.createElement(\"div\");\n var formCheck4 = document.createElement(\"div\");\n var buttonRow = document.createElement(\"div\");\n var buttonCol = document.createElement(\"div\");\n\n var questionTitle = document.createElement(\"h2\");\n var p1 = document.createElement(\"p\");\n var p2 = document.createElement(\"p\");\n var p3 = document.createElement(\"p\");\n var hr1 = document.createElement(\"hr\");\n var formLabel1 = document.createElement(\"label\");\n var radioForm1 = document.createElement(\"input\");\n var formLabel2 = document.createElement(\"label\");\n var radioForm2 = document.createElement(\"input\");\n var formLabel3 = document.createElement(\"label\");\n var radioForm3 = document.createElement(\"input\");\n var formLabel4 = document.createElement(\"label\");\n var radioForm4 = document.createElement(\"input\");\n var submitButton = document.createElement(\"button\");\n\n mainContainer.appendChild(correctWrongRow);\n correctWrongRow.appendChild(p2);\n correctWrongRow.appendChild(p3);\n mainContainer.appendChild(divTitleRow);\n divTitleRow.appendChild(divTitleCol);\n divTitleCol.appendChild(questionTitle);\n divTitleCol.appendChild(p1);\n\n mainContainer.appendChild(divHRRow);\n divHRRow.appendChild(divHRCol);\n divHRCol.appendChild(hr1);\n\n correctWrongRow.setAttribute(\"class\", \"row\");\n p2.setAttribute(\"class\", \"mr-3\");\n divTitleRow.setAttribute(\"class\", \"row\");\n buttonRow.setAttribute(\"class\", \"row\");\n divTitleCol.setAttribute(\"class\", \"col-md\");\n buttonCol.setAttribute(\"class\", \"col-md\");\n\n\n p2.textContent = \"Correct \" + totalCorrect;\n p3.textContent = \"Wrong \" + totalWrong;\n questionTitle.textContent = questionTitleText;\n p1.textContent = questions[questionNumber].question;\n\n mainContainer.appendChild(divAnswerRow);\n mainContainer.appendChild(buttonRow);\n buttonRow.appendChild(buttonCol);\n divAnswerRow.appendChild(divAnswerCol);\n divAnswerCol.appendChild(formCheck1);\n divAnswerCol.appendChild(formCheck2);\n divAnswerCol.appendChild(formCheck3);\n divAnswerCol.appendChild(formCheck4);\n buttonCol.appendChild(submitButton);\n\n formCheck1.appendChild(radioForm1);\n formCheck1.appendChild(formLabel1);\n formCheck2.appendChild(radioForm2);\n formCheck2.appendChild(formLabel2);\n formCheck3.appendChild(radioForm3);\n formCheck3.appendChild(formLabel3);\n formCheck4.appendChild(radioForm4);\n formCheck4.appendChild(formLabel4);\n\n formCheck1.setAttribute(\"class\", \"form-check\");\n formCheck2.setAttribute(\"class\", \"form-check\");\n formCheck3.setAttribute(\"class\", \"form-check\");\n formCheck4.setAttribute(\"class\", \"form-check\");\n\n divAnswerRow.setAttribute(\"class\", \"row\");\n divAnswerCol.setAttribute(\"class\", \"col-md\");\n radioForm1.setAttribute(\"class\", \"form-check-input\");\n radioForm1.setAttribute(\"type\", \"radio\");\n radioForm1.setAttribute(\"name\", \"answer1\");\n radioForm1.setAttribute(\"id\", \"answerRadio1\");\n radioForm1.setAttribute(\"value\", questions[questionNumber].answer[0]);\n formLabel1.setAttribute(\"class\", \"form-check-label\");\n formLabel1.setAttribute(\"for\", \"answerRadio1\");\n formLabel1.textContent = questions[questionNumber].answer[0];\n\n radioForm2.setAttribute(\"type\", \"radio\");\n radioForm2.setAttribute(\"name\", \"answer1\");\n radioForm2.setAttribute(\"id\", \"answerRadio2\");\n radioForm2.setAttribute(\"class\", \"form-check-input\");\n radioForm2.setAttribute(\"value\", questions[questionNumber].answer[1]);\n formLabel2.setAttribute(\"class\", \"form-check-label\");\n formLabel2.setAttribute(\"for\", \"answerRadio2\");\n formLabel2.textContent = questions[questionNumber].answer[1];\n\n radioForm3.setAttribute(\"class\", \"form-check-input\");\n radioForm3.setAttribute(\"type\", \"radio\");\n radioForm3.setAttribute(\"name\", \"answer1\");\n radioForm3.setAttribute(\"id\", \"answerRadio3\");\n radioForm3.setAttribute(\"value\", questions[questionNumber].answer[2]);\n formLabel3.setAttribute(\"class\", \"form-check-label\");\n formLabel3.setAttribute(\"for\", \"answerRadio3\");\n formLabel3.textContent = questions[questionNumber].answer[2];\n\n radioForm4.setAttribute(\"class\", \"form-check-input\");\n radioForm4.setAttribute(\"type\", \"radio\");\n radioForm4.setAttribute(\"name\", \"answer1\");\n radioForm4.setAttribute(\"id\", \"answerRadio4\");\n radioForm4.setAttribute(\"value\", questions[questionNumber].answer[3]);\n formLabel4.setAttribute(\"class\", \"form-check-label\");\n formLabel4.setAttribute(\"for\", \"answerRadio4\");\n formLabel4.textContent = questions[questionNumber].answer[3];\n\n submitButton.setAttribute(\"id\", \"submit-button\");\n submitButton.setAttribute(\"class\", \"btn btn-primary mt-3\");\n submitButton.textContent = \"Submit\";\n}", "title": "" }, { "docid": "e7dc8fe8baf043f5a1330bef80ae95c0", "score": "0.47930676", "text": "function addRootQuestion(givenButton, givenRootQText, givenRootQTime, givenRootQFeedback)\r\n{\r\n numOfRootQSoFar++;\r\n numOfQSoFar++;\r\n\r\n //update the number of questions\r\n document.getElementById('quizEditor').setAttribute('data-numOfQuestions', numOfQSoFar);\r\n\r\n //wrapper to contain the root question and all of the sub questions\r\n var rootQDiv = document.createElement('div');\r\n rootQDiv.setAttribute('id', 'rootQDiv' + (numOfRootQSoFar - 1));\r\n rootQDiv.setAttribute('class' , 'rootQDiv');\r\n rootQDiv.setAttribute('data-x', (numOfRootQSoFar - 1));\r\n rootQDiv.setAttribute('data-y', '0');\r\n\r\n\r\n var rootQTable = createRootQTable((numOfRootQSoFar - 1), givenRootQText, givenRootQTime, givenRootQFeedback);\r\n //append the root question table to the wrapper\r\n rootQDiv.appendChild(rootQTable);\r\n\r\n //wrapper that includes hideOrShow\r\n var subQDivWithHideOrShow = document.createElement('div');\r\n subQDivWithHideOrShow.setAttribute('class', 'subQDivWithHideOrShow');\r\n subQDivWithHideOrShow.style.display = 'block';\r\n\r\n //button for hide/show sub questions\r\n var hideSubQButton = document.createElement('input');\r\n hideSubQButton.setAttribute('type', 'button');\r\n hideSubQButton.setAttribute('value','Hide');\r\n hideSubQButton.setAttribute('class', 'hideSubQButton');\r\n hideSubQButton.setAttribute('id','make-my-subqhide-button-small');\r\n hideSubQButton.setAttribute('onClick', 'hideSubQuestions(this)');\r\n\r\n subQDivWithHideOrShow.appendChild(hideSubQButton);\r\n\r\n\r\n // hide/show individual sub questions added. known error: edit root Q order does not work properly\r\n // a wrapper for sub questions\r\n var subQDiv = document.createElement('div');\r\n subQDiv.setAttribute('data-numOfSubQSoFar', '0');\r\n subQDiv.setAttribute('class', 'subQDiv');\r\n subQDiv.setAttribute('style', 'display: block;');\r\n subQDiv.setAttribute('id', 'subQDiv' + (numOfRootQSoFar - 1) + '0');\r\n\r\n //hide/show individual sub questions added. known error: edit root Q order does not work properly\r\n\r\n\r\n var dragConfig = createDragConfigSub();\r\n\r\n //make the sub Q Div as the draggable container\r\n dragConfig.containers.push(subQDiv);\r\n\r\n //wrapper to contain subQDiv and button\r\n var subQDivWithButton = document.createElement('div');\r\n subQDivWithButton.setAttribute('class', 'subQDivWithButton');\r\n subQDivWithButton.setAttribute('style', 'display: block;');\r\n //append the subQdiv to the div with button\r\n subQDivWithButton.appendChild(subQDiv);\r\n\r\n\r\n //append 'add sub question' button to the wrapper\r\n var addSubQButton = document.createElement('input');\r\n\r\n addSubQButton.setAttribute('id', 'addSubQButton' + (numOfRootQSoFar - 1));\r\n addSubQButton.setAttribute('type', 'button');\r\n addSubQButton.setAttribute('value', '+');\r\n\r\n //set the onClick attribute (adding a sub question)\r\n addSubQButton.setAttribute('onClick', 'addSubQuestion(this)');\r\n addSubQButton.setAttribute('class', 'addSubQButton');\r\n\r\n\r\n //append the button to the div with button\r\n subQDivWithButton.appendChild(addSubQButton);\r\n\r\n subQDivWithHideOrShow.appendChild(subQDivWithButton);\r\n\r\n //append the subQDiv with Button to the rootQDiv\r\n rootQDiv.appendChild(subQDivWithHideOrShow);\r\n\r\n\r\n //append the wrapper right before where the button is situated\r\n givenButton.previousElementSibling.appendChild(rootQDiv);\r\n\r\n\r\n\r\n return rootQTable;\r\n\r\n}", "title": "" }, { "docid": "ada417dda1748d96f24b00447a8de2d5", "score": "0.47901165", "text": "function renderPreviousQuestion() {\n control.page--;\n if (control.page == 0) {\n hideBackButton();\n }\n if (control.page == 4) {\n showNextButton();\n hideResults();\n }\n renderQuestion();\n}", "title": "" } ]
44a798f3ac4600c3b9508eb08d048dab
This function loads the Line dropdown list with values
[ { "docid": "bb51e4428e70460750e505624fb69b7f", "score": "0.775814", "text": "function loadLineDD(line){\n\n \tvar label = \"\";\n\t\n\tlineList = document.getElementById('lineList');\n\t\n\t//Add line to dropdown\n var newOption = document.createElement('option');\n\tif(line.numPoints > 1){\n\t\tlabel = \"Line: \";\n\t}\n\telse{\n\t\tlabel = \"Point: \";\n\t}\n newOption.text = label + line.name;\n\tnewOption.line = line;\n\tlineList.add(newOption, 0);\n \n\treturn; \n\n}", "title": "" } ]
[ { "docid": "5451e6fd88a4c75cc74dc2614968f89d", "score": "0.6830904", "text": "function load_lines()\n{\n\tconsole.log('Showing all lines');\n\t\n\tvar lines_list = new UI.Menu({ sections: [{ items: [{ title: 'Loading...'}] }] });\n\tlines_list.show();\n\t\n\tvar lines = ['rd', 'or', 'yl', 'gr', 'bl', 'sv'];\n\t\n\tfor (var l in lines)\n\t{\n\t\tlines_list.item (0, l, {\n\t\t\ttitle: tr_line (lines[l]) + ' Line',\n\t\t\tline: lines[l],\n\t\t\ticon: 'images/' + lines[l] + '.png'\n\t\t});\n\t}\n\tlines_list.on('select', function (e)\n\t{\n\t\tload_stations(e.item.line);\n\t});\n}", "title": "" }, { "docid": "10c290b8a278bc733eee121525e1b2f9", "score": "0.6737032", "text": "function loadPointDD(line, numPoints, oldPoints){\n\t\n\tpointList = document.getElementById('pointList');\n\t\n\t//Remove old points\n\tfor(var i = 0; i < oldPoints; i++){\n\t\tpointList.remove(i);\n\t}\n\t\n\t//Iterate through points in line and add to dropdown\n\tfor(var i = 0; i < numPoints; i++) {\n\t\t\n var newOption = document.createElement('option');\n newOption.text = \"(\" + line.pointList[i].name + \")\";\n\t\tnewOption.value = i;\n\t\tnewOption.point = line.pointList[i];\n\t\tpointList.add(newOption, 0);\t\n }\n\t\n\treturn;\n}", "title": "" }, { "docid": "ee8c4f1bf82c1a367a031ff4bedf98e1", "score": "0.660603", "text": "function getBusLines() {\n $.ajax({\n type: \"POST\",\n url: \"/get_busLines/\",\n data: { csrfmiddlewaretoken: csrftoken },\n success: function(response) {\n bus_lines = JSON.parse(response).bus_lines;\n // console.log(bus_lines);\n for (var i=0; i<bus_lines.length; i++) {\n document.getElementById('bus_line').innerHTML += '<option>' + bus_lines[i][0] + ' (' + bus_lines[i][1] + ')</option>';\n }\n }\n })\n}", "title": "" }, { "docid": "6e03892d7423b1241708835bba1ea6a3", "score": "0.6318919", "text": "function processData2(allText) {\r\n var allTextLines = allText.split(/\\r\\n|\\n/);\r\n var headers = allTextLines[0].split(',');\r\n var lines = [];\r\n\r\n for (var i=1; i<allTextLines.length; i++) {\r\n var data = allTextLines[i].split(',');\r\n if (data.length == headers.length) {\r\n\r\n var tarr = [];\r\n for (var j=0; j<data.length; j++) {\r\n //tarr.push(headers[j]+\":\"+data[j]);\r\n\t\t\t\ttarr.push(data[j]); // thake just the values without header\r\n }\r\n lines.push(tarr);\r\n }\r\n }\r\n \r\n\tx = lines\r\n\t\r\n\t// push each value in x to the dropdown\r\nconst first_name = document.getElementById(\"readFirstName\")\r\n\r\n\tx.forEach( x => {\tconst option = document.createElement(\"option\")\r\n\t\toption.textContent = x\r\n\t\t//option.id = t.id\r\n\t\tfirst_name.appendChild(option)\r\n\t\t})\r\n}", "title": "" }, { "docid": "15b09a1ab0551223a0692d5ec058fb5d", "score": "0.6280256", "text": "function newLineList(){\n // select box\n var sel = document.createElement('select');\n sel.setAttribute('style','margin-bottom:5px; width:45px;height:24px; float:left;');\n sel.className = \"selProduct\"; // className = selProduct. This will be useful when we insert into DB\n\n // Append options to select box\n for (var i = 0; i < lineArr.length; i++) {\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", lineArr[i]);\n option.text = lineArr[i];\n sel.appendChild(option);\n }\n return sel;\n}", "title": "" }, { "docid": "c9996797065126b274416367f921a6f0", "score": "0.62015855", "text": "function onLoadResponse(evt){\n console.log(\"HEREEE\");\n var dropDown1= document.getElementById(\"puma_select\");\n var dropDown2= document.getElementById(\"year_select\");\n dropDown2.options.add( new Option(\"2013\") );\n dropDown2.options.add( new Option(\"2014\") );\n dropDown2.options.add( new Option(\"2015\") );\n\n var xhr = evt.target;\n var jsonData=JSON.parse(xhr.responseText);\n console.log(jsonData.puma_list.length);\n for (var i=0; i<jsonData.puma_list.length; i++){\n dropDown1.options.add( new Option(jsonData.puma_list[i]) );\n }\n}", "title": "" }, { "docid": "8425c7dfb4d1ac8a12478a9eddd0f0d4", "score": "0.6171183", "text": "function makeDropDown(each_country) {\r\n\r\n // Append the dropdown to the SVG\r\n var dropDown = d3.select(\"body\")\r\n .append('select')\r\n\r\n var options = dropDown.selectAll('option')\r\n .data(each_country)\r\n .enter()\r\n .append('option')\r\n .text(d => d)\r\n\r\n dropDown.on(\"change\", function () {\r\n country_selected = this.value;\r\n svgLineGraph.selectAll(\"path\").remove()\r\n svgLineGraph.selectAll(\"text\").remove()\r\n svgLineGraph.selectAll(\"g\").remove()\r\n makeLineGraphBase();\r\n });\r\n }", "title": "" }, { "docid": "2639a65db6c00e307abd9a168ab8ec09", "score": "0.6161572", "text": "function loadDataset(index,value){\t\n\t\tvar option=\"<option value='\"+value.conf+\"'>\"+value.name+\"</option>\";\n\t\t$(\"#dset\").append(option);\t\n\t}", "title": "" }, { "docid": "2639a65db6c00e307abd9a168ab8ec09", "score": "0.6161572", "text": "function loadDataset(index,value){\t\n\t\tvar option=\"<option value='\"+value.conf+\"'>\"+value.name+\"</option>\";\n\t\t$(\"#dset\").append(option);\t\n\t}", "title": "" }, { "docid": "d8ffbc4ea6a1d5214daf704af094d164", "score": "0.6152864", "text": "function processData3(allText) {\r\n var allTextLines = allText.split(/\\r\\n|\\n/);\r\n var headers = allTextLines[0].split(',');\r\n var lines = [];\r\n\r\n for (var i=1; i<allTextLines.length; i++) {\r\n var data = allTextLines[i].split(',');\r\n if (data.length == headers.length) {\r\n\r\n var tarr = [];\r\n for (var j=0; j<data.length; j++) {\r\n //tarr.push(headers[j]+\":\"+data[j]);\r\n\t\t\t\ttarr.push(data[j]); // thake just the values without header\r\n }\r\n lines.push(tarr);\r\n }\r\n }\r\n \r\n\tx = lines\r\n\t\r\n\t// push each value in x to the dropdown\r\nconst second_name = document.getElementById(\"readSecondName\")\r\n\r\n\tx.forEach( x => {\tconst option = document.createElement(\"option\")\r\n\t\toption.textContent = x\r\n\t\t//option.id = t.id\r\n\t\tsecond_name.appendChild(option)\r\n\t\t})\r\n}", "title": "" }, { "docid": "7096304a11c8c047c0f33a12419d1e62", "score": "0.61202496", "text": "function init() {\n // Assign the value of the dropdown menu option to a variable\n var dropdownMenu = d3.select(\"#selDataset\");\n\n // read the data \n d3.json(url).then((data) => {\n\n names = []\n data.forEach(function(obj) {\n var label = obj.facility_name\n names.push(label)\n })\n // console.log(names)\n\n //get ids for dropdow\n names.forEach(function(ID) {\n dropdownMenu.append(\"option\").text(ID).property(\"value\");\n })\n\n // call functions to display plot\n getValues(names[0]);\n getData(names[0]);\n\n })\n}", "title": "" }, { "docid": "bb4d0b339ac8a2ad0b5ea2d26fc5d6bb", "score": "0.60658836", "text": "function initializeHorizontalAxe() {\n//Charger tous les axes dans l'horizontal\n\n $.ajax({\n url : '/mepa-front/api/dataSet/' + idDataSet + '.json',\n type : 'GET',\n dataType : 'json',\n success: function(data) {\n listAxe = data.fieldMap;\n $.each(listAxe, function(key, val)\n {\n $('#horizontal-axe').append('<option value=' + key + '>' + key + '</option>');\n });\n },\n error: function() {\n console.log(\"error while getting the dataset from API\");\n }\n });\n}", "title": "" }, { "docid": "5a6a4dd0881de20975f694d8dacf44be", "score": "0.60605556", "text": "function FillDropDowns(controlname,hdncontrolname,DataField)\n {\n var FinalData;\n FinalData=document.getElementById(hdncontrolname).value;\n FinalData=FinalData.split(\";\")\n var data;\n var subdata;\n for(i = 0; i < FinalData.length; i++)\n {\n data=FinalData[i];\n data=data.split(\",\");\n if(data.length >0)\n {\n if(data[2]!=null)\n {\n //To get JobID value\n subdata=data[2].split(\"=\");\n //JobID and Selected TrxID equalents items added to dropdownlist\n if(subdata[1] == DataField)\n {\n var opt = document.createElement(\"option\");\n // Add an Option object to Drop Down/List Box\n document.getElementById(controlname).options.add(opt);\n // Assign text and value to Option object\n subdata=data[1].split(\"=\");\n opt.text = subdata[1];\n subdata=data[0].split(\"=\");\n opt.value = subdata[1];\n }\n }\n }\n } \n //For loop close\n }", "title": "" }, { "docid": "9e56ee7cc9da03987e2b4c6e706ae641", "score": "0.6033576", "text": "function fillInSelectOptions(resp) {\n var requiredList = JSON.parse(resp);\n // build a little selection pulldown menu\n var selectTarget = document.getElementById(\"dataOptions\");\n \n addOption(selectTarget, [\"Select Census Data\", 0, \"no-op\"]);\n for(var i = 0; i < requiredList.length; i++) {\n addOption(selectTarget, requiredList[i]);\n }\n addOption(selectTarget, [\"Vote value\", 0, \"voteValue\"]);\n}", "title": "" }, { "docid": "f831ca18dbee367a8823352eabf892f2", "score": "0.6028111", "text": "function loadDrop(){\n var drop=\"\";\n for(var i=0;i<productes_client.length;i++){\n var marca=productes_client[i][1].split(\",\");\n drop+=\"<option value='\"+productes_client[i][0]+\"'>\"+productes_client[i][0]+\" -- \"+marca[0]+\"</option>\"\n }\n $(\"#inventari\")[0].innerHTML=drop;\n}", "title": "" }, { "docid": "fae6458b98b58f7d946a7716953e0a0f", "score": "0.60062575", "text": "function checkLine(){\n let myOption = $('#line option:selected').val();\n let stationList = $('#stations').find('[data-line=\"' + myOption + '\"]').html();\n $('#origin, #destination').html(stationList);\n}", "title": "" }, { "docid": "8eb46912cd429ddbf14335916bf9a9c2", "score": "0.59724134", "text": "function LoadStatusDropdown() {\n // and StaticName eq 'ProjectType'\n var requesturl = _spPageContextInfo.webAbsoluteUrl + \"/_api/web/lists/getbytitle('\" + project_listDisplayName + \"')/fields?$filter=StaticName eq 'Status'\";\n $.ajax({\n url: requesturl,\n type: \"GET\",\n headers: { \"accept\": \"application/json;odata=verbose\" },\n async: false,\n success: function (data) {\n if (data.d.results) {\n Client_Status.push({ Title: \"Select\", ID: \"Select\" });\n for (var j = 0; j < data.d.results[0].Choices.results.length; j++) {\n Client_Status.push({ Title: data.d.results[0].Choices.results[j], ID: data.d.results[0].Choices.results[j] });\n }\n $scope.statusitems = Client_Status;\n\n }\n },\n error: function (xhr) {\n //alert(xhr.status + ': ' + xhr.statusText);\n }\n });\n }", "title": "" }, { "docid": "13ceeb932eb9e5bdb2f709898cbf914f", "score": "0.59717435", "text": "function loadDropdown() {\n url_icao24 = `/api/v1.0/aircrafts-data`\n d3.json(url_icao24).then((importData) => {\n createDropdownMenu(importData)\n });\n}", "title": "" }, { "docid": "78626d49cc7b902792220e6f5a5875e8", "score": "0.59546715", "text": "function GetDropdownList() {\n // Get CFXType Dropdown list\n var typeCodeList = [\"ProductCondition\", \"INW_LINE_UQ\", \"AdjustmentReason\", \"WMSYESNO\"];\n var dynamicFindAllInput = [];\n\n typeCodeList.map(function (value, key) {\n dynamicFindAllInput[key] = {\n \"FieldName\": \"TypeCode\",\n \"value\": value\n }\n });\n var _input = {\n \"searchInput\": dynamicFindAllInput,\n \"FilterID\": appConfig.Entities.CfxTypes.API.DynamicFindAll.FilterID\n };\n\n apiService.post(\"eAxisAPI\", appConfig.Entities.CfxTypes.API.DynamicFindAll.Url + authService.getUserInfo().AppPK, _input).then(function (response) {\n if (response.data.Response) {\n typeCodeList.map(function (value, key) {\n AdjustmentGeneralCtrl.ePage.Masters.DropDownMasterList[value] = helperService.metaBase();\n AdjustmentGeneralCtrl.ePage.Masters.DropDownMasterList[value].ListSource = response.data.Response[value];\n });\n }\n });\n }", "title": "" }, { "docid": "91e46c6bba3d61ef08f97591072c6ad8", "score": "0.59328556", "text": "function LoadReferenceNo() {\n\n var pageUrl = '/Webservice/svr_CustomerSales.asmx';\n\n\n $.ajax({\n type: \"POST\",\n url: pageUrl + \"/SelectReferenceNo\",\n data: \"{ 'id':'0', 'prefix_initial':'', 'description':'', 'lastest':'0', 'nextno':'0', 'maximum':'0' }\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n crossdomain: true,\n success: function (response) {\n\n $('#SalesRef').empty();\n $('#SalesRef').append(\"<option value='\" + \"0\" + \"'>\" + \"</option>\");\n var data = eval(response.d);\n var obj = \"\";\n for (var i = 0; i < data.length; i++) {\n\n $('#SalesRef').append(\"<option value='\" + data[i][\"ID\"] + \"'>\" + data[i][\"PrefixInitial\"] + \"</option>\");\n\n }\n\n\n },\n error: function (response) {\n alert(response.status);\n }\n });\n\n}", "title": "" }, { "docid": "356b420a75bff9ece9df6e1c3567cbc9", "score": "0.59285086", "text": "function createSelect(rawData, itemName) {\n //console.log(\"itemName\", itemName);\n // console.log(\"rawdata\", rawData);\n var myDiv = document.getElementById(\"select_\" + itemName);\n myDiv.innerHTML = \"\";\n\n\n if (itemName == \"customer\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"customerName\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"customerName\"]).trim();\n myDiv.appendChild(option);\n }\n // var selected = $(\"#current-route\").val();\n // alert($scope.currentRoute);\n $(\"#select_customer\").val($scope.currentRoute);\n }\n\n if (itemName == \"kittype\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"kitType\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"kitType\"]).trim();\n myDiv.appendChild(option);\n }\n // var selected = $(\"#current-route\").val();\n // alert($scope.currentRoute);\n $(\"#select_kittype\").val($scope.currentRoute);\n }\n\n if (itemName == \"detail\") {\n if (rawData != undefined) {\n $(\"#detail-report\").show();\n\n // var option1 = document.createElement(\"option\");\n // option1.value = \"\";\n // option1.text = \"\";\n // myDiv.appendChild(option1);\n\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i]).trim();//Subcon QC\n option.text = String(rawData[i]).trim();\n myDiv.appendChild(option);\n }\n }\n // var selected = $(\"#current-route\").val();\n // alert($scope.currentRoute);\n // $(\"#select_detail\").val($scope.currentRoute);\n }\n\n //if (itemName == \"customerkittype\") {\n // var option1 = document.createElement(\"option\");\n // option1.value = \"\";\n // option1.text = \"\";\n // myDiv.appendChild(option1);\n\n // for (var i = 0; i < rawData.length; i++) {\n // var option = document.createElement(\"option\");\n // option.value = String(rawData[i][\"kitType\"]).trim();//Subcon QC\n // option.text = String(rawData[i][\"kitType\"]).trim();\n // myDiv.appendChild(option);\n // }\n // // var selected = $(\"#current-route\").val();\n // // alert($scope.currentRoute);\n // $(\"#select_customerkittype\").val($scope.currentRoute);\n //}\n }", "title": "" }, { "docid": "81c8f7994d41bfea186cfd578b9c4436", "score": "0.59168184", "text": "function loadLeaseterms(from_date, to_date) {\n var data = {'from_date': from_date, 'to_date': to_date};\n $(\"#lease_terms, #lease_type, #lkp_trucklease_lease_term_id\").empty().append('<option value=\"\">Lease Term*</option>').selectpicker('refresh');\n if (from_date != '' && to_date != '') {\n $.ajax({\n type: \"POST\",\n url: '/trucklease/ajxleaseterms',\n data: data,\n dataType: 'json',\n success: function (resData) {\n if (resData.success == true) {\n var htmlText = '';\n $.each(resData.optHtml, function (k, v) {\n htmlText += '<option value=\"' + k + '\">' + v + '</option>';\n });\n $(\"#lease_terms, #lease_type, #lkp_trucklease_lease_term_id\").append(htmlText);\n $('#lease_terms, #lease_type, #lkp_trucklease_lease_term_id').selectpicker('refresh');\n /* Checking element exists or not */\n if ($('#daysDiffCnt').length) {\n $(\"#daysDiffCnt\").val(resData.daysDiff);\n } else {\n $('#lease_terms, #lease_type').next().append('<input type=\"hidden\" name=\"daysDiffCnt\" id=\"daysDiffCnt\" value=\"' + resData.daysDiff + '\" />');\n }\n }\n },\n error: function (request, status, error) {\n },\n });\n }\n}", "title": "" }, { "docid": "7b05b49232f3a029a75ed8d8614f54d8", "score": "0.5886287", "text": "function GetDropDownList() {\n var typeCodeList = [\"CodeType\"];\n var dynamicFindAllInput = [];\n\n typeCodeList.map(function (value, key) {\n dynamicFindAllInput[key] = {\n \"FieldName\": \"TypeCode\",\n \"value\": value\n }\n });\n var _input = {\n \"searchInput\": dynamicFindAllInput,\n \"FilterID\": appConfig.Entities.CfxTypes.API.DynamicFindAll.FilterID\n };\n\n apiService.post(\"eAxisAPI\", appConfig.Entities.CfxTypes.API.DynamicFindAll.Url + authService.getUserInfo().AppPK, _input).then(function (response) {\n if (response.data.Response) {\n typeCodeList.map(function (value, key) {\n GenerateBarcodeCtrl.ePage.Masters.DropDownMasterList[value] = helperService.metaBase();\n GenerateBarcodeCtrl.ePage.Masters.DropDownMasterList[value].ListSource = response.data.Response[value];\n });\n }\n });\n }", "title": "" }, { "docid": "37cbc28c50450bad523074391dc9709a", "score": "0.58763444", "text": "function LoadTermsOpeningBalance() {\n\n var pageUrl = '/Webservice/svr_Terms.asmx';\n\n\n $.ajax({\n type: \"POST\",\n url: pageUrl + \"/SelectTerm\",\n data: \"{ 'id':'0', 'term_name':'' }\",\n contentType: \"application/json; charset=utf-8\", \n dataType: \"json\",\n crossdomain: true,\n success: function (response) {\n\n $('#termOpeningBalance').empty();\n var data = eval(response.d);\n var obj = \"\";\n for (var i = 0; i < data.length; i++) {\n\n $('#termOpeningBalance').append(\"<option value='\" + data[i][\"ID\"] + \"'>\" + data[i][\"TermName\"] + \"</option>\");\n\n }\n\n },\n error: function (response) {\n alert(response.status);\n }\n });\n}", "title": "" }, { "docid": "d2f99600b9318fdc47b9e0a8421668d7", "score": "0.5868095", "text": "function changeOptions() {\n var chemin = $('#monPath').val();\n\n loadLst(chemin);\n}", "title": "" }, { "docid": "22522c502aa72f418fef12aaa2a83407", "score": "0.5860257", "text": "function updateLineChart() {\n //$ntaDropdown.change(function() {\n $ntaDropdown.dropdown('refresh');\n \n dataset=$datasetDropdown.dropdown(\"get value\");\n console.log(dataset)\n selectedNTAs = $(\"#neighborhoodDropdown\").dropdown(\"get value\") \n // selectedNTAs = selectedNTAs.slice(0,5)\n \n // console.log('New NTAs for line chart!');\n // console.log(selectedNTAs);\n \n // color object\n color = d3v3.scale.ordinal().domain(selectedNTAs).range(colorbrewer.Paired[9]);\n \n if (selectedNTAs.length == 0 || (selectedNTAs.length == 1 && selectedNTAs[0] == 'NYC')){\n selectedNTAs = Object.values(allNTA)\n d3v3.select(\"#legend\").remove()\n } else if (selectedNTAs.length > 1 && selectedNTAs[0] == 'NYC'){\n selectedNTAs = selectedNTAs.slice(1)\n d3v3.select('#legendContainer').append('svg').attr(\"id\",\"legend\")\n }\n // Get the initial data\n if (dataset.includes('acs')){ // Use for ACS data\n sqlD3 = `https://wxu-carto.carto.com/api/v2/sql?q=SELECT value as count, ntacode, variable, year from \"wxu-carto\".${dataset} as a WHERE ntacode in ('${selectedNTAs.join(`', '`)}')`\n }else{\n sqlD3 = `https://wxu-carto.carto.com/api/v2/sql?q=SELECT DATE_PART('year',${datasetDict[dataset][\"datename\"]}) as year,${datasetDict[dataset][\"groupby_cat\"]}, ntacode, count(*) FROM \"wxu-carto\".${dataset} WHERE ntacode in ('${selectedNTAs.join(`', '`)}') group by DATE_PART('year',${datasetDict[dataset][\"datename\"]}),${datasetDict[dataset][\"groupby_cat\"]},ntacode&api_key=c5yeQOubTACo6uxKipiq8A`\n }\n // console.log(sqlD3);\n var complaintTypes = {};\n console.log('This SQL query is data for the line chart')\n console.log(sqlD3);\n \n d3v3.json(sqlD3,\n \n //READ ONLY SQL API KEY\n function(error, json) {\n json = json.rows;\n //console.log(json);\n var dropdown = document.getElementById('inds');\n dropdown.innerHTML='' \n \n min_year = null\n max_year = null\n json.forEach(function(d, i) {\n d.count = +d.count;\n if (d.year > max_year || !max_year){\n max_year = d.year\n }\n if (d.year < min_year || !min_year){\n min_year = d.year\n }\n d.year = parseDate(String(d.year));\n \n complaint = d[datasetDict[dataset]['groupby_cat']] ;\n \n // Adding in dropdown options\n if (!complaintTypes[complaint]){\n dropdown.innerHTML += `<option value=\"${complaint}\">${complaint}</option>`;\n \n complaintTypes[complaint] = true;\n } \n });\n if (!dataset.includes('acs')){\n dropdown.innerHTML += `<option selected=\"selected\" value=\"Total\">Total</option>`;\n } else {\n dropdown.value = datasetDict[dataset]['first_cat'];\n }\n // Make new date range\n var date_range = d3v3.time.years(parseDate(String(min_year)),parseDate(String(max_year+1)), 1);\n \n // data here is filtered and filled zero data\n data = filterJSON(json, dataset, datasetDict[dataset]['groupby_cat'],datasetDict[dataset]['first_cat']);\n data = getZeroes(data, datasetDict[dataset]['first_cat'], date_range);\n xAxis.ticks(date_range.length)\n updateGraph(data);\n \n // Update data filter when dropdown menu option changes\n d3v3.selectAll('#inds')\n .on(\"change\", function () {\n var sect = document.getElementById(\"inds\");\n var section = sect.options[sect.selectedIndex].value;\n // json variable is ALWAYS the same, it's the initial SQL query\n data = filterJSON(json, dataset, datasetDict[dataset]['groupby_cat'] ,section);\n // console.log(\"get filtered data for this category\",data);\n data = getZeroes(data, section, date_range)\n \n //debugger\n data.forEach(function(d) {\n // Make sure 'count' is a number\n d.count = +d.count;\n // The code in line below might not be necessary, depends on data date format\n // \t\t d.year = parseDate(String(d.year));\n d.active = true;\n });\n //console.log(\"updated and filtered data is\",data);\n updateGraph(data);\n });\n });\n }", "title": "" }, { "docid": "1dff29992e3fbf6ef04bb907fd21ebf2", "score": "0.58586514", "text": "function loadOptions() {\n\tdocument.getElementById(\"dropdown_id\").innerHTML = \"<option>Id</option><option selected>Unid (if possible)</option>\";\n\tvar options_clvl = \"<option class='gray-all' style='color:gray' disabled>Character Level</option>\"; for (let i = 1; i < 100; i++) { options_clvl += \"<option>\"+i+\"</option>\" }\n\tdocument.getElementById(\"dropdown_clvl\").innerHTML = options_clvl\n\tdocument.getElementById(\"dropdown_clvl\").selectedIndex = character.CLVL\n\tvar options_ilvl = \"<option class='gray-all' style='color:gray' disabled>Item Level</option>\"; for (let i = 1; i < 100; i++) { options_ilvl += \"<option>\"+i+\"</option>\" }\n\tdocument.getElementById(\"dropdown_ilvl\").innerHTML = options_ilvl\n\tdocument.getElementById(\"dropdown_ilvl\").selectedIndex = character.ILVL\n}", "title": "" }, { "docid": "e8550207782db003c59f5b411be5e490", "score": "0.58508885", "text": "function autocomplete(){\n\t\tpalabra = $('#txtSporttvPartner').val();\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"../admin/partners/getPartner\",\n\t\t\tdataType:'json',\n\t\t\tdata: {\n\t\t\t\tdato:palabra\n\t\t\t},\n\t\t\tsuccess: function(data){\n\t\t\t\t$('#partnerList').empty();\n\t\t\t\tfor(var i = 0;i<data.length;i++){\n\t\t\t\t\t$('#partnerList').append(\n\t\t\t\t\t\t\"<option id='\" + data[i].id + \"' value='\" + data[i].name + \"' />\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t}", "title": "" }, { "docid": "de251743d9eeccaa04200474d4b98e66", "score": "0.5849425", "text": "function populateRouteList() {\n $.getJSON(\"https://data.foli.fi/gtfs/routes\", function(response) { // Fetch the data\n let routeList = [];\n\n // Sort the data by the line number\n response = response.sort(function (a, b) {\n let regex = /\\D/;\n // If the first charachter in either line number is a letter, sort them lexicographically so that such lines will\n // be last in the list. These lines are service lines and internal lines in the surrounding municipalities.\n if(isNaN(a.route_short_name[0]) || isNaN(b.route_short_name[0])) {\n return a.route_short_name.localeCompare(b.route_short_name);\n }\n // If either line has a non-numerical character that is not the first character, sort them primarily by their\n // numerical part and secondarily by their non-numerical part.\n let aTemp = isNaN(a.route_short_name) ? a.route_short_name.replace(regex, \"\") : a.route_short_name;\n let bTemp = isNaN(b.route_short_name) ? b.route_short_name.replace(regex, \"\") : b.route_short_name;\n if (aTemp === bTemp) return a.route_short_name.localeCompare(b.route_short_name);\n\n // If both line numbers are actual integers, sort them from smaller to bigger\n return aTemp - bTemp;\n });\n\n // Go through the sorted data and parse it into the list that is shown in the dropdown menu\n response.forEach(item => {\n let lineName = item.route_short_name + \": \" + item.route_long_name;\n var newOption = new Option(lineName, JSON.stringify({name: item.route_short_name, lineID: item.route_id}));\n $(\"#route_number\").append(newOption);\n });\n });\n}", "title": "" }, { "docid": "77b3a119235e515d10ed157bf4d9e4b4", "score": "0.58492655", "text": "function fnBindRegionTypes() {\n $.blockUI();\n $.ajax({\n type: 'POST',\n url: '../HiDoctor_Reports/Reports/GetChildRegionType',\n data: \"regionCode=\" + $(\"#hdnRegioncode\").val(),\n success: function (response) {\n jsData = eval('(' + response + ')');\n $('option', $(\"#drplevelOne\")).remove();\n $('option', $(\"#drplevelTwo\")).remove();\n\n if (jsData.Tables[0].Rows.length > 0) {\n for (var i = 0; i < jsData.Tables[0].Rows.length; i++) {\n $('#drplevelOne').append(\"<option value='\" + jsData.Tables[0].Rows[i].Region_Type_Code + \"'>\" + jsData.Tables[0].Rows[i].Region_Type_Name + \"</option>\");\n $('#drplevelTwo').append(\"<option value='\" + jsData.Tables[0].Rows[i].Region_Type_Code + \"'>\" + jsData.Tables[0].Rows[i].Region_Type_Name + \"</option>\");\n }\n }\n },\n error: function (e) {\n fnMsgAlert('info', 'CP Compliance', e.responseText);\n }\n });\n}", "title": "" }, { "docid": "c82ecb1961d32da6b380775ac75cc5f7", "score": "0.58429915", "text": "function _1sel() {\n slc2.innerHTML = \"\";//clear the target select\n let brgy = Object.keys(dataObj[slc1.value]);//get the cities from country as array\n cmo(brgy, slc2);//push values to select two\n \n }", "title": "" }, { "docid": "6353b38393523572494e39d585487812", "score": "0.5842801", "text": "function draw_select_anzeige(){\n\tcreate_feld_frucht();\n\tcreate_item_lager();\n\tvar element = document.getElementById(\"itemlist\");\n\tfor(var i = 1; i < feld_frucht.length; i++){\n\t\telement.innerHTML += \"<option value = \"+feld_frucht[i].name+\">\"+feld_frucht[i].name+\"</option>\";\n\t}\n\tfor(var i = 1; i < item_lager.length; i++){\n\t\telement.innerHTML += \"<option value = \"+item_lager[i].name+\">\"+item_lager[i].name+\"</option>\";\n\t}\n}", "title": "" }, { "docid": "be190ee00fa1aeb79e46b6ab776be53f", "score": "0.58338577", "text": "function populateAreasSelect(rows, status, xhr) {\n for (let i = 0; i < rows.length; i++) {\n $(`<option id=\"${rows[i].countid}\" style=\"display:none\" data-areaid='${rows[i].areaid}' value='${rows[i].areaname}'>${rows[i].areaname}</option>`).appendTo('#Area');\n }// end for\n}// end populateAreas", "title": "" }, { "docid": "b9ec1cba369b0ead2c61b785035ae620", "score": "0.58265465", "text": "populateSelectElements() {\n\t\tfor (const code of this.codes) {\n\t\t\tconst option = `<option value=${code[\"code\"]}>${code[\"currency\"]} (${code[\"country\"]})</option>`;\n\t\t\tthis.fromField.append(option);\n\t\t\tthis.toField.append(option);\n\t\t}\n\t}", "title": "" }, { "docid": "29e0a126733bcf03577dca18e905c9a2", "score": "0.582101", "text": "function PopulateControls(serviceUrl) {\n $.ajax({\n type: \"POST\",\n url: serviceUrl,\n data: '{}',\n contentType: \"application/json; charset=utf-8\",\n dataType: 'json',\n success: function (data) {\n var jsonostr = data.d;\n var jsonobj = eval('(' + jsonostr + ')');\n for (i in jsonobj) {\n _dropDownList.append(\"<option value='\" + jsonobj[i][\"Key\"] + \"' >\" + jsonobj[i][\"Value\"] + \"</option>\");\n }\n }\n });\n }", "title": "" }, { "docid": "52b2ec535568a73e22fa488832f970aa", "score": "0.5801166", "text": "function createLandSelectContent () {\n getJson(url, function (avtaleObject) {\n for (j = 0; j < avtaleObject.avtale.length; j++) {\n var land = avtaleObject.avtale[j].land;\n if (!landArray.includes(land)) landArray.push(land);\n }\n\n for (i=0; i < landArray.length; i++){\n land = landArray[i];\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", land);\n var landText = document.createTextNode(land);\n option.appendChild(landText);\n document.getElementById(\"land\").appendChild(option);\n };\n })\n}", "title": "" }, { "docid": "7c3dbfddab092a8be2ff86c5dec41eea", "score": "0.57985914", "text": "function getFlights(){\r\n\tconst flightDiv = document.getElementById(\"flightDiv\");\r\n\tconst flightOptionsDiv = document.getElementById(\"flightOptions\");\r\n\t\r\n\tvar departureAirport = document.getElementById(\"departureAirportOptions\").value;\r\n\tvar arrivalAirport = document.getElementById(\"arrivalAirportOptions\").value;\r\n\t\r\n\tvar flights = [\"None\", \"Flight X\"];\r\n\tvar flightcode = [\"123\", \"ABC\"]\r\n\tvar flightOptions = \"\";\r\n\t\r\n\tflightDiv.style.display = \"block\";\r\n\t\r\n\tfor (i = 0; i < flights.length; i++) {\r\n\t\tflightOptions += \"<option value='\"+flightcode[i]+\"'>\"+flights[i]+\"</option>\";\r\n\t};\r\n\t\r\n\tflightOptionsDiv.innerHTML = flightOptions;\r\n}", "title": "" }, { "docid": "45ef6e82b0b9e4353ad101023b11c1cc", "score": "0.5788536", "text": "function init() {\n dropdown = d3.select(\"#selDataset\")\n\n d3.json(\"samples.json\").then(function(data){ \n data.names.forEach((ID)=>\n {\n dropdown.append(\"option\").text(ID).property(\"value\", ID)\n })\n console.log(data);\n\n optionChanged(data.names[0]);\n }); \n\n }", "title": "" }, { "docid": "71d26d54cdaacd0c73c45ed9377e9658", "score": "0.57823896", "text": "function fillInModelOptions(resp) {\n var modelList = JSON.parse(resp);\n // build a little selection pulldown menu\n var selectTarget = document.getElementById(\"modelOptions\");\n \n addOption(selectTarget, [\"Select Model\", 0, \"no-op\"]);\n for(var i = 0; i < modelList.length; i++) {\n addOption(selectTarget, modelList[i]);\n }\n}", "title": "" }, { "docid": "5d49ac1bfe5cbda0568481065ac6e56a", "score": "0.5767815", "text": "function cargarAuto()\n{\n let value = document.getElementById('auto').value;\n fillSelect(ENDPOINT_AUTO+'&cliente='+value, 'auto', null);\n\n}", "title": "" }, { "docid": "c1075e4980d8fc088817019831b59897", "score": "0.5748406", "text": "function init() {\n const dropDown = d3.select('#selDataset');\n d3.json('data/samples.json').then((samples) => {\n const subjectID = samples.names;\n subjectID.forEach((number) => {\n dropDown.append('option').text(number).property('value', number.id);\n });\n const selection = subjectID[0];\n console.log('Initial Dropdown Menu Success') // Check functionality\n buildPlot(selection);\n });\n}", "title": "" }, { "docid": "6db9fd7cc9d7655d609bf9ec66827096", "score": "0.5746174", "text": "function selectCharts(){\n\tvar $demo1 = $('#demo1'),\n\t\t$demo2 = $('#demo2');\n\t\t\n\tvar demo1Options_header = '<option>请选择数据</option>';\n\tvar demo1Options_body = '';\n\tvar executeParam = { SPName: 'Pricing.usp_GetPricingAllCurve_HistoricalBondType', SQLParams: [] };\n\tvar serviceUrl = GlobalVariable.QuickWizardServiceUrl + 'CommonGetWithConnName?connName=QuantDB_FixedIncome&exeParams=' + encodeURIComponent(JSON.stringify(executeParam));\n\tCallWCFSvc(serviceUrl, true, 'GET', function (zNodes) {\n\t\tconsole.log(zNodes)\n\t\tfor(var i in zNodes){\n\t\t\tif(zNodes[i].Column1){\n\t\t\t\tdemo1Options_body += '<option value=\"'+zNodes[i].Column1+'\">'+zNodes[i].Column1+'</option>';\n\t\t\t}\n\t\t}\n\t\tvar demo1Options = demo1Options_header+demo1Options_body;\n\t\t$demo1.html(demo1Options);\n\t});\n\tvar demo1_value='';\n\tvar demo2_value='';\n\t$demo1.change(function(){\n\tdemo1_value = $(this).val();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\tvar demo2Options_header = '<option>请选择数据</option>';\n\tvar demo2Options_body = '';\n\tvar executeParam = { SPName: 'Pricing.usp_GetPricingAllCurve_HistoricalBondTerm', SQLParams: [] };\n\texecuteParam.SQLParams.push({ Name: 'BondType', Value: demo1_value, DBType: 'string' });\n\tvar serviceUrl = GlobalVariable.QuickWizardServiceUrl + 'CommonGetWithConnName?connName=QuantDB_FixedIncome&exeParams=' + encodeURIComponent(JSON.stringify(executeParam));\n\tCallWCFSvc(serviceUrl, true, 'GET', function (zNodes) {\n\t\tconsole.log(zNodes)\n\t\tfor(var i in zNodes){\n\t\t\tif(zNodes[i].Term){\n\t\t\t\tdemo2Options_body += '<option value=\"'+zNodes[i].Term+'\">'+zNodes[i].Term+'</option>';\n\t\t\t}\n\t\t}\n\t\tvar demo2Options = demo2Options_header+demo2Options_body;\n\t\t$demo2.html(demo2Options);\n\t});\n\t\t\n\t});\n\t$demo2.change(function(){\n\tdemo2_value = $(this).val();\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n\t\t\nvar curverOperation1 = {\n curverSeries: []\n , curverCategories: []\n , colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4', '#DDDF00', '#FF9655']\n , colorIndex: -1\n , LoadAllCurverZTree: function () {\n var self = this;\n var executeParam = { SPName: 'Pricing.usp_GetPricingAllCurve_Historical', SQLParams: [] };\n executeParam.SQLParams.push({ Name: 'BondType', Value: demo1_value, DBType: 'string' },{Name:'BondTerm',Value:demo2_value,DBType:'string'});\n\t\tvar serviceUrl = GlobalVariable.QuickWizardServiceUrl + 'CommonGetWithConnName?connName=QuantDB_FixedIncome&exeParams=' + encodeURIComponent(JSON.stringify(executeParam));\n CallWCFSvc(serviceUrl, true, 'GET', function (zNodes) {\n $.each(zNodes, function (i, v) {\n\t\t\t\t\tif (v.xDatas) {\n\t\t\t\t\t\tself.curverCategories = v.xDatas.split(',');\n\t\t\t\t\t\t\n\t\t\t\t\t\tself.colorIndex = (self.colorIndex == 10) ? 0 : self.colorIndex + 1;\n\t\t\t\t\t\t var aryData = v.yDatas.split(',');\n\t\t\t\t\t\t aryData = $.map(aryData, function (item, index) { return parseFloat(item); }); \n\t\t\t\t\t\t self.curverSeries.push({ name: v.name, data: aryData, color: self.colors[self.colorIndex] });\n\t\t\t\t\t\t \n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n });\n\t\t\t\n \n $('#divAllCurverChartHistory').highcharts({\n title: { text: '收益率历史趋势' },\n subtitle: { text: 'Historical Yield Curvers for Pricing' },\n xAxis: { categories: self.curverCategories },\n yAxis: {\n title: { text: '年化收益率' },\n plotLines: [{ value: 0, width: 1, color: '#808080' }]\n },\n tooltip: { valueSuffix: '%' },\n legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', width: 150, borderWidth: 0 },\n series: self.curverSeries\n });\n });\n }\n\t \n};\n\t\tvar co = curverOperation1;\n\t\tco.LoadAllCurverZTree();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t})\n}", "title": "" }, { "docid": "2e315cf960aad2bcb07ff5c07dbecd4d", "score": "0.5739091", "text": "function getAirports(){\r\n\tconst airportDiv = document.getElementById(\"airportDiv\");\r\n\tconst departureDiv = document.getElementById(\"departureAirportOptions\");\r\n\tconst arrivalDiv = document.getElementById(\"arrivalAirportOptions\");\r\n\t\r\n\tvar flighDate = document.getElementById(\"flightDate\").value;\r\n\t\r\n\tvar departureList = [\"Any\", \"New York\"];\r\n\tvar arrivalList = [\"Any\", \"Glasgow\"];\r\n\tvar departureOptions = \"\";\r\n\tvar arrivalOptions = \"\";\r\n\t\r\n\tairportDiv.style.display = \"block\"; // Shows the airport selection dropdown menus\r\n\t\r\n\t//Loads data into dropdown menus\r\n\tvar i;\r\n\tfor (i = 0; i < departureList.length; i++) {\r\n\t\tdepartureOptions += \"<option>\"+departureList[i]+\"</option>\";\r\n\t};\r\n\tfor (i = 0; i < arrivalList.length; i++) {\r\n\t\tarrivalOptions += \"<option>\"+arrivalList[i]+\"</option>\";\r\n\t};\r\n\t\r\n\tdepartureDiv.innerHTML = departureOptions;\r\n\tarrivalDiv.innerHTML = arrivalOptions;\r\n\t\r\n}", "title": "" }, { "docid": "c90b467709127ce0c209447f7e18f336", "score": "0.5738962", "text": "function fillField(response)\n{\n\t\t\trows = response.data; \n\t\t\tif (document.getElementsByClassName)\n\t\t\t\tfields = document.getElementsByClassName(rows[0]);\n\t\t\telse\n\t\t\t\tfields\t = document.getElementsByTagName(\"select\");\n\t\t\t//if (response.xmlhttp.responseText.length < 400) resultPane.innerHTML += response.xmlhttp.responseText; //debugging\n\t\t\tinfo(rows[1]); //debug first value \n\n\t\t\tfor (j=0; j < fields.length; j++)\n\t\t\t{\n\t\t\tfield = fields[j];\n\t\t\tif (!field.options) continue; //not a dropdownlist\n\t\t\tif (field.className.indexOf(rows[0]) == -1) continue; //not correct dropdownlist\n\t\t\tselectedIndex = field.selectedIndex;\n\t\t\tfield.options.length = 0; //clean out old values\n\n\t\t\tfor (y=1;y < rows.length; y++)\n\t\t\t{\n\t\t\t values = rows[y].split(\"===\");\n\t\t\t if (values[1] != undefined)\n\t\t\t field.options[field.options.length] = new Option(values[1],values[0]);\n\t\t\t}\n\t\t\tif (selectedIndex < field.options.length);\n\t\t\t\tfield.selectedIndex = selectedIndex;\n\t\t\t}\n}", "title": "" }, { "docid": "5d0fb742f4777a478ee12cc4cf3ef183", "score": "0.5737117", "text": "function LoadChecktypeOpeningBalance() {\n\n var pageUrl = '/Webservice/svr_Customer.asmx';\n\n\n $.ajax({\n type: \"POST\",\n url: pageUrl + \"/SelectCheckType\",\n data: \"{ }\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n crossdomain: true,\n success: function (response) {\n\n $('#check_type').empty();\n var data = eval(response.d);\n var obj = \"\";\n for (var i = 0; i < data.length; i++) {\n\n $('#check_type').append(\"<option value='\" + data[i][\"ID\"] + \"'>\" + data[i][\"CheckType\"] + \"</option>\");\n\n }\n\n\n },\n error: function (response) {\n alert(response.status);\n }\n });\n}", "title": "" }, { "docid": "42f7785f7c39ded7d29efada1b5fe16b", "score": "0.5727434", "text": "function init() {\n \n var dropdownMenu = d3.select(\"#selDataset\");\n //Call the json\n d3.json(\"data/samples.json\").then((dropitem) => {\n dropitem.names.forEach((id) => {\n dropdownMenu.append('option').text(id).property(\"value\");\n\n });\n })\n\n \n\n}", "title": "" }, { "docid": "98eca9b6e9819df717bcd29abda483f0", "score": "0.5723812", "text": "function populateTypesSelect(rows, status, xhr) {\n for (let i = 0; i < rows.length; i++) {\n $(`<option id=\"${rows[i].catid}\" name=\"${rows[i].catid}\" style=\"display:visible\" data-catid='${rows[i].catid}' value='${rows[i].ptypename}'>${rows[i].ptypename}</option>`).appendTo('#PropertyType');\n }// end for\n}// end populateType", "title": "" }, { "docid": "28b6d603a913deaa7136c0b5ac454bc5", "score": "0.571107", "text": "function myFunction(arr) {\n var out = \"\";\n var i;\n for(i = 0; i < arr.length; i++) {\n out += '<option id =' + arr[i]+'>' + arr[i] + '</option>';\n }\n document.getElementById(\"selDataset\").innerHTML = out;\n first_charts = document.getElementById(\"BB_940\").textContent;\n build_charts(first_charts);\n}", "title": "" }, { "docid": "98ce19830650fb73daabe15395749619", "score": "0.5703178", "text": "function load_stations (line)\n{\n\tconsole.log('Showing stations on ' + tr_line(line));\n\t\n\tvar stations_list = new UI.Menu({ sections: [{ title: tr_line(line) + ' Line', items: [{ title: 'Loading...'}] }] });\n\tstations_list.show();\n\t\n\tnew Ajax({\n\t\turl: wmata_stations_url + '?LineCode=' + line + '&api_key=' + wmata_api_key,\n\t\ttype: 'json'\n\t}, function (data) {\n\t\tif (data.Stations.length > 0)\n\t\t{\n\t\t\tfor (var s in data.Stations)\n\t\t\t{\n\t\t\t\tconsole.log(s + '\\t' + data.Stations[s].Name);\n\t\t\t\tstations_list.item(0, s, { title: data.Stations[s].Name });\n\t\t\t}\n\t\t\tstations_list.on('select', function (e) {\n\t\t\t\tload_trains(data.Stations[e.itemIndex]);\n\t\t\t});\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar card = new UI.Card({\n\t\t\t\ttitle: tr_line(line) + ' Line',\n\t\t\t\tbody: 'No stations are on this line.',\n\t\t\t\tscrollable: true\n\t\t\t});\n\t\t\tstations_list.hide();\n\t\t\tcard.show();\n\t\t}\n\t}, function (error) {\n\t\tvar card = new UI.Card({\n\t\t\ttitle: 'Error',\n\t\t\tbody: error,\n\t\t\tscrollable: true\n\t\t});\n\t\tconsole.log('Error getting stations: ' + error);\n\t\tstations_list.hide();\n\t\tcard.show();\n\t});\n}", "title": "" }, { "docid": "674166435561295ef79088e28bb12571", "score": "0.5701327", "text": "createListClientStatus() {\n\n var objSelect = document.getElementById(this.id);\n let objOption = ' <option disabled selected value> -- Seleccione una opción -- </option> ';\n \n \n for (let i = 0; i < this.jSon.length; i++) {\n \n objOption += '<option value=' + this.jSon[i].Stat_id + '>' + this.jSon[i].Stat_name + '</option>';\n }\n \n objSelect.innerHTML = objOption;\n }", "title": "" }, { "docid": "68f3121aece8d3eeac970b2dd62aaeda", "score": "0.56996787", "text": "function GetKlant(){\n var xhttp = new XMLHttpRequest();\n var trainees = document.getElementById(\"selectedTrainee\");\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var arr = new Array;\n var klantTrainees = JSON.parse(this.responseText); \n console.log(klantTrainees);\n for(var i =0; i<klantTrainees.trainee.length; i++){\n console.log(klantTrainees.trainee[i]);\n var p = klantTrainees.trainee[i].voornaam + \" \" + klantTrainees.trainee[i].achternaam;\n arr.push(klantTrainees.trainee[i]);\n \n }\n for(var i = 0; i<arr.length; i++){\n var option = document.createElement(\"OPTION\"),\n txt = document.createTextNode(arr[i].voornaam + \" \" + arr[i].achternaam); \n option.appendChild(txt);\n option.id = \"option\"+ arr[i].id;\n trainees.insertBefore(option,trainees.lastChild);\n }\n }\n };\n xhttp.open(\"GET\", apiKlant, true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.send(); \n}", "title": "" }, { "docid": "c755dea05bec97e40b8358f5bfdbd0e0", "score": "0.56975734", "text": "function init() {\n\n var dropdown = d3.select(\"#selDataset\");\n \n \n\n\n d3.json(\"samples.json\").then((data) => {\n \n console.log(data)\n\n\n\n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n\n // Calling the Function to Display Selected Data\n\n getdemoinfo(data.names[0]);\n getPlot(data.names[0]);\n dropdown.on(\"change\",function(){console.log(this);getPlot(dropdown.node().value);getdemoinfo(dropdown.node().value)});\n });\n }", "title": "" }, { "docid": "7240e62059cc2300bc09b74d7b5c7221", "score": "0.5696958", "text": "createListClient() {\n var objSelect = document.getElementById(this.id);\n let objOption = ' <option disabled selected value> -- Seleccione una opción -- </option> ';\n for (let i = 0; i < this.jSon.length; i++) {\n objOption += '<option value=' + this.jSon[i].Client_id + '>' + this.jSon[i].Client_name + '</option>';\n }\n objSelect.innerHTML = objOption;\n }", "title": "" }, { "docid": "3fcf53ab29ce7e36178ed92e4b778a57", "score": "0.56937164", "text": "function init() {\n var dropDownMenu = d3.select('#selDataset');\n\n d3.json('data/samples.json').then(function (data) {\n var data = data;\n var names = data.names;\n\n for (var name of names) {\n dropDownMenu.append('option').attr('value', name).text(name);\n }\n });\n\n // Now render Charts\n optionChanged();\n}", "title": "" }, { "docid": "9aa6776a8f364ed1822dda74a99d408e", "score": "0.56931096", "text": "function updateHostSelect(){\n\n hosts_select = makeSelectOptions(dataTable_hosts,1,2,7,\"DISABLED\");\n\n}", "title": "" }, { "docid": "31b5478374667780d79ba0d725e614fd", "score": "0.56914383", "text": "function fillLineasPedido() {\n $scope.dataloading = true;\n //apiService.get('');\n if ($scope.WorkPedido.IdPedido != null) {\n $scope.dataLoading = true;\n apiService.get('/api/lineaPedido/GetLineasByIdPedido/' + $scope.WorkPedido.IdPedido, null, getAllLineasCompleted, apiServiceFailed);\n }\n }", "title": "" }, { "docid": "b3f8d1e6a9061b084fd7d736a8e07c63", "score": "0.56884587", "text": "function populateDropDown() {\n let vehicleNames = Object.keys(vehiclesJSON);\n vehicleNames.forEach(name => {vehicleDropDown.options.add(new Option(name));});\n}", "title": "" }, { "docid": "3b967aa71c756a4f48e0c0c8ec8a871f", "score": "0.56870013", "text": "function FillDataMultipleSelectLineNoMdl(idDropdownlist, arrDataSource, valueField, textFiled) {\n $('#' + idDropdownlist).multiselect('destroy');\n $('#' + idDropdownlist).empty();\n var option = '';\n for (var i = 0; i < arrDataSource.length; i++) {\n option += '<option value=\"' + arrDataSource[i][valueField] + '\">' + arrDataSource[i][textFiled] + '</option>';\n }\n $('#' + idDropdownlist).append(option);\n\n //Format dropdownlist to selection\n MultipleSelectLineNoMdl(idDropdownlist);\n}", "title": "" }, { "docid": "292094dad835a2d000e4c5f8f6b6e158", "score": "0.5674889", "text": "function print_country(country_arrr) {\n var defcountryarr1 = country_arrr.mofluid_countries;\n var defcountry = country_arrr.mofluid_default_country.country_id;\n var option_str = document.getElementById(\"Scountry\");\n var i = 1,\n indexj = 0;\n option_str.options[0] = new Option(\"Select\", \"Select\");\n\n $.each(defcountryarr1, function() {\n option_str.options[i++] = new Option(defcountryarr1[indexj].country_name, defcountryarr1[indexj].country_id);\n console.log(defcountryarr1[indexj].country_name);\n indexj++;\n });\n\n\n\n $(\"#Scountry\").val(defcountry);\n $(\"#Scountry\").trigger(\"create\");\n}", "title": "" }, { "docid": "97d4a145cc709190119ef23e400137fd", "score": "0.56711334", "text": "function plotVehicles(selectedLine) {\n routeName = JSON.parse(selectedLine).name;\n\n // Get the vehicle position data from the server\n $.getJSON(\"https://data.foli.fi/siri/vm/\", function(vmData) {\n // Check that the system returned a valid response before cntinuing\n if(vmData.status !== \"OK\") {\n alert(\"The realtime vehicle monitoring system is currently unavailable.\");\n return;\n }\n\n let vehicleData = vmData.result.vehicles;\n // Remove any earlier markers\n clearMarkers();\n\n // If there is a bus line plotted that is not the currently selected line, removit\n if (plottedLine !== selectedLine) clearRoute();\n\n // Parse the vehicle data for the ones that belong to the selected line and set their markers on the map\n Object.getOwnPropertyNames(vehicleData).forEach(itemName => {\n let item = vehicleData[itemName];\n if (item.publishedlinename === routeName) {\n let newPoint = new google.maps.LatLng(item.latitude, item.longitude);\n setMarker(newPoint, item.publishedlinename);\n }\n });\n });\n // Memorize in a global variable which line the plotted buses are from, and set the dropdown to the selected line\n // (the dropdown can be in the \"wrong\" position eg. when the user clicks the refresh-button)\n plottedVehicles = selectedLine;\n $(\"#route_number\").val(selectedLine);\n}", "title": "" }, { "docid": "49c543e4b50ad757b636803e3dbfc21e", "score": "0.5670423", "text": "function initialStuff() {\n var dropdown = d3.select(\"#selDataset\");\n // Generate the sample list to populate the select options\n d3.json(\"samples.json\").then((data) => {\n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n drawCharts(data.names[0]);\n tsInfo(parseInt(data.names[0]));\n });\n}", "title": "" }, { "docid": "f271a238abf26a971f91b79f37d0bb88", "score": "0.5666965", "text": "function populateDropdown(values) {\n // select the dropdown\n var dropDown = d3.select(\"#selDataset\");\n\n // populate the options for the select list\n var options = dropDown\n .selectAll(\"option\")\n .data(values)\n .enter()\n .append(\"option\")\n .text((d) => d)\n .attr(\"value\", (d) => d);\n\n // create the listener on change\n dropDown.on(\"change\", updateDashboard);\n}", "title": "" }, { "docid": "8352d3707cadd1068427c7abf9a3d260", "score": "0.5661752", "text": "function updateLineupDropdownOptions(teamDropdownId, lineupDropdownId) {\n var teamId = d3.select(`#${teamDropdownId}`).node().value;\n d3.json(`../nba/lineup_names_id?teamId=${teamId}`, function(error, data) {\n var lineupDropdown = document.getElementById(lineupDropdownId);\n lineupDropdown.innerHTML = \"\";\n for (var i = 0; i < data.length; i++) {\n var newOption = document.createElement(\"option\");\n newOption.value = data[i][\"groupId\"];\n newOption.text = data[i][\"groupName\"];\n lineupDropdown.appendChild(newOption);\n }\n updateBarGraphsShotChart();\n if (teamDropdownId == \"team1-dropdown\") {\n updateShotChart(1);\n } else {\n updateShotChart(2);\n }\n });\n}", "title": "" }, { "docid": "7dbdf8e19ad4381dab77864f5ca9a017", "score": "0.56606674", "text": "function draw_date(draw_me){ \n//detect parent\n// console.log(\"-------------\");\n// console.log(draw_me); \nvar vizz_bar = document.getElementById(\"vizz_bar\");\n//Creating node to be made\n var new_drop = document.createElement('select');\n //DESIGN\n new_drop.setAttribute(\"class\",\"form-control\");\n //FIRST SELECT\n new_text = document.createTextNode(\"select\");\n var opt = document.createElement(\"option\");\n opt.text = \"select\";\n opt.value = \"0\";\n new_drop.options.add(opt);\n\n //ADDING FUNCTION ON CHANGE\n id = \"find_me\"\n new_drop.setAttribute(\"id\",id);\n new_drop.setAttribute(\"onchange\",\"setDate();\");\n\n//Append to parent after sibling\npar = vizz_bar.parentNode;\npar.insertBefore(new_drop, vizz_bar); // here we take the reference get parent and add it beside reference after\n\n\n//get keys\nd3.csv(draw_me,function(data){\n Keys = Object.keys(d3.values(data));\n key_len = Keys.length -1; //(remember header)\n v = d3.values(data[2])\n \n\n //generate dropdown\n //add options\n for(i=0;i<key_len;i++){\n v = d3.values(data[i])\n \n var opt = document.createElement(\"option\");\n opt.text = v[2];\n opt.value = v[2];\n new_drop.options.add(opt);\n }\n})\n}", "title": "" }, { "docid": "c7ff792adc4fa292f480c0105b64a4b5", "score": "0.56561184", "text": "function loadYears() {\n\t\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : \"/SydneyTrainService/loadYears\",\n\t\tdataType : \"json\",\n\t\tsuccess : function(data) {\n\n\t\t\t$('#yearsDD').empty();\n\t\t\t$('<option value=\"\">-- Select Year --</option>').appendTo(\n\t\t\t'#yearsDD');\n\t\t\t$.each(data.Years, function(i, obj) {\n\n\t\t\t\tvar div_data = \"<option value=\" + obj.id + \">\" + obj.value\n\t\t\t\t\t\t+ \"</option>\";\n\t\t\t\tconsole.log(div_data);\n\t\t\t\t$(div_data).appendTo('#yearsDD');\n\t\t\t});\n\n\t\t},\n\t\terror : function(e) {\n\t\t\tconsole.log(\"ERROR: \", e);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "53caa75fcac528db9a0740d42f0912ba", "score": "0.56416386", "text": "function dataRenderValue() {\n if (localStorage.getItem(\"dropDownData\") == null || localStorage.getItem(\"dropDownData\") == undefined) {\n\n var Blankk = [];\n localStorage.setItem(\"dropDownData\", JSON.stringify(Blankk));\n }\n var LocalstoredValue = JSON.parse(localStorage.getItem(\"dropDownData\"));\n\n LocalstoredValue.forEach((element, index) => {\n var x = JSON.parse(element).drop;\n var dropDownValue = document.getElementById(\"Select-Job\");\n var option = document.createElement(\"OPTION\");\n option.innerHTML = x;\n dropDownValue.add(option);\n\n });\n}", "title": "" }, { "docid": "c8b135be974aa7ff217fda0053be0455", "score": "0.5638778", "text": "function inite() {\n\n var htmlSpecialty = '';\n for (var i = 0; i < studyDomain.length; i++) {\n htmlSpecialty+='<option value=\"'+studyDomain[i].specialty+'\">'+studyDomain[i].specialty+'</option>';\n }\n $('#specialty').html(htmlSpecialty);\n $('#specialty').val('Computer Engineering');\n SelectSectors(\"Computer Engineering\");\n // call RefreshTable \n RefreshTable();\n}", "title": "" }, { "docid": "5d2f44e3d1158ec08a69834cda521774", "score": "0.5629876", "text": "function loadDropDownFactory(){\n\t\t /** ajax call method list from factorycontroller\n\t\t * **/\n\t \t$.ajax({\n\t \t\t\n\t \t\tdataType: \"json\",\n\t\t\t\ttype: 'GET',\n\t\t\t\tdata:{},\n\t\t\t\tcontentType: \"application/json\",\n\t\t\t\turl: \"/Chori/factory/list\",\n\t\t\t\tsuccess: function(data){\n\t\t\t\t\tif(data.status == \"ok\"){\n\t\t\t\t\t\t$.each( data.list, function( key, value ) {\n\t $('#txtFactory').append($('<option>', {\n\t value: value.factorycode,\n\t text: value.shortname\n\t }));\n\t \n\t \n\t });\n\t\t\t\t\t}else{\n\t\t\t\t\t\talert('This alert should never show!');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function(){\n\t\t\t\t\talert('error (173)');\n\t\t\t\t}\n\t \t});\n\t }", "title": "" }, { "docid": "48b596b144130122c223f6599d146a6d", "score": "0.5625135", "text": "function Atualizar_bandas() {\n var pagina = new XMLHttpRequest();\n pagina.onreadystatechange = function() {\n if (pagina.readyState === 4) {\n\n var dado = JSON.parse(pagina.responseText);\n var auxselect = '<option selected value=\"0\">Selecione uma banda da lista</option>';\n\n //Atualizando lista de Bandas\n for (var i = 0; i < dado.length; i++) {\n auxselect += `<option value=\"` + dado[i].id_banda + `\">` + dado[i].nome_banda + `</option>`;\n }\n document.getElementById('SelectBanda').innerHTML = auxselect;\n }\n }\n pagina.open('GET', 'service.php?acao=listar_bandas');\n pagina.send();\n}", "title": "" }, { "docid": "86d989161a86144a48257be7859d48ae", "score": "0.56205934", "text": "function put_stores(dt) {\n /* $.each(dt, function (v, u) {\n let H = `<option value=\"${u.str_id}\">${u.str_name}</option>`;\n $('#txtStoreSource').append(H);\n });\n $('#txtStoreSource').on('change', function () {\n validator();\n }); */\n }", "title": "" }, { "docid": "2955f165baead2a05786e530336fd430", "score": "0.5619769", "text": "function init(){\r\n var tipos = [];\r\n var ciudades = [];\r\n $.get('data-1.json', function(data){\r\n for(i = 0; i < data.length; i++){\r\n if(tipos.indexOf(data[i].Tipo) === -1) tipos.push(data[i].Tipo);\r\n if(ciudades.indexOf(data[i].Ciudad) === -1) ciudades.push(data[i].Ciudad);\r\n }\r\n for(x = 0; x < ciudades.length; x++){\r\n $('#selectCiudad').append('<option value=\"'+ciudades[x]+'\">'+ciudades[x]+'</option>');\r\n }\r\n for(j = 0; j < tipos.length; j++){\r\n $('#selectTipo').append('<option value=\"'+tipos[j]+'\">'+tipos[j]+'</option>');\r\n }\r\n $('select').material_select();\r\n });\r\n}", "title": "" }, { "docid": "0c88d121a8279652b91b87c435f347b5", "score": "0.56163543", "text": "function addDataList(){\n var options = '';\n for(option of all_courses){\n options += '<option value=\"' + option + '\" />';\n }\n document.getElementById(\"code-picker\").innerHTML = options;\n }", "title": "" }, { "docid": "1deb4a4ca4f7296d38b6f67d368605cf", "score": "0.5610561", "text": "function initDropList() {\n\n // initiaize an empty array list for each filter criteria\n date = [];\n city = [];\n state = [];\n country = [];\n shape = [];\n\n // loop through each tableData content appending its corresponding object values per filter criteria to its array list\n for (var i = 0; i < tableData.length; i++) {\n date.push(Object.values(tableData[i])[0]);\n city.push(Object.values(tableData[i])[1]);\n state.push(Object.values(tableData[i])[2]);\n country.push(Object.values(tableData[i])[3]);\n shape.push(Object.values(tableData[i])[4]);\n }\n\n // call function to populate the form dropdown menu options for each filter criteria in alphabetical order\n createDropList(date, \"Date\", \"datetime\", 1);\n createDropList(city, \"city\", \"cityname\", 2);\n createDropList(state, \"state\", \"stateAbr\", 3);\n createDropList(country, \"country\", \"countryAbr\", 3);\n createDropList(shape, \"shape\", \"shapename\", 2);\n\n}", "title": "" }, { "docid": "fb607a5716c2ff46fe4829c427e3402e", "score": "0.56073827", "text": "function loadStates(){\n\tconsole.log('Populating list.....');\n\n\tvar coachBoards = eval(RaakStorage.getItem('savedCoachboards'));\n\tvar select = document.getElementById(\"spel\");\n\tfor (var i = coachBoards.length - 1; i >= 0; i--) {\n\t\tselect.options[select.options.length] = new Option(coachBoards[i].name, i);\n\t};\t\n}", "title": "" }, { "docid": "4de9899b7faac5fb586f672d4aacc96a", "score": "0.5606498", "text": "function cityList(){\r\n\t\tvar cities = this.responseText.split(\"\\n\");\r\n\t\tfor (var i = 0; i < cities.length; i++){\r\n\t\t\tvar opt = document.createElement(\"option\");\r\n\t\t\topt.innerHTML = cities[i];\r\n\t\t\tdocument.getElementById(\"cities\").appendChild(opt);\r\n\t\t}\r\n\t\tdocument.getElementById(\"citiesinput\").disabled = \"\";\r\n\t\tdocument.getElementById(\"loadingnames\").style.display = \"none\";\r\n\t}", "title": "" }, { "docid": "70881f9d684c6969bb6a697243dffb81", "score": "0.5604149", "text": "function populateActivityListBox(supplierId) {\r\n\r\n\t$.ajax({ \r\n\t\tasync: false,\r\n\t type: 'GET', \r\n\t url: 'http://localhost:8080/resamania/activities?supplierId=' + supplierId, \r\n\t data: '', \r\n\t dataType:'json',\r\n\t success: function (data) { \r\n\r\n var items = [];\r\n for (var i=0; i <= data.length - 1; i++) {\r\n \t\titems += '<option value=\\\"' + data[i].id + '\\\">' + data[i].name + '</option>';\r\n \t}\r\n \t$( \"#activity\" ).append(items);\r\n\t }\r\n\t});\r\n}", "title": "" }, { "docid": "3e36d8b4ee1ad979e821d87351a4bd0e", "score": "0.56037426", "text": "function setLineNumbers() {\n // Find the number of program lines\n let numLines = $(\"#program tbody tr\").length;\n\n // For every linenum list item in the program\n $(\".linenum\").each(function () {\n let cur = $(this).attr('data');\n \n // Clear out all existing line numbers in the list\n $(this).empty();\n \n // Add new linenumbers into the list\n for (let i = 0; i <= numLines; i++) {\n let option = $('<option>');\n \n if (i === 0) {\n option.val(\"x\")\n .text(\"Line #\")\n .css(\"display\", \"none\");\n }\n else {\n option.val(\"\" + i)\n .text(\"\" + i);\n }\n \n if (option.val() === cur) {\n option.attr(\"selected\", \"true\");\n }\n \n $(this).append(option);\n }\n });\n\n // For every linenumber cell in the program\n $(\"tbody .linenumcell\").each(function () {\n // Set the linenumber of the line\n $(this).html($(this).parents(\"tbody\").find(\"tr\").index($(this).parent(\"tr\")) + 1);\n });\n}", "title": "" }, { "docid": "176fac3d6e89c90ab8bc33b71280b808", "score": "0.559742", "text": "function selectClient() {\n //if product_id is not set, then don't get product list since this report doesn't use it\n if( typeof ReportController.criteria.product_id == 'undefined' ) { return; }\n\n //pre-fill the drop down with all products\n ReportController.SearchSelectProduct.searchTerm = '';\n ReportController.SearchSelectProduct.getData(true);\n }", "title": "" }, { "docid": "788fcfd47af3f9294d1ca09cf4c04ba9", "score": "0.55864567", "text": "function getaca(){\r\n\t\tvar value = getSelect()\r\n\t$.ajax({\r\n\t\t\ttype: 'Get',\r\n\t\t\turl: \"rest/graph/resources?selector=ayname&cname=\" + value[0] + \"&ayname=\" + value[1] + \"&fname=\" + value[2] + \"&sname=\" + value[3] + \"&mname=\" + value[4] + \"&lname=\" + value[5] + \"&pname=\" + value[6],\r\n\t\t\tsuccess: function(data, textStatus, jqXHR){\r\n\t\t\t\tvar obj = JSON.parse(data);\r\n\t\t\t\t$(`#aca-select option`).not(\":first\").remove()\r\n\t\t\tfor (var i = 0; i < obj.length; i++){\r\n\t\t\t\ta = new String(obj[i].ayname);\r\n\t\t\t\t$(\"#aca-select\").append('<option value=\"'+ a +'\">'+ a +'</option>')\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t})\r\n}", "title": "" }, { "docid": "a7e95a48b54c05a40e294cbfe6f7996e", "score": "0.5586283", "text": "function departmentelements() {\n $(\"#region_id\").change(function() {\n var str = $(\"#region_id\").val();\n $('#department_id').empty();\n $('#municipality_id').empty();\n $('#branch_id').empty();\n $.ajax({\n url: location.origin + '/dropdown-departments/' + str,\n type: 'GET',\n success: function(response) {\n var tittle = $(\n '<option>' + \"Seleccione una linea\" + '</option>'\n );\n $(\"#department_id\").append(tittle);\n $.each(response, function(i, departments) {\n var department = $(\n '<option value=\"' + departments.id + '\">' + departments.name + '</option>'\n );\n $(\"#department_id\").append(department);\n });\n }\n });\n })\n}", "title": "" }, { "docid": "60e61cbd72c220922f2152a9b167ad3d", "score": "0.55842555", "text": "function init() {\r\n covid_data.then(data =>{\r\n countries = Object.keys(data)\r\n\r\n var selector = d3.select(\"#select_country\")\r\n .append(\"select\")\r\n .attr(\"id\", \"country_select\")\r\n .selectAll(\"option\")\r\n .data(countries)\r\n .enter().append(\"option\")\r\n .text(function(d) { return d; })\r\n .attr(\"value\", function (d) {\r\n return d;\r\n });\r\n\r\n plot_data = get_plot_data(data.Afghanistan);\r\n traces = create_traces(plot_data)\r\n var layout = {\r\n yaxis: {\r\n type: 'linear',\r\n autorange: true\r\n }\r\n };\r\n \r\n Plotly.newPlot(\"plot\", traces, layout);\r\n })\r\n}", "title": "" }, { "docid": "3d34344caea4d0dde8e49eed1e19dff9", "score": "0.55817395", "text": "function handleDataDr(data) {\r\n var obj = JSON.parse(data.result);\r\n var drlist = obj.dr_list;\r\n\r\n var selectElmDr = $(\".dr\");\r\n selectElmDr\r\n .empty()\r\n .append(\r\n \"<option disabled='disabled' SELECTED>Lütfen Doktor Seçiniz</option>\"\r\n );\r\n $.each(drlist, function(i, val) {\r\n // console.log(val.dr_kodu);\r\n $(\"<option/>\", {\r\n value: val.dr_kodu,\r\n text: val.dr_adi\r\n }).appendTo(selectElmDr);\r\n });\r\n}", "title": "" }, { "docid": "761589e3bbcce3eee1a617bb0cdb603d", "score": "0.5575268", "text": "function FillNextDropDown(DataField,DropDownId2,HiddenId1,HiddenId2)\n {\n var FinalData;\n var data;\n var subdata;\n var ddl1Status=false; \n //clear dropdowndata \n ClearDropdownData(DropDownId2);\n document.getElementById(\"ctl00_cphPageContents_hdnCOA\").value=\"\";\n //Setting COA value\n GetCOAValue(DataField,HiddenId1);\n //Assigning COA value\n var COA=document.getElementById(\"ctl00_cphPageContents_hdnCOA\").value; \n if(COA !=\"\")\n {\n FinalData=document.getElementById(HiddenId2).value;\n FinalData=FinalData.split(\";\")\n for(i = 0; i < FinalData.length; i++)\n {\n data=FinalData[i];\n data=data.split(\",\");\n if(data.length >0)\n {\n if(data[2]!=null)\n {\n //Get COA Value\n subdata=data[2].split(\"=\");\n //COA value is equavalent to selected Source\n if(subdata[1] == COA)\n {\n ddl1Status=true; \n var opt = document.createElement(\"option\");\n // Add an Option object to Drop Down/List Box\n document.getElementById(DropDownId2).options.add(opt);\n // Assign text and value to Option object\n subdata=data[1].split(\"=\");\n opt.text = subdata[1];\n subdata=data[0].split(\"=\");\n opt.value = subdata[1];\n document.getElementById(DropDownId2).disabled=false;\n }\n }\n }\n if(ddl1Status==false)\n {\n document.getElementById(DropDownId2).disabled=true;\n }\n }\n }\n }", "title": "" }, { "docid": "e5add986bcb7b34caa605894aba22a4f", "score": "0.5568699", "text": "function getCountries()\n{\n $.get(\"http://54.254.174.74:8080/api/v1/countries\",function(data){\n // console.log(data);\n countryData = data;\n var x = document.getElementById(\"countrycode\");\n for(var i=0 ;i<count_countries;i++){\n var option = document.createElement(\"option\");\n option.text = countryData['data'][i]['countryName'];\n x.add(option);\n }\n });\n}", "title": "" }, { "docid": "3641ebb328e9c5ef0b574f5bb9508c02", "score": "0.5567824", "text": "function optionLoad(myData) {\r\n for (let i = 0; i < myData.length; i++) {\r\n\tvar option = document.createElement('option');\r\n\toption.value = myData[i].Title;\r\n\toption.text = myData[i].Title;\r\n\tdropdown.add(option);\r\n }\r\n}", "title": "" }, { "docid": "9aff20e9c222220502bd1aff7e44fb3e", "score": "0.55672824", "text": "function dropdownLoads(type) {\n var select;\n var allArrays = [maskOption, subnetBitsOption, maskBitsOption, hostPer, maxSubnetsOption];\n for (var i = 0; i < 5; i++) {\n select = selectIf(i); //get the selction type\n var x = jValue(type, i); //load from type the index x to y\n for (var j = x[0]; j < x[1]; j++) { // add in the selection tag the options\n option[j] = document.createElement('option');\n option[j].value = j;\n option[j].innerHTML = allArrays[i][j];\n select.appendChild(option[j]);\n }\n }\n}", "title": "" }, { "docid": "f40594f26a58d29d65bce47c321f4c6a", "score": "0.5565793", "text": "function SamplesList() {\n // Refer to option list on index.html\n var selDataset = document.getElementById('selDataset');\n // Refer to names route and populate option list\n Plotly.d3.json(\"/names\", function(error, samples) {\n if (error) return console.warn(error);\n for (var i = 0; i < samples.length; i++) {\n var currentOption = document.createElement('option');\n currentOption.text = samples[i];\n currentOption.value = samples[i]\n selDataset.appendChild(currentOption);\n }\n })\n}", "title": "" }, { "docid": "c90e6a995a32e6b844a1f6397b9fa929", "score": "0.5561945", "text": "function loadEnteredVehicles() {\n axios.get('/entered').then((res) => {\n let x = res.data;\n x.map((i) => {\n $('#exitSelect')\n .append(`<option value=${i.numberplate}>${i.numberplate}</option>`)\n })\n })\n}", "title": "" }, { "docid": "5bb75f3864aa16fa507fffd45cd3b6f6", "score": "0.55612856", "text": "function initializeSelect(){\n\n\tloadJSON(function(response) {\n \t\t// Parse JSON string into object\n \t\tvar select =''; \n \t\t//select += \"<select class='form-control' id='to-currencies'>\";\n \tfor(var key in response){\n \t\tselected = '';\n \t\tif (key==\"USD\"){\n \t\t\tselected = 'selected';\n \t\t}\n\n \t\tselect += \"<option value='\"+key+\"' \"+selected+\">\"+response[key]+\" (\"+key+\") </option>\";\n \t}\n \t//console.log(select);\n \t$('#to-currencies').html(select);\n \t});\n}", "title": "" }, { "docid": "3dbd4cd5b1cdac454bdfadc7a398a2a4", "score": "0.5558329", "text": "function fetchLineData() {\n callAjaxMethod({\n url: \"https://copypip.free.beeceptor.com/portfolio-line-data\",\n successCallback: (data) => {\n STATE.setLineChartData(data.data);\n plotLineChart()\n }\n });\n }", "title": "" }, { "docid": "4788ff3353f93552243f9dae474b6155", "score": "0.5556234", "text": "function setOptions() {\n\n // Fetch data\n d3.json(\"samples.json\").then(data => {\n\n // Append each persons' id name\n data.names.forEach(name => {\n var option = dropdownMenu.append(\"option\")\n .attr(\"value\", name).text(name);\n });\n });\n}", "title": "" }, { "docid": "72d09b45879bac69a6fce313e2e66c31", "score": "0.5554036", "text": "function scatterOnClick(obj)\n{\n\t\n\tvar legislators = scatterList[obj.id].legislators;\n\tnavBackStack = [];\n\tclearBreadcrumbItems();\n\tnavBackStack.push(\"LegSel\", legislators);\n\tvar legSelPanel = \"<br><br><label>Legislators On that Point: </label><SELECT NAME=\\\"LegSelect2\\\" id=\\\"right_selectLeg\\\"onchange=\\\"right_selectLeg() \\\" SIZE=\\\"10\\\" width=\\\"300px\\\" style=\\\"width: 300px\\\">\"; \n\tfor(var i = 0; i < legislators.length; i++)\n\t{\n\t\tvar leg= legislatorData[legislators[i]];\n\t\tlegSelPanel += \"<OPTION> \" + leg.firstname + \" \" + leg.lastname ;\n\t}\n\tlegSelPanel += \"</SELECT>\";\n\tdocument.getElementById(\"details\").innerHTML = legSelPanel;\n}", "title": "" }, { "docid": "3faf7ca911df13426a7717d8f25e4f03", "score": "0.55536145", "text": "function fill_crop_drop_down() {\n var tbody_obj = $('#crop_max_min_avg');\n tbody_obj.html(\"\");\n tbody_obj.append('<option value=\"\" disabled selected> Choose a Crop </option>');\n var crops_names_time_series;\n if (language == ENGLISH_LANGUAGE)\n crops_names_time_series = crops_for_filter;\n else {\n // If country is India, then Regional Language is Hindi/Marathi\n if (country_id == 1){\n if(state_id == 1){\n crops_names_time_series = croplanguage_for_filter[HINDI_ID];\n }\n else if(state_id == 7){\n crops_names_time_series = croplanguage_for_filter[MARATHI_ID];\n }\n else{\n //For data of all states in India, regional language is Hindi\n crops_names_time_series = croplanguage_for_filter[HINDI_ID];\n }\n }\n // If country is Bangladesh, then Regional Language is Bangla\n else if (country_id == 2)\n crops_names_time_series = croplanguage_for_filter[BANGLA_ID];\n }\n $.each(crops_names_time_series, function(index, data) {\n var li_item = '<option value=' + data.id + '>' + data.crop_name + '</option>';\n tbody_obj.append(li_item);\n });\n $('select').material_select();\n}", "title": "" }, { "docid": "cd869bced6ef266a2eb033fa0bc32d44", "score": "0.55523866", "text": "function dropDownMenu() {\n\n // use d3 to select the dropdown html element\n var dropdownId = d3.select(\"#selDataset\");\n\n // fetch data from JSON samples['names'] and assign to variable\n d3.json(\"data/samples.json\").then((importedData) => {\n var subjectIds = importedData.names; \n\n // create dropdown menu\n subjectIds.forEach((individ) => {\n dropdownId.append(\"option\").text(individ).property(\"value\", individ); \n }); \n\n\n // initialize the dashboard with the first sample\n demographicInfo(0);\n buildPlot(0);\n buildGaugeChart(0);\n\n });\n}", "title": "" }, { "docid": "19f2f40ce88e12b287886bf16e38c2af", "score": "0.5549871", "text": "function loadOutput() {\n // Drop down list\n let select = document.createElement(\"select\");\n select.classList.add(\"select-css\");\n let firstRun = true;\n for (let key in myData) {\n // key: sheet name, slect option name\n let option = document.createElement(\"option\");\n option.value = key;\n option.textContent = key;\n select.appendChild(option);\n if (firstRun) {\n firstRun = false;\n quizBuilder(key);\n }\n }\n select.addEventListener(\"change\", outputQuiz);\n dropDownList.appendChild(select);\n }", "title": "" }, { "docid": "38e22c56100a2caa4ab515bd2a63f5f8", "score": "0.5544526", "text": "function putTypeExchange(dt) {\n if (dt[0].ext_id != 0) {\n $.each(dt, function (v, u) {\n let H = `<option value=\"${u.ext_id}\" data-content=\"${u.ext_code}|${u.ext_type}|${u.ext_link}|${u.ext_code_a}|${u.ext_type_a}\">${u.ext_code} - ${u.ext_description}</option>`;\n $('#txtTypeExchange').append(H);\n });\n }\n $('#txtTypeExchange').on('change', function () {\n let id = $(this).val();\n link = $(`#txtTypeExchange option[value=\"${id}\"]`).attr('data-content').split('|')[2];\n\n if (link == 'null') {\n $('#txtStoreTarget').parent().css({display: 'none'});\n var ps = $('#boxProducts').offset();\n $('.list-group').css({top: ps.top + 30 + 'px', display: 'none'});\n } else {\n $('#txtStoreTarget').parent().css({display: 'block'});\n var ps = $('#boxProducts').offset();\n $('.list-group').css({top: ps.top + 30 + 'px', display: 'none'});\n }\n $('#txtStoreTarget').val(0);\n });\n}", "title": "" }, { "docid": "f5fb65e35aa59650c3d5f6deee76a04d", "score": "0.5544133", "text": "function loadDial() {\n // Get the drop-down element\n var shipSelectorDropDownElement = document.getElementById(\"shipSelectorDropDown\");\n // Find which option was selected\n var selectedOptionText_shipName = shipSelectorDropDownElement.options[shipSelectorDropDownElement.selectedIndex].text;\n var selectedOptionValue_shipStatsURL = shipSelectorDropDownElement.options[shipSelectorDropDownElement.selectedIndex].value;\n // Add a dial given this text and value\n loadDialUsingShipNameAndURL(selectedOptionText_shipName, selectedOptionValue_shipStatsURL);\n}", "title": "" }, { "docid": "068b968ecf4e77f53f7d646d6d3cbce3", "score": "0.55383223", "text": "function ChangeSelectList() {\n\n\n\n // document.getElementById('chart').style.display = 'none';\n // document.getElementById(\"retable\").deleteRow(1);//\n\n\n var DataCategory = DataList.options[DataList.selectedIndex].value; //ดึงค่าของ value หมวดหมู\n\n\n console.log(DataCategory + \"15\");\n\n if (DataCategory == \"ค่าธรรมเนียมการศึกษา\") {\n\n document.getElementById('display').style.display = 'block';\n\n while (SubDataList.options.length) {\n SubDataList.remove(0);\n }\n\n var Head = TopicData[DataCategory];\n\n console.log(Head + \"14\");\n if (Head) {\n\n var i;\n for (i = 0; i < Head.length; i++) {\n var Add_Sub = new Option(Head[i], i);// เพิ่มข้อมูลลงใน id subcategory\n SubDataList.options.add(Add_Sub);\n\n }\n\n }\n\n } else {\n\n document.getElementById('display').style.display = 'none';\n\n\n }\n\n\n\n\n}", "title": "" }, { "docid": "c0f3b12f6d05ab468adf741b50b45296", "score": "0.55276763", "text": "function pg1_loader() {\r\n\t$('.departure_field').hide();\r\n\t$('.date_select').change(function() {\r\n\t\tget_deps( $(this).val() );\r\n\t});\r\n}", "title": "" }, { "docid": "6f7054cee58b48d075a3b7e2f0871973", "score": "0.55273753", "text": "function reqListener() {\n var data = JSON.parse(this.responseText);\n console.log(data);\n var list = document.getElementById(\"routelist\");\n\n for (var i = 0; i < data.length; i++) {\n var route = data[i];\n var opt = document.createElement(\"option\");\n opt.textContent = route.route_long_name;\n opt.value = route.route_id;\n list.appendChild(opt);\n }\n}", "title": "" } ]
b8694bf450fda36a34398bd8e92eff88
Summary: Adds a header element to the body of the html document with the specified level and content. Parameters: content: the text content of the header level: the level of the header (can be from h1 to h5). If the value is not a valid number or the passed in parameter is too high, defaults to h3. Return: undefined (i.e. just type in 'return').
[ { "docid": "a8b3087f0ef013eeaf471ac722979e61", "score": "0.5034261", "text": "function addHeader() {\r\n\r\n}", "title": "" } ]
[ { "docid": "88db059fa3cb45e5e3094b9fb3f48d3c", "score": "0.7054714", "text": "header(level, text, options) {\r\n let header = { 1: \"h1\", 2: \"h2\", 3: \"h3\", 4: \"h4\", 5: \"h5\", 6: \"h6\" }[level];\r\n if (!header)\r\n throw Error(`Unrecognized level '${level}' (expected 1, 2, 3, 4, 5, or 6)`);\r\n return this.el(header, text, options);\r\n }", "title": "" }, { "docid": "a45c5008522a3588eb78513256b7aa1c", "score": "0.6058876", "text": "function createHeadingNotation(x, y, level, selection) {\n // Background\n const newElement = new Rectangle();\n newElement.width = DEFAULTS.width;\n newElement.height = DEFAULTS.height;\n newElement.fill = new Color(DEFAULTS.headings.color);\n newElement.cornerRadii = DEFAULTS.radius;\n newElement.stroke = new Color(DEFAULTS.color);\n newElement.strokeWidth = 2;\n newElement.strokePosition = \"OUTER_STROKE\";\n newElement.shadow = new Shadow(0, 0, 2, new Color(DEFAULTS.headings.color), true);\n\n\n selection.insertionParent.addChild(newElement);\n newElement.moveInParentCoordinates(x, y);\n\n // Text\n const textNode = new Text();\n textNode.text = \"H\" + level.toString();\n textNode.fill = new Color(DEFAULTS.color);\n textNode.fontSize = DEFAULTS.fontSize;\n\n selection.insertionParent.addChild(textNode);\n textNode.moveInParentCoordinates(x + 4, y + 28);\n}", "title": "" }, { "docid": "8b9c635723efe95cfbcae9b7bc132e3b", "score": "0.6019525", "text": "function createTableHeader(content) {\n\t\treturn wrapElement(\"th\", [document.createTextNode(content)], []);\n\t}", "title": "" }, { "docid": "78ab8964800e2b45abd6f5381df4ee17", "score": "0.594598", "text": "function setMarkdownHeader(cell, level) {\r\n // Remove existing header or leading white space.\r\n let source = cell.value.text;\r\n const regex = /^(#+\\s*)|^(\\s*)/;\r\n const newHeader = Array(level + 1).join('#') + ' ';\r\n const matches = regex.exec(source);\r\n if (matches) {\r\n source = source.slice(matches[0].length);\r\n }\r\n cell.value.text = newHeader + source;\r\n }", "title": "" }, { "docid": "6e17bc6d40389636836792bef506ff64", "score": "0.59069145", "text": "function setMarkdownHeader(cell, level) {\n var source = cell.value.text;\n var newHeader = Array(level + 1).join('#') + ' ';\n // Remove existing header or leading white space.\n var regex = /^(#+\\s*)|^(\\s*)/;\n var matches = regex.exec(source);\n if (matches) {\n source = source.slice(matches[0].length);\n }\n cell.value.text = newHeader + source;\n }", "title": "" }, { "docid": "ce27139e710a130b62332d680d2dac5c", "score": "0.5839678", "text": "heading(text, level) {\n const { headerIds, modifyAnchors } = this.options;\n const { _headingId } = this;\n\n if (!headerIds) {\n return `<h${level}>${text}</h${level}>`;\n }\n\n const transformOption = modifyAnchors;\n let id = anchorId(stripHTML(text), transformOption);\n const headingId = _headingId;\n\n // Add a number after id if repeated\n if (headingId[id]) {\n id += `-${headingId[id]++}`;\n } else {\n headingId[id] = 1;\n }\n\n // add headerlink\n return `<h${level} id=\"${id}\"><a href=\"#${id}\" class=\"headerlink\" title=\"${stripHTML(text)}\"></a>${text}</h${level}>`;\n }", "title": "" }, { "docid": "e87f5d8ae1a8c5a1f63cfecbf2eb327f", "score": "0.5676984", "text": "function handle_content(text, heading_count, level, content, re) {\n var new_content = generate_number(level, heading_count) + ' ' + strip_numbers(content);\n return replace_by_index(text, content, new_content, re.lastIndex);\n }", "title": "" }, { "docid": "f35d49f2a5c2d024454b2d45d8134180", "score": "0.556531", "text": "function headerStyleForLevel( headerLevel ) {\n\theaderLevel = Math.round( Math.max( Math.min( headerLevel, 6 ), 1 ) );\n\n\tvar size = [\n\t\t6, // h1\n\t\t5, // h2\n\t\t5, // h3\n\t\t4, // h4\n\t\t4, // h5\n\t\t3, // h6\n\t];\n\n\tvar bold = [\n\t\tfalse, // h1\n\t\ttrue, // h2\n\t\tfalse, // h3\n\t\ttrue, // h4\n\t\tfalse, // h5\n\t\ttrue, // h6\n\t];\n\n\tvar italic = [\n\t\tfalse, // h1\n\t\tfalse, // h2\n\t\tfalse, // h3\n\t\tfalse, // h4\n\t\tfalse, // h5\n\t\tfalse, // h6\n\t];\n\n\tvar underline = [\n\t\tfalse, // h1\n\t\tfalse, // h2\n\t\tfalse, // h3\n\t\tfalse, // h4\n\t\tfalse, // h5\n\t\tfalse, // h6\n\t];\n\n\tvar spacing = [\n\t\t'\\n', // h1\n\t\t'\\n', // h2\n\t\t'', // h3\n\t\t'', // h4\n\t\t'', // h5\n\t\t'', // h6\n\t];\n\n\treturn {\n\t\tsize: String( size[ headerLevel - 1 ] ),\n\t\tbold: !! bold[ headerLevel - 1 ],\n\t\titalic: !! italic[ headerLevel - 1 ],\n\t\tunderline: !! underline[ headerLevel - 1 ],\n\t\tadditionalSpacingBefore: spacing[ headerLevel - 1 ]\n\t};\n}", "title": "" }, { "docid": "a20488f114f79f4447287a9bae1993a3", "score": "0.5470902", "text": "function sectionHeading(heading){\n var heading2 = document.createElement(\"h3\");\n var text = document.createTextNode(heading);\n heading2.appendChild(text);\n document.querySelector(\"body\").appendChild(heading2);\n}", "title": "" }, { "docid": "676e0ef1528bc681d7fe64eace198f7a", "score": "0.540231", "text": "function makeHeaderFunc(level) {\n return function (match, header) {\n return '\\n\\n</p>\\n<a ' + protect('class=\"target\" name=\"' + mangle(removeHTMLTags(header.rp(PROTECT_REGEXP, expose))) + '\"') + \n '>&nbsp;</a>' + entag('h' + level, header) + '\\n<p>\\n\\n';\n }\n }", "title": "" }, { "docid": "41701a4408f85683de65a5ae27350586", "score": "0.53963405", "text": "function articleH(title,hlevel){ return destIn( say( newTag('h'+hlevel), title),newTag('article') );}", "title": "" }, { "docid": "44ebcc4d4cb0222607471453200bc37e", "score": "0.53802514", "text": "insertHeader() {\r\n // Grab your main container from the dom.\r\n // This is a div defined in your index.html.\r\n const container = document.getElementById(\"app-container\")\r\n\r\n // Create a container for your content.\r\n const content = document.createElement('h2')\r\n\r\n // Apply any class or id or other attributes that you want.\r\n content.className = \"headerStyling\"\r\n\r\n // Insert your text or other arguments into your content container.\r\n content.innerText = this.content\r\n\r\n // Append your content container to the main container.\r\n container.appendChild(content)\r\n\r\n\r\n\r\n // // You can also 'cheat', and just put your entire html as a string.\r\n // // This is considered bad practice, but would look something like this:\r\n // // As you can see it renders the same thing.\r\n\r\n // // (I'm only creating a container here to illustrate that you can stick a div into a container with .innerHTML)\r\n // // (I would do this just straight into the main container if I didn't want to also show how to do it properly)\r\n // const badContainer = document.createElement('div')\r\n\r\n // // Insert your html as a string into your div\r\n // badContainer.innerHTML = `<div class='headerStyling'>${text}</div>`\r\n\r\n // // Append the content div to the main container.\r\n // container.appendChild(badContainer)\r\n }", "title": "" }, { "docid": "380acd7d419d079f8563667748cdf199", "score": "0.5359958", "text": "createHeaderNode() {\r\n // Create a container for your content.\r\n const headerNode = document.createElement('h2')\r\n\r\n // Apply any class or id or other attributes that you want.\r\n headerNode.className = \"headerStyling\"\r\n\r\n // Insert your text or other arguments into your content container.\r\n headerNode.innerText = this.content\r\n\r\n return headerNode\r\n }", "title": "" }, { "docid": "8c16fda4f6a2c734368e3c059675ce6c", "score": "0.52600414", "text": "function createHeading(headingObj) {\n\n let heading = headingObj.size >= 1 && headingObj.size <= 5 ? document.createElement('h' + headingObj.size) : document.createElement('h4');\n\n heading.innerText = (typeof headingObj.text == 'string') ? headingObj.text : 'no text';\n\n if (headingObj.id != undefined && document.getElementById(headingObj.id) == null) {\n\n heading.id = headingObj.id\n\n }\n\n document.body.appendChild(heading);\n\n}", "title": "" }, { "docid": "70ade45a4ba6dccb68f48d1b75d6cace", "score": "0.5226674", "text": "function heading (ctx, node) {\n const depth = node.depth\n const content = require('../all')(ctx, node)\n\n const headings = ctx.headings || defaultHeadings\n const fn = headings[node.depth - 1]\n\n if (typeof fn !== 'function') {\n throw new Error(`Cannot compile heading of depth ${depth}: not a function`)\n }\n\n return fn(content)\n}", "title": "" }, { "docid": "c9f4dc5fc9834fdff1f40d33661e0932", "score": "0.5207142", "text": "function heading(node) {\n var self = this;\n var depth = node.depth;\n var setext = self.options.setext;\n var closeAtx = self.options.closeAtx;\n var content = self.all(node).join('');\n var prefix;\n\n if (setext && depth < 3) {\n return (\n content + lineFeed$n + repeatString(depth === 1 ? equalsTo$3 : dash$9, content.length)\n )\n }\n\n prefix = repeatString(numberSign$3, node.depth);\n\n return prefix + space$h + content + (closeAtx ? space$h + prefix : '')\n }", "title": "" }, { "docid": "db4e9862cfd45a8827dd9d3998c54204", "score": "0.5169649", "text": "function addContent() {\n // Get a reference to the element in which we want to insert a new node\n var parentElement = document.getElementById('headings');\n // Get a reference to the first child\n var theFirstChild = parentElement.firstChild;\n // Create a new element\n var newElement = document.createElement('p');\n newElement.textContent = 'Prepended before h1';\n // Insert the new element before the first child\n parentElement.insertBefore(newElement, theFirstChild);\n}", "title": "" }, { "docid": "c086801666a509e71892fd21be6bee25", "score": "0.5152922", "text": "function header() {\n const coffeeTable = document.querySelector('#table-header');\n let tableHeader = document.createElement('th');\n coffeeTable.appendChild(tableHeader);\n tableHeader.setAttribute('colspan', '5');\n tableHeader.textContent = 'Coffee Menu';\n}", "title": "" }, { "docid": "cca74e7a1f52c182a3627f27fed9d2d1", "score": "0.51456255", "text": "function heading(node) {\n var self = this\n var depth = node.depth\n var setext = self.options.setext\n var closeAtx = self.options.closeAtx\n var content = self.all(node).join('')\n var prefix\n\n if (setext && depth < 3) {\n return (\n content + lineFeed + repeat(depth === 1 ? equalsTo : dash, content.length)\n )\n }\n\n prefix = repeat(numberSign, node.depth)\n\n return prefix + space + content + (closeAtx ? space + prefix : '')\n}", "title": "" }, { "docid": "cca74e7a1f52c182a3627f27fed9d2d1", "score": "0.51456255", "text": "function heading(node) {\n var self = this\n var depth = node.depth\n var setext = self.options.setext\n var closeAtx = self.options.closeAtx\n var content = self.all(node).join('')\n var prefix\n\n if (setext && depth < 3) {\n return (\n content + lineFeed + repeat(depth === 1 ? equalsTo : dash, content.length)\n )\n }\n\n prefix = repeat(numberSign, node.depth)\n\n return prefix + space + content + (closeAtx ? space + prefix : '')\n}", "title": "" }, { "docid": "cca74e7a1f52c182a3627f27fed9d2d1", "score": "0.51456255", "text": "function heading(node) {\n var self = this\n var depth = node.depth\n var setext = self.options.setext\n var closeAtx = self.options.closeAtx\n var content = self.all(node).join('')\n var prefix\n\n if (setext && depth < 3) {\n return (\n content + lineFeed + repeat(depth === 1 ? equalsTo : dash, content.length)\n )\n }\n\n prefix = repeat(numberSign, node.depth)\n\n return prefix + space + content + (closeAtx ? space + prefix : '')\n}", "title": "" }, { "docid": "f765ac04a276f07479deec26be8b424d", "score": "0.5131982", "text": "function createHeading(text) {\n\t//@TODO\n\treturn \n}", "title": "" }, { "docid": "def89bfbaaae7d8bd11201191197370b", "score": "0.51304066", "text": "function setMarkdownHeader(widget, level) {\n if (!widget.model || !widget.activeCell) {\n return;\n }\n var state = Private.getState(widget);\n level = Math.min(Math.max(level, 1), 6);\n var cells = widget.model.cells;\n var i = 0;\n algorithm_1.each(widget.widgets, function (child) {\n if (widget.isSelected(child)) {\n Private.setMarkdownHeader(cells.get(i), level);\n }\n i++;\n });\n Private.changeCellType(widget, 'markdown');\n Private.handleState(widget, state);\n }", "title": "" }, { "docid": "f6176d879cb7af401cbbfde28c8569a0", "score": "0.5112677", "text": "function increaseHeadingLevel() {\n return (_, l) => {\n // trim the string and calculate length as there might be whitespace\n const level = l.trim().length;\n\n return `${'#'.repeat(level === 6 ? level : level + 1)} `;\n };\n}", "title": "" }, { "docid": "970f83e117111eb02647a8ca9664c6fa", "score": "0.5086096", "text": "function createCheckoutHeader(innerHTML, type){\n\n\t// create a header with a horizontal rule\n\tvar row = document.createElement(\"row\");\n\trow.className = \"row bg-light text-dark col-sm-12 border-dark mr-3\";\n\tvar header = document.createElement(type);\n\theader.className = \"col-sm-8 col-md-10\";\n\theader.innerHTML = innerHTML;\n\trow.appendChild(header);\n\treturn row;\n}", "title": "" }, { "docid": "ea444d106a3d2f000fd7c67bc33b55ed", "score": "0.50682944", "text": "function addMdHeading() {\n const selected = getSelection();\n const chunk = selected.length === 0 ? \"heading text\" : `${selected.text}\\n`;\n const content = EDITOR.value;\n let cursor;\n let pointer;\n let prevChar;\n\n if ((pointer = 4, content.substr(selected.start - pointer, pointer) === \"### \") ||\n (pointer = 3, content.substr(selected.start - pointer, pointer) === \"###\")) {\n setSelection(selected.start - pointer, selected.end);\n replaceSelection(chunk);\n cursor = selected.start - pointer;\n } else if (selected.start > 0 &&\n (prevChar = content.substr(selected.start - 1, 1), !!prevChar && prevChar != \"\\n\")) {\n replaceSelection(`\\n\\n### ${chunk}`);\n cursor = selected.start + 6;\n } else {\n replaceSelection(`### ${chunk}`);\n cursor = selected.start + 4;\n }\n\n setSelection(cursor, cursor + chunk.length);\n}", "title": "" }, { "docid": "80224e61e8f1e47465870b28307f444d", "score": "0.5063096", "text": "function headingsHandlerFunction(selection, documentRoot) {\n console.log(selection.items.length + \" items are selected\");\n\n if (selection.hasArtboards) {\n console.log(\"Selecting artboards not supported\");\n }\n\n selection.items.forEach(function (item) {\n let node = item;\n console.log(node.name);\n let level = 0;\n\n if (node.name.includes(\"[h1]\")) {\n level = 1;\n }\n\n if (node.name.includes(\"[h2]\")) {\n level = 2;\n }\n if (level > 0) {\n createHeadingNotation(\n node.translation.x - DEFAULTS.width,\n node.translation.y - DEFAULTS.height,\n level,\n selection\n );\n }\n });\n}", "title": "" }, { "docid": "6711677c7d25ec7523864fd066de716b", "score": "0.50610477", "text": "function replaceHeaderText(match, p1, p2){\n\n let level = p1.length;\n let header_text = checkLink(p2) ? convertLink(p2) : p2;\n\n return `&lt;h${level}&gt;${header_text}&lt;/h${level}&gt;`;\n\n}", "title": "" }, { "docid": "2c87b1d0e543143ad6927ee669a8da93", "score": "0.5037203", "text": "function addSubHeader() {\n\t\tvar subHeader = $('<small>&nbsp&nbspsquash the bugs!</small>')\n\t\t$('h1').append(subHeader);\n\t}", "title": "" }, { "docid": "45c8a4716b77225279c1c67add86edc2", "score": "0.5022551", "text": "function bfsHeaderAccumulate(node, headings) {\n if (node.type === 'heading') {\n const level = node.level;\n const strHeader = stringContentAccumulate(node);\n headings.push({ name: strHeader, level });\n } else {\n getChildNodes(node).forEach((c) => bfsHeaderAccumulate(c, headings));\n }\n}", "title": "" }, { "docid": "4b7880144f190d59dda6a2d541dfed1e", "score": "0.5016537", "text": "function makeHeader(address){\n var text = document.getElementById(\"text\");\n text.innerHTML = \"\";\n var crimeInfo = document.createElement('h3');\n var selectMonth = document.getElementById('selector').options[document.getElementById('selector').selectedIndex].text;\n crimeInfo.innerHTML = \"In \" + selectMonth + \" there were:<br>\" + state.crimes.length + \" crimes within 1 mile of:<br>\" + address;\n text.appendChild(crimeInfo);\n}", "title": "" }, { "docid": "496eb754f2b5555a4c45695f259a5488", "score": "0.500727", "text": "function createBadge(badgeType, content, headingSize) {\n let $heading = $(headingSize)\n let $badge = $(\"<span>\")\n $badge.addClass(\"badge \" + badgeType)\n $badge.append(content)\n $heading.append($badge)\n return $heading\n}", "title": "" }, { "docid": "7b59d34e50a1e09a61a7f7601fa7f549", "score": "0.50035936", "text": "function injectHeader(contentBody) {\n let oldInnerHeader = contentBody.querySelector('.TableCommonHeader');\n if (!oldInnerHeader) {\n return;\n }\n let oldHeader = oldInnerHeader.parentNode.parentNode;\n let newHeaderHtml = `<div class=\"top header container\"><div class=\"alt buttons container left\">`;\n let oldHome = contentBody.querySelector('#CommonHeader_ibtBackHome');\n if (oldHome) {\n newHeaderHtml += `\n <span for=\"home-button\" class=\"mdl-tooltip mdl-tooltip--large\">首頁</span>\n <label id=\"home-button\" for=${oldHome.id} class='btn hoverable' onclick='toggleOverlay(this.getRootNode()); this.nextElementSibling.click();'>home</label>\n <input id=${oldHome.id} src=${emptyImage} style='display: none;' value='' type=\"image\" name=${oldHome.name} alt=${oldHome.alt} title=${oldHome.title}>`;\n }\n newHeaderHtml += `</div><div class=\"sub container\" id=\"module-info\">`;\n let moduleName = contentBody.querySelector('#CommonHeader_lblModule')\n if (moduleName) {\n newHeaderHtml += `\n <div>\n <i class=\"material-icons\">dashboard</i>\n <div class=\"hoverable\" id=\"page-name\">\n ${moduleName.innerText}\n </div>\n </div>`;\n }\n let semesterElement = contentBody.querySelector('#CommonHeader_lblYSC');\n if (semesterElement) {\n let semesterName = semesterElement.innerText.replace(/[::]/g, '');\n let oldSemSwitch = contentBody.querySelector('#CommonHeader_ibtChgSYearSeme');\n if (semesterName) {\n newHeaderHtml += `<div><i class=\"material-icons\">event</i>`;\n }\n if (oldSemSwitch) {\n newHeaderHtml += `\n <span for=\"semester-name\" class=\"mdl-tooltip mdl-tooltip--large\">切換學期</span>\n <label id=\"semester-name\" class=\"text clickable\" onclick='this.nextElementSibling.click();'>${semesterName}</label>\n <input id=${oldSemSwitch.id} src=${emptyImage} style='display: none;' value='' type=\"image\" alt=${oldSemSwitch.name} name=${oldSemSwitch.name} title=${oldSemSwitch.title}>`;\n } else {\n newHeaderHtml += `<div class=\"hoverable\" id=\"semester-name\">${semesterName}</div>`;\n }\n newHeaderHtml += `</div>`;\n }\n newHeaderHtml += `</div><div class=\"sub container\" id=\"user-info\">`;\n let loginName = contentBody.querySelector('#CommonHeader_lblName');\n if (loginName) {\n newHeaderHtml += `\n <div>\n <i class=\"material-icons\">person</i>\n <div class=\"hoverable\" id=\"user-name\">\n ${loginName.innerText}\n </div>\n </div>`;\n }\n let onlineUsers = contentBody.querySelector('.CommomHeadstyle2 font');\n if (onlineUsers) {\n newHeaderHtml += `\n <div>\n <i class=\"material-icons\">people</i>\n <div class=\"hoverable\" id=\"user-count\">\n ${onlineUsers.innerText}\n </div>\n </div>`;\n }\n newHeaderHtml += `</div><div class=\"alt buttons container right\">`;\n let oldPwdBtn = contentBody.querySelector('#CommonHeader_ibtChgPwd');\n if (oldPwdBtn) {\n newHeaderHtml += `\n <span for=\"change-pw-button\" class=\"mdl-tooltip mdl-tooltip--large\">更改密碼</span>\n <label for=${oldPwdBtn.id} id=\"change-pw-button\" class='btn hoverable' onclick='this.nextElementSibling.click();'>lock</label>\n <input id=${oldPwdBtn.id} src=${emptyImage} style='display: none;' value='' type=\"image\" alt=${oldPwdBtn.name} name=${oldPwdBtn.name} title=${oldPwdBtn.title}>`;\n }\n let oldLogout = contentBody.querySelector('#CommonHeader_ibtLogOut');\n if (oldLogout) {\n newHeaderHtml += `\n <span for=\"logout-button\" class=\"mdl-tooltip mdl-tooltip--large\">登出</span>\n <label for=${oldLogout.id} id=\"logout-button\" class='btn hoverable' onclick='this.nextElementSibling.click();'>exit_to_app</label>\n <input id=${oldLogout.id} src=${emptyImage} style='display: none;' value='' type=\"image\" alt=${oldLogout.name} name=${oldLogout.name} title=${oldLogout.title}>`;\n }\n newHeaderHtml += `</div></div>`;\n let newHeader = make({\n el: \"header\",\n html: newHeaderHtml,\n class: 'redux-header'\n });\n // For some reason they're using this for print detection? What the hell guys\n let textUsedDummy = contentBody.querySelector('#CommonHeader_txtUsed');\n if (textUsedDummy) {\n textUsedDummy.style.opacity = 0;\n textUsedDummy.style.position = 'absolute';\n textUsedDummy.style.left = '-1px';\n textUsedDummy.style.top = '-1px';\n newHeader.appendChild(textUsedDummy);\n }\n let mainForm = mainWindow.document.body.querySelector('body>form');\n let righthandButtons = newHeader.querySelector('.alt.buttons.container.right');\n\n let settingsTooltip = make({\n el: 'span',\n text: 'Redux 設定',\n attr: {\n for: 'settings-button'\n },\n class: 'mdl-tooltip mdl-tooltip--large'\n });\n let settingsBtn = make({\n el: 'label',\n id: 'settings-button',\n class: 'btn hoverable',\n text: 'settings'\n });\n settingsBtn.addEventListener('click', function() {\n let settingsOverlay = getOrCreateSettingsLayer(window.parent.document.body);\n toggleVisibility(settingsOverlay);\n })\n righthandButtons.prepend(settingsTooltip);\n righthandButtons.prepend(settingsBtn);\n componentHandler.upgradeElement(newHeader);\n mainForm.prepend(newHeader);\n oldHeader.remove();\n}", "title": "" }, { "docid": "298d9ffb3a69ba9933e3a165029557db", "score": "0.49961737", "text": "function h1(text){\n var element = document.createElement(\"h1\");\n element.innerHTML = text;\n return element;\n}", "title": "" }, { "docid": "07742fe3413e05f8bdc482c7489e38f1", "score": "0.4983963", "text": "appendHeader(title) {\n\t\tlet header = createDiv(\"header center\");\n\n\t\tfunction heading() {\n\t\t\tlet heading = document.createElement(\"h1\");\n\t\t\theading.innerText = title;\n\n\t\t\treturn heading;\n\t\t}\n\n\t\t// Close button\n\t\tfunction close() {\n\t\t\tlet close = createDiv(\"close center\");\n\t\t\tclose.setAttribute(\"onclick\",\"this.closest('.modal').close()\");\n\t\n\t\t\tclose.appendChild(createDiv(\"line\"));\n\t\t\tclose.appendChild(createDiv(\"line\"));\n\t\n\t\t\treturn close;\n\t\t}\n\t\t\n\t\theader.appendChild(heading());\n\t\theader.appendChild(close());\n\n\t\tthis.append(header);\n\t}", "title": "" }, { "docid": "135a6304ebaba33eb98d7d1f72914dae", "score": "0.49833867", "text": "function addNesting(content, row, level) {\n return '<div class=\"dd-hyp\" id=\"nst'+row+''+level+'\">'+content+'</div>';\n}", "title": "" }, { "docid": "c9127b0fce6691b8eb3fbb45c49184e2", "score": "0.49770743", "text": "function append_content() {\n // add heading to container div\n $('#container').append( '<div class=\"container\">' );\n \n // add dummy content\n $('#container').append( \"<div class='header'><span>Recent Comments Expand</span> \\\n </div> <div class='content'> \\\n <div> \\\n </div> </div>\" );\n}", "title": "" }, { "docid": "f28fbf231a736bb6b58d1150084d1aca", "score": "0.4975688", "text": "function createHeader() {\n let tHead = document.createElement('thead');\n let tRow = document.createElement('tr');\n let thItem = document.createElement('th');\n let thPrice = document.createElement('th');\n\n thItem.textContent = \"Item\";\n tRow.appendChild(thItem);\n thPrice.textContent = \"Price\";\n thPrice.setAttribute(\"class\", \"currency\");\n tRow.appendChild(thPrice);\n\n tHead.appendChild(tRow);\n\n return tHead;\n}", "title": "" }, { "docid": "622312295e8823ac75feb429e7f58828", "score": "0.49737442", "text": "function setHeader(position , header){\n var hdrCell = $('#reportDiv .xhdr .hdr .hdrcell').get();\n hdrCell[position].innerHTML = header;\n}", "title": "" }, { "docid": "e54982f9183646869884ca0457873dfe", "score": "0.49582174", "text": "function setMarkdownHeader(notebook, level) {\r\n if (!notebook.model || !notebook.activeCell) {\r\n return;\r\n }\r\n const state = Private.getState(notebook);\r\n const cells = notebook.model.cells;\r\n level = Math.min(Math.max(level, 1), 6);\r\n notebook.widgets.forEach((child, index) => {\r\n if (notebook.isSelectedOrActive(child)) {\r\n Private.setMarkdownHeader(cells.get(index), level);\r\n }\r\n });\r\n Private.changeCellType(notebook, 'markdown');\r\n Private.handleState(notebook, state);\r\n }", "title": "" }, { "docid": "92522e395a79a8e8c0cf0c5a3cc4fa51", "score": "0.49522564", "text": "function addToHeader(string) {\r\n lottoHeader.insertAdjacentHTML('beforeend', \"<p>\" + string + \"</p>\");\r\n}", "title": "" }, { "docid": "5bec2951952e0e71c1c26b2c71e5e08a", "score": "0.49491224", "text": "function makingHeader() {\n let headerRow = document.createElement('tr');\n table.appendChild(headerRow);\n let cellOne = document.createElement('th');\n headerRow.appendChild(cellOne);\n cellOne.textContent = 'id';\n\n let cellTwo = document.createElement('th');\n headerRow.appendChild(cellTwo);\n cellTwo.textContent = 'Name';\n\n let cellThree = document.createElement('th');\n headerRow.appendChild(cellThree);\n cellThree.textContent = 'Age';\n\n let cellFour = document.createElement('th');\n headerRow.appendChild(cellFour);\n cellFour.textContent = 'Email';\n\n let cellFive = document.createElement('th');\n headerRow.appendChild(cellFive);\n cellFive.textContent = 'mobile';\n\n let cellSixe = document.createElement('th');\n headerRow.appendChild(cellSixe);\n cellSixe.textContent = 'tuition';\n}", "title": "" }, { "docid": "238a626d876346aa12942e401bc4dc47", "score": "0.491912", "text": "function textOnlyH1(line){\n var para = document.createElement(\"h1\");\n var text = document.createTextNode(line);\n para.appendChild(text);\n document.querySelector(\"body\").appendChild(para);\n}", "title": "" }, { "docid": "07f09471dc62e1e900283d1a4c03ab50", "score": "0.4913896", "text": "static convertHeaders(input) {\n for (var i = 6; i >= 1; i--) {\n /* \n selects characters matching '#n {anything but a line return} where n is the number of #'s and the corresponding header level.'\n */\n let regSelect = new RegExp(`^#{${i}}\\\\s{1}(.+)`, 'gm')\n /* \n replaces the entire match with just the sectioned off portion being our inner value\n */\n input = input.replace(regSelect, `<h${i}>$1</h${i}>`);\n }\n return input;\n }", "title": "" }, { "docid": "616d0489c0f7c84f847981dd58eccf69", "score": "0.49120212", "text": "function onHeaderItemClick(lvl) {\n //check if there is selected text\n const selection = checkIfSelection();\n\n if (selection.isSelected) {\n //there is selected text\n updateSelection(selection.selection, 'heading', { level: lvl });\n } else {\n //insert new item to post body\n type = 'h' + lvl;\n insertNewItem(type);\n }\n}", "title": "" }, { "docid": "a887074e3c8780baf144cf585789e974", "score": "0.48954445", "text": "function handleHeadingValue(heading){\n\tvar headingRound = Math.round(heading/5)*5;\n\tvar heading_presize = (((heading + 2.5) % 5) - 2.5)/2.5;\n\twriteHeading(\"heading_1\", (headingRound - 25), 6 - 6*heading_presize);\n\twriteHeading(\"heading_2\", (headingRound - 20), 12 - 3*heading_presize);\n\twriteHeading(\"heading_3\", (headingRound - 15), 18 - 3*heading_presize);\n\twriteHeading(\"heading_4\", (headingRound - 10), 24 - 3*heading_presize);\n\twriteHeading(\"heading_5\", (headingRound - 5), 30 - 3*heading_presize);\n\twriteHeading(\"heading_6\", (headingRound), 36 - 3*Math.abs(heading_presize));\n\twriteHeading(\"heading_7\", (headingRound + 5), 30 + 3*heading_presize);\n\twriteHeading(\"heading_8\", (headingRound + 10), 24 + 3*heading_presize);\n\twriteHeading(\"heading_9\", (headingRound + 15), 18 + 3*heading_presize);\n\twriteHeading(\"heading_10\", (headingRound + 20), 12 + 3*heading_presize);\n\twriteHeading(\"heading_11\", (headingRound + 25), 6 + 6*heading_presize);\n}", "title": "" }, { "docid": "371817d59ddc8c9b2a4dbaa56f939ec6", "score": "0.48917535", "text": "function creaHeader(level, nameImg){\n\tvar levelTree = climbTreeStr(level);\n\t$(\".HMR_Banner\").append(\"<a href='\" + levelTree + \"'><img id='HMR_Logo' src='\" + levelTree + \"Assets/Images/HMR_2017g_GC-WebHeaderLogo-140x105.gif' alt='img'></a> <div id='HMR_HeaderText1'><a href='\" + levelTree + \"'>Hackerando la Macchina Ridotta</a></div> <div id='HMR_HeaderText2'>storia e archeologia sperimentale dell&rsquo;informatica</div> <img id='HMR_HeaderRightImg' src='\" + levelTree + \"Assets/Images/\" + nameImg + \"' alt='img'>\");\n}", "title": "" }, { "docid": "c2b5075925d8f0e6ff00e780b724b487", "score": "0.48913646", "text": "function addContent1(){\n //Test si le contenu de h1 (text) est égal à : Cette page est bien vide.\n if(h1.textContent == 'Cette page est bien vide'){\n //Remplissage de h1 (innerHTML).\n h1.innerHTML = \"Enfin du contenu !!!\";\n document.querySelector('h1').style.textDecoration = 'underline';\n //Remplissage de content1 (innerHTML).\n content1.innerHTML = '<h2>Veux-tu jouer avec moi ?</h2>';\n document.querySelector('h2').style.textDecoration = 'underline';\n document.querySelector('h2').style.color = 'red';\n content1.innerHTML += '<h3>Pour gagner tu dois faire plus de 3 sur un lancé de dés</h3>';\n content1.innerHTML += '<p><button type=\"button\" onclick=\"lancer()\">lancer le dés</button></p>';\n \n }\n //Test sinon on restore le contenu de h1, resultat et content1\n else{\n //Appel de la fonction reset.\n reset(); \n }\n}", "title": "" }, { "docid": "60db518b02efb99b7b4d4b7973cc504a", "score": "0.48772338", "text": "function appendHeader() {\n var containAdd = $(\".container\");\n var head =$(\"<h1/>\").text(\"Angry Birds!\");\n containAdd.append(head);\n console.log(containAdd);\n console.log(head);\n }", "title": "" }, { "docid": "6bc3cf10a0236ba885f2c0e80969b9ab", "score": "0.48771623", "text": "function createHeader() {\n content.appendChild(headerGrid);\n\n title.textContent = 'Fructece';\n homeTab.textContent = 'Home';\n menuTab.textContent = 'Menu';\n contactTab.textContent = \"Contact Us\";\n\n headerGrid.appendChild(title);\n headerGrid.appendChild(tabGrid);\n tabGrid.appendChild(homeTab);\n tabGrid.appendChild(menuTab);\n tabGrid.appendChild(contactTab);\n\n }", "title": "" }, { "docid": "8bf7d4b8672910b72363086c069d6e4a", "score": "0.48538136", "text": "_checkHeader(start)\n {\n // Headers need to be at the start of a line (or at least the first non-whitespace character)\n // Nested within a ListItem is still fine though, as long as they're at the beginning\n let newline = this._lastNewline(start);\n\n let between = this.text.substring(newline + 1, start);\n if (!RegExp('^' + this._nestRegex() + '$').test(between))\n {\n return start;\n }\n\n if (!stateAllowedInState(State.Header, this.currentRun, start))\n {\n return start;\n }\n\n let headingLevel = 1;\n while (start + 1 < this.text.length && this.text[start + 1] == '#')\n {\n ++headingLevel;\n ++start;\n }\n\n // h6 is the highest heading level possible,\n // and there must be a space after the header declaration\n if (headingLevel > 6 || start == this.text.length - 1 || this.text[start + 1] != ' ')\n {\n // Reset i and continue\n start -= (headingLevel - 1);\n return start;\n }\n\n let end = this.text.indexOf('\\n', start);\n if (end == -1) { end = this.text.length; }\n let header = new Header(start - headingLevel + 1, end, this.text, headingLevel, this.currentRun);\n this.currentRun = header;\n return start;\n }", "title": "" }, { "docid": "d3cf8e57ba2c24183a6675169cb18fbc", "score": "0.48506832", "text": "function postHeader(meta) {\n // var href = meta.slug + '.html';\n var datetime = moment(meta.publishedat).format('Do of MMMM YYYY');\n var html = { tag:\"header\",\n inner: [\n { tag: 'div', 'class':'title blog-post-title',\n inner: meta.title },\n \n // inner: {\n // tag: 'a', href: meta.slug + '.html', inner: meta.title \n // }\n { tag: 'time', 'class': 'blog-post-meta',\n datetime:datetime, inner: datetime }\n // inner: [\n // {tag: 'a', href:href, inner:'Jan 1 1970'}\n // ]}\n // inner: [\n // {tag: 'a', href:href, inner: meta.title}\n // ]}\n ]};\n return htmlizeObject(html);\n}", "title": "" }, { "docid": "d24b559399c656f581446240c009bfc6", "score": "0.4827742", "text": "function appendStatHeader(table, headerText) {\n\tvar thead = document.createElement('thead');\n\tvar row = thead.insertRow(0);\n\tvar cell = row.insertCell(0);\n\tcell.colSpan = '2';\n\tcell.className = 'stats-head';\n\tcell.appendChild(document.createTextNode(headerText));\n\ttable.appendChild(thead);\n}", "title": "" }, { "docid": "b6769c099be16235758f8392ce2c39b7", "score": "0.4826459", "text": "function h4(text){\n var element = document.createElement(\"h4\");\n element.innerHTML = text;\n return element;\n}", "title": "" }, { "docid": "b1639eadfb48c219f21c51ce0c93cc4a", "score": "0.48204446", "text": "function populateHeader(iScreamInc) {\n let headerH1 = document.createElement('h1');\n headerH1.textContent = iScreamInc['companyName'];\n header.appendChild(headerH1);\n\n let headerPara = document.createElement('p');\n headerPara.textContent = iScreamInc['headOffice'];\n header.appendChild(headerPara);\n\n}", "title": "" }, { "docid": "3dd2602dd0751808f4065b2b81a3244d", "score": "0.48162588", "text": "function appendNumber() {\n // gets the text inside the header element\n var headerNumber = document.getElementsByTagName('header')[0].innerHTML;\n // creates a new paragraph element\n var newP = document.createElement('p');\n // sets the text inside the new paragraph to be the current header number\n newP.innerHTML = headerNumber;\n\n // appends the new paragraph element to the body\n document.body.appendChild(newP);\n }", "title": "" }, { "docid": "90a7b4d8467b8c7cafd5904087ae3743", "score": "0.4814504", "text": "function insertXHeader() {\n var xrow = table.insertRow(0),\n xhead = xrow.insertCell(0);\nxhead.setAttribute('class', 'headings');\nxhead.innerHTML = document.getElementsByTagName('tspan')[2].innerHTML;\nxhead.colSpan = ncol;\n}", "title": "" }, { "docid": "5956d8032636e502ed94e3fd6c5b1e81", "score": "0.4789737", "text": "function appendHeading(domParent, text) {\n\tvar heading = document.createElement('h3');\n\theading.className = 'sub-banner';\n\theading.appendChild(document.createTextNode(text));\n\tdomParent.appendChild(heading);\n}", "title": "" }, { "docid": "6d4f942da879faaa37d59a063d1f1d28", "score": "0.47746965", "text": "addText(number, type, cell = this.selectedCell) {\r\n let text;\r\n if (type === \"h2\") {\r\n text = document.createElement(\"h2\");\r\n } else {\r\n text = document.createElement(\"h3\");\r\n }\r\n text.innerText = number;\r\n cell.div.appendChild(text);\r\n }", "title": "" }, { "docid": "1a2b208d0960f3919c5ae7d708e236ee", "score": "0.4774258", "text": "function writeHeading(headingElementID, number, font_size){\n\tvar string_H = new String;\n\tif(number > 360){\n\t\tnumber -= 360;\n\t}\n\telse if(number < 0){\n\t\tnumber += 360;\n\t}\n\tstring_H=string_H.concat(number.toString());\n\tdocument.getElementById(headingElementID).innerHTML = string_H;\n\t$(\".\"+headingElementID).css(\"width\", font_size*2.5 + \"px\");\n\t$(\".\"+headingElementID).css(\"font-size\", font_size);\n}", "title": "" }, { "docid": "bdfea802566750291fe1624a1314b5fe", "score": "0.47658902", "text": "function createInitialheader(tree, section) {\n const newShow = document.createElement(\"li\"); // creates the list item\n newShow.className = \"shows__single-title-container\"; // adds a class to the list item\n // creates the labels\n const dateLabel = addsLabel(\"p\", \"shows__label\", \"DATE\");\n const venueLabel = addsLabel(\"p\", \"shows__label\", \"VENUE\");\n const locationLabel = addsLabel(\"p\", \"shows__label\", \"LOCATION\");\n //appends the labels to a list\n newShow.appendChild(dateLabel);\n newShow.appendChild(venueLabel);\n newShow.appendChild(locationLabel);\n //appends the list to the unordered list\n appendComment(section, newShow);\n // appends to the DOM\n appendComment(tree, section);\n }", "title": "" }, { "docid": "b736e5a1e987af4a0a6f0cc9794d3a15", "score": "0.47652486", "text": "function printResult(text, headerText) {\n var myHeader = document.createElement(\"h2\");\n var h = document.createTextNode(headerText);\n myHeader.appendChild(h);\n document.body.appendChild(myHeader);\n //headerText code above\n var myDiv = document.createElement(\"div\"); // Create a <div> element\n var t = document.createTextNode(text); // Create a text node\n myDiv.appendChild(t); // Append the text to <div>\n document.body.appendChild(myDiv);\n //div code above\n}", "title": "" }, { "docid": "b1250f10f3fc276dddbc9f0967fa826e", "score": "0.4751625", "text": "function header() {\n container.appendChild(tableEl);\n var tr1El = document.createElement('tr');\n tableEl.appendChild(tr1El);\n var th1El = document.createElement('th');\n tr1El.appendChild(th1El);\n for (var j = 0; j < arrayHours.length; j++) {\n var th1El = document.createElement('th');\n th1El.textContent = arrayHours[j];\n tr1El.appendChild(th1El);\n }\n var th1El = document.createElement('th');\n tr1El.appendChild(th1El);\n th1El.textContent = 'Total';\n}", "title": "" }, { "docid": "d0ef57c704934424c33be0d639c1d19b", "score": "0.47497153", "text": "function h3(text){\n var element = document.createElement(\"h3\");\n element.innerHTML = text;\n return element;\n}", "title": "" }, { "docid": "a6230a8e82ce4d50a0e824f8d4ec591d", "score": "0.47271505", "text": "function headerTemplate(title) {\n return html`<header>${title}</header>`;\n}", "title": "" }, { "docid": "41cf0aaf9e3eb0b7950d077b4596e9fa", "score": "0.47249326", "text": "function getHeading() {\r\n heading = document.createElement('div');\r\n heading.className = \"ctw-heading\"\r\n heading.id = \"ctw-heading\"\r\n heading.innerText = \"contributions this week\"\r\n return heading\r\n}", "title": "" }, { "docid": "abf0abf8982b4d98bbad492bd628fc36", "score": "0.47100374", "text": "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "title": "" }, { "docid": "abf0abf8982b4d98bbad492bd628fc36", "score": "0.47100374", "text": "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "title": "" }, { "docid": "081daeade055a8ea4154b724c2f77a5d", "score": "0.4708136", "text": "function header(){\n // dapatkan id hasilTabel\n var hasilTabel = document.getElementById(\"hasilTabel\");\n // Kosongkan\n hasilTabel.innerHTML = \"\";\n // Buat elemen tr dan th\n var trHeader = document.createElement(\"tr\"),\n thNama = document.createElement(\"th\"),\n thNim = document.createElement(\"th\"),\n thProdi = document.createElement(\"th\"),\n thEmail = document.createElement(\"th\");\n\n // Masukkan teks pada th lalu masukkan ke dalam tr\n thNama.textContent = \"Nama\";\n trHeader.appendChild(thNama);\n thNim.textContent = \"Nim\";\n trHeader.appendChild(thNim);\n thProdi.textContent = \"Prodi\";\n trHeader.appendChild(thProdi);\n thEmail.textContent = \"Email\";\n trHeader.appendChild(thEmail);\n\n // Masukkan tr ke dalam tabel\n hasilTabel.appendChild(trHeader);\n}", "title": "" }, { "docid": "c0191a17fefdccc81eae624fd20859a4", "score": "0.4705614", "text": "function headerResponse(id)\n{\n var idOfContent = \"content-\" + id; \n addHeaderClass(idOfContent);\n}", "title": "" }, { "docid": "771bff224960c0c7493038278dc0b922", "score": "0.47042963", "text": "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 6;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "title": "" }, { "docid": "f93d6affb161114b33a784b369fa239d", "score": "0.47011197", "text": "function textOnlyH2(line){\n var para = document.createElement(\"h2\");\n var text = document.createTextNode(line);\n para.appendChild(text);\n document.querySelector(\"body\").appendChild(para);\n}", "title": "" }, { "docid": "9a1447595f1dc1baa52daa39ced00fc0", "score": "0.46971306", "text": "function changeHeader () {\n\n document.querySelector('#value').innerHTML = value.toString()\n\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.4691788", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.4691788", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.4691788", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.4691788", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.4691788", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "229b2fef35d3fe7ef7ee703f5db609d9", "score": "0.4691788", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "06da99ba8d8d193a47b2352b84320d5a", "score": "0.46871895", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "9fda5395e8e63d5874294d79eb7694df", "score": "0.46842566", "text": "function adminUrenTotTableHeader() {\n var tableHeader = document.createElement(\"thead\");\n var tr = addHtmlElement(tableHeader, document.createElement(\"tr\"));\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Status\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Totaal\");\n //addHtmlElementContent(tr, document.createElement(\"th\"), \"Datum\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Gewerkt\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Over 100%\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Over 125%\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Verlof\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Wacht\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Ziekte\");\n return tableHeader;\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" }, { "docid": "6b5103bad191120066501cbbdd88a6e6", "score": "0.46826965", "text": "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "title": "" } ]
1421b38e658fba261f119b822f6e9c4c
Defining a function for toggling nav
[ { "docid": "ac135ba788d1969db71725a96ad4cda0", "score": "0.7160069", "text": "function toggleNav() {\n burger.classList.toggle(\"fa-bars\");\n burger.classList.toggle(\"fa-times\");\n nav.classList.toggle(\"nav-active\");\n}", "title": "" } ]
[ { "docid": "fa17041c77660928da08ceee69446841", "score": "0.84066725", "text": "function toggleNav() {\n if (nav_state === true) {\n closeNav();\n } else {\n openNav();\n }\n}", "title": "" }, { "docid": "77dc15c1d713ad1e2e4980b3ade1ffb4", "score": "0.7887025", "text": "function toggleNav2() {\n nav ? closeNav2() : openNav2();\n}", "title": "" }, { "docid": "f49389e1a1efa680c01b5c7ec844703a", "score": "0.7855841", "text": "function toggleNavigation() {\r\n if ($('#container').hasClass('display-nav')) {\r\n // Close Nav\r\n $('#container').removeClass('display-nav');\r\n } else {\r\n // Open Nav\r\n $('#container').addClass('display-nav');\r\n }\r\n}", "title": "" }, { "docid": "f3c4451f596d0dd06de5d36808392acb", "score": "0.77800864", "text": "function toggleNav() {\n $('body').toggleClass('on');\n }", "title": "" }, { "docid": "44df561d7b961e7a04aef50a54f1723b", "score": "0.77653146", "text": "function toggleNavHandler() {\n var sideBar = $(\"nav ul\");\n $(this).toggleClass('open');\n sideBar.toggleClass(\"opened\")\n }", "title": "" }, { "docid": "71eef28967c947e18c73c02cd3590270", "score": "0.76963323", "text": "function toggleNav() {\n\n if( $('body').hasClass('navigation-off-canvas') ){\n $('.header .toggle-navigation').click(function() {\n $('#outer-wrapper').toggleClass('show-nav');\n });\n $('#page-content').click(function() {\n $('#outer-wrapper').removeClass('show-nav');\n });\n }\n\n}", "title": "" }, { "docid": "34e318128bcd569589aed90fea505f2b", "score": "0.76902276", "text": "function toggleStatus() {\n toggleNavClass();\n toggleMenu();\n}", "title": "" }, { "docid": "151c72c372832822921daabb477f398b", "score": "0.76717496", "text": "function toggleNav() {\n var x = document.getElementById(\"nav-list\");\n if (x.style.display !== \"block\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "53d6a25c1a19095f1818b6118365317c", "score": "0.7670829", "text": "toggleNav() {\n // Change nav button and show nav when click in it\n this.nav.classList.toggle('expanded-nav');\n this.buttonsNavIcon.forEach(item => item.classList.toggle('icon-hidden'));\n this.buttonsNavIcon.forEach(item => item.classList.toggle('icon-visible'));\n }", "title": "" }, { "docid": "a5c14895431936cbe0859b39603a06e0", "score": "0.764378", "text": "function toggleNav(e) {\n if (e.target.className === \"fas fa-bars\") {\n expandNav();\n } else if (e.target.className === \"fas fa-times\") {\n collapseNav();\n }\n}", "title": "" }, { "docid": "95df17af11c99ca987da2453ea087d3f", "score": "0.7632408", "text": "function toggleNav() {\n if ( $('#nav').hasClass('on') ) {\n $('#m-nav .m-button .line:first-child').animate({width:'70%'}, 277);\n $('#nav').removeClass('on').animate({left:'100vw'}, 477);\n $('#m-nav').fadeIn();\n } else {\n $('#m-nav .m-button .line:first-child').animate({width:'100%'}, 277);\n $('#nav').addClass('on').animate({left:'0'}, 477);\n $('#m-nav').fadeOut();\n }\n}", "title": "" }, { "docid": "9ba0c24f4e4d99be8a479a55c3ad8203", "score": "0.7616925", "text": "function toggleNav() {\n // if nav is open, close it\n if ($(\"nav\").is(\":visible\")) {\n $(\"nav\").fadeOut();\n $(\"button\").removeClass(\"menu\");\n }\n // if nav is closed, open it\n else {\n $(\"button\").addClass(\"menu\");\n $(\"nav\").fadeIn().css(\"display\", \"flex\");\n }\n}", "title": "" }, { "docid": "791158f9cc24b46aabb16fd800ed9589", "score": "0.7552996", "text": "function navClick(){\r\n document.getElementById(\"navigation\");\r\n\r\n if(document.getElementById(\"navigation\").className == \"hide\" || document.getElementById(\"navigation\").className == \"navhide\"){\r\n document.getElementById(\"navigation\").className = \"show\";\r\n }\r\n else if(document.getElementById(\"navigation\").className == \"show\"){\r\n document.getElementById(\"navigation\").className = \"hide\";\r\n }\r\n}", "title": "" }, { "docid": "79eadc0aa015db03e08e47756419835c", "score": "0.75343776", "text": "function toggleMenu() {\n if (toggleStatus === 0) {\n openNav();\n } else if (toggleStatus === 1) {\n closeNav();\n console.log(\"Nav Closed\");\n }\n }", "title": "" }, { "docid": "852d7de90f0bab6f53bc07ebaed10ef9", "score": "0.7530219", "text": "function toggleNav() {\n\n nav.toggleClass(\"menu-closed menu-open\");\n navBtn.toggleClass(\"fa-bars fa-times\");\n\n}", "title": "" }, { "docid": "3a50053785cb64ca19348f8f6fe42d82", "score": "0.7471361", "text": "function toggleFunction() {\n var navDemo = document.getElementById(\"navDemo\");\n if (navDemo.className.indexOf(\"show\") == -1) {\n navDemo.className += \" show\";\n } else {\n navDemo.className = navDemo.className.replace(\" show\", \"\");\n }\n}", "title": "" }, { "docid": "47a6c3293b7aa9c74eaab13ce57f49bf", "score": "0.7463582", "text": "function toggleFunction() {\r\n var x = document.getElementById(\"navDemo\");\r\n if (x.className.indexOf(\"show\") == -1) {\r\n x.className += \" show\";\r\n } else {\r\n x.className = x.className.replace(\" show\", \"\");\r\n }\r\n}", "title": "" }, { "docid": "f9a0770af48e74ed7bc695851364ad9d", "score": "0.74570584", "text": "ToggleFunction() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") === -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n }", "title": "" }, { "docid": "b83fe92cd0f876a13ae34e9ba3b14aaf", "score": "0.7445781", "text": "toggleNav() {\n this.props.toggleNav();\n }", "title": "" }, { "docid": "7ffaf40c413f22c073e3e0309ac79680", "score": "0.74352664", "text": "toggleNav() {\n this.setState({\n isNavOpen: !this.state.isNavOpen\n });\n }", "title": "" }, { "docid": "22c8ab65808f3cab4c13a315035ae0a4", "score": "0.7422249", "text": "function toggleFunction() {\r\n var x = document.getElementById(\"nav\");\r\n if (x.className.indexOf(\"w3-show\") == -1) {\r\n x.className += \" w3-show\";\r\n } else {\r\n x.className = x.className.replace(\" w3-show\", \"\");\r\n }\r\n}", "title": "" }, { "docid": "a0f5ecf99703923db492003397a99953", "score": "0.7421269", "text": "function toggleNav() {\n if ($('#site-wrapper').hasClass('show-nav')) {\n // Do things on Nav Close\n $('#site-wrapper').removeClass('show-nav');\n } else {\n // Do things on Nav Open\n $('#site-wrapper').addClass('show-nav');\n }\n\n //$('#site-wrapper').toggleClass('show-nav');\n}", "title": "" }, { "docid": "7ba21197b47d0b510426c91afe1dfa02", "score": "0.74078727", "text": "function toggleNav() {\r\n\r\n\tconst navList = document.querySelector(\".navList\");\r\n\tnavList.classList.toggle(\"nav-active\");\r\n}", "title": "" }, { "docid": "35f9d07491d419f8592a5b080455ec91", "score": "0.73821235", "text": "function toggleFunction() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"oms-show\") === -1) {\n x.className += \" oms-show\";\n } else {\n x.className = x.className.replace(\" oms-show\", \"\");\n }\n}", "title": "" }, { "docid": "1f024fb4ca0c2822f84369cfe22c2a4f", "score": "0.73424345", "text": "toggleNav () {\n if (this._navBar.style.display === 'none') {\n this._navBar.style.display = 'block';\n } else {\n this._navBar.style.display = 'none';\n }\n }", "title": "" }, { "docid": "66e5837ed029617b7afd983c17d136f0", "score": "0.73423696", "text": "function toggleFunction() {\n let x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "e189ff63644629638eaee6fbf8f1ea76", "score": "0.7319756", "text": "function toggleExpandedNav() {\n $('#nav').toggleClass('expanded');\n}", "title": "" }, { "docid": "a3c194a09ee81456f96c97677d82ff1b", "score": "0.73031646", "text": "function toggleSlider() {\n if($nav.hasClass('nav-open')) {\n $nav.removeClass('nav-open');\n } else {\n $nav.addClass('nav-open');\n }\n}", "title": "" }, { "docid": "5235b36d5262753caceac83689c6153e", "score": "0.72992796", "text": "function toggleNavLinks() {\n $('.login-link').toggle();\n $('.signup-link').toggle();\n $('.logout-link').toggle();\n}", "title": "" }, { "docid": "94ac1e324e942c09bbac1f08751f5a2e", "score": "0.72970134", "text": "function toggleNavbar() {\n\n if (NavVisible) {\n\n $(\"#toggle_nav\").addClass(\"CA_hideNav\");\n $('#navToggle img').attr(\"src\", \"http://nickel-dime.com/OPENSRC/IMG/CA_nav-down.png\");\n\n NavVisible = false;\n\n } else {\n\n $(\"#toggle_nav\").removeClass(\"CA_hideNav\");\n $('#navToggle img').attr(\"src\", \"http://nickel-dime.com/OPENSRC/IMG/CA_nav-up.png\");\n\n NavVisible = true;\n }\n }", "title": "" }, { "docid": "d98b6d531ed2c38f003cd4f8494d152e", "score": "0.7292817", "text": "function toggleNav() {\n $(\"#l-generalContainer\").addClass('is-activated').toggleClass(\"is-nav-open\");\n $(\"body\").attr('data-animatedNav', 'true');\n setTimeout(function() {\n $(\"body\").attr('data-animatedNav', 'false');\n }, 600);\n }", "title": "" }, { "docid": "738f1936b474425c4e73e5f2e907ba31", "score": "0.72925925", "text": "function toggleFunction() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "738f1936b474425c4e73e5f2e907ba31", "score": "0.72925925", "text": "function toggleFunction() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "738f1936b474425c4e73e5f2e907ba31", "score": "0.72925925", "text": "function toggleFunction() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "738f1936b474425c4e73e5f2e907ba31", "score": "0.72925925", "text": "function toggleFunction() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "e500c3783416d4413c3128f64659d73e", "score": "0.7291138", "text": "function toggleNav() {\n let addBookMenu = retrieveDomElement(\"#add-book-menu\");\n let menuBtnIcon = retrieveDomElement(\"#menu-btn-icon\");\n let menuBtn = retrieveDomElement(\"#menu-btn\");\n if (addBookMenu.classList.contains(\"closed-menu\")) {\n addBookMenu.classList.remove(\"closed-menu\");\n sort.classList.remove(\"closed-menu\");\n menuBtnIcon.classList.remove(\"fa-angle-down\");\n menuBtnIcon.classList.add(\"fa-angle-up\");\n } else {\n addBookMenu.classList.add(\"closed-menu\");\n sort.classList.add(\"closed-menu\");\n menuBtnIcon.classList.remove(\"fa-angle-up\");\n menuBtnIcon.classList.add(\"fa-angle-down\");\n }\n}", "title": "" }, { "docid": "1dbc3a5eeb839b1a16e3fcb5fcbb6e3e", "score": "0.72872806", "text": "function toggleFunction() {\r\n let x = document.getElementById(\"navDemo\");\r\n if (x.className.indexOf(\"w3-show\") == -1) {\r\n x.className += \" w3-show\";\r\n } else {\r\n x.className = x.className.replace(\" w3-show\", \"\");\r\n }\r\n}", "title": "" }, { "docid": "0410b4dae9cc6dc363655954766af7a5", "score": "0.72734404", "text": "function navigationToggle() {\n\tconst nav = document.querySelector(\"nav\");\n\tconst menuItem = document.querySelectorAll(\".menu-item\");\n\n\tmenuItem.forEach(function (item) {\n\t\titem.addEventListener(\"click\", function () {\n\t\t\tconst menuToggle = document.querySelector(\".menu-toggle\");\n\t\t\tif (nav.classList.contains(\"is-open\")) {\n\t\t\t\tnav.classList.toggle(\"is-open\");\n\t\t\t\tmenuToggle.toggleAttribute(\"aria-expanded\");\n\t\t\t}\n\t\t});\n\t});\n}", "title": "" }, { "docid": "5d4d7b95136e09d4080c5f2eb9fc130c", "score": "0.7265002", "text": "function toggleFunction() {\r\n var x = document.getElementById(\"navDemo\");\r\n if (x.className.indexOf(\"w3-show\") == -1) {\r\n x.className += \" w3-show\";\r\n } else {\r\n x.className = x.className.replace(\" w3-show\", \"\");\r\n }\r\n}", "title": "" }, { "docid": "fd2c6495fbfd2a47ff316af824f02bc8", "score": "0.72390896", "text": "function openNav(){\n $('.sub-sidebar > ul.menu').toggle();\n}", "title": "" }, { "docid": "f83eaa81b28b75343b07675e6d38ca7d", "score": "0.72357595", "text": "function menu_button() {\r\n\tvar x = document.getElementsByClassName('nav_link');\r\n\tx[0].classList.toggle('active');\r\n\tx[1].classList.toggle('active');\r\n}", "title": "" }, { "docid": "579e31239877c612f25f2c7350b8f622", "score": "0.722747", "text": "function toggleNav(tog){\n\t\tvar tl = new TimelineLite();\n\t\tvar $ham = $('.ham');\n\t\tvar $nav = $('#myNav');\n\t\tif(tog){\n\t\t\tripple();\n\t\t\t$('.nav').css({'position':'fixed','right':'90px'});\n\t\t\ttl.to($nav, 0, {width:'100%',opacity:0})\n\t\t\t .to($nav, 0.3, {display:'block',opacity:1})\n\t\t\t .to($ham, 0.3, {color:'white'})\n\t\t}else{\n\t\t\t// $(body).css('overflow','hidden');\n\t\t\t$('.nav').css('position','inherit');\n\t\t\trippleOut();\n\t\t\ttl.to($nav, 0, {width:'100%',opacity:1})\n\t\t\t .to($nav, 0.3, {display:'none',opacity:0})\n\t\t\t .to($ham, 0.3, {color:'black'})\n\t\t}\n\t }", "title": "" }, { "docid": "762ecdd26372283dfc8a21404c7c6e37", "score": "0.7224251", "text": "showNav() {\n document.querySelector('.nav').classList.toggle('nav--show')\n }", "title": "" }, { "docid": "d745076f505c26d261a5729af5121b31", "score": "0.7218161", "text": "function toggleNavigation() {\n var windowsize = $window.width();\n if (windowsize > 767) {\n navigation.show();\n } else {\n navigation.hide();\n }\n }", "title": "" }, { "docid": "6d4fac50469685d2e41979dabad94a40", "score": "0.7179373", "text": "function toggleNavBar() {\n $('.Site_Container').toggleClass(\"nav-push-from-top\");\n $('.Nav_Container').toggleClass(\"translate-y-0\");\n \n toggleNavIcon();\n}", "title": "" }, { "docid": "67e02917f17dab8db3411b6563c15102", "score": "0.71402097", "text": "function showhidenav(){\n\t$(\".libnav\").slideToggle(500);\n}", "title": "" }, { "docid": "b144cf0048471e047f83a9ee939d3d1c", "score": "0.71364146", "text": "toggleNav(){\n this.setState({\n visible: !this.state.visible,\n })\n }", "title": "" }, { "docid": "832fd61da02fdf514bafe8919200c04e", "score": "0.71139", "text": "function navBarToggle() {\n // var toggleMenu = document.getElementById('toggleMenu');\n var navBarFormat = document.getElementById(\"navBarFormat\");\n if (navBarFormat.style.display === \"none\") {\n navBarFormat.style.display = \"block\";\n } else {\n navBarFormat.style.display = \"none\";\n }\n}", "title": "" }, { "docid": "57a888e08087e8f2e76484eac88d7de4", "score": "0.7110653", "text": "function toggleFunction() {\n var x = document.getElementById(\"mobileNav\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "798cbc50d07df56c64c1ad31f81b8e8c", "score": "0.71039367", "text": "function menu (){\n\t\t$('header nav ul').toggleClass('toggleHamburger');\n\t}", "title": "" }, { "docid": "02b373f7f843687bb9b15381f826f9b1", "score": "0.708928", "text": "function toggleBurgerListener() {\n \n $('#nav_toggle').on('click', function (event) {\n event.preventDefault();\n \n $(this).toggleClass('active');\n $('#nav').toggleClass('active');\n \n });\n}", "title": "" }, { "docid": "e43d3c97dc1a52cb912fe8152cf61117", "score": "0.70782316", "text": "function toggleNavMenu() {\n const navMenu = document.querySelector('nav ul');\n navMenu.classList.toggle('show');\n}", "title": "" }, { "docid": "a602eed400208f03ce952907c40439d9", "score": "0.707114", "text": "function slideNav() {\n // slide nav bar\n $('nav').toggleClass('slide');\n // switch from 3 lines to cross\n $('.burger').toggleClass('cross');\n}", "title": "" }, { "docid": "79f4c98200e84686ea844d0fdd1296a7", "score": "0.70708406", "text": "function openNav() {\n document.getElementById(\"myNav\").style.display = \"block\";\n document.getElementsByClassName(\"menu-toggle\")[0].style.display = \"none\";\n navOpen = true;\n}", "title": "" }, { "docid": "8931ead34a344b27d0fd8df6735ac7f1", "score": "0.7070015", "text": "toggleSideNav() {\n this.navService.setShowNav(true);\n }", "title": "" }, { "docid": "f441113c0f5efa69f234267cd102574f", "score": "0.7063499", "text": "function navHandler() {\n var isActive = null;\n const burger = document.getElementById(\"hamburger\");\n for (var i = 0; i < burger.classList.length; i++) {\n if (burger.classList[i] === \"is-active\") {\n isActive = true\n } else {\n isActive = false\n }\n }\n if (!isActive) {\n document.getElementById(\"drawer\").className = \"open\"\n burger.classList.add(\"is-active\")\n } else {\n document.getElementById(\"drawer\").className = \"closed\"\n burger.classList.remove(\"is-active\")\n }\n drawerLinkLooper();\n}", "title": "" }, { "docid": "abcc26f5652be74a73cf9a05b1731440", "score": "0.70606357", "text": "function toggleNav() {\n let navList = document.getElementById('nav-list');\n navList.classList.toggle('expanded');\n\n //Toggle Hamburger button/close button\n let btnMenu = document.getElementById('menu-btn');\n\n if (navList.classList.contains('expanded')) {\n btnMenu.innerHTML = \"&times;\";\n }\n else {\n btnMenu.innerHTML = \"&#9776;\";\n }\n}", "title": "" }, { "docid": "f9d477e60f821744a5f23942c5c3b266", "score": "0.7056976", "text": "function navSelector() {\r\n\tvar y = document.getElementById(\"menu\");\r\n\tvar x = document.getElementById(\"menutoggle\");\r\n\tif (x.classList.contains(\"visible\")) {\r\n\t\tif (y.style.display === \"block\") { y.style.display = \"none\"; x.classList.toggle(\"change\"); }\r\n\t\telse { y.style.display = \"block\"; x.classList.toggle(\"change\"); } } }", "title": "" }, { "docid": "7654b3005c19ac78ee9053277c80194d", "score": "0.70403945", "text": "function toggleNav() {\r\n if (window.innerWidth >= 768) {\r\n document.getElementById(\"nav-toggler\").classList.remove(\"nav-toggler-position-visible\");\r\n document.getElementById(\"nav-toggler\").classList.add(\"nav-toggler-position-hidden\");\r\n\r\n document.getElementById(\"navResponsive\").classList.remove(\"nav-list-wide-hidden\");\r\n document.getElementById(\"navResponsive\").classList.add(\"nav-list-wide-visible\");\r\n\r\n document.getElementById(\"navResponsive\").classList.remove(\"nav-list-expanding-hidden\");\r\n document.getElementById(\"navResponsive\").classList.remove(\"nav-list-expanding-visible\");\r\n } else {\r\n document.getElementById(\"nav-toggler\").classList.remove(\"nav-toggler-position-hidden\");\r\n document.getElementById(\"nav-toggler\").classList.add(\"nav-toggler-position-visible\");\r\n\r\n document.getElementById(\"navResponsive\").classList.remove(\"nav-list-wide-visible\");\r\n document.getElementById(\"navResponsive\").classList.add(\"nav-list-wide-hidden\");\r\n\r\n document.getElementById(\"navResponsive\").classList.add(\"nav-list-expanding-hidden\");\r\n }\r\n}", "title": "" }, { "docid": "5a2a141f0ae1c86b7874f8716f2e14ed", "score": "0.70155835", "text": "function toggleNavBar() {\n $mdSidenav('left').toggle();\n }", "title": "" }, { "docid": "ec6f323c8715ad08502cd30a4674dac8", "score": "0.70079917", "text": "function openNav() {\n open();\n wt();\n}", "title": "" }, { "docid": "a5cfacacbe72bdb4ef64ad5e8e5ad016", "score": "0.69952106", "text": "function toggleNavigationBar(indexNavigationBar)\n{\nvar NavToggle = document.getElementById(\"NavToggle\" + indexNavigationBar);\nvar NavFrame = document.getElementById(\"NavFrame\" + indexNavigationBar);\n \nif (!NavFrame || !NavToggle) {\nreturn false;\n}\n \n// if shown now\nif (NavToggle.firstChild.data == NavigationBarHide) {\nfor (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {\nif ( hasClass( NavChild, 'NavPic' ) ) {\nNavChild.style.display = 'none';\n}\nif ( hasClass( NavChild, 'NavContent') ) {\nNavChild.style.display = 'none';\n}\n}\nNavToggle.firstChild.data = NavigationBarShow;\n \n// if hidden now\n} else if (NavToggle.firstChild.data == NavigationBarShow) {\nfor (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {\nif (hasClass(NavChild, 'NavPic')) {\nNavChild.style.display = 'block';\n}\nif (hasClass(NavChild, 'NavContent')) {\nNavChild.style.display = 'block';\n}\n}\nNavToggle.firstChild.data = NavigationBarHide;\n}\n}", "title": "" }, { "docid": "0dbfb9a0afd887525e1c5cb0d2c4b0cb", "score": "0.6979022", "text": "function showClicked(navElement) {\n console.log(navElement);\n\n if (navElement == 'portfolio') {\n hideAll();\n showPortfolio();\n } else if (navElement == 'bio') {\n hideAll();\n showBio();\n } else if (navElement == 'contact') {\n hideAll();\n showContact();\n } else if (navElement == 'social') {\n hideAll();\n showSocial();\n } else if (navElement == 'home') {\n hideAll();\n showShowcase();\n } else { }\n}", "title": "" }, { "docid": "c660a9d00e60306492365557e02718d3", "score": "0.6978501", "text": "function toggleNav(){\r\n $('#navbar').fadeToggle(700);\r\n}", "title": "" }, { "docid": "0e8fcd6c063ab680a75373802efc7634", "score": "0.69707376", "text": "function setNavClick() {\n $(\".nav-btn\").click(function() {\n navClick($(this).data(\"page\"));\n });\n }", "title": "" }, { "docid": "dc93bba21df5a06234126f17827a9bcf", "score": "0.69700426", "text": "function mainNav() {\n let fullpageNavbar = document.querySelector(\".fullpage-navbar\");\n fullpageNavbar.classList.toggle(\"show-fullpage-navbar\");\n}", "title": "" }, { "docid": "1bff8f3d5f90d8c61e15530e57a8772e", "score": "0.6969529", "text": "function toggleMenu() {\n if ( $('.navbar').offset().top > 50 ) {\n !$nav.hasClass(cssClass) && $nav.addClass(cssClass);\n } else {\n $nav.hasClass(cssClass) && $nav.removeClass(cssClass);\n }\n }", "title": "" }, { "docid": "5f240c360f6070c2b59f31a87a251b57", "score": "0.69648", "text": "function toggleNav(wrap) {\r\n if (wrap.classList.contains(\"nav-menu__screen--show\")) {\r\n wrap.classList.remove(\"nav-menu__screen--show\");\r\n document.body.classList.remove(\"body__no-scroll\");\r\n } else {\r\n wrap.classList.add(\"nav-menu__screen--show\");\r\n document.body.classList.add(\"body__no-scroll\");\r\n }\r\n }", "title": "" }, { "docid": "960da62395685ac61610221a7629f6ad", "score": "0.69626576", "text": "function toggleNav() {\n let taskLinks = document.body.querySelectorAll(\".task-nav-link\");\n for (let i = 0; i < taskLinks.length; i++) {\n if (taskLinks[i].style.display === \"none\") {\n taskLinks[i].style.display = \"block\";\n } else {\n taskLinks[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "ddb04c0c7f67edba18d7681e29ccfc26", "score": "0.69571453", "text": "function showNav() {\r\n\t\r\n\tconst burger = document.querySelector(\".burger\");\r\n\tburger.addEventListener(\"click\", toggleNav);\r\n}", "title": "" }, { "docid": "cb86b7e0ca7618b613ee9494de4fb67d", "score": "0.6954673", "text": "function toggleMenu() {\n $('nav ul').slideToggle();\n\n}", "title": "" }, { "docid": "0a78082f633b4c9cd831a2a52baf896a", "score": "0.69534445", "text": "function toggleMenu() {\n let toggle = document.querySelector('.toggle');\n let navigation = document.querySelector('.navigation');\n let main = document.querySelector('.main');\n toggle.classList.toggle('active');\n navigation.classList.toggle('active');\n main.classList.toggle('active');\n}", "title": "" }, { "docid": "cea93c45c8325e0897b8953a73c58e1f", "score": "0.692727", "text": "function openNav() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else { \n x.className = x.className.replace(\" w3-show\", \"\");\n }\n }", "title": "" }, { "docid": "f779c8d90283e6f05243c6fba67bf516", "score": "0.69137806", "text": "function nav(){\n\tconst container = document.getElementsByClassName(\"HeaderAndAside\")[0];\n\tconst nav = document.getElementsByTagName(\"nav\")[0];\n\tconst bars = document.getElementsByClassName(\"Nav-Icon\")[0];\n\tvar sideNavContent = document.getElementById(\"sideNavContent\");\n\t\n\tif (nav.style.display == \"block\"){\n\t\tif(sideNavContent.style.display == \"none\"){\n\t\t\tcontainer.style.zIndex = 0;\t\n\t\t}\n\t\tnav.style.display = \"none\";\n\t\tbars.style.color = \"#A0A0A0\";\n\t} else {\n\t\tcontainer.style.zIndex = 2;\n\t\tnav.style.display = \"block\";\n\t\tbars.style.color = \"#2B82D9\";\n\t}\n}", "title": "" }, { "docid": "b5d412b9f7811caf19306883d097c778", "score": "0.6902972", "text": "function navToggle(){\n\t\t\tvar $body = $(\"body\");\n\t\t\tvar $header = $(\".header\");\n\t\t\tvar $overlay = \"<div class='nav-overlay'></div>\";\n\t\t\t$(\".nav-toggle\").on(\"click\", function(){\n\t\t\t\ttoggleCtrl();\n\t\t\t});\n\t\t\t$(\".nav-close-toggle\").on(\"click\", function(){\n\t\t\t\ttoggleCtrl();\n\t\t\t});\n\t\t\t$(\".header-nav-container\").swipeRight(function(){\n\t\t\t\ttoggleCtrl();\n\t\t\t});\n\t\t\t$(document).on('click','.nav-overlay', function(){\n\t\t\t\ttoggleCtrl();\n\t\t\t});\n\t\t\twindow.addEventListener(\"hashchange\", function(){\n\t\t\t\ttoggleCtrl();\n\t\t\t}, false);\n\t\t\tfunction toggleCtrl(){\n\t\t\t\tif(!$body.hasClass(\"nav-active\")){\n\t\t\t\t\t$header.append($overlay); \n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t$body.addClass(\"nav-active\");\n\t\t\t\t\t},20);\n\t\t\t\t} else {\n\t\t\t\t\t$body.removeClass(\"nav-active\");\n\t\t\t\t\t// closing all navs\n\t\t\t\t\t$(\".header-main-nav .sub-active\").children(\"ul\").stop().slideUp(slidetime);\n\t\t\t\t\t$(\".header-main-nav .sub-active\").removeClass(\"sub-active\");\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t$(\".nav-overlay\").remove();\n\t\t\t\t\t},300);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "26155ea793fd93f90ccace6c7ec32e72", "score": "0.6897413", "text": "function toggleNavMenu() {\n\tif(navMenuOpen) {\n\t\tdocument.getElementById(\"sideNav\").style.width = \"0\";\n\t\tdocument.getElementById(\"main\").style.marginLeft = \"0\";\n\t\n\t\tnavMenuOpen = false;\n\t} else {\n\t\tdocument.getElementById(\"sideNav\").style.width = \"250px\";\n\t\tdocument.getElementById(\"main\").style.marginLeft = \"250px\";\n\t\t\n\t\tnavMenuOpen = true;\n\t}\n}", "title": "" }, { "docid": "42579ab884b11c80490528c45a9bd8fa", "score": "0.68965226", "text": "function klikmenu(){\r\n nav.classList.toggle('show');\r\n hamburger.classList.toggle('rotate');\r\n}", "title": "" }, { "docid": "30f751d3f967fb043e6838f152eb6c49", "score": "0.6896044", "text": "function toggleMainMenu() {\n var bodyElem = document.querySelector('body');\n var navBtn = bodyElem.querySelector('.sidebar-nav-btn');\n\n if (navBtn) {\n navBtn.onclick = function () {\n bodyElem.classList.toggle('nav-open');\n };\n }\n} // Выполнить после загрузки страницы", "title": "" }, { "docid": "2f74fd889120a2a5f9a6f6842f284b3a", "score": "0.688555", "text": "function openNav(classChange) {\n clickCounter++;\n classChange.classList.toggle(\"change\");\n if (clickCounter === 1) {\n sideNav.style.width = \"250px\";\n clickCounter = 1;\n }\n else {\n sideNav.style.width = \"0\";\n clickCounter = 0;\n }\n\n}", "title": "" }, { "docid": "8ed0a6338256dba93f7627f30e35919b", "score": "0.6884902", "text": "function setNav() {\n\t\tvar $anchorLinks = jQuery('#mobilenav').find('a');\n\t\t$anchorLinks.click(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar $this = jQuery(this),\n\t\t\t\tthisHref = $this.attr('href');\n\t\t\tjQuery('.reveal').hide();\n\t\t\tif($this.hasClass('active')) {\n\t\t\t\t$this.removeClass('active');\n\t\t\t\tjQuery(thisHref).hide();\n\t\t\t} else {\n\t\t\t\t$anchorLinks.removeClass('active');\n\t\t\t\t$this.addClass('active');\n\t\t\t\tjQuery(thisHref).show();\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "deb88eb0376a9319f975d894db1ec197", "score": "0.6876309", "text": "function collapsible_navigation()\n{\n\t$('div.NavFrame').each( function() {\n\t\tvar\t$that = $(this), css_width = $that.css( 'width' ), attr_width = $that.attr( 'width' ),\n\t\t\twhich = $that.hasClass( 'selected' ) ? NavigationBarShow : NavigationBarHide;\n \n\t\tif ( (!css_width || css_width === 'auto') && (!attr_width || attr_width === 'auto') ) {\n\t\t\t$that.css( 'width', $that.width() );\n\t\t}\n \n\t\t$that.children('.NavHead').each( function() {\n\t\t\t$(this).append( '<a class=\"NavToggle\">' + which + '</a>' ).click( function() {\n\t\t\t\tvar which = $that.toggleClass('selected').hasClass( 'selected' ), $this = $(this);\n \n\t\t\t\t$this.find( '.NavToggle' ).text( which ? NavigationBarShow : NavigationBarHide );\n \n\t\t\t\tif ( which ) {\n\t\t\t\t\t$this.attr( 'title', NavigationTitleShow )\n\t\t\t\t\t\t.siblings( ':not(.NavHead)' ).stop( true, true ).fadeOut();\n\t\t\t\t} else {\n\t\t\t\t\t$this.attr( 'title', NavigationTitleHide )\n\t\t\t\t\t\t.siblings( ':not(.NavHead)' ).stop( true, true ).fadeIn();\n\t\t\t\t}\n\t\t\t}).click();\n\t\t});\n\t});\n}", "title": "" }, { "docid": "8993ac963e3b908f258cb6c45babcb0f", "score": "0.6869638", "text": "function nav() {\n\n\n\t// DISPLAY NAV\n\n\n\t// Where to trigger nav hiding\n\n\tvar posTrigger ;\n\tvar childNumber = $('.main').children().length;\n\tif ( childNumber == 1 ) {\n\t\tposTrigger = '400';\n\t} else {\n\t\tvar firstChild = $( $('.main').children().eq(0) );\n\t\tif ( firstChild.is('article') ) {\n\t\t\tposTrigger = firstChild.children().eq(1).offset().top-$('.navBar').height();\n\t\t} else {\n\t\t\tposTrigger = $('.main').children().eq(1).offset().top-$('.navBar').height();\n\t\t}\n\t} \n\t(posTrigger<=0) ? posTrigger = '400' : '';\n\n\n\t// Listen to scroll\n\n\t$(document).bind('mousewheel', monitorScroll);\n\n\tfunction monitorScroll(event) {\n\t\tvar documentOffset = $(window).scrollTop();\n\t if ( event.deltaY < 0 && documentOffset > posTrigger ) { // if scroll down\n \t\t$('.navBar').addClass('is-out');\n \t\tsetTimeout(function(){\n \t\t\t$('.nav').addClass('is-compact')\n \t\t}, 400);\n\t } else if (event.deltaY > 0) { // if scroll up\n\t \tif( $('.navBar').hasClass('is-out') ) {\n\t \t\t$('.navBar').removeClass('is-out');\n\t \t}\n\t \tif( documentOffset < 10 && $('.nav').hasClass('is-compact') ) {\n\t \t\t$('.nav').removeClass('is-compact');\n\t \t}\n\t }\n\t}\n\n\n\t// MAIN NAV\n\n\t$('.js-open-nav').on('click', function(e){\n\t\t$('.nav').toggleClass('is-open');\n\t\t$(this).toggleClass('icon2');\n\n\t\tif (!$('.nav').hasClass('is-open')) {\n\t\t\t$('.js-close-subnav').removeClass('is-visible');\n\t\t\t$('.c-navList.is-open').removeClass('is-open');\n\t\t}\n\t})\n\n\t$('.js-mute-main').hover(\n\t\tfunction() {\n\t\t\t$('.main').addClass('is-overlayed');\n\t\t},\n\t\tfunction() {\n\t\t\t$('.main').removeClass('is-overlayed');\n\t\t}\n\t)\n\n\n\t// SUBNAV\n\n\t$('.js-open-subnav').on('click', function(e){\n\t\te.preventDefault();\n\n\t\tif (windowW < 960) {\n\t\t\t$('.js-close-subnav').addClass('is-visible');\n\t\t\t$('.c-navList.is-front').removeClass('is-front');\n\t\t\t$(this).next().toggleClass('is-open is-front');\n\t\t}\n\t})\n\n\t$('.js-close-subnav').on('click', function(e){\n\t\t$('.c-navList.is-front').removeClass('is-open is-front');\n\t\t$('.c-navList.is-open').addClass('is-front');\n\n\t\tif ($('.c-navList.is-open').length == 0) {\n\t\t\t$('.js-close-subnav').removeClass('is-visible');\n\t\t}\n\t})\n\n\n\t// LOGOUT\n\n\t$('.js-tips-logout').hover(\n\t\tfunction() {\n\t\t\t$('.btn-profil').addClass('bg-error is-collapsed').data('title', $('.btn-profil').html()).html('A bientôt !')\n\t\t},\n\t\tfunction() {\n\t\t\t$('.btn-profil').removeClass('bg-error is-collapsed').html($('.btn-profil').data('title')).removeData();\n\t\t}\n\t)\n\n\n\t// SEARCH\n\n\t$('.js-open-search').on('click', function(){\n\t\topenSearch();\n\t\t$('.footer').removeClass('is-out');\n\t})\n\n\t$('.js-force-search').on('click', function(){\n\t\t$('.footer').toggleClass('is-out');\n\t\topenSearch();\n\t})\n\n\tfunction openSearch() {\n\t\t$('.js-open-search').toggleClass('icon2 c-btn--ghost');\n\t\t$('#search').toggleClass('is-open');\n\t\t$('#search-input').focus();\n\t}\n}", "title": "" }, { "docid": "1573d67c3ec476a9a7a5d6e751ca39d9", "score": "0.68668884", "text": "function openNav() {\n\t$('#mySidenav.sidenav').addClass('screenAdjust');\n\t$('#main').addClass('screenAdjust');\n $('.js-closed-nav').addClass('hidden');\n $('.js-nav-components').removeClass('hidden');\n}", "title": "" }, { "docid": "4ea95c21d1b3ecaf868653da666a072b", "score": "0.68660223", "text": "toggleNav() {\n this.setState({\n //the value will be in Negation, if it is false it will be true and if the value is true it will become false\n isNavOpen: !this.state.isNavOpen\n });\n }", "title": "" }, { "docid": "753c010d6ab77d7d7bac3b5c3ec98e99", "score": "0.68636554", "text": "function makeNavToggler(wrap) {\r\n // toggleNav :: HTMLElement -> void\r\n function toggleNav(wrap) {\r\n if (wrap.classList.contains(\"nav-menu__screen--show\")) {\r\n wrap.classList.remove(\"nav-menu__screen--show\");\r\n document.body.classList.remove(\"body__no-scroll\");\r\n } else {\r\n wrap.classList.add(\"nav-menu__screen--show\");\r\n document.body.classList.add(\"body__no-scroll\");\r\n }\r\n }\r\n\r\n return function() {\r\n toggleNav(wrap);\r\n };\r\n }", "title": "" }, { "docid": "1e6ad0f30331dfbbdac4c797d3aa8bf1", "score": "0.6858124", "text": "function MobileShow(){\r\n Mob_Menu = document.getElementById('mob-menu');\r\n nav = document.getElementById('Mobile-Icon');\r\n \r\n Mob_Menu.addEventListener('click',()=>{\r\n \r\n nav.ClassList.toggle('.nav-active')\r\n \r\n})\r\n}", "title": "" }, { "docid": "9628164a61af8b7a2cd02c0551a98a9d", "score": "0.6841853", "text": "function slideNavbar() {\n\n if (NavVisible) {\n\n sideNav.css(\"width\", \"55px\");\n sideNav.removeClass(\"slideNavRight\");\n sideNav.addClass(\"slideNavLeft\");\n\n $('#navToggle img').attr(\"src\", \"http://nickel-dime.com/OPENSRC/IMG/CA_nav-down.png\");\n\n $(\".navHighlight\").show(600);\n\n NavVisible = false;\n\n } else {\n\n sideNav.css(\"width\", \"50px\");\n sideNav.removeClass(\"slideNavLeft\");\n sideNav.addClass(\"slideNavRight\");\n\n $('#navToggle img').attr(\"src\", \"../assets/images/togglenav.png\");\n\n $(\".navHighlight\").hide(0);\n\n NavVisible = true;\n }\n }", "title": "" }, { "docid": "a74476d8742b85c5e673665fcb4f2db7", "score": "0.6841686", "text": "function togglemenu() {\r\n let x = document.getElementById(\"navBar\");\r\n if (x.style.display === \"block\") {\r\n x.style.display = \"none\";\r\n } else {\r\n x.style.display = \"block\";\r\n }\r\n}", "title": "" }, { "docid": "c6d700b7a3777b0538f22168f11a6d11", "score": "0.68377215", "text": "function navInteraction(){\n console.log(\"navInteraction() working!\");\n //Show or Hide navigation\n $(\"#showNav\").click(function(){\n $(\"#showNav\").hide();\n $(\"#hideNav\").show();\n $(\"#navigation\").slideDown(\"slow\");\n });//show nav click event end\n \n $(\"#hideNav\").click(function(){\n $(\"#showNav\").show();\n $(\"#hideNav\").hide();\n $(\"#navigation\").slideUp(\"slow\");\n });//hide nav click event end\n\n /*--------------------------------------*/\n // when click logo, refresh page -> go back to home page\n $(\"#logo\").click(function(){\n location.reload();\n });//click End\n}", "title": "" }, { "docid": "ab59497607b653962c888c615135ed97", "score": "0.683543", "text": "function toggleNavMenu(idOfMenu, idOfSpan, iconClass, hideThis1, hideThis2, hide1class, hide2class, idOfSpan2Hide1, idOfSpan2Hide2){\n if ($(idOfMenu).css('display') == 'none'){\n $(hideThis1).hide('slide',500);\n $(hideThis2).hide('slide',500);\n $(idOfSpan2Hide1+' .ion').removeClass('ion-ios-close-empty').addClass(hide1class);\n $(idOfSpan2Hide2+' .ion').removeClass('ion-ios-close-empty').addClass(hide2class);\n $(idOfSpan2Hide1+','+ idOfSpan2Hide2).css('background-color','').css('color','').addClass('outer');\n \n \n $(idOfMenu).show('slide', 500);\n $(\".nav-text\").animate({\n width: 0\n },500);\n $(\"#open-menu\").removeClass('ion-ios-close-empty').addClass('ion-navicon');\n $(idOfSpan).css({'background-color':'rgb(20, 29, 40)','color':'rgb(227, 27, 109)'});\n $(idOfSpan +' .ion').removeClass(iconClass).addClass('ion-ios-close-empty');\n }\n else {\n $(idOfMenu).hide('slide', 500);\n $(\".nav-text\").animate({\n width: 0\n },500);\n $(\"#open-menu\").removeClass('ion-ios-close-empty').addClass('ion-navicon');\n $(idOfSpan).css('background-color','').css('color','').addClass('outer');\n $(idOfSpan +' .ion').removeClass('ion-ios-close-empty').addClass(iconClass);\n }\n}", "title": "" }, { "docid": "2fc61008cd0bb3383c7b1e59a346aefb", "score": "0.6815403", "text": "function showNav() {\n $(\"#topbar-contents-mobile-navs-wrapper \").removeClass(\"mobile-nav-hide\");\n $(\"#topbar-contents-mobile-navs-wrapper \").removeClass(\"mobile-nav-close\");\n $(\"#topbar-contents-mobile-navs-wrapper \").addClass(\"mobile-nav-show\");\n}", "title": "" }, { "docid": "a08dd30d1f80e59036b9e212be782a00", "score": "0.6803989", "text": "function toggleHamburger() {\n navbar.classList.toggle('display')\n ham.classList.toggle('active')\n}", "title": "" }, { "docid": "885608861fef1a89a293e3f47cfdf99a", "score": "0.67978865", "text": "function insideMenuFunction() {\n document.getElementById(\"mobile_hide\").classList.toggle(\"show_about\");\n}", "title": "" }, { "docid": "f03f0a0db35107020f63a9b53fbf3601", "score": "0.6794134", "text": "function slideNav() {\n const burger = document.querySelector('.burger');\n const nav = document.getElementById('nav__list');\n\n burger.addEventListener('click', () => {\n nav.classList.toggle('active-nav');\n })\n}", "title": "" }, { "docid": "f55442b12e4c9807e134f9bba9589248", "score": "0.6790533", "text": "function openNav() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className += \" w3-show\";\n } else {\n x.className = x.className.replace(\" w3-show\", \"\");\n }\n}", "title": "" }, { "docid": "b205917d5ea2074837bfba3efbd36976", "score": "0.6790183", "text": "function showMobileNavigation(){\n $(\".pf-mobile-navigation-trigger\").on('click',function(){\n \n if($(\"#pf-header\").hasClass(\"pf-header-hide\")){\n $(this).find(\"span\").first().addClass(\"is-clicked\");\n $(\"#pf-header\").switchClass(\"pf-header-hide\",\"pf-header-show\");\n\n }\n else{\n $(this).find(\"span\").first().removeClass(\"is-clicked\");\n $(\"#pf-header\").switchClass(\"pf-header-show\",\"pf-header-hide\");\n }\n \n });\n}", "title": "" }, { "docid": "066a6345afbb5dfba43c159b485140c1", "score": "0.6783008", "text": "function toggle(id) {\r\n // Hauptnavigation holen\r\n var e = document.getElementById(id);\r\n // brotkrumenNavi holen\r\n var brot = document.getElementById('brotkrumenNavi');\r\n if (e.style.display == '') {\r\n e.style.display = 'block';\r\n brot.style.display = 'none';\r\n } else {\r\n e.style.display = '';\r\n brot.style.display = 'block';\r\n }\r\n}", "title": "" }, { "docid": "c6440ebaeb57af62c4520310363e18ef", "score": "0.67733955", "text": "function changeNav() {\n if (window.scrollY > nav.offsetHeight + 150) {\n links.forEach((link) => link.classList.remove('current'));\n nav.classList.add('active');\n links[2].classList.add('current');\n } else {\n links.forEach((link) => link.classList.remove('current'));\n nav.classList.remove('active');\n links[1].classList.add('current');\n }\n}", "title": "" }, { "docid": "72043e8c7cd08535c2c60bcd23b4d365", "score": "0.6770198", "text": "toggleNavMenu(force = false) {\n this.navMenuIsActive = force || !this.navMenuIsActive;\n }", "title": "" }, { "docid": "c59fe4f8252d56df6889307042d4b709", "score": "0.67695266", "text": "function openNav() {\n\t\n\tvar html=\"\";\n\n\n\tStore.treeIterate(function(node){\n\t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\" data-cell=\"'+node.cell+'\">'+node.title+'</li>';\t\t\n\t});\n\t\n\t// Store.iterate(function(index,row){\n\t// \tvar value=row[\"id\"];\n\t//\n\t// \tif (value){\n\t// \t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\">Article '+index+'</li>';\n\t// \t\t// html+=\"<button class='btn btn-default'> Article \"+value+\". </button>\";\n\t// \t}\n\t// });\n\n\tvar el=$(\"#mySidenav\");\n\tel.html('<ul class=\"list-group\">'+\n\t\t\thtml+\n\t\t\t'</ul>');\n\t\n\tel.css(\"width\",\"200px\");\n\t\n document.getElementById(\"main\").style.marginLeft = \"200px\";\n}", "title": "" } ]
46ee0167c7e8c6657bc7c0d1a60954e6
Get all cultivation result data
[ { "docid": "07c6c2912f4fb15c4f9ef8d83054dff6", "score": "0.73452926", "text": "function getAllCultivationResultData() {\n\t\t// make Ajax call to server to get data\n\t\t$.ajax({\n\t\t\turl: \"getCultivationResultData\",\n\t\t\tdata: { \"farmId\": farmIdGlobal, \"areaId\": selectedAreaIdGlobal, \"kindId\": selectedKindIdGlobal },\n\t\t\ttype: \"POST\",\n\t\t\tasync: false,\n\t\t\tsuccess: function(returnedJsonData) {\n\t\t\t\tif (checkSessionTimeout(returnedJsonData) == 1) return;\n\t\t\t\t// store data in global variable\n\t\t\t\tcultivationResultData = returnedJsonData;\n\t\t\t\tif (cultivationResultData.length == 0) {\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\turl: \"getLastUpdateDateProduct\",\n\t\t\t\t\t\tdata: { \"farmId\": farmIdGlobal, \"areaId\": selectedAreaIdGlobal },\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\tsuccess: function(returnedJsonData) {\n\t\t\t\t\t\t\tif (checkSessionTimeout(returnedJsonData) == 1) return;\n\t\t\t\t\t\t\tlastUpdateDateGlobal = returnedJsonData;\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror: function(e) {\n\t\t\t\t\t\t\t// display error message\n\t\t\t\t\t\t\tjWarning(ERROR_MESSAGE.replace('$1', ERROR_MESSAGE_EXCEPTION_CLIENT), DIALOG_TITLE, DIALOG_OK_BUTTON);\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\terror: function(e) {\n\t\t\t\t// display error message\n\t\t\t\tjWarning(ERROR_MESSAGE.replace('$1', ERROR_MESSAGE_EXCEPTION_CLIENT), DIALOG_TITLE, DIALOG_OK_BUTTON);\n\t\t\t}\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "b16e2bae857e7d3855cf5c25f409b1d2", "score": "0.66934454", "text": "function getResults() {\n Traitify.get(\"/assessments/\" + assessmentId + \"?data=blend,types,traits\").then(function(res) {\n console.log(res);\n traitify = Traitify.ui.load(\"results\", assessmentId, \".traitify-widget\");\n traitify = Traitify.ui.load(\"personalityTypes\", assessmentId, \".traitify-widget\");\n traitify = Traitify.ui.load(\"personalityTraits\", assessmentId, \".traitify-widget\");\n });\n }", "title": "" }, { "docid": "a973ce59d7e5827763520242d056fff1", "score": "0.6464016", "text": "function all(){\n return data;\n }", "title": "" }, { "docid": "66165cc42ea9e4251cb52cf913b5c9d5", "score": "0.63828427", "text": "async getAllCData() {\n\n const response = await fetch(this.allCountryData);\n const data = await response.json();\n return data;\n }", "title": "" }, { "docid": "f16f1d06ea1f1df9c860bb0e5a9fb325", "score": "0.6373622", "text": "async getResults() {\n try {\n const res = await axios(`${proxy}${apiurl}categories`);\n this.result = res.data;\n } catch (error) {\n alert(error);\n }\n }", "title": "" }, { "docid": "b6cac57a25d06d579b08b7974eb1f1bc", "score": "0.63457364", "text": "getAllData() {\n\t\t\tconst { size } = this.$props;\n\t\t\tconst { hits, streamHits } = this.$data;\n\t\t\tconst results = parseHits(hits) || [];\n\t\t\tconst streamResults = parseHits(streamHits) || [];\n\t\t\treturn {\n\t\t\t\tresults,\n\t\t\t\tstreamResults,\n\t\t\t\tloadMore: this.loadMore,\n\t\t\t\tbase: this.$currentPage * size,\n\t\t\t\ttriggerClickAnalytics: this.triggerClickAnalytics,\n\t\t\t};\n\t\t}", "title": "" }, { "docid": "901e71e41fc468a0c228c17d687c4ed4", "score": "0.6332393", "text": "function getAllEntrepriseCandidatures(){\n var URL = API_HOST + API_LIST_ENTREPRISES_PATH;\n Axios.get(URL)\n .then((response) => response.data)\n .then((data) => setListCandidatures(data))\n .catch((error) => console.log(error.response));\n }", "title": "" }, { "docid": "fa0644e92ae8d11a6e6aae046a988346", "score": "0.6290756", "text": "async getCarritosAll(){\n const data = await super.getAll();\n return data;\n }", "title": "" }, { "docid": "2d365d056b4d6a9c71dd8b20bb6189a5", "score": "0.62559974", "text": "async function getResults() {\n\n const promise = new Promise((resolve, reject) => {\n $.get(util.resultApi, function (data) {\n if (data && data.results) {\n resolve(setUIdata(data.results));\n } else {\n reject('Something Went Wrong.');\n }\n });\n });\n\n const result = await promise;\n const resultData = result.card;\n const filters = {\n species: [...result.filters.species],\n gender: [...result.filters.gender],\n origin: [...result.filters.origin]\n }\n\n filter.populateFilters(filters);\n\n populateCardData(resultData);\n\n //[TODO] Redux store can be used to save the app state\n util.setDataToLocalStorage('originalData', resultData);\n getCheckedFilters();\n\n }", "title": "" }, { "docid": "3998fcf0d187b4e00346ee53cddafed3", "score": "0.623199", "text": "getResults() {\n const url = `${API_URL}/api/result/`;\n return axios.get(url).then(response => response.data);\n }", "title": "" }, { "docid": "2f4f1d22f0967662ef845c3ccfe278bb", "score": "0.6221722", "text": "async getResults() {\n\t\ttry {\n\t\t\tconst blob = await fetch(\n\t\t\t\t`https://forkify-api.herokuapp.com/api/search?q=${this.query}`\n\t\t\t);\n\n\t\t\tconst json = await blob.json();\n\t\t\t// console.log(json);\n\t\t\tthis.result = json.recipes;\n\t\t\t// console.log(this.result); //array of recepies related to query\n\t\t} catch (error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t}", "title": "" }, { "docid": "1a90741f6275ca7ab8be593b54d08a16", "score": "0.6137686", "text": "getResults() {\n return this.getResultsAndScalarResults().then(results => {\n return results.entities;\n });\n }", "title": "" }, { "docid": "480bc265a333c41aa10a73a9c05710c0", "score": "0.6082607", "text": "getAll(result, next) {\r\n let query = 'select * from category'\r\n sql.query(query, (error, results, fields) => {\r\n if (error) next(error);\r\n else result(results);\r\n })\r\n }", "title": "" }, { "docid": "7b540de504225787cc9c0cc4838a5658", "score": "0.60814565", "text": "async getResults() {\n // ^^ Request to Api for Recipe\n try {\n // ^^ Api Endpoint\n const res = await axios(`${this.endpoint}key=${this.key}&rId=${this.id}`)\n\n // ^^ Query Results\n this.results = res.data.recipe\n\n } catch (err) {\n\n // ~~ Error Handler General\n console.log(err)\n }\n }", "title": "" }, { "docid": "a116fc33fb058aef8519855dbcc6dc02", "score": "0.60430795", "text": "function getResults () {\n NgResourceService.getResults().then(function (results) {\n vm.results = results;\n });\n }", "title": "" }, { "docid": "5b8e94b7d4a9152227745c672d77881f", "score": "0.60100895", "text": "getAll() {\n return __awaiter(this, void 0, void 0, function* () {\n const asArray = Object.values(data_1.default);\n return asArray;\n });\n }", "title": "" }, { "docid": "4f49ceb8a8a119a63573b2273ed9dbe9", "score": "0.5996155", "text": "getAll() {\n return this.data;\n }", "title": "" }, { "docid": "b1efcc73ad7743a9c12ae2cda26947da", "score": "0.5932372", "text": "get Results() {\n\t\treturn this._resultItems;\n\t}", "title": "" }, { "docid": "68a5edd1adb4f8cbfb68ee3afe0cd66f", "score": "0.5923396", "text": "function getData () {\n\n // get sheet level data\n var values = getTidyValues ( \"sheetDetails\");\n Logger.log (\"------------slice of tidied API response from getByDataFilters-sheet\");\n Logger.log ( JSON.stringify (values).slice(0,200));\n \n // get column level data\n var values = getTidyValues ( \"municipalityColumn\");\n Logger.log (\"------------slice of tidied API response from getByDataFilters-column\");\n Logger.log ( JSON.stringify (values).slice(0,200));\n \n // get row level data\n var values = getTidyValues ( \"originalFirstAirport\")\n Logger.log (\"------------slice of tidied API response from getByDataFilters-row\");\n Logger.log ( JSON.stringify (values).slice(0,200));\n \n}", "title": "" }, { "docid": "b812b342b74f0a44982737d9377ed0b6", "score": "0.59097487", "text": "getElectricityData() {\n const {\n GetAcDayElec, GetAcMonthElec\n } = this.props;\n GetAcDayElec()\n .then((res) => {\n console.log('✅ success GetAcDayElec' + JSON.stringify(res));\n })\n .catch((err) => {\n console.log('❌ failure GetAcDayElec' + JSON.stringify(err));\n });\n\n GetAcMonthElec()\n .then((res) => {\n console.log('✅ success GetAcMonthElec' + JSON.stringify(res));\n })\n .catch((err) => {\n console.log('❌ failure GetAcMonthElec' + JSON.stringify(err));\n });\n }", "title": "" }, { "docid": "3bd00bad09277570adb208fa6fea7132", "score": "0.5907175", "text": "static displayAll() {\n return myContact.find({})\n .then((contacts) => {\n return contacts;\n });\n }", "title": "" }, { "docid": "4aa0ee86b551e9b9d0bd83ef12712c35", "score": "0.5902066", "text": "async function getResult() {\n const apiResult = await fetch(`https://www.boredapi.com/api/${searchParams()}`)\n const activities = await apiResult.json()\n //update the state with api data\n setResult(activities)\n }", "title": "" }, { "docid": "4b2e7f3d89fcc9b7a46bb11021bd0b9e", "score": "0.5898686", "text": "loadSubResults(result) {\n\t\tlet values = {};\n\n\t\tfor (let subResult of result.subResults) {\n\t\t\tvalues.v = subResult;\n\t\t}\n\n\t\treturn values;\n\t}", "title": "" }, { "docid": "344331122b0a19ba85d37955d1ff6938", "score": "0.5884241", "text": "allData() {\n const sql = 'SELECT * FROM questions WHERE course_id = $1';\n return this.db.many(sql);\n }", "title": "" }, { "docid": "5196cbe02c20e8c7515398e8fe3c6409", "score": "0.58761966", "text": "async getAll() {\n try {\n const response = await fetch(baseUrl + this.entity);\n const dataJson = await response.json(); \n return dataJson;\n\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "23ecd3e44b11efda9f33ebbace2d7992", "score": "0.5871559", "text": "async results() {\n // Check if canary is already been deployed\n const canaryName = this.state.name\n if (!canaryName) {\n log('No components found. Components seems not been deployed yet.')\n return\n }\n\n // Get AWS clients\n const { synthetics } = getClients(this.credentials.aws, this.state.region)\n\n // Retrieve canary runs\n log('Retrieving Synthetics Canary runs..')\n const runs = await getSyntheticsCanaryRuns(synthetics, canaryName)\n log('Canary runs retrieved!')\n\n // Export last 5 runs\n return {\n outputs: runs.slice(0, 5)\n }\n }", "title": "" }, { "docid": "e0b8f641af4e9e898ef47a635b9c2634", "score": "0.5869671", "text": "async getResults() {\n try {\n const res = await axios(`${proxy}https://api.edamam.com/search?q=${this.query}&app_id=${id}&app_key=${key}&from=0&to=50${this.diet === 'none' ? '': '&diet=' + this.diet}${this.health === 'none' ? '': '&health=' + this.health}`);\n this.recipes = res.data.hits.map(hit => hit.recipe);\n this.recipes.forEach((recipe, index) => this.recipes[index].ingredients = this.standardizeIngredients(recipe.ingredientLines));\n this.tidyRecipes();\n this.createIDs();\n this.storeServings();\n } catch (error) {\n alert(error);\n }\n }", "title": "" }, { "docid": "f2a6a253da8c1000472e991773d61676", "score": "0.58443344", "text": "_fetchData() {\n // eslint-disable-next-line object-curly-newline\n const { medico, desde, hasta, institucion } = this;\n this._setQueryParams(medico, desde, hasta, institucion);\n const noFetch = !medico || !desde || !hasta;\n if (noFetch) {\n this.tratamientos = [];\n return;\n }\n\n const _vInstitucion = institucion ? { institucion } : {};\n this.variables = {\n medico,\n ..._vInstitucion,\n entre: `${formatDateToISO(desde)},${formatDateToISO(hasta)}`,\n };\n this.subscribe();\n }", "title": "" }, { "docid": "7b6f7d7c4df66d9188394173adc381f0", "score": "0.5841804", "text": "function query_data() {\n $http.get('getRuns').then(function (response) {\n addPacetoActivities(response.data);\n vm.list = response.data;\n vm.nTotalItems = vm.list.length;\n });\n }", "title": "" }, { "docid": "4123b275d519fab0a4ff97b9243537a3", "score": "0.5839627", "text": "async function fetchTrajetsCompatibles(){\n const trajetsResult = await Requete.get(\n \"/matching/trajets/aller/\" + id + \"/\" + membreId + \"/\" + passagerOuConducteur,\n { headers: { \"x-auth-token\": token } },\n )\n setTrajetsData(trajetsResult.data);\n }", "title": "" }, { "docid": "dd9ccd3a696f13ebd39955092a1bfb7a", "score": "0.5828897", "text": "function loadAll() {\n\t var cities = void 0;\n\t return ActivityService.getCities().then(function (res) {\n\t cities = res.data;\n\t\n\t return cities.map(function (city) {\n\t city.value = city.name.toLowerCase();\n\t return city;\n\t });\n\t });\n\t }", "title": "" }, { "docid": "9f9ec87acb6d7fa04d215cb56773139e", "score": "0.582356", "text": "getAll () {\n\t\t// TODO: setup later with pagination, main code goes in this model, update client/freelancer review models to hit this method, add to tests after\n\t}", "title": "" }, { "docid": "086231f3e825183357687c70d302d9a1", "score": "0.58185256", "text": "getAll() {\n return this.infos_eleves;\n }", "title": "" }, { "docid": "0ab65a06908cff3771f10305444f7bb4", "score": "0.58166707", "text": "function loadResults() {\n API.searchAreas()\n .then((res) => setResults(res.data[\"RECDATA\"]))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "0beb958bb3ceefa0916fb19b68deaf92", "score": "0.58134323", "text": "async function getallData() {\n let res = await axios.get(API);\n return res.data;\n}", "title": "" }, { "docid": "a50aa45ae0dd721ae5d3d64d12841ac9", "score": "0.58132166", "text": "function loadAll() {\n\n $http.get('/clinic').then(function(resp){\n var values = resp.data.data;\n vm.clinics = values.map(function(clinic) {\n return {\n value: clinic.shortname,\n display: clinic.name\n };\n });\n }, function(err){\n console.log(err);\n });\n }", "title": "" }, { "docid": "ef509631f293dfaba9ca98fc2d2ecf43", "score": "0.5783925", "text": "loadResults() {\n\n\t\t/**\n\t\t * For each result of a user.\n\t\t */\n\t\tfor (let result of this.results.data) {\n\t\t\t// if the result belongs to the selected test add the result\n\t\t\tif(result.test === this.selectedTest._id) {\n\t\t\t\t//for each data entry, 'c' is used in google-charts to set the information of the data entry\n\t\t\t\t//The first value pushed in 'c' is the value shown on the X-axis, the second is the actual (numerical) value in the chart\n\t\t\t\t// this numerical value is a point on the chart\n\t\t\t\tlet dataEntry = {};\n\t\t\t\tdataEntry.c = [];\n\t\t\t\tdataEntry.c.push({ 'v': result.time.split(\" \")[0] });\n\t\t\t\tdataEntry.c.push(this.loadSubResults(result));\n\t\t\t\tthis.rows.push(dataEntry);\n\t\t\t}\n\t\t}\n\n\t\t// add the rows data set to the chart itself.\n\t\tthis.aChart.data.rows = this.rows;\n\t\t// if there is data available then add the graph to the selectedTest to show it, else don't\n\t\tthis.selectedTest.chart = this.rows.length < 1 ? null : this.aChart;\n\t\tthis.noDataText= \"Geen data beschikbaar\";\n\n\t}", "title": "" }, { "docid": "36de097658bba9dfc7d4936a0d0b7fe1", "score": "0.577579", "text": "async carregarCategorias(){\n\t\t\tconst {data} = await servicoCategoria.carregarCategorias()\n\t\t\treturn data\n\t\t}", "title": "" }, { "docid": "e4ea7d2e8c83799bf9aed6e1ae3aa8a3", "score": "0.5748118", "text": "fetchAllData() {\n this.fetchListing();\n this.fetchHoods();\n this.fetchPendingHoods();\n }", "title": "" }, { "docid": "44a50180c10221c653cdd9dffac06c65", "score": "0.57451946", "text": "getAll_() {\r\n return fetch(this.endPoint)\r\n .then( (resp)=> {\r\n return resp.json();\r\n } );\r\n }", "title": "" }, { "docid": "1e904eec57e5d001e9f30f47441988d1", "score": "0.5745183", "text": "static async getAll() {\n const allGoalsRes = await db.query(\n `SELECT id, title, category, claps from goals ORDER BY category`\n );\n return allGoalsRes.rows;\n }", "title": "" }, { "docid": "1dfe2c6df206f2dfef43857a4c30bf19", "score": "0.5745035", "text": "results(state) {\n return state.results;\n }", "title": "" }, { "docid": "ed4d51f84ec7181afdf758ef513328b2", "score": "0.57361215", "text": "static async getAll() {\n const layoverResults = await db.query(\n `SELECT layover_code, city_name, country_name, thumbnail_url FROM layovers`\n );\n const layovers = layoverResults.rows;\n return layovers;\n }", "title": "" }, { "docid": "6a47b9208cb36f65c429cb68fc01c3db", "score": "0.5733757", "text": "all () {\n return this.data\n }", "title": "" }, { "docid": "ae41a36deac5d3cb7e0badc6c37083c0", "score": "0.5731922", "text": "async loadAllResults()\n {\n throw \"Not implemented\";\n }", "title": "" }, { "docid": "bfa37c7b46ec21cafad9a57a28183801", "score": "0.5726", "text": "async obtenerCategorias(){\n\t\tconst url = `https://www.etnassoft.com/api/v1/get/?get_categories=all`;\n\t\tconst urlObtenerCategorias = await fetch(url);\n\t\tconst categorias = await urlObtenerCategorias.json();\n\t\treturn{\n\t\t\tcategorias\n\t\t}\n\t}", "title": "" }, { "docid": "52298df5ae78e62f6add5d0dcb3356c2", "score": "0.5710438", "text": "getAllCompetences() {\n return fetch(\"https://recruitment-app-api.herokuapp.com/applicant/competence\", {\n credentials: 'include',\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n }\n }).then(response => {\n if (response.status == 401) {\n throw response;\n }\n if (response.status == 500) {\n throw response;\n }\n return response.json();\n }).catch(error => {\n throw error;\n })\n }", "title": "" }, { "docid": "021d048eb82513b5c889b0501489f05c", "score": "0.57102245", "text": "function getAllCourseContent() {\n allCourse().then((data) => {\n if (data.err) {\n log(\"[getAllCourseContent()] : post/allCourse => \" + data.err);\n } else {\n log(\"[getAllCourseContent()] : post/allCourse => \");\n log(data);\n generateCourseHtmlTable(filterCourseData(data.course));\n }\n });\n}", "title": "" }, { "docid": "9778d250e7a3c47bb52f36d3ae5f639f", "score": "0.5709634", "text": "async function fetchData() {\n const result = await axios('https://hn.algolia.com/api/v1/search?query=redux');\n\n setData(result.data);\n setLoading(false);\n }", "title": "" }, { "docid": "1ea725f68cbbebf1f756d2f6c340d23d", "score": "0.5708275", "text": "function loadAll() {\n\t var activities = void 0;\n\t return ActivitiesService.getAllActivities().then(function (res) {\n\t activities = res.data;\n\t\n\t return activities.map(function (activity) {\n\t activity.value = activity.name;\n\t return activity;\n\t });\n\t });\n\t }", "title": "" }, { "docid": "97127e5216f3cbdd12261d006e978d1d", "score": "0.57033443", "text": "function getResults() {\n let multiWeight = false;\n if (state.weightNumber > 1) multiWeight = true;\n eel.topsis_capulate(state.matrix, state.weight, state.max, multiWeight)(function(ret) {\n console.log(state.choicesNames)\n Ui.initializeResults(ret[0], state.choicesNames, ret[1])\n Ui.changeViewModeTo(6);});\n}", "title": "" }, { "docid": "beb260ebf135f2b611a7f371984169ff", "score": "0.57000065", "text": "function loadAll() {\n\t var cities = void 0;\n\t return MemberService.getCities().then(function (res) {\n\t cities = res.data;\n\t\n\t return cities.map(function (city) {\n\t city.value = city.name.toLowerCase();\n\t return city;\n\t });\n\t });\n\t }", "title": "" }, { "docid": "9f1e0f0ce2030570eaeb166ee9b6c6ca", "score": "0.56975734", "text": "getAllPasien() {\n\t\treturn fetch(`${cors}${baseUrl}/1/getAllPasien`, {\n\t\t\tmethod: 'GET',\n\t\t})\n\t\t.then(response => {\n\t\t\treturn response.json()\n\t\t})\n\t\t.then(jsonResponse => {\n\t\t\treturn jsonResponse\n\t\t})\n\t}", "title": "" }, { "docid": "e9cc4189bd4fa4e0ffc867f875cd8a1b", "score": "0.56939495", "text": "function getAll (result) {\n var output = [];\n for (var i = 0; i < result.rows.length; i++) {\n output.push(JSON.parse(result.rows.item(i).json));\n }\n return output;\n }", "title": "" }, { "docid": "ada25d159258304a13d5ff6a5abb90aa", "score": "0.56877065", "text": "async index ({ request, response, view }) {\n return await Compra.all();\n }", "title": "" }, { "docid": "dba2fd0b0bf89dbb5ec4b9cb0222ffed", "score": "0.56796384", "text": "all() {\n return data\n }", "title": "" }, { "docid": "5da059cddba671a979a0d477af6d2069", "score": "0.56786865", "text": "async results() {\n return {\n responses: this.responses,\n errors: this.errors,\n }\n }", "title": "" }, { "docid": "68c2bd8b8674d19f4e8e6b4600fae561", "score": "0.5671943", "text": "getAllData() {\n console.log(`Titulo: ${this.title}, Autor: ${this.author}, Precio: ${this.price}`);\n }", "title": "" }, { "docid": "c1abc00f5f176be70d13c5d1b66498f7", "score": "0.56639504", "text": "FindAllResult(date) {\n return __awaiter(this, void 0, void 0, function* () {\n const resultData = [];\n const allQuiz = yield resultModel_1.Result.findAll({\n where: { createdAt: date },\n order: [\n ['obtained_marks', 'DESC'],\n ],\n include: [usersModel_1.User, quizModel_1.Quiz]\n });\n for (let i = 0; i < allQuiz.length; i++) {\n resultData.push({\n obtained_marks: allQuiz[i].obtained_marks,\n quiz_name: allQuiz[i].Quiz.quiz_name,\n name: allQuiz[i].User.name,\n createdAt: allQuiz[i].createdAt,\n });\n }\n return resultData;\n });\n }", "title": "" }, { "docid": "9c764cac7ec6c12066d1756db2da3935", "score": "0.5661764", "text": "static async getInitialProps() {\n const campaigns = await factory.methods.getDeployedCampaigns().call();\n const summaries = await Promise.all(\n campaigns.map(address => {\n const campaign = Campaign(address);\n return campaign.methods.getSummary().call();\n })\n );\n return { campaigns, summaries };\n }", "title": "" }, { "docid": "b876d1fa33f726f7a9d0452e9f2c4f92", "score": "0.5643461", "text": "function getCategories(){\n\t categoryDataService.all().then(function (results) {\n\t $scope.Categories = results;\n\t // console.log(results);\n\t\t});\n\t}", "title": "" }, { "docid": "3230d70e249f6a1f7f703e46d090ca5a", "score": "0.5637433", "text": "getMeteorData() {\n let query = {};\n\n if (this.state.hideCompleted) {\n // If hide completed is checked, filter experiences\n query = {checked: {$ne: true}};\n }\n\n // We can also use Meteor.user().username or Meteor.userId() too.\n return {\n experiences: Experiences.find(query, {sort: {createdAt: -1}}).fetch(),\n incompleteCount: Experiences.find({checked: {$ne: true}}).count(),\n currentUser: Meteor.user(),\n };\n }", "title": "" }, { "docid": "8f9d6ee854231d81539b3e9b8e24a124", "score": "0.56373674", "text": "function getCyphrs() {\n cyphr_store = []\n return fetch(`${BASE_URL}/api/v1/cyphrs`)\n .then(response => response.json())\n .then(result => {\n result.map(cyphr => cyphr_store.push(cyphr));\n renderCyphrs();\n })\n}", "title": "" }, { "docid": "fccee35df92e20f74dfd656c7deb7ffa", "score": "0.5636015", "text": "static fetchCategories(){\n const url = `${host}/categories`;\n return this.getData(url);\n }", "title": "" }, { "docid": "f692cdc909a68eb7a1227b1ba8a2411e", "score": "0.56329787", "text": "function getTreatments() {\n vm.promise = amTreatments.getTreatments().then(success).catch(failure);\n \n function success(res) {\n vm.treatments = res.treatments;\n vm.query.total = res.treatments.length;\n }\n \n function failure(error) {\n vm.treatments = [];\n vm.query.total = 0;\n }\n }", "title": "" }, { "docid": "36bcf010fdb2dd766f2220a8f83aa8b1", "score": "0.5630293", "text": "function getAllObservations() {\n const filtered = filterObservations(data.results);\n const transformed = transformObservations(filtered);\n\n return transformed;\n}", "title": "" }, { "docid": "453ce93c490f3b742acbbc2848d297b8", "score": "0.56297266", "text": "obtenerCosechasConDetalleCompra() {\n return axios.get(`${API_URL}/harvests/con_detalle`);\n }", "title": "" }, { "docid": "0d5fe93aa388eecf74a3748152285b1f", "score": "0.56272966", "text": "get results() {\n\n if (!this.studentData) {\n return this.studentData;\n\n } else {\n throw \"Exception : Please call scrape function()\"\n }\n }", "title": "" }, { "docid": "533fdb25ab8d748b10565dd06faaf111", "score": "0.56258655", "text": "function getAllCases(){\n // console.log(\"https://kea-alt-del.dk/customersupport/\"\");\n fetch(\"https://kea-alt-del.dk/customersupport/\")\n .then(res=>res.json())\n .then(show)\n \n }", "title": "" }, { "docid": "7b1bdb17fc9b1517b12f4c4f4706f370", "score": "0.56226057", "text": "async function getAffData() {\n window.selectedaff = \"Select affiliaion\";\n var res = await get_all_affiliations();\n await setAffiliations(res.data.data);\n }", "title": "" }, { "docid": "86cbf131ba42137de03bdcbeb34b9f5d", "score": "0.5616056", "text": "function getVinculaciones() {\n service.getVinculaciones().then(\n function (response) {\n $scope.listaVinculaciones = response.data;\n },\n function () {\n Message.error(\"Ocurrió un error al recuperar la lista de vinculaciones.\");\n }\n );\n }", "title": "" }, { "docid": "e066f8a6a4a28ed43d51399c0f3897c9", "score": "0.5611125", "text": "async function fetchData() {\n const result = await axios('https://data.messari.io/api/v1/assets?fields=id,name,slug,symbol,metrics/market_data,metrics/marketcap,metrics/roi_data');\n setData(result.data.data);\n //console.log(result.data.data);\n }", "title": "" }, { "docid": "c38d78530f487b83d2ec6c17029b0134", "score": "0.5602932", "text": "async function fetchCovidDataRequest(){\n return [];\n}", "title": "" }, { "docid": "04213621f4d5503bbe52e9fe2e11dac5", "score": "0.5598565", "text": "all() {\n let object = this.courses;\n return Object.keys(object).map(function(key) {\n return object[key];\n });\n }", "title": "" }, { "docid": "3ec33878c89199eceb8eaaebf476c6be", "score": "0.5595509", "text": "toArray() {\n return this._results.slice();\n }", "title": "" }, { "docid": "3ec33878c89199eceb8eaaebf476c6be", "score": "0.5595509", "text": "toArray() {\n return this._results.slice();\n }", "title": "" }, { "docid": "3ec33878c89199eceb8eaaebf476c6be", "score": "0.5595509", "text": "toArray() {\n return this._results.slice();\n }", "title": "" }, { "docid": "3ec33878c89199eceb8eaaebf476c6be", "score": "0.5595509", "text": "toArray() {\n return this._results.slice();\n }", "title": "" }, { "docid": "3ec33878c89199eceb8eaaebf476c6be", "score": "0.5595509", "text": "toArray() {\n return this._results.slice();\n }", "title": "" }, { "docid": "3ec33878c89199eceb8eaaebf476c6be", "score": "0.5595509", "text": "toArray() {\n return this._results.slice();\n }", "title": "" }, { "docid": "8284be8fa8a44f9d4425dac733e4c3a1", "score": "0.5591425", "text": "getRecipiesAll() { \n httpClient.fetch('http://localhost:8080/recipies/all')\n .then(response => response.json())\n .then(data => {\n console.log(data);\n this.dataToShow = data;\n this.manageDataToShow();\n });\n }", "title": "" }, { "docid": "50c295603167a1d1af213e6387a17846", "score": "0.5591345", "text": "async function fetchData() {\n const baseUrl =\n \"https://api.mercadolibre.com/sites/MLA/search?q=auriculares\";\n const getItems = await axios.get(baseUrl);\n\n setItems(getItems.data.results);\n //para probar si funciona\n console.log(getItems);\n }", "title": "" }, { "docid": "59e39e434b0c232b3bd1f2a65652cee7", "score": "0.5591254", "text": "async getCategoriesCourses() {\n const response = await axios.get(GET_ALL_CATEGORIES_COURSES, { headers : { Authorization : `Bearer `+localStorage.getItem('token')}});\n if (response.status === 200) {\n return response.data;\n }\n }", "title": "" }, { "docid": "32e39e0a986cbb70eaa815d24e36b964", "score": "0.5588628", "text": "async getCandidates() {\n return axios\n .get(url + `/ListInfo`, {\n headers: {\n Authorization: \"token \" + sessionStorage.getItem(\"jwt\"),\n },\n })\n .then((res) => res.data);\n }", "title": "" }, { "docid": "e369c8cc9269c2316705da17373bf34d", "score": "0.5586345", "text": "function getCategoryList(){\r\n return new Promise((resolve, reject) => {\r\n Service(\r\n //Service call\r\n ).then((retValue) => {\r\n resolve(retValue);\r\n });\r\n }).catch((e) =>{\r\n console.error(e);\r\n });\r\n }", "title": "" }, { "docid": "238e49634b25a6426462cb0a233059ee", "score": "0.5578954", "text": "getAll(){\n return this.content\n }", "title": "" }, { "docid": "75d2667bcaaff9e885bc22b541dea2ee", "score": "0.5578417", "text": "async getAll() {\n let response = await this.client.get(this.baseResource)\n return response.data\n }", "title": "" }, { "docid": "7f75994302353d403c98ca6320815f66", "score": "0.55768704", "text": "obtenerCosechasSinDetalleCompra() {\n return axios.get(`${API_URL}/harvests/sin_detalle`);\n }", "title": "" }, { "docid": "f2d6f4bf31e62352c10909787167ad08", "score": "0.55686885", "text": "function ApiQuery() { \n axios.get('http://localhost:3000/query')\n .then(response => setData(response.data.data) ) \n }", "title": "" }, { "docid": "ebd871ec530a570a776fb87dfcf3d396", "score": "0.5564701", "text": "async getResults() {\n try {\n const queryResults = await axios(`https://forkify-api.herokuapp.com/api/search?&q=${this.query}`);\n this.recipes = queryResults.data.recipes;\n } catch(error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "30e19535c990f1e3f04fcfccce581608", "score": "0.5559278", "text": "fetchAllData() {\n this.fetchListing();\n this.fetchHoods();\n }", "title": "" }, { "docid": "e3f7922a152221b204eeee476eda8f95", "score": "0.5555411", "text": "getAllClientes() {\n const url = `${API_URL}/cliente/creatListarClientes/`;\n return axios.get(url).then(response => response.data);\n }", "title": "" }, { "docid": "97953f412b052e3f41ac5b11db8a5d0d", "score": "0.55519646", "text": "getAllCat() {\n return new Promise((resolve, reject) => {\n this.db.dbGet(\"/categories/_design/allcategories/_view/allcategories\", true, \"\").then(cats => {\n\n resolve(cats);\n })\n });\n }", "title": "" }, { "docid": "ca700c638de5adc6dee30e60ba3e0fd6", "score": "0.5551065", "text": "function getCampaignList(){\n db.get('CampaignList').find({}, function(e, docs){\n model.campaignList = docs;\n getCampaignProgress();\n });\n }", "title": "" }, { "docid": "44d23ce1c17e686082bbb4ef4538b992", "score": "0.55507976", "text": "function getElectedRepData()\n {\n var electedrep = {\"id\": klpData[\"report_info\"][\"dise\"],\n \"type\": repType}\n klp.dise_api.getElectedRepData(electedrep.id, electedrep.type,\n acadYear).done(function(diseData) {\n var categoryCount = common.getCategoryCount(diseData.properties);\n summaryData = common.getSummaryData(diseData, \n klpData[\"report_info\"],\n categoryCount, \n repType, \n acadYear);\n boundary_name = klpData[\"report_info\"][\"name\"];\n boundary_type = klpData[\"report_info\"][\"type\"];\n common.renderSummary(summaryData);\n getCategoriesData(diseData[\"properties\"]);\n renderCategories(categoriesData);\n var languageData = getLanguageData(diseData[\"properties\"]);\n renderLanguage(languageData);\n //Get Comparison Data\n if (klpData.neighbour_info.length != 0)\n common.getNeighbourData(klpData, renderNeighbours);\n common.getYearData(klpData, renderYearComparison);\n })\n .fail(function(err) {\n klp.utils.alertMessage(\"Sorry, could not fetch dise data\", \"error\");\n });\n }", "title": "" }, { "docid": "535986c3e1723d0185944995061d14b6", "score": "0.5549017", "text": "getAll(req, res) {\n Cache.find({}).then((data) => {\n\n const totalCache = data.map((record) => {\n return { key: record.key, value: record.value }\n });\n\n return res.send(totalCache);\n });\n }", "title": "" }, { "docid": "4f925fa3c58388def3f1039da710b464", "score": "0.55487186", "text": "getAllClientes() {\n const url = `${API_URL}/producto/creatListarProductos/`;\n return axios.get(url).then(response => response.data);\n }", "title": "" }, { "docid": "b62b05b96d4b94ee37fbad396c154de4", "score": "0.554151", "text": "async function getVMs() {\n\t request_body = {\n\t\t\t \"criteriaList\": [],\n\t \t \"logicalOperator\": \"AND\",\n\t \t \"className\": \"VirtualMachine\",\n\t \t \"environmentType\": \"ONPREM\",\n\t \t \"scope\": null\n\t }\n\t response = await fetch('/vmturbo/rest/search/?ascending=false&disable_hateoas=true&order_by=severity&q=', {\n\t \t method: 'POST',\n\t \t body: JSON.stringify(request_body),\n\t \t headers: {\n\t \t\t 'Content-Type': 'application/json'\n\t \t }\n\t })\n\t return await response.json() \n}", "title": "" }, { "docid": "754381845e245186cfe7046784e82766", "score": "0.5536448", "text": "function fetchAllCats()\n {\n\t var deferred = $q.defer();\n $http.get(REST_SERVICE_URI+\"cat/\")\n .then(\n function (response) {\n deferred.resolve(response.data);\n\t\t\t\tconsole.log(response.data);\n },\n function(errResponse){\n console.error('Error while fetching cats'+errResponse.data);\n deferred.reject(errResponse);\n }\n );\n return deferred.promise; }", "title": "" }, { "docid": "e4443d9cfe6ea522d25adc6ae1b616ba", "score": "0.5527527", "text": "function getAPIdata() {\n Axios.get(`/api/ETfLiveArbitrage/AllTickers`)\n .then(({ data }) => {\n setTableData(data);\n setDataForTime(data[0][\"Timestamp\"]);\n // setFilteredData(data);\n })\n .catch((err) => {\n setErrorCode(err.response.status);\n });\n }", "title": "" }, { "docid": "b52f39c8faa53720b2ee1fe1bae9a278", "score": "0.5527053", "text": "getConversicaData(context, payload) {\n context.commit('loading/SET_LOADING', 'conversica', { root: true });\n \n axios\n .get('/conversica/data', {\n params: {\n filter: context.rootGetters['filter/filter']\n }\n })\n .then(response => {\n context.commit('conversica/CONVERSICA_DATA', response.data.actuals, { root: true });\n context.commit('conversica/CONVERSICA_TARGETS', response.data.targets, { root: true });\n context.commit('conversica/CONVERSICA_DEPLOYMENTS', response.data.deployments, { root: true });\n\n context.commit('loading/UNSET_LOADING', 'conversica', { root: true });\n });\n }", "title": "" } ]
c99b59667d26921fe91fa776e43a6f35
Detects whether an element's content has horizontal overflow
[ { "docid": "96a8291cc2a4cfe79f0721910877f4c0", "score": "0.85750824", "text": "function hasHorizontalOverflow(element) {\n return element.clientWidth < element.scrollWidth;\n}", "title": "" } ]
[ { "docid": "02232d19a5824a2c0709accfbd79946e", "score": "0.8605328", "text": "function hasHorizontalOverflow(element) {\r\n return element.clientWidth < element.scrollWidth;\r\n}", "title": "" }, { "docid": "02232d19a5824a2c0709accfbd79946e", "score": "0.8605328", "text": "function hasHorizontalOverflow(element) {\r\n return element.clientWidth < element.scrollWidth;\r\n}", "title": "" }, { "docid": "02232d19a5824a2c0709accfbd79946e", "score": "0.8605328", "text": "function hasHorizontalOverflow(element) {\r\n return element.clientWidth < element.scrollWidth;\r\n}", "title": "" }, { "docid": "02232d19a5824a2c0709accfbd79946e", "score": "0.8605328", "text": "function hasHorizontalOverflow(element) {\r\n return element.clientWidth < element.scrollWidth;\r\n}", "title": "" }, { "docid": "02232d19a5824a2c0709accfbd79946e", "score": "0.8605328", "text": "function hasHorizontalOverflow(element) {\r\n return element.clientWidth < element.scrollWidth;\r\n}", "title": "" }, { "docid": "02232d19a5824a2c0709accfbd79946e", "score": "0.8605328", "text": "function hasHorizontalOverflow(element) {\r\n return element.clientWidth < element.scrollWidth;\r\n}", "title": "" }, { "docid": "4e66113725e0c91daef0da1ed8a48fdf", "score": "0.85679686", "text": "function hasHorizontalOverflow(element) {\n return element.clientWidth < element.scrollWidth;\n}", "title": "" }, { "docid": "0a80393ac304ce7b005dadcde8b98d54", "score": "0.8525998", "text": "function hasHorizontalOverflow(element) {\n return element.clientWidth < element.scrollWidth;\n }", "title": "" }, { "docid": "07959c34320bb48bdbb866233a3b05f6", "score": "0.8484089", "text": "function hasHorizontalOverflow(element) {\n\t return element.clientWidth < element.scrollWidth;\n\t}", "title": "" }, { "docid": "e6a49dd542fbef62e84bd7bd93fbe9bc", "score": "0.7824373", "text": "function hasOverflow(element) {\r\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\r\n}", "title": "" }, { "docid": "e6a49dd542fbef62e84bd7bd93fbe9bc", "score": "0.7824373", "text": "function hasOverflow(element) {\r\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\r\n}", "title": "" }, { "docid": "e6a49dd542fbef62e84bd7bd93fbe9bc", "score": "0.7824373", "text": "function hasOverflow(element) {\r\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\r\n}", "title": "" }, { "docid": "e6a49dd542fbef62e84bd7bd93fbe9bc", "score": "0.7824373", "text": "function hasOverflow(element) {\r\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\r\n}", "title": "" }, { "docid": "e6a49dd542fbef62e84bd7bd93fbe9bc", "score": "0.7824373", "text": "function hasOverflow(element) {\r\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\r\n}", "title": "" }, { "docid": "e6a49dd542fbef62e84bd7bd93fbe9bc", "score": "0.7824373", "text": "function hasOverflow(element) {\r\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\r\n}", "title": "" }, { "docid": "68e9b39f09c978531019ee2485169d59", "score": "0.7775302", "text": "function isOverflowed(element){\n return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n}", "title": "" }, { "docid": "265e462b65e40ec99e0a3af8d877b821", "score": "0.7769729", "text": "hasOverflow() {\n\t\tvar e = this.element;\n\t\t//If the first element in the sectioin would be sent to the overflow menu, we don't render the section. In that case, e would be null.\n\t\tif (e === null || e.offsetWidth === 0) return false;\n\t\tlet offset = 0;\n\t\t//If we already have an overflow, we should account for the overflow button in our calculations.\n\t\tif (this.state.minOverflowIndex !== DEFAULT_MINIMUM_OVERFLOW) {\n\t\t\toffset = 20;\n\t\t}\n\t\treturn e.offsetWidth < e.scrollWidth - offset;\n\t}", "title": "" }, { "docid": "d6ccb40cd723de6d5627fd553cbe8f57", "score": "0.77590764", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n }", "title": "" }, { "docid": "a753a22b6faa08db1114f11f00da7567", "score": "0.7747234", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}", "title": "" }, { "docid": "a753a22b6faa08db1114f11f00da7567", "score": "0.7747234", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}", "title": "" }, { "docid": "a753a22b6faa08db1114f11f00da7567", "score": "0.7747234", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}", "title": "" }, { "docid": "a753a22b6faa08db1114f11f00da7567", "score": "0.7747234", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}", "title": "" }, { "docid": "a753a22b6faa08db1114f11f00da7567", "score": "0.7747234", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}", "title": "" }, { "docid": "6d6e9d960f5540e740603a337129e5e3", "score": "0.77386606", "text": "function hasOverflow(element) {\n\t return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n\t}", "title": "" }, { "docid": "b218d75782eef9b3dc9dec1b4e1120fd", "score": "0.77126384", "text": "function hasOverflow(element) {\n return hasHorizontalOverflow(element) || hasVerticalOverflow(element);\n}", "title": "" }, { "docid": "35534e5d68adb8d3bc7de0c29bbaf43a", "score": "0.7700454", "text": "function checkOverflow(el)\n{\n var curOverflow = el.style.overflow;\n\n var isOverflowing = el.clientWidth < el.scrollWidth \n || el.clientHeight < el.scrollHeight;\n\n return isOverflowing;\n}", "title": "" }, { "docid": "5ade2262e5d1a8fe5d789832c6a44b63", "score": "0.76703817", "text": "function isOverflown (element) {\n return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;\n}", "title": "" }, { "docid": "4516a221c56312670d1bd3e78a419b45", "score": "0.74177563", "text": "function check_overflow(element) {\r\n var element_clone = element.clone();\r\n\r\n element.after(element_clone.hide().css({\r\n 'position': 'absolute',\r\n 'width': 'auto',\r\n 'overflow': 'visible',\r\n 'max-width': 'inherit'\r\n }));\r\n\r\n var has_overflow = element_clone.width() > element.width();\r\n\r\n element_clone.remove();\r\n return has_overflow;\r\n }", "title": "" }, { "docid": "7b17d7db2b448e4a37b1ffe0b28b1054", "score": "0.7378014", "text": "function checkOverflow(el)\n{\n var curOverflow = el.style.overflow;\n\n if ( !curOverflow || curOverflow === \"visible\" ) {\n el.style.overflow = \"hidden\";\n }\n\n var isOverflowing = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;\n el.style.overflow = curOverflow;\n\n return isOverflowing;\n}", "title": "" }, { "docid": "693cc773a67dddf72fd4e1634367e131", "score": "0.7322753", "text": "function isOverflowed(thisElement) {\n return thisElement[0].scrollHeight > thisElement[0].clientHeight;\n }", "title": "" }, { "docid": "1a32f05e64cdf5a7291000e83961eb8c", "score": "0.72837543", "text": "function isOverflowed(thisElement) {\n thisElement = thisElement;\n return thisElement[0].scrollHeight > thisElement[0].clientHeight;\n }", "title": "" }, { "docid": "0692e8a16f08b902a55c28b0b4b15127", "score": "0.7271705", "text": "function isOverflowed(element){\n var eHeight = $(element).height();\n var eOffset = $(element).position();\n var wHeight = $(window).height();\n var combinedHeight = eHeight + eOffset.top;\n \tif (combinedHeight > wHeight) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n}", "title": "" }, { "docid": "85f591e42ad572f6a8f80800ba59636a", "score": "0.7187288", "text": "function hasVerticalOverflow(element) {\r\n return element.clientHeight < element.scrollHeight;\r\n}", "title": "" }, { "docid": "85f591e42ad572f6a8f80800ba59636a", "score": "0.7187288", "text": "function hasVerticalOverflow(element) {\r\n return element.clientHeight < element.scrollHeight;\r\n}", "title": "" }, { "docid": "85f591e42ad572f6a8f80800ba59636a", "score": "0.7187288", "text": "function hasVerticalOverflow(element) {\r\n return element.clientHeight < element.scrollHeight;\r\n}", "title": "" }, { "docid": "85f591e42ad572f6a8f80800ba59636a", "score": "0.7187288", "text": "function hasVerticalOverflow(element) {\r\n return element.clientHeight < element.scrollHeight;\r\n}", "title": "" }, { "docid": "85f591e42ad572f6a8f80800ba59636a", "score": "0.7187288", "text": "function hasVerticalOverflow(element) {\r\n return element.clientHeight < element.scrollHeight;\r\n}", "title": "" }, { "docid": "85f591e42ad572f6a8f80800ba59636a", "score": "0.7187288", "text": "function hasVerticalOverflow(element) {\r\n return element.clientHeight < element.scrollHeight;\r\n}", "title": "" }, { "docid": "1ee1faa6570704365775ce121b948f9a", "score": "0.71222854", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}", "title": "" }, { "docid": "1ee1faa6570704365775ce121b948f9a", "score": "0.71222854", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}", "title": "" }, { "docid": "1ee1faa6570704365775ce121b948f9a", "score": "0.71222854", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}", "title": "" }, { "docid": "1ee1faa6570704365775ce121b948f9a", "score": "0.71222854", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}", "title": "" }, { "docid": "1ee1faa6570704365775ce121b948f9a", "score": "0.71222854", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}", "title": "" }, { "docid": "78df3abba3f2fc31a1e415d18b09b998", "score": "0.7095534", "text": "function isOverflowing(container) {\n const doc = (0,_mui_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(container);\n\n if (doc.body === container) {\n return (0,_mui_utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(container).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "e5427745e3ba7f18613ff9a76e97ed4b", "score": "0.7085855", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n}", "title": "" }, { "docid": "387823412f52198254005e79f50755f9", "score": "0.7045656", "text": "function isOverflowing(container) {\n var doc = (0, _ownerDocument.default)(container);\n\n if (doc.body === container) {\n return (0, _ownerWindow.default)(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "387823412f52198254005e79f50755f9", "score": "0.7045656", "text": "function isOverflowing(container) {\n var doc = (0, _ownerDocument.default)(container);\n\n if (doc.body === container) {\n return (0, _ownerWindow.default)(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "0346d2551ea1b63fe009ffae93610869", "score": "0.7012508", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "0346d2551ea1b63fe009ffae93610869", "score": "0.7012508", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[/* default */ \"a\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[/* default */ \"a\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "d3dc105adc06aa15525284ae2d47529f", "score": "0.7000985", "text": "function isOverflowing(container) {\n const doc = Object(_mui_utils__WEBPACK_IMPORTED_MODULE_0__[\"unstable_ownerDocument\"])(container);\n\n if (doc.body === container) {\n return Object(_mui_utils__WEBPACK_IMPORTED_MODULE_0__[\"unstable_ownerWindow\"])(container).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "259fe0107d8a5a1e16ab9282c5b86edb", "score": "0.6997088", "text": "function isOverflowing(container) {\n var doc = Object(__WEBPACK_IMPORTED_MODULE_4__utils_ownerDocument__[\"a\" /* default */])(container);\n\n if (doc.body === container) {\n return Object(__WEBPACK_IMPORTED_MODULE_5__utils_ownerWindow__[\"a\" /* default */])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "259fe0107d8a5a1e16ab9282c5b86edb", "score": "0.6997088", "text": "function isOverflowing(container) {\n var doc = Object(__WEBPACK_IMPORTED_MODULE_4__utils_ownerDocument__[\"a\" /* default */])(container);\n\n if (doc.body === container) {\n return Object(__WEBPACK_IMPORTED_MODULE_5__utils_ownerWindow__[\"a\" /* default */])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "705f5e8d6c2b7ee5f7ea86bcb64ab6a4", "score": "0.6991741", "text": "function isOverflowing(container) {\n var doc = Object(__WEBPACK_IMPORTED_MODULE_4__utils_ownerDocument__[\"a\" /* default */])(container);\n\n if (doc.body === container) {\n var win = Object(__WEBPACK_IMPORTED_MODULE_5__utils_ownerWindow__[\"a\" /* default */])(doc);\n return win.innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "2da8d5f2504cbb0f11955cbdcbed2458", "score": "0.69881666", "text": "function isOverflowing(container) {\n var doc = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__utils_ownerDocument__[\"a\" /* default */])(container);\n\n if (doc.body === container) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__utils_ownerWindow__[\"a\" /* default */])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "d9acb71ccc32b2120560713ee178126d", "score": "0.69802254", "text": "function isOverflowing(container) {\r\n var doc = Object(__WEBPACK_IMPORTED_MODULE_4__utils_ownerDocument__[\"a\" /* default */])(container);\r\n\r\n if (doc.body === container) {\r\n return Object(__WEBPACK_IMPORTED_MODULE_5__utils_ownerWindow__[\"a\" /* default */])(doc).innerWidth > doc.documentElement.clientWidth;\r\n }\r\n\r\n return container.scrollHeight > container.clientHeight;\r\n}", "title": "" }, { "docid": "24c9cf1d0204ccf1d820dc380b876fae", "score": "0.6964967", "text": "function isOverflowing(container) {\n var doc = (0,_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_3__.default)(container);\n\n if (doc.body === container) {\n return (0,_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_4__.default)(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "296fac175ac0fb45eb268f9ba6ed3b35", "score": "0.6962635", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n return Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "8b42036537d800106e33aaad39a8c3f8", "score": "0.69605285", "text": "function isOverflowing(container) {\n\t var doc = (0, _ownerDocument.default)(container);\n\n\t if (doc.body === container) {\n\t return (0, _ownerWindow.default)(doc).innerWidth > doc.documentElement.clientWidth;\n\t }\n\n\t return container.scrollHeight > container.clientHeight;\n\t}", "title": "" }, { "docid": "21542d572bae84061b99605feeac8ad5", "score": "0.6959837", "text": "function isOverflowing(container) {\n var doc = (0, _ownerDocument2.default)(container);\n var win = (0, _ownerWindow2.default)(doc);\n\n /* istanbul ignore next */\n if (!(0, _isWindow2.default)(doc) && !isBody(container)) {\n return container.scrollHeight > container.clientHeight;\n }\n\n // Takes in account potential non zero margin on the body.\n var style = win.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}", "title": "" }, { "docid": "21542d572bae84061b99605feeac8ad5", "score": "0.6959837", "text": "function isOverflowing(container) {\n var doc = (0, _ownerDocument2.default)(container);\n var win = (0, _ownerWindow2.default)(doc);\n\n /* istanbul ignore next */\n if (!(0, _isWindow2.default)(doc) && !isBody(container)) {\n return container.scrollHeight > container.clientHeight;\n }\n\n // Takes in account potential non zero margin on the body.\n var style = win.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}", "title": "" }, { "docid": "78f71746229b9a59f468fa8a48425868", "score": "0.69593775", "text": "function hasVerticalOverflow(element) {\n return element.clientHeight < element.scrollHeight;\n }", "title": "" }, { "docid": "777516d00c2e8d9bb8d60861a4cbb439", "score": "0.69573355", "text": "function isOverflowing(container) {\n var doc = Object(_utils_ownerDocument__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(container);\n\n if (doc.body === container) {\n var win = Object(_utils_ownerWindow__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(doc);\n return win.innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "ddae4afd305e8ac5000f67fcc6de51a5", "score": "0.69488525", "text": "function isOverflowing(container) {\n var doc = _utilsOwnerDocumentDefault.default(container);\n if (doc.body === container) {\n return _utilsOwnerWindowDefault.default(doc).innerWidth > doc.documentElement.clientWidth;\n }\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "a3f1fc9102ec0a2a7bd285d3b69fc30d", "score": "0.6946238", "text": "function isOverflowContent(container, content)\n {\n if( container.offsetWidth < content.offsetWidth )\n {\n return true;\n }\n if( container.offsetHeight < content.offsetHeight )\n {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "cab526db4db21b96dbce3d5ee9eb52ba", "score": "0.693653", "text": "function isOverflown(element, parent) {\r\n \"use strict\";\r\n return element.offsetHeight > parent.offsetHeight || element.offsetWidth > parent.offsetWidth;\r\n}", "title": "" }, { "docid": "c1ec4b99c2b0334ad975eda378fb51eb", "score": "0.6924439", "text": "function checkOverflow(target) {\n var el = target[0];\n var curOverflow = el.style.overflow;\n if (!curOverflow || curOverflow === 'visible'){\n el.style.overflow = 'hidden';\n }\n var isOverflowing = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;\n el.style.overflow = curOverflow;\n return isOverflowing;\n}", "title": "" }, { "docid": "0d70c8aaa6e163062c16c647c38abb73", "score": "0.688718", "text": "function isOverflowing(container) {\n const doc = (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(container);\n\n if (doc.body === container) {\n return (0,_material_ui_utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(container).innerWidth > doc.documentElement.clientWidth;\n }\n\n return container.scrollHeight > container.clientHeight;\n}", "title": "" }, { "docid": "4e6673c78d2dce2f71e77f3c23d5d993", "score": "0.68558186", "text": "function hasVerticalOverflow(element) {\n\t return element.clientHeight < element.scrollHeight;\n\t}", "title": "" }, { "docid": "dbfc10ea939b622f535b31a02a4fca8a", "score": "0.67800933", "text": "_checkContentOverflow() {\n\t\tif(!this._element) {\n\t\t\tthis.debug(`checkContentOverflow::_element: null`);\n\t\t\treturn;\n\t\t}\n\n\t\tlet content = this._element.querySelector('md-dialog-content');\n\t\tif(!content) {\n\t\t\tthis.debug(`checkContentOverflow::content: null`);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.debug(`checkContentOverflow: ${content.scrollHeight > content.clientHeight}`);\n\t\tthis._contentOverflow = content.scrollHeight > content.clientHeight;\n\t}", "title": "" }, { "docid": "ed7553a4bd6fe42d0ebeba6c18f2b1ba", "score": "0.6629932", "text": "overflowCheck(el) {\r\n\t\tel.style.fontSize = this.displayFontSize; // sets fontSize to the default val\r\n\t\tel.style.paddingLeft = this.displayPaddingX; // sets left padding to the default val\r\n\t\tel.style.paddingRight = this.displayPaddingX; // sets right padding to the default val\r\n\t\tlet currPadding = parseInt(this.displayPaddingX.match(/\\d+/)); // gets the default padding in an integer\r\n\t\tlet currFontSize = parseInt(this.displayFontSize.match(/\\d+/)); // gets the default font-size in an integer\r\n\t\twhile (el.scrollWidth > el.clientWidth || el.scrollHeight > el.clientHeight) {\r\n\t\t\t// while content of el is overflowing...\r\n\t\t\tcurrPadding -= 1;\r\n\t\t\tcurrFontSize -= 1;\r\n\t\t\tel.style.fontSize = `${currFontSize}px`;\r\n\t\t\tel.style.paddingLeft = `${currPadding}px`;\r\n\t\t\tel.style.paddingRight = `${currFontSize}px`;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "cc6017c4720fcb2d9df836cbdc4db6ba", "score": "0.65919375", "text": "function isOverflowed(thisElement, useParent) {\n\t\t\t\t\tthisElement = useParent ? thisElement.parent() : thisElement;\n\t\t\t\t\treturn thisElement[0].scrollHeight > thisElement[0].clientHeight;\n\t\t\t\t}", "title": "" }, { "docid": "66ec568a79a11f98490a25a6ec560ca2", "score": "0.64887315", "text": "function isEllipsisActive(e) {\n\t\t//console.log(e);\n\t\t//console.log(e.offsetWidth + 2, e.scrollWidth);\n\t\treturn (e.offsetWidth + 2 < e.scrollWidth);\n\t}", "title": "" }, { "docid": "e24160b7cf1177b84c477c6b3d308099", "score": "0.6408845", "text": "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "title": "" }, { "docid": "e24160b7cf1177b84c477c6b3d308099", "score": "0.6408845", "text": "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "title": "" }, { "docid": "e24160b7cf1177b84c477c6b3d308099", "score": "0.6408845", "text": "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "title": "" }, { "docid": "e24160b7cf1177b84c477c6b3d308099", "score": "0.6408845", "text": "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "title": "" }, { "docid": "7b9addf4a8c5c69906ca80fd73183db9", "score": "0.63270944", "text": "function bodyIsOverflowing(node) {\n var doc = (0, _ownerDocument2.default)(node);\n var win = (0, _isWindow2.default)(doc);\n\n // Takes in account potential non zero margin on the body.\n var style = window.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}", "title": "" }, { "docid": "7b9addf4a8c5c69906ca80fd73183db9", "score": "0.63270944", "text": "function bodyIsOverflowing(node) {\n var doc = (0, _ownerDocument2.default)(node);\n var win = (0, _isWindow2.default)(doc);\n\n // Takes in account potential non zero margin on the body.\n var style = window.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}", "title": "" }, { "docid": "7b9addf4a8c5c69906ca80fd73183db9", "score": "0.63270944", "text": "function bodyIsOverflowing(node) {\n var doc = (0, _ownerDocument2.default)(node);\n var win = (0, _isWindow2.default)(doc);\n\n // Takes in account potential non zero margin on the body.\n var style = window.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}", "title": "" }, { "docid": "7b9addf4a8c5c69906ca80fd73183db9", "score": "0.63270944", "text": "function bodyIsOverflowing(node) {\n var doc = (0, _ownerDocument2.default)(node);\n var win = (0, _isWindow2.default)(doc);\n\n // Takes in account potential non zero margin on the body.\n var style = window.getComputedStyle(doc.body);\n var marginLeft = parseInt(style.getPropertyValue('margin-left'), 10);\n var marginRight = parseInt(style.getPropertyValue('margin-right'), 10);\n\n return marginLeft + doc.body.clientWidth + marginRight < win.innerWidth;\n}", "title": "" }, { "docid": "3f8e7ff068736d842953da9d04d2cc4d", "score": "0.62635666", "text": "function fitHorizontal(el, leftOffset){\n\tvar leftVal = parseInt(leftOffset) || $(el).offset().left;\n\treturn (leftVal + $(el).width() <= getWindowWidth() + getScrollLeft() && leftVal - getScrollLeft() >= 0);\n}", "title": "" }, { "docid": "2720db4edca72c6c681ef7b9956cc337", "score": "0.6126101", "text": "function checkTextOverflow() {\n // Check for any overflowing text\n let tableChildren = $($(table)[0]).find('td');\n for (var i = 0; i < tableChildren.length; i++) {\n let el = $(tableChildren).get(i);\n // Only check odd numbers in el list (The Value field) Assume all titles are set well\n if (i % 2 == 1) {\n let alreadyAssigned = $(el).hasClass('largeValue');\n let overflow = isGreater(el.scrollWidth, $(el).width());\n if (el.hasAttribute('data-scrollWidth')) {\n overflow = isGreater($(el).attr('data-scrollWidth'), $(el).width());\n }\n if (overflow && !(alreadyAssigned)) {\n // Add the data-scrollWidth attr so that it never changes\n $(el).addClass('largeValue').attr('data-scrollWidth', el.scrollWidth);\n }\n // If largeValue fix the overflow\n if ($(el).hasClass('largeValue')) {\n fixLargeValues(el);\n }\n }\n }\n }", "title": "" }, { "docid": "406888230f900b64081969076330a652", "score": "0.60970557", "text": "function is_truncated(element) {\n var $c = element\n .clone()\n .css({display: 'inline', width: 'auto', visibility: 'hidden'})\n .appendTo('body');\n\n if ($c.width() > element.width()) {\n result = true;\n } else {\n result = false;\n }\n\n $c.remove();\n return result;\n }", "title": "" }, { "docid": "dc63f1fd2d927cac85dd2ef72fae3c51", "score": "0.6077002", "text": "function inRange() {\n const currentHeight = Math.round(ellipsisContainer.getBoundingClientRect().height * 100) / 100;\n return currentHeight - 0.1 <= maxHeight; // -.1 for firefox\n }", "title": "" }, { "docid": "4d98426f8ac91048bac93f512ea7e6bc", "score": "0.604608", "text": "function hiddenByOverflow(e) {\n return getOverflowState(e) == OverflowState.HIDDEN &&\n Array.prototype.slice.call(e.childNodes).every(function(n) {\n return (n.nodeType != Node.ELEMENT_NODE) || hiddenByOverflow(n) ||\n !positiveSize(n);\n });\n }", "title": "" }, { "docid": "95a45e3101d9271ec090bafe061460e9", "score": "0.60303676", "text": "get overflow() {\n\t\treturn this.nativeElement ? this.nativeElement.overflow : undefined;\n\t}", "title": "" }, { "docid": "27844ea7da9d718e1bf8489b4c0531c6", "score": "0.59673786", "text": "get horizontalScrollBarVisibility() {\n\t\treturn this.nativeElement ? this.nativeElement.horizontalScrollBarVisibility : undefined;\n\t}", "title": "" }, { "docid": "e8185fb13a158766e17e8d470ea5d3b3", "score": "0.59330267", "text": "function checkVisibility(elem) {\n const viewportSize = getViewportSize();\n const currentScroll = getCurrentScroll();\n const elemInfo = getElemInfo(elem);\n const spaceOffset = 0.2;\n const elemHeight = elemInfo.height;\n const elemWidth = elemInfo.width;\n const elemTop = elemInfo.top;\n const elemLeft = elemInfo.left;\n const elemBottom = elemTop + elemHeight;\n const elemRight = elemLeft + elemWidth;\n\n const checkBoundaries = () => {\n // Defining the element boundaries and extra space offset\n const top = elemTop + elemHeight * spaceOffset;\n const left = elemLeft + elemWidth * spaceOffset;\n const bottom = elemBottom - elemHeight * spaceOffset;\n const right = elemRight - elemWidth * spaceOffset;\n\n // Defining the window boundaries and window offset\n const wTop = currentScroll.y + 0;\n const wLeft = currentScroll.x + 0;\n const wBottom = currentScroll.y - 0 + viewportSize.height;\n const wRight = currentScroll.x - 0 + viewportSize.width;\n\n // Check if the element is within boundary\n return top < wBottom && bottom > wTop && left > wLeft && right < wRight;\n };\n\n return checkBoundaries();\n}", "title": "" }, { "docid": "a5ef08190759135b667147101de216a2", "score": "0.5903726", "text": "function hasGeometry(element) {\n // Use logic from jQuery to check for an invisible element.\n // See https://github.com/jquery/jquery/blob/master/src/css/hiddenVisibleSelectors.js#L12\n return !!(element.offsetWidth || element.offsetHeight || typeof element.getClientRects === 'function' && element.getClientRects().length);\n }", "title": "" } ]
9857e0f56eb3ec5a2dfec9d8df8c3ef8
Linear Algebra Multiply two tensors and returns the result as a tensor. For 2D tensors, this is equivalent to matrix multiplication (matMul). For tensors of higher ranks, it follows the Theano behavior, (e.g. `(2, 3) (4, 3, 5) > (2, 4, 5)`). From the Theano documentation: For N dimensions it is a sum product over the last axis of x and the secondtolast of y:
[ { "docid": "b0e06f8b055f4845c6db83c4f0a8ddf1", "score": "0.6725363", "text": "function dot(a, b, activation, bias) {\n if ((a.rank < 2) || (b.rank < 2)) {\n throw new errors_1.NotImplementedError(\"dot requires both inputs to be rank >= 2\" +\n (\" but got x shape = \" + a.shape + \" and y shape = \" + b.shape));\n }\n if (b.rank >= 3) {\n var xLastDim = a.shape.slice(-1)[0];\n var ySecondLastDim = b.shape.slice(-2)[0];\n if (xLastDim !== ySecondLastDim) {\n throw new errors_1.NotImplementedError(\"If rank y >= 3, then the second last dim\" +\n (\" of y must equal the last dim of x but got x shape = \" + a.shape + \" and \") +\n (\" y shape = \" + b.shape));\n }\n }\n // Handle basic 2D x 2D case.\n if ((a.rank === 2) && (b.rank === 2)) {\n var transposeA = false;\n var transposeB = false;\n // tfc.fused.matMul only fuses certain activation functions. Unsupported\n // activation functions are treated as 'linear' activations, which is\n // equivalent to a no-op.\n return tfc.fused.matMul({\n a: a,\n b: b,\n transposeA: transposeA,\n transposeB: transposeB,\n bias: bias ? reshapeBias(a.rank, bias, common_2.imageDataFormat()) : null,\n activation: activation\n });\n }\n else {\n // Reshape x into the analogous 2D Tensor.\n var aFirstDims = a.shape.slice(); // Holds all but the last dim of x.\n var aLastDim = aFirstDims.pop();\n a = a.reshape([-1, aLastDim]);\n // Reshape y into the analogous 2D Tensor, and keep track of the\n // required dimensions to reproduce the output shape.\n var bShape = b.shape.slice();\n var bLastDim = bShape.pop();\n var ySecondLastDim = bShape.pop();\n var yOtherDims = bShape.concat([bLastDim]);\n // permutation should be like [r-2, 0, 1, 2, ... r-4, r-3, r-1]\n // where r is the rank of y.\n var perm = Array.from({ length: b.rank }, function (_, i) {\n if (i === 0) {\n return b.rank - 2;\n }\n else if (i <= b.rank - 2) {\n return i - 1;\n }\n return i;\n });\n b = b.transpose(perm).reshape([ySecondLastDim, -1]);\n // Multiply x and y as 2D Tensors, and then reshape back to original.\n var outputShape = aFirstDims.concat(yOtherDims);\n var transposeA = false;\n var transposeB = false;\n return tfc.fused\n .matMul({\n a: a,\n b: b,\n transposeA: transposeA,\n transposeB: transposeB,\n bias: bias ? reshapeBias(a.rank, bias, common_2.imageDataFormat()) : null,\n activation: activation\n })\n .reshape(outputShape);\n }\n}", "title": "" } ]
[ { "docid": "f08f86e8d9cf53684e402d57f724ef49", "score": "0.6781496", "text": "function matrixMultiply(a, b) {\n var bCols = transpose(b);\n\n return a.map(function (aRow) {\n return bCols.map(function (bCol) {\n return dotProduct(aRow, bCol);\n });\n });\n }", "title": "" }, { "docid": "d5abdff2718f0de63eb89e3a072461ff", "score": "0.65611607", "text": "function matrix_multiply(m1, m2){\n return math.multiply(math.matrix(m1), math.matrix(m2))\n}", "title": "" }, { "docid": "f13bea71b74ae51adaed42a7f18d6d28", "score": "0.64119416", "text": "function mat_mul (a, b) {\r\n\trowA = a.length;\r\n\trowB = b.length;\r\n\tcolA = a[0].length;\r\n\tcolB = b[0].length;\r\n\r\n let result = [];\r\n for (let t = 0; t < 4; t++) {\r\n \tresult.push([0, 0, 0, 0]);\r\n }\r\n\r\n for (let i = 0; i < rowA; i++) {\r\n for (let j = 0; j < colB; j++) {\r\n for (k = 0; k < rowB; k++) {\r\n result[i][j] += a[i][k] * b[k][j];\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n}", "title": "" }, { "docid": "1c126d0a99733f81777f0cd681209542", "score": "0.6265926", "text": "function MatMult(X, Y) {\n if (X.m !== Y.n) {\n console.log(\"attempted to use matmult with incompatible argument sizes\");\n return null;\n }\n var Z = new Matrix(X.n, Y.m);\n for (var i = 0; i < X.n; i++) {\n for (var j = 0; j < Y.m; j++) {\n var idx = Z.ix(i, j);\n Z.data[idx] = 0;\n for (var k = 0; k < Y.n; k++) {\n Z.data[idx] += X.data[X.ix(i, k)] * Y.data[Y.ix(k, j)];\n }\n }\n }\n return Z;\n}", "title": "" }, { "docid": "b7ef1cb7f7124d90e188061658378de6", "score": "0.625142", "text": "function dotProd(a,b){\n return a[0]*b[0] + a[1]*b[1] + a[2]*b[2];\n }", "title": "" }, { "docid": "cc815e63fe89bda798f7175887198870", "score": "0.6222607", "text": "function matrixMultiply(a, b) {\n var aNumRows = a.length, aNumCols = a[0].length,\n bNumRows = b.length, bNumCols = b[0].length,\n m = new Array(aNumRows); // initialize array of rows\n for (var r = 0; r < aNumRows; ++r) {\n m[r] = new Array(bNumCols); // initialize the current row\n for (var c = 0; c < bNumCols; ++c) {\n m[r][c] = 0; // initialize the current cell\n for (var i = 0; i < aNumCols; ++i) {\n m[r][c] += a[r][i] * b[i][c];\n }\n }\n }\n return m;\n}", "title": "" }, { "docid": "cc815e63fe89bda798f7175887198870", "score": "0.6222607", "text": "function matrixMultiply(a, b) {\n var aNumRows = a.length, aNumCols = a[0].length,\n bNumRows = b.length, bNumCols = b[0].length,\n m = new Array(aNumRows); // initialize array of rows\n for (var r = 0; r < aNumRows; ++r) {\n m[r] = new Array(bNumCols); // initialize the current row\n for (var c = 0; c < bNumCols; ++c) {\n m[r][c] = 0; // initialize the current cell\n for (var i = 0; i < aNumCols; ++i) {\n m[r][c] += a[r][i] * b[i][c];\n }\n }\n }\n return m;\n}", "title": "" }, { "docid": "ad1b0524e68bf9d0a6b43a96672da16f", "score": "0.618913", "text": "function matrixMultiply(a, b) {\n\n var n = a.length;\n var m = b.length;\n var p = b[0].length;\n\n // initialize n*p array of 0s\n var c = [];\n for (var i = 0; i < n; i += 1) {\n r = Array(p); r.fill(0.0);\n c.push(r);\n }\n\n for (var i = 0; i < n; i += 1) {\n for (var j = 0; j < p; j += 1) {\n for (var k = 0; k < m; k += 1) {\n c[i][j] += a[i][k] * b[k][j];\n }\n }\n }\n\n return c;\n}", "title": "" }, { "docid": "5b03d326dc5051cabaabe38f8ae0e967", "score": "0.61623526", "text": "function matrixMult(a, b) {\n var aM = a.length; //columns\n var aN = a[0].length; //rows\n var bP = b.length; //columns\n var bM = b[0].length; //rows\n if (aM != bM) {\n return undefined;\n }\n\n var out = [];\n for (var x = 0; x < bP; x++) {\n out[x] = [];\n for (var y = 0; y < aN; y++) {\n out[x][y] = 0;\n for (i = 0; i < aM; i++) {\n out[x][y] += a[i][y] * b[x][i];\n }\n }\n }\n return out;\n}", "title": "" }, { "docid": "180fa532a71984ae0eb2dddfea55cc93", "score": "0.6154164", "text": "function mulStrict_(a, b) {\n var $a = tensor_util_env_1.convertToTensor(a, 'a', 'mul');\n var $b = tensor_util_env_1.convertToTensor(b, 'b', 'mul');\n util.assertShapesMatch($a.shape, $b.shape, 'Error in multiplyStrict: ');\n return $a.mul($b);\n}", "title": "" }, { "docid": "180fa532a71984ae0eb2dddfea55cc93", "score": "0.6154164", "text": "function mulStrict_(a, b) {\n var $a = tensor_util_env_1.convertToTensor(a, 'a', 'mul');\n var $b = tensor_util_env_1.convertToTensor(b, 'b', 'mul');\n util.assertShapesMatch($a.shape, $b.shape, 'Error in multiplyStrict: ');\n return $a.mul($b);\n}", "title": "" }, { "docid": "79566276039d61cb28c2bc415d6fe4ea", "score": "0.61463416", "text": "static dot(_a, _b) {\n let scalarProduct = _a.X * _b.X + _a.Y * _b.Y + _a.Z * _b.Z;\n return scalarProduct;\n }", "title": "" }, { "docid": "bd2a20ebdc17bb27ffca571317985288", "score": "0.6131699", "text": "function dotProduct(a, b) {\n return a.x * b.x + a.y * b.y;\n}", "title": "" }, { "docid": "7306b2c2dc2cad07e0d090eb714a62ef", "score": "0.6131452", "text": "function mul(a, b) {\n _ch_checkArgs(arguments, 2, \"mul(a, b)\");\n return _ch_vecApply('mul', _ch_mul, a, b);\n}", "title": "" }, { "docid": "442c8ab63d2be7056a57d750f2bf69fa", "score": "0.60510194", "text": "function multiply (x, y) {\n\treturn x * y\n}", "title": "" }, { "docid": "ceaad85252e2fb5c381e83c7f458cbe8", "score": "0.5982062", "text": "function matrix_mult(x, y) {\n\n let m = x.length,\n n = x[0].length,\n p = y[0].length,\n q = y.length;\n\n if (m === 0 || q === 0)\n throw {\n name: 'Type Error',\n message: 'Input matrix should not be empty'\n };\n\n for (let i = 0; i < m - 1; i++) {\n if (x[i].length !== x[i + 1].length) {\n throw {\n name: 'TypeError',\n message: 'x is an invalid 2D matrix'\n };\n }\n }\n\n for (let i = 0; i < q - 1; i++) {\n if (y[i].length !== y[i + 1].length) {\n throw {\n name: 'TypeError',\n message: 'y is an invalid 2D matrix'\n };\n }\n }\n\n if (n !== q) {\n throw {\n name: \"TypeError\",\n message: \"Invalid matrix dimensions for matrix multiplication.\"\n };\n }\n var ans = [];\n for (let i = 0; i < m; i++)\n ans.push([]);\n\n for (let i = 0; i < m; i++) {\n for (let j = 0; j < p; j++) {\n sum = 0;\n for (let k = 0; k < n; k++)\n sum = sum ^ multiply(x[i][k], y[k][j]);\n ans[i][j] = sum;\n }\n }\n return ans;\n}", "title": "" }, { "docid": "984f43d4a469f88525c12d651beff805", "score": "0.59575766", "text": "function mul(x, y) {\n return x * y;\n}", "title": "" }, { "docid": "44721b5323b106e177c3a1f69c9f7f66", "score": "0.59155387", "text": "function product(x, y) {\n return x * y;\n }", "title": "" }, { "docid": "37e6761b4f98b8b5f49c5f6f61e84253", "score": "0.5890114", "text": "function multiply(x, y) {\n return x * y;\n }", "title": "" }, { "docid": "f77b3cf5d5997c62f83979a340189d15", "score": "0.5886541", "text": "function matrixMultiply(m1, m2) {\n// var m3 = ''\n// for (var i = 0; i < m1.length + 1; i++) {\n// for (var j = 0; j < m1[i].length; j++) {\n// m3 += ((m1[i][j] * m2[i][j]) + (m1[i][j + 1] * m2[i + 1][j]))\n// }\n// }\n// return m3\n}", "title": "" }, { "docid": "1dd8c143f75f3bc6e39a99a3926a92f4", "score": "0.587667", "text": "function scalarMultiply(A, b) {\n try {\n var dA = A.dim\n if (dA !== undefined) {\n if (dA === 2) {\n return Vec2(A.x * b, A.y * b)\n } else if (dA === 3) {\n return Vec3(A.x * b, A.y * b, A.z * b)\n } else {\n return Vec4(A.x * b, A.y * b, A.z * b, A.w * b)\n }\n } else\n return null\n } catch (err) {\n console.error(err)\n return null\n }\n }", "title": "" }, { "docid": "85409f6ef8915f291a45ddcc270747aa", "score": "0.5842743", "text": "function multiply(x, ...y) { // <--- rest operators\n return y.reduce((a, b) => a*b, x);\n}", "title": "" }, { "docid": "db958d4fb6e8fbc161e8ccf9bcdd26bb", "score": "0.5830078", "text": "function matMult(M1, M2){\n\tvar retM;\n\t\n\tretM[0] = (M1[0] * M2[0]) + (M1[1] * M2[3]) + (M1[2] * M2[6]);\n\tretM[1] = (M1[0] * M2[1]) + (M1[1] * M2[4]) + (M1[2] * M2[7]);\n\tretM[2] = (M1[0] * M2[2]) + (M1[1] * M2[5]) + (M1[2] * M2[8]);\n\tretM[3] = (M1[3] * M2[0]) + (M1[4] * M2[3]) + (M1[5] * M2[6]);\n\tretM[4] = (M1[3] * M2[1]) + (M1[4] * M2[4]) + (M1[5] * M2[7]);\n\tretM[5] = (M1[3] * M2[2]) + (M1[4] * M2[5]) + (M1[5] * M2[8]);\n\tretM[6] = (M1[6] * M2[0]) + (M1[7] * M2[3]) + (M1[8] * M2[6]);\n\tretM[7] = (M1[6] * M2[1]) + (M1[7] * M2[4]) + (M1[8] * M2[7]);\n\tretM[8] = (M1[6] * M2[2]) + (M1[7] * M2[5]) + (M1[8] * M2[8]);\n\t\n\treturn retM;\n}", "title": "" }, { "docid": "adc58e8d090739bdd024c8677606a8f2", "score": "0.58268243", "text": "function mul(n1, n2) {\n return n1 * n2;\n}", "title": "" }, { "docid": "adc58e8d090739bdd024c8677606a8f2", "score": "0.58268243", "text": "function mul(n1, n2) {\n return n1 * n2;\n}", "title": "" }, { "docid": "adc58e8d090739bdd024c8677606a8f2", "score": "0.58268243", "text": "function mul(n1, n2) {\n return n1 * n2;\n}", "title": "" }, { "docid": "56a88af965a6caae204be35e96928ddf", "score": "0.580761", "text": "function multiply(x, y){\n\treturn x * y;\n}", "title": "" }, { "docid": "7a2182f47cc57706164d67f32f0e5fbf", "score": "0.58065456", "text": "function vectorMult(first, second){\n var result = [];\n for(var i = 0; i < first.length; i++){\n for(var j = 0; j < second.length; j++){\n var x = first[i]*second[j];\n if(i+j >= result.length)\n result.push(x);\n else\n result[i+j] += x;\n }\n }\n return result;\n}", "title": "" }, { "docid": "f0e35c8ee77c56ddee4a06fe09f78559", "score": "0.58007205", "text": "static multiply(m1,m2){\n if(m1.cols !== m2.rows) throw Error(`Columns ${m1.cols} and Rows ${m2.rows} are not the same length`);\n const result = new Matrix(m1.rows, m2.cols); // # of rows from 1st and # of cols from 2nd\n for(let Arow = 0; Arow < result.rows; Arow++){\n for(let Bcol = 0; Bcol < result.cols; Bcol++){\n // DOT PRODUCTS OF VALUES IN COL\n let sum = 0;\n for(let itemIndex = 0; itemIndex < m1.cols; itemIndex++){\n sum += m1.data[Arow][itemIndex] * m2.data[itemIndex][Bcol];\n }\n result.data[Arow][Bcol] = sum;\n }\n }\n return result;\n }", "title": "" }, { "docid": "d90afcd7301674a78c6d8d896c7eafde", "score": "0.5777541", "text": "function multiply2(x, y, ...rest) {\n var values = [x,y ...rest];\n \n for(var i = 0; i < values.length; i++) {\n result *= values[i];\n }\n return result;\n \n }", "title": "" }, { "docid": "8b27526a6a3b6022a40e8dc84ae03b06", "score": "0.5771934", "text": "function mul(a, b) {\n return a * b;\n }", "title": "" }, { "docid": "b6e3d0137161e15aa4cdb4905288572b", "score": "0.5748281", "text": "function multiply(lhs, rhs)\n{\n\tvar resultMat = new Array(lhs.length);\n\tvar i, j, k;\n\t\n\tfor (i = 0; i < lhs.length; i++)\n\t{\n\t\tresultMat[i] = new Array(rhs[0].length);\t\t\n\t}\n\tfor (i = 0; i < lhs.length; i++)\n\t{\n\t\tfor (j = 0; j < rhs[0].length; j++)\n\t\t{\n\t\t\tvar value = 0;\n\t\t\tfor (k = 0; k < rhs.length; k++)\n\t\t\t{\n\t\t\t\tvalue = value + lhs[i][k] * rhs[k][j];\n\t\t\t}\n\t\t\tresultMat[i][j] = value;\n\t\t}\n\t}\n\treturn resultMat;\n}", "title": "" }, { "docid": "d9fdc653c5a26b6e2f271ce450e7cb7f", "score": "0.5747671", "text": "function pureMultiply(a, b) {\n return a * b;\n}", "title": "" }, { "docid": "1833214b681edfd68e134727eb69b72c", "score": "0.5742144", "text": "function multiplyMatrices(a,b){\r\n\tif(a[0].length !== b.length){\r\n\t\tconsole.log(\"Matrix multiplication not possible\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar product = [];\r\n\tfor(var a_row = 0; a_row < a.length; a_row++){\r\n\t\tproduct[a_row] = [];\r\n\t\tfor(var b_col = 0; b_col < b[0].length; b_col++){\r\n\t\t\t// each cell of the resulting matrix, 'product'\r\n\t\t\tvar cellABSum = 0; \r\n\t\t\tfor(var b_row = 0; b_row < b.length; b_row++){\r\n\t\t\t\tcellABSum += a[a_row][b_row]*b[b_row][b_col];\r\n\t\t\t}\r\n\t\t\tproduct[a_row][b_col] = cellABSum;\r\n\t\t}\r\n\t}\r\n\treturn product;\r\n}", "title": "" }, { "docid": "efa281117e2f2286d877cf352f4282f8", "score": "0.57416594", "text": "function vectorMultiplyMatrix(a, B) {\n\t//var A_x = 1;\n\tvar A_y = a.length;\n\tvar B_x = B[0].length;\n\tvar B_y = B.length;\n\t\n\tif (B_x != A_y) {\n\t\talert(\"Matrix inner dimensions must agree\");\n\t\treturn;\n\t}\n\t\t\n\tvar v = new Array(B_y);\n\tfor (var j = 0; j < B_y; j++) {\n\t\tv[j] = 0;\n\t}\n\t\t\n\tfor (var i = 0; i < A_y; i++) {\n\t\tvar Browi = B[i];\n\t\tfor (var j = 0; j < B_y; j++) {\n\t\t\t\tv[j] += a[i] * Browi[j];\n\t\t}\n\t}\n\treturn v;\n}", "title": "" }, { "docid": "3672522375b519772afdb83e4e1c0c78", "score": "0.5735502", "text": "static matrixMultiply(l, r, o) {\n // Work out the product directly\n const a = l.a * r.a + l.c * r.b;\n const b = l.b * r.a + l.d * r.b;\n const c = l.a * r.c + l.c * r.d;\n const d = l.b * r.c + l.d * r.d;\n const e = l.e + l.a * r.e + l.c * r.f;\n const f = l.f + l.b * r.e + l.d * r.f; // make sure to use local variables because l/r and o could be the same\n\n o.a = a;\n o.b = b;\n o.c = c;\n o.d = d;\n o.e = e;\n o.f = f;\n return o;\n }", "title": "" }, { "docid": "7c43e95fdc0938d339ecb4faab5035ef", "score": "0.57347035", "text": "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n }", "title": "" }, { "docid": "7c43e95fdc0938d339ecb4faab5035ef", "score": "0.57347035", "text": "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n }", "title": "" }, { "docid": "8018e3d02eaa2c2d2b6e0df62b43e418", "score": "0.57222664", "text": "function multiply(x, y) {\n\tvar result = x * y;\n\treturn result;\n}", "title": "" }, { "docid": "8c9abcb3282be63738dea53e3905251d", "score": "0.57215077", "text": "function multiply(a, b) {\n return [\n a[0] * b[0] + a[1] * b[3],\n a[0] * b[1] + a[1] * b[4],\n a[0] * b[2] + a[1] * b[5] + a[2],\n a[3] * b[0] + a[4] * b[3],\n a[3] * b[1] + a[4] * b[4],\n a[3] * b[2] + a[4] * b[5] + a[5]\n ];\n}", "title": "" }, { "docid": "9fc8ef27e286eb41cf2b030e587d4619", "score": "0.5718598", "text": "times (b) \r\n { const len = b.length; // Usage: M.times(b) where b can be a scalar, a Vec, or another Mat. Returns a new Mat.\r\n if( typeof len === \"undefined\" ) return this.map( r => r.map( x => b*x ) ); // Mat * scalar case.\r\n const len2 = b[0].length; \r\n if( typeof len2 === \"undefined\" )\r\n { let result = Vec.of( ...new Array( this.length ) ); // Mat * Vec case.\r\n for( var r=0; r < len; r++ ) result[r] = b.dot(this[r]); \r\n return result;\r\n }\r\n let result = Mat.from( new Array( this.length ) );\r\n for( let r = 0; r < this.length; r++ ) // Mat * Mat case.\r\n { result[ r ] = new Array( len2 );\r\n for( let c = 0, sum = 0; c < len2; c++ )\r\n { result[ r ][ c ] = 0;\r\n for( let r2 = 0; r2 < len; r2++ )\r\n result[ r ][ c ] += this[ r ][ r2 ] * b[ r2 ][ c ];\r\n }\r\n }\r\n return result;\r\n }", "title": "" }, { "docid": "348c5cf283b8caa2fcbb617309dd4e6b", "score": "0.57173616", "text": "dot(other) {\n return new Matrix(math.multiply(this.array, other.array));\n }", "title": "" }, { "docid": "243c541be4b780cad75935b17405aa62", "score": "0.57111484", "text": "function product(a, b) {\n return a * b;\n }", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "9717241712e5b1dcec1c8bdc15471c9e", "score": "0.5706595", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r)\n this.reduce(r)\n}", "title": "" }, { "docid": "75cd2c5a53678a4b147f3a98d59504de", "score": "0.5697087", "text": "function multiply(x, y) {\n return x * y;\n}", "title": "" }, { "docid": "75cd2c5a53678a4b147f3a98d59504de", "score": "0.5697087", "text": "function multiply(x, y) {\n return x * y;\n}", "title": "" }, { "docid": "75cd2c5a53678a4b147f3a98d59504de", "score": "0.5697087", "text": "function multiply(x, y) {\n return x * y;\n}", "title": "" }, { "docid": "c5bbf6cd608e4ae8d9d5ee632217df7e", "score": "0.5686993", "text": "function matrix_multiply(m1, m2) {\n // returns 2D array that is product of m1 and m2\n\n var mat = [];\n var i,j;\n\n var len = m2[0].length;\n var wid = m1.length;\n\n for (i=0;i<wid;i++) { //for each row of mat\n mat[i] = [];\n for (j=0;j<len;j++) { // for each column of mat\n var val = 0;\n //iterating to calculate mat[i][j]\n for(k=0;k<m1[0].length;k++) {\n val = val + m1[i][k]*m2[k][j];\n }\n mat[i][j] = val;\n }\n }\n\n return mat;\n}", "title": "" }, { "docid": "a5754431e5c356af787fcaad223c517f", "score": "0.56793016", "text": "function matMult(matrix1, matrix2) {\n var multipliedMatrix = [];\n for (var i = 0; i < matrix1.length; i++) {\n multipliedMatrix[i] = [];\n for (var j = 0; j < matrix1[i].length; j++) {\n var dotProduct = 0;\n for (var k = 0; k < matrix1[i].length; k++) {\n dotProduct += matrix1[i][k] * matrix2[k][j];\n }\n multipliedMatrix[i][j] = dotProduct;\n }\n }\n return multipliedMatrix;\n}", "title": "" }, { "docid": "769fcf5c3bdc99a8c389aa6946e74c38", "score": "0.5669025", "text": "_dotM(m1, m2) {\n let result = this._createNDArray([m1.length, m2[0].length]);\n for (let i = 0; i < m1.length; i++) {\n for (let j = 0; j < m2[0].length; j++) {\n let sum = 0;\n for (let k = 0; k < m1[0].length; k++) {\n sum += m1[i][k] * m2[k][j];\n }\n result[i][j] = sum;\n }\n }\n return result;\n }", "title": "" }, { "docid": "09ea067705b9025eb750712e19c2e75d", "score": "0.5668724", "text": "function dot(tensor1, tensor2){\n let [s1, s2] = [shape(tensor1), shape(tensor2)]; \n if(s1.length>2 || s2.length>2){\n return;\n }else if(s1.length===1 && s2.length===1){\n return dot1(tensor1, tensor2);\n }else if(s1.length===1 && s1[0]===s2[0]){\n tensor2 = transpose(tensor2);\n return tensor2.map(row => dot1(row, tensor1));\n }else if(s2.length===1 && s1.slice(-1)[0]===s2[0]){\n return tensor1.map(row => dot1(row, tensor2));\n }else if(s1.slice(-1)[0]===s2[0]){\n return dot2(tensor1, tensor2)\n }\n}", "title": "" }, { "docid": "1923157ac2edf2566b0011f227963769", "score": "0.56675506", "text": "static MultiplyVector(A, B) {\n\n\t\tvar Ax = A.length;\n\t\tvar Bx = B.length;\n\n\t\tif (Ax == Bx) {\n\n\t\t\tvar result = this.Create(Ax);\n\n\t\t\tfor (var x = 0; x < Ax; x++) {\n\n\t\t\t\tresult[x] = A[x] * B[x];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t}", "title": "" }, { "docid": "45bc8203d80c08e54625017e182decdc", "score": "0.56665677", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}", "title": "" }, { "docid": "337d860b7434a14d37dbd1e1724241cf", "score": "0.5664585", "text": "static Multiply(A, B) {\n\n\t\tvar Ax = A[0].length, Ay = A.length;\n\t\tvar Bx = B[0].length, By = B.length;\n\n\t\tif (Ax == By) {\n\n\t\t\tvar result = this.Create(Ay, Bx);\n\n\t\t\tfor (var y = 0; y < Ay; y++) {\n\t\t\t\tfor (var x = 0; x < Bx; x++) {\n\n\t\t\t\t\tresult[y][x] = 0;\n\n\t\t\t\t\tfor (var k = 0; k < Ax; k++) {\n\n\t\t\t\t\t\tresult[y][x] += A[y][k] * B[k][x];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\t}", "title": "" }, { "docid": "58ba7063a4c3967f1a279bccad7cc1b9", "score": "0.56623626", "text": "function multiplyMatrices(m1, m2) {\n var result = [];\n for (var i = 0; i < m1.length; i++) {\n result[i] = [];\n for (var j = 0; j < m2[0].length; j++) {\n var sum = 0;\n for (var k = 0; k < m1[0].length; k++) {\n sum += m1[i][k] * m2[k][j];\n }\n result[i][j] = sum;\n }\n }\n return result;\n }", "title": "" }, { "docid": "04c05c794e0c3e9004a3af7dbed9b97a", "score": "0.5660559", "text": "function mul(a, b) {\n return a * b;\n}", "title": "" }, { "docid": "d879abadfbfb992a4137ee23f93c10d3", "score": "0.5658826", "text": "function matrixMultiply(matrix1, matrix2) {\n let sum = 0;\n\n // Validating the cast parameters\n // => is it possible to multiply those matrices?\n // if (matrix1.length !== matrix2.length || matrix1[0].length !== matrix2[0].length) {\n // throw new Error(\"Invalid matrix multiplication.\");\n // }\n\n // The Math\n for (let y = 0; y < matrix1.length; y++) {\n for (let x = 0; x < matrix1[0].length; x++) {\n sum += matrix1[y][x] * matrix2[y][x];\n }\n }\n\n return sum;\n}", "title": "" }, { "docid": "a40d52a01b6c88f94d01d7790e018055", "score": "0.5656989", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}", "title": "" }, { "docid": "a40d52a01b6c88f94d01d7790e018055", "score": "0.5656989", "text": "function montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}", "title": "" }, { "docid": "def2b315e7abe74908068870b5642e84", "score": "0.56537074", "text": "function multiply(a, b) {\n\treturn a * b\n}", "title": "" }, { "docid": "cbd34aeb20d54104b6e7f874e387e12e", "score": "0.5643583", "text": "function multiply(x, y) {\r\n var result = x * y;\r\n return result;\r\n}", "title": "" }, { "docid": "977e90b2a0c2fb8337e0cccc6e8b990b", "score": "0.5642437", "text": "function\nd_tensor_tensor(p1, p2)\n{\n\tvar i, j, k, m, n, p3;\n\n\tn = p1.elem.length;\n\tm = p2.elem.length;\n\n\tp3 = alloc_tensor();\n\n\tfor (i = 0; i < n; i++) {\n\t\tfor (j = 0; j < m; j++) {\n\t\t\tpush(p1.elem[i]);\n\t\t\tpush(p2.elem[j]);\n\t\t\tderivative();\n\t\t\tp3.elem[m * i + j] = pop();\n\t\t}\n\t}\n\n\t// dim info\n\n\tk = 0;\n\n\tn = p1.dim.length;\n\n\tfor (i = 0; i < n; i++)\n\t\tp3.dim[k++] = p1.dim[i];\n\n\tn = p2.dim.length;\n\n\tfor (i = 0; i < n; i++)\n\t\tp3.dim[k++] = p2.dim[i];\n\n\tpush(p3);\n}", "title": "" }, { "docid": "6ada14ed567fc58880d4e56998c02a8d", "score": "0.5639207", "text": "function getProduct(x, y){\n return x * y;\n}", "title": "" }, { "docid": "f570373257ced5e50009505fcd8ea801", "score": "0.5636311", "text": "function matrixProduct(a, b) {\n var r = [\n a[0] * b[0] + a[2] * b[1],\n a[1] * b[0] + a[3] * b[1],\n a[0] * b[2] + a[2] * b[3],\n a[1] * b[2] + a[3] * b[3]\n ];\n var along = (a.length == 6);\n if (b.length == 6) {\n r.push(a[0] * b[4] + a[2] * b[5] + (along ? a[4] : 0));\n r.push(a[1] * b[4] + a[3] * b[5] + (along ? a[5] : 0));\n } else if (along) {\n r.push(a[4]);\n r.push(a[5]);\n }\n return r;\n}", "title": "" }, { "docid": "3c9849a241ab05c51d313dd949a0f9e6", "score": "0.5631967", "text": "function multiply(x, y) {\n return x * y;\n}", "title": "" }, { "docid": "3c9849a241ab05c51d313dd949a0f9e6", "score": "0.5631967", "text": "function multiply(x, y) {\n return x * y;\n}", "title": "" }, { "docid": "6257829221bf69d64b732f8c8e681cbb", "score": "0.5629778", "text": "_dotMWith(m1, m2, sumFunc, productFunc) {\n let result = this._createNDArray([m1.length, m2[0].length]);\n for (let i = 0; i < m1.length; i++) {\n for (let j = 0; j < m2[0].length; j++) {\n let sum = productFunc(m1[i][0], m2[0][j]);\n for (let k = 1; k < m1[0].length; k++) {\n sum = sumFunc(sum, productFunc(m1[i][k], m2[k][j]));\n }\n result[i][j] = sum;\n }\n }\n return result;\n }", "title": "" }, { "docid": "50aeb8ccd4dc5c3e10a559fef722d7b4", "score": "0.5625112", "text": "function montMulTo(x, y, r) { x.multiplyTo(y, r); this.reduce(r); }", "title": "" }, { "docid": "50aeb8ccd4dc5c3e10a559fef722d7b4", "score": "0.5625112", "text": "function montMulTo(x, y, r) { x.multiplyTo(y, r); this.reduce(r); }", "title": "" }, { "docid": "50aeb8ccd4dc5c3e10a559fef722d7b4", "score": "0.5625112", "text": "function montMulTo(x, y, r) { x.multiplyTo(y, r); this.reduce(r); }", "title": "" }, { "docid": "50aeb8ccd4dc5c3e10a559fef722d7b4", "score": "0.5625112", "text": "function montMulTo(x, y, r) { x.multiplyTo(y, r); this.reduce(r); }", "title": "" }, { "docid": "50aeb8ccd4dc5c3e10a559fef722d7b4", "score": "0.5625112", "text": "function montMulTo(x, y, r) { x.multiplyTo(y, r); this.reduce(r); }", "title": "" }, { "docid": "50aeb8ccd4dc5c3e10a559fef722d7b4", "score": "0.5625112", "text": "function montMulTo(x, y, r) { x.multiplyTo(y, r); this.reduce(r); }", "title": "" }, { "docid": "9ed10fdc0ab5d5c1260fc1ad3a4d4fa0", "score": "0.5619072", "text": "function multiply(x, y) {\r\n return x * y;\r\n}", "title": "" }, { "docid": "b92266f4f42119a9d5711c919a681363", "score": "0.5618818", "text": "function multiply(n1, n2) {\n return n1 * n2;\n}", "title": "" }, { "docid": "b8aa637d9967440e194aedc557d7c966", "score": "0.56180155", "text": "function montMulTo(x,y,r) { x._multiplyTo(y,r); this._reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" }, { "docid": "5fdcbd75310623dcdff24bfc0fd760d4", "score": "0.56173277", "text": "function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }", "title": "" } ]
1f11bb79a24bba498515d654b10199f0
STEP 2 LOAD JS Modules
[ { "docid": "5cd87939a2dee5351e7b3b8d79fee93d", "score": "0.0", "text": "function initScripts(_data){\n\t$('.C_LoaderText').text(\"Initializing scripts.\");\n\tcourseData = _data;\n\t////console.log(data);\n\n\t// Create new ieUserAgent object\n\tvar ieUserAgent = {\n\t init: function () {\n\t // Get the user agent string\n\t var ua = navigator.userAgent;\n\t this.compatibilityMode = false;\n\n\t // Detect whether or not the browser is IE\n\t var ieRegex = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n\t if (ieRegex.exec(ua) == null){\n\t this.exception = \"The user agent detected does not contain Internet Explorer.\";\n\t }else{\n\t \tisIE = true;\n\t }\n\n\t // Get the current \"emulated\" version of IE\n\t this.renderVersion = parseFloat(RegExp.$1);\n\t this.version = this.renderVersion;\n\n\t // Check the browser version with the rest of the agent string to detect compatibility mode\n\t if(document.documentMode == 5 || document.documentMode == 6 || document.documentMode == 7){\n\t \tthis.compatibilityMode = true;\n\t \tthis.version = document.documentMode;\n\t }\n\t else if (ua.indexOf(\"Trident/6.0\") > -1) {\n\t if (ua.indexOf(\"MSIE 7.0\") > -1) {\n\t this.compatibilityMode = true;\n\t this.version = 10; // IE 10\n\t }\n\t }\n\t else if (ua.indexOf(\"Trident/5.0\") > -1) {\n\t if (ua.indexOf(\"MSIE 7.0\") > -1) {\n\t this.compatibilityMode = true;\n\t this.version = 9; // IE 9\n\t }\n\t }\n\t else if (ua.indexOf(\"Trident/4.0\") > -1) {\n\t if (ua.indexOf(\"MSIE 7.0\") > -1) {\n\t this.compatibilityMode = true;\n\t this.version = 8; // IE 8\n\t }\n\t }\n\t else if (ua.indexOf(\"MSIE 7.0\") > -1){\n\t this.version = 7; // IE 7\n\t this.compatibilityMode = true; //not truly compatibilityMode IE7 is not supported\n\t }\n\n\t else{\n\t \tthis.compatibilityMode = false;\n\t this.version = -1; // IE 6\n\t }\n\n\t }\n\t};\n\n\t// Initialize the ieUserAgent object\n\tieUserAgent.init();\n\n var val = \"IE\" + ieUserAgent.renderVersion;\n if(ieUserAgent.renderVersion == 7){\n \tval += \" or Compatibility View\";\n }\n if (ieUserAgent.compatibilityMode)\n {\n val += \" Compatibility Mode (IE\" + ieUserAgent.version + \" emulation)\";\n //alert(val);\n \t$('body').empty();\n\t\t$('body').append(\"<div style=\\\"background-color: #FFFFFF\\\"> <p>We have detected the following IE browser: \" + val + \"<br/><br/>\"+\n\t\t\t\"This content has been tested on IE8+, Chrome, Firefox and Safari but does not support Compatibility Mode or Document Mode of \\\"Quirks Mode\\\" and \\\"IE7 Standards\\\" in IE.<br/></p>\"+\n\t\t\t\"<p>Instructions for disabling Compatibility Mode:</p>\"+\n\t\t\t\"<ol><li>Go to tools (on the top) on Internet Explorer 8, 9 or 10.</li>\"+\n\t\t\t\"<li>Click on \\\"Compatibility View Settings\\\".</li>\"+\n\t\t\t\"<li>Uncheck \\\"Display intranet sites in Compatibility View.” \\\".</li>\"+\n\t\t\t\"<li>Uncheck \\\"Display all websites in compatibility view\\\" if it is checked.</li>\"+\n\t\t\t\"<li>Click on \\\"Close\\\". You are now done. Please refresh the page.</li></ol></div>\");\n }\n else{\n\n\t\ttotalPages = $(data).find('page').length;\n\t\tvar ckpath = corePath + \"js/libs/ckeditor/ckeditor.js\";\n\t\tvar ckAdapath = corePath + \"js/libs/ckeditor/adapters/jquery.js\";\n\t\tmode = $(data).find('mode').attr(\"value\");\n\t\tif(mode == \"production\" || mode == \"Production\" || mode == \"prod\"){\n\t\t\tcorePath = \"../\";\n\t\t\tckpath = '';\n\t\t\tckAdapath = '';\n\t\t}\n\n\t // This will prevent errors on slow connections. We might need to set it to an actual number, as 0 means no timeout.\n\t require.config({\n\t waitSeconds: 0\n\t });\n\n\t /*require([corePath + 'js/libs/socket.io.js'], function(foo){\n\t\t\tio = foo;\n\t\t});*/\n\t\t//GATHERING AND LOADING ALL OF THE ENGINE PARTS\n\t\trequire([\n\t\t\t//Funtionality/utilities\n\t\t\t\t\tcorePath +\"js/libs/jquery.min.js\",\n\t\t\t\t\tcorePath +\"js/libs/jqueryui/jquery-ui.min.js\",\n\t\t\t\t\tcorePath +\"js/libs/jquery.magnific-popup.js\",\n\t\t\t\t\tcorePath +\"js/libs/SCORM_API_wrapper.js\", //SCORM capabilities\n\t\t\t\t\tcorePath +\"js/libs/jquery.ui.touch-punch.min.js\", //Adds touch drag to touchscreen devices.\n\t\t\t\t\tcorePath +\"js/libs/overthrow.min.js\",\n\t\t\t\t\tckpath,\n\t\t\t\t\tckAdapath,\n\t\t\t\t\tcorePath +\"js/libs/C_DynamicBackgroundImage.js\", //Allows us to set an image background on all browsers\n\t\t\t\t\tcorePath +\"js/libs/mediaElement/mediaelement-and-player.js\", //Our audio and video solution\n\t\t\t\t\tcorePath +\"js/libs/velocity.min.js\", //Our animation library.\n\t\t\t\t\tcorePath +\"js/libs/jquery.swfobject.1-1-1.min.js\", //Method to embed .swf files.\n\t\t\t\t\tcorePath +\"js/libs/jquery.nestable.js\",\n\t\t\t\t\tcorePath +\"js/libs/jquery.browser.js\",\n\t\t\t\t\tcorePath +\"js/libs/jquery.corner.js\",\n\t\t\t\t\tcorePath +\"js/libs/modernizr.js\",\n\t\t\t\t\tcorePath +\"js/libs/siofu/client.js\",\n\t\t\t\t\tcorePath +\"js/libs/socket.io/socket.io.min.js\",\n\t\t\t\t\tcorePath +\"js/libs/underscore-min.js\",\n\t\t\t\t\tcorePath +\"js/libs/pretty-data.js\",\n\t\t\t\t\tcorePath +\"js/libs/jquery.alphanum.js\",\n\t\t\t\t\tcorePath +\"js/libs/widget2chart.js\",\n\t\t\t\t\tcorePath +\"js/libs/chart.min.js\",\n\t\t\t//Import Cognizen layout templates\n\t\t\t\t\tcorePath +\"js/templates/C_Branching.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Categories.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Chaining.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_ClickImage.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_ClickListRevealText.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Completion.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Pathing.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_StaticContent.js\", //All text and static media pages - text, .jpg, .png, .swf\n\t\t\t\t\tcorePath +\"js/templates/C_TabbedContent.js\", //Tabs can be added to static by power users but this is more user friendly.\n\t\t\t\t\tcorePath +\"js/templates/C_Reveal.js\", //Reveal text upon clicking on an image.\n\t\t\t\t\tcorePath +\"js/templates/C_Flashcard.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Unity3D.js\", //Template for importing Unity 3D swf files - requires more than regular swf\n\t\t\t//Import Cognizen Knowledge Check templates\n\t\t\t\t\tcorePath +\"js/templates/C_MultipleChoiceFancy.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_MultipleChoice.js\", //Multiple choice quizzing\n\t\t\t\t\tcorePath +\"js/templates/C_MultipleChoiceImage.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Matching.js\", //Matching quizzing\n\t\t\t\t\tcorePath +\"js/templates/C_QuestionBank.js\", //Matching quizzing\n\t\t\t\t\tcorePath +\"js/templates/C_Sequencing.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_TextInput.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_EssayCompare.js\",\n\t\t\t\t\tcorePath +\"js/templates/C_Slider.js\",\n\t\t\t//Import Cognizen Components\n\t\t\t\t\tcorePath +\"js/components/C_PageTitle.js\",\n\t\t\t\t\tcorePath +\"js/components/C_VisualMediaHolder.js\",\n\t\t\t\t\tcorePath +\"js/components/C_AudioHolder.js\",\n\t\t\t\t\tcorePath +\"js/components/C_MediaBrowser.js\",\n\t\t\t//Import Cognizen Utilities\n\t\t\t\t\tcorePath +\"js/util/C_Access.js\",\n\t\t\t\t\tcorePath +\"js/util/C_AddPage.js\",\n\t\t\t\t\tcorePath +\"js/util/C_API.js\",\n\t\t\t\t\tcorePath +\"js/util/C_Comment.js\",\n\t\t\t\t\tcorePath +\"js/util/C_DocList.js\",\n\t\t\t\t\tcorePath +\"js/util/C_EditorToolbarFormat.js\",\n\t\t\t\t\tcorePath +\"js/util/C_Glossary.js\",\n\t\t\t\t\tcorePath +\"js/util/C_Index.js\",\n\t\t\t\t\tcorePath +\"js/util/C_Lock.js\",\n\t\t\t\t\tcorePath +\"js/util/C_NavControl.js\",\n\t\t\t\t\tcorePath +\"js/util/C_ScrubContent.js\",\n\t\t\t\t\tcorePath +\"js/util/C_SCORM.js\",\n\t\t\t\t\tcorePath +\"js/util/C_Sockets.js\",\n\t\t\t\t\tcorePath +\"js/util/C_UtilFunctions.js\",\n\t\t\t//Give mouse super powers.\n\t\t\t\t\tcorePath +\"js/libs/jquery.mousewheel-3.0.6.pack.js\",\n\t\t\t\t\tcorePath +\"js/libs/antiscroll.js\"\n\t\t], loadStreamer);\n\t}\n\tif((ieUserAgent.renderVersion < 10) || (document.documentMode < 10)){\n oldIE = true;\n\t}\n}", "title": "" } ]
[ { "docid": "54282166765a6160a1f7fad359b81222", "score": "0.6826816", "text": "function loadModule(a){\n\tfor(var i=0;i<a.length;i++){\n\t\tdocument.write('<script src=\"../modules/'+a[i]+'\"><\\/script>');\n\t}\n}", "title": "" }, { "docid": "a2e120573bd7a4ddd713bc31d84fab55", "score": "0.6826014", "text": "function autoJsModule() {\n // Is the pageJS variable declared in your route vars? Load it.\n if (typeof pageJs !== 'undefined') {\n // Require the module via webpack's dynamic context module\n const pageModule = require(`./pages/${pageJs}`);\n // Does the module have an init()? Run it, w/ config included.\n if (pageModule && typeof pageModule.init === 'function') {\n pageModule.init(config);\n }\n }\n}", "title": "" }, { "docid": "a2e120573bd7a4ddd713bc31d84fab55", "score": "0.6826014", "text": "function autoJsModule() {\n // Is the pageJS variable declared in your route vars? Load it.\n if (typeof pageJs !== 'undefined') {\n // Require the module via webpack's dynamic context module\n const pageModule = require(`./pages/${pageJs}`);\n // Does the module have an init()? Run it, w/ config included.\n if (pageModule && typeof pageModule.init === 'function') {\n pageModule.init(config);\n }\n }\n}", "title": "" }, { "docid": "6e6c67fd3f658e4ac7cc0139b14f2b08", "score": "0.6797366", "text": "function loadModules() {\r\n SmartModule.modules.map(module=>{\r\n addModule(module.moduleName, module.moduleFunction, module.moduleInfo);\r\n })\r\n if(SmartModule.moduleExtensions) {\r\n SmartModule.moduleExtensions.map(module=>{\r\n addModule(module.moduleName, module.moduleFunction, module.moduleInfo, true);\r\n }) \r\n }\r\n }", "title": "" }, { "docid": "96f95aba5bbda6851b2b45bce5aadfa3", "score": "0.66418767", "text": "function loadJS() {\n const files = glob.sync(path.join(__dirname, 'main-process/*.js'));\n files.forEach((file) => {\n require(file);\n });\n}", "title": "" }, { "docid": "75bb3e19c60bfaf5d0ffb462d18c66ff", "score": "0.65892214", "text": "function load(){\t\t\n\tvar EXTRAS = typeof IMPORT == 'undefined' ? \"\" : IMPORT;\n\t\n\tloadJS(WEB_PATH+\"/jscore/dobleos/dobleosapiclient.v2.js\");/** API de llamadas al core */\n\tloadCSS(WEB_PATH+\"/applications/_commons/_css/application.v3.css\");/** estilo generico */\n\tloadCSS(WEB_PATH+\"/applications/\"+MODULE_NAME+\"/css/application.css\");/** estilo propio de la ventana*/\n\t/** Jquer UI */\n\tloadCSS(WEB_PATH+\"/jscore/system/jquery-ui.min.css\");\n\tloadJS(WEB_PATH+\"/jscore/system/jquery-ui.min.js\");\n\t/** GRID **/\n\tloadCSS(WEB_PATH+\"/jscore/system/pqgrid.min.css\");\n\tloadJS(WEB_PATH+\"/jscore/system/pqgrid.min.js\");\n\tloadJS(WEB_PATH+\"/jscore/system/pq-localize-es.js\");\n\t/** Bloqueo pantalla */\n\tloadJS(WEB_PATH+\"/jscore/system/jquery.blockUI.min.js\");\n\t/** mascaras en los campos */\n\tloadJS(WEB_PATH+\"/jscore/extras/jquery.maskMoney.min.js\");\n\t/** JS modulo en ejecucion */\n\tloadJS(WEB_PATH+\"/applications/\"+MODULE_NAME+\"/js/application.js\");\n\t/** grid lista */\n\tif ( EXTRAS.indexOf('simple-details')!=-1 )\n\t\tloadJS(WEB_PATH+\"/jscore/system/simple-details.js\");\n\t/** updload */\n\tif ( EXTRAS.indexOf('upload')!=-1 ){\t\t\n\t\tloadJS(WEB_PATH+\"/jscore/extras/upload/jquery.fileupload.js\");\n\t\tloadJS(WEB_PATH+\"/jscore/extras/upload/jquery.ui.widget.js\");\n\t}\n\n}", "title": "" }, { "docid": "5a60cd615c7cf10edaeac78374f3482c", "score": "0.6525639", "text": "function loadModules()\n{\n Crafty.modules('http://cdn.craftycomponents.com', {\n CraftyBox2d: 'release'\n }, function() {\n console.log(\"loadGame()>>> Modules loaded!\");\n \n initGame();\n });\n}", "title": "" }, { "docid": "b0a4057d27a49d41cb54308b0cbea21d", "score": "0.64942104", "text": "function loadExternalScripts()\n\t{ \n\t\tloadExternalCSS(\"./codemirrorBare/lib/codemirror.css\");\n\t\tloadExternalJavaScript(\"./codemirrorBare/lib/codemirror.js\");\n\t\tloadExternalJavaScript(\"./codemirrorBare/mode/meta.js\");\n\t\tloadExternalJavaScript(\"./codemirrorBare/addon/mode/loadmode.js\");\n\t\tloadExternalJavaScript(\"./codemirrorBare/addon/runmode/runmode.js\", true);\n\t}", "title": "" }, { "docid": "45d8c95374b0bb29204ece498ea62d54", "score": "0.6486594", "text": "loadScript(name) {\n return window.exposeModulesForTests()\n .then(() => window.exposedModules._loadScript(name));\n }", "title": "" }, { "docid": "87032bec98bbec8a407bdd569c9f4439", "score": "0.6481922", "text": "function load_module()\r\n {\r\n document.addEventListener('d2n_gamebody_reload', function(event) {\r\n if (!D2N.is_on_page_in_city('bank') && !D2N.is_outside()) {\r\n return;\r\n }\r\n\r\n var module = Module.get(\"external_tools_bar\");\r\n JS.wait_for_id(module.container_id, function(node){\r\n\r\n if (module === null || !module.is_enabled()) {\r\n return;\r\n }\r\n\r\n module.actions.refresh();\r\n });\r\n }.bind(this), false);\r\n }", "title": "" }, { "docid": "ffb8efd868e84f9a43f23a40fa28836d", "score": "0.6394357", "text": "function use_labjs_loader($L) {\n Rdbhost.loader = loader = function(nm, f) {\n $L.script(nm).wait(function() {\n f();\n })\n }\n }", "title": "" }, { "docid": "7af43aa535b42262d09e58120eb628d6", "score": "0.633098", "text": "function load()\n{\n dashcode.setupParts();\n doInit();\n}", "title": "" }, { "docid": "4ae413e9bd3afb3837237c9e635c4bf8", "score": "0.6321947", "text": "function loadDemos() {\n const files = glob.sync(path.join(__dirname, \"main-process/**/*.js\"));\n files.forEach(file => {\n require(file);\n });\n //autoUpdater.updateMenu();\n\n \n}", "title": "" }, { "docid": "1256f76c21baaaf70035771a31546f05", "score": "0.6266255", "text": "function load() {\n dashcode.setupParts();\n}", "title": "" }, { "docid": "fa168248671485aad6c86ecc5d8f049d", "score": "0.62623966", "text": "function _loadModule() {\n console.log('Loading Modules', currentState, modules);\n for(var i in modules){\n if(modules[i].tab == currentState.viewport) modules[i].module.activate();\n }\n }", "title": "" }, { "docid": "ba5b119ddc25e4c85d3f807313b5fac4", "score": "0.62610686", "text": "function loadWebAssemblyModule() {}", "title": "" }, { "docid": "ad276f0ddfd8a6d38010f5c823256b84", "score": "0.62412196", "text": "function AddModule(mFileName) //Takes the Javascript file name and adds it to the document as a script\n{\n var sTag = document.createElement(\"script\"); //Create a SCRIPT tag\n sTag.setAttribute(\"src\", mFileName); //Set the SCRIPT src=mFileName\n sTag.setAttribute(\"type\", \"text/javascript\"); //set the SCRIPT type=\"text/javascript\"\n hHead.appendChild(sTag); //Add it to your header section (parsed and run immediately)\n}", "title": "" }, { "docid": "f9a4cc752e8e8c2fa8ca7954691e9030", "score": "0.6240619", "text": "function GlobalScriptLoader() {\n}", "title": "" }, { "docid": "09e436451ea5effd7ad1049078e0cd08", "score": "0.6222382", "text": "function onModuleLoaded(e)\n\t{\n\t\t// -- resolve plugin id\n\t\tif (e.url) var name = e.url;\n\t\telse var name = e.target.src;\n\t\tvar dot = name.lastIndexOf(\".\");\n\t\tvar tail = name.slice(dot);\n\t\tif (tail == \".pexe\") name = name.slice(0,dot) + \".nmf\"; \n\t\tvar id = modules[name];\n\t\tmodules[name] = e.path[0];\n\t\t\n\t\tif (id)\n\t\t{\n\t\t\tvar plug = plugins[id];\n\t\t\tif (!plug.isPNaCl)\t// todo: how to load multiple emscripten modules ?\n\t\t\t\tDAWPlugin.prototype.c_createPlugin = Module.cwrap(\"createPlugin\", \"string\", [\"number\",\"number\",\"number\"]);\n\t\t\tplug.create();\n\t\t\tif (pending[name])\n\t\t\t{\n\t\t\t\tpending[name].forEach(function(plug) { plug.create(); });\n\t\t\t\tpending.splice(pending.indexOf(pending[name]), 1);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.62106174", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.62106174", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.62106174", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "7d9a5d8bf59e168ad8d4675523a4c206", "score": "0.62106174", "text": "function load()\n{\n dashcode.setupParts();\n}", "title": "" }, { "docid": "16670dabdff8d3b67d3a76533890a6b8", "score": "0.61908793", "text": "function importScripts() {\n for (var i = 0; i < arguments.length; i++) {\n document.getElementsByTagName(\"head\")[0].appendChild(\n newNode('script', {\n src: builder.urlFor(\"js/\" + arguments[i]),\n type: \"text/javascript\"\n }));\n }\n }", "title": "" }, { "docid": "e333c8c06270a5f618d96082d0511a1f", "score": "0.61559", "text": "function loadJS(link) {\n loadScripts(link,function(){\n trace('Scripts loaded');\n init();\n });\n}", "title": "" }, { "docid": "74e8b0243c62daa6016631e67a8b2ad2", "score": "0.6141461", "text": "function load_scripts() {\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n\n script.src = '/1_starting_projects/2_terms_page/js/min.js/jquery.min.js';\n head.appendChild(script);\n\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/2_terms_page/js/min.js/bootstrap.min.js';\n head.appendChild(script);\n\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/2_terms_page/js/min.js/popper.min.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/2_terms_page/js/min.js/modernizr-2.6.2.min.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/2_terms_page/js/min.js/jquery.isotope.min.js';\n head.appendChild(script);\n\n\n \n script = document.createElement('script');\n script.src = '/1_starting_projects/2_terms_page/js/main.js';\n head.appendChild(script);\n\n script = document.createElement('script');\n script.src = '/1_starting_projects/2_terms_page/js/initialize.js';\n head.appendChild(script);\n\n \n \n \n}", "title": "" }, { "docid": "c9dab13aa199d7c60e77ad75ddf8025c", "score": "0.6134902", "text": "async load(link){\n\t\tif(!link){\n\t\t\tlink = new Location(window.location.href);\n\t\t}\n\t\t\n\t\t// Load all missing javascript libraries.\n\t\ttry{\n\n\t\t\tlet main = await import(`/ui/modules/${link.module()}/${this._descriptor.controller}`);\n\t\t\tthis._menu = main.menu;\n\t\t\tmodules[link.module()]=this; // Register module.\n\t\t\t\n\t\t\tfor(let i=0; i < this._descriptor.applications.length; i++){\n\t\t\t\ttry{\n\t\t\t\t\tlet app = this._descriptor.applications[i];\n\t\t\t\t\tlet library = await import(`/ui/modules/${this._descriptor.module}/${app.application||app}/${app.controller||'controller.js'}`);\n\t\t\t\t\tthis.addApplication({'name':`${app.application||app}`,\n\t\t\t\t\t\t\t\t\t \t 'menu':library.menu});\n\t\t\t\t} catch(e){\n\t\t\t\t\talert(e);\n\t\t\t\t\tconsole.log(`/ui/modules/${link.module()}/${this._descriptor.applications[i]} reported a ${e}`);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlet templateLoader = new Html(`/ui/modules/${this._descriptor.module}/${this._descriptor.template}`);\n\t\t\tthis._moduleTemplate = await templateLoader.load();\n\t\t\ttemplateLoader = new Html(`/ui/modules/${this._descriptor.module}/${this._descriptor.menu_template}`);\n\t\t\tthis._menuTemplate = await templateLoader.load();\n\t\t\t\n\t\t\twindow.dispatchEvent(new CustomEvent('UIModuleLoaded',{'detail':{'module':this,'location':link}}));\n\t\t\t\n\t\t} catch (e){\n\t\t\talert(`/ui/modules/${link.module()}/${this._descriptor.controller} reported a ${e}`);\n\t\t\tthrow e;\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "5c626370a79754f6cdb3c8a5cb33a26e", "score": "0.61085165", "text": "function load_module(where_to_add,obj)\n {\n // $(where_to_add).add_loading();\n $.get('../engine/req_modules_handler.php',obj,function(response_html){\n $(where_to_add).empty().html(response_html);\n\t end_progressbar();\t\n return true;\n\t });\n\t return false;\n }", "title": "" }, { "docid": "7214ab7b05662c6cf1c22903b540f3f5", "score": "0.6107758", "text": "function loadScript()\n{\n}", "title": "" }, { "docid": "c1a6bffa5f51d04944ca71fa0bd73a2f", "score": "0.6091976", "text": "function importAll() {\n requireDir = require('require-dir');\n lib_js = requireDir('./js');\n console.log('import js scripts from client.js')\n}", "title": "" }, { "docid": "c7b38b033e4252ddcf27b200a8c115c7", "score": "0.6064898", "text": "function load(){\n\t // b()\n\t tool()\n\t console.log('全部文件都从一个入口打包')\n\t //虽然始终会加载\n\t if(true){\n\t __webpack_require__.e/* nsure */(2, function(require){\n\t var di = __webpack_require__(13)\n\t })\n\t }\n\t}", "title": "" }, { "docid": "c1ec63fcbad82a41bb879467d772749e", "score": "0.6051771", "text": "function restoreJsLoader() {\r\n require.extensions[\".js\"] = originalLoader;\r\n}", "title": "" }, { "docid": "5f3e57b94f373191ce2a238ea67e3d77", "score": "0.60362065", "text": "loadServerScripts() {\n // @TODO: implement me\n }", "title": "" }, { "docid": "da0669e257da56a2f0aa995d6a8a1abe", "score": "0.6009109", "text": "function LANDING_IV___loadLemmaJSCodes( lemmaConfig )\n {\n codesList.forEach( function( codeItem ) {\n codeItem.src = fconf.pathToContentSite + \"/contents/\" +\n jscode_sappId + \"/js/\" + codeItem.src;\n });\n nsmethods.loadScripts(\n codesList,\n\n ///this function is called when all JS-lemma-modules are loaded\n function()\n {\n //----------------------------------------------------------\n ///module can be executed right after load if it is safe or\n ///module can register subs. in setModule and execute them\n ///here right below after all lemma-modules are loaded,\n ///\n ///executes loaded modules from modules registry\n ///this is a second and a last round of executing setModule for\n ///lemma modules\n eachprop( srg_modules, function( setModule, wwProp ) {\n setModule();\n });\n //----------------------------------------------------------\n\n //==========================================================\n // //\\\\ init_conf for models\n //==========================================================\n eachprop( studyMods, stdMod => {\n //pastes default lemma.conf.js::fconf.sconf into stdMod.sconf\n nspaste( stdMod.sconf, sconf );\n });\n //note: for non-common module, there cannot be\n // ssF.init_conf, only stdMod.init_conf,\n // for common - the only ssF.init_conf,\n ssF.init_conf(); //adds common-module data to fconf.sconf\n eachprop( studyMods, stdMod => {\n haff( stdMod, 'init_conf' );\n\n //expansion patch: todm: make function for this:\n stdMod.sconf.originalMod2inn_scale = stdMod.sconf.mod2inn_scale;\n //can add this here: doesImproveSconf();\n !haz( stdMod.sconf, 'dontRun_ExpandConfig' ) &&\n ssF.doExpandConfig( stdMod );\n ns.url2conf( stdMod.sconf );\n });\n //==========================================================\n // \\\\// init_conf for models\n //==========================================================\n\n\n sDomF.creates_mainWorkspace_domRoots();\n fmethods.populate_mediaSuperRoot(); //rename: ?? popul sim Super Scene\n\n eachprop( studyMods, (stdMod,stdModId) => {\n sDomF.cre_simscene8svg8legendIIslider( stdMod );\n });\n\n ///loads Book\n ssF.LANDING_V___loads_professorList8cont_8_buildsSubexegs(\n function() {\n ////exegs are ready now,\n\n //this place looks like\n //the best to establish initial topics,\n //then additional topics will be extracted from exegs\n var wwCase = sDomF.topicIdUpperCase_2_underscore;\n //pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp\n //pastes ssD['fixed-colors'] into lcaseId2allLemTopics\n eachprop( ssD['fixed-colors'], ( colorArray, topicId_ ) => {\n lcaseId2allLemTopics[ wwCase( topicId_ ) ] = {\n 'fixed-color' : colorArray,\n }\n });\n //pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp\n\n ////executes loaded \"proferssor's scripts\"\n //=======================================\n // //\\\\ html and css\n //=======================================\n //breaks left-menu if placed before professor-scripts ...\n //todm why?\n engCssMs.places_engineCSSes2styleTags();\n\n //todm: unclear: which part of content\n // this sesction uses, why not full content? ...\n\n //...........................................................\n //seems as obsolete and hard to remember design,\n //this is different from default ssCssOrder and css-modules\n //only for lemma2\n ssCssOrder.list.forEach( function( cssName ) {\n //we do first check existence of the function because of\n //module can be a blank stub and function is missed\n var css = ns.haf( cssmod, cssName )( cssp, fconf );\n //if stub is valid, does add css\n css && ns.globalCss.add8update( css );\n });\n //...........................................................\n\n //=======================================\n // \\\\// html and css\n //=======================================\n\n ////perhaps this is a cause of random failed load bug: ...\n ////the body which follows below can be put in\n ////cb for image-loader-ajax\n fmethods.cre__medRootDetails(\n ///this callback goes to final event of\n ///loading all media-bg-images:\n () => {\n LANDING_VI___exegs_2_frags8majorInit();\n LANDING_VII___landingFlag_8_nextLemmaButtons();\n ns.doScrollToHash();\n }\n );\n }\n );\n }\n );\n }", "title": "" }, { "docid": "a449934cc319c24770745f2aaebe7449", "score": "0.5998487", "text": "function main() {\n // require('./scripts/auxilaryFunctions.js');\n // require('./scripts/objects.js');\n // import './scripts/activate.js';\n require('./scripts/testing.js');\n\n require('./scripts/index.js');\n\n // require('@jscad/web/min.css');\n //let gProcessor = require('./scripts/cad');\n\n require('./scripts/draw-model');\n }", "title": "" }, { "docid": "c9febb0f280fdf3ed6b6395b3dac5ff4", "score": "0.59875077", "text": "function mtbImport(file){\n\tif(file == FILE_PROFILE_JS){\n\t\tif(!LOADED_PROFILE_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_PROFILE_JS = true;\n\t\t}\n\t} else if(file == FILE_STARS_SCROLL_JS){\n\t\tif(!LOADED_STARS_SCROLL_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_STARS_SCROLL_JS = true;\n\t\t}\n\t} else if(file == FILE_TOP_SELECTION_JS){\n\t\tif(!LOADED_TOP_SELECTION_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_TOP_SELECTION_JS = true;\n\t\t}\n\t} else if(file == FILE_SETTINGS_JS){\n\t\tif(!LOADED_SETTINGS_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_SETTINGS_JS = true;\n\t\t}\n\t} else if(file == FILE_TIPS_JS){\n\t\tif(!LOADED_TIPS_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_TIPS_JS = true;\n\t\t}\n\t} else if(file == FILE_SIGNIN_JS){\n\t\tif(!LOADED_SIGNIN_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_SIGNIN_JS = true;\n\t\t}\n\t} else if(file == FILE_CATEGORIES_JS){\n\t\tif(!LOADED_CATEGORIES_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_CATEGORIES_JS = true;\n\t\t}\n\t} else if(file == FILE_LOADER_JS){\n\t\tif(!LOADED_LOADER_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_LOADER_JS = true;\n\t\t}\n\t} else if(file == FILE_QUESTION_JS){\n\t\tif(!LOADED_QUESTION_JS){\n\t\t\tTi.include(file);\n\t\t\tLOADED_QUESTION_JS = true;\n\t\t}\n\t} else if(file == FILE_TOP_VIEW_JS){\n\t\tif(!LOADED_TOP_VIEW_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_TOP_VIEW_JS = true;\n\t\t}\n\t} else if(file == FILE_INVITE_JS){\n\t\tif(!LOADED_INVITE_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_INVITE_JS = true;\n\t\t}\n\t} else if(file == FILE_STARS_DETAILS_JS){\n\t\tif(!LOADED_STARS_DETAILS_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_STARS_DETAILS_JS = true;\n\t\t}\n\t} else if(file == FILE_AWARD_BADGE_JS){\n\t\tif(!LOADED_AWARD_BADGE_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_AWARD_BADGE_JS = true;\n\t\t}\n\t} else if(file == FILE_FEEDBACK_JS){\n\t\tif(!LOADED_FEEDBACK_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_FEEDBACK_JS = true;\n\t\t}\n\t} else if(file == FILE_TIPS_DETAILS_JS){\n\t\tif(!LOADED_TIPS_DETAILS_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_TIPS_DETAILS_JS = true;\n\t\t}\n\t} else if(file == FILE_ABOUT_CREDITS_JS){\n\t\tif(!LOADED_ABOUT_CREDITS_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_ABOUT_CREDITS_JS = true;\n\t\t}\n\t} else if(file == FILE_GAME_SELECTION_JS){\n\t\tif(!LOADED_GAME_SELECTION_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_GAME_SELECTION_JS = true;\n\t\t}\n\t} else if(file == FILE_GROUP_SELECTION_JS){\n\t\tif(!LOADED_GROUP_SELECTION_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_GROUP_SELECTION_JS = true;\n\t\t}\n\t} else if(file == FILE_GROUP_PLAYER_SELECTION_JS){\n\t\tif(!LOADED_GROUP_PLAYER_SELECTION_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_GROUP_PLAYER_SELECTION_JS = true;\n\t\t}\n\t} else if(file == FILE_PLAYER_NAMES_SELECTION_JS){\n\t\tif(!LOADED_PLAYER_NAMES_SELECTION_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_PLAYER_NAMES_SELECTION_JS = true;\n\t\t}\n\t} else if(file == FILE_QUESTION_NEXT_JS) {\n\t\tif(!LOADED_QUESTION_NEXT_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_QUESTION_NEXT_JS = true;\n\t\t}\n\t} else if(file == FILE_QUESTION_REPORT_JS) {\n\t\tif(!LOADED_QUESTION_REPORT_JS){\n\t\t\tTi.include(BUZZ_PATH+file);\n\t\t\tLOADED_QUESTION_REPORT_JS = true;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a27a2e0d11a94b6be1eacf3c4e0af1dd", "score": "0.598648", "text": "function processJs(jsFiles) {\n var mergedJs = mergeFiles(jsFiles).join(' ');\n var script = replaceDemoModuleWithCodepenModule(mergedJs);\n return script;\n }", "title": "" }, { "docid": "d0734630a0a37f233de117bd0b9a4a8f", "score": "0.59846264", "text": "function loadTemplate(){\n\n // clear stage\n $('.main').html('');\n\n // re-calculate the value of gird ident\n var gridCount = 0, allModules = [];\n\n for(var prop in global.templates[global.currentTemplate].grid){\n if (global.templates[global.currentTemplate].grid.hasOwnProperty(prop)){\n gridCount ++;\n }\n }\n \n global.gridIdent = gridCount;\n\n if(global.templates[global.currentTemplate].lock){\n $('.main').addClass('lock');\n }\n\n $.each(global.templates[global.currentTemplate].positions, function(key, gridId){\n // add grid objects to the stage\n addGridObjectToStage(global.templates[global.currentTemplate].grid[gridId].size, gridId);\n\n // end classes\n if(global.templates[global.currentTemplate].grid[gridId].end){\n $('#grid-ident-'+gridId).addClass('end');\n }\n\n // adding modules to the grid items\n if(global.templates[global.currentTemplate].grid[gridId].modules.length > 0){\n // loop through all the modules in this grid object and add them\n $.each(global.templates[global.currentTemplate].grid[gridId].modules, function(moduleKey, moduleName){\n // if the module is availible\n if ($('#'+moduleName).length > 0){\n var moduleObject = $('<div class=\"module-box\">'+$('#code-'+moduleName).html()+'</div>');\n $('#grid-ident-'+gridId).append(moduleObject);\n if( $.inArray(moduleName, allModules)){\n allModules.push(moduleName);\n }\n }\n });\n }\n\n });\n\n // now we have a list of all modules we get the js files for the modules we need it for\n $.each(allModules, function(key, val){\n\n // insert the js for the moudles into the page (if there is a script file that is)\n $.ajax({\n url: \"/assets/modules/\"+val+\"/js/script.js\",\n type: \"GET\",\n dataType: \"script\"\n }); \n });\n\n // get the js for the navigation for the project\n $.ajax({\n url: \"/assets/navigation/\"+global.navigation+\"/js/script.js\",\n type: \"GET\",\n dataType: \"script\"\n });\n\n // add the navigation HTML to the page\n $('#nav-header').html($('#code-'+global.navigation).html()); \n\n // set active item\n $('.grid-box').removeClass('grid-active');\n $('.grid-box').eq(0).addClass('grid-active');\n\n // load up all the templates on the list\n updateTemplateList();\n\n // Change template functionality\n $('.template-item').click(function(e){\n e.preventDefault();\n global.currentTemplate = $(this).text();\n // update and reload page\n updateStore(true);\n });\n\n}", "title": "" }, { "docid": "83ca35fb89163da0ecb2f60c277f5e63", "score": "0.59803736", "text": "function _onAllJsIncludesDone() {\n\t\tinitNavigationMode();\n//\t\tSitoolsDesk.loadPreferences(this);\n\n\t\tthis.fireEvent('modulesLoaded');\n\t}", "title": "" }, { "docid": "2474e7705ec77632a0aa3fc7f739a2b7", "score": "0.5953806", "text": "function loadDemos() {\n const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n files.forEach((file) => {\n require(file)\n })\n}", "title": "" }, { "docid": "dff2be3715989566f718a12056226743", "score": "0.59515756", "text": "function loadNext() {\n var nextScript = nike.ScriptLoader.scriptsToInclude.shift();\n if (nextScript) {\n nike.ScriptLoader.loadScript(nextScript);\n }\n }", "title": "" }, { "docid": "8490298cf869efc8390adf20f237c1b8", "score": "0.5946866", "text": "function loadLibs(){\t\n\t$(function() {\n\t\tlog(\"loading libraries\");\n\t\tyepnope([{\n\t\t\tload: core_scripts,\n\t\t\tcallback: function (url, result, key) {\n\t\t\t\tprogress(\"loaded: \" + url);\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tloadAdditionalLibs();\t\n\t\t\t}\n\t\t}]);\n\t});\n}", "title": "" }, { "docid": "35c4989238e81d9c01785f2df4837f94", "score": "0.59401274", "text": "function loadScripts() {\n\tif (typeof d3 === 'undefined') {\n\t\tQv.LoadExtensionScripts(scripts, init);\n\t} else {\n\t\tinit()\n\t};\n}", "title": "" }, { "docid": "3109ade411d784ba2f257c2052cf8cc1", "score": "0.59353286", "text": "loadInBrowser(path, isModule = false) {\n return new Promise((resolve, reject) => {\n window.module = {\n exports: null,\n };\n const script = document.createElement('script');\n script.src = path;\n if (isModule) {\n script.type = 'module';\n }\n script.onload = () => {\n const exported = module.exports;\n delete window.module;\n resolve(exported);\n };\n script.onerror = error => {\n reject(error);\n };\n document.head.appendChild(script);\n });\n }", "title": "" }, { "docid": "7c4a3d0ebae1ac838b7b8bf29ce1f60c", "score": "0.59276724", "text": "function loadJS(u) {\n var r = document.getElementsByTagName(\"script\")[0], s = document.createElement(\"script\");\n s.src = u;\n r.parentNode.insertBefore(s, r);\n}", "title": "" }, { "docid": "4ccbb675f83e66153763e57d7160b38b", "score": "0.5919037", "text": "function loadJS(jsFiles, pageScript) {\n\n var i;\n for(i = 0; i<jsFiles.length;i++){\n\n var body = document.getElementsByTagName('body')[0];\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.async = false;\n script.src = jsFiles[i];\n body.appendChild(script);\n }\n\n if (pageScript) {\n var body = document.getElementsByTagName('body')[0];\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.async = false;\n script.src = pageScript;\n body.appendChild(script);\n }\n\n init();\n}", "title": "" }, { "docid": "442cf861787dbf684e553ddd635175b2", "score": "0.58951974", "text": "function loadDemos() {\n const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n files.forEach((file) => {\n require(file)\n })\n}", "title": "" }, { "docid": "46a7c81c5b963271405e1828751bcf70", "score": "0.5868757", "text": "function loadDemos () {\n const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n files.forEach((file) => { require(file) })\n}", "title": "" }, { "docid": "66a733dd2ae0a7cf42093a5e3d8c9d0c", "score": "0.5862502", "text": "function init() {\n\t\t\tvar allScripts, i, arborURL, re;\n\n\t\t\t// Load the dependances: The new way. Thanks for AIP staff for this\n\t\t\tallScripts = document.querySelectorAll( 'script' );\n\t\t\tre = /^(.*)(\\/cytoscape[^\\/]*)\\/(.*)cytoscape\\.js??(.*)?$/;\n\t\t\tfor ( i = 0; i < allScripts.length && ! arborURL; i++ ) {\n\t\t\t\tif ( re.test( allScripts[i].src ) ) {\n\t\t\t\t\tvar match = re.exec( allScripts[i].src );\n\t\t\t\t\tarborURL = match[1] + match[2] + '/lib/arbor.js';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( arborURL ) {\n\t\t\t\tvar el = document.createElement( 'script' );\n\t\t\t\tel.src = arborURL;\n\t\t\t\tel.type = 'text/javascript';\n\t\t\t\tdocument.body.appendChild( el );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "a29e9c1ad6b8e44761502c74c7a8ffd2", "score": "0.5850593", "text": "function init(){\n\t\t//MBP.hideUrlBar();\n\n\t\tif(iScroll) $('body').addClass('iScrollEnabled');\n\n\t\t$LAB\n\t\t.script(on.path.js + 'app/views.js?' + on.env.v)\n\t\t.wait()\n\t\t.script(on.path.js + 'app/app.js?' + on.env.v)\n\t\t.wait(function(){console.log('1. app loaded')});\n\t}", "title": "" }, { "docid": "3ee5b9d208f5039684846f1b2951a3f3", "score": "0.58447194", "text": "function init() {\n var body = document.body,\n module = body.getAttribute('data-module'),\n action = body.getAttribute('data-action');\n\n exec(DEFAULT_MODULE_NAME); \n exec(module);\n exec(module, action);\n }", "title": "" }, { "docid": "08c82c085ab1769f898bf568bf32eb27", "score": "0.583789", "text": "function init() \n{ \n logger.info(\"Initializing D2Refine Extensions...\");\n \n // Registering Exporters\n Exporters.ExporterRegistry.registerExporter(\"adl_with_openehr\",\n new ADLExporter(\"OPENEHR\")); \n Exporters.ExporterRegistry.registerExporter(\"adl_with_opencimi\",\n new ADLExporter(\"OPENCIMI\"));\n \n // Registering Commands\n RefineServlet.registerCommand(module, \"registerD2RefineServices\", new RegistrationCommand());\n RefineServlet.registerCommand(module, \"reconcileWithCTS2\", new ReconciliationCommand());\n \n // Script files to inject into /project page\n ClientSideResourceManager.addPaths(\n \"project/scripts\", \n module, [\n \"scripts/d2rReconciliation.js\",\n \"scripts/utils/util.js\",\n \"scripts/exporter/model-export-menu.js\",\n \"scripts/extension-bar-menu.js\",\n \"dialogs/d2rAddReconService.js\",\n \"dialogs/d2rAbout.js\" ]);\n\n // Style files to inject into /project page\n ClientSideResourceManager.addPaths(\n \"project/styles\", \n module,\n [ \n \"styles/project-injection.less\",\n //\"styles/d2refine.less\",\n \"dialogs/d2rDialogs.less\",\n \"dialogs/d2rAbout.less\"\n ]);\n}", "title": "" }, { "docid": "edaa9a7391c881f62184ccaf5d62c591", "score": "0.583631", "text": "function loadJS(src,cb){\"use strict\";var ref=window.document.getElementsByTagName(\"script\")[0];var script=window.document.createElement(\"script\");script.src=src;script.async=true;ref.parentNode.insertBefore(script,ref);if(cb&&typeof(cb)===\"function\"){script.onload=cb;}\nreturn script;}", "title": "" }, { "docid": "00d3cdb26fe5d171bf81bb5e89d7a90f", "score": "0.58226794", "text": "function modules() {\n // Bootstrap JS\n var bootstrapJS = gulp.src(path.join(NODE_MODULE_PATH, 'bootstrap/dist/js/*'))\n .pipe(gulp.dest(path.join(VENDOR_SRC, 'bootstrap/js')));\n // Bootstrap SCSS\n var bootstrapSCSS = gulp.src(path.join(NODE_MODULE_PATH, 'bootstrap/scss/**/*'))\n .pipe(gulp.dest(path.join(VENDOR_SRC,'bootstrap/scss')));\n // ChartJS\n var chartJS = gulp.src(path.join(NODE_MODULE_PATH, 'chart.js/dist/*.js'))\n .pipe(gulp.dest(path.join(VENDOR_SRC,'chart.js')));\n // dataTables\n var dataTables = gulp.src([\n path.join(NODE_MODULE_PATH, 'datatables.net/js/*.js'),\n path.join(NODE_MODULE_PATH, 'datatables.net-bs4/js/*.js'),\n path.join(NODE_MODULE_PATH, 'datatables.net-bs4/css/*.css')\n ])\n .pipe(gulp.dest(path.join(VENDOR_SRC,'datatables')));\n // Font Awesome\n var fontAwesome = gulp.src(path.join(NODE_MODULE_PATH, '@fortawesome/**/*'))\n .pipe(gulp.dest(path.join(VENDOR_SRC,'')));\n // jQuery Easing\n var jqueryEasing = gulp.src(path.join(NODE_MODULE_PATH, 'jquery.easing/*.js'))\n .pipe(gulp.dest(path.join(VENDOR_SRC,'jquery-easing')));\n // jQuery\n var jquery = gulp.src([\n path.join(NODE_MODULE_PATH, 'jquery/dist/*'),\n '!'+path.join(NODE_MODULE_PATH, 'jquery/dist/core.js')\n ])\n .pipe(gulp.dest(path.join(VENDOR_SRC,'jquery')));\n return merge(bootstrapJS, bootstrapSCSS, chartJS, dataTables, fontAwesome, jquery, jqueryEasing);\n }", "title": "" }, { "docid": "63d77e9050b48e195d3df89484c1e994", "score": "0.5810711", "text": "function Module(){}", "title": "" }, { "docid": "63d77e9050b48e195d3df89484c1e994", "score": "0.5810711", "text": "function Module(){}", "title": "" }, { "docid": "63d77e9050b48e195d3df89484c1e994", "score": "0.5810711", "text": "function Module(){}", "title": "" }, { "docid": "3ba450682e5536ff9086d253453d638f", "score": "0.5805374", "text": "function load()\n{\n dashcode.setupParts();\n\tlogin();\n}", "title": "" }, { "docid": "c32f6ceb0d63547d3d0244dbdad17c05", "score": "0.5804289", "text": "function loadJS(jsFiles, pageScript) {\n\n\t\tfor(i=0;i<jsFiles.length;i++){\n\n\t\t\tvar body = document.getElementsByTagName('body')[0];\n\t\t\tvar script = document.createElement('script');\n\t\t\tscript.type = 'text/javascript';\n\t\t\tscript.async = false;\n\t\t\tscript.src = jsFiles[i];\n\t\t\tbody.appendChild(script);\n\t\t}\n\n\t\tif (pageScript) {\n\t\t\tvar body = document.getElementsByTagName('body')[0];\n\t\t\tvar script = document.createElement('script');\n\t\t\tscript.type = 'text/javascript';\n\t\t\tscript.async = false;\n\t\t\tscript.src = pageScript;\n\t\t\tbody.appendChild(script);\n\t\t}\n\t\t\n\t\tinit();\t\n\t}", "title": "" }, { "docid": "b91996942031b3f8b38ceb97df22b422", "score": "0.5801979", "text": "insertJs() {\n [\n 'js/Rx-5.5.12.js',\n 'js/react.development.js',\n 'js/react-dom.development.js',\n 'js/babel-6.26.0.js',\n 'js/typescript/typescript.js',\n 'https://unpkg.com/rxjs@6.5.2/bundles/rxjs.umd.min.js',\n 'https://unpkg.com/rxjs@6.5.2/bundles/rxjs.umd.js'\n ].forEach(function (src) {\n var script = document.createElement('script');\n script.src = src;\n // script.async = false;\n preview.head.appendChild(script);\n });\n }", "title": "" }, { "docid": "7213986a48c305c179be74a79434eb69", "score": "0.57949907", "text": "function importJs(src, success, error) {\n var noop = function(){};\n var identity = function (arg){return arg};\n var successCb = (typeof success == 'function') ? success : noop;\n var errorCb = (typeof error == 'function') ? error : noop;\n logDebug('(importJs) Importing: ' + src);\n if (isChrome()) {\n syncImportScripts(src, successCb, errorCb);\n } else {\n asyncImportScripts(src, identity, successCb, errorCb);\n }\n}", "title": "" }, { "docid": "aaacbf4fbe6c7112f7770d57c3fee4ae", "score": "0.5788139", "text": "function loadScript() {\n require(\"./game.js\");\n}", "title": "" }, { "docid": "b7de2bc13f77b6c78edb16f8c9da0eee", "score": "0.57841027", "text": "function app_LoadPlugins()\n{\n\tif(USE_SDL){\n\t\tDKCreate(\"DKSDLText\"); //Class contains SDL fps counter\n\t}\n\tDKCreate(\"DKTray/DKTray.js\", function(){});\n\tDKCreate(\"DKDebug/DKDebug.js\", function(){});\n}", "title": "" }, { "docid": "d78bc9d4f32c8938d1ea410a6d256729", "score": "0.5777853", "text": "async load () {\n // First, locate all the modules that we need to load.\n const collector = new BlueprintModuleCollector (this.app.appPath);\n const modules = await collector.gather (this.app.appPath);\n\n // Topologically sort the module by reversing the array. This will ensure\n // that we load the modules in correct order of dependency.\n modules.reverse ();\n\n // Load each module into memory.\n for (const blueprintModule of modules) {\n const module = new ApplicationModule ({app: this.app, name: blueprintModule.name, modulePath: blueprintModule.appPath});\n\n await this.emit ('loading', module);\n await module.configure ();\n await this.emit ('loaded', module);\n }\n }", "title": "" }, { "docid": "2484e8f68f3fca1833f3856516ffdada", "score": "0.5769777", "text": "async function load() {\n // @ts-ignore\n await wasm_bindgen('./pkg/phase2/phase2_bg.wasm');\n\n // let data = await fetch('./zk_transaction_1_2.params');\n // let data2 = await data.arrayBuffer()\n // sourceParams = new Uint8Array(data2);\n console.debug('wasm module loaded');\n}", "title": "" }, { "docid": "0bea0ecbf7c4c4874f2cec6ec164e0f9", "score": "0.57688534", "text": "function load_all_scripts(){\n\t\tloadScript(\"/scripts/block_ui.js\",loadigrep)\t\t\n\t}", "title": "" }, { "docid": "633a7a4c64665bf03bcffe4b076210b6", "score": "0.57662636", "text": "function processModules()\n\t{\n\t\tif(unprocessedQueue.length != 0)\n\t\t{\n\t\t\t//We will process all the scripts one by one.\n\t\t\tvar mod=null;\n\t\t\tif(unprocessedQueue.length == 1){\n\t\t\t\tmod = unprocessedQueue.pop();\n\t\t\t}else{\n\t\t\t\tmod = unprocessedQueue.shift();\n\t\t\t}\n\t\t\tloadModule(mod);\n\t\t\tloadedModule = null;\n\t\t}\n\t}", "title": "" }, { "docid": "ba851ba1fd9c6fab86a4e4e657aac44e", "score": "0.5762574", "text": "function loadSecondaryScripts() {\n\t// load chat options - likely not relevant for mobile users\n\toptionsLoader();\n\t// further imports\n\timportArticles({\n\t\ttype: \"script\",\n\t\tarticles: [\n\t\t\t\"u:dev:!kick/code.js\",\n\t\t\t\"u:dev:MediaWiki:ChatAnnouncements/code.js\",\n\t\t\t\"MediaWiki:Chat.js/clock.js\",\n\t\t\t\"MediaWiki:Chat.js/emoticonRefresh.js\",\n\t\t\t\"MediaWiki:Chat.js/emoticonRotate.js\"\t\t\n\t\t]\n\t}, {\n\t\ttype: \"style\",\n\t\tarticles: [\n\t\t\t\"MediaWiki:ChatResizeEmoticons.css\"\n\t\t]\n\t});\n}", "title": "" }, { "docid": "a135b3462cb2663ea857802e734ee9c3", "score": "0.5743024", "text": "initModulesAndPlugins() {\n MODULES.concat(PLUGINS).forEach((module) => {\n module(APP);\n });\n }", "title": "" }, { "docid": "c5d3382b225cb273e9c389dee5a30308", "score": "0.5727063", "text": "async function bootstrap() {\n const { a } = await import('./deps/module-a.js');\n a();\n\n const { b } = await import('./deps/module-b.js');\n b();\n\n // sync require (mixing import/require)\n const { c } = require('./deps/module-c.js');\n c();\n\n if (config.debug) {\n const { debug } = await import('./deps/always-debug.js');\n debug('i\\'m accessible by runtime config');\n } else {\n console.log('no debugging enabled');\n }\n}", "title": "" }, { "docid": "48b0a999503109658cdda889152b35c2", "score": "0.57125914", "text": "function addJS() { // inject listed files into the dom.\n\n var fileCount = JSFiles.length ;\n console.log(fileCount);\n for( var i = 0; i < fileCount; i++ ) {\n var script = document.createElement( 'script' );\n script.type = 'text/javascript';\n script.src = JSFilesDocRoot + JSFiles[i] ;\n document.head.appendChild( script );\n }\n\n}", "title": "" }, { "docid": "494776f61b70ef0c2a90a8d3ce1312e9", "score": "0.57116145", "text": "function loadjsfile(filename, done) {\n var r = document.createElement('script')\n r.setAttribute(\"type\", \"text/javascript\")\n r.setAttribute(\"src\", filename)\n r.onload = done\n if (typeof r != \"undefined\") document.getElementsByTagName(\"head\")[0].appendChild(r)\n }", "title": "" }, { "docid": "89364b859c549b6bdf0f743f679e6e81", "score": "0.5709815", "text": "function onLoadSucess(evt)\n\t{\n\t\tvar scriptnode = evt.currentTarget || evt.srcElement;\n\t\tscriptnode.removeEventListener('load', onLoadSucess , false);\n\t\tscriptnode.removeEventListener('onreadystatechange', onLoadSucess, false);\n\t\tscriptnode.removeEventListener('error', onLoadError , false);\n\t\tvar context = scriptnode.getAttribute('data-context');\n\t\t\n\t\tif(context !== currentContext){\n\t\t\tLERROR(\"Current context \" + currentContext + \" is diffrent from the \" +\n\t\t\t\t\t\"module loaded context \" + context );\n\t\t}\n\t\t\n\t\tvar loadComplete = false;\n\t\tvar mod = null;\n\n\t\t/*\n\t\t * By this time iam in the module would have loaded.\n\t\t * The loadedModule contains the initialized module.\n\t\t * If the loadModule is empty, then script doesn't contain\n\t\t * the iam module. \n\t\t */\n\t\t//Lets create a new module\n\t\tmod = new module();\n\t\t\n\t\t/*\n\t\t * check if this loaded module's dependencies are all loaded.\n\t\t */\n\t\tif(loadedModule)\n\t\t{\n\t\t\tmod.depends = loadedModule.depends;\n\t\t\tmod.callBack = loadedModule.callBack;\n\t\t\tmod.className = loadedModule.className;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//These are not iam modules. \n\t\t\t//Ex., jQuery\n\t\t\tmod.depends = [];\n\t\t\tmod.callBack = null;\n\t\t\t//filename as class name\n\t\t\tmod.className = scriptnode.getAttribute('data-module');\n\t\t}\n\t\tmod.loaded = true;\n\t\tmod.fileName = scriptnode.getAttribute('data-module');\n\t\tmod.context = context;\n\t\t_modules[mod.fileName] = mod;\n\t\t\n\t\t//Lets check if all the dependent modules are loaded an get \n\t\t//the params\n\t\tvar params = prepareDependents(mod);\n\t\tif( params.length == mod.depends.length )\n\t\t{\n\t\t\tmod.instance = createModule(mod,params);\n\t\t\tmod.initialized = true;\n\t\t\tloadComplete = true;\n\t\t}\n\t\t\n\t\tcurrentContext = null;\n\n\n\t\tif(loadComplete)\n\t\t{\n\t\t\t/* \n\t\t\t * If so, then call all dependent modules which are waiting for \n\t\t\t * this to complete \n\t\t\t * Fill up the dependencies if the other modules are waiting\n\t\t\t * for this module and initialize that module\n\t\t\t */\n\t\t\tcallAllDependentModules(mod.fileName);\n\t\t}\n\n\t\t/*\n\t\t * We will process the next module if exists\n\t\t */\n\t\tprocessModules();\n\t}", "title": "" }, { "docid": "fe6b2ea49ff1032ba01a57f4a4ccd02d", "score": "0.56913435", "text": "function preloadModules(self){\n\t\tfor(var i=0; i<self.options.availableThemes.length; i++){\n\t\t\tloadTheme(self.options.availableThemes[i]);\n\t\t}\n\t\tfor(var i=0; i<self.options.availableModes.length; i++){\n\t\t\tloadMode(self.options.availableModes[i]);\n\t\t}\n\t}", "title": "" }, { "docid": "d3b6310a4323655e7d773c74da294850", "score": "0.5688381", "text": "function initModuleExample() {\n\t//CHECK IF MODULE EXISTS ON THE PAGE\n\tif(!!$('.module-example').length) {\n\t\t//TODO\n\t\t// add code here\n\t}\n}", "title": "" }, { "docid": "c86081ed1748df6fd9d971692d397445", "score": "0.5681391", "text": "function loadScripts() {\n var path = window.location.pathname;\n var head = document.getElementsByTagName('head').item(0);\n var script = document.createElement('script');\n script.type = 'text/javascript';\n if (path.indexOf('/register') > -1) {\n script.src = '/javascripts/regScript.js';\n head.appendChild(script);\n }\n else if (path.indexOf('/client') > -1) {\n script.src = '/javascripts/clientScript.js';\n head.appendChild(script);\n }\n else if (path.indexOf('/') > -1 || path.indexOf('/login') > -1) {\n script.src = '/javascripts/loginScript.js';\n head.appendChild(script);\n }\n}", "title": "" }, { "docid": "c825224a9066a7ac3c2a924399d4db6b", "score": "0.56812084", "text": "function require(module) {\n if (!(module in modules)) {\n let principal = Components.classes[\"@mozilla.org/systemprincipal;1\"].getService(Components.interfaces.nsIPrincipal);\n let url = \"resource://ytcenter/libs/\" + module + \".js\";\n modules[module] = Components.utils.Sandbox(principal, {\n sandboxName: url,\n sandboxPrototype: {\n inFrameScript: true,\n require: require,\n exports: {},\n Cc: Components.classes,\n Ci: Components.interfaces,\n Cr: Components.results,\n Cu: Components.utils,\n unload: function(){},\n removeUnloadListener: function(){},\n framescript: {\n sendSyncMessage: sendSyncMessage.bind(this)\n }\n },\n wantXrays: false\n });\n Services.scriptloader.loadSubScript(url, modules[module]);\n }\n return modules[module].exports;\n}", "title": "" }, { "docid": "6a400079c401b98a1176a56f627e9c8e", "score": "0.56734246", "text": "function _initModule(){\n //console.log('[ neatFramework_chrome_devtools_MODULE.js ] : ' + 'initiating module ..'); // debug message > module is registered\n consoleLog('[ neatFramework_gamepad_MODULE.js ] : ' + 'initiating module ..', 'color: #d88069;');\n _initial_setup_module_init(); // actually init the module's 'initial setup' config/params (..)\n }", "title": "" }, { "docid": "4b10e09f9dba0fce30fb2a05710d6607", "score": "0.5663593", "text": "function _loadJS(elem) {\n\tif (elem.nodeType==1 && elem.nodeName==\"SCRIPT\" \n\t&& (!elem.type || elem.type==\"text/javascript\")) {\n\t\tif (elem.src) {\n\t\t\t_utils.execScript(_utils.loadStringAsset(elem.src),elem.src);\n\t\t} else {\n\t\t\tvar src = \"\";\n\t\t\tfor (var i=0; i<elem.childNodes.length; i++) {\n\t\t\t\tif (elem.childNodes[i].nodeType==3) {\n\t\t\t\t\tsrc += elem.childNodes[i].textContent;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_utils.execScript(src,\"index.html\");\n\t\t}\n\t} else if (elem.nodeType==1) {\n\t\tfor (var i=0; i<elem.childNodes.length; i++) {\n\t\t\t_loadJS(elem.childNodes[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8a04b82e36ceafb913acff20eaac0f60", "score": "0.5643002", "text": "loadScript(url) {\n return new Promise((resolve, reject) => {\n loadjs(url, {\n success: resolve,\n error: reject,\n });\n });\n }", "title": "" }, { "docid": "a5e326b3d341fd3564e4109cee9464fa", "score": "0.56369454", "text": "function loadScripts(t,e){if(t.length){var r=(t=t.slice()).shift(),i=loadScripts;i.loadScript(r,function(){t.length?i(t,e):e&&e()},function(){throw new Error(\"failed to load script \"+r)})}else e&&e()}", "title": "" }, { "docid": "10033bf9386ddd214bb9975e3120e13e", "score": "0.5631772", "text": "_initialize_script() {\n this.initializers = requireDirectory(module, './initializers');\n }", "title": "" }, { "docid": "fcbe0b6d17bc7ff28bd971fe156487eb", "score": "0.5631616", "text": "function loadScripts(){\n $.getScript(\"gamescripts/keybindings.js\");\n $.getScript(\"gamescripts/crosshair.js\");\n $.getScript(\"gamescripts/player.js\");\n $.getScript(\"gamescripts/movements.js\");\n $.getScript(\"gamescripts/enemy.js\");\n\n}", "title": "" }, { "docid": "1652a985faf6005b25729d4c57740664", "score": "0.5631606", "text": "load () { return {} }", "title": "" }, { "docid": "f5b9c1b172f33a560bb2d179c9340c8d", "score": "0.56253445", "text": "function LANDING_III___config8run_lemmaModules( lemBriefDef )\n {\n var lemmaConfig = lemBriefDef; //to merge both later: def and conf\n //-------------------------------------------------\n // //\\\\ prepares sub-application-source-code-files,\n // sub-application === lemma\n //-------------------------------------------------\n var jscode_sappId;\n var codesList;\n nsmethods.loadScripts(\n [\n { src : fconf.pathToContentSite + \"/contents/\" +\n lemmaConfig.sappId + \"/lemma-conf.js\"\n }\n ],\n landing_III_cb,\n );\n //-------------------------------------------------\n // \\\\// prepares sub-application-source-code-files,\n //-------------------------------------------------\n return;\n\n\n\n\n\n function landing_III_cb()\n {\n ns.paste( lemmaConfig, fapp.lemmaConfig() );\n\n var sappId_ref = ns.haz( lemmaConfig, 'sappCodeReference' );\n jscode_sappId = sappId_ref || lemmaConfig.sappId;\n //must be the same type of data as \"fconf.sappId\"\n fconf.lemBasecode_fullpath =\n fconf.pathToContentSite + \"/contents/\" + jscode_sappId;\n\n\n // //\\\\ loads jscodes and continues\n if( sappId_ref ) {\n ////preloads referenced jscodes before own jscodes\n nsmethods.loadScripts(\n [\n { src : fconf.lemBasecode_fullpath + \"/lemma-conf.js\"\n }\n ],\n function() {\n ////uses own placeholder of-jscodes-list or adds missed\n codesList = sn( 'codesList', fapp.lemmaConfig(), [] );\n //loads own jscodes and continues landing\n LANDING_IV___loadLemmaJSCodes( lemmaConfig );\n }\n );\n\n } else {\n ////uses own placeholder of-jscodes-list or adds missed\n codesList = sn( 'codesList', lemmaConfig, [] );\n //loads own jscodes and continues landing\n LANDING_IV___loadLemmaJSCodes( lemmaConfig );\n }\n // \\\\// loads jscodes and continues\n }\n\n\n\n\n\n\n //loads JS-scripts for specific lemma\n function LANDING_IV___loadLemmaJSCodes( lemmaConfig )\n {\n codesList.forEach( function( codeItem ) {\n codeItem.src = fconf.pathToContentSite + \"/contents/\" +\n jscode_sappId + \"/js/\" + codeItem.src;\n });\n nsmethods.loadScripts(\n codesList,\n\n ///this function is called when all JS-lemma-modules are loaded\n function()\n {\n //----------------------------------------------------------\n ///module can be executed right after load if it is safe or\n ///module can register subs. in setModule and execute them\n ///here right below after all lemma-modules are loaded,\n ///\n ///executes loaded modules from modules registry\n ///this is a second and a last round of executing setModule for\n ///lemma modules\n eachprop( srg_modules, function( setModule, wwProp ) {\n setModule();\n });\n //----------------------------------------------------------\n\n //==========================================================\n // //\\\\ init_conf for models\n //==========================================================\n eachprop( studyMods, stdMod => {\n //pastes default lemma.conf.js::fconf.sconf into stdMod.sconf\n nspaste( stdMod.sconf, sconf );\n });\n //note: for non-common module, there cannot be\n // ssF.init_conf, only stdMod.init_conf,\n // for common - the only ssF.init_conf,\n ssF.init_conf(); //adds common-module data to fconf.sconf\n eachprop( studyMods, stdMod => {\n haff( stdMod, 'init_conf' );\n\n //expansion patch: todm: make function for this:\n stdMod.sconf.originalMod2inn_scale = stdMod.sconf.mod2inn_scale;\n //can add this here: doesImproveSconf();\n !haz( stdMod.sconf, 'dontRun_ExpandConfig' ) &&\n ssF.doExpandConfig( stdMod );\n ns.url2conf( stdMod.sconf );\n });\n //==========================================================\n // \\\\// init_conf for models\n //==========================================================\n\n\n sDomF.creates_mainWorkspace_domRoots();\n fmethods.populate_mediaSuperRoot(); //rename: ?? popul sim Super Scene\n\n eachprop( studyMods, (stdMod,stdModId) => {\n sDomF.cre_simscene8svg8legendIIslider( stdMod );\n });\n\n ///loads Book\n ssF.LANDING_V___loads_professorList8cont_8_buildsSubexegs(\n function() {\n ////exegs are ready now,\n\n //this place looks like\n //the best to establish initial topics,\n //then additional topics will be extracted from exegs\n var wwCase = sDomF.topicIdUpperCase_2_underscore;\n //pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp\n //pastes ssD['fixed-colors'] into lcaseId2allLemTopics\n eachprop( ssD['fixed-colors'], ( colorArray, topicId_ ) => {\n lcaseId2allLemTopics[ wwCase( topicId_ ) ] = {\n 'fixed-color' : colorArray,\n }\n });\n //pppppppppppppppppppppppppppppppppppppppppppppppppppppppppp\n\n ////executes loaded \"proferssor's scripts\"\n //=======================================\n // //\\\\ html and css\n //=======================================\n //breaks left-menu if placed before professor-scripts ...\n //todm why?\n engCssMs.places_engineCSSes2styleTags();\n\n //todm: unclear: which part of content\n // this sesction uses, why not full content? ...\n\n //...........................................................\n //seems as obsolete and hard to remember design,\n //this is different from default ssCssOrder and css-modules\n //only for lemma2\n ssCssOrder.list.forEach( function( cssName ) {\n //we do first check existence of the function because of\n //module can be a blank stub and function is missed\n var css = ns.haf( cssmod, cssName )( cssp, fconf );\n //if stub is valid, does add css\n css && ns.globalCss.add8update( css );\n });\n //...........................................................\n\n //=======================================\n // \\\\// html and css\n //=======================================\n\n ////perhaps this is a cause of random failed load bug: ...\n ////the body which follows below can be put in\n ////cb for image-loader-ajax\n fmethods.cre__medRootDetails(\n ///this callback goes to final event of\n ///loading all media-bg-images:\n () => {\n LANDING_VI___exegs_2_frags8majorInit();\n LANDING_VII___landingFlag_8_nextLemmaButtons();\n ns.doScrollToHash();\n }\n );\n }\n );\n }\n );\n }\n }", "title": "" }, { "docid": "b09cc0f5c29b22f2cac95c56e2ce805a", "score": "0.56229526", "text": "init () {\n\n let url = this.getUtagSyncUrl();\n\n if ( url && !this.scriptLoaded) {\n fsUtils.getScript(url, this.setScriptLoaded(true)); //load the script asynchronously\n //fsUtils.getScript(url, this.setScriptLoaded(true), false); //load the script synchronously\n }\n\n }", "title": "" }, { "docid": "6a6f583c7c1593bce83325c37acce334", "score": "0.5617526", "text": "function load() {\n\t\t\tvar path = includes.shift();\n\t\t\tif (path) {\n\t\t\t\tvar url = /^\\/lib\\//.test(path) ? path.substring(1) : path;\n\t\t\t\t// Switch to the editor console globally so loaded libraries use\n\t\t\t\t// our own console too:\n\t\t\t\twindow.console = scope.console;\n\t\t\t\t$.getScript(url, load).fail(function(xhr, error) {\n\t\t\t\t\tscope.console.error('Cannot load ' + path + ': ' + error);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tevaluateCode();\n\t\t\t\twindow.console = realConsole;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5016b01bf1a1a2ff6ad9e49ee5b26a9f", "score": "0.5616791", "text": "function load_ipython_extension(){\n console.log(\"Linker extension (common) loaded\");\n\n modify_common_html.load();\n}", "title": "" }, { "docid": "9a97d25a5acb06802d175bf2c58e7b95", "score": "0.5610896", "text": "function jsu_loaded(){\n // [Optional] Init jslog with JSLOG_LEV \n // jslog_init(JSLOG_LEV);\n\tinitSampleCmn(); // manage optional PAR show_opt, only for developer\n sampleInit(); \n\tloadingShow(false);\n \n}", "title": "" }, { "docid": "1401e96f6da1cddcf4454cdd0fac758f", "score": "0.5609944", "text": "function importS(jsName, callback){\n\timportCallback[jsName] = callback;\n\timportScript(jsName, null, callback, X);\n}", "title": "" }, { "docid": "0e1d5dfcbfa182dd6d87ef0e337e6ede", "score": "0.56086046", "text": "function proyectoCustomLoad() {\n \"use strict\";\n console.log('Functions Correctly Loaded');\n}", "title": "" }, { "docid": "bfa2af9bbff943cf8f86b93c04e60ea5", "score": "0.560418", "text": "function init() {\n\t\tif ( config.skin ) {\n\t\t\tsourceSkinFile = path.resolve( sourceLocation, 'skins/' + ( config.skin ) + '/skin.js' );\n\t\t\ttargetSkinFile = path.resolve( targetLocation, 'skins/' + ( config.skin ) + '/skin.js' );\n\t\t}\n\t\tlanguageFile = path.resolve( targetLocation, 'lang/' + ( config.language || process.env.DEFAULT_LANGUAGE || 'en' ) + '.js' );\n\t\tvar loaderFile = path.resolve( sourceLocation, 'core/loader.js' );\n\n\t\t/*\n\t\t * Execute script loader.js in core directory and read\n\t\t * CKEDITOR.loader.scripts property\n\t\t */\n\t\tloaderScripts = ( function() {\n\t\t\tvar code = 'var CKEDITOR = { basePath : \\'/ckeditor/\\' }; ' + ckbuilder.io.readFile( loaderFile );\n\t\t\tvar script = new vm.Script( code, { filename: loaderFile } );\n\t\t\tvar scope = {};\n\t\t\tvm.createContext( scope );\n\n\t\t\ttry {\n\t\t\t\tscript.runInContext( scope );\n\t\t\t\treturn scope.CKEDITOR.loader.scripts;\n\t\t\t} catch ( e ) {\n\t\t\t\tthrow( 'Invalid JavaScript file: ' + loaderFile + '.\\nError: ' + e.message );\n\t\t\t}\n\t\t}() );\n\n\t\tif ( !loaderScripts ) {\n\t\t\tthrow( 'Unable to get required scripts from loader: ' + loaderFile );\n\t\t}\n\n\t\tif ( ckbuilder.options.debug ) {\n\t\t\tconsole.log( 'Reading core files from loader' );\n\t\t}\n\n\t\tgetCoreScripts( 'ckeditor' );\n\t\tgetCoreScripts( '_bootstrap' );\n\n\t\tif ( ckbuilder.options.debug ) {\n\t\t\tconsole.log( 'Checking plugins dependency' );\n\t\t}\n\n\t\tfindAllRequiredPlugins( getPluginsFromBuildConfig() );\n\t}", "title": "" }, { "docid": "785fe92cf25074318c10387dc09fe031", "score": "0.55969137", "text": "function testFn() {\n new Promise(function (resolve, reject) { require(['./dynamic-import-chunk-amd'], resolve, reject) }).then(console.log);\n }", "title": "" }, { "docid": "f068be2326f08732e7c1d73e1b9dd839", "score": "0.55943346", "text": "function handlePluginsObject(path, moduleList, finishPluginLoading) {\n // Now inject the scripts.\n var scriptCounter = moduleList.length;\n \n if (!scriptCounter) {\n finishPluginLoading();\n return;\n }\n function scriptLoadedCallback() {\n if (!--scriptCounter) {\n onScriptLoadingComplete(moduleList, finishPluginLoading);\n }\n }\n \n for (var i = 0; i < moduleList.length; i++) {\n injectIfNecessary(moduleList[i].id, path + moduleList[i].file, scriptLoadedCallback);\n }\n }", "title": "" }, { "docid": "fe1f23676ea9365501fe7a24c483e79c", "score": "0.55929995", "text": "function require() { }", "title": "" }, { "docid": "548f207b7e4276f48251a692642646ed", "score": "0.5592946", "text": "function loadJS( src, plugins ) {\n\tvar headID = document.getElementsByTagName(\"head\")[0]; \n\tvar newScript = document.createElement('script');\n\t\n\tnewScript.type = 'text/javascript';\n\tnewScript.src = src;\n\tif ( plugins ) {\n\t\tnewScript.setAttribute('data-aloha-plugins', plugins);\n\t}\n\t\n\theadID.appendChild(newScript);\n}", "title": "" }, { "docid": "b1ac30734cafdc80be99ffc0401af5bb", "score": "0.55927193", "text": "function RegisterScriptFiles(filename) {\r\n if (RegisterSod != undefined) {\r\n RegisterSod(filename, '/_layouts/15/' + filename);\r\n SP.SOD.loadMultiple([filename], function () {\r\n console.info('File Loaded', filename);\r\n })\r\n }\r\n else {\r\n var scriptEle = document.createElement('script');\r\n scriptEle.setAttribute(\"type\", \"text/javascript\")\r\n scriptEle.setAttribute(\"src\", \"/_layouts/15/\" + filename);\r\n document.getElementsByTagName(\"head\")[0].appendChild(scriptEle)\r\n }\r\n }", "title": "" }, { "docid": "9353cb37c352a892f6a214b0fa34873c", "score": "0.55872643", "text": "function execModule(sModuleName, bAsync) {\n\n\t\t\tvar oModule = mModules[sModuleName],\n\t\t\t\toShim = mAMDShim[sModuleName],\n\t\t\t\tbLoggable = log.isLoggable(),\n\t\t\t\tsOldPrefix, sScript, vAMD, oMatch, bOldGlobalAsyncMode;\n\n\t\t\tif ( oModule && oModule.state === LOADED && typeof oModule.data !== \"undefined\" ) {\n\n\t\t\t\t// check whether the module is known to use an existing AMD loader, remember the AMD flag\n\t\t\t\tvAMD = (oShim === true || (oShim && oShim.amd)) && typeof window.define === \"function\" && window.define.amd;\n\t\t\t\tbOldGlobalAsyncMode = bGlobalAsyncMode;\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif ( vAMD ) {\n\t\t\t\t\t\t// temp. remove the AMD Flag from the loader\n\t\t\t\t\t\tdelete window.define.amd;\n\t\t\t\t\t}\n\t\t\t\t\tbGlobalAsyncMode = bAsync;\n\n\t\t\t\t\tif ( bLoggable ) {\n\t\t\t\t\t\tlog.debug(sLogPrefix + \"executing '\" + sModuleName + \"'\");\n\t\t\t\t\t\tsOldPrefix = sLogPrefix;\n\t\t\t\t\t\tsLogPrefix = sLogPrefix + \": \";\n\t\t\t\t\t}\n\n\t\t\t\t\t// execute the script in the window context\n\t\t\t\t\toModule.state = EXECUTING;\n\t\t\t\t\t_execStack.push(sModuleName);\n\t\t\t\t\tif ( typeof oModule.data === \"function\" ) {\n\t\t\t\t\t\tcallPreloadWrapperFn(oModule.data);\n\t\t\t\t\t} else if ( Array.isArray(oModule.data) ) {\n\t\t\t\t\t\tsap.ui.define.apply(sap.ui, oModule.data);\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tsScript = oModule.data;\n\n\t\t\t\t\t\t// sourceURL: Firebug, Chrome, Safari and IE11 debugging help, appending the string seems to cost ZERO performance\n\t\t\t\t\t\t// Note: IE11 supports sourceURL even when running in IE9 or IE10 mode\n\t\t\t\t\t\t// Note: make URL absolute so Chrome displays the file tree correctly\n\t\t\t\t\t\t// Note: do not append if there is already a sourceURL / sourceMappingURL\n\t\t\t\t\t\t// Note: Safari fails, if sourceURL is the same as an existing XHR URL\n\t\t\t\t\t\t// Note: Chrome ignores debug files when the same URL has already been load via sourcemap of the bootstrap file (sap-ui-core)\n\t\t\t\t\t\t// Note: sourcemap annotations URLs in eval'ed sources are resolved relative to the page, not relative to the source\n\t\t\t\t\t\tif (sScript ) {\n\t\t\t\t\t\t\toMatch = /\\/\\/[#@] source(Mapping)?URL=(.*)$/.exec(sScript);\n\t\t\t\t\t\t\tif ( oMatch && oMatch[1] && /[^/]+\\.js\\.map$/.test(oMatch[2]) ) {\n\t\t\t\t\t\t\t\t// found a sourcemap annotation with a typical UI5 generated relative URL\n\t\t\t\t\t\t\t\tsScript = sScript.slice(0, oMatch.index) + oMatch[0].slice(0, -oMatch[2].length) + URI(oMatch[2]).absoluteTo(oModule.url);\n\t\t\t\t\t\t\t} else if ( !oMatch ) {\n\t\t\t\t\t\t\t\tsScript += \"\\n//# sourceURL=\" + URI(oModule.url).absoluteTo(sDocumentLocation);\n\t\t\t\t\t\t\t\tif (Device.browser.safari || Device.browser.chrome) {\n\t\t\t\t\t\t\t\t\tsScript += \"?eval\";\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\n\t\t\t\t\t\t// framework internal hook to intercept the loaded script and modify\n\t\t\t\t\t\t// it before executing the script - e.g. useful for client side coverage\n\t\t\t\t\t\tif (typeof jQuery.sap.require._hook === \"function\") {\n\t\t\t\t\t\t\tsScript = jQuery.sap.require._hook(sScript, sModuleName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (window.execScript && (!oModule.data || oModule.data.length < MAX_EXEC_SCRIPT_LENGTH) ) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\toModule.data && window.execScript(sScript); // execScript fails if data is empty\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\t_execStack.pop();\n\t\t\t\t\t\t\t\t// eval again with different approach - should fail with a more informative exception\n\t\t\t\t\t\t\t\tjQuery.sap.globalEval(oModule.data);\n\t\t\t\t\t\t\t\tthrow e; // rethrow err in case globalEval succeeded unexpectedly\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tevalModuleStr(sScript);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_execStack.pop();\n\t\t\t\t\toModule.state = READY;\n\t\t\t\t\toModule.data = undefined;\n\t\t\t\t\toModule.value(); // enforce determination of module value for non-AMD modules\n\n\t\t\t\t\tif ( bLoggable ) {\n\t\t\t\t\t\tsLogPrefix = sOldPrefix;\n\t\t\t\t\t\tlog.debug(sLogPrefix + \"finished executing '\" + sModuleName + \"'\");\n\t\t\t\t\t}\n\n\t\t\t\t} catch (err) {\n\t\t\t\t\toModule.state = FAILED;\n\t\t\t\t\toModule.errorStack = err && err.stack;\n\t\t\t\t\toModule.errorMessage = ((err.toString && err.toString()) || err.message) + (err.line ? \"(line \" + err.line + \")\" : \"\" );\n\t\t\t\t\toModule.data = undefined;\n\t\t\t\t\tif ( window[\"sap-ui-debug\"] && (/sap-ui-xx-show(L|-l)oad(E|-e)rrors=(true|x|X)/.test(location.search) || oCfgData[\"xx-showloaderrors\"]) ) {\n\t\t\t\t\t\tlog.error(\"error while evaluating \" + sModuleName + \", embedding again via script tag to enforce a stack trace (see below)\");\n\t\t\t\t\t\tjQuery.sap.includeScript(oModule.url);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t} finally {\n\n\t\t\t\t\t// restore AMD flag\n\t\t\t\t\tif ( vAMD ) {\n\t\t\t\t\t\twindow.define.amd = vAMD;\n\t\t\t\t\t}\n\t\t\t\t\tbGlobalAsyncMode = bOldGlobalAsyncMode;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c5e5ec792399ecdc33e12abbab3df3b1", "score": "0.55812705", "text": "function modules (...args) {\n\tif (args.length == 1) {\n\t\treturn import(chrome.runtime.getURL(`lib/${args[0]}.js`));\n\t}\n\telse {\n\t\treturn Promise.all(args.map(name => modules(name)));\n\t}\n}", "title": "" }, { "docid": "0b96697f8fc5f1cf071c3aa6f9f9239e", "score": "0.5580838", "text": "function loadJS(file) {\n // Grab the head element\n var head = document.getElementsByTagName('head')[0];\n // Create a script element\n var script = document.createElement('script');\n // Set the type\n script.type = 'text/javascript';\n // Set the source file\n script.src = 'js/jquery.inview.js';\n // Add the script element to the head\n head.appendChild(script);\n}", "title": "" }, { "docid": "06296c009858174dc96f61a76f8aa056", "score": "0.55773824", "text": "require() {}", "title": "" } ]
fcd9a8e0f7a6cbc83f4e13126b47e2f7
Loads loading bar and fires up loader
[ { "docid": "83134e3ae79c9ede8b9e0fbd455e27af", "score": "0.0", "text": "function Boot()\n{\n this.preload = function()\n {\n game.load.image('load_bar' , './res/assets/preloader.gif');\n }\n \n this.create = function()\n {\n game.scale.forceLandscape = true;\n game.scaleMode = Phaser.ScaleManager.EXACT_FIT;\n \n game.scale.setExactFit(false);\n //game.scale.pageAlignHorizontally = true;\n game.scale.refresh();\n \n world_height = game.world.height;\n world_width = game.world.width;\n \n game.state.start('Loader', true, false);\n }\n}", "title": "" } ]
[ { "docid": "99079aebae2d5651163fa538fbda7ae9", "score": "0.78933316", "text": "function startLoading() {\n\tvar loadingBar = new LoadingBar();\n\tglobal.set('loadingBar', loadingBar);\n\n\tloadingBar.preloadImage(continueLoading); // have to actually preload the (go figure) loading background\n}", "title": "" }, { "docid": "fe3bb3f02fdf8c7a26ed4d01dc2702c8", "score": "0.7668324", "text": "function loading() {\n $loading.prependTo('body').fadeIn();\n }", "title": "" }, { "docid": "0d8e369c140fe4c7abfe5cbce6ec2816", "score": "0.7558585", "text": "function state_loading() {\n status.loading = true;\n if (status.bar) status.bar.className = 'autopager_loading';\n }", "title": "" }, { "docid": "238c8cd8c2ef8ea1f68a4160ac444fe0", "score": "0.7398369", "text": "function showLoader() {\n $('#loading').show();\n }", "title": "" }, { "docid": "f65f512c2948364557fe1712f9ec2321", "score": "0.7389998", "text": "function onLoadStart() {\n $(\".loading\").css(\"display\", \"block\");\n}", "title": "" }, { "docid": "4baba06e84bc8cf6edf4b8c6140e7082", "score": "0.7367516", "text": "function loader() {\n $loader.addClass('active');\n setTimeout(function () {\n $body.addClass('show');\n setTimeout(function () {\n paralax();\n $body.addClass('regular').removeClass('transitions').removeClass('overflow');\n $html.removeClass('overflow');\n }, 4000)\n }, 600);\n }", "title": "" }, { "docid": "cf9cae1da30224a28d93a801b9162cf7", "score": "0.73537916", "text": "function LoadingIndicator() {\n this.el = this.build_();\n document.body.appendChild(this.el);\n this.show();\n }", "title": "" }, { "docid": "04f0d2f2188a576ac6c8b0a1e370ec93", "score": "0.7334325", "text": "function loading() {\n $(\"div.loader\").show(); \n}", "title": "" }, { "docid": "cbe9b6d5be61906bfa2b8c8211a8cec6", "score": "0.7280832", "text": "function loading(){\n /*This is the loading gif, It will popup as soon as startLoad is called*/\n $('#loading').html('<center><button class=\"btn btn-primary\" type=\"button\" id=\"start_call\" disabled>'+'<span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"> </span> <span class=\"ml-1\">Loading...</span></button></center>');\n /*\n This is an example of the ajax get method, \n You would retrieve the html then use the results\n to populate the container.\n \n $.get('example.php', function (results) {\n $('#loading').html(results);\n });\n */\n /*This is an example and can be disregarded\n The clearTimeout makes sure you don't overload the timeout variable\n with multiple timout sessions.*/\n clearTimeout(timeout);\n /*Set timeout delays a given function for given milliseconds*/\n timeout = setTimeout(loaded, 9000);\n }", "title": "" }, { "docid": "4676fd778a031db103962fc397287711", "score": "0.72645336", "text": "function ativaLoading(){\r\n loading.show();\r\n}", "title": "" }, { "docid": "55d559532bd09a25f6adb0c8ed308c46", "score": "0.72529066", "text": "function loading() {\n background(255);\n push();\n fill(0);\n textSize(22);\n textAlign(CENTER, CENTER);\n text(`Loading ${modelName}...`, width / 2, height / 2 - 100);\n pop();\n}", "title": "" }, { "docid": "cb2c25cada6b48d6d31941c0d20a4c4e", "score": "0.7232147", "text": "function appAddLoader()\n\t{\n\t\tif (jQuery('#TB_load').size() != 0) return;\n\t\t\n\t\tjQuery('body').append('<div id=\"TB_load\" style=\"display: block;\"><div class=\"loader\"></div></div>');\n\t}", "title": "" }, { "docid": "5a2471f25d248b7aa898c3efd07e91ad", "score": "0.7219483", "text": "function loading(status) {\n\t\tif (status == 'hide') {\n\t\t\t$.LoadingOverlay(\"hide\");\n\t\t} else {\n\t\t\t$.LoadingOverlay(\"show\", {\n\t\t\t\tbackground: \"rgba(59, 29, 78, 0.8)\",\n\t\t\t\timageColor: \"rgba(193, 55, 120, 0.82)\",\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "a8713438a0691f5523f54c5a6d4957ac", "score": "0.7207206", "text": "function _loader(target)\r\n{\r\n\t// App.startPageLoading('Please wait...');\r\n\tApp.blockUI({\r\n\t\ttarget: target,\r\n\t\toverlayColor: 'none',\r\n\t\tboxed: false,\r\n\t\tmessage: 'Processing...'\r\n\t});\r\n}", "title": "" }, { "docid": "6e23c5676065d1274c9510987bbb39c4", "score": "0.7206981", "text": "showLoading() {\n if ($('#rbro_loading_div').length == 0) {\n $('body').append('<div id=\"rbro_loading_div\" class=\"rbroLoadingIndicator\"></div>');\n }\n }", "title": "" }, { "docid": "db7602fc166005b6e9efe5d754eaec3a", "score": "0.7198051", "text": "function loaderOn() {\n $('#loader1').show();\n $('#loader2').show();\n setTimeout(do_stuff, 100);\n }", "title": "" }, { "docid": "cb7cead10d802ce7363e6b6f1325c9fb", "score": "0.71872276", "text": "function loading(id) {\n \"use strict\";\n alert(\"change loading panel stuff\");\n $(id).loader();\n $(id).trigger(\"loader.show\");\n /*\n var LoadingPanel = id;\n LoadingPanel.append(\"<div class='loading-panel' style='position:absolute;overflow: auto; width:\" + LoadingPanel.width() + \"px; height: \" + LoadingPanel.height() + \"px; z-index:5; background-color:#FFF; opacity:0.7; filter:alpha(opacity=70); '></div>\");\n var paddingLeft = (LoadingPanel.width() / 2);\n var paddingTop = (LoadingPanel.height() / 2);\n LoadingPanel.append(\"<div class='loading-panel' style='background:url(/images/icons/loader-bg.png) 0 0 no-repeat; position:absolute; left: \" + paddingLeft + \"px; top: \" + paddingTop + \"px; z-index:6;'><img src='/images/loader.gif'/></div>\");\n */\n}", "title": "" }, { "docid": "872b9e2505b494385e3b42bba5e3d5ad", "score": "0.71753776", "text": "function startLoading() {\r\n loader.className = '';\r\n}", "title": "" }, { "docid": "6eafd83ffc4a0e62241baa192c80da28", "score": "0.7151099", "text": "load() {\n this.showSpinner();\n this.executeAll();\n }", "title": "" }, { "docid": "01096866deda9d8fdd2d4168582a497a", "score": "0.71353763", "text": "function loadDisplay() {\n $(\"#loading\").css('display', 'block');\n}", "title": "" }, { "docid": "6bd132d286aecac75f1124e91cc893ab", "score": "0.7134212", "text": "buildLoadingIndicator_() {\n const loadingContainer = this.loadingContainer_;\n this.container_.appendChild(loadingContainer);\n\n // Add 4 vertical bars animated at different rates, as defined in the\n // style.\n for (let i = 0; i < 4; i++) {\n const loadingBar = this.document_.createElement('swg-loading-bar');\n loadingContainer.appendChild(loadingBar);\n }\n }", "title": "" }, { "docid": "1dc988f787a23aaee5721831f56642be", "score": "0.7128011", "text": "function makePageBusy()\r\n{\r\n $('#ajaxLoader').fadeIn(250);\r\n}", "title": "" }, { "docid": "f1aa8040602a3ffe9709a4181421590c", "score": "0.71129876", "text": "loading() {\n window.loadingInvoked = true;\n }", "title": "" }, { "docid": "d02f3c2f5defeb43533bfcefe9db1d99", "score": "0.7109591", "text": "function startLoadingUpdate()\n{\n updateLoaded();\n}", "title": "" }, { "docid": "06500f0fc82f126deaa977138c5ed54a", "score": "0.710877", "text": "function LoadingIndicator() {\n this.el = this.build_();\n document.body.appendChild(this.el);\n this.show();\n}", "title": "" }, { "docid": "f6264d0dd8eff08cd1a190ee3a73f7de", "score": "0.71068496", "text": "function showLoadingStatus() {\n console.log(\"[menu_actions.js] Showing loading status\");\n showElementById(\"loading-status\");\n}", "title": "" }, { "docid": "889bf0577b9f7bda800442154cc4a86a", "score": "0.70644814", "text": "function showLoader(){\n\t$('#ajax-status').show();\n}", "title": "" }, { "docid": "ef20e23086dcc3978dad55210e06ab58", "score": "0.70493114", "text": "function ajaxindicatorstart() {\n if ($('body').find('#loadingDiv').attr('id') != 'loadingDiv') {\n var loadingString = '<div id=\"loadingDiv\" class=\"modal1\"><div id=\"loading-image\" class=\"center\"><img src=\"../assets/img/loader.gif\" alt=\"Loading...\" /></div></div>';\n $('body').append(loadingString);\n $('#loadingDiv .bg').height('100%');\n $('#loadingDiv').fadeIn(300);\n $('body').css('cursor', 'wait');\n }\n }", "title": "" }, { "docid": "ef20e23086dcc3978dad55210e06ab58", "score": "0.70493114", "text": "function ajaxindicatorstart() {\n if ($('body').find('#loadingDiv').attr('id') != 'loadingDiv') {\n var loadingString = '<div id=\"loadingDiv\" class=\"modal1\"><div id=\"loading-image\" class=\"center\"><img src=\"../assets/img/loader.gif\" alt=\"Loading...\" /></div></div>';\n $('body').append(loadingString);\n $('#loadingDiv .bg').height('100%');\n $('#loadingDiv').fadeIn(300);\n $('body').css('cursor', 'wait');\n }\n }", "title": "" }, { "docid": "f156f7bfdc8ceaf0029c809dbac2fc51", "score": "0.70492274", "text": "function load() {\n id(\"loading\").classList.toggle(\"hidden\");\n }", "title": "" }, { "docid": "fd0d6f33b95ec0982fc18251668e073a", "score": "0.70417315", "text": "function _doLoading() {\n options.containerEl.classList.add(options.prefixCls + '-loading');\n\n // If no valid loading function exists, just reset elements\n if (!options.loadingFunction) {\n return _doReset();\n }\n\n // The loading function should return a promise\n var loadingPromise = options.loadingFunction();\n\n // For UX continuity, make sure we show loading for at least one second before resetting\n setTimeout(function () {\n // Once actual loading is complete, reset pull to refresh\n loadingPromise.then(_doReset, _doReset);\n }, 1000);\n }", "title": "" }, { "docid": "c896379455ca83af58f35b6b9b0bcdf3", "score": "0.7025882", "text": "function loading(evt) {\n if (evt.lengthComputable) {\n // ProgressBar.js animates using 0.0-1.0 as a range, so we need the progress in terms of that\n progressBarElem.animate(evt.loaded / evt.total);\n }\n }", "title": "" }, { "docid": "f2c4c4fe8072b105084af4f75d8f4b5d", "score": "0.70169824", "text": "function showLoadingState() {\n LEXUS.loadingAnimation.start();\n FullPageLoader.open();\n }", "title": "" }, { "docid": "f3e91005af287024c5bcafe51341a12c", "score": "0.7009325", "text": "function addLoad(){\n $('#loadingPopup').css('display', 'block');\n }", "title": "" }, { "docid": "ff35abdf061706b05b7ef9ca737672d0", "score": "0.70047426", "text": "function loading() {\n if (mario.loaded && stage.loaded) {\n stage.drawBackground(ctxBackground);\n main();\n } else {\n loadingMessage();\n setTimeout(loading, 100);\n }\n }", "title": "" }, { "docid": "49c38204761f600d97139593c2d98562", "score": "0.6986241", "text": "loader() {\n const spinner = document.querySelector('#spinning');\n\n if(spinner) {\n spinner.style.display = 'block';\n } \n }", "title": "" }, { "docid": "3d6334af6d47cf55dc3df1dff2a61c14", "score": "0.6986169", "text": "function loaded() {\n $loading.fadeOut('fast', function () {\n $(this).remove();\n });\n }", "title": "" }, { "docid": "2ec04de7556cdbad295b1413cda9192b", "score": "0.6977288", "text": "initLoading() {\n this.$initialScreen.removeClass('shown');\n this.$loadingBar.show().focus();\n\n setTimeout(() => {\n this.maybeShowLoadingText('Analyzing website...');\n }, 2000);\n\n setTimeout(() => {\n this.maybeShowLoadingText('Checking for sufficient color contrast...');\n }, 4000);\n\n setTimeout(() => {\n this.maybeShowLoadingText('Processing results...');\n }, 6000);\n\n setTimeout(() => {\n if (!this.appHasError) {\n this.loadingAnimationComplete = true;\n this.showResultsScreen();\n }\n }, 8000);\n\n // For debug\n // this.$loadingBar.hide();\n // this.$results.addClass('shown').find('.results-content').focus();\n\n }", "title": "" }, { "docid": "1c11f21f324c8dd1e794a4beb8f3eee5", "score": "0.6971811", "text": "function onLoadEnd() {\n $(\".loading\").css(\"display\", \"none\");\n}", "title": "" }, { "docid": "3e5ba026c16367d3a944151f36909559", "score": "0.69566494", "text": "function startLoading() {\n var opts = {\n lines: 9, // The number of lines to draw\n length: 24, // The length of each line\n width: 11, // The line thickness\n radius: 26, // The radius of the inner circle\n corners: 1, // Corner roundness (0..1)\n rotate: 0, // The rotation offset\n direction: 1, // 1: clockwise, -1: counterclockwise\n color: '#000', // #rgb or #rrggbb or array of colors\n speed: 0.9, // Rounds per second\n trail: 37, // Afterglow percentage\n shadow: false, // Whether to render a shadow\n hwaccel: false, // Whether to use hardware acceleration\n className: 'spinner', // The CSS class to assign to the spinner\n zIndex: 2e9, // The z-index (defaults to 2000000000)\n top: '50%', // Top position relative to parent\n left: '50%' // Left position relative to parent\n };\n var target = document.getElementById('loadingbody');\n var spinner = new Spinner(opts).spin(target); \n $('#loadingModal').modal('show');\n}", "title": "" }, { "docid": "16271950542254c0917c202051e74e89", "score": "0.69487876", "text": "function loadDone()\n\t{\n\t\tapp.clearLoadingBox();\n\t}", "title": "" }, { "docid": "3e6093841cafa60ed24dc3cd0460b1b7", "score": "0.6940651", "text": "function doLoad(loadstatus){\n\tloadstatus = typeof loadstatus !== 'undefined' ? loadstatus : loading;\n\t//Alloy.Globals.Log(loadstatus);\n\t\n\tif(loadstatus){\n\t\tloading=false;\n\t\t$.loading.stop();\n\t\t$.pagecontainer.remove($.loading.getView());\t\t\t\t\n\t}else{\n\t\tloading = true;\n\t\t$.pagecontainer.add($.loading.getView());\n\t\t$.loading.start();\n\t}\t\n}", "title": "" }, { "docid": "b66b2c1503f7bc24c67938745108d7c5", "score": "0.693751", "text": "function loadingAnimation() {\n var div = '<div class=\"tabletki-loading\"></div>';\n\n $('body').append(div);\n }", "title": "" }, { "docid": "f16d736450584cf56d166baf029763ee", "score": "0.69332767", "text": "startLoading() {\n $('body').trigger('processStart');\n }", "title": "" }, { "docid": "821104d229aea02bbace4b9903f5e728", "score": "0.6908469", "text": "function loading() {\r\n document.getElementById('loading').style.display = 'inline-block';\r\n return;\r\n}", "title": "" }, { "docid": "24489bf17682a225b51be2882c5c2c0a", "score": "0.69017136", "text": "function setLoading() {\n\t\t\t$(Elem.navi_info).text(Msg.loading);\n\t\t\tif ($(Elem.results).html() == '') {\n\t\t\t\t$(Elem.navi).children('p').empty();\n\t\t\t\tcalcWidthResults();\n\t\t\t\t$(Elem.container).addClass(Cls.container_open);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "6ad8d81c90f230a8b5f9aadaf4c24472", "score": "0.6901324", "text": "function state_loaded() {\n status.loading = false;\n if (status.bar) status.bar.className = status.state ? 'autopager_on' : 'autopager_off';\n }", "title": "" }, { "docid": "ca072a01baa7aca470b04affe2593360", "score": "0.68927526", "text": "function show_loader(progress) {\n\t\t$('.pace .pace-progress').width(progress);\n\t\t$('.pace').removeClass('pace-inactive');\n\t}", "title": "" }, { "docid": "7a9a8515b71cdc690b98681b7f8cf7a5", "score": "0.68881893", "text": "function startLoadingBar() {\n console.log(\"==Hide playback content\");\n $(\"#playback-content\").css('visibility', 'hidden');\n Pace.once('done', function() {\n $(\"#loading-error\").css('height','0');\n console.log(\"==Show playback content\");\n $(\"#playback-content\").css('visibility', 'visible');\n });\n Pace.start();\n}", "title": "" }, { "docid": "c9db7f99b844135428e40589982fbb82", "score": "0.6861752", "text": "function showLoader(){\n $(\"body\").prepend('<div class=\"gifBox\"></div>');\n}", "title": "" }, { "docid": "28b691f8a17765f19529edcd24bce690", "score": "0.68501353", "text": "function resource_onload_callback(){\n let delta = 100 / ModelLoader.get_instance().total_resources;\n let loading_status = document.getElementById(\"loader-progress-bar\").style.width;\n loading_status = String(parseInt(loading_status) + delta + \"%\");\n document.getElementById(\"loader-progress-bar\").style.width = loading_status;\n\n }", "title": "" }, { "docid": "59fc3d20a56b7f8bf01e814720dbb59b", "score": "0.68435675", "text": "function showLoadingMessage()\n{\n showElement(\"loading\");\n startLoadingAnimation();\n}", "title": "" }, { "docid": "9e2ed81dba8dabb397baa32a35a97e14", "score": "0.68351936", "text": "function _loadingActive() {\n\t\t\tloading.active = true;\n\t\t}", "title": "" }, { "docid": "d448c1a4d761a3dc102685e95137b729", "score": "0.68272644", "text": "loaded() {\n if(this.header) {\n const loading = new Loading(this.page, this.header);\n }\n else {\n this.loadedCancelled = true;\n }\n }", "title": "" }, { "docid": "0dc411255edd75b861d1b9e7972c2fe1", "score": "0.68264323", "text": "function loaderComplete(){\n //first check if loader is hidden\n if(!loader.hidden){\n //show quote container\n quoteContainer.hidden = false\n //hide loader\n loader.hidden = true\n }\n}", "title": "" }, { "docid": "dc8101acab63c128f99c224979ae481f", "score": "0.68243825", "text": "function yarns_reader_show_loading(target) {\n \t\ttarget.append('<div class=\"yarns_reader-loading\"></div>');\n \t}", "title": "" }, { "docid": "e62c93b3c824510d8196df8af5749e13", "score": "0.68243665", "text": "function displayLoading() {\n\t$('div#loadingDialog').show();\n\tloadingCounter++;\n} // displayLoading()", "title": "" }, { "docid": "19da069a47f207317f9ca8096964e2de", "score": "0.6817276", "text": "function showLoadingSpinner() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "title": "" }, { "docid": "8c513c95acbc3060bdae60b7d3c69dcf", "score": "0.6812775", "text": "function activate_loading() {\n $('.not_loading').css('display','none')\n $('.loading').css('display','block')\n}", "title": "" }, { "docid": "87713b4cb444c39b770f027d1866d7f4", "score": "0.68101007", "text": "function _startLoading() {\n this.$$state.loading = true;\n this._elements.svg.classList.add('loading');\n}", "title": "" }, { "docid": "1a0f75b2f76f66659a13446982427500", "score": "0.6809444", "text": "function showLoader(){\n\t$(\"#preLoader\").fadeIn();\n}", "title": "" }, { "docid": "8dd1c22c88a244f1d53c0c6c62c5891d", "score": "0.67925626", "text": "function startLoadingScreen(){\r\n\t\r\n\t//Start to Load Course Content\r\n\tloadContent();\r\n\t\r\n\tvar progressBar = new ProgressBar.Circle('#progress_bar',{\r\n\t\t\tcolor:'#336699',\r\n\t\t\tduration:5000,\r\n\t\t\tstrokeWidth:6,\r\n\t\t\ttrailWidth:3,\r\n\t\t\ttrailColor:\"#999999\",\r\n\t\t\teasing:'easeInOut',\r\n\t\t\ttext: {value:\"0\",style:{color:\"#ffffff\",opacity:1}},\r\n\t\t\tstep: function(state,bar){\r\n\t\t\t\tbar.setText((bar.value()*100).toFixed(0)+\"%\");\r\n\t\t\t\t}\r\n\t\t\r\n\t});\r\n\t\r\n\tvar startBlink = setInterval(function(){\r\n\t\t$(\"#loading_string\").animate({opacity:0},function(){\r\n\t\t\t$(\"#loading_string\").animate({opacity:1});\r\n\t\t});\r\n\t},1000);\r\n\t\r\n\tprogressBar.animate(1,function(){\r\n\t\t$(\"#start_course_btn\").css(\"visibility\",\"visible\").animate({opacity:1});\r\n\t\t$(\"#loading_string\").html(\"Loading Complete!\");\r\n\t\tclearInterval(startBlink);\r\n\t});\r\n}", "title": "" }, { "docid": "c2dbc1d2d9dac30e6e769ff07af178ee", "score": "0.6791762", "text": "buildLoadingIndicator_() {\n const loadingContainer = this.loading_;\n\n const loadingIndicatorTopContainer = createElement(\n this.doc_,\n 'swg-loading-animate',\n {}\n );\n loadingContainer.appendChild(loadingIndicatorTopContainer);\n\n const loadingIndicatorChildContainer = createElement(\n this.doc_,\n 'swg-loading-image',\n {}\n );\n loadingIndicatorTopContainer.appendChild(loadingIndicatorChildContainer);\n }", "title": "" }, { "docid": "d4d17d7b38610e0a8db823e940914c7c", "score": "0.6775509", "text": "function showLoadingSpinner() {\n loader.hidden = false;\n quoteContainer.hidden = true;\n}", "title": "" }, { "docid": "bc91a65dd062e35990fa87cb9e1fe113", "score": "0.67740726", "text": "showLoader(){\n\n const loader = this.getLoaderElement();\n\n this.addClass(this[mainPageElement], 'disabled');\n this.addClass(this[sliderMenuElement], 'disabled');\n this.showElement(loader);\n }", "title": "" }, { "docid": "fd9f26d8af26f79069b141ce1eea9389", "score": "0.67680967", "text": "function showLoading() {\n if ($(\"#drive-box-loading\").length === 0) {\n $(\"#drive-box\").prepend(\"<div id='drive-box-loading'></div>\");\n }\n $(\"#drive-box-loading\").html(\"<div id='loading-wrapper'><div id='loading'><img src='../Images/loading.gif'></div></div>\");\n}", "title": "" }, { "docid": "bee830321f57f85ff4662c7219b9514a", "score": "0.67647815", "text": "function LoadController(renderer, config) {\n\tDivController.call(this, renderer.getDiv());\n\tvar isLoading = false;\n\tvar wrapper;\n\t\n\t/**\n\t * Renders the loader.\n\t * \n\t * @param onRenderDone(div) is invoked when the renderer's div is rendered\n\t * @param onLoaderDone(div) is invoked when load wheel is rendered\n\t */\n\tthis.render = function(onRenderDone, onLoaderDone) {\n\t\t\n\t\t// ignore if loading\n\t\tif (isLoading) {\n\t\t\tif (onLoaderDone) onLoaderDone(wrapper);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// check if already rendered\n\t\tif (renderer.getDiv().children().length) {\n\t\t\tif (onLoaderDone) onLoaderDone(renderer.getDiv());\n\t\t\tif (onRenderDone) onRenderDone(renderer.getDiv());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// load loading gif\n\t\tisLoading = true;\n\t\tvar loadingImg = new Image();\n\t\tloadingImg.onload = function() {\n\t\t\t$(loadingImg).addClass(\"loading\");\n\t\t\t\n\t\t\t// wrap renderer's div\n\t\t\trenderer.getDiv().wrap(\"<div class='loading_div flex_vertical flex_align_center'>\");\t// wrap div with loading\n\t\t\twrapper = renderer.getDiv().parent();\n\t\t\twrapper.prepend(loadingImg);\n\t\t\tif (config && config.enableScroll) wrapper.css(\"margin-bottom\", \"1200px\");\n\t\t\t\n\t\t\t// load is done\n\t\t\tif (onLoaderDone) onLoaderDone(wrapper);\n\t\t\t\n\t\t\t// don't show div while rendering\n\t\t\trenderer.getDiv().hide();\n\t\t\t\t\n\t\t\t// render content\n\t\t\trenderer.render(function() {\n\t\t\t\twrapper.replaceWith(renderer.getDiv());\n\t\t\t\twrapper = null;\n\t\t\t\tisLoading = false;\n\t\t\t\trenderer.getDiv().show();\n\t\t\t\tif (onRenderDone) onRenderDone(renderer.getDiv());\n\t\t\t});\n\t\t};\n\t\tloadingImg.src = \"img/loading.gif\";\n\t}\n\t\n\tthis.getDiv = function() {\n\t\treturn wrapper ? wrapper : renderer.getDiv();\n\t}\n\t\n\tthis.getRenderer = function() {\n\t\treturn renderer;\n\t}\n}", "title": "" }, { "docid": "8f07b7df805c2b5558faad8c35429354", "score": "0.6758329", "text": "function showLoadingView() {\n $startBtn.html(\"loading\");\n $startBtn.off();\n $gameBoard.empty();\n $gameBoard.append('<i id=\"spinner\" class=\"fas fa-spinner fa-spin fa-10x\"></i>');\n\n}", "title": "" }, { "docid": "cbb96ec57e03adaa25cfd1edce228f5a", "score": "0.67483616", "text": "function loadComplete() {\n\tsetTimeout(function(){\n\t\t$(\"#loading-container\").fadeOut();\n\t}, 400);\n}", "title": "" }, { "docid": "4c8d210798beed441b734e97ef46cdca", "score": "0.67426026", "text": "function loading() {\n const container = document.querySelector('.container');\n const loadingSpan = document.createElement('span');\n loadingSpan.className = 'loading';\n loadingSpan.innerHTML = 'Loading..';\n container.appendChild(loadingSpan);\n}", "title": "" }, { "docid": "e8cab6a81f3feea2b7ea0a5b16b61481", "score": "0.6740625", "text": "function showLoading() {\n loader.hidden = false;\n quoteContainer.hidden = true; \n}", "title": "" }, { "docid": "89a9d649291832680f58e3bd7767ead3", "score": "0.6732596", "text": "function change_loader(area, showLoading)\r\n\t{\r\n\t\t// Find the loading element\r\n\t\tvar loader = $('div#loading', area);\r\n\t\t\r\n\t\tif(showLoading)\r\n\t\t\tloader.show();\r\n\t\telse\r\n\t\t\tloader.hide();\r\n\t}", "title": "" }, { "docid": "5b20ea0829ec3e5590dd931d5eb0332c", "score": "0.672818", "text": "function loadingBar() {\n stroke(255, 255, 255);\n strokeWeight(8);\n\n if (player.loadingLevel != 0.99) {\n line(0, 0, map(player.loadingLevel, 0, 1, 0, width), 0);\n }\n}", "title": "" }, { "docid": "e2791005f7ab0a406927bfe6d7d2adbd", "score": "0.6715939", "text": "function showLoading(selector) {\n var html = \"<div>\";\n html += \"<img src='imagens/ajax-loader.gif'></div>\";\n insertHtml(selector, html);\n }", "title": "" }, { "docid": "26792356303a5c0144f38c1cd3ff7a0c", "score": "0.67141694", "text": "function loading(){\n\n\t// Remove success class from a previous ajax request during initial load\n\tbody.removeClass('success');\n\n\t// If ajax request hasn't given success response within 500ms show loading page\n\tsetTimeout(testSuccess, 500);\n\n\tfunction testSuccess(){\n\t\tif ( !body.hasClass('success') ){\n\t\t\t// Load in our loading page\n\t\t\t$('#content').load(stateURL + themeDir + 'templates/loading.php');\n\t\t}\n\t}\n\t\t\t\t\t\n}", "title": "" }, { "docid": "e5c73dd5ee60686da0a89c974f81c917", "score": "0.6703772", "text": "function Loader(){\n this.$el = $('<div />', {\n css: {\n position: 'fixed',\n width: 200,\n height: 50,\n top: '50%',\n left: '50%',\n margin: '-25px 0 0 -100px',\n display: 'none'\n },\n text: 'loading results...'\n });\n }", "title": "" }, { "docid": "7b431f48d59b42a7b2890a190ebe3ac5", "score": "0.67031443", "text": "function setLoading(loading) {\n\t\tif (loading) {\n\t\t\t$(\".defiant-fab-counter p\").hide();\n\t\t\t$(\".defiant-fab-counter i\").show();\n\t\t} else {\n\t\t\t$(\".defiant-fab-counter p\").show();\n\t\t\t$(\".defiant-fab-counter i\").hide();\n\t\t}\n\t}", "title": "" }, { "docid": "489434f568f81f78ba2132f331e9ee1e", "score": "0.6699045", "text": "function updateLoading(){\r\n numImagesLoaded += 1;\r\n $('#loadingBar').css(\"width\",(numImagesLoaded/7)*700);\r\n if(numImagesLoaded === 7){\r\n $('#game').css(\"display\",\"block\");\r\n\t\t$('#loadingScreen').css(\"display\",\"none\");\r\n } \r\n}", "title": "" }, { "docid": "2482c7a232cb0ea5f529e2186f09528a", "score": "0.66987294", "text": "function appendLoader(element) {\n loading = gettext('loading...');\n element.append('<img class=\"ajax-loader\" ' +\n 'src=\"' + mediaUrl('media/images/indicator.gif') + '\" title=\"' +\n loading +\n '\" alt=\"' +\n loading +\n '\" />');\n}", "title": "" }, { "docid": "2482c7a232cb0ea5f529e2186f09528a", "score": "0.66987294", "text": "function appendLoader(element) {\n loading = gettext('loading...');\n element.append('<img class=\"ajax-loader\" ' +\n 'src=\"' + mediaUrl('media/images/indicator.gif') + '\" title=\"' +\n loading +\n '\" alt=\"' +\n loading +\n '\" />');\n}", "title": "" }, { "docid": "47203664b978247e7783b91eac506194", "score": "0.66924727", "text": "function showLoading() {\n $(\"body\").append(\"<div class='pmDynaformLoading' style='position: fixed;left: 0px;top: 0px;width: 100%;height: 100%;z-index: 9999;background: url(/lib/img/loading.gif) 50% 50% no-repeat rgba(255,255,255,0.5);'></div>\");\n}", "title": "" }, { "docid": "167df2e28ec1acd8c919ce802b7fb5d9", "score": "0.66842604", "text": "function showLoader(e) {\n\thtml = '<div class=\"directcheckout-loading-wrapper\"><div class=\"directcheckout-loading\"></div></div>';\n\t$(e).update(html).innerHTML;\n}", "title": "" }, { "docid": "2f1a7a52d639316377914ca8983ee04b", "score": "0.6682644", "text": "function onGraphLoadStart(error,g)\n\t{\n\t\tshowLoader();\n\t}", "title": "" }, { "docid": "a05be2a5c2add097eaea1152cbbef52e", "score": "0.6680207", "text": "function showLoadingFor(id)\n{\n $(id).loading({\n align: 'center',\n pulse: 'working type',\n text: 'Loading...',\n mask: true\n });\n}", "title": "" }, { "docid": "2b1ab8e2a30c65f12ebda4a8b061ad61", "score": "0.66777515", "text": "page_loader() {\n window.$(\".loading-area\").fadeOut(1000)\n }", "title": "" }, { "docid": "5794f13f9085870c5d86453c41e4da50", "score": "0.6671525", "text": "loader() {\n var message = { 'title': 'Topology data loaded', 'msg': '' }\n this.props.triggerLoader(false, null);\n }", "title": "" }, { "docid": "52df18981091d90193c61cfdb06ffee8", "score": "0.66688013", "text": "function showGlobalLoadingImage() {\n\t\t\t$j('#rialto-loading-image').fadeIn(400);\n\t\t\t//alert('showing');\n\t\t}", "title": "" }, { "docid": "186714a9a6e2ec5e00980a23ebd34b6d", "score": "0.66624886", "text": "showLoader () {\n if (this.hideLoader) return\n this.loadingWrapper.style.display = 'flex'\n this.canvas.style.display = 'none'\n }", "title": "" }, { "docid": "8dd3012fb4699e9e4059839c7373e4fe", "score": "0.665219", "text": "_handleResponse(event){this.$.loading.hidden=!0}", "title": "" }, { "docid": "1b7c6e49f91ea945742724fb5f2105f5", "score": "0.66428685", "text": "function _fillContentWithLoadingSpinner() {\n _repositoriesContent.empty()\n .append(HtmlBuilder.div(\"\")\n .addClass(\"loading\")\n .append(HtmlBuilder.img({ src: \"/assets/img/loader.gif\", alt: \"Carregando...\" })))\n }", "title": "" }, { "docid": "db15d2cbb6d1f78fa3132ba39e6bb746", "score": "0.66426134", "text": "function showLoadingView() {\n $(\"#loader\").toggleClass(\"hidden\")\n $(\"button\").text(\"Loading\")\n}", "title": "" }, { "docid": "4f70dae6e0abc6e0d234ad7ee371a7d9", "score": "0.6640596", "text": "function startLoadingAnimation()\n{\n var dots = 0;\n var animateLoadingDots = function ()\n {\n var loading = dashcode.getLocalizedString(\"Laden\");\n for (var i = 0; i < dots; i++) {\n loading = loading + \".\";\n }\n setLoadingText(loading);\n\n if (++dots > 3) {\n dots = 0;\n }\n };\n\n loadingAnimationTimer = setInterval(animateLoadingDots, 500);\n}", "title": "" }, { "docid": "51df7840fd55db7156a8db4f1fc8e8e7", "score": "0.6640423", "text": "function handleComplete() {\r\n\ttoggleLoader(false);\r\n\tinitMain();\r\n}", "title": "" }, { "docid": "0b26207add2f56f4a04cf62f9a3362dc", "score": "0.6627802", "text": "function loader() {\n 'use strict';\n let spinner = document.getElementById('loader');\n setTimeout(function () {\n spinner.style.display = 'none';\n }, 1000);\n}", "title": "" }, { "docid": "f962ef8ece05b9d8843baa6009efd528", "score": "0.6617303", "text": "function startLoading() {\n vm.loading = true;\n }", "title": "" }, { "docid": "f962ef8ece05b9d8843baa6009efd528", "score": "0.6617303", "text": "function startLoading() {\n vm.loading = true;\n }", "title": "" }, { "docid": "f8d60b4d7dc231d2bb7fff503eed6d01", "score": "0.66157037", "text": "function showLoading() {\n\tloading.style.visibility = \"visible\";\n\tloading.style.opacity = \"1\";\n}", "title": "" }, { "docid": "8c31ea49ffcd82d2c8d66867fef8a7ba", "score": "0.661221", "text": "notifyLoading(isLoading) {\n this.isLoading = isLoading;\n if (this.isLoading) {\n this.dispatchEvent(new CustomEvent(\"loading\"));\n }\n else {\n this.dispatchEvent(new CustomEvent(\"doneloading\"));\n }\n }", "title": "" }, { "docid": "bd106485b32cd2023ce9f4444f617647", "score": "0.66113716", "text": "function handleProgress() {\n\t$('#mainLoader').html(Math.round(loader.progress/1*100)+'%');\n}", "title": "" }, { "docid": "c1dee312279d36590b2d35f31a123a64", "score": "0.66105723", "text": "function showLoadingView() {\n $(\"#start\").attr('disabled', 'true')\n $(\"#start\").text(\"Loading...\")\n $(\"#start\").append('<span class=\"spinner-border spinner-border-sm\" role=\"status\" aria-hidden=\"true\"></span>')\n}", "title": "" }, { "docid": "e0ec0f79222564ffc9356ede5fd9c52c", "score": "0.66100866", "text": "function showLoading() {\n $(\"#loading\").show();\n}", "title": "" } ]
d3a019f72ebf442a9c9c957e362fe77e
Triggered when reset icon in the dashboard is clicked. May be clicked in middle of game.
[ { "docid": "57989a6547be9c5641bce7bea79e76dd", "score": "0.6628561", "text": "function resetButtonHandler(mgo) {\n\tif (mgo.testMode) {console.log('resetButtonHandler:');}\n\n\tevent.stopPropagation();\n\n\t// REMOVE THE BLINK HERE\n\thighlightBorder('a.reset', 'reset-blink-red', false, mgo);\n\n\tmgo.tally = 0;\t// Set tally back to start value\n\n\tlet backCollection = \tdocument.querySelectorAll('.back.card');\n\tbackCollection.forEach(element => {\n\t\telement.src = mgo.cardBackImage;\n\t});\n\n\treturn;\n}", "title": "" } ]
[ { "docid": "2bb271ab4a0155453c6e24d38b7d106b", "score": "0.8149632", "text": "function _handleResetClick() {\n game.reset();\n }", "title": "" }, { "docid": "b3894303c2305a96a2e803b932e0ebbf", "score": "0.78045887", "text": "function Reset() {\n console.log(\"Reset Clicked\");\n}", "title": "" }, { "docid": "c409b6914c1cdfa1ce28f465f30d9447", "score": "0.7484812", "text": "function onResetClick() {\n\t\tchrome.extension.sendMessage({\n\t\t\taction: 'reset',\n\t\t}, onReset)\n\t}", "title": "" }, { "docid": "ac0cf3061c26b2e5d4a555860f7b9115", "score": "0.73017263", "text": "function onResetButtonClicked() {\n resetStats();\n window.location.reload();\n}", "title": "" }, { "docid": "2187be7d47d239b29b7211696dd01ca2", "score": "0.716603", "text": "function Reset()\r\n{\r\n\taction_completed = false;\r\n\tGetComponent.<SpriteRenderer>().sprite = spr_switch_up;\r\n}", "title": "" }, { "docid": "401ef255bac0a4e8006ca27a18fcedee", "score": "0.71594834", "text": "function reset() {\n finalScreen();\n }", "title": "" }, { "docid": "2cadd1efb2251d0a38a14d15fa62d8f9", "score": "0.71043855", "text": "function reset() {\n setClicked(true);\n setScore(0);\n setTimer(0);\n }", "title": "" }, { "docid": "3f18d1ca9d4f6c4f4ab80a3adfc0d7b2", "score": "0.70679194", "text": "function reset() {\n // Update gameOver and make it false\n gameOver = false;\n \n hide(document.getElementById('game-start'));\n hide(document.getElementById('game-over'));\n hide(document.getElementById('audio-ctl'));\n hide(document.getElementById('overlay'));\n show(document.getElementById('stats'));\n \n // Tell the Player to reset\n player.reset(true);\n \n // Reset the collectibles on the board\n Collectible.reset();\n }", "title": "" }, { "docid": "0c2d9330a9b576cdab0a421e72675aae", "score": "0.70653945", "text": "function resetGame() {\n resetScore();\n resetLoss();\n hideGameOverModal();\n }", "title": "" }, { "docid": "0c2d9330a9b576cdab0a421e72675aae", "score": "0.70653945", "text": "function resetGame() {\n resetScore();\n resetLoss();\n hideGameOverModal();\n }", "title": "" }, { "docid": "b0208578a6ec92531c738a543d95469a", "score": "0.6998149", "text": "function reset() {\n gameCodeInput.value = \"\";\n initialScreen.style.display = \"block\";\n gameScreen.style.display = \"none\";\n player1.classList.remove(\"turn\");\n player2.classList.remove(\"turn\");\n\n down = true;\n state = {};\n gameStarted = false;\n current = {};\n host = {};\n socket.emit(\"reset\");\n $(\"#finalScreen\").modal(\"hide\");\n}", "title": "" }, { "docid": "6b6dfb1d0b15214fdf23a215d809c278", "score": "0.6989723", "text": "function resetGameState() {\n let startButton = $('.start-button');\n let settingButton = $('.setting-button');\n startButton.html('Play Again');\n settingButton.html('Change Settings');\n let pieces = $('.board-piece');\n pieces.off('click');\n startButton.prop('disabled', false);\n settingButton.prop('disabled', false);\n }", "title": "" }, { "docid": "49bdbf7680ae333ca364a66606d2aa77", "score": "0.696525", "text": "function reset() {\n // reset the number of turns\n _numTurns = 0;\n \n // reset the gameBoard state\n gameBoard.resetState();\n\n // Display empty text in the outcome field\n displayController.displayOutcome('');\n\n // Call start method\n game.start();\n }", "title": "" }, { "docid": "e63dee95bef200d7bab376724848f878", "score": "0.694702", "text": "onReset() {}", "title": "" }, { "docid": "04b2a612dcb82d67ff64ece9f8e0d8cc", "score": "0.69447476", "text": "function resetGame() {\n createDeck();\n resetStats();\n toggleModal();\n}", "title": "" }, { "docid": "231b769549153f5110ff5e10c63d6691", "score": "0.6938227", "text": "optionResetButtonClicked () {\n this.disableRenderer = true;\n this.panelDataHandler.resetToDefaults(true, true);\n this.disableRenderer = false;\n this.refresh();\n }", "title": "" }, { "docid": "271f94a580aa4258a9a833bde2d98d59", "score": "0.69276375", "text": "function reset() {\n exit.play();\n menuscreen.style.display = \"block\";\n loadingscreen.style.display = \"none\";\n creditsscreen.style.display = \"block\";\n gamescreen.style.display = \"block\";\n onMainMenu = true;\n onMenu = true;\n}", "title": "" }, { "docid": "560845733ee6804ba8569c7cdcb1449a", "score": "0.6890061", "text": "function reset() {\n alert(\"Game is over resetting\");\n init();\n}", "title": "" }, { "docid": "3be5edc78a832f42607ef94d453de646", "score": "0.6886205", "text": "function resetClicked() {\n resetBackground();\n if(TogetherJS.running) {\n TogetherJS.send({\n type: \"resetBackground\"\n });\n }\n}", "title": "" }, { "docid": "0ed3977bc4e690a8fc63b0bc94a57fa5", "score": "0.6872799", "text": "function OnResetButtonClick ()\r\n {\r\n if (document.getElementById ('ResetBtn').disabled == false)\r\n {\r\n SetParamsValues (true);\r\n drawScreen ();\r\n }\r\n }", "title": "" }, { "docid": "17b6024e24ea75c98cc6703dd8b7a99e", "score": "0.6862016", "text": "resetButtonClicked(event) {\n if(event.target.classList.contains(this.boardUI.classes.button)){\n this.resetGame();\n }\n }", "title": "" }, { "docid": "11f78ccc59252cb21989c53cf48f6ba2", "score": "0.68483746", "text": "function reset() {\n AJ.offboard();\n}", "title": "" }, { "docid": "6a447bd3767d5fa49c0ab36e946bb402", "score": "0.68395764", "text": "function resetButtonHandler()\n {\n resetCanvas(canvas);\n drawSummaryChart( moduleObjectArray, canvas);\n compareMode = false;\n }", "title": "" }, { "docid": "b67eacd5d8efd1a6014e4c76b6511578", "score": "0.6831912", "text": "function reset() {\n\t\tconsole.log(\"reset button pressed\")\n\t\tlocation.reload();\n\t}", "title": "" }, { "docid": "99676b3e97e1987e6094735f45ae2618", "score": "0.6829542", "text": "actionReset(){\n this.currentTurn = false;\n this.actionDone = 0;\n }", "title": "" }, { "docid": "b98f9a206c43a34276e6d355548f8972", "score": "0.6816731", "text": "function resetGame() {\n //\n visuals.removeFeedbackClasses();\n config.animations.playerTurnChangeTimeLength = 600;\n //\n for (var i = 1; i <= 9; i++) document.getElementById('elem-cell-button' + i).value = config.symbols.empty;\n //\n setCellButtons();\n getCellButtons();\n disableAllCellButtons(false);\n config.playState.whoseTurn = 0;\n movesMade = 0;\n //\n playerTurnChangeAnimation({\n elem: elemOutputTurn,\n message: config.onePlayer ? uiLabels.userFeedback.turn.player : uiLabels.userFeedback.turn.playerOne,\n fadeState: {\n begin: 0,\n end: 1,\n len: config.animations.speedSettings.quick\n }\n });\n config.playState.playerInteractionEnabled = true;\n}", "title": "" }, { "docid": "650505c60ca5f1fe83d2b535af81fb8d", "score": "0.68117315", "text": "function drawResetButton() {\n if (mouseX > dashboardColumnLeft && mouseX < 195 && mouseY > secondRowButtonTop && mouseY < 546 && mouseIsPressed) { // clicked state\n fill(181, 218, 252); // light blue\n } else if (mouseX > dashboardColumnLeft && mouseX < 195 && mouseY > secondRowButtonTop && mouseY < 546) { // hover state\n fill(150); // grey\n } else { // not interacting with\n fill(180); // light grey\n }\n noStroke(); // stroke removed\n rect(dashboardColumnLeft, secondRowButtonTop, 72, 32); // draws reset button rectangle\n fill(0); // fill set to black for label\n text(\"RESET\", 140, 535); // Reset label drawn on button\n}", "title": "" }, { "docid": "bd625be85584b566347fd2edf74078e7", "score": "0.6791215", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html(\"\");\n }\n }", "title": "" }, { "docid": "8dbc18a6f92365ca2d49ee2e621d77cf", "score": "0.67876136", "text": "function resetButtonPressed(){\n setup();\n waitLabel.hide();\n}", "title": "" }, { "docid": "6dcbf67258059073ba6b996e730c45a6", "score": "0.6771389", "text": "function fullReset() {\n $(\".overlay\").remove();\n $(\"div\").css('background-image', \"\");\n $(\"div\").removeClass('filled');\n $(\"div\").attr('title', \" \");\n gameWon=0;\n turnCounter=0;\n //ensures O starts each round, because Beyonce is #1\n playerIcon = oIcon;\n displayTurn();\n}", "title": "" }, { "docid": "98392c4b7b2b0c360bca977159111a6d", "score": "0.67697614", "text": "function resetGame() {\n resetTimer();\n startTimer();\n game.clicks = 0;\n $('#score').text(game.clicks);\n }", "title": "" }, { "docid": "3a108a4f5761a9caa7ca680933d0daf3", "score": "0.67645144", "text": "function gameRestart() {\n gameReset();\n toggleOverModal();\n cardReset();\n}", "title": "" }, { "docid": "2a4fb1a2303e67955564cbdb800410ef", "score": "0.67527425", "text": "function setupResetBtn(){\n resetBtn.addEventListener(\"click\", function() {\n resetGame();\n })\n}", "title": "" }, { "docid": "96aa8ba95ea9379a7179d22e0160f2e0", "score": "0.67460716", "text": "function reset() {\n\n \n}", "title": "" }, { "docid": "faf1b463c22b893e15168edf3a635ba0", "score": "0.6723831", "text": "function resetGame(){\n \n }", "title": "" }, { "docid": "aaa81d54fb575b1262efa042b4617fc7", "score": "0.67182046", "text": "faildAction(){\n\t\t\tgameView.resetStyle()\n\t\t\tconsole.log(`oops, lets try againe`)\n\t\t}", "title": "" }, { "docid": "1ac29a14bd2684a127a1c89c17b37ddb", "score": "0.6716775", "text": "function reset() {\n game.startNewGame();\n }", "title": "" }, { "docid": "c5fb61019a1cb51a4ae1868bfa5e2517", "score": "0.67129856", "text": "function resetScreen() {\n\t// Remove any instances of the databox changing classes.\n\t$('.databox').removeClass('changedodd');\n\t$('.databox').removeClass('changedeven');\n\t$('.databox').removeClass('endedGame');\n\n\t// Display the thank you.\n\t$('.thankyou').addClass('endedGame');\n}", "title": "" }, { "docid": "d52f534f6d2f3fac435de596717ddd6f", "score": "0.67085874", "text": "function reset(){\n gameState=PLAY;\n gameOver.visible=false;\n restart.visible=false\n pinkCG.destroyEach();\n redCG.destroyEach();\n yellowCG.destroyEach();\n cycleboy1G.destroyEach();\n cycleboy2G.destroyEach();\n mainCyclist.addAnimation(\"SahilRunning\",mainRacerImg1);\n distance=0;\n}", "title": "" }, { "docid": "f3d5de82fdf0b0d775ea93297f8f75d6", "score": "0.67010987", "text": "function resetGame() {\n document.querySelector('.flags').innerText = '⛳️ ' + flagCounter;\n document.querySelector('.timer').innerText = ' 00:00';\n if (gLevel.size === 4) {\n gLevel.livesLeft = 1;\n } else if (gLevel.size === 8) {\n gLevel.livesLeft = 2;\n } else if (gLevel.size === 12) {\n gLevel.livesLeft = 3;\n }\n document.querySelector('.lives span').innerText = gLevel.livesLeft;\n document.querySelector('.smiley').innerText = '😃'\n document.querySelector('h2').style.visibility = 'hidden';\n clickCounter = 0;\n flagCounter = gLevel.mines;\n minesIgnored = 0;\n isHintOn = false;\n shownCellsCount = 0;\n numCellsOnBoard = (gLevel.size ** 2) - gLevel.mines;\n totalSeconds = 0;\n safeClicks = [];\n safeClicksCounter = 3;\n document.querySelector('.safe-click span').innerText = safeClicksCounter\n\n}", "title": "" }, { "docid": "d11da95a4bce89c35a301ecb01abd208", "score": "0.66963524", "text": "function reset() {\n playerNum = null;\n gameId.value = \"\";\n displayGameId.value = \"\";\n homeScreen.style.display = \"block\";\n gameScreen.style.display = \"none\"\n}", "title": "" }, { "docid": "d30aae37d49859bd3044d02203979711", "score": "0.66955596", "text": "function resetGame() {\n gInitGame = false;\n\n gGameClock = gGameClockSetting;\n\n hideScore();\n}", "title": "" }, { "docid": "aa05ff9865b4f5b5b782639208d47092", "score": "0.66793394", "text": "function reset() {\n inputText.textContent = 'How many rounds should you play?';\n document.getElementById(\"btnOne\").src=\"one.png\";\n document.getElementById(\"btnTwo\").src=\"three.png\";\n document.getElementById(\"btnThree\").src=\"five.png\";\n \n \n \n bOne.onclick = () => game(1);\n bTwo.onclick = () => game(3);\n bThree.onclick = () => game(5);\n }", "title": "" }, { "docid": "f075151e60da65ef9d757d479a8e3f5c", "score": "0.6678833", "text": "function reset() {\n\n}", "title": "" }, { "docid": "00fd171a9607e6f62e5ab300ac4e9da5", "score": "0.6676942", "text": "function reset(){\n \n}", "title": "" }, { "docid": "25ebe56291f3967ba659fcfdcd23bb18", "score": "0.6667583", "text": "function ResetGame(){\n\tif (playerBug[0].GetComponent(bugController).isOnHome && \n\t\tplayerBug[1].GetComponent(bugController).isOnHome && \n\t\tplayerBug[2].GetComponent(bugController).isOnHome && \n\t\tplayerBug[3].GetComponent(bugController).isOnHome && \n\t\tplayerBug[4].GetComponent(bugController).isOnHome && \n\t\tenemyBug[0].GetComponent(bugController).isOnHome && \n\t\tenemyBug[1].GetComponent(bugController).isOnHome && \n\t\tenemyBug[2].GetComponent(bugController).isOnHome && \n\t\tenemyBug[3].GetComponent(bugController).isOnHome && \n\t\tenemyBug[4].GetComponent(bugController).isOnHome)\n\t{\n\t\tgamePhase \t\t= 2;\n\t\tCheckHealthBars();\n\t\tstartButton.SetActive(true);\n\t planningTitle.SetActive(true);\n\t choosingControl.GetComponent(choosingController).ChooseEnemyActions();\n\t}\n}", "title": "" }, { "docid": "f0b9643b60bccda63c16a31981855b80", "score": "0.6662556", "text": "function resetGame() {\n //Update the highscore\n updateHighscore();\n //Reset the game score\n elScoreboard.value = '';\n //Reset game piece background-image\n for (var i = 0; i < gamePieces.length; i++) {\n var curPiece = gamePieces[i];\n curPiece.removeAttribute('style');\n }\n //Remove game over modal window\n gameoverModal.style.display = 'none';\n\n shuffleBoard();\n addPieceEvents();\n }", "title": "" }, { "docid": "02425f0722eff39d5d4e055d6ef7aa45", "score": "0.66610014", "text": "function resetGame(){\n gamesPlayed++;\n resetStats();\n displayStats();\n\n $('#cardContainer').empty();\n\n $('.card').off('click'); //temporarily removes all click handlers, so that they won't fire twice when restarted\n $('#gameWon').css('display', 'none'); //reset win features //will need to be placed outside of cardContainer\n initMap();\n\n $('.reset').off('click');\n initializeGame();\n }", "title": "" }, { "docid": "c297da1ce35b83cb91ecf96ee1e36c5e", "score": "0.66561437", "text": "function reset() {\n playerNumber = null;\n gameCodeInput.value = '';\n initialScreen.style.display = \"block\";\n gameScreen.style.display = \"none\";\n gameOverScreen.style.display = \"none\";\n winnerScreen.style.display = \"none\";\n}", "title": "" }, { "docid": "7d300020705b92b953d489f5c711190a", "score": "0.6653396", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n }\n}", "title": "" }, { "docid": "586c414f6f75507eabf45869e0dfae64", "score": "0.66480786", "text": "function resetKonami() {\n\tif (this.konami_trigger != 0) this.konami_trigger = 0;\n\tconsole.log(\"Konami Reset\");\n}", "title": "" }, { "docid": "dfc17f1b3554c0977d8bbfd1da9087d1", "score": "0.66464454", "text": "function reset() {\n // writng code for things to be changed after reset function\n gameState = PLAY;\n gameOver.visible = false;\n pinkCyclistsGroup.destroyEach();\n yellowCyclistsGroup.destroyEach();\n redCyclistsGroup.destroyEach();\n mainCyclist.changeAnimation(\"mainCyclist cycling\", mainCyclist_cycling);\n distance = 0;\n \n // Logging the count of reset frame called in the console\n console.count(\"Reset frame is called\");\n}", "title": "" }, { "docid": "bbe03933909d6e7c2d17f0edffd1ff5a", "score": "0.6637865", "text": "ResetGame() {}", "title": "" }, { "docid": "c9b9f6715e9ccf899469a69d94ad18bb", "score": "0.66371816", "text": "function reset(){\r\n gameState = \"PLAY\";\r\n\r\n trex.changeAnimation(\"trexRunning\", trex_running);\r\n trex.x = width/2 - 450;\r\n trex.y = height - 75;\r\n\r\n gameOver.visible = false;\r\n restartButton.visible = false;\r\n\r\n cactusGroup.destroyEach();\r\n cloudGroup.destroyEach();\r\n birdsGroup.destroyEach();\r\n\r\n score = 0;\r\n}", "title": "" }, { "docid": "2054fbcbfd7f6f4f428a01ce7a64050a", "score": "0.6634989", "text": "function reset() {\n onePlayerStart.disabled = false;\n twoPlayerStart.disabled = false;\n board = { 0: false, 1: false, 2: false, 3: false, 4: false, 5: false, 6: false, 7: false, 8: false };\n setTimeout(() => {\n gameBoard.className = 'fadeAway';\n gameBoard.style.zIndex = '-10';\n cells.forEach((cell) => {\n cell.textContent = '';\n cell.removeEventListener('click', clicked);\n });\n status.className = 'fadeOut';\n status.zIndex = '-10';\n }, 1000);\n setTimeout(() => {\n playAgain.className = 'fade';\n playAgain.style.zIndex = '1';\n }, 3000);\n return stopClock();\n}", "title": "" }, { "docid": "96288ca381eeb4ccc3b6b80c345f771e", "score": "0.66322285", "text": "function resetGame() {\n resetFuel();\n changeActivePlanet(-7);\n currentStatsIndex = 0;\n displayStats();\n planetQIndex = 0;\n updateQuestion();\n gameContainer.classList.remove('hide');\n flightContainer.classList.remove('hide');\n}", "title": "" }, { "docid": "b8889f6667881c19d197ff85f17cf4bd", "score": "0.6616006", "text": "resetButton() {\n let changes = [\n {key: \"app.state.save\", value: \"ready\"}\n ];\n contentActions.changeContent(changes);\n }", "title": "" }, { "docid": "005a50fe8fc784a776536c591e8636a8", "score": "0.6610683", "text": "function reset(){\n\t// Display Reset\n\tsquares.removeClass(\"player1 player2\");\n\tmessageDisaplay.textContent = \"\";\n\tconsole.clear();\n\n\t// Game Data Reset\n\tmove_count = 0;\n\tfor (var i= 0; i < matrix.length; i++){\n\t\tfor (var j = 0; j < matrix[0].length; j++){\n\t\t\tmatrix[i][j] = 0;\n\t\t}\n\t}\n\taction = undefined;\n}", "title": "" }, { "docid": "7d97f1dabf7102a5444a97373de781f1", "score": "0.66101015", "text": "function reset() {\n\tcreateGameBoard();\n\tinitGame();\n}", "title": "" }, { "docid": "acb2bfa9e2ae0795b742bf1ba697efaa", "score": "0.65989244", "text": "function reset() {\n drawUI();\n S(function(tile){return tile.y >= uiHeight;})\n .exec(function(tile) { tile.data = new GameBehavior(); })\n .set(styles.empty);\n\n playing = true;\n processFirstClick = true;\n setInteractionMode(modes.reveal);\n }", "title": "" }, { "docid": "54a47d3d5f2b14655d33a37b001611cd", "score": "0.65966374", "text": "bindResetButton() {\n return this.resetButton.addEventListener(\"click\", function() {\n return fg.mindmap.reset();\n });\n }", "title": "" }, { "docid": "d57a7373f5a24752b7bc5e93369bfb9a", "score": "0.6591778", "text": "function reset() {\n }", "title": "" }, { "docid": "4cabe36ca73c4ef5639630121a0c9fb2", "score": "0.65910643", "text": "function resetGame() {\n\tconst button = document.getElementById('computerButton');\n\tconst resetButton = document.getElementById('resetButton');\n\n\tbutton.style.display = 'none';\n\tresetButton.style.display = 'block';\n\n\tresetButton.onclick = () => {\n\t\tresetPlayer2Choice(resetButton);\n\t\tresetPlayer1Choice();\n\t\tresetWinnerOutput();\n\t}\n}", "title": "" }, { "docid": "6feb8eb93c12485c7746b93bba6ab8e6", "score": "0.6590026", "text": "function resetGame() {\n $(\"#youWin\").hide();\n $(\"#youLose\").hide();\n $(\".crystalRed\").unbind(\"click\");\n $(\".crystalYellow\").unbind(\"click\");\n $(\".crystalBlue\").unbind(\"click\");\n $(\".crystalPurple\").unbind(\"click\");\n console.log(\"Reset Game Started\");\n magicButtonClicked = false;\n userScore = 0;\n $(\"#userScore\").text(\"User Score: \");\n $(\"#magicScore\").text(\"Score to match: \");\n result = Math.floor(Math.random() * (200 - 50) + 50);\n playGame();\n}", "title": "" }, { "docid": "f8be1dc5fb179c1b57c347588573ce98", "score": "0.65857667", "text": "function ResetButton() {\r\n if( !g_buttons_enabled ) return;\r\n \r\n // Ugly confirm box. Prettify in the future?\r\n if( confirm( \"Are you sure?\" )) {\r\n localStorage.clear();\r\n ShowNormal();\r\n }\r\n}", "title": "" }, { "docid": "328272bf3d73d4e08ff7f31144fa4365", "score": "0.6582687", "text": "function reset() {\n rpcBtns.forEach(btn => btn.disabled = false);\n updateImages('default', 'default');\n playAgainBtn.style.visibility = \"hidden\";\n userScore = 0;\n computerScore = 0;\n userScoreText.textContent = userScore;\n computerScoreText.textContent = computerScore;\n finalResult.textContent = '';\n result.innerText = '\\n';\n gameActive = true;\n playerMoves.forEach(container => container.style.border = null);\n}", "title": "" }, { "docid": "b9e895353bcc8bcb7185bf73569434e9", "score": "0.6579713", "text": "function resetGame() {\n\t$(\"#board\").html(\"\");\n\tbuildGrid();\n\n\tcurrentPlayer = \"r\";\n\tgridMatrix = [[,,,,,],[,,,,,],[,,,,,],[,,,,,],[,,,,,],[,,,,,]];\n\n\t$(\"#pageDiv\").keyup(function() {\n\t\treturn;\n\t});\n\n\t$(\"#pageDiv\").click(function() {\n\t\treturn;\n\t})\n}", "title": "" }, { "docid": "f48a2a7336971f0e7288ba8f752316a4", "score": "0.6574294", "text": "function resetGame() {\n resetBtn.addEventListener('click',() => \n location.reload());\n}", "title": "" }, { "docid": "aef1fb47d58e6892f95eb97797efe342", "score": "0.6573325", "text": "function resetGame() {\n // Reset del gioco\n manager.resetGame();\n\n // Rimuovo il numero di pizze rimanenti\n $(\"#lblPizzasNr\").html(\"Numero pizze: \");\n\n // Disabilito i giocatori\n setActivePlayer(\"player1\", false);\n setActivePlayer(\"player2\", false);\n\n // Metto il focus al pulsante per l'inizio del gioco\n $(\"#btnStartGame\").focus();\n}", "title": "" }, { "docid": "0a3a7b9434ba38092a1723235c356ef9", "score": "0.65730333", "text": "function resetBtn(){\r\n reset.addEventListener('click', ()=>{\r\n location.reload(true)\r\n })\r\n}", "title": "" }, { "docid": "d83fd5af3e756d24ca060be34ce913b7", "score": "0.6571003", "text": "function listenForReset() {\n $('#reset-game').click(() => {\n $.post(`${rootDir}/game/reset`, (game) => {\n updateBoard(game);\n });\n $('#winner-display').hide();\n });\n $('#reset-score').click(() => {\n $.get(`${rootDir}/game/state`, (data) => {\n // TODO: change this to something meaningful\n $('#grid').append($('<li></li>').text(data));\n });\n });\n}", "title": "" }, { "docid": "f55c377c53d1bd61018ab3abb7f4ba6a", "score": "0.65666837", "text": "function resetall() {\n setScreen(\"welcome_screen\");\n startvalues();\n update();\n}", "title": "" }, { "docid": "daf8dd8f72c2c127e0de5ec1834088e4", "score": "0.6564318", "text": "function resetIcon() {\n chrome.browserAction.setIcon({path: 'images/rose-0.png'});\n}", "title": "" }, { "docid": "1454d780b35063efe5fd124c8887164f", "score": "0.6560085", "text": "function reset(){}", "title": "" }, { "docid": "97ad2fd15d5ecbda72b031b11ffc365b", "score": "0.6552972", "text": "function onReset() {\n log('#logs', 'Clicked the reset button');\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html('');\n }\n}", "title": "" }, { "docid": "bb0f67a15ee6af17b1346fa44de0a727", "score": "0.6542189", "text": "function reset() {\n gameState = \"play\";\n gameOver.visible = false;\n restart.visible = false;\n cloudsGroup.destroyEach();\n obstaclesGroup.destroyEach();\n trex.changeAnimation(\"running\", trex_running);\n score = 0;\n}", "title": "" }, { "docid": "4de4a0a229ca9a5519df9ea77bf9919a", "score": "0.6542138", "text": "function resetGameState() {\n $(\"#alerts\").html(\"\");\n $(\"#guesses-remaining\").html(\"--\");\n $(\"#submit-guess-input\").val(\"\");\n $(\"#submit-guess-input\").attr(\"disabled\", \"\");\n}", "title": "" }, { "docid": "1c6a6be70f34c05abc9aeb8081411cbf", "score": "0.65415263", "text": "function reset(){\n gameState = PLAY; \n gameOver.visible=false;\n Hare.addAnimation(\"SahilRunning\",mainRacerImg1);\n\n pinkCG.destroyEach();\n \n distance = 0;\n}", "title": "" }, { "docid": "bc1c83d9293bc3418c866ab8e0a37dda", "score": "0.65352976", "text": "function activateResetButton(game) {\n const resetButton = document.querySelector(\".main-control button.reset\");\n const startButton = document.querySelector(\".main-control button.begin\");\n\n resetButton.addEventListener(\"click\", () => {\n game.reset(game.target);\n resetButton.classList.add(\"hidden\");\n startButton.classList.remove(\"hidden\");\n });\n}", "title": "" }, { "docid": "38d5a0584585f9fd8d8a40ec75552494", "score": "0.6527445", "text": "resetGame(){\n var that = this;\n $(\"#restart-btn\").on(\"click\", function(){\n $(\".hidden\").show();\n $(\"#end-display\").hide();\n questionDisplayed = false; \n questionsUsed = [];\n correctAnswer = 0;\n incorrectAnswer = 0;\n questionNumber = 0;\n that.generateQuestion();\n })\n }", "title": "" }, { "docid": "f9960ee39b11a2663c0c2cbceaccc82f", "score": "0.65269655", "text": "function reset(){\n if(confirm(\"Do you want to reset?\")) {\n team1.goals = 0;\n team1.shotsTaken = 0;\n team2.goals = 0;\n team2.shotsTaken = 0;\n resetCounter.innerHTML = Number(resetCounter.innerHTML) + 1\n updateScoreboard();\n }\n}", "title": "" }, { "docid": "02f8922033caaa85303f2df02b6bc7a3", "score": "0.65190053", "text": "function Reset() {\r\n\t\t\t\t \tvar reset = $(\"#reset\");\r\n\t\t\t\t \treset.on(\"click\", function(){\r\n\t\t\t\t \t\t location.reload(true);\r\n\t\t\t\t \t})\r\n\t\t\t\t \r\n\t\t\t\t \t\r\n\t\t\t\t }", "title": "" }, { "docid": "a1f916105ba7e6ffaed2a3ffeae5770b", "score": "0.6517238", "text": "function resetGame() {\n saveHighScore();\n startBtn.children[0].innerText = \"Start!\";\n turn.innerText = 'Press Start!';\n randomSequence = [];\n playerSequence = [];\n startBtnEventListener();\n}", "title": "" }, { "docid": "58e5428170057a4519e4a6b786bcabd0", "score": "0.6511442", "text": "function gameReset(hardReset){\n if (hardReset){\n modalText.innerText = \"New game?\";\n } else {\n modalText.innerText = \"Select Turn\";\n }\n}", "title": "" }, { "docid": "70a076a1ee5ae780ea0f8b52de451503", "score": "0.65091693", "text": "async function reset() {\n play_local.game.animation_states.cancelled = true;\n cleanSession();\n cellsToggleEvent(true);\n play_local.panel.score.player1.innerHTML = 0;\n play_local.panel.score.player2.innerHTML = 0;\n await utils.sleep(500);\n play_local.game.animation_states.cancelled = false;\n return console.log(\"TicTacToe Message: Game was reinitialized.\");\n}", "title": "" }, { "docid": "aed6b4d9fc4402c9881269aec5d1c356", "score": "0.65039873", "text": "function resetGame(){ \n attackCounter = 0;\n enemiesleft = 2; \n //hide the right robots\n $(\".availableOpponents\").hide();\n $(\".currentOpponent\").hide();\n //initialize the health tracking\n $(\".bumblebee .card-footer\").text(transformer.bumblebee.healthpoints) ;\n $(\".jazz .card-footer\").text(transformer.jazz.healthpoints) ;\n $(\".soundwave .card-footer\").text(transformer.soundwave.healthpoints) ;\n $(\".skywarp .card-footer\").text(transformer.skywarp.healthpoints) ;\n \n clickChampion();\n clickOpponent();\n clickFight(); \n }", "title": "" }, { "docid": "b27875e25212c992c344f1fd4d0b3335", "score": "0.6500539", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html(\"\");\n }\n}", "title": "" }, { "docid": "b27875e25212c992c344f1fd4d0b3335", "score": "0.6500539", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html(\"\");\n }\n}", "title": "" }, { "docid": "b27875e25212c992c344f1fd4d0b3335", "score": "0.6500539", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html(\"\");\n }\n}", "title": "" }, { "docid": "aa4634e402021e45c69dc80ad954b65e", "score": "0.64945334", "text": "function resetGame(){\n\t//change all squares back to black text\n\tgameSquareArray.forEach(function(item){\n\t\titem.innerHTML = \"\";\n\t\titem.touched = false;\n\t\titem.style.color = \"black\";\n\t\titem.winning = false;\n\t});\n\tresetButton.classList.add(\"hide\");\n\tinstructionDisplay.classList.add(\"hide\");\n\tturnDisplay.classList.add(\"hide\");\n\tgameBoard.classList.add(\"hide\");\n\ttwoPlayerButton.classList.remove(\"hide\");\n\tagainstAIButton.classList.remove(\"hide\");\n}", "title": "" }, { "docid": "03c27f9641d2dce67ec17644c161c054", "score": "0.64893323", "text": "function reset() {\n showGameScreen(false);\n questionIndex = 0;\n strikesRef.innerHTML = \"\";\n strikeCounter = 0;\n progressMarkerRef.style.gridColumn = 1;\n finishMarkerRef.classList.remove = \"hidden\";\n}", "title": "" }, { "docid": "0fb9003f64cf474b43d8fe10070ce5e8", "score": "0.64864206", "text": "function resetGame() {\n document.body.classList.remove(\"overlay-is-open\");\n updateProblem();\n state.score = 0;\n state.wrongAnswers = 0;\n pointsNeeded.textContent = 10;\n mistakesAllowed.textContent = 2;\n inputField();\n renderProgressBar(); // Call function to reset progress bar despending on the \"state.score\"\n }", "title": "" }, { "docid": "2363e168281bffda6a5fe44e74e84c5d", "score": "0.648601", "text": "function resetGameClickHandler( event ) {\r\n\t// If the game is being played, stop the game and display the intro screen\r\n\t/*\r\n\t if (playing === true) {\r\n\t playing = false;\r\n\t panels.style.display = 'inline-block';\r\n\t }\r\n\t */\r\n}", "title": "" }, { "docid": "b76cd08086a5f780345f24f927581dcc", "score": "0.64853287", "text": "function reset(){\ngameState=PLAY;\ngameOver.visible=false;\nrestart.visible=false;\nHandGroup.destroyEach();\nscore=0;\nzombie.x=150;\nground.addImage(bg);\nbgm.play();\n\n}", "title": "" }, { "docid": "f5f6053befea7ea40b71fc9ca07b008f", "score": "0.6483676", "text": "function resetGame() {\r\n clearInterval(gGameTimeInterval);\r\n resetGameTime();\r\n gFirstClick = false;\r\n gLives = (gBoard.length === 4) ? 1 : 3;\r\n renderLives();\r\n initGame();\r\n}", "title": "" }, { "docid": "293bcbc244d45d2e1a32fe56193088ab", "score": "0.6479879", "text": "reset() {\n this.game.noises.reset.play();\n this.player.clearTeam();\n this.player.addStandardPieces();\n this.player.copyPieceData();\n this.player.saveToLocalStorage();\n this.player.calculateTeamValue();\n this.player.placeTeamInCustomize();\n\n this.hide();\n }", "title": "" }, { "docid": "4a8602cdb33cc446dc6fad222feb7e28", "score": "0.6479311", "text": "function reset() {\n indexClicked = 0;\n trackClicked = 0;\n}", "title": "" }, { "docid": "7b4a42a625619623dbf7a703ec975014", "score": "0.64786786", "text": "function onReset() {\n\t\twindow.location.reload()\n\t}", "title": "" }, { "docid": "02c68675b9b91f7e4f5b113951a5a7ba", "score": "0.647636", "text": "function resetGame() {\n button.className = button.className.replace('green', 'gray');\n button.className = button.className.replace('hide', '');\n round = 0;\n points = 0;\n imageIndex = Math.floor(Math.random() * imagesArray.length);\n imagesShowed = [];\n hideScoreAlert();\n newRound();\n}", "title": "" }, { "docid": "bd23f353696b73814de3742bcd650a0e", "score": "0.6465732", "text": "function gameOver() {\n\t$(\"#attackBTN\").hide();\n\t$(\"#resetBTN\").show().on(\"click\", function() {\n\t\tlocation.reload();\n\t});\n}", "title": "" } ]
a1d6554ca0797885efc9159d8f65acc6
displaying, only array elements that are more than 10; filtering
[ { "docid": "7bc9517fff269a580e64b59f67077cd2", "score": "0.7526953", "text": "function great(){\n var isGrt= arr.filter(function (num){\n return num>=10;\n });\n document.getElementById(\"p2\").innerHTML= \"NUMBERS GREATER THAN 10 IN THE ARRAY: \"+isGrt;\n\n}", "title": "" } ]
[ { "docid": "5ffd7bbfeb0a2908bbb8ce31b38c8ace", "score": "0.69725424", "text": "function filterArr(array) {\n const filtered = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i] >= 5) {\n filtered.push(array[i]);\n }\n }\n return filtered;\n}", "title": "" }, { "docid": "6c29b2eb780023ef149ccf928aecaa8e", "score": "0.6880824", "text": "function filter(arr) {\n let output = []\n for (let i = 0; i < arr.length; i++) {\n if(arr[i] >= 5) {\n output.push(arr[i])\n }\n }\n return output \n}", "title": "" }, { "docid": "bd583803a5f2a333a204abb7198953ae", "score": "0.6809003", "text": "function isMoreThan10(element, index, array) {\n return array.length > 1;\n}", "title": "" }, { "docid": "341d88b3971ab88435fbca313fb65990", "score": "0.67504966", "text": "function longerThan(arr,num){\n\n \treturn arr.filter(a=>a.length>num);\n\n \t\n }", "title": "" }, { "docid": "17c4ea285d4a3d1b73fb903dbb2cdb39", "score": "0.6627059", "text": "function eightOrMore(){\n function matFilt(value){\n if (value.materials.length > 8){\n // console.log(value.title);\n value.materials.forEach(function(i){\n console.log(i);\n });\n }\n }\n\n items.filter(matFilt);\n}", "title": "" }, { "docid": "2af8e82a91f5da322899c8bc4967654c", "score": "0.6615283", "text": "function anyGreaterThan10(array) {\n return array.some(element => element > 10);\n}", "title": "" }, { "docid": "d1ffecb84b1da549b4d1095fc4ea398f", "score": "0.65880173", "text": "function filterByLength(array) {\n const res = [];\n return (() => {\n for (const item of array) {\n if (item.length > 3) {\n res.push(item);\n }\n }\n return res;\n })();\n}", "title": "" }, { "docid": "09f7cc390cd56aff8b8d2df203cda690", "score": "0.65211225", "text": "function getFirstTenCountries()\n{\n return countries.filter((it,ind, arr) => (ind < 10))\n}", "title": "" }, { "docid": "7b42821691cb0a550adb2becac13d62b", "score": "0.6511262", "text": "function filterLongWords (array, num) {\n\tfunction f (element){\n\t\treturn element.length>num;\n\t};\n\tvar longWords = array.filter(f);\n\treturn longWords;\n}", "title": "" }, { "docid": "c650a662b14d9396ac9a9c0add4933db", "score": "0.6462064", "text": "function fiveAndGreaterOnly(arr) {\n // your code here\n return arr.filter(number => {\n return number >= 5;\n });\n}", "title": "" }, { "docid": "45dc77f9a2d345f282491a68dc7f11a1", "score": "0.644175", "text": "function greaterThanTen(arr){\n let newArr = [];\n for (let i = 0; i < arr.length; i++)\n {\n if (arr[i] > 10){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "5dd59f92784e0879108cc4d80eb20481", "score": "0.64365846", "text": "function filtering(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < 5) {\n arr.splice(i, 1);\n // need this to remove more than 1 index\n i--;\n }\n }\n return arr\n }", "title": "" }, { "docid": "5fd34da6913fac93ee882ad2b8560881", "score": "0.64304096", "text": "function showMillionaires() {\n data = data.filter(item => {\n return item.money > 1000000\n })\n\n updateDOM()\n}", "title": "" }, { "docid": "08612e98ceecad3da78d55114d93a1c8", "score": "0.6417263", "text": "function getBigHits(arr){\n\treturn arr.filter(function(val){\n\t\treturn val.weeksAtNumberOne >= 10;\n\t});\n}", "title": "" }, { "docid": "6c17c5cf94a822d3e27db7e63b1d4035", "score": "0.6407585", "text": "function fiveCharactersOrFewerOnly(arr) {\n return arr.filter(item => item.length <= 5)\n }", "title": "" }, { "docid": "6154a4a0d53e8d5b5b527a70d9f60b0f", "score": "0.64037055", "text": "function filterLessThan5(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < 5) {\n arr.splice(i, 1);\n i--;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "d6c8d312bb0bf9cea9139f689b357a9f", "score": "0.6357914", "text": "function filter(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] < 5) arr.splice(i, 1);\n }\n return arr;\n}", "title": "" }, { "docid": "26a2ec06a64865f2fd53f93ea760b4c1", "score": "0.6354967", "text": "function showMillioners() {\r\n data = data.filter(user => {\r\n return user.money > 1000000;\r\n });\r\n}", "title": "" }, { "docid": "de1d10f94ff40a6213194faa56014b73", "score": "0.63445294", "text": "function greaterThanNumberUsingFilter(arr, number) {\r\n res = arr.filter( e => e > number);\r\n\r\n if(res.length === 0) \r\n return \"Such values do not exist.\";\r\n\r\n return res;\r\n \r\n}", "title": "" }, { "docid": "d9f11428d939233d3b8f7bf6808c6aee", "score": "0.63189167", "text": "function overFiftyFilter (data) {\n return data.filter(item => { return item.age > 50; })\n}", "title": "" }, { "docid": "ddf7200c80e6f6e57a106b695b14f0c8", "score": "0.6316756", "text": "function fiveCharactersOrFewerOnly(arr) {\n const result = arr.filter(function(num){\n if (num.length <= 5){\n return true;\n }\n });\n return result;\n}", "title": "" }, { "docid": "4efbac6a91aad9e4cc2fde792b7f1fda", "score": "0.6302632", "text": "function filterArray(number, array){\n let filteredArray = []\n\n for(let i = 0; i < array.length; i++){\n if(array[i] >= number){\n filteredArray.push(array[i])\n }\n }\n return filteredArray\n}", "title": "" }, { "docid": "e84e23898412594ac53163b1b2c12118", "score": "0.63000494", "text": "function shorterThan(arr , num){\n\treturn arr.filter(a => a.length < num);\n}", "title": "" }, { "docid": "e7d0747dffea6c789cab60abed32959f", "score": "0.6297628", "text": "function fiveCharactersOrFewerOnly(arr) {\n const result = arr.filter(function(num){\n if(num.length <= 5){\n return true;\n };\n });\n return result;\n}", "title": "" }, { "docid": "2f23b325b67305805b07a633862c8634", "score": "0.62890327", "text": "function filterLongWords (arr,num) {\n const newArr = [];\n for (let i = 0; i < arr.length; i++) {\n if(arr[i].length > num){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "title": "" }, { "docid": "87c4a3681d038bc7abdab3e35ecb8bc3", "score": "0.6286527", "text": "function myArray(array){\n let result = [];\n\n for (let i = 0; i < array.length; i++){\n let bike = array[i];\n\n if (bike.length> 7) {\n result.push(bike);\n\n }\n\n }\n return result;\n}", "title": "" }, { "docid": "f0ee204d7feb53df904b0daf4d41a9ea", "score": "0.6263258", "text": "function moreThanAverage(arr) {\n return filter(arr, function(element){\n return element>arr.length;\n })\n}", "title": "" }, { "docid": "f671426df0f987be85537583c94a6b33", "score": "0.62548167", "text": "function slicedArray3(array, num1, num2) {\r\n\r\n if (num1 >= num2 || b > array.length) {\r\n return console.log(\"inserisci due numeri validi per estrarre i valori dell'array\");\r\n } else {\r\n return array.filter((element, index) => {\r\n return (index >= num1 && index <= num2)\r\n });\r\n }\r\n}", "title": "" }, { "docid": "e0869def16c1d20022ac79b7ac9f32e2", "score": "0.62490875", "text": "function highPass(arr, cutoff) {\n var filteredArr = [];\n var imports = highPass[arr];\n var howLongIsIt = imports.length;\n console.log(howLongIsIt);\n for (let i = 0; i < howLongIsIt; i++) {\n var temp = highPass[0][i];\n if (temp > cutoff) { \n filteredArr.push(temp);\n console.log(filteredArr);\n }\n }\n}", "title": "" }, { "docid": "8be29ab257e322402e83f43c6e0ba939", "score": "0.62441576", "text": "function fiveCharactersOrFewerOnly(arr) {\n // your code here\n return arr.filter(word => {\n return word.length <= 5;\n });\n}", "title": "" }, { "docid": "14ad8ad212beeb579275430f10273040", "score": "0.6230277", "text": "function filterElements(prices, n) {\n const result = [];\n for (let i = 0; i < prices.length; i++) {\n if (prices[i] > n) {\n result.push(prices[i]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "34a0bb7f530b9ba0c0e3ab5c59bf9d4f", "score": "0.62223524", "text": "function largerThanSix(arr) {\n return filter(arr, function(elem) {\n return elem > 6;\n });\n}", "title": "" }, { "docid": "c5b0a0e4888a654edbfb0999dbaa1a69", "score": "0.61946094", "text": "function fiveCharactersOrFewerOnly(arr){\n return arr.filter(name => name.length <= 5) \n}", "title": "" }, { "docid": "8d7046223717cd22a622463e85c6ce3b", "score": "0.61891514", "text": "function highPass(arr, cutoff) {\n var filteredArr = [];\n for(var i = 0; i<= arr.length; i++) {\n if(arr[i] > cutoff)\n filteredArr.push(arr[i]); \n }\n // your code here\n return filteredArr;\n}", "title": "" }, { "docid": "15cb98c8d91a122dd39fe501c07af217", "score": "0.61817956", "text": "function filterMethod() {\n\tvar testArray=[1,4,77,12,66,101,10];\n\tfunction smallElement(smallValue) {\n\t\treturn(smallValue)<10;\n\t}\n\tvar filteredElement=testArray.filter(smallElement);\n\tconsole.log(filteredElement);\n}", "title": "" }, { "docid": "547711dc875a1fc70ee9671ab8904b23", "score": "0.61702734", "text": "function shortStrings(array) {\n let newarray = array.filter(function(item) {\n return item.length < 5;\n });\n return newarray;\n}", "title": "" }, { "docid": "8c4b80908946f57a738690cf43fb4a17", "score": "0.61389995", "text": "function filterByLength(arr, n) {\n const result = arr.filter(a => a.length == n);\n return result;\n }", "title": "" }, { "docid": "6ead9fc9c75e1a4b174fb9441b353b4d", "score": "0.6126554", "text": "function getBigHits(arr){\n let hits = [];\n return arr.filter(function(val){\n if(val.weeksAtNumberOne >= 10){\n hits.push(val.name);\n return hits;\n }\n })\n}", "title": "" }, { "docid": "1e8a4ad9f6421023a73dc0e576012120", "score": "0.61083543", "text": "function isBiggerThan10(element, index, array) {\n return element > 10;\n}", "title": "" }, { "docid": "6f3f1779fcb9eede446f132465f01470", "score": "0.6088809", "text": "function limitBooks(allBooks,index){\n \n let booksListLimited = [];\n let indxStart;\n let indxEnd;\n //Books to display algorithm\n if(index > 1){\n indxEnd = ( (10*index) + (index-1 ) );\n indxStart = indxEnd-10;\n }\n else{\n indxStart = 0;\n indxEnd = 10;\n }\n booksListLimited = allBooks.slice(indxStart,indxEnd);\n \n return booksListLimited;\n}", "title": "" }, { "docid": "a9795bb8f97cfe3622d887b1a279b6c6", "score": "0.6061031", "text": "function getFirstTenCountries() {\n return countriesAll.filter(country => countriesAll.indexOf(country) < 10);\n}", "title": "" }, { "docid": "d4c678b9cb0eedae26fceaf989165693", "score": "0.6049544", "text": "filter(minNum, maxNum) {\n //Filter with spacific rang of Backers\n const filteredList = this.state.initialData.filter(\n item => (Number(minNum) < item['num.backers'] && Number(maxNum) > item['num.backers'])\n );\n //Update the projects state with new array so that comonent will rander with filters list\n this.updateDataSource(filteredList);\n }", "title": "" }, { "docid": "46b72df11ba9af2713ceda017c5ccc55", "score": "0.6041146", "text": "function filterLongWords(array, num) {\n let message = \"\";\n for (i = 0; i < array.length; i++) {\n if (array[i].length >= num) {\n message += array[i] + \" \";\n }\n }\n return message;\n}", "title": "" }, { "docid": "9af111d09e6cdfd2f8d8adfc7210121a", "score": "0.6038582", "text": "function filterPassingGrades(grades){\n return grades.filter(function(el){\n return el >= 70;\n });\n}", "title": "" }, { "docid": "221e7fda57dbb2f271cc8269b894bd68", "score": "0.6017343", "text": "function isBiggerThan10(element, index, array) {\n return element > 10;\n}", "title": "" }, { "docid": "fed92a39c7155645a7a10919826743b7", "score": "0.60126686", "text": "function filterData11(Country ) {\n return parseInt(Country .Company_Count) > 4000;\n}", "title": "" }, { "docid": "b910353536185c144fc1234a9cf475de", "score": "0.60071164", "text": "function displayMillionaires() {\n data = data.filter(user => (user.money > 1000000))\n updateDOM();\n}", "title": "" }, { "docid": "77ae52223692a98c2e058991bbcb2b68", "score": "0.5991468", "text": "function millionOrMore(data) {\n return data.romanSearchResults > 1000000;\n}", "title": "" }, { "docid": "f7b088210cef8b7d7138f035a6f3f22d", "score": "0.5980483", "text": "function filterLongWords () {\n const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];\n const result = words.filter(word => word.length > 6);\n console.log(result);\n}", "title": "" }, { "docid": "cd0931dcaa0574ba52a707fae665dfb7", "score": "0.59721893", "text": "function filterLongWords(arr, int) {\n return arr.filter(function(item) {\n return item.length > int;\n });\n}", "title": "" }, { "docid": "cc96060e4634cb79186cfdc29096669e", "score": "0.5961605", "text": "function hide_unwanted_cards(cards_to_hide, total_num)\r\n{\r\n var k;\r\n //show number of results after filter\r\n var hide_num = cards_to_hide.length;\r\n if (total_num - hide_num != 1)\r\n {\r\n utils.changeInnerText(\"resultsNum\", total_num - hide_num + \" results were found\");\r\n }\r\n else\r\n {\r\n utils.changeInnerText(\"resultsNum\", total_num - hide_num + \" result was found\");\r\n }\r\n //hide all cards that were filtered out\r\n for(k = 0; k < cards_to_hide.length; k ++) //hide all uncompatible cards\r\n {\r\n $(cards_to_hide[k]).hide();\r\n }\r\n}", "title": "" }, { "docid": "f25a1d39620800bd65c4871a006464e9", "score": "0.5950156", "text": "function filterResults(){\n titlesToRender = allTitles.filter(filter)\n renderFirst12Titles();\n}", "title": "" }, { "docid": "f898d5da1a514488ab18a1c870d6d5d3", "score": "0.5948261", "text": "function getElementsGreaterThan10AtProperty(obj, key) {\n // your code here\n return obj.key.filter(function(element) {\n return element > 10;\n });\n}", "title": "" }, { "docid": "fb2b302cd8d46cd5563cd7e1ca20b755", "score": "0.59463966", "text": "function fiveCharactersOrFewerOnly(arr) {\n return arr.filter(str => str.length <= 5);\n}", "title": "" }, { "docid": "621f08e23ec44f6e0f475bce3bcab185", "score": "0.5932881", "text": "function showOnlyMillionaires() {\n data = data.filter((user) => user.money >= 1000000);\n displayUser();\n}", "title": "" }, { "docid": "ec3d46add359bd8cda8e05c2e921b327", "score": "0.5929522", "text": "function getBigHits(songs) {\n return songs.filter(song => song.weeksAtNumberOne >= 10);\n}", "title": "" }, { "docid": "ec0c47390ff1410b498ae934d44f530d", "score": "0.5923959", "text": "function showMillionaries() {\n data = data.filter(user => user.money > 1000000);\n\n updateDOM();\n}", "title": "" }, { "docid": "3e1877f54bbf4545fcb2972276215950", "score": "0.5897905", "text": "function filter513DeputiesMorePresent(){ \n\t\t\tvar deputies = $.map(deputiesInTheDateRange, function(deputy){ \n\t\t\t\t\t\t\t\treturn deputy;\n\t\t\t\t\t\t\t})\n\t\t\tdeputies = deputies.sort(function(a,b){ return b.numVotes - a.numVotes})\n\n\t\t\t// get the first 513nd deputies\n\t\t\tvar selectedDeputies = deputies.splice(0, ((deputies.lenght < 513)? deputies.lenght : 513) )\n\n\t\t\t// set selected\n\t\t\tvar svdKey =0;\n\t\t\tselectedDeputies.forEach( function(deputy,i){\n\t\t\t\tdeputy.svdKey = svdKey++;\n\t\t\t})\n\n\t\t\t// reset non selected\n\t\t\tdeputies.forEach( function(deputy){\n\t\t\t\tdeputy.scatterplot = null;\n\t\t\t\tdeputy.svdKey= null;\n\t\t\t})\n\n\t\t\treturn selectedDeputies;\n\t\t}", "title": "" }, { "docid": "e5fbe243f225a3da0d1f47b23c401dba", "score": "0.5885029", "text": "function filterLongWords(array,iVal){\n\tlet longArrays=[];\n\tfor(let i=0;i<array.length;i++){\n\t\tif(array[i].length>iVal){\n\t\t\tlongArrays.push(array[i]);\n\t\t}\n\t\t\n\t}\n\treturn longArrays;\n}", "title": "" }, { "docid": "9588baa11babdd7008e6e79d70ebbc02", "score": "0.58838314", "text": "function filterLongWords(arr, num){\n //declare a array to hold the words longer then the number\n let longWords = [];\n for(let i = 0; i <arr.length; i++){\n if(arr[i].length > num){longWords.push(arr[i]);}\n }\n if(longWords.length < 1){return null;}\n return longWords;\n }", "title": "" }, { "docid": "b628db93e1b8e1d9f0b8d63d9ecd0506", "score": "0.5872437", "text": "function badMovies2000(data) {\n const badMovies2000 = data.filter((movie) => {\n return movie.rating < 4 && movie.year >= 2000;\n });\n console.log(badMovies2000);\n}", "title": "" }, { "docid": "8fb525c55accc518080792aea8101a20", "score": "0.5862434", "text": "function filterNumbers(arr, maxNumber) {\n let array = [];\n arr.filter (number => {\n if (number < maxNumber){\n array.push(number);\n };\n });\n return array;\n}", "title": "" }, { "docid": "3af7dcad20886f4a4ee4dcfafcab8e46", "score": "0.5856413", "text": "function predefined(array)\r\n{\r\nvar result;\r\nfor(var index=0;index<array.length;index++)\r\n{\r\n if(array[index]>10)\r\n {\r\n result=array[index];\r\n return result;\r\n }\r\n}\r\nreturn result;\r\n}", "title": "" }, { "docid": "5bca13fa2747d0868e640b1fe8d4a5f1", "score": "0.5830243", "text": "function mapFilterAndReduce(arr){\n return arr.map(val => val.firstName).filter(val => val.length < 5).reduce((acc,next) => \n\t{acc[next] = next.length;\n\treturn acc;}, {})\n}", "title": "" }, { "docid": "9b6d3fbec84995ee1d8f6170fc653422", "score": "0.5801325", "text": "filterTopTenCountries(data) { \n let header = data['columns'].map(header => header);\n let lastEntryInHeaders = (header[header.length - 1])\n \n //sort data in descending order by total numbers\n let countriesSortedByTotalNumbers = data.sort(compareTotal);\n function compareTotal(a, b) {\n let country1 = a[lastEntryInHeaders]; \n let country2 = b[lastEntryInHeaders]; \n\n let comparison = 0;\n if (country1 > country2) {\n comparison = -1;\n } else if (country1 < country2) {\n comparison = 1;\n }\n return comparison;\n }\n return countriesSortedByTotalNumbers.slice(0, 10)\n }", "title": "" }, { "docid": "19a9e94dc498a0debeac86a9523eb651", "score": "0.5796468", "text": "static countAndPrintArrayValuesGreaterThanY(min = 1, max = 20, numValY = max / 2){\n // console.log(numValY);\n let inputArray = Basic13.makeArray(min, max, 1);\n // let greaterThanArray = inputArray.filter((element) => {\n // return element > numValY;\n // })\n let indexOfGreaterValue = undefined;\n inputArray.filter((element, index) => {\n if(element < numValY){\n indexOfGreaterValue = index\n }\n })\n indexOfGreaterValue += 1;\n if(inputArray[indexOfGreaterValue] === numValY){\n indexOfGreaterValue += 1;\n }\n // let greaterThanArray = [...inputArray].slice(indexOfGreaterValue);\n let greaterThanArray = [...inputArray].splice(indexOfGreaterValue)\n // console.log(indexOfGreaterValue);\n // console.log(inputArray[indexOfGreaterValue]);\n console.log(greaterThanArray);\n return greaterThanArray;\n }", "title": "" }, { "docid": "6e45ee4e5fa7cfde9f9b7b85c682ea07", "score": "0.5795257", "text": "function filterdLength() {\n var taskLeft = todoData.filter(value => value.todoStatus === false).length;\n totalItems.innerText = `${taskLeft} items left`;\n}", "title": "" }, { "docid": "77f29b64d41b5e1bdb9acf0eb9d41a0d", "score": "0.5785989", "text": "function arrayLimit(val) {\n return val.length <= 100;\n}", "title": "" }, { "docid": "667eae67cbd61b7e328692150db6f790", "score": "0.5785578", "text": "function isBigEnough(element, index, array) { \n return element >= 10; \n}", "title": "" }, { "docid": "8ba01cce10bee8521a9f1c6edf489f80", "score": "0.57843065", "text": "function showFiltered() {\n filteredResults.forEach(function(result, index) {\n if(index < resultsPerSearch) {\n result.classList.remove(hiddenResultsClass);\n result.classList.add(visibleResultsClass);\n }\n });\n }", "title": "" }, { "docid": "38fdcf825aa655cb848092208013d360", "score": "0.5781878", "text": "function largerThanSix(numbers) {\n return filter(numbers, function(num) {\n return num > 6;\n });\n}", "title": "" }, { "docid": "74975e63ca23a6a5ba045aeab9de5c39", "score": "0.57783544", "text": "function filterLongWords(words, i){\n return arr.filter( function(a) { return a.length > i} );\n\n\n //...\n}", "title": "" }, { "docid": "740e19cbd6beba7bc5690e16f672cca9", "score": "0.57773215", "text": "function fiveCharactersOrFewerOnly(arr){\r\n const result = arr.filter(function(str){\r\n if(str.length <= 5){\r\n return str;\r\n }\r\n });\r\n return result;\r\n}", "title": "" }, { "docid": "0daaa4c6ba181c082c261a08309c27e2", "score": "0.5772192", "text": "function countMoreCandies(students){\n var moreList = students.filter(function(value,index){\n return value.candies > 4;\n })\n return moreList;\n}", "title": "" }, { "docid": "e694a8051cb1541a5a27f9be22c3d79b", "score": "0.5760949", "text": "function divisibleBy10(array) {\n return array.every(element => element % 5 === 0)\n}", "title": "" }, { "docid": "610b9f0af5d85d394ca93358f738f000", "score": "0.57553464", "text": "function showAdults(arr) {\n return arr.filter(person => person.age >= 18);\n}", "title": "" }, { "docid": "3219950c727bd0790b07819a99de66e7", "score": "0.575371", "text": "function arrayLessThan100(arr) {\n\treturn arr.reduce((x, i) => x + i) < 100;\n}", "title": "" }, { "docid": "40b0018a14123a9d86558042a769e30e", "score": "0.57479835", "text": "function longerThanFive(arr) {\n return arr.length <= 5;\n}", "title": "" }, { "docid": "a736ddcb16dba34ccf6a351b844fecbf", "score": "0.57449204", "text": "function fiverAndGreaterOnly(arr){\n // let result = arr.filter(function(num){\n // if (num > 5){\n // return true\n // }\n // })\n //let result = arr.filter(num => num > 5)\n//return result\nreturn arr.filter(num => num > 5)\n}", "title": "" }, { "docid": "c1ad0560b45e28c7ff9a5289f2ce5702", "score": "0.57413775", "text": "function showCrorepati() {\r\n data = data.filter((user) => user.money > 10000000);\r\n\r\n updateDOM();\r\n}", "title": "" }, { "docid": "f23c55befe59e1e710140c3012b7626f", "score": "0.5733993", "text": "function removeNumbers(array){\n let newArray = []\n for (let i = 0; i < array.length; i++){\n if (array[i] > 5){\n newArray.push(array[i])\n }\n }\n return newArray\n}", "title": "" }, { "docid": "afa9b49333184a4ece530540cd2cf8a6", "score": "0.5730567", "text": "function sortFilterArrays()\n\t {\n\t\t \tyearsArray.sort(function(a, b) {return b - a});\n\t \t\tauthorsArray.sort(function(a, b) {return b[1] - a[1]});\n\n\t\t\tif (NUMBER_OF_TIMES_IN_FILTER <= yearsArray.length)\n\t\t\t\tOLDER_TEXT = \"< \" + yearsArray[NUMBER_OF_TIMES_IN_FILTER - 1]\n\t }", "title": "" }, { "docid": "02a43f551816109b69872178f1788d12", "score": "0.57249504", "text": "function filterLongWords(strArray=[], i){\nlet filter = strArray.filter(word=>word.length>i);\nreturn filter;\n}", "title": "" }, { "docid": "715beb72a71409f87d17b25185d746ca", "score": "0.57231075", "text": "function smallEnough(a, limit){\n // const isBelowThreshold = (currentValue) => currentValue < limit;\n return a.every(currentValue => currentValue <= limit)\n\n}", "title": "" }, { "docid": "001b27efe60c6f665cc3c7c5bc28811c", "score": "0.5722283", "text": "function getLastTenCountries() {\n return countriesAll.filter(\n country => countriesAll.indexOf(country) > countriesAll.length - 11\n );\n}", "title": "" }, { "docid": "d1a53b7ca164771baa0047962e676937", "score": "0.57107854", "text": "function containingFive(arr){\n let a = arr.filter(e => Number.isInteger(e) && e.toString().includes('5'));\n\n return a;\n}", "title": "" }, { "docid": "c1a2ca630e37bd2a5be5e8e6b8cdbc69", "score": "0.5709429", "text": "function filtermeth(value){\n\tif(value.length > 5){ return value}\n}", "title": "" }, { "docid": "c6c4a455983faa324455727a549922e3", "score": "0.5704035", "text": "function filterDataByMinimalAge(age) {\n emptyUITable();\n let minFilterResult = originalData.filter(animal => animal.age >= age);\n displayArray(minFilterResult);\n }", "title": "" }, { "docid": "4856a921167295a0fa210e348f8e008c", "score": "0.57000834", "text": "function filterArray(arr, filter) {\n function checkNumber(num) {\n return num < filter;\n }\n return arr.filter(checkNumber);\n}", "title": "" }, { "docid": "9ccf54f57a4eef4ecf3243605317b46c", "score": "0.56998074", "text": "function ofAge(arr) {\n const result = arr.filter(function(num){\n if(num.age >= 18){\n return true;\n };\n });\n return result;\n}", "title": "" }, { "docid": "ce712a07fd749809599c156029669743", "score": "0.5680502", "text": "function anyGreaterThan10 (input) {\n return input.some(x => x > 10);\n}", "title": "" }, { "docid": "4dfd749204b04af4d6453792eab8961a", "score": "0.5674252", "text": "function filterOutliers(array) {\n const arrMean = mean(array);\n return array.filter((value) => value / arrMean < 50);\n}", "title": "" }, { "docid": "fd058e5a3b5ef56905fe7e5c764030c1", "score": "0.56689405", "text": "function getBigParties() {\n partyResults = [];\n\n filterAll.classList.remove(\"remember-btn\");\n filterSecular.classList.remove(\"remember-btn\");\n filterBig.classList.add(\"remember-btn\");\n\n partyResults = parties.filter(party => {\n return party.size >= partySize;\n });\n}", "title": "" }, { "docid": "4bae35d0b8db0dae3756566b3e6ab9fe", "score": "0.5667396", "text": "function filterArr(arr){\nlet test = arr.forEach(x => {\n \n if(x <= 5 ){\n console.log(x)\n console.log(\"trying to delete\")\n }\n else{\n console.log(\"yes\")\n }\n});\n\n}", "title": "" }, { "docid": "11160dd8746197befa4516e7e582eaf8", "score": "0.5667025", "text": "function showFirstTenStudents () {\r\n\tfor(let i = 0; i < $studentList.length; i++){\r\n\t\tif(i < studentsPerPage) {\r\n\t\t\t$studentList[i].style.display = '';\r\n\t\t} else {\r\n\t\t\t$studentList[i].style.display = 'none';\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "377a062907266e4d1f00993e9330898a", "score": "0.56482273", "text": "function cleanUpArray() {\n if (previouslyDisplayed.length > 15) {\n for (var i= 0; i < 12; i++) {\n previouslyDisplayed.shift();\n }\n }\n}", "title": "" }, { "docid": "091d2367b1486a63d12f5c6a1aed3be4", "score": "0.56482273", "text": "function fiveCharactersOrFewerOnly(arr){\n const result = arr.filter(function(character){\n if (character.length <= 5)\n return character;\n });\n return result;\n}", "title": "" }, { "docid": "9dd35af9bfa738752716a933c7ba6e44", "score": "0.56472546", "text": "function filterMethodJ() {\n\tvar countOfNan=0;\n\tfunction findElements(num) {\n\t\tif(typeof(num.id)==='number' && !isNaN(num.id)) {\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\tcountOfNan++;\n\t\t\treturn false;\n\t\t}\n\t}\n\t\tvar filterElement= feedArray.filter(findElements);\n\t\tconsole.log(filterElement);\n\t\tconsole.log(\"The number of NaN\", countOfNan);\n}", "title": "" }, { "docid": "c067e292b4f3cc513eee86337c8f7433", "score": "0.56401837", "text": "function filtersThreeOrMoreKeys (arr) {\n return arr.filter(student => {\n return Object.keys(student).length >= 3;\n })\n}", "title": "" }, { "docid": "c0ec98b374300a48c9df0a531de8fcb1", "score": "0.5635685", "text": "function filterLongWords(words, int){\n \"use strict\";\n var int = 6;\n var length = wordArray.length;\n var longerWords = [];\n for (var i = 0; i < length; i++) {\n if (wordArray[i].length > int) {\n longerWords[longerWords.length] = wordArray[i];\n }\n }\n return longerWords;\n\n}", "title": "" } ]
34113844754bad5b084157af37617ede
Provides: caml_raise_not_a_dir Requires: MlBytes, caml_raise_sys_error
[ { "docid": "8f69be0a1e5576fc3802e0a1e6b3f01c", "score": "0.78809327", "text": "function caml_raise_not_a_dir(name){\n name = (name instanceof MlBytes)?name.toString():name;\n caml_raise_sys_error (name + \": Not a directory\");\n}", "title": "" } ]
[ { "docid": "5313531a0ba0e6c24f648db91b2bb5c9", "score": "0.68168986", "text": "function caml_raise_no_such_file(name){\n name = (name instanceof MlBytes)?name.toString():name;\n caml_raise_sys_error (name + \": No such file or directory\");\n}", "title": "" }, { "docid": "91d2bbb291ebd762e163114c3aa42a89", "score": "0.5793681", "text": "function notDirError (callback) {\n const error = new Error('ENOTDIR, not a directory')\n error.code = 'ENOTDIR'\n error.errno = -20\n if (typeof callback !== 'function') {\n throw error\n }\n process.nextTick(() => callback(error))\n}", "title": "" }, { "docid": "45c07a4c3e1bd2ee7112b5fb7f875160", "score": "0.57528466", "text": "async function filePathErrorTest() {\n let mfs = new MFS();\n assert.throws(() => { mfs.chdir(12345)}, Error, \"Error thrown\")\n\n}", "title": "" }, { "docid": "b4d1dd265dad7922f570e59e85a17866", "score": "0.5654377", "text": "function validateDirectory(currentPath, raise) {\n const stat = _.attempt(fs.statSync, currentPath)\n if ( _.isError(stat) || ! stat.isDirectory() ) {\n raise(`Could not stat directory ${currentPath} it may not exist:\\n${stat}`)\n }\n\n const error = _.attempt(fs.accessSync, currentPath, fs.R_OK | fs.W_OK)\n if ( _.isError(error) ) {\n raise(`Could not get write access to directory ${currentPath}:\\n${error}`)\n }\n}", "title": "" }, { "docid": "79510f8201639e1ae834fd1a1479bb2a", "score": "0.56506056", "text": "static isDir(context, fs, path){\n\t\treturn (async_ctx_0) => {\n\t\t\tvar async_jump_0 = async_ctx_0.current();\n\t\t\tif (async_jump_0 == \"0\"){\n\t\t\t}\n\t\t\telse if (async_jump_0 == \"-1\"){\n\t\t\t\treturn async_ctx_0.error( async_ctx_0.getError() )\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn async_ctx_0.next();\n\t\t\t}\n\t\t\treturn async_ctx_0.end();\n\t\t}\n\t}", "title": "" }, { "docid": "e334ff605271d30702000a69072012f4", "score": "0.56267196", "text": "function onOpenDirError() {\n onCheck(false);\n }", "title": "" }, { "docid": "9bd1c1d40bdc243b7b3c9dcbf2aaf0f5", "score": "0.551022", "text": "_checkOrCreateDirectory() {\n\n Fs.mkdir(this.directory, MASK, (error) => {\n\n if (error && error.code !== IGNORED_MKDIR_ERROR) {\n throw error;\n }\n });\n }", "title": "" }, { "docid": "d8fb4e3eb9074e7142417e8fb6ce5d3b", "score": "0.5458527", "text": "_checkOrCreateDirectory() {\n fs.mkdir(this.directory, MASK, (error) => {\n if (error && error.code !== IGNORED_MKDIR_ERROR) {\n throw error;\n }\n });\n }", "title": "" }, { "docid": "1eaf6da1b80d23eef6703e9f2d77a261", "score": "0.53701264", "text": "function caml_sys_is_directory(name){\n var root = resolve_fs_device(name);\n var a = root.device.is_dir(root.rest);\n return a?1:0;\n}", "title": "" }, { "docid": "339b707352581ed19473d337a48e555c", "score": "0.51322126", "text": "function caml_sys_chdir(dir) {\n var root = resolve_fs_device(dir);\n if(root.device.exists(root.rest)) {\n if(root.rest) caml_current_dir = root.path + root.rest + \"/\";\n else caml_current_dir = root.path;\n return 0;\n }\n else {\n caml_raise_no_such_file(dir);\n }\n}", "title": "" }, { "docid": "ed341b31f187d2e4d2cd4f4330fcec4d", "score": "0.51167196", "text": "function constructorShouldThrowOnNonExistingBaseDirectory() {\n const directory = \"constructor/invalid\"\n expect(() => {\n new FileSystemStorage(directory)\n }).toThrow(\n new TypeError(`Invalid base: '${directory}'`))\n}", "title": "" }, { "docid": "6358c65fd35a2c7400b81a50f379de75", "score": "0.5092965", "text": "async makeDirectory(directory) { throw new NotImplementedError('makeDirectory'); }", "title": "" }, { "docid": "6f67b5ee47cdf1ab92e47a9f02a56a3e", "score": "0.5081382", "text": "function caml_sys_read_directory(name){\n var root = resolve_fs_device(name);\n var a = root.device.readdir(root.rest);\n var l = new Array(a.length + 1);\n l[0] = 0;\n for(var i=0;i<a.length;i++)\n l[i+1] = caml_new_string(a[i]);\n return l;\n}", "title": "" }, { "docid": "2b470cf08dcd7829f41183de0725a082", "score": "0.50663584", "text": "function checkDirSize(dir) {\r\n if (!dir) dir = path.join(resLocation, \"CNC files\");\r\n var dirs = getDirectories(dir);\r\n if (dirs.length > 0) {\r\n selectSub(dir);\r\n } else {\r\n selectCNCFile(dir);\r\n }\r\n}", "title": "" }, { "docid": "78ad5e9b9d2b9e866b6641da427cde50", "score": "0.49974394", "text": "function constructorShouldThrowOnFile() {\n const directory = \"constructor/genmaicha/oolong\"\n expect(() => {\n new FileSystemStorage(directory)\n }).toThrow(\n new TypeError(`Invalid base: '${directory}'`))\n}", "title": "" }, { "docid": "cf38df59b91d06721668356a3b22d5fb", "score": "0.49896216", "text": "function constructorShouldThrowOnInvalidBaseDirectory() {\n expect(() => {\n new FileSystemStorage(null)\n }).toThrow(\n new TypeError(\"Invalid base: null\"))\n}", "title": "" }, { "docid": "0b086445735892d99fb168df7cce2eb7", "score": "0.49863255", "text": "function checkDir(path) {\n var stat = window.cep.fs.stat(path);\n var isDir = stat.err == window.cep.fs.NO_ERROR && stat.data.isDirectory();\n\tif (!isDir) { window.cep.fs.makedir(path) }\n}", "title": "" }, { "docid": "164d0ec8fdcd3a3d289cf841ccecb6f3", "score": "0.49720725", "text": "static verifyProjectDir(dir, callback) {\n // Append last path.sep\n dir += dir[dir.length - 1] !== path.sep ? path.sep : '';\n\n fs.stat(dir, (err, stat) => {\n if (err) {\n callback(err);\n return;\n }\n\n if (stat.isDirectory()) {\n fs.stat(dir + 'config.xml', (fileErr, fileStat) => {\n if (fileErr) {\n callback('config.xml file is missing');\n } else {\n callback(null);\n }\n });\n } else {\n callback('Given path must be a directory');\n }\n });\n }", "title": "" }, { "docid": "6722d9542a9ea18ce058f1b05be9b0a8", "score": "0.4922271", "text": "targetDirectory() {\n\t\tthrow Error('not implemented');\n\t}", "title": "" }, { "docid": "d610c1c3fb5f8643b8ac1a01660f155a", "score": "0.4909293", "text": "dataDirInitError(){\n\t\tconsole.error(`Please start app with --init=/path/to/data/dir or --init for default (~/.kdx/data)`.red);\n\t\tnw.Window.open('modules/initialize/initialize.html', {\n\t\t\t//new_instance: true,\n\t\t\tid: 'initialize',\n\t\t\ttitle: 'KaspaDX',\n\t\t\twidth: 1027,\n\t\t\theight: 768,\n\t\t\tresizable: true,\n\t\t\tframe: true,\n\t\t\ttransparent: false,\n\t\t\tshow: true,\n\t\t\ticon: 'resources/images/kdx-icon.png'\n\t\t\t// http://docs.nwjs.io/en/latest/References/Manifest%20Format/#window-subfields\n\t\t}, (win) => {\n\n\t\t});\n\t}", "title": "" }, { "docid": "b3416a068115a338b8249830f2e44cad", "score": "0.4896119", "text": "_ensureDirExists() {\n try {\n if (!fs.existsSync(this._dirname)) {\n fs.mkdirSync(this._dirname)\n }\n } catch (error) {\n if (error.code === 'EACCES' || error.code === 'EPERM') {\n this._callListeners('error', error)\n }\n }\n }", "title": "" }, { "docid": "23d856819b736a52195d56a080ad7b38", "score": "0.48748788", "text": "function caml_raise_not_found () {\n caml_raise_constant(caml_global_data.Not_found); }", "title": "" }, { "docid": "23d856819b736a52195d56a080ad7b38", "score": "0.48748788", "text": "function caml_raise_not_found () {\n caml_raise_constant(caml_global_data.Not_found); }", "title": "" }, { "docid": "4f51268274cdd9a25abec295d86dec99", "score": "0.48667485", "text": "async readDir(L, T) {\n const {device, path} = this.resolveLuaPath(T);\n T.startStep({name: 'lookup entry'});\n const entry = await device.getEntry(path, true);\n T.endStep();\n if (!entry) return 0;\n\n if (entry.enumerate) {\n const enumer = new EnumerationWriter(2); // TODO\n T.startStep({name: 'perform enumeration'});\n try {\n await entry.enumerate(enumer);\n T.endStep();\n } catch (err) {\n if (err.response.Ok === false) {\n console.warn('ctx.readDir() enumeration failed :(', err);\n lua.lua_pushnil(L);\n T.endStep();\n return 1;\n }\n throw err;\n }\n\n T.startStep({name: 'build lua result'});\n this.pushLiteralEntry(T, enumer.reconstruct());\n T.endStep();\n return 1;\n }\n\n throw new Error(`readDir() target wasn't enumerable`);\n }", "title": "" }, { "docid": "bae76cec281847d2ee92fbc1fee17228", "score": "0.48516998", "text": "function wrongDir(){\r\n\t\tdocument.getElementById(\"navError\").innerHTML = \"Oops! Try that again. N, S, E, or W.\"\r\n\t\t}", "title": "" }, { "docid": "2a38367a6e478707e0279da5834fd64e", "score": "0.48428282", "text": "function ensureDirectory (p) {\r\n p = path.resolve(p);\r\n try {\r\n fs.mkdirSync(p);\r\n } catch (err0) {\r\n switch (err0.code) {\r\n case 'ENOENT' :\r\n ensureDirectory(path.dirname(p));\r\n ensureDirectory(p);\r\n break;\r\n default:\r\n try {\r\n var stat = fs.statSync(p);\r\n if (!stat.isDirectory()) throw err0;\r\n } catch (err1) {\r\n throw err0;\r\n }\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b6bc713f6b5b2aed7e469c427af7d138", "score": "0.48414612", "text": "function checkDir (dir) {\n return new Promise ((res, rej) => {\n fs.stat(dir, (err, stats) => {\n if (err && err.errno == -2 || err && err.errno == -4058) {\n console.log(err);\n fs.mkdirSync(dir);\n res(dir);\n } else if (!err) {\n res(dir);\n }else {\n rej(err);\n }\n })\n })\n}", "title": "" }, { "docid": "d455c4291b625654ef5f8be5a499e2bc", "score": "0.48403278", "text": "function caml_fs_init (){\n var tmp=joo_global_object.caml_fs_tmp\n if(tmp){\n for(var i = 0; i < tmp.length; i++){\n caml_create_file(tmp[i].name,tmp[i].content);\n }\n }\n joo_global_object.caml_create_file = caml_create_file;\n return 0;\n}", "title": "" }, { "docid": "321ccfa826f254271455e38891ab366b", "score": "0.48369724", "text": "_initialize(cb) {\n this._wrapped.exists(this._folder, (exists) => {\n if (exists) {\n cb();\n }\n else if (this._wrapped.isReadOnly()) {\n cb(ApiError.ENOENT(this._folder));\n }\n else {\n this._wrapped.mkdir(this._folder, 0x1ff, cb);\n }\n });\n }", "title": "" }, { "docid": "fa29622cb0648c871b6ddcc5ea278c35", "score": "0.48255646", "text": "ensureDownloadDirectory() {\n // TODO: Check read/write permissions and handle errors gracefully or alert user\n fs.access(this.downloadDirectory, (err) => {\n if (err) {\n // TODO: Handle potential errors\n mkdirp(this.downloadDirectory);\n }\n });\n }", "title": "" }, { "docid": "b7ea029dd3677c8551052e42d9de9604", "score": "0.48233104", "text": "function fsError(){\n return FS_STATUS < 0;\n}", "title": "" }, { "docid": "2afd7bbcebc78c5460db24d436c2a27e", "score": "0.48189437", "text": "function testForLocalDirectories() {\n testPromise(localDirSystemPromise.then(function(volume) {\n return launchWithEntries(volume.entries);\n }));\n}", "title": "" }, { "docid": "45c4a54cc647f5f68dfadd78ed58134c", "score": "0.48159316", "text": "function fileSystemErrorHandler(e){\n var msg = 'An file system error occured: ';\n \n switch (e.code) {\n case FileError.QUOTA_EXCEEDED_ERR:\n msg += 'QUOTA_EXCEEDED_ERR';\n break;\n case FileError.NOT_FOUND_ERR:\n msg += 'NOT_FOUND_ERR';\n break;\n case FileError.SECURITY_ERR:\n msg += 'SECURITY_ERR';\n break;\n case FileError.INVALID_MODIFICATION_ERR:\n msg += 'INVALID_MODIFICATION_ERR';\n break;\n case FileError.INVALID_STATE_ERR:\n msg += 'INVALID_STATE_ERR';\n break;\n default:\n msg += 'Unknown Error';\n break;\n };\n\n \n console.log(msg);\n}", "title": "" }, { "docid": "b8c397c4da0d757060a7bb475f5c1f0e", "score": "0.4761755", "text": "[CHECKFS] (entry) {\n this[PEND]()\n this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {\n if (er)\n return this[ONERROR](er, entry)\n fs.lstat(entry.absolute, (er, st) => {\n if (st && (this.keep || this.newer && st.mtime > entry.mtime))\n this[SKIP](entry)\n else if (er || this[ISREUSABLE](entry, st))\n this[MAKEFS](null, entry)\n else if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n if (!entry.mode || (st.mode & 0o7777) === entry.mode)\n this[MAKEFS](null, entry)\n else\n fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry))\n } else\n fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry))\n } else\n unlinkFile(entry.absolute, er => this[MAKEFS](er, entry))\n })\n })\n }", "title": "" }, { "docid": "b8797f8149dd3ebb832a009dbcb63822", "score": "0.47601458", "text": "function displayNonInitializedFolderErrorMessage() {\n const clc = cliColor();\n\n console.log(\n clc.warn('It seems this is not an Harmonic project yet. \\n') +\n clc.warn('Check your directory or run ') +\n clc.info.bgWhite.italic(' harmonic init ') +\n clc.warn(' to start a new Harmonic project.')\n );\n}", "title": "" }, { "docid": "300cbe71627f5db07cbb7c6abb08054b", "score": "0.47506088", "text": "function ensureLocalizationDirectory() {\n var locDir = common_1.getLocalizationDirectoryPath(true);\n if (!fse.existsSync(locDir))\n common_1.log(\"created '\" + common_1.chalk.cyanBright(locDir) + \"' directory\");\n fse.ensureDirSync(locDir);\n if (!fse.existsSync(locDir))\n throw new Error(common_1.terminalPrefix + \" cannot create '\" + common_1.chalk.cyanBright(_1.Lingualizer.DefaulLocalizationDirName) + \"' directory at '\" + common_1.chalk.red(locDir) + \"'\");\n return locDir;\n}", "title": "" }, { "docid": "a69f0ed5a35035f8a8963af20a5cbeb5", "score": "0.47220308", "text": "function U(e){if('string'!=typeof e)throw new TypeError('Path must be a string. Received '+e)}// Resolves . and .. elements in a path with directory names", "title": "" }, { "docid": "eb079dea5787664ada8d02751d39c214", "score": "0.4718237", "text": "dir(path, cb) {\n this.send({\n dir: {\n path,\n nonce: cb\n }\n })\n }", "title": "" }, { "docid": "fbe4bd9c5fc37d0fc7573198ef4ea817", "score": "0.47179347", "text": "function error(err) {\n next('ENOENT' == err.code\n ? null\n : err);\n }", "title": "" }, { "docid": "1383788abb00595c762ae2afb8d81758", "score": "0.47077248", "text": "function caml_raise_sys_error (msg) {\n caml_raise_with_string(caml_global_data.Sys_error, msg);\n}", "title": "" }, { "docid": "1383788abb00595c762ae2afb8d81758", "score": "0.47077248", "text": "function caml_raise_sys_error (msg) {\n caml_raise_with_string(caml_global_data.Sys_error, msg);\n}", "title": "" }, { "docid": "4c4945a17c257749e9e1aaf454fabcbe", "score": "0.46876904", "text": "function Path() {\n\n this.path = \"/\";\n\n /**\n *\n * @param {String} path1\n * @param {String} path2 Unix-like path. Absolute or relative\n * @returns {String[]}\n */\n Path.prototype.resolveToArray = function (path1, path2) {\n const goingBackwardsSymb = '..';\n const mainPath = path1.split('/').filter(it => it.length);\n const foreignPath = path2.split('/').filter(it => it.length);\n\n if (foreignPath.includes('..')) {\n foreignPath.forEach(pathElement => {\n if (pathElement !== goingBackwardsSymb) {\n mainPath.push(pathElement);\n } else {\n if (!mainPath[mainPath.length - 1]) {\n throw new Error('Invalid path');\n }\n mainPath.pop();\n }\n });\n return mainPath;\n } else {\n return mainPath.concat(foreignPath);\n }\n }\n\n /**\n * Determine if the passed value is the proper format for a directory.\n */\n Path.prototype.isValidDirectory = function (filename) {\n if (filename == '') {\n return false;\n }\n var newFilename = filename.replace(/[^A-Za-z\\d\\.\\-_~]/, ''); // Remove all but allowed chars.\n if (newFilename.length != filename.length) {\n return false;\n }\n // Check for more than 1 period in a row. TODO: Do we even need this protection? Don't want people creating a dir called '..'.\n var foundPeriods = newFilename.match(/\\.\\./g);\n if (foundPeriods != null && foundPeriods.length > 1) {\n return false;\n }\n return true;\n };\n\n /**\n * Determine if the passed value is the proper format for a file name.\n */\n Path.prototype.isValidFilename = function (filename) {\n if (filename == '') {\n return false;\n }\n var newFilename = filename.replace(/[^A-Za-z\\d\\.\\-_~]/, ''); // Remove all but allowed chars.\n if (newFilename.length != filename.length) {\n return false;\n }\n // Check for more than 1 period in a row. TODO: Do we even need this protection? Don't want people creating a dir called '..'.\n var foundPeriods = newFilename.match(/\\.\\./g);\n if (foundPeriods != null && foundPeriods.length > 1) {\n return false;\n }\n return true;\n };\n\n /**\n * Determine if the passed value is the proper format for a directory path (no file name at end).\n */\n Path.prototype.isValidDirectoryPath = function (filename) {\n if (filename == '') {\n return false;\n }\n var newFilename = filename.replace(/[^A-Za-z\\d\\/\\-_~]/, ''); // Remove all but allowed chars.\n newFilename = newFilename.replace(/(\\/)\\/+/g, \"$1\"); // Remove any double slashes.\n if (newFilename.length != filename.length) {\n return false;\n }\n return true;\n };\n\n /**\n * Get the directory part of a filepath. What's before the final slash. Add a final slash if not there.\n * assumeDirectory - if true, no slashes means assume it's meant to be a directory name.\n */\n Path.prototype.getDirectoryPart = function (filepath, assumeDirectory) {\n var dirs = '';\n if (filepath == '') {\n return false;\n }\n if (assumeDirectory && this.isValidDirectory(filepath)) {\n dirs = filepath;\n } else if (!assumeDirectory && this.isValidFilename(filepath)) {\n return false;\n } else {\n dirs = filepath.substring(0, filepath.lastIndexOf(\"/\")); // The path without the trailing portion.\n }\n return dirs + \"/\";\n };\n\n /**\n * Get the ending part of a filepath (the filename). What's after the final slash.\n * assumeFile - if true, no slashes means assume it's meant to be a directory name.\n */\n Path.prototype.getFilenamePart = function (filepath, assumeFile) {\n if (filepath == '') {\n return false;\n }\n if (assumeFile && this.isValidFilename(filepath)) {\n return filepath;\n } else if (!assumeFile && this.isValidDirectory(filepath)) {\n return false;\n }\n var name = filepath.split('\\\\').pop().split('/').pop(); // Get the final part (file name).\n if (name == '') {\n return false;\n }\n return name;\n };\n\n /**\n * Parse a path into a selector for finding a directory node.\n */\n Path.prototype.parseDirPathToSelector = function (path) {\n if (path == \"/\" || path == \"~\") {\n return \"d[path='/'][name='/']\";\n }\n path = path.replace(/\\/+$/, \"\"); // Remove trailing slash.\n var name = path.split('\\\\').pop().split('/').pop(); // Get the last part - either a file name or a dir name without a trailing slash.\n var dirs = path.substring(0, path.lastIndexOf(\"/\") + 1); // The path without the trailing portion.\n return \"d[path='\" + dirs + name + \"/'][name='\" + name + \"']\"; // Create a node selector for a directory.\n };\n\n /**\n * Parse a path with filename into a selector for finding a file node.\n */\n Path.prototype.parseFilePathToSelector = function (path) {\n var name = path.split('\\\\').pop().split('/').pop(); // Get the final part (file name).\n var dirs = path.substring(0, path.lastIndexOf(\"/\") + 1); // The path without the trailing portion.\n return \"f[path='\" + dirs + \"'][name='\" + name + \"']\"; // Create a node selector for a file.\n };\n}", "title": "" }, { "docid": "e25f5e814c2dd53ebf19acfc3337b877", "score": "0.46842754", "text": "_ensureDirectory(relPath) {\n const parts = files.pathNormalize(relPath).split(files.pathSep);\n if (parts.length > 1 && parts[parts.length - 1] === '') {\n // remove trailing slash\n parts.pop();\n }\n\n const partsSoFar = [];\n parts.forEach(part => {\n partsSoFar.push(part);\n const partial = partsSoFar.join(files.pathSep);\n if (! (partial in this.usedAsFile)) {\n let needToMkdir = true;\n if (partial in this.previousUsedAsFile) {\n if (this.previousUsedAsFile[partial]) {\n // was previously used as file, delete it, create a directory\n try {\n files.unlink(partial);\n } catch (e) {\n // If files.unlink(partial) failed because the file does not\n // exist, then we can just pretend the unlink succeeded.\n if (e.code !== \"ENOENT\") {\n throw e;\n }\n }\n } else {\n // is already a directory\n needToMkdir = false;\n }\n }\n\n if (needToMkdir) {\n // It's new -- create it\n files.mkdir_p(files.pathJoin(this.buildPath, partial), 0o755);\n }\n this.usedAsFile[partial] = false;\n } else if (this.usedAsFile[partial]) {\n // Already exists and is a file. Oops.\n throw new Error(`tried to make ${relPath} a directory but ${partial} is already a file`);\n } else {\n // Already exists and is a directory\n }\n });\n }", "title": "" }, { "docid": "10c2ee32668c77b2a37f651a75044154", "score": "0.4680709", "text": "function checkDirectory(directory, callback) {\n\tfs.stat(directory, function(err, stats) {\n\t\t//Check if error defined and the error code is \"not exists\"\n\t\tif (err && err.errno === 34 || err && err.errno === -4058) {\n\t\t\tcallback(false);\n\t\t} else if (err) {\n\t\t\t//just in case there was a different error:\n\t\t\tcallback(false, err);\n\t\t}\n\t\telse {\n\t\t\tcallback(true);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "baa1bfc14250ef081e2a0f4705f51401", "score": "0.46756625", "text": "makeDirectory(dir) {\n if (this.isReadOnly()) {\n return ec.readonly;\n }\n dir = this._cleanFilePath(dir);\n if (!this._isFileInDisk(dir)) {\n return ec.notindisk;\n }\n if (this.exists(dir)) {\n console.error(this.disk, \"mkdir\", \"Tried to create a directory when it already exists.\");\n return ec.alreadyexists;\n }\n fs.mkdirSync(this.filePath + dir, {recursive: true});\n return this.exists(dir);\n }", "title": "" }, { "docid": "9166d1829d2f6f0e967a50b7463555d8", "score": "0.46714577", "text": "function ensureDir(dir) {\n return fs.ensureDir(dir, 0777);\n}", "title": "" }, { "docid": "4a774edbeff5acc441711524065c82df", "score": "0.46703428", "text": "function constructorShouldThrowOnEmptyBaseDirectory() {\n expect(() => {\n new FileSystemStorage(\"\")\n }).toThrow(\n new TypeError(\"Invalid base: ''\"))\n}", "title": "" }, { "docid": "31d174edea862a3e055d9097b309ebca", "score": "0.4660529", "text": "function ensureDirectories (lambda) {\n if (!pathExists(ProgramDir)) fs.mkdirSync(ProgramDir)\n if (!pathExists(LogsDir)) fs.mkdirSync(LogsDir)\n\n const lambdaDir = path.join(LogsDir, lambda)\n if (!pathExists(lambdaDir)) fs.mkdirSync(lambdaDir)\n}", "title": "" }, { "docid": "94a9857aea62e2145651dcdb42d336be", "score": "0.4649785", "text": "function isENOENT(error) {\n return isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "94a9857aea62e2145651dcdb42d336be", "score": "0.4649785", "text": "function isENOENT(error) {\n return isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "94a9857aea62e2145651dcdb42d336be", "score": "0.4649785", "text": "function isENOENT(error) {\n return isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "94a9857aea62e2145651dcdb42d336be", "score": "0.4649785", "text": "function isENOENT(error) {\n return isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "94a9857aea62e2145651dcdb42d336be", "score": "0.4649785", "text": "function isENOENT(error) {\n return isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "94a9857aea62e2145651dcdb42d336be", "score": "0.4649785", "text": "function isENOENT(error) {\n return isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "f06413f004bb4e2f0664724b1246726b", "score": "0.46251577", "text": "manifestError(message) {\n this.packagingError(`Reading manifest: ${message}`);\n }", "title": "" }, { "docid": "98d53b35a78a96f81b381d763d8cd2b2", "score": "0.46221024", "text": "function prep_dir (name, next) {\n log.trace('Preparing directory ' + name);\n fs.exists(name, function (exists) {\n if (exists) return next();\n fs.mkdir(name, '0700', function (err) {\n next(err);\n });\n });\n }", "title": "" }, { "docid": "feaa91dd71cc7d874a75c1abfc538e5e", "score": "0.4621745", "text": "function assertLocationDir (location, section) {\n if (!location) {\n MSG.show(MSG.NAME.UCONF_LOCATION_INVALID, { section })\n return false\n }\n if (!Utils.isDir(location)) {\n MSG.show(MSG.NAME.UCONF_LOCATION_NOT_EXIST, { section, location })\n return false\n }\n return true\n}", "title": "" }, { "docid": "051bd91f22a76461b5d738fe182e104a", "score": "0.4611352", "text": "async function handleComponentsDirectory () {\n try {\n await access(`${cwd}/components`, fs.constants.R_OK)\n return true\n } catch {\n const questions = []\n questions.push({\n type: 'confirm',\n name: 'componentsDirectory',\n message:\n \"'components' directory does not exist, do you want to create it?\"\n })\n\n const answers = await inquirer.prompt(questions)\n if (answers['componentsDirectory']) {\n fs.mkdirSync('./components')\n }\n return answers['componentsDirectory']\n }\n}", "title": "" }, { "docid": "8f7424ff0a497bdd88c1e396e3724422", "score": "0.460958", "text": "function checkDirforSpace(dirToCheck) {\r\n var fx = sh.fs.checkSpace2;\r\n if (sh.isWin()) {\r\n\r\n } else {\r\n fx = sh.fs.checkSpace\r\n }\r\n fx(dirToCheck, function onCheckedDir(ok, freeSpace) {\r\n //dictDirOk[dirToCheck] = ok;\r\n /*if ( dirsOK ) {\r\n dirsOk.push(dirToCheck);\r\n } else {\r\n dirsFullsNotOk.push(dirToCheck);\r\n };*/\r\n dirStatus.freeSpace = freeSpace;\r\n dirStatus.empty = !ok;\r\n dirStatus.hasFreeSpace = ok;\r\n dirStatus.dir = dirToCheck;\r\n\r\n if (dirStatus.hasFreeSpace && dirStatus.freeSpace > minSpace) {\r\n dirWithSpace = dirStatus\r\n }\r\n //get size of directory\r\n var sizeOfDir = sh.fs.getSizeOfDir3(dirToCheck)\r\n dirStatus.dirSize = sizeOfDir;\r\n checkIfDirExists();\r\n\r\n })\r\n }", "title": "" }, { "docid": "51c6df6b25177e509cb1f169a5399368", "score": "0.4608675", "text": "function gotDir(dirEntry) {\n\t\t\t\talert('created dir: ' + dirName); \n\t\t\t}", "title": "" }, { "docid": "3c10750bd960d6efeca3cea64b55ec83", "score": "0.45923376", "text": "function createDirStruct(bundle, callback) {\n\t\tvar dirlist = bundle.split(\"/\"),\n\t\t\ti = 0,\n\t\t\tmax = dirlist.length - 1,\n\t\t\tpreceed = \"\";\n\n\t\tfunction createDirStep(path, i, callback) {\n\t\t\tif (i >= max) {\n\t\t\t\treturn callback.call();\n\t\t\t}\n\t\t\tfs.stat(path + dirlist[i], function(err, stat) {\n\t\t\t\tif (err || !stat) {\n\t\t\t\t\tfs.mkdir(path + dirlist[i], 0777, function(err) {\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.log(\"couldn't make dir \" + dirlist[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpath = path + dirlist[i] + \"/\";\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tcreateDirStep.call(null, path, i, callback);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tpath = path + dirlist[i] + \"/\";\n\t\t\t\t\ti++;\n\t\t\t\t\tcreateDirStep.call(null, path, i, callback);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcreateDirStep(preceed, i, callback);\n\t}", "title": "" }, { "docid": "a602f3b84496d0f56ef86051cb5bb103", "score": "0.4588628", "text": "bootstrapDirectory() {\n // make sure the workspace directory exists\n fse.mkdirpSync(this.workspaceDirectory);\n\n // make sure the chaindata folder exists\n if (this.chaindataDirectory) {\n fse.mkdirpSync(this.chaindataDirectory);\n }\n }", "title": "" }, { "docid": "369aff0f12262eab1dedba72bc81acbb", "score": "0.4587737", "text": "function fatalShouldNotExist(path) {\n\tif (fs.existsSync(path)) {\n\t\tdie('expected item \"' + path.replace('../', '') + '\" to not exist, but it did');\n\t}\n}", "title": "" }, { "docid": "7a607b34687151d85ec308e7d952aa3c", "score": "0.4579177", "text": "listDir(path){\n\t window.resolveLocalFileSystemURL(path,\n\t function (fileSystem) {\n\t var reader = fileSystem.createReader();\n\t reader.readEntries(\n\t function (entries) {\n\t entireMaterialDirectory = entries;\n\t },\n\t function (err) {\n\t //\talert(err)\n\t console.log(err);\n\t }\n\t );\n\t }, function (err) {\n\t //\talert(err)\n\t console.log(err);\n\t }\n\t );\n\t}", "title": "" }, { "docid": "40bc920d62d67ffad2389b3347297039", "score": "0.4553976", "text": "function caml_failwith (msg) {\n caml_raise_with_string(caml_global_data.Failure, msg);\n}", "title": "" }, { "docid": "40bc920d62d67ffad2389b3347297039", "score": "0.4553976", "text": "function caml_failwith (msg) {\n caml_raise_with_string(caml_global_data.Failure, msg);\n}", "title": "" }, { "docid": "ba246d9c91b14c6b1fb4ce9e6fb30d96", "score": "0.4535749", "text": "function check_directory()\n{\n return new Promise((resolve, reject)=>\n {\n fs.stat(schat_dir, (err, stats)=>\n {\n if(err && err.code == 'ENOENT')\n {\n fs.mkdir(schat_dir, (err)=>\n {\n if(err)\n {\n err.code = error_codes.DIRECTORY_ERROR;\n reject(err);\n }\n else\n resolve();\n });\n }\n else if(!stats.isDirectory())\n {\n var err = new Error(\"file ~/.schat already exist and is not a directory\");\n err.code = error_codes.DIRECTORY_ERROR;\n reject(err);\n }\n else\n resolve();\n });\n });\n}", "title": "" }, { "docid": "3bf4c5757d8a8dd4008b2c8fbb4bd1c0", "score": "0.45218638", "text": "function caml_raise_unix_error(msg) {\n var tag = caml_named_value(\"Unix.Unix_error\");\n // var util = require('util');\n // console.log(util.inspect(chan, {showHidden: false, depth: null}));\n caml_raise_with_arg (tag, caml_new_string (msg));\n}", "title": "" }, { "docid": "2862344b7a7b75d023f35f9ec1dee368", "score": "0.45202452", "text": "function factoryShouldCreateNonExistingBaseDirectory(done) {\n FileSystemStorage.factory(\"genmaicha/sencha/bancha\")\n .then(storage => {\n expect(storage.base)\n .toEqual(\"genmaicha/sencha/bancha\")\n expect(fs.existsSync(\"genmaicha/sencha/bancha\"))\n .toBe(true)\n done()\n })\n .catch(done.fail)\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "a28d20c6e242a465120f62159204d044", "score": "0.4496141", "text": "function _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}", "title": "" }, { "docid": "2ef8250f3e04ff104e4fc1b556d8a9ca", "score": "0.44904247", "text": "function fatalShouldExist(path) {\n\tif (!fs.existsSync(path)) {\n\t\tdie('expected item \"' + path.replace('../', '') + '\" to exist, but it didn\\'t');\n\t}\n}", "title": "" }, { "docid": "2ab26ff34e233565018ba241945e94d6", "score": "0.44870755", "text": "function testForDriveDirectories() {\n testPromise(driveDirSystemPromise.then(function(volume) {\n return launchWithEntries(volume.entries);\n }));\n}", "title": "" }, { "docid": "0edf6a94c79d4d56cc6e00bd73d59170", "score": "0.44825405", "text": "function gotDir(d){\n console.log(\"got dir\");\n alert(\"d-\"+JSON.stringify(d));\n DATADIR = d;\n var reader = DATADIR.createReader();\n reader.readEntries(function(d){\n gotFiles(d);\n\n },onError);\n}", "title": "" }, { "docid": "4ba92285488f687e7bea26e8c51f7344", "score": "0.4481191", "text": "function checkDirectoryIsAllowed(aLocalPath) {\n /**\n * Check if the local path (aLocalPath) is 'safe' i.e. NOT a parent\n * or subdirectory of the given special system/app directory (aDirToCheck).\n *\n * @param aDirToCheck An object describing the special directory.\n * The object has the following members:\n * dirsvc : A path keyword to retrieve from the Directory service.\n * dir : An absolute filesystem path.\n * Only one of 'dirsvc' or 'dir' can be specified.\n * OS : A string of comma separated values defining on which\n * Operating systems the folder is unusable:\n * null = all\n * WINNT = Windows\n * Darwin = OS X\n * Linux = Linux\n * safeSubdirs : An array of directory names that are allowed to be used\n * under the tested directory.\n * @param aLocalPath An nsIFile of the directory to check, intended for message storage.\n */\n function checkLocalDirectoryIsSafe(aDirToCheck, aLocalPath) {\n if (aDirToCheck.OS) {\n if (!aDirToCheck.OS.split(\",\").includes(Services.appinfo.OS)) {\n return true;\n }\n }\n\n let testDir = null;\n if (\"dirsvc\" in aDirToCheck) {\n try {\n testDir = Services.dirsvc.get(aDirToCheck.dirsvc, Ci.nsIFile);\n } catch (e) {\n Cu.reportError(\n \"The special folder \" +\n aDirToCheck.dirsvc +\n \" cannot be retrieved on this platform: \" +\n e\n );\n }\n\n if (!testDir) {\n return true;\n }\n } else if (\"dir\" in aDirToCheck) {\n testDir = Cc[\"@mozilla.org/file/local;1\"].createInstance(Ci.nsIFile);\n testDir.initWithPath(aDirToCheck.dir);\n if (!testDir.exists()) {\n return true;\n }\n } else {\n Cu.reportError(\"No directory to check?\");\n return true;\n }\n\n testDir.normalize();\n\n if (testDir.equals(aLocalPath) || aLocalPath.contains(testDir)) {\n return false;\n }\n\n if (testDir.contains(aLocalPath)) {\n if (!(\"safeSubdirs\" in aDirToCheck)) {\n return false;\n }\n\n // While the tested directory may not be safe,\n // a subdirectory of some safe subdirectories may be fine.\n let isInSubdir = false;\n for (let subDir of aDirToCheck.safeSubdirs) {\n let checkDir = testDir.clone();\n checkDir.append(subDir);\n if (checkDir.contains(aLocalPath)) {\n isInSubdir = true;\n break;\n }\n }\n return isInSubdir;\n }\n\n return true;\n } // end of checkDirectoryIsNotSpecial\n\n // If the server type has a nsIMsgProtocolInfo.defaultLocalPath set,\n // allow that directory.\n if (currentAccount.incomingServer) {\n try {\n let defaultPath =\n currentAccount.incomingServer.protocolInfo.defaultLocalPath;\n if (defaultPath) {\n defaultPath.normalize();\n if (defaultPath.contains(aLocalPath)) {\n return true;\n }\n }\n } catch (e) {\n /* No problem if this fails. */\n }\n }\n\n for (let tryDir of gDangerousLocalStorageDirs) {\n if (!checkLocalDirectoryIsSafe(tryDir, aLocalPath)) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "bd55e798ae4247b15d3e3c356ae1cff5", "score": "0.4480877", "text": "function getattr(path, cb) {\t \n var path = pth.join(srcRoot, path);\n return fs.lstat(path, function lstatCb(err, stats) {\n if (err) \n return cb(-excToErrno(err));\n return cb(0, stats);\n });\n}", "title": "" }, { "docid": "5aad421666a800311a3bb744dec2dedb", "score": "0.44802678", "text": "ensure_files_map() {\n if (this.slave) {\n this.slave.ensure_files_map();\n }\n else {\n throw new TypeError(\"Slave directory \" +\n this.name +\n \" : No slave to ensure a files map exists\");\n }\n }", "title": "" }, { "docid": "c3cbdd133b9016ccafe9a8b1f822509b", "score": "0.4480227", "text": "function findValidDir(url, callback) {\n // eg 25 bytes => 50 chars ( we need the halt id length)\n crypto.randomBytes(Math.ceil(id_length / 2), function (err, buffer) {\n if (err) {\n return callback(err, null);\n }\n // get exact length of the string\n var path = murl.parse(url, false).host + \"-\" + buffer.toString('hex').slice(0, id_length);\n // If it exists, we just call this function again.\n // This has the risk of running thousands of times if it is always the same id\n fs.exists(mpath.join(\"public\", \"s\", path), function (exists) {\n if (exists) {\n findValidDir(url, callback);\n }\n else {\n return callback(null, path);\n }\n });\n });\n}", "title": "" }, { "docid": "cf6c97676455bb1ad47a913b8a8e74c5", "score": "0.44796255", "text": "checkDelta()\n {\n for (let file of this.mergeCommit.data.files)\n {\n if (file.filename.indexOf(this.studentDirectory + '/') !== 0)\n throw new Error(`You can't modify files outside ${this.studentDirectory}/`);\n }\n }", "title": "" }, { "docid": "f66026311059923f3c10a4592947f4b0", "score": "0.44727886", "text": "function verifyPath(curPath, done) {\n nodeFs.stat(curPath, function(err, stats) {\n done(curPath, !err);\n });\n }", "title": "" }, { "docid": "9fbca0b6108e5b6b9443ee85a1b104f3", "score": "0.4455122", "text": "function _validatePaths(pathArray) {\n for (var idx in pathArray) {\n path = pathArray[idx];\n if (!_isValidPath(path[0], path[1])) {\n log.err(`${path[0]} is not a valid ${path[1] === 'D' ? 'directory' : 'file'}\n `, 0, true);\n process.exit(-1);\n }\n }\n}", "title": "" }, { "docid": "ef2e726dbb42cda0c73e1349062086e3", "score": "0.4440393", "text": "function assertPath(path, callback)\n{\n\trunCommand(\"mkdir\", [\"-p\", path], callback, console.error);\n}", "title": "" }, { "docid": "eda48939ce5769f24633b6492f24872d", "score": "0.44255957", "text": "addSubDir(dirUri, dirStat) {\n\n }", "title": "" }, { "docid": "c53e5aa5b2b1b0104e854ca31740b78e", "score": "0.44138294", "text": "function test_newly_created_folders_start_clean() {\n let msgFolder = MessageInjection.make_empty_folder();\n let glodaFolder = Gloda.getFolderForFolder(msgFolder);\n Assert.equal(glodaFolder.dirtyStatus, glodaFolder.kFolderClean);\n}", "title": "" }, { "docid": "df40687796f3bc0e69be32e46206087b", "score": "0.4410262", "text": "function caml_invalid_argument (msg) {\n caml_raise_with_string(caml_global_data.Invalid_argument, msg);\n}", "title": "" }, { "docid": "df40687796f3bc0e69be32e46206087b", "score": "0.4410262", "text": "function caml_invalid_argument (msg) {\n caml_raise_with_string(caml_global_data.Invalid_argument, msg);\n}", "title": "" }, { "docid": "f04146257ba577bd281cb4b364195a96", "score": "0.4400503", "text": "function _checkFolder() {\n if (!useFiles) return true;\n \n let folderPath = path.join(__dirname, \"..\", \"..\", \"logs\");\n if (!fs.existsSync(folderPath)) {\n try {\n fs.mkdirSync(folderPath);\n return true;\n } catch (e) {\n _logMessage(e, Level.ERROR, Colour.RED);\n return e;\n }\n } else return true;\n }", "title": "" }, { "docid": "0d50333f453e2e61653172ba85db5abf", "score": "0.44003072", "text": "function validShouldFailOnFile() {\n expect(new FileSystemStorage(\"valid\").valid(\"sencha\"))\n .toBe(false)\n}", "title": "" }, { "docid": "4b168f88b82a84487e982e25b297cb22", "score": "0.43980026", "text": "function setupReadDirSuccess() {\n fsStub.readdirSync.reset();\n fsStub.readdirSync.onCall(0).returns(['db', 'server', 'client']);\n fsStub.readdirSync.onCall(1).returns(['node_modules', 'src', 'lib', 'package.json']);\n\n // at this point, the search for the migrations folder should begin\n fsStub.readdirSync.onCall(2).returns(['node_modules', 'src', 'lib']);\n fsStub.readdirSync.onCall(3).returns(['db', 'server', 'client']);\n fsStub.readdirSync.onCall(4).returns(['migrations', 'config', 'seeds', 'models']);\n fsStub.readdirSync.returns([]);\n}", "title": "" }, { "docid": "2920c3be3c1142b2c28707755722d516", "score": "0.43975368", "text": "function validateDirManipulation(components) {\n const throwOnError = (expectedPath, actualPath) => {\n if (expectedPath !== actualPath) {\n throw new (_validationError().default)(`failed validating the component paths with sharedDir, expected path ${expectedPath}, got ${actualPath}`);\n }\n };\n\n const validateComponent = component => {\n if (!component.componentMap) throw new Error(`componentMap is missing from ${component.id.toString()}`);\n if (!component.componentFromModel) return; // component.componentFromModel.setOriginallySharedDir();\n\n const sharedDir = component.componentFromModel.originallySharedDir;\n const wrapDir = component.componentFromModel.wrapDir;\n\n const pathWithSharedDir = pathStr => {\n // $FlowFixMe componentMap is set here\n // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n if (sharedDir && component.componentMap.origin === _constants().COMPONENT_ORIGINS.IMPORTED) {\n return (0, _utils().pathJoinLinux)(sharedDir, pathStr);\n }\n\n return pathStr;\n };\n\n const pathWithoutWrapDir = pathStr => {\n if (wrapDir) {\n return pathStr.replace(`${wrapDir}/`, '');\n }\n\n return pathStr;\n };\n\n const pathAfterDirManipulation = pathStr => {\n const withoutWrapDir = pathWithoutWrapDir(pathStr);\n return pathWithSharedDir(withoutWrapDir);\n };\n\n const expectedMainFile = pathAfterDirManipulation(component.componentMap.mainFile); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n throwOnError(expectedMainFile, component.pendingVersion.mainFile); // $FlowFixMe componentMap is set here\n\n const componentMapFiles = component.componentMap.getAllFilesPaths(); // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!\n\n const componentFiles = component.pendingVersion.files.map(file => file.relativePath);\n componentMapFiles.forEach(file => {\n const expectedFile = pathAfterDirManipulation(file);\n\n if (!componentFiles.includes(expectedFile)) {\n throw new (_validationError().default)(`failed validating the component paths, expected a file ${expectedFile} to be in ${componentFiles.toString()} array`);\n }\n });\n };\n\n components.forEach(component => validateComponent(component));\n}", "title": "" }, { "docid": "6a513fac7402a6d818fcea0505f127b3", "score": "0.43960986", "text": "function checkDirectoryIsValid(aLocalPath) {\n // Any directory selected in the file picker already exists.\n // Any directory specified in prefs.js will be created at start if it does\n // not exist yet.\n // If at the time of entering Account Manager the directory does not exist,\n // it must be invalid in the current OS or not creatable due to permissions.\n // Even then, the backend sometimes tries to create a new one\n // under the current profile.\n if (!aLocalPath.exists() || !aLocalPath.isDirectory()) {\n return false;\n }\n\n if (Services.appinfo.OS == \"WINNT\") {\n // Do not allow some special filenames on Windows.\n // Taken from mozilla/widget/windows/nsDataObj.cpp::MangleTextToValidFilename()\n let dirLeafName = aLocalPath.leafName;\n const kForbiddenNames = [\n \"COM1\",\n \"COM2\",\n \"COM3\",\n \"COM4\",\n \"COM5\",\n \"COM6\",\n \"COM7\",\n \"COM8\",\n \"COM9\",\n \"LPT1\",\n \"LPT2\",\n \"LPT3\",\n \"LPT4\",\n \"LPT5\",\n \"LPT6\",\n \"LPT7\",\n \"LPT8\",\n \"LPT9\",\n \"CON\",\n \"PRN\",\n \"AUX\",\n \"NUL\",\n \"CLOCK$\",\n ];\n if (kForbiddenNames.includes(dirLeafName)) {\n return false;\n }\n }\n\n // The directory must be readable and writable to work as a mail store.\n if (!(aLocalPath.isReadable() && aLocalPath.isWritable())) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "1ef1b28e3d645d697b8807b6cd699a34", "score": "0.4395305", "text": "function mkDir(dirPath, cb){\n fs.exists(dirPath, function(exists){\n if(!exists){\n mkdirp(dirPath, '0755', function(err){\n if(err) console.log( 'error creating folder');\n else cb();\n });\n }else{\n cb();\n }\n });\t\n}", "title": "" }, { "docid": "9188f04b3942a61ac3ddd1b2164c9600", "score": "0.43878648", "text": "function makeDirAutofrom(aOSPath, aOptions={}) {\n // worker version\n\t// aOSPath is path to directory you want made\n\t// this functions checks if its parent exists, if it doesnt, it checks grandparent, and so on until it finds an existing. then it calls OS.File.makeDir(aOSPath, {from:FOUND_EXISTING})\n\t\n\t// aOptions\n\t\t// checkExistsFirst - if set to true, it checks if the dir at aOSPath exists, if it does then it quits. else it starts finding first existing parent then does create from there.\n\t\t\t// if true\n\t\t\t\t// if aOSPath DNE - then just one call happens. OS.File.Exists\n\t\t\t\t// if aOSPath EXISTS - then it does a minimum of 3 calls. first exist. then it checks parent exist, and assuming parent exists (just one loop here). then make dir.\n\t\t\t// if false\n\t\t\t\t// if aOSPath DNE - then minimum of 2 calls. loop check finds first parent exists, then makedir\n\t\t\t\t// if aOSPath EXISTS - still min of 2 calls. loop check finds first parent exists, then makedir\n\tvar defaultOptions = {\n\t\tcheckExistsFirst: false\n\t};\n\t\n\t// add to aOptions the defaults if a key for it was not found\n\tfor (var p in defaultOptions) {\n\t\tif (!(p in defaultOptions)) {\n\t\t\taOptions[p] = defaultOptions[p];\n\t\t}\n\t}\n\t\n\tif (aOptions.checkExistsFirst) {\n\t\tvar itExists = OS.File.exists(aOSPath);\n\t\tif (itExists) {\n\t\t\tconsole.log('already existing');\n\t\t\treturn true;\n\t\t}\n\t}\n\t\n\tvar aOSPath_existingDir = aOSPath;\n\tvar aExists;\n\twhile (!aExists) {\n\t\taOSPath_existingDir = OS.Path.dirname(aOSPath_existingDir);\n\t\taExists = OS.File.exists(aOSPath_existingDir);\n\t}\n\t\n\tconsole.log('making from:', aOSPath_existingDir);\n\tvar rez = OS.File.makeDir(aOSPath, {\n\t\tfrom: aOSPath_existingDir\n\t});\n\t\n\tconsole.log('rez:', rez);\n}", "title": "" }, { "docid": "aebc24b663cee05d8fd8c48c626dc12e", "score": "0.43791866", "text": "function Test_CFolder_Folder() {\r\n Test_CFolder_Folder_Core(\"C:\\\\work\");\r\n}", "title": "" } ]
595bd10ff9276ca10b4c1ac4c95d8e3e
change img alt text
[ { "docid": "d9dbd7ad24ce2cc5be34f3b67d48429a", "score": "0.5594732", "text": "function editImg(imgfile, imgdesc) {\n document.forms['newImgAlt']['imgDescription'].value = imgdesc;\n $('#imgAltEdit').css({'top':event.pageY,'left':event.pageX}); \n $('#imgAltEdit').show(); \n $('#newImgAlt').submit(function( event ) {\n var newimgdesc = $('#imgDescription').val();\n newimgdesc = DOMPurify.sanitize(newimgdesc, {SAFE_FOR_JQUERY: true});\n event.preventDefault();\n $.ajax({ \n url: \"../admin/phpajax.php\",\n data: { imgfile: imgfile, imgdesc: newimgdesc },\n type: \"POST\"\n }).done(function(response) {\n $('#imgAltEdit').hide();\n var curText = document.forms['blogpost']['text'].value;\n // replace active text desc\n if (curText.includes(' alt=\"'+imgdesc+'\"><div class=\"textImgMain\"><i>'+imgdesc+'</i></div>')) {\n // escape all occurrences of string, probably not very necessary but annyoing if only one img updates and not the other, \n // in case of multiple instances of the same image\n var toescape = ' alt=\"'+imgdesc+'\"><div class=\"textImgMain\"><i>'+imgdesc+'</i></div>';\n var regexp = escapeRegExp(toescape);\n var newText = curText.replace(new RegExp(regexp, 'g'), ' alt=\"'+newimgdesc+'\"><div class=\"textImgMain\"><i>'+newimgdesc+'</i></div>');\n document.forms['blogpost']['text'].value = newText;\n manualPreview();\n }\n $(window).scrollTop(0);\n ioffset = 0;\n loadImages();\n showDialog(response);\n });\n });\n }", "title": "" } ]
[ { "docid": "06ad0ab8dcdc8b4b330b9ddd25fba0c5", "score": "0.77960765", "text": "function viewAltText() {\n $(\"td img\").each(function () {\n var thisImage = $(this);\n var altText = thisImage.attr(\"alt\");\n var imgP = document.createElement(\"p\");\n var imgTxt = document.createTextNode(\"ALT: \" + altText);\n imgP.className = \"kpmAlt\";\n imgP.appendChild(imgTxt);\n thisImage.after(imgP);\n });\n}", "title": "" }, { "docid": "78f328ab4e6b6f22d87e047776da630b", "score": "0.7464553", "text": "displayAlt() {\n if ( this.altImage ) {\n this.displayImage();\n } else {\n this.displayText();\n }\n }", "title": "" }, { "docid": "51380192fccb5be6ab50c8fc990c28df", "score": "0.74146116", "text": "function replaceImg() {\n const images = document.getElementsByTagName('img');\n for (let i = images.length - 1; i >= 0; i--) {\n const image = images[i];\n if (image.alt) {\n const textNode = document.createTextNode(image.alt);\n image.parentNode.replaceChild(textNode, image);\n }\n }\n}", "title": "" }, { "docid": "fb4d04a3d23d437dc99ded76b894cf94", "score": "0.7118616", "text": "function useAlt(pic) {\n let pStr = pic.image;\n let alt;\n try {\n alt = pStr.match(/alt\\=\\\"([^\\\"]+)\"/);\n } catch (e) {\n try {\n alt = pStr.match(/title\\=\\\"([^\\\"]+)\"/);\n } catch (e2) {\n console.log('no title for ' + pic);\n alt = ''\n }\n console.log('no alt for ' + pic);\n }\n return alt[1];\n }", "title": "" }, { "docid": "9ac1c98f8d339ba045f2160a626d8f8d", "score": "0.71096593", "text": "function replaceImages(){\n\tvar images = document.body.getElementsByTagName(\"img\");\n\tvar text;\n\tfor( var i = images.length - 1; i > -1; i--){\n\t\tif(images[i].alt){\n\t\t\timages[i].parentNode.replaceChild(document.createTextNode(images[i].alt), images[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "56df4a2d891e8bf3a60503bf86295cde", "score": "0.70411175", "text": "function _autoAlt(altPlaceholder = document.title) {\n\tfor (let i = 0; i < document.getElementsByTagName(\"img\").length; i++) {\n\t\tif (\n\t\t\ttypeof document.getElementsByTagName(\"img\")[i].alt == typeof undefined ||\n\t\t\tdocument.getElementsByTagName(\"img\")[i].alt == false ||\n\t\t\tdocument.getElementsByTagName(\"img\")[i].alt.length == 0\n\t\t) {\n\t\t\tdocument .getElementsByTagName(\"img\") [i]\n\t\t\t\t.setAttribute( \"alt\", altPlaceholder || document.getElementsByTagName(\"img\")[i].src );\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b18eca79a652ecea6ce21c840b3862ac", "score": "0.6883791", "text": "function viewDivAltText() {\n $(\"div [class='thumbnail']\").each(function () {\n var thisTD = $(this);\n var thisTitle = $(this).attr(\"title\");\n thisTD.after(\"<p class=\\\"kpmAlt\\\">ALT:\" + thisTitle + \"</p>\");\n });\n}", "title": "" }, { "docid": "497cf67ac3fa620a739a79851efd12f6", "score": "0.68731666", "text": "function imgHover(th, z) {\n var art = \"art\" + th.id.substr(3);\n var img = \"img\" + th.id.substr(3);\n if (z == 1) {\n var alt = document.getElementById(img).alt;\n document.getElementById(art).innerHTML = alt;\n } else {\n document.getElementById(art).innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "f930056ca9109ecaddf680dc153a9f34", "score": "0.68616223", "text": "function altToTitleFunc(element){\r\n if($(element)[0]){\r\n $(element).each(function(){\r\n $(this).children(\"img\").attr(\"title\", ($(this).children(\"img\").attr(\"alt\")));\r\n });\r\n }\r\n}", "title": "" }, { "docid": "cfc07d1c12e6997c5f949d08386e85fb", "score": "0.6859449", "text": "function updateDescription() {\n const description = document.querySelectorAll('.slide')[0].querySelector('img').alt\n document.querySelector('.controls-container p').innerText = description\n}", "title": "" }, { "docid": "7c52be39c0a4f5ba4377b138baca237e", "score": "0.6799261", "text": "function changeImage(chosenWord) {\n document.querySelector(\"#image\").setAttribute(\"src\", \"assets/images/\" + chosenWord + \".png\");\n document.querySelector(\"#image\").setAttribute(\"alt\", chosenWord);\n}", "title": "" }, { "docid": "97f8adf88e575e5aaaee9c947ebc5594", "score": "0.6702959", "text": "function replaceDisplayImage(img) {\r\n\tselectedImage.src = img.src.replace(\"_s.jpg\", \"_c.jpg\");\r\n\tselectedImage.alt = img.alt;\r\n}", "title": "" }, { "docid": "fdd0e672d0320a194dc2cfa08c08b442", "score": "0.6595264", "text": "function updateImgElements() {\n document.querySelectorAll(imgSelector).forEach((el) => {\n // Get the name and alt text from the alt attribute.\n let [, name, sep, alt] = el.alt.match(altRegExp);\n\n // Allow upper case flag names.\n name = name.toLowerCase();\n\n // Set the options from class names.\n const options = {};\n (el.classList ?? []).forEach((css) => {\n const match = css.match(cssRegExp);\n if (!match) return;\n options[match[1]] = match[2];\n });\n\n if (SignalFlags.has(name)) {\n SignalFlags.insertAsImgSrc(el, name, options);\n }\n\n // If there is a separating character...\n if (sep.length > 0) {\n // Replace the alt with the remaining text.\n el.alt = alt;\n }\n });\n}", "title": "" }, { "docid": "154a0da3a84a522b0d88b1e8ad6dea49", "score": "0.6506283", "text": "function replaceHeroImage(src, alt) {\n // This should take attributes and replace the img src and alt in the hero\n $('.hero img').attr('src', src).attr('alt', alt);\n}", "title": "" }, { "docid": "f620b41770d1c08e4cc3c3ab9589c01f", "score": "0.63824266", "text": "function getImgAltTags() {\r\n var alts = \"\";\r\n $(\"img\").each (function() {\r\n alts += \" | \" + $(this).attr(\"alt\"); \r\n });\r\n console.log(alts);\r\n //alert(alts);\r\n}", "title": "" }, { "docid": "9b8a175f152950c17eebfbcb9ee4b8bf", "score": "0.63270557", "text": "function appendImgLink(imgfile, imgdesc) {\n textBefore = text.value.substring(0, start);\n textAfter = text.value.substring(end, text.length);\n text.value = textBefore+'<img src=\\\"'+imgfile+'\\\" alt=\\\"'+imgdesc+'\\\"><div class=\\\"textImgMain\\\"><i>'+imgdesc+'</i></div>'+textAfter;\n manualPreview(); \n }", "title": "" }, { "docid": "9cfca891b5f85505a44465f0d52d1a32", "score": "0.6308808", "text": "function changeBlankImg(){\n\n for(var i = 0; i < imgAryLength ; i++){\n $('#image_list img')[i].src = \"img/blank.JPG\";\n $('#image_list img')[i].alt = \"Image Blank\";\n\t\t\t$captionNode.html(\"Let's Start!\");\n } \n }", "title": "" }, { "docid": "ec2e760d9f36911bce018ad090a349b1", "score": "0.62600887", "text": "function displayImage(URL, alt) {\n $(\"#foodPic\").attr(\"src\", URL);\n $(\"#foodPic\").attr(\"alt\", alt);\n}", "title": "" }, { "docid": "3c030791d1511ba721bd44b73906c3ff", "score": "0.62036556", "text": "function addImageText(imageId,imageTxt){\n$(imageId).text(imageTxt); \n}", "title": "" }, { "docid": "342d084d67d21bcf12d0469ce463e852", "score": "0.61907053", "text": "function imageThis(_this){\n var captionText = document.getElementById(\"caption\");\n var modalImg = document.getElementById(\"imgMod\");\n modal.style.display = \"block\";\n modalImg.src = _this.src;\n captionText.innerHTML = _this.alt;\n}", "title": "" }, { "docid": "68deb9c4e3653f8856825ee63402f398", "score": "0.6181647", "text": "function imageThisP(_this){\n var captionText = document.getElementById(\"caption\");\n var modalImg = document.getElementById(\"imgMod\");\n modal.style.display = \"block\";\n modalImg.src = _this.childNodes[3].src;\n captionText.innerHTML = _this.childNodes[3].alt;\n}", "title": "" }, { "docid": "b1ac72eaee4aaa995c7015f1ee905ca7", "score": "0.61748123", "text": "function getCaption(y) {\n if(captionSetting !== 'on') {\n return '';\n }\n if($(y).attr('alt') !== '') {\n return '<figcaption class=\"image-caption\">' + $(y).attr('alt') + '</figcaption>';\n } else {\n return '';\n } \n }", "title": "" }, { "docid": "113d00501d5f186712d03c3b59e0d08d", "score": "0.61569315", "text": "function doSetTextImageLabel(label) {\n parent.titlebar.SetImageLabel(label);\n}", "title": "" }, { "docid": "e72ff3b06120e79dc52dbf51f55e404d", "score": "0.61488616", "text": "function giveLetter(param){\n if (param === 'letter' && j < image.alt.length) {\n letter.innerHTML = image.alt[j];\n console.log(image.alt[j]);\n j++;\n }\n}", "title": "" }, { "docid": "beaee4481a60f134452185ee37a5a57e", "score": "0.609697", "text": "function showImage()\r\n{ \r\n image.src=\"img/\"+images[index].src;\r\n image.alt=images[index].alt;\r\n}", "title": "" }, { "docid": "ddb28ae0882edc464ab857e4d3563ae3", "score": "0.60914797", "text": "changeText(val){\r\n this.logo.innerHTML = val + String('<img class=\"fill\" max-height=100% src=\"sasayeyo.JPG\">');\r\n }", "title": "" }, { "docid": "03386fb3e5bf21eefe0332bc9b329e55", "score": "0.60383546", "text": "function replaceSrc(e, img){\n if (!img) e.target.src = placeholder\n else e.target.src = (`https://cdn2.thedogapi.com/images/${img}.png`)\n }", "title": "" }, { "docid": "1697b0626ecc0a8742f4508441fbd00b", "score": "0.60090613", "text": "getAltTag() {\n const pureAltTag = this.metadata.altTag;\n\n if (!pureAltTag) {\n return;\n }\n\n const suffix = (0, _CustomElementsScope.getEffectiveScopingSuffixForTag)(pureAltTag);\n\n if (!suffix) {\n return pureAltTag;\n }\n\n return `${pureAltTag}-${suffix}`;\n }", "title": "" }, { "docid": "14b567d42b67df906a706ecf7de87fbc", "score": "0.59727305", "text": "function selectImg() {\n var img = document.getElementById(\"header\");\n img.src = images[randomIndex];\n img.alt = img.src.slice(img.src.indexOf(\"images/\"), img.src.indexOf(\".\"));\n}", "title": "" }, { "docid": "52dbd40ab8718cc505640b2f8d1e5f31", "score": "0.59549886", "text": "function onClick(img, url, alt) {\n img.src = url;\n img.alt = alt;\n handleCompare(img);\n}", "title": "" }, { "docid": "e673279764a989eef848e45d8dfc0819", "score": "0.5946185", "text": "function image() {\n _image.setAttribute('src', images[secretWords.indexOf(word)])\n}", "title": "" }, { "docid": "d96bdee29fe92769f2ff7a6c52493768", "score": "0.59331346", "text": "function saveAltText() {\n\teditedFileData.fileData.altText = $('#altText').val();\n\tdataChanged = true;\n\tif (editedFileData.bulkEdit) {\n\t\teditedFilesData.forEach(function(f) {\n\t\t\tf.fileData.altText = $('#altText').val();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "669f219187f0b9d9c8d75bde7cbde0d6", "score": "0.5932459", "text": "static restaurantImageAlt(restaurant) {\r\n return `An image of ${restaurant.name} in ${restaurant.neighborhood}`;\r\n }", "title": "" }, { "docid": "671360233d63ec27303640f0916b0ae3", "score": "0.5931071", "text": "function expanFunction(imgs) {\n var expandImg = document.getElementById(\"expandedImg\");\n var imgText = document.getElementById(\"imgtext\");\n expandImg.src = imgs.src;\n imgText.innerHTML = imgs.alt;\n expandImg.parentElement.style.display = \"block\";\n}", "title": "" }, { "docid": "054adc13c376ca417b018eaf73684cb9", "score": "0.5927129", "text": "function SaveEPiImageDescription(tbID, tbAltID, imgID)\n{ \n var descID = '#' + imgID + '-EPiImageDescription';\n\n $(descID).dialog('close');\n var value = $(descID + ' .EPiImagePreviewAlt').val().replace('|', '');\n $('#' + tbAltID).val(value);\n \n MarkPageAsChanged(); \n}", "title": "" }, { "docid": "3dbfb08b8ec74b3c956e5c18961f26c2", "score": "0.5875882", "text": "function setImgs(imgs) {\n allImgs = imgs;\n showImgs();\n document.title = 'Alt & Title Results: ' + allImgs[0].ptitle;\n}", "title": "" }, { "docid": "299a67fcad54f677eb0a7b8e96c42f72", "score": "0.5825799", "text": "function altCheck() {\r\n const allDocumentImages = document.getElementsByTagName('img');\r\n let counter = 0;\r\n let empty = 0;\r\n\r\n for (let i = 0; i < allDocumentImages.length; i++ ) {\r\n if (allDocumentImages[i].hasAttribute('alt')) {\r\n // Alt attribute is empty\r\n if (allDocumentImages[i].alt === ''){\r\n empty++;\r\n allDocumentImages[i].style.border = '2px solid greenyellow';\r\n }\r\n } else {\r\n // No alt attribute\r\n allDocumentImages[i].style.border = '2px solid greenyellow';\r\n counter++;\r\n }\r\n }\r\n\r\n // If there is an errors\r\n if (counter || empty) {\r\n seoResult.errors += counter + empty;\r\n seoResult.links_missing_alt = counter;\r\n seoResult.links_empty_alt = empty;\r\n }\r\n}", "title": "" }, { "docid": "ad3bfa393f13adfa613c5bcdf1e4c0d0", "score": "0.5809803", "text": "function changeDieImage(targetElement, dieValue){\n targetElement.setAttribute(\"src\", \"images/die\"+dieValue+\".png\");\n targetElement.setAttribute(\"alt\", \"Die value: \"+dieValue);\n}", "title": "" }, { "docid": "bb7c295263e2066949fbf3120e811ed9", "score": "0.5808858", "text": "function replacementBigIcons(nameItem, way){\n $(nameItem).find('img').attr('src', way);\n }", "title": "" }, { "docid": "208552d75227274727b5169a5717386b", "score": "0.5806465", "text": "function replaceImageNode(image, find, method, fontSize){\n text = image.getAttribute('alt');\n if (find.test(text)){\n encodedCodePoint = getEncoding(text);\n var url = URL_CONST + encodedCodePoint;\n makeRequest(url, function(response){\n if(!checkIfEmpty(response)){\n emoji = response[method];\n if (method == \"name\")\n replacePlainTextFromImage(image, emoji, fontSize);\n else\n replaceImageFromImage(image, emoji);\n }\n });\n }\n}", "title": "" }, { "docid": "8182e433236334adbc0cd4ad02f55ebb", "score": "0.57945657", "text": "function makeAlt(choices) {\n return {\n tag: tags.ALT,\n choices: choices\n };\n }", "title": "" }, { "docid": "29cc35c4e6da067a8279d22d0aa0e7fe", "score": "0.5792862", "text": "static imageAltTextForRestaurant(restaurant) {\r\n return `${restaurant.name} - ${restaurant.neighborhood}`;\r\n }", "title": "" }, { "docid": "2634ed62563325e47fb2815f614f5649", "score": "0.57892793", "text": "function C101_KinbakuClub_Erica_KissedBetter() {\n\tOverridenIntroImage = \"KissBetter\";\n}", "title": "" }, { "docid": "fb00e5c4e6454c2e411c7e94728d3369", "score": "0.57848704", "text": "function onClick(element) {\n document.getElementById(\"img01\").src = element.src;\n document.getElementById(\"modal01\").style.display = \"block\";\n var captionText = document.getElementById(\"caption\");\n captionText.innerHTML = element.alt;\n}", "title": "" }, { "docid": "6433df2a5df09186edcbcdaa2198f8dc", "score": "0.5768784", "text": "function MouseRollover(altImage) {\n\t\"use strict\"; //This code disallows undefined code from running and allow better error catching.\n altImage.src = \"WebpageImages/NZ.jpg\";\n }", "title": "" }, { "docid": "19702394ff46c7e1f7356344410a4e10", "score": "0.5762421", "text": "function updateImageSrc (htmlBody) {\n var srcOld\n var alt\n var newSrc\n var imgNam\n var $ = cheerio.load('<html><head></head><body>' + htmlBody + '</body></html>')\n $('img').each(function (index) {\n srcOld = $(this).attr('src')\n imgNam = srcOld.substring(srcOld.lastIndexOf('/') + 1)\n alt = $(this).attr('alt')\n newSrc = '<img alt=\"' + alt + '\" src=\"' + path.join('img/', imgNam) + '\">'\n $(this).replaceWith(newSrc)\n })\n return $('body').html()\n}", "title": "" }, { "docid": "1c505e31d7c3225c41aa23cea47bb54c", "score": "0.5759999", "text": "function handle_themo_alt_logo ( newValue ) {\n //console.log( newValue );\n elementor.reloadPreview();\n\n /*elementor.once( 'preview:loaded', function() {\n elementor.getPanelView().setPage( 'page_settings' );\n } );*/\n }", "title": "" }, { "docid": "125da4b0a9100a08b941a9858dd57e29", "score": "0.575754", "text": "function clickedImage(e) {\n if (msg) return;\n if (state[e.target.alt].tags.includes(randomTag)) {\n setMsg(\"Correct!\");\n setScore(score + 1);\n } else setMsg(\"Incorrect\");\n }", "title": "" }, { "docid": "1e7a3f22c94b27f86355be4cd4447a79", "score": "0.5747418", "text": "function replace_smiles()\r\n{ \r\n for (var i = 0; i < document.images.length; i++)\r\n {\r\n var altSrc = map[document.images[i].src];\r\n \r\n if (altSrc != null)\r\n {\r\n document.images[i].src = altSrc;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "9ada76d42e7253b6ba55696fa10d13df", "score": "0.57443535", "text": "function getComicAlt(item) {\n return item['alt'];\n}", "title": "" }, { "docid": "8f41ec5e077a907000fd67432291003d", "score": "0.5735218", "text": "function checkImages(dimage,dtext) {\r\n\t\tif(document.getElementById) {\r\n\t\t\tvar imagesArr = new Array();\r\n\t\t\tvar setDefaultErrImg=dimage; // Default image to be displayed on error\r\n\t\t\tvar setDefaultErrTxt=dtext; // Default text to be displayed on error \r\n\t\t\timagesArr = document.getElementsByTagName(\"img\");\r\n\t\t\tfor(var i=0; i<imagesArr.length; i++) {\r\n\t\t\t\tif(!imagesArr[0].getAttribute(\"nc\")==\"1\") {\r\n\t\t\t\t\tvar tempImgAttrib=imagesArr[i].getAttribute(\"alt\");\r\n\t\t\t\t\timagesArr[i].setAttribute(\"alt\",\"\");\r\n\t\t\t\t\tif(imagesArr[i].width==\"28\" && imagesArr[i].height==\"30\") {\r\n\t\t\t\t\t\timagesArr[i].src=setDefaultErrImg;\r\n\t\t\t\t\t\timagesArr[i].setAttribute(\"alt\",setDefaultErrTxt);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\timagesArr[i].setAttribute(\"alt\",tempImgAttrib);\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}", "title": "" }, { "docid": "89bd91b97424243c416a24c2c290d035", "score": "0.5714992", "text": "function changeImage(e) {\n\tmakeName(e);\n\tlet img = document.querySelector('.main_img');\n\t/* changes the string for the file path that the src attribute is equal to. */\n\tvar lrgImg = e.target.src.replace('small', 'large');\n\t/* changes the actual src attribute to the new string */\n\timg.src = lrgImg;\n}", "title": "" }, { "docid": "89cbf236260d6664bd15710824143dd9", "score": "0.5605835", "text": "get altKey() { return !!this.keys.Alt }", "title": "" }, { "docid": "bfe7145a946734b67b4172472fa9482d", "score": "0.56007856", "text": "function initializeIncorrect() {\n $('.logo').attr('src','art/incorrect.png');\n $('.logo').attr('alt','penrose triangle one')\n $('.startQuestion').html(\n `\n <div class=\"feedback\">\n <h2>incorrect</h2> \n <button type=\"button\" class=\"returnBtn\">Resume Quiz</button>\n </div>`\n );\n}", "title": "" }, { "docid": "62e5e88e84d442e0bd00500d4a8e4634", "score": "0.5600511", "text": "function composeHTMLTag([fileLocation, altText]){\n let output = `<img src=\"${fileLocation}\" alt=\"${altText}\">`;\n return output;\n}", "title": "" }, { "docid": "a37e12c0e88be7902155c9262b61e964", "score": "0.5596879", "text": "function set_title($title) {\n document.getElementById(\"title_img\").innerHTML = $title;\n}", "title": "" }, { "docid": "8abf37c1d760fcd2ff5af4d7815ceaef", "score": "0.55751985", "text": "function composeReplacement(str){\r\n\treturn\tstr[2] + '<span title=\"'+ str[1]+'\" class=\"keyIcon\"><img src=\"../../StoreAssets/images/pencil_blue.png\" alt=\"'+ str[1] +'\"/></span>';\r\n}", "title": "" }, { "docid": "a234d16353ba46d5707808d0b6b5ea77", "score": "0.55734485", "text": "function changeImgs(){\n $scope.img1 = {path: 'training-1.jpg'};\n $scope.img2 = {path: 'impressie-2.jpg'};\n if($rootScope.imgList){\n var rand1 = (Math.random()*$rootScope.imgList.length | 0)\n var rand2 = (Math.random()*$rootScope.imgList.length | 0)\n if (rand2 == rand1) {\n rand2 = (rand2+1) % $rootScope.imgList.length;\n }\n $scope.img1.path = $rootScope.imgList[rand1];\n $scope.img2.path = $rootScope.imgList[rand2];\n }\n var alt1str = typeof altTexts[$scope.img1.path] != 'undefined' ? \n $scope.img1.path : 'default';\n var alt2str = typeof altTexts[$scope.img2.path] != 'undefined' ? \n $scope.img2.path : 'default';\n $scope.img1.alt = \n $scope.ENG ? altTexts[alt1str].eng : altTexts[alt1str].dutch;\n $scope.img2.alt = \n $scope.ENG ? altTexts[alt1str].eng : altTexts[alt2str].dutch\n }", "title": "" }, { "docid": "19435571f6cc047c2b1cd8824e6e493e", "score": "0.55639035", "text": "function replace_emoticons(text) {\r\n\t$.each(emoticons, function(char, img) {\r\n\t\tre = new RegExp(char,'g');\r\n\t\t// replace the following at will\r\n\t\ttext = text.replace(re, '<img src=\"'+img_dir+img+'\" />');\r\n\t});\r\n\treturn text;\r\n}", "title": "" }, { "docid": "ddcacd4bedfb5c52a30865f4c56921e3", "score": "0.5555965", "text": "function showTips(args){\nvar img=event.srcElement;\nvar ox=event.offsetX;\nvar oy=event.offsetY;\nvar argsGroup=args.split(\"|\");\nleft=argsGroup[0].split(\",\");\nwidth=argsGroup[1].split(\",\");\ntop=argsGroup[2].split(\",\");\nheight=argsGroup[3].split(\",\");\nvalue=argsGroup[4].split(\",\");\nvar nowAlt=img.longDesc;\nfor(i=0;i<left.length;i++){\nif(ox>parseInt(left[i]) && ox<parseInt(left[i])+parseInt(width[i])){\nif(oy>parseInt(top[i]) && oy<parseInt(top[i])+parseInt(height[i])){\nnowAlt=\tvalue[i];\nbreak;\n}}}\nimg.alt=nowAlt;\n}", "title": "" }, { "docid": "52867ce277939c78aadbd80454cb2191", "score": "0.5553766", "text": "function replaceTextWithEmotes() {\n if(typeof twitchEmotesRegExp === 'undefined')\n twitchEmotesRegExp = new RegExp(\"\\\\b(\" + Object.keys( KappaJS.emotes ).join(\"|\") + \")\\\\b\", \"g\");\n\n $(self).each((i, el) => {\n $(el).html(\n $(el).html().replace(\n twitchEmotesRegExp,\n function(all, emote){ return generateImgTag(KappaJS.emotes[emote], emote) }\n )\n );\n });\n }", "title": "" }, { "docid": "28c75ce4281a5bd8fca25179645dbabd", "score": "0.5526124", "text": "function handleImgClick(e){\n modal.style.display = \"block\";\n let image=e.currentTarget.src;\n modalImg.src=image;\n captionText.innerHTML = e.currentTarget.getAttribute(\"aria-label\");\n}", "title": "" }, { "docid": "2e1413a44ff7a94d74fc86ee0c9f9ca8", "score": "0.55201757", "text": "function updateImg () {\n\tshowImg = currentWord;\n\t\n\tswitch (showImg) {\n\t\tcase \"COMET\":\n\t\t\tspaceImg.src = \"assets/images/comet.jpg\";\n\t\t\tbreak;\n\t\tcase \"EARTH\":\n\t\t\tspaceImg.src = \"assets/images/earth.jpg\";\n\t\t\tbreak;\n\t\tcase \"GALAXY\":\n\t\t\tspaceImg.src = \"assets/images/galaxy.jpg\";\n\t\t\tbreak;\n\t\tcase \"INTERSTELLAR\":\n\t\t\tspaceImg.src = \"assets/images/interstellar.jpg\";\n\t\t\tbreak;\n\t\tcase \"COSMOS\":\n\t\t\tspaceImg.src = \"assets/images/cosmos.jpg\";\n\t\t\tbreak;\n\t\tcase \"NEBULA\":\n\t\t\tspaceImg.src = \"assets/images/nebula.jpg\";\n\t\t\tbreak;\n\t\tcase \"NOVA\":\n\t\t\tspaceImg.src = \"assets/images/nova.jpg\";\n\t\t\tbreak;\n\t\tcase \"SUPERNOVA\":\n\t\t\tspaceImg.src = \"assets/images/supernova.jpg\";\n\t\t\tbreak;\n\t\tcase \"EXTRATERRESTIAL\":\n\t\t\tspaceImg.src = \"assets/images/extraterrestial.jpg\";\n\t\t\tbreak;\n\t\tcase \"UNIVERSE\":\n\t\t\tspaceImg.src = \"assets/images/universe.jpg\";\n\t\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "bd60a8c90a8e39186952427ef27f8d7c", "score": "0.5514799", "text": "function editPic(){\n return '<a class=\"dataDictTable1Edit\" href=\"javascript:void(0)\" title=\"编辑\"><img src=\"img/itoss/dataDictEdit.png\"/></a>';\n}", "title": "" }, { "docid": "4b73866395149a692c5e2b39a84d1759", "score": "0.55089945", "text": "function C999_Common_Cuffs_ShowImage() {\n\tOverridenIntroImage = \"Cuffs.jpg\";\n}", "title": "" }, { "docid": "a75eaeb18d5d69c09ede9534ebf550b4", "score": "0.5501595", "text": "function changeImage() {\n\n var temp = $(this).attr(\"data-name\");\n\n $(this).attr(\"data-name\", $(this).attr(\"src\"));\n\n $(this).attr(\"src\", temp);\n\n }", "title": "" }, { "docid": "d5767e0c5f4f697e2b45b615cfa8f83d", "score": "0.54945105", "text": "function alternativeProductImage() {\n var $=jQuery;\n\tvar tm;\n\tfunction swap() {\n\t\tclearTimeout(tm);\n\t\tsetTimeout(function() {\n\t\t\tel = $(this).find('img[data-alt-src]');\n\t\t\tvar newImg = $(el).data('alt-src');\n\t\t\tvar oldImg = $(el).attr('src');\n\t\t\t$(el).attr('src', newImg).data('alt-src', oldImg);\n\t\t\t$(el).fadeIn(300, \"easeInCubic\");\n\n\t\t}.bind(this), 400);\n\t}\t\n\t$('.item .product-image img[data-alt-src]').parents('.product-image').bind('mouseenter', swap).bind('mouseleave', swap);\n}", "title": "" }, { "docid": "d3eed14d1e1fd549aa11c74f3ab52a74", "score": "0.549089", "text": "function updateNote(obj) {\n\tdebugObject(\"updateNote() obj=\", obj);\n\tsetElementClass(obj.id, getObjectClass(obj));\n\tif (isSpecialStyle(obj, IMAGE_STYLE)) {\n\t\tgetJQElement(obj.id + \"_image\").attr(\"src\", obj.label);\n\t}\n\telse {\n\t\tgetJQElement(obj.id + \"_label\").text(obj.label);\n\t}\n}", "title": "" }, { "docid": "dd9ca5854e2d3df1a7ca49b43ef85ab0", "score": "0.54876065", "text": "function imgUpdate(img){\r\n document.getElementById('Pics').innerHTML=`\r\n ${img.map(x => `<img class=\"photo\" src=\"${x}\" alt=\"Photo taken on Mars by \r\n ${store.selectedRover}\"/>`).join('')}\r\n `\r\n }", "title": "" }, { "docid": "83fed8ddd4413098c8b09fa17538afb9", "score": "0.5478343", "text": "image(token) {\n return `\\n\\n<${token.tag} src=\"${token.attrs[0][1]}\" alt=\"${token.content}\"/>`\n }", "title": "" }, { "docid": "79f240e4a341d833e5cce34affa84047", "score": "0.5476959", "text": "function changeTitle(text){\n// var val = document.getElementById(\"imgInput\").value\n imgTitle.innerHTML = myTitle.value\n}", "title": "" }, { "docid": "81e7326d8ddccbc2541074efd84d318c", "score": "0.547308", "text": "function image$3(node) {\n var self = this;\n var content = encloseUri(self.encode(node.url || '', node));\n var exit = self.enterLink();\n var alt = self.encode(self.escape(node.alt || '', node));\n\n exit();\n\n if (node.title) {\n content += space$t + encloseTitle(self.encode(node.title, node));\n }\n\n return (\n exclamationMark$6 +\n leftSquareBracket$c +\n alt +\n rightSquareBracket$c +\n leftParenthesis$6 +\n content +\n rightParenthesis$7\n )\n}", "title": "" }, { "docid": "58550fc51b84e1f18e0dd75e5d52cfda", "score": "0.5437677", "text": "function image(node) {\r\n var self = this\r\n var content = uri(self.encode(node.url || '', node))\r\n var exit = self.enterLink()\r\n var alt = self.encode(self.escape(node.alt || '', node))\r\n\r\n exit()\r\n\r\n if (node.title) {\r\n content += space + title(self.encode(node.title, node))\r\n }\r\n\r\n return (\r\n exclamationMark +\r\n leftSquareBracket +\r\n alt +\r\n rightSquareBracket +\r\n leftParenthesis +\r\n content +\r\n rightParenthesis\r\n )\r\n}", "title": "" }, { "docid": "a9ff4869b2904686246e868d8e5f1637", "score": "0.54194707", "text": "function replaceText(alternateEvt, originalTextEvt) {\n const antonym = alternateEvt.target.innerText;\n const wordEl = originalTextEvt.target;\n\n // Remove the highlight from the word\n wordEl.removeAttribute('class');\n\n // Replace the word\n wordEl.innerText = antonym;\n}", "title": "" }, { "docid": "702137183b295293f46513741ef4e9d4", "score": "0.54175174", "text": "createThumbnailAlt (project) {\n let thumbnailAlt = 'Project ' + project.id + ' - ' + project.title\n return thumbnailAlt\n }", "title": "" }, { "docid": "30aa29fadadbb2c05e3209f0e1602a49", "score": "0.5413379", "text": "function upDate(previewPic) {\n let div = document.getElementById('placeholder');\n div.style.backgroundImage = \"url('\" + previewPic.src + \"')\";\n document.getElementById('alt-text').innerHTML = previewPic.alt;\n}", "title": "" }, { "docid": "0626d56b6599e79419822a8ce60adfb0", "score": "0.54053515", "text": "function displayImage(img_name, img_caption) {\n\n\t// Find transformation value\n\tvar alt = document.getElementsByName(\"transformations\");\n\tvar cur_trans = alt[0].value;\n\n\t// Make image object, load it, and draw it\n\tvar temp_image = new Image();\n\ttemp_image.src = img_name;\n\ttemp_image.onload = function() {\n\t\tdraw(this, cur_trans);\n\t};\n\n\t// Grab output element that contains the caption\n\tvar output = document.getElementById(\"box\");\n\n\t// Set the caption\n\tvar caption = document.getElementById(\"caption\");\n\tcaption.innerHTML = img_caption;\n\n\t// Append the caption to the output\n\toutput.appendChild(caption);\n}", "title": "" }, { "docid": "8527ffceb77c9547f125f7f10164509a", "score": "0.5393203", "text": "function fillNumDigits(){\r\n\tvar imgs=document.getElementsByTagName('img');\r\n\tfor(i=0;i<imgs.length;i++){\r\n\t\tvar img=imgs[i];\r\n\t\tvar parent = img.parentNode;\r\n\t\tif(img.alt==img.title&&img.alt.indexOf(\".jpg\")!=-1){\r\n\t\t\tnumDigits=img.alt.length-4;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "570c9327ea037d987f1ab2700f84ec11", "score": "0.5390249", "text": "function setExampleImage() {\n if (TUTORIAL_PIC >= TUTORIAL_PICS.length) {\n printErr('Tried to show a non existing tutorial image (index out of array).');\n } else {\n // Set the image\n setImage(TUTORIAL_PICS[TUTORIAL_PIC]);\n // Set the respective examples\n setExampleMorales(TUTORIAL_EXAMPLES[TUTORIAL_PIC]);\n\n // Increase the tutorial pic counter and set the new image string (for posting).\n ++TUTORIAL_PIC;\n CURRENT_IMAGE = \"TUTORIAL_\" + TUTORIAL_PIC;\n }\n}", "title": "" }, { "docid": "f44a2f8763fae856cefd9aabce7f5c31", "score": "0.53779536", "text": "function image(node) {\n var self = this\n var content = uri(self.encode(node.url || '', node))\n var exit = self.enterLink()\n var alt = self.encode(self.escape(node.alt || '', node))\n\n exit()\n\n if (node.title) {\n content += space + title(self.encode(node.title, node))\n }\n\n return (\n exclamationMark +\n leftSquareBracket +\n alt +\n rightSquareBracket +\n leftParenthesis +\n content +\n rightParenthesis\n )\n}", "title": "" }, { "docid": "d2404e523dd714a173bfba17f360f6f6", "score": "0.53716373", "text": "function changePicture() {\n document.querySelectorAll('img')[1].src = './images/' + this.textContent + '.jpeg';\n }", "title": "" }, { "docid": "52d3bb7db7fd0ea03d1169fa3c589301", "score": "0.5370247", "text": "function replaceText(textBlock) { \n textBlock = textBlock.replace(/\\(monkey\\)/g, \t\t\"<img class='emoticon' title='(monkey)' src='\" + monkeySource + \"' />\"); // monkey- :(|)\n textBlock = textBlock.replace(/\\(pig\\)/g, \t\t\"<img class='emoticon' title='(pig)' src='\" + pigSource + \"' />\"); // pig- :(:)\n textBlock = textBlock.replace(/\\(smile\\)/g, \t\t\"<img class='emoticon' title='(smile)' src='\" + smileSource + \"' />\"); // smile- :)\n textBlock = textBlock.replace(/\\(wink\\)/g, \t\t\"<img class='emoticon' title='(wink)' src='\" + winkSource + \"' />\"); // wink- ;)\n textBlock = textBlock.replace(/\\(frown\\)/g, \t\t\"<img class='emoticon' title='(frown)' src='\" + frownSource + \"' />\"); // frown- :(\n textBlock = textBlock.replace(/\\(sad\\)/g, \t\t\"<img class='emoticon' title='(sad)' src='\" + frownSource + \"' />\"); // frown- :-(\n textBlock = textBlock.replace(/<3/g, \t\t\t\t\"<img class='emoticon' title='<3' src='\" + heartSource + \"' />\"); // heart-<3\n textBlock = textBlock.replace(/\\(mustache\\)/g, \t\"<img class='emoticon' title='(mustache)' src='\" + mustacheSource + \"' />\"); // mustache- :{\n textBlock = textBlock.replace(/:o/gi, \t\t\t\"<img class='emoticon' title=':o' src='\" + shockedSource + \"' />\"); // shocked- :o\n textBlock = textBlock.replace(/\\(grin\\)/g, \t\t\"<img class='emoticon' title='(grin)' src='\" + grinSource + \"' />\"); // grin- :D\n textBlock = textBlock.replace(/\\(angry\\)/g, \t\t\"<img class='emoticon' title='(angry)' src='\" + angrySource + \"' />\"); // angry- x-(\n textBlock = textBlock.replace(/\\(cool\\)/g, \t\t\"<img class='emoticon' title='(cool)' src='\" + coolSource + \"' />\"); // cool- B-)\n textBlock = textBlock.replace(/\\(cry\\)/g, \t\t\"<img class='emoticon' title='(cry)'' src='\" + crySource + \"'' />\"); // cry- :'(\n textBlock = textBlock.replace(/:\\|/g, \t\t\t\"<img class='emoticon' title=':|' src='\" + straightfaceSource + \"' />\"); // straightface- :|\n textBlock = textBlock.replace(/:\\//g, \t\t\t\"<img class='emoticon' title=':/' src='\" + slantSource + \"' />\"); // slant- :-/\n textBlock = textBlock.replace(/=\\//g, \t\t\t\"<img class='emoticon' title='=/' src='\" + slantSource + \"' />\"); // slant- =/\n textBlock = textBlock.replace(/:P/gi, \t\t\t\"<img class='emoticon' title=':P' src='\" + tongueSource + \"' />\"); // tongue- :P or :p\n textBlock = textBlock.replace(/=P/gi, \t\t\t\"<img class='emoticon' title='=P' src='\" + tongueSource + \"' />\"); // tongue- =P\n textBlock = textBlock.replace(/:-P/gi, \t\t\t\"<img class='emoticon' title=':-P' src='\" + tongueSource + \"' />\"); // tongue- :-P or :-p\n textBlock = textBlock.replace(/\\(crab\\)/g, \t\t\"<img class='emoticon' title='(crab)' src='\" + crabSource + \"' />\"); // crab- V.v.V or VvV (tl snippets remove periods) \n textBlock = textBlock.replace(/>.</g, \t\t\t\"<img class='emoticon' title='>.<' src='\" + winceSource + \"' />\"); // wince- >.<\n textBlock = textBlock.replace(/:-x/gi, \t\t\t\"<img class='emoticon' title=':-x' src='\" + kissSource + \"' />\"); // kiss- :-x\n textBlock = textBlock.replace(/:\\*/g, \t\t\t\"<img class='emoticon' title=':*' src='\" + kissSource + \"' />\"); // kiss- :*\n return textBlock;\n}", "title": "" }, { "docid": "7a1df8db38b0e1dcbeef000f56585106", "score": "0.5359608", "text": "function addImg() {\n if (this.getAttribute('data-card') == \"king\") {\n this.innerHTML = \"<img src='king.png' alt='King' />\"}\n else {\n this.innerHTML = \"<img src='queen.png' alt='queen' />\"}\n }", "title": "" }, { "docid": "ee885c903247f925c829191e0ea3a537", "score": "0.5347242", "text": "function update_code(){\n var temp=$('#page_preview').html().replace(/src=(.*?)dummy_template_image.png/g,'src=\"dnd_image');\n $('#page_text').val(temp);\n}", "title": "" }, { "docid": "5889ffae867ab8b643e7081fa201f192", "score": "0.53382796", "text": "function setContactImage(name, title, img) {\n $('#contact-extended .person .names').text(name);\n $('#contact-extended .person .title').text(title);\n $('#contact-extended .person .image img').attr('src', './public/images/persons/' + img + '.png');\n}", "title": "" }, { "docid": "6f23f1651ad7b77bdaa67a865dfdfdd3", "score": "0.53363574", "text": "function changeHtmlImageElement(img) {\n\t\t\n\t\trunSimulationOnImage(img.src, function(dataUrl) {\n\t\t\t\t\t\t\t\timg.src = dataUrl;\n\t\t\t\t\t\t\t});\n\t}", "title": "" }, { "docid": "8ee44d455f9b4e57cd1b0c8f682ec034", "score": "0.53362465", "text": "function img_change_file(img, new_name, new_ext=null) {\n var old_name = $(img).prop(\"src\").split(\"/\").pop();\n var old_ext = \".\" + old_name.split(\".\").pop();\n var new_src = $(img).prop(\"src\").replace(old_name, new_name + (new_ext ? new_ext : old_ext));\n\n $(img).prop(\"src\", new_src);\n}", "title": "" }, { "docid": "fd7198a81cfc4d9a23fe66ae47185550", "score": "0.53290087", "text": "function replaceImage(text) {\n\n\tvar searchFor = /:D|:-D|:\\)|:-\\)|;\\)|';-\\)|:\\(|:-\\(|:o|:\\?|8-\\)|:x|:X|:P|:p|:q|:8|8\\)|:lol:|:shock:|:red:|:cry:|:evil:|:twisted:|:roll:|:wink:|:!:|:idea:|:arrow:/gi;\n\n\tvar map = {\n\t\t\":D\" : 'icon_biggrin.gif',\n\t\t\":d\" : 'icon_e_biggrin.gif',\n\t\t\":-D\" : 'icon_e_biggrin.gif',\n\t\t\":-d\" : 'icon_e_biggrin.gif',\n\t\t\":)\" : 'icon_smile.gif',\n\t\t\":-)\" : 'icon_e_smile.gif',\n\t\t\":(\" : 'icon_sad.gif',\n\t\t\":-(\" : 'icon_e_sad.gif',\n\t\t\":O\" : 'icon_surprised.gif',\n\t\t\":o\" : 'icon_surprised.gif',\n\t\t\";)\" : 'icon_e_wink.gif',\n\t\t\":wink:\" : 'icon_wink.gif',\n\t\t\"';-)\" : 'icon_e_wink.gif',\n\t\t\":shock:\" : 'icon_eek.gif',\n\n\t\t\":?\" : 'icon_confused.gif',\n\t\t\":8\" : 'icon_cool.gif',\n\t\t\"8)\" : 'icon_cool.gif',\n\t\t\":lol:\" : 'icon_lol.gif',\n\t\t\":X\" : 'icon_mad.gif',\n\t\t\":x\" : 'icon_mad.gif',\n\t\t\":P\" : 'icon_razz.gif',\n\t\t\":p\" : 'icon_razz.gif',\n\n\t\t\":red:\" : 'icon_redface.gif',\n\t\t\":cry:\" : 'icon_cry.gif',\n\t\t\":evil:\" : 'icon_evil.gif',\n\t\t\":twisted:\" : 'icon_twisted.gif',\n\t\t\":roll:\" : 'icon_rolleyes.gif',\n\t\t\":!:\" : 'icon_exclaim.gif',\n\t\t\":q\" : 'icon_question.gif',\n\t\t\":idea:\" : 'icon_idea.gif',\n\t\t\":arrow:\" : 'icon_arrow.gif'\n\t};\n\n\ttext = text.replace(searchFor, function(match) {\n\t\tvar rep;\n\t\trep = map[match];\n\t\tvar url = site_url; // defined in the layout file\n\t\tvar url_new = url + \"/img/smiley/\";\n\t\treturn rep ? '<img src=\"' + url_new + rep + '\" class=\"emoticons\" />' : match;\n\t});\n\treturn text;\n\n}", "title": "" }, { "docid": "1bac5d863287a98ef88e0b1b0371162b", "score": "0.53253347", "text": "function updateMainImage(index) {\n imageMain.src = thumbnails[index].src.replace('150/100', '1000/400'); //Replaces large image with whichever thumbnail was clicked\n captionElement.textContent = thumbnails[index].dataset.caption;\n imageMain.alt = thumbnails[index].dataset.caption;\n imageMain.title = thumbnails[index].dataset.caption;\n }", "title": "" }, { "docid": "b556bf8e0c628b7519018fa4bf015fbc", "score": "0.5322237", "text": "function imagen_sexo(sexo) {\n var etiqueta_imagen='<img alt=\"'+sexo+'\"'+ ' src=\"images/'+ \n sexo +'.png\"/>';\n return etiqueta_imagen;\n}", "title": "" }, { "docid": "c289c78a46480e40c2614e69cabbe390", "score": "0.5319214", "text": "function showGreyImage()\r\n{\r\n\tthis.src = PHOTO_PAGE_ADD_LINK_BUTTON_IMAGES.GREY;\r\n}", "title": "" }, { "docid": "6a7d1691eb86261a4d6fe31b534b3658", "score": "0.531893", "text": "function iconToText(icon, remove){\n\tvar title = $(icon).attr('title') || $(icon).children().attr('alt');\n\t//return text; if true remove img\n\tif(!remove) {\n\t\treturn $(icon).html(title);\n\t} else {\n\t\tvar img = $('img', icon);\n\t\treturn $(icon).empty().append(img, title);\n\t}\n}", "title": "" }, { "docid": "558aa35e2c07ee2012d7de9d9cf5e0e0", "score": "0.53182083", "text": "function wrongAnswer () {\n clearQandA();\n $(\"#question\").html(\"<img src='assets/img/wrong.jpg'/>\")\n }", "title": "" }, { "docid": "5373caa32971a2bf5f7ddada9a64f172", "score": "0.53081954", "text": "function enlargen(count) {\n var modal = document.getElementById(\"myModal\");\n var modalImg = document.getElementById(\"img01\");\n var captionText = document.getElementById(\"caption\");\n var targetImage = document.getElementById(\"img\" + count)\n var targetCaption = document.getElementById(\"caption\" + count)\n modal.style.display = \"block\";\n modalImg.src = targetImage.src;\n captionText.innerHTML = targetCaption.innerHTML;\n}", "title": "" }, { "docid": "4d234508d92cf873b1f58df9f77c4500", "score": "0.5306106", "text": "function iconBoxToggle(objImg, show) {\n\n\tvar src = $(objImg).attr('src');\n\n\tif (show) {\n\t\t$(objImg).attr('src',src.replace('gray_18','color_18'));\n\t} else {\n\t\t$(objImg).attr('src',src.replace('color_18','gray_18'));\n\t}\n\n}", "title": "" }, { "docid": "de48603299919e38f19d8f446b7b4adb", "score": "0.53048825", "text": "function getImage() {\n\tdocument.getElementById(\"afbeelding\").style.display = \"block\";\n\tdocument.getElementById(\"afbeelding\").src = \"javascriptBestanden/\" + this.dataset.foto + \".jpg\";\n\tdocument.getElementById(\"afbeelding\").title = this.dataset.plaats;\n}", "title": "" }, { "docid": "32b9b1fa087a3a1fc4dcd9f3f377be6e", "score": "0.53040546", "text": "function imgOver(groupName)\r\n {\r\n \tif (document.images)\r\n \t{\r\n \t\tdocument[groupName+\"_text\"].src = eval(groupName + \"_text_over.src\");\r\n \t\tdocument[groupName+\"_button\"].src = eval(groupName + \"_button_over.src\");\r\n \r\n \t}\r\n }", "title": "" }, { "docid": "1ec7cac65d4ea9f1184a8c0caf3a27a2", "score": "0.52974796", "text": "function enhance(image) {\n document.getElementById('memoImage').src = image.src;\n document.getElementById('story').textContent = 'My experience:\\r\\n' + image.nextElementSibling.textContent;\n}", "title": "" }, { "docid": "eca730add2ae798714e0608d4e5ee0e3", "score": "0.5276725", "text": "function updateImageTexts() {\r\n current_image = 0;\r\n data = {}\r\n for (const img of img_section.getElementsByTagName('IMG')) {\r\n current_image += 1;\r\n data[img.getAttribute('data-id')] = img.src;\r\n }\r\n text_input.value = JSON.stringify(data);\r\n}", "title": "" }, { "docid": "418ceeaec73d7153488e78b0085a0ee2", "score": "0.5273198", "text": "function showPicture(whichPicture) {\n var placeholder = document.getElementById('placeholder');\n if (!placeholder) {\n return false\n }\n if (placeholder.nodeName != \"IMG\") {\n return false\n }\n\n var source = whichPicture.getAttribute('href');\n placeholder.setAttribute('src', source);\n\n var description = document.getElementById('description');\n if (description) {\n var text = whichPicture.getAttribute('title') ? whichPicture.getAttribute('title') : \"\";\n var firstChildNode = description.firstChild;\n if (firstChildNode.nodeType == 3) {\n firstChildNode.nodeValue = text;\n }\n }\n return true;\n}", "title": "" } ]
ff95042c1a613712ebee3c88906d68f0
var babelify = require('babelify');
[ { "docid": "18827dd57bea398c6964b50ed03d1052", "score": "0.0", "text": "function errorHandler (err) {\n util.log(util.colors.red('Error'), err.message);\n this.end();\n}", "title": "" } ]
[ { "docid": "1d02c38b63d7add98a077c021665f449", "score": "0.7269151", "text": "function babelifyTransform() {\n var presets = SCRIPT_OPTS.babelify.presets;\n // Attempt to install presets\n presets.forEach((preset) => {\n Dependencies.requireInstall(`babel-preset-${preset}`)\n });\n return babelify.configure({\n presets: presets\n });\n}", "title": "" }, { "docid": "e8bee7562914eec51a82818fc97c4b7c", "score": "0.70466495", "text": "function babel() {\n return gulp.src(\"src/**/*\")\n .pipe(gulpBabel())\n .pipe(gulp.dest(\"./\"));\n}", "title": "" }, { "docid": "0c6f009891368ad2071178d920e171bb", "score": "0.6702185", "text": "function babel(args, BABEL_ENV) {\n const p = require.resolve('.bin/babel');\n return execute(`BABEL_ENV=${BABEL_ENV} babel ${args.join(' ')}`, p, args, {env: {BABEL_ENV}});\n}", "title": "" }, { "docid": "76a1a94c5d4b1cc5d5455669053086f5", "score": "0.6502574", "text": "function bundle() {\n return b\n .add(es6ify.runtime)\n .transform(es6ify.configure(/^(?!.*node_modules)+.+\\.js$/))\n //.transform(browserifyES6Transpiler)\n\n .require(require.resolve(paths.browserifyEntry), {entry: true})\n\n //try to transform all files except node modules from es6 to es5\n //\n .bundle()\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n\n //output file name\n .pipe(source(paths.bundleName))\n //show the file names\n .pipe(debug())\n //.pipe(buffer())\n //output file location\n .pipe(gulp.dest(paths.bundleFolder));\n\n}", "title": "" }, { "docid": "38b00cb9a85cbb27f2522586b6bb01cb", "score": "0.6433164", "text": "function Babelify(filename, babelConfig) {\n\tstream.Transform.call(this);\n\tthis._data = '';\n\tthis._filename = filename;\n\tthis._babelConfig = babelConfig;\n}", "title": "" }, { "docid": "4fe45f2c3dc10ccf736bc292bb582366", "score": "0.6072072", "text": "function jsBabel() {\n return src(files.jsPath + '!(vendors)*.js')\n .pipe(babel({\n presets: ['@babel/preset-env']\n }))\n .pipe(dest(files.jsPath))\n}", "title": "" }, { "docid": "b6f02980d47021f6d2ad66862e6cfc78", "score": "0.6004489", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n //.pipe(source('app.js'))\n .pipe(source('main.jsx')) // Set source name\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n .pipe(rename('app.js'))\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./js/'));\n}", "title": "" }, { "docid": "c9697ea5bf2ef82a6c37cabb68960dac", "score": "0.5756381", "text": "async function jsBundle() {\n // See manual for using browserify with gulp/transforms:\n // https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-transforms.md\n\n var b = browserify({\n entries: config.js.bundle.entries,\n debug: true,\n transform: [\n [\"babelify\", {\"presets\":[\"@babel/preset-env\"]}]\n ]\n });\n\n if (config.js.commons.modules && config.js.commons.modules.length) {\n b.external(config.js.commons.modules);\n }\n\n b\n .bundle()\n .pipe(source(\"bundle.js\"))\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n .pipe(uglify())\n .on('error', gutil.log)\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(config.js.dest));\n return\n }", "title": "" }, { "docid": "9771f4c4e0043b070d6a59b9786bc19d", "score": "0.5721323", "text": "function bfy(entry, done) {\n var data = ''\n var b = browserify();\n if (entry.slice(0, 2) !== './') {\n entry = './node_modules/' + entry\n }\n b.add(path.join(cwd, entry))\n var bundle = b.bundle()\n bundle.on('data', function(buf) { data += buf })\n bundle.on('close', function() { done(null, data) })\n}", "title": "" }, { "docid": "6c3f65e876d0e639712d592c01b8ede0", "score": "0.5709682", "text": "function compileBabel(gulp, plugins, defaults) {\n return () => {\n return gulp.src(`${defaults.paths.source}/**/*.js`)\n .pipe(plugins.changed(defaults.paths.target))\n .pipe(plugins.sourcemaps.init())\n .pipe(plugins.babel({\n presets: [ 'es2015', 'react', 'stage-0', 'stage-1', 'stage-2', 'stage-3' ]\n }))\n .pipe(plugins.sourcemaps.write())\n .pipe(plugins.size())\n .pipe(gulp.dest(defaults.paths.target));\n };\n}", "title": "" }, { "docid": "fc3096cab4e53c7c67e6377671b4ff38", "score": "0.5697955", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./js/dist'));\n}", "title": "" }, { "docid": "87465ce0ca1238dfc342d9681da553c2", "score": "0.56947374", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./js/build'));\n}", "title": "" }, { "docid": "055ada5a015c291450e061e5d12c0036", "score": "0.56663454", "text": "function jsTranspile() {\n\treturn rollup\n\t\t.rollup({\n\t\t\tinput: config.script.main,\n\t\t\tplugins: [\n\t\t\t\tnodeResolve(),\n\t\t\t\tbabel({\n\t\t\t\t\tpresets: [[\"@babel/env\", { modules: false }]],\n\t\t\t\t\tsourceMaps: true,\n\t\t\t\t\tbabelHelpers: \"bundled\",\n\t\t\t\t\texclude: \"node_modules/**\",\n\t\t\t\t}),\n\t\t\t],\n\t\t})\n\t\t.then((bundle) => {\n\t\t\twriteFile(bundle, \"iife\", config.script.es5);\n\t\t});\n}", "title": "" }, { "docid": "6ff0a43ba4616c7e9c357354d5113fd1", "score": "0.5665323", "text": "function babelPostProc(data, nextFunc)\n{\n var babel=require(\"babel-core\");\n var babelOptions={\n //\"presets\": [\"es2015\"],\n \"plugins\": [\"transform-es3-property-literals\",\"transform-es3-member-expression-literals\"]\n }\n\n var res=babel.transform(data,babelOptions);\n console.log(\"Babel processing done. Patching...\"); \n return nextFunc(res.code); \n}", "title": "" }, { "docid": "268d0fe7685c5ae6c3b552ea315ed118", "score": "0.56514597", "text": "function browserifyTransforms() {\n // Loop over transform opts and require them into an array\n return SCRIPT_OPTS.browserify.transform.map((transformKey) => {\n if(transformKey === 'babelify') return babelifyTransform()\n return Dependencies.requireInstall(transformKey)\n });\n}", "title": "" }, { "docid": "f0d5f1ec67fdab96f4b9ddd9209d1898", "score": "0.565028", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source(customOpts.js.output))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n // .pipe(sourcemaps.init({loadMaps: false})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n // .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest(customOpts.outputDir));\n}", "title": "" }, { "docid": "8f3d4e561db30043c000f0395b03b562", "score": "0.5648605", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./dist'))\n}", "title": "" }, { "docid": "39307a966f70b6e781991a5d9541dcbd", "score": "0.56430703", "text": "function rebundle(){\n bundle\n .transform(babel) //transforma lo compilado a la versión más reciente de ECMASCRIPT(6)\n .bundle() //realiza la compilación \n .pipe(source('index.js')) //lo compilado se convierte en algo entendible para gulp\n .pipe(rename('app.js')) //se re nombra el resultado\n .pipe(gulp.dest('public')); //se destina a public\n }", "title": "" }, { "docid": "1504b4b1e1d8ea0c56b2ea80027cc971", "score": "0.5634115", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./dist'));\n}", "title": "" }, { "docid": "a20dcc82afbf4d4c47f5e206ed9a822e", "score": "0.5630969", "text": "moduleCode(ref, store) {\n return Promise.all([\n store.shouldShimModuleDefinition(ref),\n store.moduleContents(ref)\n ])\n .then(([shouldShimModuleDefinition, moduleContents]) => {\n if (!shouldShimModuleDefinition) {\n return moduleContents;\n }\n\n // We fake babel's ES => commonjs shim so that the hot runtime knows\n // that `module.exports` will never be a function and hence a proxy\n // object can be used\n return [\n 'Object.defineProperty(exports, \"__esModule\", {',\n ' value: true',\n '});',\n `exports[\"default\"] = ${moduleContents};`,\n 'if (module.hot) {',\n ' module.hot.accept();',\n '}'\n ].join('\\n');\n });\n }", "title": "" }, { "docid": "5c3b3acc0d911291e2448b3e99e1004f", "score": "0.5617724", "text": "function transpileJS(entryPoint, outputName, outputPath) {\n return function() {\n return browserify(entryPoint, { debug: true })\n .transform(babelify)\n .bundle()\n .on(\"error\", function (err) { console.log(\"Error : \" + err.message); })\n .pipe(source(outputName))\n //.pipe(buffer())\n //.pipe(uglify())\n .pipe(gulp.dest(outputPath));\n }\n}", "title": "" }, { "docid": "5aec0f90dbf9e8de898f1ac8a500ef94", "score": "0.5599566", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('app.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest(output.js));\n}", "title": "" }, { "docid": "d184e8d56031694fa602e8d305e277f1", "score": "0.5552057", "text": "function rebundle(){\n bundle\n //para utilizar las caracteristicas de emmascript\n //{presets: ['es2015'], plugins: ['syntax-async-function', 'transform-regenerator'] }para poder utilizar los present en la homepage\n //tambien es para incluir dentro de la libreria babel los plugin async y regenerator \n .transform(babel, { presets: ['es2015'], plugins: ['syntax-async-functions', 'transform-regenerator'] })\n //llama la funcion bundle de browserify genere el budle\n .bundle()\n //verificar errores \n .on('error', function(err){\n console.log(err);\n this.emit('end');\n })\n //transformar de browserify a Gulp para que gulp pueda seguir procesando este archivo\n .pipe(source('index.js'))\n .pipe(rename('app.js'))\n .pipe(gulp.dest('public'));\n }", "title": "" }, { "docid": "8e671737cb271261a1f0598f7a76a520", "score": "0.55225134", "text": "function bundle() {\n process.env.NODE_ENV = 'development';\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n //.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .on('error', gutil.log)\n //.pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./public/static/js'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "7baad21e774dd5508225bb18975a016a", "score": "0.5505929", "text": "function loadBabel() {\n //grunt.loadNpmTasks(\"load-grunt-tasks\");\n require(\"load-grunt-tasks\")(grunt);\n _.merge(config, {\n babel: {\n options: {\n sourceMap: true,\n },\n default: {\n files: {} // {\"source\":\"dest\"}\n }\n }\n });\n //set input/output for watch tasks. see https://github.com/gruntjs/grunt-contrib-watch\n grunt.event.on(\"watch\", function (action, filepath, watchTaskName) {\n var outPath = filepath + \".es5\";\n var fileMap = {};\n fileMap[outPath] = filepath;\n grunt.config(\"babel.default.files\", fileMap);\n });\n }", "title": "" }, { "docid": "f9c8f2f271c868d84c6e5c94f3960ccc", "score": "0.548474", "text": "function requireReactString(src, filename) {\n\t var babel = requires.babel || (requires.babel = require('babel-core'));\n\n\t if (!filename) filename = '';\n\t var m = new module.constructor();\n\t filename = filename || '';\n\n\t // Compile Using React\n\t var compiled = babel.transform(src, { presets: [ 'react' ] }).code;\n\n\t // Compile as a module\n\t m.paths = module.paths;\n\t m._compile(compiled, filename);\n\n\t return m.exports;\n\t}", "title": "" }, { "docid": "d2f9580268a49144924780f48582a3b0", "score": "0.54820067", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('app-bundle.js'))\n // optional, remove if you don't need to buffer file contents\n //.pipe(buffer())\n // optional, remove if you dont want sourcemaps\n //.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n //.pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('public/js/app/'));\n}", "title": "" }, { "docid": "b8080efd36531e4dd4824bf830f49041", "score": "0.54736966", "text": "function jsTask() {\n return src(files.jsPath)\n .pipe(sourcemaps.init())\n .pipe(babel())\n .pipe(concat('main.js'))\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest('pub/js'))\n .pipe(browserSync.stream()); \n}", "title": "" }, { "docid": "344e0c2039ba7467739ab8b35df5e16d", "score": "0.54437286", "text": "async function jsCommons() {\n // See manual for using browserify with gulp/transforms:\n // https://github.com/gulpjs/gulp/blob/master/docs/recipes/browserify-transforms.md\n\n var b = browserify({\n debug: true,\n transform: [babelify]\n });\n\n if (!(config.js.commons.modules && config.js.commons.modules.length)) {\n return;\n }\n\n b.require(config.js.commons.modules);\n\n b.bundle()\n .pipe(source(config.js.commons.filename))\n .pipe(buffer())\n .pipe(uglify())\n .on('error', gutil.log)\n .pipe(gulp.dest(config.js.dest));\n }", "title": "" }, { "docid": "bb93dbae01cb6abd5c61ec115e9fb888", "score": "0.54198223", "text": "function browserifyTask () {\n return gulp.src('main.js')\n .pipe(browserify(\n { transform: [ 'reactify' ] }\n ))\n .pipe(rename('main.js'))\n .pipe(gulp.dest('public/'))\n .pipe(uglify())\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest('public/'))\n}", "title": "" }, { "docid": "c8d6d3f73a9360d6a7d6cfd535b466f1", "score": "0.54124016", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }", "title": "" }, { "docid": "c8d6d3f73a9360d6a7d6cfd535b466f1", "score": "0.54124016", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }", "title": "" }, { "docid": "c8d6d3f73a9360d6a7d6cfd535b466f1", "score": "0.54124016", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }", "title": "" }, { "docid": "c8d6d3f73a9360d6a7d6cfd535b466f1", "score": "0.54124016", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }", "title": "" }, { "docid": "c8d6d3f73a9360d6a7d6cfd535b466f1", "score": "0.54124016", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }", "title": "" }, { "docid": "8c6904a46ea7631ce449ad8df07714a7", "score": "0.5397152", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // .pipe(jsmin())\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./dist'));\n}", "title": "" }, { "docid": "d70d59dcad1c14cd975f14004df43797", "score": "0.5380486", "text": "function js() {\n return browserify(['./dist/components/app.js'])\n .transform(babelify, {\n presets: [\"es2015\"]\n })\n .transform(ngAnnotate)\n .bundle()\n .pipe(source(\"app.js\"))\n .pipe(gulp.dest(\"./dist/scripts\"))\n .pipe(browserSync.reload({\n stream: true\n }));\n}", "title": "" }, { "docid": "aa81b89c12ce6cbe83248b47f614d726", "score": "0.5322577", "text": "function compile(source, filename) {\n let { code } = babel.transform(source, {\n filename,\n plugins: [\n GlimmerInlineTemplatesPlugin,\n 'transform-es2015-modules-commonjs'\n ]\n });\n\n return eval(`(function(exports) {${code}; return exports;})({})`);\n}", "title": "" }, { "docid": "81c7bc294a979e02468069deb1c76436", "score": "0.53151953", "text": "function bundle() {\n return bundler.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you dont want sourcemaps\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n .pipe(sourcemaps.write('./')) // writes .map file\n //\n .pipe(gulp.dest('./build/'));\n}", "title": "" }, { "docid": "200cecf883fb643c23424e5f956ea4cc", "score": "0.5303661", "text": "function bundle() {\n return bundler.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('index.js'))\n // optional, remove if you dont want sourcemaps\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n .pipe(sourcemaps.write('./')) // writes .map file\n //\n .pipe(gulp.dest('./public'));\n}", "title": "" }, { "docid": "fcb6f5184061a55f0343134be7c88079", "score": "0.52954525", "text": "function convert(source) {\n\t\tconst {code} = transform(source, { babelrc: false, ...converterOptions })\n\t\tconst {ast} = parseWithJSX(code)\n\t\treturn {code, ast}\n\t}", "title": "" }, { "docid": "0389af6e04f70e919da3d10329272c4a", "score": "0.5280504", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(uglify())\n .pipe(sourcemaps.write('.')) // writes .map file\n .pipe(gulp.dest('client/dist'));\n}", "title": "" }, { "docid": "655fe163585e972c3eac7f3f6ee9be64", "score": "0.5271379", "text": "function transpile(src, dest) {\n const sourcesHtmlSplitter = new polymer_build.HtmlSplitter();\n return gulp.src(src)\n .pipe(sourcesHtmlSplitter.split())\n .pipe(gulpif(/\\.js$/, babel({presets: [babel_preset_env.default()]})))\n .pipe(sourcesHtmlSplitter.rejoin())\n .pipe(gulp.dest(dest));\n}", "title": "" }, { "docid": "e7da5fd59d99439797980865437e2457", "score": "0.52668595", "text": "function js() {\n return gulp.src(path.src.js) \n\t\t.pipe(sourcemaps.init())\n .pipe(babel())\n\t\t.pipe(uglify())\n .pipe(sourcemaps.write())\n\t\t.pipe(gulp.dest(path.dist.js))\n\t\t.pipe(reload({stream: true}));\n}", "title": "" }, { "docid": "18b8fbc3a8fa402350489a36dfd4f810", "score": "0.52617735", "text": "function es6Task(){\n return src([\n files.jsPath\n ])\n .pipe(sourcemaps.init())\n .pipe(babel({\n presets: ['@babel/env']\n }))\n .pipe(concat('custom.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('dist'))\n}", "title": "" }, { "docid": "4d49be3aa42be214bfc54ba38830c74b", "score": "0.52438724", "text": "function browserifyBundler(entryPath) {\n return browserify({\n entries: entryPath,\n debug: true,\n transform: browserifyTransforms()\n });\n}", "title": "" }, { "docid": "bd66d5eb27c9ce33918579eeb62be107", "score": "0.52299744", "text": "function transpileES6Modules(browserifyFileEntries) {\n browserifyFileEntries.forEach(function(fileEntry) {\n var browserifyBundle = browserify({\n entries: [fileEntry.srcPath],\n })\n .transform(babelify);\n\n var finalStream = browserifyBundle.bundle()\n .on('log', function(e) {\n console.log(e);\n console.log(\"LOG\");\n })\n .on('error', function(e) {\n console.log(e);\n console.log(\"ERRR\");\n })\n .pipe(source(fileEntry.outputFilename));\n\n return finalStream.pipe(gulp.dest(fileEntry.dest));\n });\n}", "title": "" }, { "docid": "0be93bc145532386bf81250cdc0341cd", "score": "0.52295434", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n // .on('error', gulpUtil.log.bind(gulpUtil, 'Browserify Error'))\n .on('error', function(err) {\n gulpUtil.log(err.message);\n browserSync.notify(\"Browserify Error!\");\n this.emit(\"end\");\n })\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(uglify())\n .pipe(sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest('./dist'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "bceea9a1bc2ce37d09e39c6877ccabeb", "score": "0.5227141", "text": "function babelTranspilerForAsyncAwaitCode(System, babel, filename, env) {\n // The function wrapper is needed b/c we need toplevel awaits and babel\n // converts \"this\" => \"undefined\" for modules\n return function (source, options) {\n options = Object.assign({\n sourceMap: undefined, // 'inline' || true || false\n inputSourceMap: undefined,\n filename: filename,\n code: true,\n ast: false\n }, options);\n var sourceForBabel = \"(async function(__rec) {\\n\" + source + \"\\n}).call(this);\",\n transpiled = babel.transform(sourceForBabel, options).code;\n transpiled = transpiled.replace(/\\}\\)\\.call\\(undefined\\);$/, \"}).call(this)\");\n return transpiled;\n };\n}", "title": "" }, { "docid": "abc19697110fb8d0dad38b33d6737a71", "score": "0.5193048", "text": "function bundle() {\n return bundler.bundle()\n // Log errors\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n // Source stream into a file named \"bundle.js\".\n .pipe(source('bundle.js'))\n // Optional, remove if you don't need to buffer file contents.\n .pipe(buffer())\n // Optional, remove if you dont want sourcemaps.\n // Loads map from browserify file.\n .pipe(sourcemaps.init({loadMaps: true}))\n // Add transformation tasks to the pipeline here.\n\n // Writes .map file\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest('./dist'));\n}", "title": "" }, { "docid": "e130a42113eec0911f3afe9e600a1e53", "score": "0.5192807", "text": "function javascript() {\n return gulp.src('./src/js/*.js')\n .pipe(sourcemaps.init())\n .pipe(babel({\n presets: ['@babel/preset-env'],\n plugins: ['@babel/plugin-transform-arrow-functions']\n }))\n .pipe(concat('main.js'))\n .pipe(uglify())\n .pipe(sourcemaps.write(\".\"))\n .pipe(gulp.dest('./pub/js'))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "03fa0dfd84553525e1e27e3dfbe98ced", "score": "0.51842266", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "title": "" }, { "docid": "03fa0dfd84553525e1e27e3dfbe98ced", "score": "0.51842266", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "title": "" }, { "docid": "03fa0dfd84553525e1e27e3dfbe98ced", "score": "0.51842266", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "title": "" }, { "docid": "03fa0dfd84553525e1e27e3dfbe98ced", "score": "0.51842266", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "title": "" }, { "docid": "03fa0dfd84553525e1e27e3dfbe98ced", "score": "0.51842266", "text": "function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }", "title": "" }, { "docid": "a5e15f5dac7dce91d7f1bd8afb68098f", "score": "0.5184049", "text": "function bundle() {\n return bundler.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source(basename))\n .pipe(logger({before: 'bundling...'}))\n // optional, remove if you dont want sourcemaps\n .pipe(cond(opts.sourcemaps, buffer()))\n .pipe(cond(opts.sourcemaps, sourcemaps.init({loadMaps: true}))) // loads map from browserify file\n .pipe(cond(opts.sourcemaps, sourcemaps.write('./'))); // writes .map file\n //\n }", "title": "" }, { "docid": "53c6cc123b40fc5988ffa1d406cf9b11", "score": "0.5171092", "text": "function script() {\n return src('src/js/**/*.js')\n .pipe(babel({\n presets: ['@babel/preset-env']\n }))\n .pipe(dest('dist/js'))\n .pipe(browserSync.stream())\n}", "title": "" }, { "docid": "b0b9a5a72cac0310ab746a7563e95ac0", "score": "0.5171042", "text": "function snappyJS() {\n var browserifyConfig = _.cloneDeep(pluginsConf.browserify.config);\n\n var snappy = jsConf.snappy;\n browserifyConfig.entries = snappy.files.src;\n\n return browserify(browserifyConfig)\n .bundle()\n .pipe(source(snappy.files.destFile))\n .pipe(buffer())\n .pipe(gulp.dest(snappy.files.destDir));\n}", "title": "" }, { "docid": "d2d1849a7802691ac33544a8b93ec4b6", "score": "0.5121031", "text": "function runtime(){require(\"./runtime\");}", "title": "" }, { "docid": "0c8b163145b067dd3273d4d70295fead", "score": "0.51136225", "text": "function iffeify(module) {\n\treturn \"(function(){\\n\" + module + \"})();\\n\\n\";\n}", "title": "" }, { "docid": "4454f194a0a41a1c15be2fdea0f902b1", "score": "0.51126796", "text": "function compileScripts() {\n return gulp.src([\n 'app/assets/javascript/**/*.js',\n 'docs/assets/javascript/**/*.js'\n ])\n .pipe(babel())\n .pipe(gulp.dest('public/js'));\n}", "title": "" }, { "docid": "30456cd52c8c30d69dce6a339a4d5c83", "score": "0.51109815", "text": "function bundle(graph) {\n let modules = \"\";\n\n graph.forEach(({id, code, mapping}) => {\n modules += `${id}: [\n function(require, module, exports) {\n ${code} \n },\n ${JSON.stringify(mapping)},\n ],`\n });\n\n const result = `\n (function(modules){\n function require(id) {\n const [fn, mapping] = modules[id];\n \n function localRequire(name) {\n return require(mapping[name]);\n }\n \n const module = { exports: {} };\n \n fn(localRequire, module, module.exports);\n \n return module.exports;\n }\n \n require(0);\n \n })({${modules}})\n `;\n return result;\n}", "title": "" }, { "docid": "d212b4e5d99d4090899d945447e3e18c", "score": "0.5108666", "text": "function js (cb) {\n const exec = require('child_process').exec\n exec(\n 'parcel build src/js/*.js -d public/js/parcel --no-source-maps --no-minify',\n function (err, stdout, stderr) {\n console.log(stdout)\n console.log(stderr)\n cb(err)\n\n return gulp\n .src(['public/js/parcel/themes.js', 'public/js/parcel/main.js'])\n .pipe(concat('bundle.js'))\n .pipe(gulp.dest('public/js/parcel'))\n .pipe(terser({ format: { comments: false } }))\n .pipe(\n rename(path => {\n path.extname = '.min.js'\n })\n )\n .pipe(gulp.dest('public/js/parcel'))\n }\n )\n}", "title": "" }, { "docid": "ac005c87ade819b8ed195a57517a4f13", "score": "0.5103288", "text": "function transpile(src, stack) {\n var target = createTargetName(src);\n\n babel.transformFile(src, babelOptions, function (err, result) {\n if (err) { return console.log(err.codeFrame); }\n\n fse.outputFile(target, result.code, function(err) {\n if (err) { return console.error(err.message); }\n\n console.log(util.format(green + '=> \"%s\" successfully transpiled to \"%s\"' + NC, src, target));\n\n // next\n if (stack && stack.length) {\n transpile(stack.shift(), stack);\n }\n });\n });\n}", "title": "" }, { "docid": "cf2b65ee48bb62760ddace5afc858b94", "score": "0.50866514", "text": "function jsTasks() {\n return src(files.jsPath)\n .pipe(babel({\n presets: [\"@babel/preset-env\"]\n }))\n .pipe(concat('main.js'))\n .pipe(uglify())\n .pipe(dest('pub/js'));\n}", "title": "" }, { "docid": "5e638f99d21c3270be91593134813bf6", "score": "0.5086633", "text": "function scriptify() {\n return scripts.bundle()\n // log errors if they happen\n .on('error', cons.$.util.log.bind(cons.$.util, 'Browserify Error'))\n .pipe(source('bundle.js'))\n // optional, remove if you don't need to buffer file contents\n .pipe(buffer())\n // optional, remove if you dont want sourcemaps\n .pipe(cons.$.sourcemaps.init({loadMaps: true})) // loads map from browserify file\n // Add transformation tasks to the pipeline here.\n .pipe(cons.$.concat('scripts.js'))\n .pipe(gulp.dest(`${cons.tmp}/scripts`))\n .pipe(cons.$.rename(function (path) {\n path.basename += \".min\";\n path.extname = \".js\"\n }))\n .pipe(cons.$.uglify({preserveComments: 'some'}))\n .pipe(cons.$.sourcemaps.write('./')) // writes .map file\n .pipe(gulp.dest(`${cons.tmp}/scripts`))\n .pipe(cons.reload({stream: true}));\n}", "title": "" }, { "docid": "536a4886d7957e0e01665d6dadbe611e", "score": "0.5070991", "text": "function compileReact() {\n var g = gulp.src('./src/react/index.coffee', { read: false })\n .pipe(browserify({ transform: ['coffeeify'], extensions: ['.coffee'] }))\n .pipe(concat('app2.js'));\n if (prod) {\n g.pipe($.uglify().on('error', function(e) { console.log(e); }));\n }\n return g.pipe(gulp.dest('dist/js'));\n}", "title": "" }, { "docid": "390e733ee45e9df15d5339b424647602", "score": "0.50492746", "text": "function js() {\n return src(['src/js/resources.js', 'src/js/app.js', 'src/js/engine.js'])\n .pipe(concat('main.js'))\n .pipe(babel({\n presets: [\n ['@babel/preset-env', {\n modules: false}]\n ]}))\n .pipe(uglify())\n .pipe(dest('dist/js'));\n}", "title": "" }, { "docid": "b53adfbcd6d038d0d6d62ceeb039692c", "score": "0.5047465", "text": "function bundle() {\n\treturn b.bundle()\n\t\t// log errors if they happen\n\t\t.on('error', log.error.bind(log, 'Browserify Error'))\n\t\t.pipe(source('bundle.js'))\n\n\t\t.pipe(gulp.dest('./stageTwo/js/dist/'));\n}", "title": "" }, { "docid": "783a40bbdb08a27004d6b6c254ff7789", "score": "0.5044928", "text": "function buildBabelOptions(script) {\n\t\t return {\n\t\t presets: script.presets || ['react', 'es2015'],\n\t\t plugins: script.plugins || ['transform-class-properties', 'transform-object-rest-spread', 'transform-flow-strip-types'],\n\t\t sourceMaps: 'inline'\n\t\t };\n\t\t}", "title": "" }, { "docid": "4ce69a7938de556f2941baa570aaceac", "score": "0.50293094", "text": "function bundle() {\n var src = './' + pkg.main;\n var target = getUmdName();\n var b = browserify(src, browserifyOptions);\n\n try {\n b.bundle().pipe(fse.createWriteStream(target));\n // is not called at the right place - streams are async\n console.log(util.format(green + '=> \"%s\" successfully created' + NC, target));\n } catch(e) {\n return console.log(err.message);\n }\n\n}", "title": "" }, { "docid": "dc09db39462bed25664564c8aeec176d", "score": "0.5025908", "text": "setBabelWithTsHarmony() {\n const EXTENSIONS_BASE_FOLDER = 'multiple-compilers-env';\n this.fixtures.copyFixtureExtensions(EXTENSIONS_BASE_FOLDER);\n this.command.addComponent(EXTENSIONS_BASE_FOLDER);\n this.extensions.addExtensionToVariant(EXTENSIONS_BASE_FOLDER, 'teambit.harmony/aspect');\n this.command.link();\n this.extensions.addExtensionToVariant(EXTENSIONS_BASE_FOLDER, 'teambit.dependencies/dependency-resolver', {\n policy: {\n dependencies: {\n '@babel/runtime': '^7.8.4',\n '@babel/core': '7.11.6',\n '@babel/preset-env': '7.11.5',\n '@babel/preset-typescript': '7.10.4',\n '@babel/plugin-proposal-class-properties': '7.10.4'\n }\n }\n });\n this.command.install();\n this.command.compile();\n return EXTENSIONS_BASE_FOLDER;\n }", "title": "" }, { "docid": "9d8ef5f5accce0e1cca4819b5466e436", "score": "0.50204873", "text": "function bundle() {\n return b.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(buffer())\n //.pipe(uglify())\n .pipe(gulp.dest('src/' + project + '/statics/js/'))\n .pipe(browserSync.reload({\n stream: true\n }));\n}", "title": "" }, { "docid": "4a5949b8a035a6757c8e587a831313e6", "score": "0.5015772", "text": "import() {}", "title": "" }, { "docid": "8e9a126360d08f91d73aa691b52e3cec", "score": "0.50149226", "text": "function packageReact() {\n\n\n return through.obj(function (file, enc, cb) {\n\n if (file.isNull()) {\n console.log(\"FILE IS NULL\");\n cb(null, file);\n return;\n }\n\n if (file.isStream()) {\n cb(new gutil.PluginError('package-react', 'Streaming not supported'));\n return;\n }\n\n try {\n\n var res = file.contents.toString();\n\n var array = res.split(\"\\n\");\n var newarr = [];\n var cnt = 0;\n for ( var i=0; i < array.length; i++ ) {\n if ( array[i].indexOf('require') === -1 && array[i].indexOf('strict') === -1 && array[i].indexOf('import') === -1 ) {\n newarr[cnt] = array[i];\n cnt++;\n }\n }\n\n var newfile = newarr.join(\"\\n\");\n\n file.contents = new Buffer(newfile);\n this.push(file);\n\n } catch (err) {\n this.emit('error', new gutil.PluginError('package-react', err, {\n fileName: file.path\n }));\n }\n cb();\n });\n\n}", "title": "" }, { "docid": "a597761382337bc83816a5fb8836c3f4", "score": "0.5007635", "text": "function requireReact(module, filename) {\n\n var ReactTools = require('react-tools');\n\n var content = fs.readFileSync(filename, 'utf8');\n var compiled = ReactTools.transform(content, {harmony: true});\n\n return module._compile(compiled, filename);\n}", "title": "" }, { "docid": "11c3871811498f9be6f18c991f2ae815", "score": "0.5004246", "text": "function bundle(file_name, bundle_name, dest) {\n\n var bundler = browserify(file_name, {\n standalone: bundle_name, debug: true, transform: [['babelify', {\"presets\": [\"es2015\"], \"plugins\": [\"transform-object-assign\"]}]]});\n\n function rebundle() {\n return bundler.bundle()\n .on('error', function(err) {\n console.error(err);\n this.emit('end');\n })\n .pipe(source(bundle_name + '.js'))\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n // .pipe(uglify())\n .pipe(sourcemaps.write('./'))\n .pipe(replace('{{version}}', pkg.version))\n .pipe(gulp.dest(dest));\n }\n\n return rebundle();\n\n}", "title": "" }, { "docid": "0a83a4ec6896980b514157619934d6f8", "score": "0.50039965", "text": "function requireBabelPlugin(packageName) {\n return require.resolve(packageName);\n}", "title": "" }, { "docid": "e3d709f2d1e65980c7c2e822b911f3cd", "score": "0.5002996", "text": "function loadLibsFn () {\n LineReader = require( 'line-by-line' );\n applyPatchFn = require( 'apply-patch' ).applyPatch;\n flowObj = require( 'flow' );\n psObj = require( 'ps-node' );\n shellJsObj = require( 'shelljs' );\n uglifyCssObj = require( 'uglifycss' );\n uglifyJsObj = require( 'uglify-js' );\n}", "title": "" }, { "docid": "603fac1f6c93c936f4c697b51bc9387a", "score": "0.4994927", "text": "function javascript() {\n return src(paths.js)\n .pipe(sourcemaps.init())\n .pipe(concat('bundle.js'))\n // codigo optimizado para producción\n .pipe(terser())\n .pipe(sourcemaps.write('.'))\n .pipe(rename({suffix: '.min'}))\n .pipe(dest('./build/js'));\n}", "title": "" }, { "docid": "c332e7106d2dde01e06539ecc1da7bfd", "score": "0.49923977", "text": "function $require() {}", "title": "" }, { "docid": "80799114fa9ca82f4d1c38ed0b1d6362", "score": "0.49217483", "text": "function javascriptMinificationTask() {\r\n return gulp\r\n .src(constant.SRC_JS_PATH + \"/**/*.js\")\r\n .pipe(plumber())\r\n .pipe(babel({\r\n presets: [\r\n ['@babel/env', {\r\n modules: false\r\n }]\r\n ]\r\n }))\r\n .pipe(concat(\"app.min.js\"))\r\n .pipe(uglify())\r\n .pipe(gulp.dest(constant.BUILD_JS_PATH));\r\n}", "title": "" }, { "docid": "e89a20ba1e4876082eb68cb94f2b54e7", "score": "0.49064478", "text": "function compileReact() {\n log.info('Compiling jsx files');\n log.info('There is a delay of around 1 second after the bytes is written where the browser will continue to use the old react code');\n log.info('Check the comments on gulpfile.js');\n return watch.bundle()\n .on('error', log.error.bind(log, 'Browserify Error')) // log errors if they happen\n .pipe(source(dest.react.file)) //compile the jsx into a single file\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n .pipe(sourcemaps.write('./')) //create mappings at piped dir\n .pipe(gulp.dest(dest.react.dir));\n}", "title": "" }, { "docid": "2737e48ca53096b91d37509854c1eb7e", "score": "0.49060345", "text": "function jsonify( buffer ) {\n return eval( \"(\" + buffer + \")\" );\n}", "title": "" }, { "docid": "5ef5a577e7703f5e88af40b2b58f7c33", "score": "0.49044722", "text": "function buildBabelOptions(script) {\n\t return {\n\t presets: script.presets || ['react', 'es2015'],\n\t plugins: script.plugins || ['transform-class-properties', 'transform-object-rest-spread', 'transform-flow-strip-types'],\n\t sourceMaps: 'inline'\n\t };\n\t}", "title": "" }, { "docid": "0f51c3b4481911b6c414e6ff5edfc984", "score": "0.4892711", "text": "function transformCode(transformFn, code, url) {\n\t\t var source = void 0;\n\t\t if (url != null) {\n\t\t source = url;\n\t\t } else {\n\t\t source = 'Inline Babel script';\n\t\t inlineScriptCount++;\n\t\t if (inlineScriptCount > 1) {\n\t\t source += ' (' + inlineScriptCount + ')';\n\t\t }\n\t\t }\n\t\n\t\t return transformFn(code, _extends({\n\t\t filename: source\n\t\t }, babelOpts)).code;\n\t\t}", "title": "" }, { "docid": "11d7fb42905649856acb235b039b2e65", "score": "0.488424", "text": "function copyBabelPolyfill() {\n const babelPolyfill = 'node_modules/babel-polyfill/dist/polyfill.min.js';\n runCommand(`cp -v ${babelPolyfill} ${DEST_WWW}/babel-polyfill.min.js`, {}, function() {\n gutil.log(`Copied Babel polyfill.`);\n });\n}", "title": "" }, { "docid": "2efe0037096ecad89a493d3241ddf47d", "score": "0.4880307", "text": "function transformCode(transformFn, script) {\n\t\t var source = void 0;\n\t\t if (script.url != null) {\n\t\t source = script.url;\n\t\t } else {\n\t\t source = 'Inline Babel script';\n\t\t inlineScriptCount++;\n\t\t if (inlineScriptCount > 1) {\n\t\t source += ' (' + inlineScriptCount + ')';\n\t\t }\n\t\t }\n\t\n\t\t return transformFn(script.content, _extends({\n\t\t filename: source\n\t\t }, buildBabelOptions(script))).code;\n\t\t}", "title": "" }, { "docid": "195486db9d4fdbe79e3070c1a6a66ab4", "score": "0.48691615", "text": "function install(obj) {\n\t obj.Buffer = Buffer;\n\t obj.process = process;\n\t var oldRequire = obj.require ? obj.require : null;\n\t // Monkey-patch require for Node-style code.\n\t obj.require = function (arg) {\n\t var rv = BFSRequire(arg);\n\t if (!rv) {\n\t return oldRequire.apply(null, Array.prototype.slice.call(arguments, 0));\n\t }\n\t else {\n\t return rv;\n\t }\n\t };\n\t}", "title": "" }, { "docid": "fbb20c2f154016cf7f320c6f1e874d52", "score": "0.48668215", "text": "function exports() {}", "title": "" }, { "docid": "810239b0f7a23671e0fcce17c97fb26b", "score": "0.4864136", "text": "function _client_compile_task(file) {\n \n var infile = 'js/' +file;\n \n var b = browserify(infile);\n return b\n // not in npm, don't need in browser\n\t.exclude('ringo/httpclient')\n\t.bundle()\n // desired output filename to vinyl-source-stream\n\t.pipe(source(file))\n\t.pipe(gulp.dest('public'));\n}", "title": "" }, { "docid": "9676e8d098d52436a59803b3df0077fb", "score": "0.48621106", "text": "function compile(watch) {\n var plugin = [];\n if (watch) {\n plugin = [[watchify, {ignoreWatch: ['**/node_modules/**']}]]\n }\n var bundler = browserify({\n entries: \"./src/index.jsx\",\n debug: true,\n cache: {},\n packageCache: {},\n plugin: plugin,\n transform: [[\"eslintify\"], [\"babelify\", {\"presets\": [\"es2015\", \"react\", \"stage-2\"]}]]\n });\n\n function rebundle() {\n console.log('-> bundling...');\n return bundler.bundle()\n .on('error', function (err) {\n console.error(err);\n })\n .pipe(vinylSourceStream('build.js'))\n .pipe(vinylBuffer())\n .pipe(gulpSourcemaps.init({loadMaps: true}))\n .pipe(gulpSourcemaps.write('./'))\n .pipe(gulp.dest('./build'));\n }\n\n if (watch) {\n bundler.on('update', function () {\n rebundle();\n });\n bundler.on(\"time\", function (time) {\n console.log(\" bundling done in \" + time + \"ms\");\n });\n }\n return rebundle();\n}", "title": "" }, { "docid": "6ced9c7ef41bc3f77e93c1f41fff74be", "score": "0.48602787", "text": "function exports() { }", "title": "" }, { "docid": "9014c530922b84669de67d86b34e2bdc", "score": "0.48493597", "text": "function js() {\n return browserify({entries: [scriptSRC]})\n .transform( babelify, {presets: ['env']} )\n .bundle()\n .pipe( source( scriptSRC ) )\n .pipe( rename({ extname: '.min.js' }) )\n .pipe( buffer() )\n .pipe( sourcemaps.init({ loadMaps: true }) )\n .pipe( uglify() )\n .pipe( sourcemaps.write( './' ) )\n .pipe( gulp.dest( scriptDIST ) )\n .pipe( browserSync.stream() );\n}", "title": "" }, { "docid": "09e2b97514d130151f1b205276e857d2", "score": "0.48464075", "text": "function bundle() {\n gutil.log('Compiling scripts ...');\n return b.bundle()\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n .pipe($.concat('app.js'))\n .pipe(uglify())\n .on('error', gutil.log)\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(DST+paths.jsDirectory))\n .pipe(browserSync.stream());\n}", "title": "" }, { "docid": "9d2b7840caa87bbf8f5bdf7285f281c5", "score": "0.484609", "text": "function compileJS(isBuild) {\n\n var opts = plugins.assign({}, plugins.watchify.args, {\n entries: [config.src + 'js/app.js'],\n debug: true\n });\n var b = isBuild ? plugins.browserify(opts) : plugins.watchify(plugins.browserify(opts));\n\n b.transform(plugins.babelify);\n b.on('update', bundle);\n b.on('log', plugins.util.log);\n\n function bundle() {\n return b.bundle()\n .on('error', plugins.util.log.bind(plugins.gutil, 'Browserify Error'))\n .pipe(plugins.vinylSourceStream('app.bundled.js'))\n .pipe(plugins.vinylBuffer())\n .pipe(plugins.sourcemaps.init({loadMaps: true}))\n .pipe(plugins.sourcemaps.write('./'))\n .pipe(gulp.dest(config.src + 'js/'))\n .pipe(plugins.connect.reload());\n }\n\n return bundle();\n\n}", "title": "" }, { "docid": "4547ff85589f2bed8105ceec7b124886", "score": "0.4838603", "text": "function main(args) {\n return new Promise((resolve, reject) => {\n let b = browserifyArgs(['--node', '--no-detect-globals'].concat(args));\n let outdir = (b.argv.outdir || b.argv.o);\n if (b.argv._[0] === 'help' || b.argv.h || b.argv.help ||\n (process.argv.length <= 2 && process.stdin.isTTY)) {\n reject(new Error('Usage: collect-js-deps --outdir <path> [--list] ' +\n '{BROWSERIFY-OPTIONS} [entry files]'));\n return;\n }\n if (!outdir && !b.argv.list) {\n reject(new Error('collect-js-deps requires --outdir (-o) option for output directory, or --list'));\n return;\n }\n collect_js_deps(b, { list: b.argv.list, outdir });\n b.bundle((err, body) => err ? reject(err) : resolve());\n });\n}", "title": "" }, { "docid": "aa4e9c5e44791cac1643aec5ec33785a", "score": "0.48370394", "text": "function Bundle() {\n // (maybe; might not need to) adds the app's index.js to BoringShell\n var path = NodePath.join(__dirname, './BoringShell.js');\n var bundler = new _parcelBundler2.default(path);\n return bundler.bundle().catch(console.error);\n}", "title": "" }, { "docid": "4fe5bede8bbc0a104b37ed7099b8b5cc", "score": "0.4834005", "text": "function getTranspiledOutput(){\n return store.getState().python;\n}", "title": "" }, { "docid": "28296a8af69371bc21371d404dfd425e", "score": "0.48308486", "text": "function scripts() {\n return browserify(paths.scripts.src)\n .transform(babelify, {\n presets: ['@babel/preset-env'],\n })\n .bundle()\n .on(\n 'error',\n notify.onError({\n message: 'Error: <%= error.message %>',\n title: 'Failed running browserify',\n })\n )\n .pipe(source('app.js'))\n .pipe(buffer())\n .pipe(\n sourcemaps.init({\n loadMaps: true,\n })\n )\n .pipe(uglify())\n .pipe(sourcemaps.write('./'))\n .pipe(gulp.dest(paths.scripts.dest))\n .pipe(browserSync.stream())\n .pipe(\n notify({\n message: 'Browserify task ended',\n })\n );\n}", "title": "" } ]
39dd72896378edc7594a27184e89af00
Assign colors to grids when required
[ { "docid": "85659cf2785210361876ebf6470a9a0c", "score": "0.0", "text": "function assignColor()\n{\n for(var i=0;i<squares.length;i++)\n {\n squares[i].style.backgroundColor =colors[i];\n \n // add Event listner to all div squares\n squares[i].addEventListener(\"click\",function(){\n\n // grab clicked color\n var pickedColor=this.style.backgroundColor;\n\n // compare correct color and picked color\n if(pickedColor===correctColor)\n {\n message[0].textContent=\"Correct!\";\n changeColor();\n\n // change button context from new colors to play again when ans is correct\n play.textContent=\"Play Again\";\n heading.style.backgroundColor=correctColor;\n }\n else\n {\n message[0].textContent=\"Wrong\";\n this.style.backgroundColor='black';\n }\n });\n }\n}", "title": "" } ]
[ { "docid": "bfcce261b0a6d824736951387e87fb64", "score": "0.7650118", "text": "function setGridColor2(data, row, column, color){\n \n}", "title": "" }, { "docid": "2550e6fb0509bae3a99bd40a7f187576", "score": "0.7350364", "text": "function colorGrid() {\n\t$(\"#pixel_canvas tr td\").css({\n\t\t\"border-color\": color\n\t});\n\t$(\"#color-grid\").css({\n\t\t\"background-color\": color\n\t});\n}", "title": "" }, { "docid": "66a75ebb10a89efe369b5438e333003e", "score": "0.7185551", "text": "function initialGrid() {\n let numberOfSquares = 16 * 16;\n for (let i = 0; i < numberOfSquares; i++) {\n const divGrid = document.createElement(\"div\");\n divGrid.classList.add(\"grid\");\n divContainer.setAttribute(\n \"style\",\n \"grid-template-columns: repeat(16, 1fr); grid-template-rows: repeat(16, 1fr);\"\n );\n divContainer.appendChild(divGrid);\n changeBackground(whichColor);\n }\n}", "title": "" }, { "docid": "b2e653c08626cb0840e6547608064c3d", "score": "0.7146723", "text": "function resetGridColors(){\n\t\tsetColIndex();\n\t\trevealRow();\n\t\tstartMouseIndication();\n\t}", "title": "" }, { "docid": "0cfc5c66029a0571a8703e0574c23641", "score": "0.7144404", "text": "function nextStage() {\n var newColours = [];\n for (x = 0; x < gridWidth; x++) {\n for (y = 0; y < gridHeight; y++) {\n var cellNum = y * gridWidth + x;\n newColours[cellNum] = newColour(x, y);\n }\n }\n updateGridView(newColours);\n}", "title": "" }, { "docid": "c9f4a841e3f128964f9ec9b38d3afcbb", "score": "0.7108736", "text": "function assignColors() {\n colors = generateRandomColors(mode);\n correct_color = pickWinningColor(mode);\n color_display.textContent = correct_color;\n\n for (let i = 0; i < mode; i++) {\n squares[i].style.backgroundColor = colors[i];\n }\n}", "title": "" }, { "docid": "11664891b15744fa056d3672071dd502", "score": "0.705715", "text": "function setup(num){\n message.textContent = \"GUESS!\";\n colors = generateRandColors(num);\n pickedColor = pickRandColor();\n RGBLabel.textContent = pickedColor;\n for(var i = 0; i < squares.length; i++){\n squares[i].style.backgroundColor = colors[i];\n }\n if (num===3){\n for ( var i = 3; i <6;i++){\n squares[i].style.backgroundColor = \"#232223\";\n }\n\n }\n}", "title": "" }, { "docid": "3e6411ec7ec9b63eb990552232a3c76a", "score": "0.705599", "text": "function gridColor() {\n let gridArray = document.getElementsByClassName(\"square\");\n for (let i = 0; i < gridArray.length; i += 1) {\n gridArray[i].addEventListener(\"mouseenter\", function (e) {\n const initialColor = e.target.style.backgroundColor;\n const colorString = initialColor.slice(4, -1).split(\",\");\n const red = colorString[0] || 255;\n const green = colorString[1] || 255;\n const blue = colorString[2] || 255;\n\n selectedMode == \"gradient\"\n ? (e.target.style.backgroundColor = `rgb(${red - red * 0.1}, ${\n green - green * 0.1\n }, ${blue - blue * 0.1})`)\n : (e.target.style.backgroundColor = `rgb(${rgbNumber()}, ${rgbNumber()}, ${rgbNumber()})`);\n });\n }\n}", "title": "" }, { "docid": "a82eff879b303a868dbc99f7221eeae2", "score": "0.7001234", "text": "switchGrid(row, column, totalOn, diffColor) {\n\t\t\t\tlet curGrid = this.grid[row][column];\n\t\t\t\tlet sameColor = 9 - diffColor;\n\t\t\t\tif(diffColor < sameColor) {\n\t\t\t\t\tif(curGrid.state == 1) {\n\t\t\t\t\t\tthis.grid[row][column].state = totalOn < 2 || totalOn > 3 ? 0 : 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.grid[row][column].state = totalOn == 3 ? 1 : 0;\n\t\t\t\t\t}\t\t\n\t\t\t\t} else if(diffColor > sameColor) {\n\t\t\t\t\tthis.grid[row][column].color = curGrid.color == \"blue\" ? \"red\" : \"blue\"; \n\t\t\t\t}\n\t\t\t\t//apply last rule\n\t\t\t\tif(!curGrid.state && totalOn == 3 && diffColor > sameColor) {\n\t\t\t\t\tthis.grid[row][column].color = curGrid.color == \"blue\" ? \"red\" : \"blue\";\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "01880c05f17939b264383d4ca863ffd4", "score": "0.6983137", "text": "function updateGrid() {\n\t\tfor (let row = 0; row < numRows; row++) {\n\t\t\tfor (let col = 0; col < numCols; col++) {\n\t\t\t\tlet element = cells[row][col];\n\t\t\t\tif (lifeworld.world[row][col] == 1) {\n\t\t\t\t\telement.style.backgroundColor = \"red\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\telement.style.backgroundColor = \"white\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5518d53e739d04419906bf6fc0bf3586", "score": "0.69647217", "text": "function storeGridColours() {\n\n let startTop = tileTop + tileBorder + tileWidth + tileGap;\n let startLeft = tileLeft + tileBorder +tileWidth + tileGap;\n const allGrid = document.getElementsByClassName('tile');\n\n for (let i = 0; i < allGrid.length; i++) {\n const topDiff = parseInt(allGrid[i].style.top) - startTop;\n const leftDiff = parseInt(allGrid[i].style.left) - startLeft;\n const rowPos = topDiff / (tileWidth + tileGap);\n const colPos = leftDiff / (tileWidth + tileGap);\n\n if (rowPos < 0 || colPos < 0 || rowPos >= diceRows || colPos >= diceCols) {\n continue;\n }\n gridColourArray[rowPos * diceCols + colPos] = allGrid[i].style.backgroundColor;\n }\n}", "title": "" }, { "docid": "b8ece974190eb6cb398670177a397d41", "score": "0.69059265", "text": "initializeGrid(){\n for(let row1 = 0; row1 < 3; row1++){\n for(let col1 = 0; col1 < 8; col1++){\n if(row1 % 2 === 0 && col1 % 2 === 1){\n this.grid[row1][col1] = this.redPiece;\n this.checkers.push(this.redPiece);\n }\n if(row1 % 2 === 1 && col1 % 2 === 0){\n this.grid[row1][col1] = this.redPiece;\n this.checkers.push(this.redPiece);\n }\n }\n }\n for(let row2 = 5; row2 < 8; row2++){\n for(let col2 = 0; col2 < 8; col2++){\n if(row2 % 2 == 0 & col2 % 2 == 1){\n this.grid[row2][col2] = this.blackPiece;\n this.checkers.push(this.blackPiece);\n\n } if(row2 % 2 == 1 & col2 % 2 == 0){\n this.grid[row2][col2] = this.blackPiece;\n this.checkers.push(this.blackPiece);\n }\n }\n }\n }", "title": "" }, { "docid": "989c5a4a368440104d5a0c74860a2b71", "score": "0.68895966", "text": "function colorCells() {\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n if (grid[i][j].id == \"0\") {\n grid[i][j].style.backgroundColor = \"#FFFF\"; //sets vacant cell color to white\n }\n else if (grid[i][j].id == \"1\") {\n grid[i][j].style.backgroundColor = popXColor; //sets pop X color to given color by user\n }\n else if (grid[i][j].id == \"2\") {\n grid[i][j].style.backgroundColor = popYColor; //sets pop Y color to given color by user\n }\n }\n }\n}", "title": "" }, { "docid": "dbfc971dc9d1d5c446dc8a636043fa15", "score": "0.68806016", "text": "function drawGrid(grid) {\n\t\tfor (var x = 0; x < grid.length; x++) {\n\t\t\tfor (var y = 0; y < grid[x].length; y++) {\n\t\t\t\tvar color = grid[x][y],\n\t\t\t\t\tidx = (x + y*canvas.width) * 4, // 4 elements per pixel\n\t\t\t\t\tcolorParts = BORDER_COLOR;\n\t\t\t\tif\t\t(color === 0) colorParts = WATER_COLOR;\n\t\t\t\telse if (color === 1) colorParts = LAND_COLOR[0];\n\t\t\t\telse if (color === 2) colorParts = LAND_COLOR[1];\n\t\t\t\tcanvasData.data[idx+0] = colorParts[0];\n\t\t\t\tcanvasData.data[idx+1] = colorParts[1];\n\t\t\t\tcanvasData.data[idx+2] = colorParts[2];\n\t\t\t\tcanvasData.data[idx+3] = 255; // opaque\n\t\t\t}\n\t\t}\n\t\tctx.putImageData(canvasData,0,0);\n\t}", "title": "" }, { "docid": "49e5a85c65425311530428cce12f1c56", "score": "0.687043", "text": "function populateGrid(grid) {\n for (let index = 0; index < 9; index++) {\n let randColor = colors[Math.floor(Math.random() * colors.length)];\n grid.append(`<div class=\"${randColor}\"></div>`)\n };\n}", "title": "" }, { "docid": "ff90d23ca68e7ee6888053d2cf19eae1", "score": "0.6847682", "text": "function updateGrid() {\n Parity.grid.children(':not(.circler)').each(function( row_index, row ) {\n $(row).children().each(function( col_index, col ) {\n $col = $(col);\n if (Parity.grid_values[row_index][col_index]) {\n $col.removeClass(\"black\");\n } else {\n $col.addClass(\"black\");\n }\n });\n });\n}", "title": "" }, { "docid": "80acb55f9f22fffb2a3560d803e9e5c4", "score": "0.68422484", "text": "function colorGrid(e){\n if(e.target.classList == 'grid-column'){\n if(verify){\n e.target.style.backgroundColor = '#' + randomColor();\n } else {\n e.target.style.backgroundColor = 'red';\n }\n }\n}", "title": "" }, { "docid": "0c92c6055c7d37538e489d3f89035bea", "score": "0.6812628", "text": "function randomSetUp(){\n for (let x = 0; x < NUM_COLS; x++) {\n for (let y = 0; y < NUM_ROW; y++) {\n let randnum = int(random(1,3)); //if 1 than 0 else 2 is 255\n if(randnum === 1){\n grid[y][x] = 0;\n }\n if(randnum === 2){\n grid[y][x] = 255;\n }\n }\n\n }\n}", "title": "" }, { "docid": "9345972d9f82bdc0303ff601365e0844", "score": "0.68080527", "text": "function paint(){\r\n\t\t\tfor (var i=3; i<12; i++){\r\n\t\t\t\tvar grid = document.getElementById(\"grid\");\r\n\t\t\t\tvar cella = document.getElementById(\"casella\" + i);\r\n\t\t\t\tvar riga = Math.floor(i/3);\r\n\t\t\t\tvar colonna = i%3;\r\n\t\t\t\tvar n = grid.childNodes[riga].childNodes[colonna].value;\r\n\t\t\t\tcella.style.backgroundColor = colors[n];\r\n\t\t\t\t} \r\n\t\t}", "title": "" }, { "docid": "052574e354737fe4091c11472b877582", "score": "0.6763531", "text": "function setColors() {\r\n\tvar g = 0;\r\n\tvar b = 0;\r\n\tvar y = 0;\r\n\tvar d = 0;\r\n\tfor (r = 1; r < 5; r++) {\r\n\t\tfor (c = 1; c < 5; c++) {\r\n // sets for for row and column Tile_11 = row 1 column 1\r\n var el = 'tile' + r + c;\r\n\t\t\tvar thisEl = document.getElementById(el);\r\n\t\t\tvar f = false;\r\n\t\t\tdo {\r\n //\r\n\t\t\t\tvar v = Math.floor(Math.random() * (5 - 1) + 1);\r\n // v= value of colors no more than 4 per board\r\n\t\t\t\tswitch (v) {\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tif (g < 4) {\r\n\t\t\t\t\t\t\tthisEl.classList.add('green');\r\n\t\t\t\t\t\t\tg++;\r\n\t\t\t\t\t\t\tf = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tf = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tif (b < 4) {\r\n\t\t\t\t\t\t\tthisEl.classList.add('blue');\r\n\t\t\t\t\t\t\tb++;\r\n\t\t\t\t\t\t\tf = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tf = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tif (y < 4) {\r\n\t\t\t\t\t\t\tthisEl.classList.add('yellow');\r\n\t\t\t\t\t\t\ty++;\r\n\t\t\t\t\t\t\tf = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tf = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\tif (d < 4) {\r\n\t\t\t\t\t\t\tthisEl.classList.add('red');\r\n\t\t\t\t\t\t\td++;\r\n\t\t\t\t\t\t\tf = true;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tf = false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t}\r\n \r\n\t\t\t} while (f == false);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "19ce2a2c24b416df4d27cbfb05775f54", "score": "0.6761567", "text": "function setNewColors(){\n backCol = getRandomColor();\n col1 = getRandomColor();\n col2 = getRandomColor();\n}", "title": "" }, { "docid": "05864ddf1a89d32025c8cf9691f29100", "score": "0.6737768", "text": "function _createColorForGrid(color1, color2){\n let colorGrid = new Array(8);\n let fillbox = true;\n for (let i = 0 ; i < 8; i++) {\n colorGrid[i] = new Array(8);\n for (let j = 0 ; j < 8; j++) {\n if (fillbox){\n colorGrid[i][j] = color1;\n }else{\n colorGrid[i][j] = color2;\n }\n fillbox = !fillbox;\n }\n fillbox = !fillbox;\n }\n return colorGrid;\n}", "title": "" }, { "docid": "2688af5b3ba4641c6913ab1b77ebe0a7", "score": "0.6725002", "text": "initializeGrid() {\n for (var i=0; i < 4; i++) {\n for (var j=0; j < 4; j++) {\n var cell = new Cell(i, j);\n // cell.colorBackground();\n cell.drawBorders();\n this.info.push(cell);\n }\n }\n }", "title": "" }, { "docid": "b072c7c49b72e6add6cae686d4e1a1a4", "score": "0.6723126", "text": "function setGridColor1(data, row, column){\n data.color_history.push(\n {column: column, row: row, color: data.current_color}\n )\n}", "title": "" }, { "docid": "1a2427c3c94059d49971cb77db8aaecb", "score": "0.6690359", "text": "function drawGrid(color){\n container.style.width = (gridSize * boxSize + (gridSize*2))+\"px\";\n container.style.height = (gridSize * boxSize + (gridSize*2)) +\"px\";\n for(let i=0; i <gridSize; i++){\n for(let n=0; n<gridSize; n++){\n //console.log('n: '+n+ ' i: '+i);\n let gridBox = document.createElement('div');\n gridBox.className = 'grid'\n gridBox.style.backgroundColor = color[i][n]\n gridBox.style.width = boxSize + \"px\";\n gridBox.style.height = boxSize + \"px\";\n container.appendChild(gridBox)\n }\n }\n}", "title": "" }, { "docid": "2ad6083a7346599eaff1a0f73fe3b39d", "score": "0.6686823", "text": "function colorGrid() {\n let grids = document.querySelectorAll('.gr');\n for (let i = 0; i < grids.length; i++) {\n let grid = grids[i];\n let colour = () => { // function for generating random colour\n let red = Math.floor(Math.random() * 256);\n let green = Math.floor(Math.random() * 256);\n let blue = Math.floor(Math.random() * 256);\n return (`rgb( ${red}, ${green}, ${blue});`);\n }\n grid.addEventListener('mouseover', function () {\n grid.setAttribute('style', `background-color:${colour()}`);\n });\n }\n}", "title": "" }, { "docid": "3f8a796ecc8ea8b8a2a7e311bd7ed243", "score": "0.6677133", "text": "function colorCells(id, size){\n //Colors subgrid\n var row = (id - 1) / size, col = (id - 1) % size, gridId;\n var lowerRowLim = row - row % Math.sqrt(size);\n var lowerColLim = col - col % Math.sqrt(size);\n for(var i = lowerRowLim; i < lowerRowLim + Math.sqrt(size); ++i){\n for(var j = lowerColLim; j < lowerColLim + Math.sqrt(size); ++j){\n gridId = i * size + j + 1;\n if(document.getElementById(gridId).value == document.getElementById(id).value && document.getElementById(id).value != \"\"){\n document.getElementById(gridId).style.backgroundColor = '#F15353';\n continue;\n }\n document.getElementById(gridId).style.backgroundColor = '#FBA8DF';\n }\n }\n //Colors row\n if(id % size == 0){\n for(var rowId = id - size + 1; rowId <= id; ++rowId){\n if(document.getElementById(rowId).value == document.getElementById(id).value && document.getElementById(id).value != \"\"){\n document.getElementById(rowId).style.backgroundColor = '#F15353';\n continue;\n }\n document.getElementById(rowId).style.backgroundColor = '#D187F5';\n }\n } else {\n for(var rowId = id - id % size + 1; rowId <= id - id % size + size; ++rowId){\n if(document.getElementById(rowId).value == document.getElementById(id).value && document.getElementById(id).value != \"\"){\n document.getElementById(rowId).style.backgroundColor = '#F15353';\n continue;\n }document.getElementById(rowId).style.backgroundColor = '#D187F5';\n }\n }\n\n //Colors column\n if(id % size == 0){\n for(var colId = size; colId <= size * size; colId = colId + size){\n if(document.getElementById(colId).value == document.getElementById(id).value && document.getElementById(id).value != \"\"){\n document.getElementById(colId).style.backgroundColor = '#F15353';\n continue;\n }\n document.getElementById(colId).style.backgroundColor = '#D187F5';\n }\n } else {\n for(var colId = id % size; colId <= size * size; colId = colId + size){\n if(document.getElementById(colId).value == document.getElementById(id).value && document.getElementById(id).value != \"\"){\n document.getElementById(colId).style.backgroundColor = '#F15353';\n continue;\n }\n document.getElementById(colId).style.backgroundColor = '#D187F5';\n }\n }\n}", "title": "" }, { "docid": "484654e40e3c17bf2576351f9cbc026a", "score": "0.6675158", "text": "function makeGrid(cells) {\n for (let i = 0; i < cells**2; i++) {\n let cell = document.createElement('div');\n // Assign each cell an ID\n cell.id = \"grid\" + [i];\n // Define CSS elements to apply mouseover properties\n let count = 0; // Alpha variable\n cell.onmouseover = function() {\n if (!rainbow.checked) {\n // Pen Color is whatever color is selected\n cell.style.backgroundColor = color.value;\n }\n else {\n // Defining random coloration\n let r = Math.floor(Math.random() * 255);\n let g = Math.floor(Math.random() * 255);\n let b = Math.floor(Math.random() * 255);\n\n //Output\n cell.style.backgroundColor = `rgb(${r}, ${g}, ${b})`;\n }\n }\n // Attach the div to the container\n container.appendChild(cell);\n }\n}", "title": "" }, { "docid": "557e0425876a3d7e5c47e31f577075fa", "score": "0.6648871", "text": "function updateTileColor() {\r\n var grid, i, count;\r\n\r\n grid = this;\r\n\r\n for (i = 0, count = grid.allNonContentTiles.length; i < count; i += 1) {\r\n grid.allNonContentTiles[i].setColor(config.tileHue, config.tileSaturation,\r\n config.tileLightness);\r\n }\r\n }", "title": "" }, { "docid": "650ef703275b0989bcf86cdad8532937", "score": "0.6636513", "text": "function addColorToAllSquareBackgrd(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n }\n}", "title": "" }, { "docid": "1a5b6b5932de425394f2b4a50e89a0de", "score": "0.66199106", "text": "function createGrid(rows, columns){\n for (i=0; i<(rows*columns); i++){\n let cell = document.createElement('div');\n cell.textContent=\"\";\n cell.classList.add('cells')\n cell.style.backgroundColor = 'white';\n divGridContainer.appendChild(cell);\n divGridContainer.style.setProperty('--rows', rows);\n divGridContainer.style.setProperty('--columns', columns);\n\n colors.forEach(selection=>selection.addEventListener('click', colorSelection));\n\n function colorSelection(e){\n let colorSelect = e.target;\n\n if(colorSelect === colorGrey){\n colorChangeGray(cell);\n }\n else if (colorSelect === colorBlack){\n colorChangeBlack(cell);\n }\n else if (colorSelect === eraser){\n colorChangeWhite(cell);\n }\n else if (colorSelect = colorCustom){\n colorRandom(cell); \n }\n }\n }\n}", "title": "" }, { "docid": "e2e85defa6f1e7c5d7d74fbf8d1e3dc1", "score": "0.6595411", "text": "function drawBoard() {\n for (var i = 0; i < 9; i++) {\n var lc;\n if (localState.state[i] == 0)\n lc = config.nilColor;\n else if (localState.state[i] == 1)\n lc = config.p1Color;\n else if (localState.state[i] == -1)\n lc = config.p2Color;\n\n $('span[data-idx=' + i.toString() + ']').css('background', lc);\n }\n}", "title": "" }, { "docid": "4272216818092ffd8c4e5ae9e1b31c9d", "score": "0.65831196", "text": "function gridIntensity(){\n\tif(whiteOnBlack == true){\n\t\t// adding 0.1 so it never goes to 0\n\t\tvar value = 0.1 + (high * dial1);\n\t\t// assigning value to R, G and B to make it go from black to white\n\t\tmyGrid.gl_color = [value, value, value, 1];\n\t} else {\n\t\tvar value = 0.9 - (high * dial1);\n\t\tmyGrid.gl_color = [value, value, value, 1];\n\t}\n}", "title": "" }, { "docid": "aeeb13c658c44f9c783287b2baf4d87c", "score": "0.6579122", "text": "function\t\tfillTheGrid()\t\t{\n\t\n\t//\tTo start, let's call those two functions:\n\t//\tTo tell us which cells are coloured:\n\t\n\tisItColored();\n\t//\tTo tell us which colors are available:\n\tcolorsChecked();\n\t\n\tvar xPos = 0;\n\tvar yPos = 0;\n\tvar indexer = 0;\n\tvar randColor;\n\t\n\t//\tThis first loop goes through each COLUMN\n\tfor(i=0; i < widthDivider; i++){\n\t\t\n\t\tyPos = 0;\n\t\t\n\t//\tThis next loop goes through each ROW\n\t\tfor(j=0; j < heightDivider; j++){\n\t\t\t\n\t\t\t//\tOnly if there is actually a color that has been checked do we pick a random color:\n\t\t\tif(colorsChosen[0] != undefined){\n\t\t\t\t\t\t\t\t\n\t\t\t\trandColor = Math.floor(Math.random() * colorsChosen.length);\n\t\t\t\t\n\t\t\t};\n\t\t\t\n\t\t\t//\tIf the current cell is to be colored, let the color be randomly selected from the bunch\n\t\t\tif(isColored[indexer] == true){\n\t\t\t\t\n\t\t\t\tctx.fillStyle = colorsChosen[randColor];\n\t\t\t\t\n\t\t\t}\n\t\t\t//\tOtherwise, fill it with white:\n\t\t\telse if(isColored[indexer] == false){\n\t\t\t\t\n\t\t\t\tctx.fillStyle = \"#fff\";\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//\tActually draws the rectangle. Pretty awesome.\n\t\t\tctx.fillRect(xPos,yPos,widthsArray[i],heightsArray[j]);\n\t\t\t\n\t\t\t//\tNow we must change some things for next time:\n\t\t\tyPos += heightsArray[j];\n\t\t\t\n\t\t\tindexer += 1;\n\t\t\t\n\t\t};//\tEnd of row loop\n\t\t\n\t\t//\tNow we must change some things for next time:\n\t\txPos += widthsArray[i];\n\t\t\t\t\n\t};//\tEnd of column loop\n\t\t\n}", "title": "" }, { "docid": "6e81bf25379bc97b4a87c2d07e8c0c9b", "score": "0.6577223", "text": "function fillGrid (color) {\n\tvar grid = document.getElementById('grid');\n\tfor (var i=0; i < gridWidth*gridHeight; i++) {\n\t\tgrid.appendChild(addPixel(color, false));\n\t}\n\tif (600/gridWidth > 600/gridHeight) {\n\t\tsquareSize = 600/gridHeight;\n\t}\n\telse {\n\t\tsquareSize = 600/gridWidth;\n\t}\n\tgrid.style.width = squareSize * gridWidth + 'px';\n}", "title": "" }, { "docid": "48ac02ffbf51fcc2b1e05c8533a247de", "score": "0.6575331", "text": "update(grid) {\n this.clear();\n this.context.fillStyle = \"red\";\n for (let row = 0; row < this.height; row++) {\n for (let col = 0; col < this.width; col++) {\n if (grid[row][col]) {\n this.context.fillRect(\n col*this.cellSize, row*this.cellSize, \n this.cellSize, this.cellSize);\n }\n }\n }\n }", "title": "" }, { "docid": "224951c061a6a329ef5d326f45e03be0", "score": "0.6566131", "text": "function prepareSquares(grid){\n var colors = [];\n for (var i = 0; i < grid.length; i++){\n \n //randomly assign some of the squares as null (they are going to be empty spaces)\n var newSquare = getRandomIntInclusive(0,1) ? {\n x: grid[i].x,\n y: grid[i].y,\n size: squareSize,\n number: i,\n color: getSquareColor(i)\n } : null;\n \n squares.unshift(newSquare);\n }\n drawSquares(squares);\n }", "title": "" }, { "docid": "55e001bb9e8cf7a6319b469c5a63d805", "score": "0.6552793", "text": "function changeColorsDisplay(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n }\n }", "title": "" }, { "docid": "ffbecb6cc72ba8b41da767339cc44433", "score": "0.65523964", "text": "function setColors(row,col) {\n\n if (board[row][col]){\n table.rows[row].cells[col].style.background=\"green\"\n availMoves=thisPiece.movement(row,col)\n for(var i=0, n=availMoves.length;i<n;i++) {\n table.rows[availMoves[i][0]].cells[availMoves[i][1]].style.background=\"#00cc99\"\n }\n }\n}", "title": "" }, { "docid": "af71f2333255686df5c617c66d1239f5", "score": "0.6545363", "text": "function addNumberToGrid(arr, grid) {\r\n squares = grid.childNodes;\r\n for(let i=0; i<arr.length; i++) {\r\n if(arr[i] === 1) {\r\n squares[i].style.backgroundColor = \"black\";\r\n }\r\n else {\r\n squares[i].style.backgroundColor = \"white\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "94c93ff0803eb586e72e4f01401c8449", "score": "0.6544599", "text": "displayGrid(color) {\n rectMode(CORNER);\n strokeWeight(0);\n fill(color);\n if (this.wall) {\n fill(0, 255, 0);\n }\n rect(this.x * cellWidth, this.y * cellHeight, cellWidth - 1, cellHeight - 1);\n }", "title": "" }, { "docid": "919748bf84a779a0a7d85125f2291a13", "score": "0.65222555", "text": "function makeGrid(height, width) {\n var r, c; // c is colomn,r is row\n for( r = 1; r <= height; r++) {\n let row = tab.insertRow(r);\n for( c = 1; c < width; c++){\n let col = row.insertCol(c);\n col.addEventListener('click',function(){\n col.style.backgroundcolor = color.value;\n });\n }\n }\n}", "title": "" }, { "docid": "3bf7e343259909decd3de307bbd107e9", "score": "0.65193605", "text": "function addColorsToSquares() {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = colors[i];\n }\n}", "title": "" }, { "docid": "08b5aa63c80d12a426dcf632501adf3d", "score": "0.65156204", "text": "function setBackgroundColor() {\r\n var grid = this;\r\n\r\n grid.parent.style.backgroundColor = 'hsl(' + config.backgroundHue + ',' +\r\n config.backgroundSaturation + '%,' + config.backgroundLightness + '%)';\r\n }", "title": "" }, { "docid": "5a7a75fa01f32a0fca41992d93d815b3", "score": "0.65111935", "text": "function setColor() {\n // if (this.style.backgroundColor === 'white') {\n // this.style.backgroundColor = 'black';\n // blackcells.push(this);\n //} else {\n this.style.backgroundColor = 'black';\n //blackcells.remove(this);\n \n //}\n if (!blackcells.includes(this)) {\n\tblackcells.push(this);\n }\n}", "title": "" }, { "docid": "a4d85d2f6bfeb9efbda13e5b0622a1c6", "score": "0.6492084", "text": "function allTransparent(ele){\n //ele represents the number of cells\n var size = Math.sqrt(ele);//size of the grid\n var sub = Math.sqrt(size);//size of the sub-grid\n var option = 2;\n if(sub % 2 != 0){//For 9x9 grids\n for(var row = 0; row < size; row = row + sub){\n for(var col = 0; col < size; col = col + sub){\n option = (option == 1)? 2:1;\n for(var i = row; i < row + sub; ++i){\n for(var j = col; j < col + sub; ++j){\n var index = i * size + j + 1;\n if(option == 1){\n document.getElementById(index).style.backgroundColor = '#6CAEFB';\n } else {\n document.getElementById(index).style.backgroundColor = '#B3D4FC';\n }\n document.getElementById(index).style.border = 'solid 1px';\n }\n }\n }\n }\n } else {//For 4x4 and 16x16 grids\n var gridEnds = false;\n for(var row = 0; row < size; row = row + sub){\n for(var col = 0; col < size; col = col + sub){\n if(!gridEnds){\n option = (option == 1)? 2:1;\n }\n for(var i = row; i < row + sub; ++i){\n for(var j = col; j < col + sub; ++j){\n var index = i * size + j + 1;\n if(option == 1){\n document.getElementById(index).style.backgroundColor = '#6CAEFB';\n } else {\n document.getElementById(index).style.backgroundColor = '#B3D4FC';\n }\n document.getElementById(index).style.border = 'solid 1px';\n }\n }\n gridEnds = false;\n }\n gridEnds = true;\n }\n }\n}", "title": "" }, { "docid": "bceb4e4285db0f084733131ed5f08435", "score": "0.6490166", "text": "function drawGrid(amount) {\n for (var i = 0; i < (amount*amount); i++) {\n let div = document.createElement('div')\n div.classList.add('pixel');\n grid.appendChild(div);\n div.addEventListener('mouseover', function(event) {\n const userColor = document.getElementById('colorChoice');\n event.target.style.background = userColor.value;\n });\n }\n document.documentElement.style.setProperty(\"--columnNumber\", amount);\n}", "title": "" }, { "docid": "71e7641e4e6b19f0ed28a1d9f1702f2c", "score": "0.6488393", "text": "function createGrid(numberSquares) { \n\tfor (let row = 1; row <= numberSquares; row++) {\n\t\tlet gridRow = document.createElement('div'); \n\t\tgridRow.classList.add('gridRow'); \n\t\tgridRow.style.height = (480 / numberSquares) + 'px'; \n\n\t\tfor (let col = 1; col <= numberSquares; col++) {\n\t\t\tlet grid = document.createElement('div'); \n\t\t\tgrid.classList.add('grid'); \n\t\t\tgrid.style.width = (480 / numberSquares) + 'px'; \n\t\t\tgrid.style.backgroundColor = \"rgb(255, 255, 255)\"; \n\t\t\tgridRow.append(grid); \n\t\t\t}\n\t\tcontainer.append(gridRow); \n\t}\n\tchangeColor(); \n}", "title": "" }, { "docid": "9ea4cbe2ff3b2e1c615635953e0d6d36", "score": "0.64701277", "text": "function ChangeColors(color){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tif(colors[i])\n\t\tsquares[i].style.background = color;\n\t\t/*need to use squares array\n\t\t,instead of colors array, cause 'background' is defined by squares*/\n\t}\n\n}", "title": "" }, { "docid": "5fb50c8acebd3d19ea8323a32d723e16", "score": "0.646006", "text": "function changeGridColor(e) {\n hoverColor = e.target.value;\n}", "title": "" }, { "docid": "b2ad65f9a0ac4b4db1842215eb78fec6", "score": "0.64573383", "text": "function makeRainbowGrid(gridSize) {\n removeCells();\n document.getElementById('grid-div').style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n document.getElementById('grid-div').style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n\n for (i = 0; i < gridSize * gridSize; i++) {\n const rainbowCell = document.createElement('div');\n rainbowCell.classList.add('rainbow-cell');\n gridDiv.append(rainbowCell);\n // hover effect on gridCell to make it change color upon hovering over it\n rainbowCell.addEventListener('mouseover', function(e) {\n let rgbNumberOne = Math.floor(Math.random() * 255);\n let rgbNumberTwo = Math.floor(Math.random() * 255);\n let rgbNumberThree = Math.floor(Math.random() * 255);\n rainbowCell.style.backgroundColor = `rgb(${rgbNumberOne}, ${rgbNumberTwo}, ${rgbNumberThree})`;\n \n });\n };\n\n}", "title": "" }, { "docid": "899a2f483d8d66b993a51938a7fc2b80", "score": "0.6452435", "text": "function changeColors(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.background = color;\n }\n }", "title": "" }, { "docid": "187aef816e76e6a7df8f66fa5473a3c6", "score": "0.6452202", "text": "function changeDefaultCells() {\n //saving all grid locations\n let cells = document.getElementsByTagName(\"td\");\n let allCells = [...cells];\n\n //filter out colored grids\n let noColor = allCells.filter((cell) => {\n return cell.classList.contains(\"no-color\");\n });\n\n //setting color for uncolored squares\n noColor.forEach((cell) => {\n cell.style.backgroundColor = currentColor;\n cell.classList.remove(\"no-color\");\n });\n}", "title": "" }, { "docid": "3e13439afe64af1d9eb1c11d4436e053", "score": "0.6451636", "text": "function fillUnfilledColors() {\n var colorless = document.getElementsByClassName(\"colorless\");\n while(colorless.length > 0) \n {\n paintCell({target: colorless[0]});\n }\n}", "title": "" }, { "docid": "7d2f334f3a3993b97d5b14bf72fbf5f9", "score": "0.64510995", "text": "function change_colors(squares_num){\n window.random_square = Math.floor(Math.random()*squares_num);\n window.chosen = chosen_color();\n squares[random_square].style.background = chosen;\n for (var i = 0; i<random_square; i++){\n squares[i].style.background = 'rgb(' +_rand_color()+')';\n }\n for (var i = random_square+1; i<squares.length; i++){\n squares[i].style.background = 'rgb(' +_rand_color()+')';\n }\n}", "title": "" }, { "docid": "3308bf959dc93fc945efc9d77d96c289", "score": "0.64486146", "text": "function colorbg () {\n colorMode(red, 400);\n for (var i = 0; i < 400; i++) {\n for (var j = 0; j < 400; j++) {\n stroke(i, j, 0);\n point(i, j);\n }\n }\n}", "title": "" }, { "docid": "d5fa2ede58fb3c1c603d3310dce6967f", "score": "0.64483804", "text": "function setup() {\n //based on the padding, canvas padding, cols and rows generate a canvas that fits the grid\n createCanvas(\n colNum * (moduleSize + padding) + canvasPadding * 2,\n rowNum * (moduleSize + padding) + canvasPadding * 2\n );\n //set the color mode to HSB and define the HSBA ranges\n colorMode(HSB, 360, 100, 100, 100);\n //set the mouse cursor to a cross\n cursor(CROSS);\n //pass the variables into the grid constructor and generate a new grid object\n //constructor(moduleSize, padding, cols, rows, canvasPadding, moduleStrokeThickness, circleCount, mouduleAlpha) {\n grid = new Grid(\n moduleSize,\n padding,\n colNum,\n rowNum,\n canvasPadding,\n 1,\n 10,\n 100\n );\n // grid must be rendered after colorMode is set or else its generateColor function generates in RBG instead of HSB\n\n //assign the background color HSBA vals\n bgH = 225;\n bgS = 95;\n bgB = 2.5;\n bgA = 100;\n}", "title": "" }, { "docid": "a4405d1cc6f0024bc08beafb1951bd2b", "score": "0.64482725", "text": "function makeGrid(rows, columns) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-columns', columns);\n\n for (c = 0; c < (rows * columns); c++) {\n let cell = document.createElement('div');\n container.appendChild(cell).className = \"grid-item\";\n };\n\n //function to change the color of the grid items as the mouse moves over them\n //brightness decreases each time user hovers until item is black using filter\n const colorChange = document.querySelectorAll(\".grid-item\");\n for (var i = 0; i < colorChange.length; i++) { //iterate through the items\n colorChange[i].addEventListener(\"mouseover\", function (e) {\n let brightness = getComputedStyle(e.target).getPropertyValue(\"filter\").split(/\\(([^)]+)\\)/);\n\n if (brightness == \"none\") { // check to see current brightness\n e.target.style.backgroundColor = 'hsl(0, 3%, 93%)';\n e.target.style.filter = \"brightness(1)\"; //set initial brightness to 1\n } else if (brightness[1] > 0) {\n e.target.style.filter = `brightness(${brightness[1] - 0.1})`; //decrease brightness of item\n }\n\n });\n };\n\n}", "title": "" }, { "docid": "302eb3ad883a34c7bb46321bf33c6fa5", "score": "0.64399487", "text": "function clearGrid() {\r\n for (let i = 0; i < gridCells.length; i++) {\r\n if (gridCells[i].style.backgroundColor !== defaultGridColor) {\r\n gridCells[i].style.backgroundColor = defaultGridColor;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7678aa7e2141a1a316350befa335e4f4", "score": "0.6429698", "text": "function drawGradientGrid(){\n for (var i = 0; i <= width; i+=8) {\n var inter = map(i, 0, width, 0, 1);\n var c = lerpColor(c1, c2, inter);\n stroke(c);\n fill(c);\n for(var j = 0; j <= height; j+=8){\n ellipse(i,j,2);\n }\n }\n}", "title": "" }, { "docid": "80b83dc33784944db0e19d92822b7823", "score": "0.6418973", "text": "function noicemapcolor() {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n for (let y = 0; y < 100; y++) {\n for (let x = 0; x < 100; x++) {\n ctx.fillStyle = rndrgb();\n ctx.fillRect(x * 10, y * 10, 100, 100);\n }\n }\n}", "title": "" }, { "docid": "174347a5607d1934c649ecbcac4952cb", "score": "0.6410739", "text": "function drawGrid(){\n\tfor(var i =0; i<6; i++){\n\t\tfor(var j = 0; j<7; j++){\n\t\t\tctx.strokeRect(j*gridSize, i*gridSize+40, gridSize, gridSize);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "eb22d97211373862ddcd196204ba39f7", "score": "0.6409913", "text": "function drawGrid(){\n for (let i = 0; i <= this.bw; i += 40) {\n this.context.moveTo(0.5 + i, 0);\n this.context.lineTo(0.5 + i, this.bh);\n }\n\n for (let j = 0; j <= this.bh; j += 40) {\n this.context.moveTo(0, 0.5 + j);\n this.context.lineTo(this.bw + 0, 0.5 + j);\n }\n this.context.strokeStyle = \"black\";\n this.context.stroke();\n\n this.context.fillStyle = \"green\";\n this.context.fillRect(561,1,39,39);\n\n this.context.fillStyle = \"red\";\n this.context.fillRect(1,561,39,39);\n}", "title": "" }, { "docid": "b2b38e4518718d1f1521f94ee233534c", "score": "0.64090943", "text": "function setUpGrid() {\n\n // Get the num of boxes width for the grid from the root variable in the style file\n let rt = window.getComputedStyle(document.documentElement);\n let sq = rt.getPropertyValue(\"--grid-width-sq\");\n\n const container = document.querySelector(\"#canvas\");\n // Clear the canvas\n container.innerHTML = \"\";\n\n // Make one box for each unit in the area\n // Area = length ** 2\n for (let i = 0; i < Math.pow(sq, 2); i++) {\n\n let box = document.createElement(\"div\");\n // Keep record of which number box it is\n box.setAttribute('id', i.toString());\n\n box.classList.add('gridBox');\n container.appendChild(box);\n\n }\n\n // Draw the borders, if it is selected\n let borderBtn = document.querySelector(\"#border\");\n if (borderBtn.checked) {\n addBorders();\n } else {\n removeBorders();\n }\n\n // Set the default paint to whatever is currently chosen\n let colorRadios = document.querySelectorAll(\"#colorForm input[type=radio]\");\n for (let i = 0; i < colorRadios.length; i++) {\n if (colorRadios[i].checked) {\n setPaints(colorRadios[i]);\n }\n }\n\n let icon = document.querySelector(\"#paintbrush\");\n\n container.addEventListener(\"click\", (e) => {\n painting = !painting;\n if (!painting) {\n icon.classList.add(\"hide\");\n } else {\n icon.classList.remove(\"hide\");\n }\n });\n\n if (!painting) {\n icon.classList.add(\"hide\");\n } else {\n icon.classList.remove(\"hide\");\n }\n\n // Report that it has loaded\n loaded = true;\n}", "title": "" }, { "docid": "4021842f2ec252fc2ffefb307d8ecd9b", "score": "0.64066154", "text": "function updateColors() {\n for (var i = 0; i < displayed.length - 1; i++) {\n DOM.style(\"#\" + divIds[displayed[i]], \"color\", divCollection.lowColor);\n DOM.style(\"#\" + divIds[displayed[i]], \"backgroundColor\", divCollection.lowBackgroundColor);\n }\n DOM.style(\"#\" + divIds[displayed[displayed.length - 1]], \"color\", divCollection.topColor);\n DOM.style(\"#\" + divIds[displayed[displayed.length - 1]], \"backgroundColor\", divCollection.topBackgroundColor);\n }", "title": "" }, { "docid": "7b291a487a9e2283fd85c302e8722fec", "score": "0.6397531", "text": "function makeGrid() {\n for (let r = 0; r < height.value; r++) {\n const row = canvas.insertRow(r);\n for (let c = 0; c < width.value; c++) {\n const cell = row.insertCell(c);\n\n function fillSquare(event) {\n var str1 = 'background-color:';\n var str2 = color.value;\n\n cell.setAttribute(\"style\", str1.concat(str2));\n }\n cell.addEventListener(\"click\", fillSquare)\n }\n }\n\n}", "title": "" }, { "docid": "3ebd60c5378f9376f532b313bdb58067", "score": "0.6393902", "text": "function getCleanGrid(){\nlet cleanPixels = gridContainer.querySelectorAll('div');\ncleanPixels.forEach(griditem=> griditem.style.backgroundColor = '#ffffff');\n}", "title": "" }, { "docid": "7d228fdfd3c58b68c7a224146f25d81c", "score": "0.6393489", "text": "function randomColours() {\n for(var i = 0; i <= 5; i++) {\n if (squares[i].id !== square.id) {\n squares[i].style.backgroundColor = rgb();\n }\n}\n}", "title": "" }, { "docid": "88416a719accd91ab899e9d0f2fe15cc", "score": "0.63901556", "text": "function updateGrid() {\n ctx.clearRect(0, 0, W, H);\n if (N == 15) {\n ctx.fillStyle = \"rgba(0, 0, 0, 0.5)\";\n ctx.fillRect(0, 0, W, H);\n ctx.clearRect(60, 60, 507, 507);\n }\n\n for (var y_grid = 0; y_grid < N; y_grid++) {\n for (var x_grid = 0; x_grid < N; x_grid++) {\n drawStone(x_grid + adjust_grid, y_grid + adjust_grid, grid[y_grid][x_grid], 0, 0);\n }\n }\n}", "title": "" }, { "docid": "0a8e5d9e5b574295e8c0950a58788d4e", "score": "0.63871753", "text": "function drawGrid() {\r\n for (let i = 0; i < arrSize; i++) {\r\n for (let j = 0; j < arrSize; j++) {\r\n noFill();\r\n strokeWeight(2);\r\n let val = grid[i][j];\r\n let s = val.toString();\r\n if (grid_new[i][j] === 1) {\r\n stroke(200, 0, 200);\r\n strokeWeight(16);\r\n grid_new[i][j] = 0;\r\n } else {\r\n strokeWeight(4);\r\n stroke(0);\r\n }\r\n\r\n if (val != 0) {\r\n fill(\"lightblue\");\r\n } else {\r\n noFill();\r\n }\r\n rect(i * width, j * width, width, width, 5);\r\n if (val !== 0) {\r\n textAlign(\"CENTER\", \"CENTER\");\r\n noStroke();\r\n fill(0);\r\n textSize(fontSize);\r\n text(\r\n val,\r\n i * width + width / 2 - width / 10,\r\n j * width + width / 2 + width / 10\r\n );\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "43c57d51f737ef9deb3bd5304556babc", "score": "0.63789046", "text": "glider (color) {\n const { x, y } = randomPosition()\n\n let tx = x - 1 > 0 ? x - 1 : COLUMNS - 1\n let ty = y - 1 > 0 ? y - 1 : ROWS - 1\n // 2 (1, 0)\n this.colors[x][ty] = color\n // 5 (0, 2)\n tx = x - 1 > 0 ? x - 1 : COLUMNS - 1\n ty = y + 1 < ROWS ? y + 1 : 0\n this.colors[tx][ty] = color\n // 6 (2, 2)\n tx = x + 1 < COLUMNS ? x + 1 : 0\n this.colors[tx][ty] = color\n // 7 (1, 2)\n this.colors[x][ty] = color\n // 8 (2, 1)\n this.colors[tx][y] = color\n\n }", "title": "" }, { "docid": "45743513e1aaa02e97af8594f1963f93", "score": "0.6378616", "text": "function colorBoard(){\n\tfor(var i = 0; i < 4; i++){ //outer loop over rows\n\t\tfor(var j = 0; j < 4; j++){ //inner loop over columns\n\t\t\tif(board[i][j]===\"\"){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#C0C0C0\";\n\t\t\t}\n\t\t\tif(board[i][j]===2){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#eee4da\";\n\t\t\t}\n\t\t\tif(board[i][j]===4){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#FF0000\";\n\t\t\t}\n\t\t\tif(board[i][j]===8){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#f59563\";\n\t\t\t}\n\t\t\tif(board[i][j]===16){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#3399ff\";\n\t\t\t}\n\t\t\tif(board[i][j]===32){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#ffa333\";\n\t\t\t}\n\t\t\tif(board[i][j]===64){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#cef030\";\n\t\t\t}\n\t\t\tif(board[i][j]===128){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#800080\";\n\t\t\t}\n\t\t\tif(board[i][j]===256){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#990303\";\n\t\t\t}\n\t\t\tif(board[i][j]===512){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#6ba5de\";\n\t\t\t}\n\t\t\tif(board[i][j]===1024){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#dcad60\";\n\t\t\t}\n\t\t\tif(board[i][j]===2048){\n\t\t\t\tvar boardID = \"r\"+i+\"c\"+j; //build the ID string\n\t\t\t\tdocument.getElementById(boardID).style.background = \"#b60022\";\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "ed5eb087a4c62830bca636143e174abe", "score": "0.63785017", "text": "generateGrayGrids() {\n for (let numberOfGrayGrids = 0; numberOfGrayGrids < 10; numberOfGrayGrids++) {\n const coordinates = this.generatePosXY();\n const x = coordinates[0];\n const y = coordinates[1];\n this.grids[x][y] = 'grayGrid'; // Occupies location of the gray grids on the map\n }\n }", "title": "" }, { "docid": "23e63cf0eb0fb10fa7104cb3e1e387fa", "score": "0.63764334", "text": "_prepareColorShades(min, max) {\r\n let step = (max - min) / 5;\r\n this._shades = [];\r\n for (let i = 0; i < 5; i++) {\r\n this._shades.push(max - i * step);\r\n }\r\n }", "title": "" }, { "docid": "38613cf8de2b12caa6ff8f891c7e7106", "score": "0.63677424", "text": "makeGridCorrectLayer() {\n return {\n id: 'change-grid',\n type: 'fill',\n source: {\n type: 'geojson',\n data: this.squareGridGeoJSON\n },\n layout: {},\n paint: {\n 'fill-color': [\n 'match',\n ['get', 'v'],\n 1, this.selectedBox,\n /* other */ this.defaultGreyBox\n ],\n 'fill-opacity': 0.5\n }\n };\n }", "title": "" }, { "docid": "3934dcb50a1f67ed343c63f49839a8f7", "score": "0.6362149", "text": "function makeGrid(height, width) {\n for (let x = 0; x < height; x++) {\n let row = canvas.insertRow(x);\n for (let y = 0; y < width; y++) {\n let cell = row.insertCell(y);\n cell.addEventListener('click', function (event) {\n cell.style.backgroundColor = color.value;\n });\n }\n }\n}", "title": "" }, { "docid": "31f94e893480062f4ea5f11e8bec2855", "score": "0.6357567", "text": "function drawGrid() {\n startTime();\n\n background(255);\n for (var i = 0; i < cols; i++) {\n for (var j = 0; j < rows; j++) {\n grid[i][j].show();\n }\n }\n for (var i = 0; i < closedSet.length; i++) {\n closedSet[i].show(color(255, 0, 0, 50));\n }\n for (var i = 0; i < openSet.length; i++) {\n openSet[i].show(color(0, 255, 0, 50));\n }\n\n recordTime(\"Draw Grid\");\n}", "title": "" }, { "docid": "b04ba4a55ce7e97779d87564dccecf56", "score": "0.6354092", "text": "function changeColors(color){\n for(let i = 0; i < squares.length; i ++){\n squares[i].backgroundColor = color;\n }\n}", "title": "" }, { "docid": "b48c4df89a4f2e257f1100035b47c88d", "score": "0.6350092", "text": "function changeColors(color){\n for(var i =0; i<squares.length;i++){\n squares[i].style.backgroundColor = color;\n }\n }", "title": "" }, { "docid": "072fadf3b07ff994ccc218c1916481f6", "score": "0.6343167", "text": "function changeAllCells() {\n //saving all grid locations\n let cells = document.getElementsByTagName(\"td\");\n let allCells = [...cells];\n\n //setting color for uncolored squares\n allCells.forEach((cell) => {\n cell.style.backgroundColor = currentColor;\n cell.classList.remove(\"no-color\");\n });\n}", "title": "" }, { "docid": "6e281e0d4a3fe7c75369f5e15b83506e", "score": "0.63407105", "text": "function setTiles() {\r\n for (i = 0; i < 8; i++) {\r\n tiles[i] = [];\r\n for (j = 0; j < 8; j++) {\r\n tiles[i][j] = findColor();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "8bc9156c1dfe54693c9c918cbf5debad", "score": "0.632064", "text": "function changeColor() {\n if(sudMethodsObj.affectedRows.length > 0){\n for(let j = 0; j < sudMethodsObj.affectedRows.length; j++){\n for(let i = 0; i < 9; i++){\n let currentCoord = `[${i},${sudMethodsObj.affectedRows[j]}]`;\n document.getElementById(`${currentCoord}`).style.backgroundColor = \"#ff997a\";\n }\n }\n } \n if(sudMethodsObj.affectedColumns.length > 0){\n for(let i = 0; i < sudMethodsObj.affectedColumns.length; i++){\n for(let j = 0; j < 9; j++){\n let currentCoord = `[${sudMethodsObj.affectedColumns[i]},${j}]`;\n document.getElementById(`${currentCoord}`).style.backgroundColor = \"#ff997a\"; \n }\n }\n }\n }", "title": "" }, { "docid": "351ae664b68912ce81fe5792aa31c3c9", "score": "0.6318287", "text": "function initGrid() {\n grid = new Array();\n for (var a = 0; a <= largeurGrid; a++) {\n grid[a] = new Array();\n for (var b = 0; b <= hauteurGrid; b++) {\n grid[a][b] = '';\n var hauteur = (difficulte == 'moyen') ? 2 : 4;\n if (b > (hauteurGrid/hauteur) && (Math.random() * 9) > 4 && difficulte != 'facile') {\n grid[a][b] = 'grey';\n }\n }\n }\n }", "title": "" }, { "docid": "14b4f44996f602d64cbbf86368689afe", "score": "0.6317537", "text": "function changeColors(color) {\n\t//loop through all squares\n\tfor(i=0; i<squares.length; i++) {\n\t\t//change each color to match goal color\n\t\tsquares[i].style.backgroundColor = color;\t\n\t}\n}", "title": "" }, { "docid": "b893ed2f85b2b6c937f6e43eede8510f", "score": "0.6310456", "text": "function paintBoard(state) {\n for (var i = 0; i < gridSize; i++) {\n for (var j = 0; j < gridSize; j++) {\n if (lavaArray.indexOf(JSON.stringify([i, j])) != -1) {\n scene.getObjectByName(\"cells\").getObjectByName((j + i * 19).toString()).material.color = new THREE.Color('gray');\n } else if (terminalState.indexOf(JSON.stringify([i, j])) != -1) {\n scene.getObjectByName(\"cells\").getObjectByName((j + i * 19).toString()).material.color = new THREE.Color('white');\n } else {\n scene.getObjectByName(\"cells\").getObjectByName((j + i * 19).toString()).material.color = new THREE.Color('black');\n }\n }\n }\n scene.getObjectByName(\"cells\").getObjectByName((state[0] * 19 + state[1]).toString()).material.color = new THREE.Color('silver');;\n}", "title": "" }, { "docid": "eb70b61f256cf7806974394e95435429", "score": "0.62990695", "text": "function populate_empty_canvas(grid_canv_name){\n for (var i=0; i<L; i+=1) {\n for (var j=0; j<L; j+=1) {\n let boxstr = grid_canv_name+i+j;\n $(boxstr).css(\"background-image\", 'url(assets/empty.png)');\n }\n }\n}", "title": "" }, { "docid": "3cb2f55a869f12eb124794102415d80c", "score": "0.6292927", "text": "function changeColors(color) {\n\t\tfor(var i = 0; i < squares.length; i++) {\n\t\t\tsquares[i].style.backgroundColor = color;\n\t\t}\n\t}", "title": "" }, { "docid": "058fe792f298f5b5b2fd51f9da205d8d", "score": "0.62838966", "text": "function changeColors(color){\r\n for(var i = 0; i < squares.length; i++){\r\n squares[i].style.backgroundColor = color;\r\n }\r\n}", "title": "" }, { "docid": "06bbc6eb72b4642e93a864255a0fbd7b", "score": "0.6283116", "text": "function setColor()\n{\n\tfor(var i = 0; i<squares.length;i++)\n\t{\n\t\tif(colorList[i])\n\t\t{\n\t\t\tsquares[i].style.display = \"block\";\n\t\t\tsquares[i].style.backgroundColor = colorList[i];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsquares[i].style.display = \"none\";\n\t\t}\n\t}\n\t\t\n}", "title": "" }, { "docid": "4aefe2cbf85b0771ef09e1b0c1da0387", "score": "0.6281332", "text": "function main() {\n colors = [\n '#6dfdcf', '#6cfbc8', '#6cf9c1', '#6bf7ba', '#6af5b3',\n '#68f3ac', '#67f1a5', '#66ee9e', '#64ec97', '#62ea90',\n '#60e889', '#5ee682', '#5ce47b', '#5ae273', '#58e06c',\n '#55de65', '#52dc5d', '#4fda55', '#4cd84d', '#49d645',\n '#45d43c', '#41d232', '#3dd027', '#38ce19', '#33cc00',\n '#42ce00', '#4fd100', '#5ad300', '#65d500', '#6ed700',\n '#77da00', '#80dc00', '#88de00', '#91e000', '#99e200',\n '#a1e500', '#a8e700', '#b0e900', '#b7eb00', '#bfed00',\n '#c6ef00', '#cdf100', '#d4f300', '#dcf500', '#e3f700',\n '#eaf900', '#f1fb00', '#f8fd00', '#ffff00', '#fffb00',\n '#fff700', '#fff300', '#ffee00', '#ffea00', '#ffe600',\n '#ffe200', '#ffde00', '#ffda00', '#ffd500', '#ffd100',\n '#ffcd00', '#ffc900', '#ffc500', '#ffc000', '#ffbc00',\n '#ffb800', '#ffb300', '#ffaf00', '#ffab00', '#ffa600',\n '#ffa200', '#ff9d00', '#ff9900', '#ff9600', '#ff9200',\n '#ff8f00', '#ff8b00', '#ff8800', '#ff8400', '#ff8000',\n '#ff7d00', '#ff7900', '#ff7500', '#ff7100', '#ff6d00',\n '#ff6900', '#ff6500', '#ff6100', '#ff5c00', '#ff5700',\n '#ff5300', '#ff4d00', '#ff4800', '#ff4200', '#ff3c00',\n '#ff3500', '#ff2d00', '#ff2400', '#ff1700', '#ff0000'\n ];\n // this is a variable for the center of nz, which the map defaults to\n centerNZ = {\n lat: -41.0,\n lng: 172.8333\n };\n // main map object. This builds the actual map,\n // but has no role in getting the data.\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 5,\n center: centerNZ,\n streetViewControl: false,\n // these styles change what can be visible on the map.\n // Currently it is set to disable landmark objects, highway signs etc,\n // while still visualizing their terrain (e.g. geometry.fill and .stroke are both on)\n styles: [\n {\n \"featureType\": \"poi\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n }\n ]\n });\n\n pc = new PageController();\n\n // this is a call to get the data for the map.\n pc.initMap();\n}", "title": "" }, { "docid": "cce319c389d93f99f964cd59547cd866", "score": "0.6280665", "text": "function changeColors(color) {\n // Loop through all squares\n squares.forEach(square => {\n //Change each color to match given color\n square.style.backgroundColor = color;\n })\n}", "title": "" }, { "docid": "0f8f8d53d4f91100c58348993abb1f84", "score": "0.6277512", "text": "function changecolor(colors){\n for(var j=0;j<square.length;j++){\n square[j].style.background=colors;\n }\n}", "title": "" }, { "docid": "f4e3452c984e61f269223f6a591423f0", "score": "0.62735426", "text": "function drawMap(grid) {\r\n for(let col = 0; col < grid.length; col++) {\r\n for(let row = 0; row < grid[col].length; row++) {\r\n let cell = grid[col][row];\r\n if(cell) {\r\n ctx.fillStyle = '#FFE4B5';\r\n } else {\r\n ctx.fillStyle = '#CD853F';\r\n }\r\n ctx.fillRect(row * tileSize, col*tileSize, tileSize, tileSize);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "76777d81b3bd66c8d6c1e49ad3a35eff", "score": "0.62735397", "text": "function drawGrid() {\n stroke(ht2Color);\n strokeWeight(2);\n\n for (let i = Math.floor(borders.xMin); i < Math.floor(borders.xMax) + 1; i++) {\n for (let j = Math.floor(borders.yMin); j < Math.floor(borders.yMax) + 1; j++) {\n if (i % gridSkip == 0 && j % gridSkip == 0) {\n let p = toScreenCoord(i, j);\n point(p.x, p.y);\n }\n }\n }\n}", "title": "" }, { "docid": "0b530839905c54d70dd468e8a83dc32c", "score": "0.62719303", "text": "function changeColors(color) {\n for (let i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n }\n}", "title": "" }, { "docid": "e50e3e78888aed6ee66b784b4314fb4d", "score": "0.6268454", "text": "function changeColors(color) {\n\t// loop squares\n\tsquares.forEach(function(el) {\n\t\tel.style.backgroundColor = color;\n\t});\n}", "title": "" }, { "docid": "02b90920679f4a04c9236cbdef536c24", "score": "0.626362", "text": "function colorCells(o1,o2,o3){\n o1.addClass('win');\n o2.addClass('win');\n o3.addClass('win'); \n}", "title": "" }, { "docid": "2b253b709431516602271bba110db09d", "score": "0.6263081", "text": "function changeToSameColor(color){\n // loop through all squares\nfor(let i=0; i < colors.length; i++){\n// change each color to match given color\nsquares[i].style.backgroundColor = color;\n}\n}", "title": "" }, { "docid": "c4b65062caf109d39494cf8ddb271c38", "score": "0.6262201", "text": "function makeBlackScaledGrid(gridSize) {\n removeCells();\n document.getElementById('grid-div').style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n document.getElementById('grid-div').style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n\n for (i = 0; i < gridSize * gridSize; i++) {\n const blackCell = document.createElement('div');\n blackCell.classList.add('black-cell');\n gridDiv.append(blackCell);\n // hover effect on gridCell to make it change color upon hovering over it\n let rgbNumber = 250;\n blackCell.addEventListener('mouseover', function(e) {\n \n if (rgbNumber > 0) {\n rgbNumber -= 25;\n blackCell.style.backgroundColor = `rgb(${rgbNumber}, ${rgbNumber}, ${rgbNumber})`;\n }\n });\n };\n\n}", "title": "" }, { "docid": "67d5bb9e1749d18a9c4658ff373b41bc", "score": "0.62618107", "text": "function changeColors(color){\r\n for(var i=0; i<squares.length; i++){\r\n squares[i].style.backgroundColor = color;\r\n }\r\n}", "title": "" }, { "docid": "67abd7128fae3b8f93f2d5580e3ccb12", "score": "0.6251781", "text": "function createGrid(number, color = \"black\") {\n gridContainer.style.cssText = `grid-template-columns: repeat(${number}, 1fr); grid-template-rows: repeat(${number}, 1fr)`;\n // create the divs inside the grid\n for (let i = 1; i <= number ** 2; i++) {\n const gridItem = document.createElement(\"div\");\n gridContainer.append(gridItem);\n // gridItem.style.border = \"1px solid rgba(225,225,225, .3)\";\n gridItem.addEventListener(\n \"mouseover\",\n () => (gridItem.style.backgroundColor = generateRandomColor())\n );\n // Clear grid\n const clearGrid = document.getElementById(\"clear-grid\");\n clearGrid.addEventListener(\n \"click\",\n () => (gridItem.style.backgroundColor = \"white\")\n );\n }\n}", "title": "" } ]
823aeae0ab64f89a89d79cb887e83afa
Loop de desenho dos frames
[ { "docid": "1c97455b71295bdfd5f913bbeea650fb", "score": "0.0", "text": "function draw() {\n ship.move(); \n controller.watchTheHour(sky);\n \n // Para entender como funciona a função forEach veja: \n // https://clovisdasilvaneto.github.io/explorando-javascript-filter-reduce-map-every-some-e-foreach\n sky.render((elements) => elements.forEach((el) => { el.move(); el.render(); }));\n}", "title": "" } ]
[ { "docid": "9b9a161e3bdd6e8864fc93ff054fe6d5", "score": "0.72342825", "text": "function stepFrames(e) {\n\n\tgifContainers.each(function(index){\n\t\tif ($(this).attr('data-speed') > 0) {\n\t\t\tmod = $(this).attr('data-speed');\n\t\t} else {\n\t\t\tmod = 4;\n\t\t}\n\t\tpos = ($(this).offset().top - win.scrollTop()) / (win.height() / mod);\n\t\tcount = $(this).attr('data-frames');\n\t\tif (pos <= mod && pos >= (0-mod)) {\n\t\t\trel = 1 - pos.doMod(1);\n\t\t\tsetBgSpriteFrame($(this), Math.floor(rel*count)%count, (index === 0));\n\t\t}\n\t})\n\n\tdoNavigationTuck();\n\n}", "title": "" }, { "docid": "926d2e72d181c3a58346aa17ee9f9783", "score": "0.7036229", "text": "function frame() {\n if (pos == frames) {\n // al terminar eliminamos el intervalo y eliminamos las bolas \n clearInterval(id);\n eliminarBolas();\n } else {\n animar(\"bola\" + bolas[pos++], 400, crearNumAleatorio(100, 300));\n }\n }", "title": "" }, { "docid": "e33d72272c44b0388be34f91537898dd", "score": "0.6682355", "text": "function loadFrames(){}", "title": "" }, { "docid": "ebbcd4dd534fe250f5279eee8675ca49", "score": "0.66710216", "text": "function frame_loop() {\n\t\t// get cached objects\n\t\tframe_loop.cache = frame_loop.cache || [];\n\t\tframe_loop.cache[this] = frame_loop.cache[this] || { first: new Date().getTime(), count: 0 };\n\t\tvar cache = frame_loop.cache[this];\n\t\tvar start = new Date().getTime();\n\t\t\n\t\tif (!this.isSuspended()) {\n\t\t\t// call built-in functions\n\t\t\tthis.processSprites();\n\t\t\tthis.processMovement();\n\t\t\tthis.paintBackground();\n\t\t\tthis.paintSprites();\n\t\t\tthis.paintForeground();\n\t\t\tvar textopt = this.getCurrentText();\n\t\t\tif (textopt) {\n\t\t\t\tpaint_text(this, textopt, cache.count);\n\t\t\t}\n\t\t\tthis.processInput();\n\t\t\t\n\t\t\t// call user-defined function\n\t\t\tvar onframe = this.getOptions().onframe;\n\t\t\tif (onframe && $.isFunction(onframe)) {\n\t\t\t\tsafe_execute(this, $.Linka.Constants.ERROR_RUNTIME, function() { onframe.call(this, cache.count); });\n\t\t\t};\n\n\t\t\t// process map transitions last since they subvert the frame loop\n\t\t\tthis.processMapTransitions();\n\t\t}\n\t\t\n\t\t// calculate timing for next frame\n\t\tvar finish = new Date().getTime();\n\t\tvar time_for_this_frame = finish - start;\n\t\tvar delay_for_next_frame = this.getFrameSlice() - time_for_this_frame;\n\t\tif (delay_for_next_frame < 0) {\n\t\t\tdelay_for_next_frame = 0;\n\t\t}\n\t\t//this.debug('Start: ' + start + ' - Finish: ' + finish + ' - Next frame in: ' + delay_for_next_frame);\n\n\t\t// update actual framerate\t\t\n\t\tcache.count++;\n\t\tvar fps = cache.count / ((finish - cache.first) / 1000);\n\t\tthis.setActualFramerate(fps);\n\t\t//this.debug('FPS: ' + fps); \n\t\t\n\t\t// if we're still active, jump back into the frame loop\n\t\tif (this.isActive()) {\n\t\t\tvar self = this;\n\t\t\twindow.setTimeout(function() { frame_loop.call(self); }, delay_for_next_frame);\n\t\t}\n\t}", "title": "" }, { "docid": "68de2e8072400bab92ed183c4ddc005a", "score": "0.6585122", "text": "function animationLoop() {\n layout.step();\n renderOneFrame();\n requestAnimFrame(animationLoop);\n }", "title": "" }, { "docid": "1d7e29fd6cacf138cf92d8984020a4db", "score": "0.65460324", "text": "function showFrames(){\n\t\t$('.timeline-frames-container').empty();\n\t\tfor (var i = displayStartIndex; i <= displayEndIndex; i++) {\n\t\t\tvar frame = $('<div></div>')\n\t\t\t\t.addClass('timeline-frame')\n\t\t\t\t.attr('id', 'timeline-frame-' + i)\n\t\t\t\t.attr('data-id', i)\n\t\t\t\t.attr('data-frame-id', timelineFrames[i].id)\n\t\t\t\t.attr('title', 'Go to frame ' + timelineFrames[i].id)\n\t\t\t\t.append('<div class=\"timeline-frame-indicator\"></div>')\n\t\t\t\t.append('<span class=\"timeline-frame-number\">' + timelineFrames[i].id + '</span>');\n\t\t\t\n\t\t\tif(timelineFrames[i].people.length > 0){\n\t\t\t\tframe.addClass('people');\n\t\t\t}\n\t\t\t\n\t\t\tif(i == currentFrame){\n\t\t\t\tframe.addClass('current');\n\t\t\t\tloadPeople(timelineFrames[i].people)\n\t\t\t}\n\t\t\t\n\t\t\t//On click change frame\n\t\t\tframe.click(function(){\n\t\t\t\tselectFrame($(this).data('id'));\n\t\t\t});\n\t\t\t\t\n\t\t\t$('.timeline-frames-container').append(frame);\n\t\t}\n\t\t$('.timeline-loading').remove();\n\t\tcenterTimeline();\n\t\tupdateCursor();\n\t}", "title": "" }, { "docid": "5917925ea5d5ebbedd63e63572d5618e", "score": "0.6544486", "text": "async function nframe(i) {\n mesh.geometry.attributes.color.needsUpdate = true;\n const leftids = ids.length - i;\n const leftt = endtime - frametime;\n const rate = leftids / leftt;\n const newids = Math.ceil(rate * framedelta);\n nextIdStop = i + newids;\n // log ('nframe', {leftids, leftt, rate, newids});\n await S.frame();\n }", "title": "" }, { "docid": "2e5d95992bab1cdce9f6e5f2e7c15f97", "score": "0.65441906", "text": "loop() {\n if (this.state.currentFrame >= this.state.images.length - 1) {\n this.setState({\n currentFrame: 0,\n });\n } else {\n this.setState(prev => ({\n currentFrame: prev.currentFrame + 1,\n }));\n }\n }", "title": "" }, { "docid": "584462b04f70853673fc81861d7f20f0", "score": "0.6540814", "text": "function stepframes() {\n\t\tvar j;\n\t\tif(timeout_id) {\n\t\t clearTimeout(timeout_id);\n\t\t timeout_id = null;\n\t\t}\n\t\tframe = (frame + dir + imageSum) % imageSum;\n\t\tj = frame + 1;\n\t\t\n\t\tif(images[frame].complete) {\n\t\t $('div#animation').html('<img id=\"'+frame+'\" style=\"width:'+settings.width+'px;height:'+settings.height+'px\" src=\"'+images[frame].src+'\" style=\"float:left;position:relative;z-index:10;\" />');\n\t\t $('.label #playlabel').html('step: '+j+' of '+imageSum);\n\t\t $('#slider').slider('option','value',frame);\n\t\t \n\t\t if(swingon && (j == imageSum || frame == 0)) {\n\t\t\treverse();\n\t\t }\n\t\t \n\t\t playing = 0;\n\t\t}\n\t }", "title": "" }, { "docid": "18f9f5245a1f95d132be116bf9093e26", "score": "0.6507401", "text": "function goToLastFrame() {\n var fr = project.currentFrame();\n\n fr--;\n\n if (fr < 0) {\n\n if (loop == true) {\n fr = $(\"#frame\").prop(\"max\") * 1;\n } else {\n\n }\n }\n\n goToFrame(fr);\n\n}", "title": "" }, { "docid": "b5193da88e7e212a62ef144b06389335", "score": "0.6486192", "text": "function printHtml(motivo){\n var frameStringList=\"\";\n var frameOutput = document.getElementById(\"frameDataList\");\n frameStringList += \"<h3> motivo : \" + motivo.toString() + \"</h3>\";\n console.log(lung);\n var previousFrame;\n for (var i = 0; i< lung; i++ ){\n //stampa a video tutti i frame\n console.log(i);\n frameStringList += \"<h1>index n \" + i + \"</h1><h3>Frame data:</h3><div>\";\n \n var frameString = \"Frame ID: \" + listFrame[(testa+i)%max].id + \"<br />\"\n + \"Timestamp: \" + listFrame[(testa+i)%max].timestamp + \" &micro;s<br />\"\n + \"Hands: \" + listFrame[(testa+i)%max].hands.length + \"<br />\"\n + \"Fingers: \" + listFrame[(testa+i)%max].fingers.length + \"<br />\"\n + \"Tools: \" + listFrame[(testa+i)%max].tools.length + \"<br />\"\n + \"Gestures: \" + listFrame[(testa+i)%max].gestures.length + \"<br />\";\n\n\n // Frame motion factors\n /* if (previousFrame && previousFrame.valid) {\n var translation = frame.translation(previousFrame);\n frameString += \"Translation: \" + vectorToString(translation) + \" mm <br />\";\n\n var rotationAxis = frame.rotationAxis(previousFrame);\n var rotationAngle = frame.rotationAngle(previousFrame);\n frameString += \"Rotation axis: \" + vectorToString(rotationAxis, 2) + \"<br />\";\n frameString += \"Rotation angle: \" + rotationAngle.toFixed(2) + \" radians<br />\";\n\n var scaleFactor = frame.scaleFactor(previousFrame);\n frameString += \"Scale factor: \" + scaleFactor.toFixed(2) + \"<br />\";\n }\n */\n frameStringList +=frameString + \"</div>\" +\n \"<div style='clear:both;'></div><h3>Hand data:</h3><div>\";\n \n \n \n \n\n // Display Hand object data\n var handString = \"\";\n var n =listFrame[(testa+i)%max].hands.length;\n if (n> 0) {\n\n for (var j = 0; j <n ; j++) {\n var hand = listFrame[(testa+i)%max].hands[j];\n\n handString += \"<div style='width:300px; float:left; padding:5px'>\";\n handString += \"Hand ID: \" + hand.id + \"<br />\";\n //right or left\n handString += \"Type: \" + hand.type + \" hand\" + \"<br />\";\n \n //what is the difference between those?\n //the Hand palmNormal() and direction() vectors define the orientation of the hand.\n handString += \"Direction: \" + vectorToString(hand.direction, 2) + \"<br />\";\n handString += \"Palm position: \" + vectorToString(hand.palmPosition) + \" mm<br />\";\n \n //\n handString += \"Grab strength: \" + hand.grabStrength + \"<br />\";\n handString += \"Pinch strength: \" + hand.pinchStrength + \"<br />\";\n \n handString += \"Confidence: \" + hand.confidence + \"<br />\";\n \n handString += \"Arm direction: \" + vectorToString(hand.arm.direction()) + \"<br />\";\n handString += \"Arm center: \" + vectorToString(hand.arm.center()) + \"<br />\";\n handString += \"Arm up vector: \" + vectorToString(hand.arm.basis[1]) + \"<br />\";\n\n // Hand motion factors\n /* if (previousFrame && previousFrame.valid) {\n var translation = hand.translation(previousFrame);\n handString += \"Translation: \" + vectorToString(translation) + \" mm<br />\";\n\n var rotationAxis = hand.rotationAxis(previousFrame, 2);\n var rotationAngle = hand.rotationAngle(previousFrame);\n handString += \"Rotation axis: \" + vectorToString(rotationAxis) + \"<br />\";\n handString += \"Rotation angle: \" + rotationAngle.toFixed(2) + \" radians<br />\";\n\n var scaleFactor = hand.scaleFactor(previousFrame);\n handString += \"Scale factor: \" + scaleFactor.toFixed(2) + \"<br />\";\n }\n*/\n // IDs of pointables associated with this hand\n \n if (hand.pointables.length > 0) {\n var fingerIds = [];\n for (var j = 0; j < hand.pointables.length; j++) {\n var pointable = hand.pointables[j];\n fingerIds.push(pointable.id);\n }\n if (fingerIds.length > 0) {\n handString += \"Fingers IDs: \" + fingerIds.join(\", \") + \"<br />\";\n }\n }\n\n handString += \"</div>\";\n \n \n }\n }\n else {\n handString += \"No hands\";\n }\n \n frameStringList += handString +\"</div> <div style='clear:both;'></div><h3>Finger and tool data:</h3><div>\";\n \n \n\n // Display Pointable (finger and tool) object data\n var pointableString = \"\";\n if (listFrame[(testa+i)%max].pointables.length > 0) {\n var fingerTypeMap = [\"Thumb\", \"Index finger\", \"Middle finger\", \"Ring finger\", \"Pinky finger\"];\n var boneTypeMap = [\"Metacarpal\", \"Proximal phalanx\", \"Intermediate phalanx\", \"Distal phalanx\"];\n for (var j = 0; j < listFrame[(testa+i)%max].pointables.length; j++) {\n var pointable = listFrame[(testa+i)%max].pointables[j];\n\n pointableString += \"<div style='width:250px; float:left; padding:5px'>\";\n\n if (pointable.tool) {\n pointableString += \"Pointable ID: \" + pointable.id + \"<br />\";\n pointableString += \"Classified as a tool <br />\";\n pointableString += \"Length: \" + pointable.length.toFixed(1) + \" mm<br />\";\n pointableString += \"Width: \" + pointable.width.toFixed(1) + \" mm<br />\";\n pointableString += \"Direction: \" + vectorToString(pointable.direction, 2) + \"<br />\";\n pointableString += \"Tip position: \" + vectorToString(pointable.tipPosition) + \" mm<br />\"\n pointableString += \"</div>\";\n }\n else {\n pointableString += \"Pointable ID: \" + pointable.id + \"<br />\";\n pointableString += \"Type: \" + fingerTypeMap[pointable.type] + \"<br />\";\n pointableString += \"Belongs to hand with ID: \" + pointable.handId + \"<br />\";\n pointableString += \"Classified as a finger<br />\";\n pointableString += \"Length: \" + pointable.length.toFixed(1) + \" mm<br />\";\n pointableString += \"Width: \" + pointable.width.toFixed(1) + \" mm<br />\";\n pointableString += \"Direction: \" + vectorToString(pointable.direction, 2) + \"<br />\";\n pointableString += \"Extended?: \" + pointable.extended + \"<br />\";\n pointable.bones.forEach( function(bone){\n pointableString += boneTypeMap[bone.type] + \" bone <br />\";\n pointableString += \"Center: \" + vectorToString(bone.center()) + \"<br />\";\n pointableString += \"Direction: \" + vectorToString(bone.direction()) + \"<br />\";\n pointableString += \"Up vector: \" + vectorToString(bone.basis[1]) + \"<br />\";\n });\n pointableString += \"Tip position: \" + vectorToString(pointable.tipPosition) + \" mm<br />\";\n pointableString += \"</div>\";\n }\n }\n }\n else {\n pointableString += \"<div>No pointables</div>\";\n }\n \n frameStringList += pointableString + \"</div><div style='clear:both;'></div><h3>Gesture data:</h3><div>\";\n \n \n\n // Display Gesture object data\n var gestureString = \"\";\n if (listFrame[(testa+i)%max].gestures.length > 0) {\n \n for (var j = 0; j < listFrame[(testa+i)%max].gestures.length; j++) {\n var gesture = listFrame[(testa+i)%max].gestures[j];\n gestureString += \"Gesture ID: \" + gesture.id + \", \"\n + \"type: \" + gesture.type + \", \"\n + \"state: \" + gesture.state + \", \"\n + \"hand IDs: \" + gesture.handIds.join(\", \") + \", \"\n + \"pointable IDs: \" + gesture.pointableIds.join(\", \") + \", \"\n + \"duration: \" + gesture.duration + \" &micro;s, \";\n\n switch (gesture.type) {\n case \"circle\":\n gestureString += \"center: \" + vectorToString(gesture.center) + \" mm, \"\n + \"normal: \" + vectorToString(gesture.normal, 2) + \", \"\n + \"radius: \" + gesture.radius.toFixed(1) + \" mm, \"\n + \"progress: \" + gesture.progress.toFixed(2) + \" rotations\";\n break;\n case \"swipe\":\n gestureString += \"start position: \" + vectorToString(gesture.startPosition) + \" mm, \"\n + \"current position: \" + vectorToString(gesture.position) + \" mm, \"\n + \"direction: \" + vectorToString(gesture.direction, 1) + \", \"\n + \"speed: \" + gesture.speed.toFixed(1) + \" mm/s\";\n break;\n case \"screenTap\":\n case \"keyTap\":\n gestureString += \"position: \" + vectorToString(gesture.position) + \" mm\";\n break;\n default:\n gestureString += \"unkown gesture type\";\n }\n gestureString += \"<br />\";\n }\n }\n else {\n gestureString += \"No gestures\";\n }\n frameStringList += gestureString + \"</div>\";\n \n previousFrame=listFrame[(testa+i)%max];\n }\n \n // console.log(frameStringList);\n frameOutput.innerHTML = frameStringList;\n \n \n}", "title": "" }, { "docid": "48b66bdfc89f784e947ff9bb66211163", "score": "0.6467442", "text": "function mainIterFrame(frameTime) {\n g_main.iter(frameTime);\n}", "title": "" }, { "docid": "48b66bdfc89f784e947ff9bb66211163", "score": "0.6467442", "text": "function mainIterFrame(frameTime) {\n g_main.iter(frameTime);\n}", "title": "" }, { "docid": "14fc040010efa8aded26b3371912772a", "score": "0.64558136", "text": "function myLoop () { // create a loop function\n setTimeout(function () { // call a 3s setTimeout when the loop is called\n \t var height = $('.container').height()\n var frame = data[i];\n\n\t\t// var black = frame[\"黑色\"] * 2\n\t\tvar white = frame[\"白色\"] * 2\n\t\tvar yellow = frame[\"黄色\"] * 2\n\t\tvar bblue = frame[\"宝蓝\"] * 2\n\t\tvar red = frame[\"红\"] * 2\n\t\tvar blue = frame[\"蓝\"] * 2\n\t\tvar green = frame[\"绿\"] * 2\n\t\tvar total = frame[\"FIELD8\"] * 2\n\n\t\t// $('.black').css('height', black + 'px')\n\t\t$('.container').height(total + 'px')\n\t\t$('.white').css('height', white + 'px')\n\t\t$('.yellow').css('height', yellow + 'px')\n\t\t$('.bblue').css('height', bblue + 'px')\n\t\t$('.red').css('height', red + 'px')\n\t\t$('.blue').css('height', blue + 'px')\n\t\t$('.green').css('height', green + 'px')\n\n // your code here\n i = i+2; // increment the counter\n if (i < data.length) { // if the counter < 10, call the loop function\n myLoop(); // .. again which will trigger another \n } // .. setTimeout()\n }, 100)\n}", "title": "" }, { "docid": "d13cc265ff2903b20ac9844219489ebd", "score": "0.6436849", "text": "processFrames() {\n let numUpdateSteps = 0;\n while (this.elapsedMs >= this.timestep) {\n this.update(this.timestep, this.entityList);\n this.elapsedMs -= this.timestep;\n numUpdateSteps += 1;\n if (numUpdateSteps >= this.maxFps) {\n this.panic();\n break;\n }\n }\n }", "title": "" }, { "docid": "9909976738f21f04e4b9642448d32aac", "score": "0.6426163", "text": "function doFrameLoop() {\r\n stats && stats.begin();\r\n for (var a = 0; a < actives.length; a++) actives[a].purge || actives[a].forget ? actives.splice(a, 1) : actives[a].doUpdate ? actives[a].doUpdate() : actives.splice(a, 1);\r\n stats && stats.end();\r\n requestAnimationFrame(doFrameLoop)\r\n}", "title": "" }, { "docid": "648299e090095eb64c16ca4c73bd3ee8", "score": "0.64064723", "text": "function drawFrame() {\n clearWholeCanvas();\n\n for( t = start; t < end; t += inc ) {\n // Clear canvas before drawing\n // clearTextOnly();\n\n\n getCoords();\n drawPoint();\n }\n\n\n // t += inc;\n\n // If the end is reached, stop the Interval timer\n // if (t > end) {\n // clearInterval(frameCreator);\n // }\n }", "title": "" }, { "docid": "b5665e5bdc8bb57b66e8f553f1f9dcad", "score": "0.6401677", "text": "function nextFrame() {\n \n if (LOOPING.currentImage < LOOPING.slideImages.length) {\n drawImage(LOOPING.currentImage);\n LOOPING.currentImage++;\n } else {\n resetFrames();\n }\n \n}", "title": "" }, { "docid": "07ce9dfda033c93f01bc8ef760f38483", "score": "0.63854337", "text": "function goToNextFrame(clear) {\n\n var fr = project.currentFrame();\n\n fr++;\n\n if (fr > $(\"#frame\").prop(\"max\") * 1) {\n\n if (loop == true) {\n fr = 0;\n } else {\n if (clear == true) {\n clearInterval(playInterval);\n playInterval = undefined;\n return false;\n }\n }\n }\n\n goToFrame(fr);\n\n if (clear == true && stopAtNotes == true && (project.frames[fr] != undefined || project.notes[fr] != undefined)) {\n clearInterval(playInterval);\n playInterval = undefined;\n return false;\n }\n\n}", "title": "" }, { "docid": "ea869f0669aea1e3b5177028808fb558", "score": "0.63397133", "text": "frame(self) {\n\n if(self.stage == 0) { // setup the hexes\n\n if(self.iteration < self.map.hexOrdering.length) {\n var hexLoc = self.map.hexOrdering[self.iteration];\n self.map.get(hexLoc.q, hexLoc.r).draw();\n self.iteration += 1;\n } else {\n self.iteration = 0;\n self.stage = 1;\n }\n } else if(self.stage == 1) {\n if(self.iteration < self.map.nodes.length) {\n self.map.nodes[self.iteration].draw();\n self.iteration += 1;\n } else {\n self.iteration = 0;\n self.stage = 2;\n }\n } else {\n clearInterval(self.intervalId);\n }\n\n\n }", "title": "" }, { "docid": "73f21df078f5e7baabd91786cc46118f", "score": "0.63280076", "text": "function onFrame() {\n\t// Run through the active layer's children list and change\n\t// the position of the placed symbols:\n\tfor (var i = 0; i < count; i++) {\n\t\tvar item = project.activeLayer.children[i];\n //console.log(i);\n var change = 1;\n if(i % 10){\n change = 2;\n }else{\n change = 1;\n }\n\t\tthingDo(item,change)\n\t}\n}", "title": "" }, { "docid": "6be7a28828e765c10f4b3b8ac1c234a2", "score": "0.6311734", "text": "function updateFrame() {\n frameNumber++;\n // TODO: If other updates are needed for the next frame, do them here.\n}", "title": "" }, { "docid": "e97880bef7d1222538b0dd2cfccaddf4", "score": "0.6311146", "text": "function pauseFrame(frame) {\n for (var i = 0; i < frame.length; i++) {\n if (frame[i]['startColor'] == inactiveColor()) {\n frame[i].progress(0.99).apply().pause();\n } else {\n frame[i].progress(0.0).apply().pause();\n }\n }\n}", "title": "" }, { "docid": "bae544284c576a1dec7d2e3ece72ad37", "score": "0.62985253", "text": "function loop() {\n\t\tide.stepFrame();\n\t\t// world.doOneCycle();\n\t}", "title": "" }, { "docid": "353af7b1cc4978b6084f797fd585adbe", "score": "0.6285377", "text": "function animate() {\n p.loadImage(`breathe/${zeroPad(frame)}.png`, showFrame)\n frame = (frame + 1) % 200\n }", "title": "" }, { "docid": "17a8443e4de9ea0125607bcbde2b5db3", "score": "0.62699246", "text": "function setFrames() {\n this.CANDLE_CARD = [\n {x: CARD_MARGIN, y: CARD_MARGIN},\n {x: (windowWidth - CARD_MARGIN * 2) / 3 - CARD_MARGIN / 2,\n y: windowHeight - CARD_MARGIN}\n ];\n this.OBIT_CARD = [\n {x: (windowWidth - CARD_MARGIN * 2) / 3 + CARD_MARGIN / 2,\n y: CARD_MARGIN},\n {x: windowWidth - CARD_MARGIN, y: windowHeight - CARD_MARGIN}\n ];\n this.LINK_BUTTON = [\n {x: this.OBIT_CARD[0].x, y: this.OBIT_CARD[1].y - 24},\n {x: this.OBIT_CARD[1].x, y: this.OBIT_CARD[1].y}\n ];\n this.BACK_BUTTON = [\n {x: 25, y: 25},\n {x: 115, y: 55}\n ];\n}", "title": "" }, { "docid": "040ced194f064a74690000e699eb174a", "score": "0.6263951", "text": "_loop () {\n setTimeout(this._loop.bind(this), Math.max(this.runtime.currentStepTime, Scratch3Watson.INTERVAL));\n\n // Add frame to detector\n const time = Date.now();\n if (this._lastUpdate === null) {\n this._lastUpdate = time;\n }\n const offset = time - this._lastUpdate;\n if (offset > Scratch3Watson.INTERVAL) {\n const frame = this.runtime.ioDevices.video.getFrame({\n format: Video.FORMAT_IMAGE_DATA,\n dimensions: Scratch3Watson.DIMENSIONS\n });\n if (frame) {\n this._lastUpdate = time;\n this._lastFrame = frame;\n // this.detect.addFrame(frame.data);\n }\n }\n\n }", "title": "" }, { "docid": "7c6d69cd79068b94385d1c239217a7bd", "score": "0.62615657", "text": "frame() {\n this.cycles(29780)\n }", "title": "" }, { "docid": "c02d4c1a9b5cbf75bae7240bbd44c11d", "score": "0.6252618", "text": "function process_one_frame()\n{\n process_one_frame_agent();\n draw();\n product_sugar();\n var loop = setTimeout(process_one_frame, 1000/fps);\n}", "title": "" }, { "docid": "dae568709ea41448f2ad8b99293cf1e8", "score": "0.62507874", "text": "function loop() {\n \n //loads image data into graphics2D object\n self.loadImgData();\n\n //push frame data into frame array for playback later\n self.frames.push(copy(self.g.cdata));\n\n //The new sensor position is the velocity added to the sensor\n var newSensor = self.sensor.add(velocity);\n self.setSensor(newSensor.at(0), newSensor.at(1), newSensor.at(2));\n\n //A function that copies an array into another array and returns it\n //This is apparently the fastest way according to http://jsperf.com/new-array-vs-splice-vs-slice/19\n //Plus, imageData is a Uint8ClampedArray and has no methods like slice\n function copy(a){\n var result = [];\n for (var j = 0; j < a.length; j++) {\n result.push(a[j]);\n }\n\n return result;\n }\n\n if (i > steps) {\n //An alert so that I can goof off while its loading\n //without worrying about missing anything.\n alert(\"Load Complete\");\n\n i = 0;\n\n //Loops through frame array over and over again, \n //displaying each frame on the screen.\n setInterval(function() {\n //Put the image data on the screen\n self.g.cdata.set(self.frames[i]);\n self.cxt.putImageData(self.g.imageData, 0, 0);\n\n //Next frame;\n i++;\n\n //If we've reached the end of the frame array\n // go back to the beginning.\n if (i >= self.frames.length) {\n i = 0;\n }\n }, 33);\n return;\n\n }\n\n i++;\n setTimeout(function() {\n self.cxt.clearRect(0, 0, self.WIDTH, self.HEIGHT);\n self.cxt.putImageData(self.g.imageData, 0, 0);\n self.cxt.fillStyle = \"#AAAAFF\";\n\n //Rounds to two decimal places\n self.cxt.fillText(\"Loading \" + Math.round(100 * 100 * i / steps)/100 + \"%\", 10, 10);\n loop(); \n }, 0);\n }", "title": "" }, { "docid": "92a79fc1c51161f5ac0e4d7abf6e794c", "score": "0.6220043", "text": "static setFrame(frame) {currentFrame = frame}", "title": "" }, { "docid": "2f9f6077fa109375fcc962a0fc4bd2b4", "score": "0.62200385", "text": "nextFrame () {\n if (this[_video].src) {\n this[_setFrame](1);\n }\n }", "title": "" }, { "docid": "0b784587b9a3efe205ca013f3db7a262", "score": "0.61871296", "text": "function animloop() {\n\tinit = requestAnimFrame(animloop);\n\tdraw();\n}", "title": "" }, { "docid": "c06bd7cc05c226cfcaa7b21a3ca498a2", "score": "0.6184124", "text": "frame() {\n this.motion();\n this.display();\n }", "title": "" }, { "docid": "64a5b5bd173931c11bcc092aab435880", "score": "0.6156546", "text": "function debugNextStep() {\n if (frame_data && frame + 1 < frame_data.length)\n frame += 1;\n drawDebug()\n}", "title": "" }, { "docid": "8f93f25baa880defc3ad0edbcaa0eebd", "score": "0.61544335", "text": "function animloop() {\n\tinit = requestAnimFrame(animloop);\n\tDraw();\n}", "title": "" }, { "docid": "26edf1db0ba257fab8c5f2958b382682", "score": "0.61500883", "text": "function animloop() {\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "title": "" }, { "docid": "7dac18cbd8f9c7e17046806d5d74c35c", "score": "0.6133156", "text": "function setAnimationFrames(cFrame : int, sFrame : int, eFrame : int) {\n\tcurrentFrame = cFrame;\n\tstartFrame = sFrame;\n\tendFrame = eFrame;\n}", "title": "" }, { "docid": "aab4f61082b782cc96f68df9853bcfea", "score": "0.61230963", "text": "function animloop() {\r\n\tdraw();\r\n\trequestAnimFrame(animloop);\r\n}", "title": "" }, { "docid": "cddccc3f4d8f39bb687422f881a95be6", "score": "0.61198056", "text": "function newFrame() {\n followHead();\n repoHead();\n bodyCollide();\n appleCollide();\n boardCollide();\n }", "title": "" }, { "docid": "66cd3bf899533e45499cff4382ddeec4", "score": "0.61185193", "text": "showFrame(_index) {\n let spriteFrame = this.animation.frames[_index];\n this.cmpMesh.mtxPivot = spriteFrame.mtxPivot;\n this.cmpMaterial.mtxPivot = spriteFrame.mtxTexture;\n this.cmpMaterial.material.setCoat(this.animation.spritesheet);\n this.frameCurrent = _index;\n this.timer = ƒ.Time.game.setTimer(spriteFrame.timeScale * 1000 / this.framerate, 1, this.showFrameNext);\n }", "title": "" }, { "docid": "7b7a583e94fba41a88f36c1760fcfd3c", "score": "0.6109267", "text": "nextFrame() {\n const { fps } = this;\n const { length } = this.materials;\n const ra = this.rootConf('fps') / fps;\n this.index++;\n\n if (this.index >= ra) {\n this.index = 0;\n this.frameIndex++;\n if (this.loop && this.frameIndex >= length) {\n this.frameIndex = 0;\n }\n }\n }", "title": "" }, { "docid": "72ac5299b869879c6a2e25f1f31d40c2", "score": "0.61038065", "text": "function getFrameData() {\r\n for(var frameIndex in jsonData) {\r\n var curFrame = jsonData[frameIndex],\r\n pointsInFrame = [],\r\n handsInFrame = [],\r\n fingersInFrame = [],\r\n toolsInFrame = [],\r\n gestureArray = [],\r\n circleGestsInFrame = [],\r\n keytapGestsInFrame = [],\r\n screentapGestsInFrame = [],\r\n swipeGestsInFrame = [],\r\n curFrameTips = [];\r\n\r\n // Get Gestures\r\n for(var h in curFrame.gestures) {\r\n \r\n gestureArray.push(curFrame.gestures[h]); \r\n \r\n if(curFrame.gestures[h].type == 1) {\r\n swipeGestsInFrame.push(curFrame.gestures[h]);\r\n } else if(curFrame.gestures[h].type == 4) {\r\n circleGestsInFrame.push(curFrame.gestures[h]);\r\n } else if(curFrame.gestures[h].type == 5) {\r\n screentapGestsInFrame.push(curFrame.gestures[h]);\r\n } else if(curFrame.gestures[h].type == 6) {\r\n keytapGestsInFrame.push(curFrame.gestures[h]);\r\n }\r\n }\r\n \r\n if(gestureArray.length > peakEvents) {\r\n peakEvents = gestureArray.length;\r\n }\r\n\r\n for(var i in curFrame.hands) { \r\n handsInFrame.push(curFrame.hands[i]);\r\n \r\n for(var j in curFrame.hands[i].pointables) {\r\n\r\n var p = curFrame.hands[i].pointables[j];\r\n \r\n if(p.type == 'finger') {\r\n fingersInFrame.push(p);\r\n } else if(p.type == 'tool') {\r\n toolsInFrame.push(p);\r\n }\r\n \r\n // Make sure tip positions are valid (not (0, 0, 0))\r\n var tipsXYZ = checkStableTip(p.stableTipPos.x, p.stableTipPos.y, p.stableTipPos.z, p);\r\n var newCoord = changeCoord(tipsXYZ[0], tipsXYZ[1], tipsXYZ[2]),\r\n lastCoord = null,\r\n contFlag = 0; // If the current tip is a continuation from last frame\r\n\r\n curFrameTips.push(p.id);\r\n\r\n if(prevTips.length > 0 && prevTips.indexOf(p.id) > -1) {\r\n contFlag = 1; \r\n var lastHandP = getOldPointable(p.id, frameIndex, true);\r\n var lastP = jsonData[(frameIndex-1)].hands[lastHandP.handIndex].pointables[lastHandP.pIndex];\r\n\r\n // Make sure tip positions are valid\r\n var lastFrameXYZ = checkStableTip(lastP.stableTipPos.x, lastP.stableTipPos.y, lastP.stableTipPos.z, lastP);\r\n lastCoord = changeCoord(lastFrameXYZ[0], lastFrameXYZ[1], lastFrameXYZ[2]);\r\n } \r\n\r\n pointsInFrame.push([newCoord, lastCoord, contFlag]);\r\n }\r\n }\r\n\r\n if(curFrameTips.length > peakTips) {\r\n peakTips = curFrameTips.length;\r\n }\r\n \r\n prevTips = curFrameTips;\r\n\r\n frameInfo.push({\r\n 'tips': pointsInFrame,\r\n 'hands': handsInFrame,\r\n 'fingers': fingersInFrame,\r\n 'tools': toolsInFrame,\r\n 'gestures': gestureArray,\r\n 'circleGests': circleGestsInFrame,\r\n 'keytapGests': keytapGestsInFrame,\r\n 'screentapGests': screentapGestsInFrame,\r\n 'swipeGests': swipeGestsInFrame,\r\n 'frameIndex': frameIndex,\r\n 'time': curFrame.time\r\n });\r\n }\r\n \r\n console.log('Highest Number of Pointables: ' + peakTips);\r\n console.log('Highest Number of Gestures (Events): ' + peakEvents);\r\n}", "title": "" }, { "docid": "6306489997c07f1dcb73b38ba822b9ad", "score": "0.6092489", "text": "function drawFrame(frameArray) {\n\n\tfor (i=0; i<TVArraySize; i++) {\n\t\t//setPixelColour(i, frameArray[i]);\n\t\tdocument.getElementById(\"pixel\" + i).style.color = '#' + frameArray[i];\n\t}\n}", "title": "" }, { "docid": "fd33aebc81ef3d0273c04928b0a9c9f2", "score": "0.60871696", "text": "function frame() {\n // Clear the old frame\n ctx.clearRect(0,0, canvas.width, canvas.height);\n \n // Draw the next frame\n window.requestAnimationFrame(frame);\n}", "title": "" }, { "docid": "0f1c84fe83d7cc7d36278d32e426a79a", "score": "0.60678613", "text": "function frame() {\n if (width >= raise_by || thiss.video_state != VideoStateEnum.PLAYING) {\n clearInterval(id);\n } else {\n width+=raise_by/10; //TODO make this with FPS\n thiss.set_bar_position(progress, progress+width);\n }\n }", "title": "" }, { "docid": "fcae9d4bd45369a710f43030ee866417", "score": "0.6059109", "text": "function loop(){\n context.drawImage(video, crop.x, crop.y, crop.w, crop.h, 0, 0, canvas.width, canvas.height);\n drawWireFrame(currentPose);\n raf = requestAnimationFrame(loop);\n}", "title": "" }, { "docid": "f658068d1f6c0a89217f9e07b51f2ff1", "score": "0.60556585", "text": "_animationLoop() {\n this._renderFrame();\n // Keep registering ourselves for the next animation frame\n if (typeof window !== 'undefined') {\n this._animationFrame = requestAnimationFrame(this._animationLoop);\n }\n }", "title": "" }, { "docid": "6d05e33ff28006b679dee7f31e08f1a4", "score": "0.60529816", "text": "function loop(){\n\tatualizar();\n\tdesenha();\n\twindow.requestAnimationFrame(loop);\n}", "title": "" }, { "docid": "61e0b98c3ef524bb9f8a048dbb56a08a", "score": "0.6029332", "text": "function updateFrame(){\n if(dir==\"left\"){\n frame+=1;\n if(frame>(NUM_FRAMES-1)/2)\n frame=0;\n }\n if(dir==\"right\"){\n frame+=1;\n if(frame>NUM_FRAMES-1)\n frame=2;\n }\n}", "title": "" }, { "docid": "2c5228eb1000f83050ddd2639a38c0e4", "score": "0.60279405", "text": "nextFrame() {\n this._moveFrame(this._currentFrame, ++this._currentFrame);\n if (this.isFinish()) {\n throw Error('Limite de frames excedido! chame o reset para reiniciar a contagem');\n }\n }", "title": "" }, { "docid": "b75b9cb7f2557cbb0b95370d8a82429b", "score": "0.598698", "text": "doFrame(frame, inverse=undefined, extra=false) {\n this.restart = false || extra;\n let success = false;\n for (let i = 0; i < frame.length; ++i) {\n if (Array.isArray(frame[i][0])) {\n success = this.doFrame(frame[i], inverse, true) || success;\n } else {\n success = this.doStep(frame[i][0], frame[i][1], inverse, this.restart) || success;\n }\n }\n return success;\n }", "title": "" }, { "docid": "79270dca5df7b4367fa08440c569296e", "score": "0.59613174", "text": "nextFrame() {\n const ra = this.rootConf('rfps') / this.rootConf('fps');\n this.index++;\n if (this.index >= ra) {\n this.index = 0;\n this.frameIndex++;\n }\n }", "title": "" }, { "docid": "6818f1480619ea01e433c6bb73b6c9bf", "score": "0.5958203", "text": "function getNextFrame(){\n\tdocument.getElementById(\"playarea\").value = frames[frameIndex];\n\tframeIndex = (frameIndex + 1) % frames.length;\n}", "title": "" }, { "docid": "2e7946be2787ad617becd9b13d1c49d0", "score": "0.59508204", "text": "async function frame(delta) {\n await page.evaluate(([d]) => new Promise((resolve) => {\n figure.notifications.add('afterDraw', () => resolve(), 1);\n figure.timeKeeper.frame(d);\n figure.animateNextFrame();\n }), [delta]);\n}", "title": "" }, { "docid": "a8ea14e50350b626aaf5078232ce4408", "score": "0.5938753", "text": "function anim() {\n ctx.drawImage(thumbsList[currentFrame], 0, 0); // draw the currentFrame\n // increase our counter, and set it to 0 if too large\n currentFrame = (currentFrame + 1) % thumbsList.length;\n setTimeout(anim, delay); // do it again in x ms\n }", "title": "" }, { "docid": "90298203e57f406e6d32c58f6c884262", "score": "0.59366435", "text": "function show_next_frame() {\n // show image\n // YH - display the image that is in the [animate_frame] spot in the 'stimuli' array \n display_element.innerHTML = '<img src=\"'+trial.stimuli[animate_frame]+'\" id=\"jspsych-yuval-animation-image\"></img>';\n\n current_stim = trial.stimuli[animate_frame];\n\n // record when image was shown\n animation_sequence.push({\n \"stimulus\": trial.stimuli[animate_frame],\n \"time\": performance.now() - startTime\n });\n\n if (trial.prompt !== null) { // YH - if 'prompt' is not empty ->\n display_element.innerHTML += trial.prompt; // display it\n }\n\n if (trial.frame_isi > 0) { // YH - if there is frame_isi -> hide image at frame_time and write the blanks also into the data\n jsPsych.pluginAPI.setTimeout(function() { // YH -executes this function after waiting for trial.frame_time (below)\n display_element.querySelector('#jspsych-yuval-animation-image').style.visibility = 'hidden';\n current_stim = 'blank';\n // record when blank image was shown\n animation_sequence.push({\n \"stimulus\": 'blank',\n \"time\": performance.now() - startTime\n });\n }, trial.frame_time);\n }\n }", "title": "" }, { "docid": "8be1868be5632924ae9768a7059acdf5", "score": "0.5935406", "text": "function get_frames(){\n\tget_global_frame_info();\n\tfor(var i=1; i<all_tables.length ;i++){\n\t\tget_frame_info(i);\n\t}\n\treturn all_tables;\n}", "title": "" }, { "docid": "c79c1086b5d0b49c1fa8e6ae7401045c", "score": "0.5930278", "text": "function loop()\n\t{\t\t\t\n\t\t//context.clearRect(0, 0, w, h);\n\t\t//context.globalCompositeOperation = 'destination-over';\n\t\tcontext.fillStyle = \"rgba(0,0,0,\"+TRAILS+\")\";\n\t\tcontext.fillRect( 0, 0, w, h );\n\t\t\t\n\t\tupdate();\n\t}", "title": "" }, { "docid": "c16a9719b4f1e3293d5a4aa71c3e12ea", "score": "0.5928828", "text": "function getNextFrame(frame) {\n\tmoveX = moveArray[frame][0];\n\tmoveY = moveArray[frame][1];\n\tmoveZ = moveArray[frame][2];\n\n\thipsX = moveArray[frame][3];\n\thipsY = moveArray[frame][4];\n\thipsZ = moveArray[frame][5];\n\n\tleftUpLegX = moveArray[frame][6];\n\tleftUpLegY = moveArray[frame][7];\n\tleftUpLegZ = moveArray[frame][8];\n\n\tleftLowLegX = moveArray[frame][9];\n\tleftLowLegY = moveArray[frame][10];\n\tleftLowLegZ = moveArray[frame][11];\n\n\tleftFootX = moveArray[frame][12];\n\tleftFootY = moveArray[frame][13];\n\tleftFootZ = moveArray[frame][14];\n\n\tleftToeX = moveArray[frame][15];\n\tleftToeY = moveArray[frame][16];\n\tleftToeZ = moveArray[frame][17];\n\n\trightUpLegX = moveArray[frame][18];\n\trightUpLegY = moveArray[frame][19];\n\trightUpLegZ = moveArray[frame][20];\n\n\trightLowLegX = moveArray[frame][21];\n\trightLowLegY = moveArray[frame][22];\n\trightLowLegZ = moveArray[frame][23];\n\n\trightFootX = moveArray[frame][24];\n\trightFootY = moveArray[frame][25];\n\trightFootZ = moveArray[frame][26];\n\n\trightToeX = moveArray[frame][27];\n\trightToeY = moveArray[frame][28];\n\trightToeZ = moveArray[frame][29];\n\n\tspineX = moveArray[frame][30];\n\tspineY = moveArray[frame][31];\n\tspineZ = moveArray[frame][32];\n\n\tspine1X = moveArray[frame][33];\n\tspine1Y = moveArray[frame][34];\n\tspine1Z = moveArray[frame][35];\n\n\tneckX = moveArray[frame][36];\n\tneckY = moveArray[frame][37];\n\tneckZ = moveArray[frame][38];\n\n\theadX = moveArray[frame][39];\n\theadY = moveArray[frame][40];\n\theadZ = moveArray[frame][41];\n\n\tleftShoulderX = moveArray[frame][42];\n\tleftShoulderY = moveArray[frame][43];\n\tleftShoulderZ = moveArray[frame][44];\n\n\tleftUpArmX = moveArray[frame][45];\n\tleftUpArmY = moveArray[frame][46];\n\tleftUpArmZ = moveArray[frame][47];\n\n\tleftLowArmX = moveArray[frame][48];\n\tleftLowArmY = moveArray[frame][49];\n\tleftLowArmZ = moveArray[frame][50];\n\n\tleftHandX = moveArray[frame][51];\n\tleftHandY = moveArray[frame][52];\n\tleftHandZ = moveArray[frame][53];\n\n\tleftThumbX = moveArray[frame][57];\n\tleftThumbY = moveArray[frame][58];\n\tleftThumbZ = moveArray[frame][59];\n\n\trightShoulderX = moveArray[frame][60];\n\trightShoulderY = moveArray[frame][61];\n\trightShoulderZ = moveArray[frame][62];\n\n\trightUpArmX = moveArray[frame][63];\n\trightUpArmY = moveArray[frame][64];\n\trightUpArmZ = moveArray[frame][65];\n\n\trightLowArmX = moveArray[frame][66];\n\trightLowArmY = moveArray[frame][67];\n\trightLowArmZ = moveArray[frame][68];\n\n\trightHandX = moveArray[frame][69];\n\trightHandY = moveArray[frame][71];\n\trightHandZ = moveArray[frame][72];\n\n\trightThumbX = moveArray[frame][75];\n\trightThumbY = moveArray[frame][76];\n\trightThumbZ = moveArray[frame][77];\n}", "title": "" }, { "docid": "121d4cd49c1b26d66fd6318e04aa9483", "score": "0.59261864", "text": "function funcForEachFrame() {\n animation = requestAnimationFrame(funcForEachFrame)\n timer++\n // whatever write below, will happen 60 times a second\n\n ctx.clearRect(0, 0, canvas.width, canvas.height) // removing canvas and recreating every time\n // dino.x++ // but this will leave an afterimage so will look like it is increasing. thus we wrote above line\n\n if (timer % 120 === 0) { // every 120 frames (depending on hardware, monitor) draw a cactus\n var cactus = new Cactus()\n cactusArr.push(cactus) // every 120 frames put a cactus into the array\n }\n\n cactusArr.forEach((a, i, o) => {\n // if x coordinate is lower than 0, remove from array\n if (a.x < 0) {\n o.splice(i, 1)\n }\n a.x--\n\n // keep on collision checking\n isCollision(dino, a);\n\n a.draw()\n\n // for jumping, only when space bar is triggered\n if (jumping == true) {\n dino.y -= 1\n jumpTimer++\n }\n if (jumping == false) {\n if (dino.y < 100) {\n dino.y++\n }\n }\n // stop jumping after reaching 100 frames\n if (jumpTimer > 100) {\n jumping = false\n jumpTimer = 0 // enables to use Space again\n }\n })\n\n dino.draw()\n}", "title": "" }, { "docid": "baeed8558a4120bf08f855e0475dca35", "score": "0.59231216", "text": "function callHandler() {\n var fn = jQuery.event.special.frame.handler,\n event = jQuery.Event(\"frame\"),\n array = this.array,\n l = array.length;\n\n // Give event object properties\n event.frameCount = this.frameCount;\n\n // Call handler on each elem in array\n while (l--) {\n fn.call(array[l], event);\n }\n }", "title": "" }, { "docid": "dae2f76659731cecdfc0e279d8cd275c", "score": "0.5909877", "text": "function startNextFrame(simulationInfo) {\n var simulationResults = simulationInfo['results'];\n var cy = simulationInfo['cy'];\n var currentAnimation = simulationInfo['animation'];\n\n currentAnimation['timestep']++;\n currentAnimation = {\n timestep: currentAnimation['timestep'],\n frames: [],\n paused: false,\n finished: false\n };\n assembleFullAnimation(simulationResults, cy, currentAnimation, currentAnimation['timestep']);\n playFrame(currentAnimation['frames'][currentAnimation['timestep']], currentAnimation['timestep'], currentAnimation['frames'].length);\n}", "title": "" }, { "docid": "fd65915e611fdd93ed6913794575f6c1", "score": "0.5906335", "text": "function frame() {\n if (j > 100) {\n clearInterval(j);\n intro.classList.add(\"slideUp\");\n progress.style.height = 0;\n\n } else {\n counter.innerHTML = j + \"%\";\n j++;\n }\n}", "title": "" }, { "docid": "8184c9d4aa08fa01adb8690b92127065", "score": "0.59037083", "text": "animationFrame() {\n\n // Updating times\n this.updateTime();\n this.updateHour();\n this.updateMinutes();\n this.updateSeconds();\n\n // Reseting pointers position when pointers are in starting times in order to prevent returning animation\n // Seconds pointer\n if (this.actualSeconds == 0) {\n this.resetSecondsPointerPostion();\n }\n // Minutes\n if (this.actualMinutes == 0) {\n this.resetMinutePointerPostion();\n }\n // Hours\n if (this.actualHour == 24 || this.actualHour == 12 || this.actualHour == 0) {\n this.resetHourPointerPostion();\n }\n\n // Updating pointers position\n this.updateHourPointerPosition();\n this.updateMinutePointerPosition();\n this.updateSecondPointerPosition();\n\n }", "title": "" }, { "docid": "9d80e80834ee801e657fb4d25a6b18fe", "score": "0.59031165", "text": "onFrame ({weboji}) {\n // @FIXME we shouldn't need to do this, but this is occasionally reset to {x: 0, y: 0} when running in client mode\n if (!weboji.pointer.x && !weboji.pointer.y) return\n\n // Check for hover\n this.checkForFocus(weboji)\n let isScrolling = false\n\n // Get bounds\n let bounds\n let scrollTop = this.getTargetScrollTop()\n\n if (this.$target.getBoundingClientRect) {\n bounds = this.$target.getBoundingClientRect()\n } else {\n bounds = { top: 0, bottom: window.innerHeight }\n }\n\n // Check on click\n if (weboji.pointer.state === 'mouseDown') {\n this.numFramesFocused = 0\n this.maybeSetTarget(weboji)\n }\n\n // Scroll up\n if (weboji.pointer.y < bounds.top + this.config.vertScroll.scrollZone) {\n this.$target.scrollTo(\n 0,\n scrollTop +\n (weboji.pointer.y - bounds.top - this.config.vertScroll.scrollZone) *\n this.config.vertScroll.scrollSpeed\n )\n\n isScrolling = true\n }\n\n // Scroll down\n if (weboji.pointer.y > bounds.bottom - this.config.vertScroll.scrollZone) {\n this.$target.scrollTo(\n 0,\n scrollTop -\n (bounds.bottom -\n weboji.pointer.y -\n this.config.vertScroll.scrollZone) *\n this.config.vertScroll.scrollSpeed\n )\n\n isScrolling = true\n }\n\n isScrolling && this.maybeSelectNewTarget()\n }", "title": "" }, { "docid": "6d87ce48db79921cac83f42ed1a1b5da", "score": "0.5898863", "text": "function setup() {\n for (i=0; i<clips.length; i++) {\n if (clips[i].isLoaded()) {\n $(\"div.listen>div.audio div.btn\" + i.toString()).css(\"display\", \"block\").siblings(\"p\").css(\"display\",\"none\");\n lastFrameTimes[i] = 0;\n console.log(\"Last Frame Times \" + i + \" \" + lastFrameTimes[i] );\n }\n }\n}", "title": "" }, { "docid": "7b373b645faf2e704835a2de44aeefaa", "score": "0.5898308", "text": "function callHandler(){\n var fn = jQuery.event.special.frame.handler,\n event = jQuery.Event(\"frame\"),\n array = this.array,\n l = array.length;\n \n // Give event object properties\n event.frameCount = this.frameCount;\n \n // Call handler on each elem in array\n while (l--) {\n fn.call(array[l], event);\n }\n}", "title": "" }, { "docid": "c2e8363d3862a5b7f9bdb98252f59f16", "score": "0.58964956", "text": "function limainitend() {\n nomess();\n setTimeout(autoloop, 1000);\n fingerup(width/2, height/2)\n onframe( () => {\n centreall();\n centrescalenow();\n }, 10);\n}", "title": "" }, { "docid": "f9ee474d5cc7f33ad5f10484395f581f", "score": "0.5879244", "text": "function preload (){\n // var frameString = \"assests/Thatwasclose0.jpg\";\n // frameArray[0] = loadImage(frameString);\n// starting point, condition and how it iterates\n for(var frames = 0; frames< frameAmounts; frames++){\n var frameString = \"assests/Thatwasclose\" + frames +\".jpg\";\n frameArray[frames] = loadImage(frameString);\n\n }\n}", "title": "" }, { "docid": "f254d37b3e42793191fb4d4c0b9dbcff", "score": "0.5873617", "text": "function createFrames (CurrentAnswersObject) {\r\n var j = 0;\r\n var k = 0;\r\n var firstFrameDragElement = frameDragspot;\r\n var isOlOpen = true;\r\n DragSet = ''; \r\n OptionArray = new Array(); \r\n for(var i=0; i<CurrentAnswersObject.length;i++) {\r\n var optionObj = {'data_answer': i, 'draggableText': CurrentAnswersObject[i].draggableText}\r\n OptionArray.push(optionObj);\r\n }\r\n OptionArray = shuffle(OptionArray); \r\n DragSet += '<ol class=\"frame headerFrame'+j+'\">'; \r\n for (var i = 0; i < CurrentAnswersObject.length; i++) { \r\n // console.log(OptionArray[i].draggableText); \r\n \r\n DragSet += '<li class=\"dragspotWrapper\" data-id=\"'+OptionArray[i].data_answer+'\"><div class=\"dragspot\" id=\"dragspot_'+i+'\" data-answer=\"'+OptionArray[i].data_answer+'\" aria-dropeffect=\"copy\" aria-grabbed=\"true\" draggable=\"true\"><div class=\"dragspot_txt tabindex\" role=\"button\" tabindex=\"0\" id=\"dragspot_txt_'+i+'\">'+OptionArray[i].draggableText+'</div>'; \r\n DragSet += '<button id=\"zoomText_'+i+'\" data-id=\"'+i+'\" class=\"zoomText tabindex hide\" aria-label=\"Read more button, press this button.\"></button></div></li>';\r\n if((i+1) % frameDragspot == 0) {\r\n DragSet += '</ol>';\r\n isOlOpen = false;\r\n j++;\r\n if(typeof CurrentAnswersObject[i+1] != 'undefined'){\r\n DragSet += '<ol class=\"frame headerFrame'+j+'\">';\r\n isOlOpen = true;\r\n }\r\n }\r\n \r\n }\r\n if(isOlOpen /*frameDragspot > 1*/){\r\n DragSet += '</ol>'; \r\n }\r\n if($('.rightArrow').hasClass('rightArrowEnable')){\r\n $('.rightArrow').attr('tabindex',0).removeAttr('aria-hidden');\r\n }else if($('.leftArrow').hasClass('leftArrowEnable')){\r\n $('.leftArrow').attr('tabindex',0).removeAttr('aria-hidden');\r\n } \r\n }", "title": "" }, { "docid": "159ecb068cae5c522c041b23751269d2", "score": "0.58734703", "text": "sendFrames() {\n const frames = Object.create(null)\n\n forIn(this.world.orbs, (orb, id) => {\n const skills = orb.skillsToBuffer(),\n world = this.world.boxToBuffer({\n minP: Vector.subtract(orb.position, VISION_RADIUS),\n maxP: Vector. add(orb.position, VISION_RADIUS),\n for: orb\n })\n\n frames[id] = {\n world,\n skills\n }\n })\n\n process.send({\n type: 'FRAMES',\n frames,\n timestamp: this.t\n })\n }", "title": "" }, { "docid": "828a88a42b3008d881bb0765b8b02606", "score": "0.5865298", "text": "function gotoFrame(id){\t\n\t\tid = getIndexFromId(id);\n\t\tcurrentFrame = id;\n\t\tif(currentFrame < config.loadedFrames/2){\n\t\t\tdisplayStartIndex = 0;\n\t\t\tdisplayEndIndex = config.loadedFrames;\n\t\t} else {\n\t\t\tdisplayStartIndex = currentFrame - config.loadedFrames/2;\n\t\t\tdisplayEndIndex = currentFrame + config.loadedFrames/2;\n\t\t}\t\t\t\n\t\tshowFrames();\n\t\t$('.timeline-annotation').remove();\n\t\tcenterTimeline();\n\t\tupdateCursor();\n\t\tloadPeople(timelineFrames[id].people)\n\t}", "title": "" }, { "docid": "053e42292718feb3af1204ab0677f621", "score": "0.58491755", "text": "function animationLoop(sceneThreeJs) {\n\n // Fonction JavaScript de demande d'image courante à afficher\n requestAnimationFrame(\n\n // La fonction (dite de callback) recoit en paramètre le temps courant\n function(timeStamp){\n animate(sceneThreeJs,timeStamp); // appel de notre fonction d'animation\n animationLoop(sceneThreeJs); // relance une nouvelle demande de mise à jour\n }\n\n );\n\n}", "title": "" }, { "docid": "053e42292718feb3af1204ab0677f621", "score": "0.58491755", "text": "function animationLoop(sceneThreeJs) {\n\n // Fonction JavaScript de demande d'image courante à afficher\n requestAnimationFrame(\n\n // La fonction (dite de callback) recoit en paramètre le temps courant\n function(timeStamp){\n animate(sceneThreeJs,timeStamp); // appel de notre fonction d'animation\n animationLoop(sceneThreeJs); // relance une nouvelle demande de mise à jour\n }\n\n );\n\n}", "title": "" }, { "docid": "053e42292718feb3af1204ab0677f621", "score": "0.58491755", "text": "function animationLoop(sceneThreeJs) {\n\n // Fonction JavaScript de demande d'image courante à afficher\n requestAnimationFrame(\n\n // La fonction (dite de callback) recoit en paramètre le temps courant\n function(timeStamp){\n animate(sceneThreeJs,timeStamp); // appel de notre fonction d'animation\n animationLoop(sceneThreeJs); // relance une nouvelle demande de mise à jour\n }\n\n );\n\n}", "title": "" }, { "docid": "5b3dc48d2b193b66bb48ec04a1d67c2f", "score": "0.5848429", "text": "function debugPreviousStep() {\n if (frame_data && frame > 0)\n frame -= 1;\n drawDebug()\n}", "title": "" }, { "docid": "f888d4092ec41dea0a9464d35b85322d", "score": "0.58388084", "text": "function frame (m) {\n const height = m.length;\n for (var i=0; i < height; i++) {\n process.stdout.write(m[i].join(''));\n }\n}", "title": "" }, { "docid": "161ca64bad6a0c3e900ec9a184d7c01a", "score": "0.58111745", "text": "function pageLoop() {\n\tcheckURL();\n\trequestAnimationFrame(pageLoop);\n}", "title": "" }, { "docid": "3fcfc24c275d0aaf99c3168297002ee6", "score": "0.5811114", "text": "get frames() {\n\t\treturn this.__frames;\n\t}", "title": "" }, { "docid": "bca3057c908632d04c6892c8134c8c6f", "score": "0.58110917", "text": "function loopAnimations() {\n \"use strict\";\n // Loop through all the animations.\n var i;\n for (i = 0; i < keyFrameAnimations.length; i += 1) {\n // Check if the animation is player and not paused.\n if (keyFrameAnimations[i].isPlaying && !keyFrameAnimations[i].isPaused) {\n if (keyFrameAnimations[i].currentTime === lastFrameCurrentTime[i]) {\n keyFrameAnimations[i].stop();\n keyFrameAnimations[i].play();\n lastFrameCurrentTime[i] = 0;\n\n }\n }\n\n }\n}", "title": "" }, { "docid": "d9dbe59d89f32109454f559ed4dd9118", "score": "0.5789818", "text": "pushFrame() {\n this.inner.pushFrame();\n }", "title": "" }, { "docid": "f25e6f7b43a6326a9cd97d54329eb266", "score": "0.57855105", "text": "function frame() {\n if (running) {\n // Draw one frame of the animation, and schedule the next frame.\n updateFrame();\n draw();\n requestAnimationFrame(frame);\n }\n}", "title": "" }, { "docid": "a8a9f622bc3511ddf4bbffbf9dfc2b16", "score": "0.578477", "text": "function doFrame()\n{\n updateForFrame();\n render();\n requestAnimationFrame(doFrame);\n}", "title": "" }, { "docid": "c8984917bc70a1bd39b51a0defe1306d", "score": "0.5783194", "text": "function frameList() {\n connection.query(\"SELECT * FROM frame\",\n function (err, results) {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n managerInit();\n });\n}", "title": "" }, { "docid": "a28c771875510a57adb29d7f2acff497", "score": "0.57811487", "text": "function changeAnimation() {\n subFrame = ANIMATIONS[this.value];\n subFrames = subFrame.split(\"=====\\n\");\n\n showFrames(subFrames);\n\n //darea.value = subFrames[0];\n currentLength = subFrames.length;\n currentFrame = 0;\n prevFrames = darea.value;\n}", "title": "" }, { "docid": "7707404072f8f0eecb0d3d4897a62397", "score": "0.57801425", "text": "loop() {\n Object.keys(this.instruments).forEach((name) => {\n const animation = this.instruments[name].animation;\n if (animation.triggered) {\n this.instruments[name].objects.forEach((inst) => {\n const sinArgument = (1 / animation.duration) * 2 * Math.PI * (Date.now() - animation.startTime) / 1000;\n inst.bow.sprite.x = inst.bow.x0 + 10 * Math.sin(sinArgument);\n inst.sprite.rotation = inst.rotation0 + 0.025 * Math.sin(sinArgument);\n inst.sprite.y = inst.y0 - 10 * this.velocity * (1 + Math.sin(0.5 * sinArgument));\n });\n }\n })\n\n requestAnimationFrame(this.loop.bind(this));\n }", "title": "" }, { "docid": "26980b379d5a97e58e6cb7b9baf5a728", "score": "0.5775576", "text": "function frameUpdate() {\n\n // if frameless update is in progress, interrupt it.\n if (intervalID != 0) // an update is in progress \n window.clearInterval(intervalID);\n\n // now the end of frame is over, do \n window.setInterval(framelessUpdate, 1);\n window.requestAnimationFrame(frameUpdate);\n } // end frameUpdate", "title": "" }, { "docid": "7f7b84cbf8e61a4600e61ef075138210", "score": "0.57700354", "text": "function processFrameMovement(frames) {\n\n if(frames){\n keepAnimating = false;\n let fullMotion = \"\"; \n let txtFrames = frames.split(\",\");\n\n\n let counter = 0;\n let nodeId = 0;\n for (var j = 0; j < 30; j++) { \n nodeId = 0;\n counter = 0;\n for (var i = 0; i < txtFrames.length; i += 3){\n let differenceX;\n let differenceY;\n let differenceZ;\n console.log(\"i = \" + i);\n console.log(\"txt length = \" + txtFrames.length);\n if(i < txtFrames.length - 3){\n counter = i;\n differenceX = parseFloat(txtFrames[counter]) - alpha[nodeId][0];\n ++counter;\n differenceY = parseFloat(txtFrames[counter]) - alpha[nodeId][1];\n ++counter;\n differenceZ = parseFloat(txtFrames[counter]) - alpha[nodeId][2];\n nodeId++;\n }\n \n \n if(i == txtFrames.length - 3){\n counter = i;\n differenceX = parseFloat(txtFrames[counter]) - moveAmounts[0];\n ++counter;\n differenceY = parseFloat(txtFrames[counter]) - moveAmounts[1];\n ++counter;\n differenceZ = parseFloat(txtFrames[counter]) - moveAmounts[2];\n }\n var movingX = (differenceX / 30);\n var movingY = (differenceY / 30);\n var movingZ = (differenceZ / 30);\n \n fullMotion += movingX + \",\" + movingY + \",\" + movingZ + \",\";\n }\n \n fullMotion = fullMotion.substring(0, fullMotion.length - 1); \n fullMotion += \"\\n\";\n }\n runAnimation(fullMotion);\n }\n}", "title": "" }, { "docid": "5d2cff568191f8856aad5e3fb965561f", "score": "0.5765579", "text": "function gameLoop(timestamp) {\n requestAniNum = requestAnimationFrame(gameLoop);\n \n // 애니메이션 시간 설정\n if (timestamp >= start) {\n //update the game logic\n ctx.clearRect(0,0,canvas.width, canvas.height);\n \n ctx.drawImage(catImage,imageX,0,32,32);\n ctx.drawImage(bg,ob1.postition.tileX,ob1.postition.tileY,32,32);\n imageX+=32;\n //ob1.draw(ctx);\n //Reset the frame start time\n start = timestamp + frameDuration;\n }\n}", "title": "" }, { "docid": "3d3434916a38a5bdca1ca217c6894a4e", "score": "0.57655287", "text": "updateFrame () {\n this.currentFrame = ++this.currentFrame % this.frameCount; // returns 0-3\n this.sourceX = this.currentFrame * this.width; // updates the sourceX for sprite animation purposes\n }", "title": "" }, { "docid": "26dedb49485ffe2bfa0b2618d850d5c3", "score": "0.5763736", "text": "function initFrame() {\n for(var i = 0; i < size; i++) {\n _this.pixels.push(\"\"); // empty string represents the empty pixel\n }\n }", "title": "" }, { "docid": "39f3ee449bb888ad1d69172ffde9cb4f", "score": "0.57614285", "text": "function loadFirstFrames(pages) {\n\t\tloadFrame(pages, pages.length);\n\t\tif (pages.length === 1) return;\n\t\tloadFrame(pages, pages.length - 1);\n\t\tloadFrame(pages, 1);\n\t}", "title": "" }, { "docid": "ae171a6eae07517560ef079c0cd51b56", "score": "0.5750215", "text": "function frame() {\n // increment stub time by 16.6ms (60 fps)\n now += 1000 / 60;\n mapboxgl.setNow(now);\n\n const pixels = encoder.memory().subarray(ptr); // get a view into encoder memory\n gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels); // read pixels into encoder\n encoder.encodeRGBPointer(); // encode the frame\n }", "title": "" }, { "docid": "fd0f8abd46abca0cb551eba7154347e0", "score": "0.5737231", "text": "function loadFrames(prefix, numFrames, extension=\".png\") {\n let frames = []; \n for (let i=0; i < numFrames; i++) {\n let file = prefix + i + extension;\n print(\"Loading: \" + file);\n frames[i] = loadImage(assetUrl + file);\n } \n return frames; \n}", "title": "" }, { "docid": "ce3e5e5a303f2b407533a758a047e598", "score": "0.5736855", "text": "function slide() {\n document.body.id = \"bg\"+num;\n // INCREASE NUMBER VARIABLE BY 1\n num++;\n // IF NUMBER VARIABLE EQUALS THE NUMBER OF BACKGROUND IMAGES\n // RESET NUMBER VARIABLE TO 1 (WILL START BACKGROUND IMAGE LOOP OVER) \n if (num === frames) { \n \tnum = 1; \n }\n }", "title": "" }, { "docid": "06e1aeea44c180b390badcdd9f51fa22", "score": "0.5736793", "text": "function everyFrame() {\n\tupdate();\n\trender();\n\trequestAnimationFrame(everyFrame);\n}", "title": "" }, { "docid": "8675ba7fc269d8cfe98dd76d8d1e43eb", "score": "0.57355946", "text": "function frameLooper() {\n window.requestAnimationFrame(frameLooper)\n fbc_array = new Uint8Array(analyser.frequencyBinCount)\n analyser.getByteFrequencyData(fbc_array)\n ctx.clearRect(0, 0, canvas.width, canvas.height) // Clear the canvas\n ctx.fillStyle = '#28a745' // Color of the bars\n bars = 100\n for (let i = 0; i < bars; i++) {\n bar_x = i * 3\n bar_width = 2\n bar_height = -(fbc_array[i] / 2)\n // fillRect( x, y, width, height ) // Explanation of the parameters below\n ctx.fillRect(bar_x, canvas.height, bar_width, bar_height)\n }\n }", "title": "" }, { "docid": "0bd30f0d17b5bc50f43a761e2d9d9f3c", "score": "0.5733782", "text": "function populatingAnimations(frames) {\n animation = [];\n for (let i = 0; i < frames.length; i++) {\n let pos = frames[i].frame;\n let img = spriteSheet.get(pos.x, pos.y, pos.w, pos.h);\n\n console.log('Trenutno stanje: ' + deviceOrientation);\n\n //Checking if orientation is potrait and if JSON frame is for the potrait orientation\n if (deviceOrientation === 'portrait' && frames[i].filename.includes('portrait')) {\n //In that case we add it to the animation to only have animations for the potrait orientation\n animation.push(img);\n //Of course there is no need for the whole expression down here but I wrote it for clarity\n //Add only those frames that are meant to be presented on the landscape orientation\n } else if (deviceOrientation === 'landscape' && frames[i].filename.includes('landscape')) {\n animation.push(img);\n }\n //At this point we will have our list on animations only with frames for portrait or a list with only landscape frames\n // !!!Never mixed togheter!!!\n console.log(animation);\n }\n}", "title": "" }, { "docid": "c258620ed5a6c12b4a52ab00ceede49f", "score": "0.57242924", "text": "pushFrame() {\n this.inner.pushFrame();\n }", "title": "" }, { "docid": "0f856ca224cca90555dfb9001814122d", "score": "0.5722055", "text": "function newFrame() {\n \n\n }", "title": "" } ]
84b6eb008bbdf9b332dea21c943e1946
A table can have rows.
[ { "docid": "5a3f69a077f41643ee09542754f6b90e", "score": "0.6102319", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"s\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, {\n defaultProps: {\n as: cellAs\n }\n });\n }));\n}", "title": "" } ]
[ { "docid": "9c5a95d66bc3b68661e089f8d52c7cb2", "score": "0.6901306", "text": "function Table() {\n this.columns = null; // written with the first row\n this.rows = [];\n }", "title": "" }, { "docid": "8503582b4bd5ff929f3b22fe6a17a3fe", "score": "0.67793643", "text": "function onlyRowsInTable(opts, change, context) {\n var invalids = context.node.nodes.filter(function (child) {\n return child.type !== opts.typeRow;\n });\n\n if (invalids.size === context.node.nodes.size) {\n invalids.forEach(function (invalid) {\n return change.removeNodeByKey(invalid.key, { normalize: false });\n });\n change.insertNodeByKey(context.node.key, 0, (0, _utils.createRow)(opts, 1), {\n normalize: false\n });\n }\n\n // No operations are made which means Slate will handle the normalization\n return undefined;\n}", "title": "" }, { "docid": "ad9b2dc5be832bbdec8eb3bd389e1d20", "score": "0.66582674", "text": "get tableRow() {\n return this._tableRow = this._tableRow || this.renderTableRow()\n }", "title": "" }, { "docid": "a74201605ed12c22af0a4bad887e384f", "score": "0.6587221", "text": "function tablesContainOnlyRows(opts: Options): Rule {\n const isRow = node => node.type === opts.typeRow;\n\n return {\n match(node) {\n return node.type === opts.typeTable;\n },\n\n validate(table) {\n // Figure out invalid rows\n const invalids = table.nodes.filterNot(isRow);\n\n if (invalids.isEmpty()) {\n return null;\n }\n\n return {\n invalids,\n };\n },\n\n /**\n * Replaces the node's children\n */\n normalize(\n change,\n node,\n { invalids = [] }: { invalids: Node[] }\n ) {\n // Remove invalids\n change.withoutNormalization(change => {\n invalids.forEach(child => {\n change\n .wrapBlockByKey(child.key, opts.typeRow)\n .wrapBlockByKey(child.key, opts.typeCell)\n });\n })\n\n return change;\n }\n };\n}", "title": "" }, { "docid": "96eaaf90a057e433933fd67bf83f4a68", "score": "0.6585737", "text": "rows(){\n\t\treturn this.table.rowManager.getDisplayRows();\n\t}", "title": "" }, { "docid": "f5686572dd3a96365e83d38d4cfa8ba1", "score": "0.65417635", "text": "tableShow(){\n let rows= this.getRows;\n\t\t\t// loop over rows \n rows.forEach( (row, index) => {\n // just in case somehow row is null or undefined\n if(row != null || row!= 'undefined'){ \n // create a new tr element in the table\n row.showRow(); \n }\n });\n\n }", "title": "" }, { "docid": "1bbc2c425ee5b181065c73346e55910d", "score": "0.6502168", "text": "getRows() {\n errors.throwNotImplemented(\"getting rows\");\n }", "title": "" }, { "docid": "4e539b12e836b1f132480446ecbe3f60", "score": "0.6494062", "text": "function rowOnlyInTable(opts, change, context) {\n return change.wrapBlockByKey(context.node.key, opts.typeTable);\n}", "title": "" }, { "docid": "4b4ec613e17573384e65c74de0d2339c", "score": "0.6493285", "text": "function rowsWithinTable(opts: Options): Rule {\n return {\n match(node) {\n return (\n (node.object === 'document' || node.object === 'block') &&\n node.type !== opts.typeTable\n );\n },\n\n // Find child cells nodes not in a row\n validate(node) {\n const rows = node.nodes.filter(n => n.type === opts.typeRow);\n\n if (rows.isEmpty()) {\n return undefined;\n }\n\n return {\n rows\n };\n },\n\n // If any, wrap all cells in a row block\n normalize(change, node, { rows }: { rows: Node[] }) {\n rows.forEach(row =>\n change.wrapBlockByKey(\n row.key,\n {\n type: opts.typeTable,\n data: {\n presetAlign: createAlign(row.nodes.size),\n widths: createWidths(row.nodes.size)\n }\n },\n { normalize: false }\n )\n );\n\n return change;\n }\n };\n}", "title": "" }, { "docid": "6e4e5700702410e7a8b2b427d7793fc6", "score": "0.6444893", "text": "function Table() {\n this._keys = [];\n this._data = {};\n}", "title": "" }, { "docid": "4557344722528f90a03646d2cdc3f5a7", "score": "0.64330256", "text": "function rowOnlyInTable(opts: Options, change: Change, context: Object) {\n return change.wrapBlockByKey(context.node.key, opts.typeTable);\n}", "title": "" }, { "docid": "ec8470c671ad1f32853ac8b3099d26fe", "score": "0.64050347", "text": "rows() {return range(this.rowCount);}", "title": "" }, { "docid": "f0c093dd38af1eb3c81ce3c92a9813d5", "score": "0.6399206", "text": "rows () { return this._rows }", "title": "" }, { "docid": "13c38d4335961eec68d17d4bf0fe5ff8", "score": "0.63814384", "text": "function Table() {\n this.type = \"table\";\n this._keys = [];\n this._data = {};\n this.num = count;\n count++;\n}", "title": "" }, { "docid": "c6033dc8921490b4e24f7bb2f98053c7", "score": "0.63536656", "text": "get rows() {\n let rowControls = this.control.elements('tbody > tr');\n\n let RowControlWrapper = require('./rowControlWrapper.po.js');\n return rowControls.value.map(rowControl => new RowControlWrapper(rowControl));\n }", "title": "" }, { "docid": "8c8b2d3b5225f7c30c77e26417bad00a", "score": "0.6319725", "text": "getRows() {\n return (\n <tbody>\n {\n this.props.rowData.map((row, index) => <tr key={index}>{\n row.map((val, dataIndex) => <td key={'' + index + '-' + dataIndex}>{val}</td>)\n }</tr>)\n }\n </tbody>\n );\n }", "title": "" }, { "docid": "dde52b10abf095e335fc7a3b9d2b0771", "score": "0.63060534", "text": "function creatingTableRows(rowTitleText, rowHasChild, rowHasDetail){\n \n var UniversalTableRows = Ti.UI.createTableViewRow({\n title: rowTitleText,\n hasChild: rowHasChild,\n hasDetail: rowHasDetail,\n });\n \n return UniversalTableRows;\n \n}", "title": "" }, { "docid": "df7e9dce2a42773fbfe1a8d80f1fb138", "score": "0.6294195", "text": "function addRow(table) {\n\tclearActiveTds();\n\tvar firsttr = $(\"tr\", table).first();\n\tvar gridn = 0;\n\t$(\"td\", $(\"tr\", table).first()).each(function(i, obj) {\n\t\tgridn += parseInt($(obj).attr('colspan') || 1);\n\t});\n\tvar maxheight = _max_height_of_elements($(\"td\", $(\"tr\", table).last()));\n\tvar newtr = $(\"<tr>\");\n\tfor ( var i = 0; i < gridn; i++) {\n\t\tnewtr.append('<td>');\n\t}\n\t$(\"td\", newtr).first().css('height', maxheight);\n\ttable.append(newtr);\n}", "title": "" }, { "docid": "41da667f53e1beac32ab31f5c10329d9", "score": "0.62776476", "text": "function isTable(mixed) {\n return type_util_1.isObjectWithOwnEnumerableKeys()(mixed, [\n \"isLateral\",\n \"alias\",\n \"columns\",\n \"usedRef\",\n \"unaliasedAst\",\n \"autoIncrement\",\n \"id\",\n \"primaryKey\",\n \"candidateKeys\",\n \"insertEnabled\",\n \"deleteEnabled\",\n \"generatedColumns\",\n \"nullableColumns\",\n \"explicitDefaultValueColumns\",\n \"mutableColumns\",\n \"explicitAutoIncrementValueEnabled\",\n ]);\n}", "title": "" }, { "docid": "ea2c8748948467d4c97e4ea4a2d0150b", "score": "0.62626475", "text": "function Table() {}", "title": "" }, { "docid": "13b318deb45b5be35375d0168f19de77", "score": "0.6202223", "text": "function Table(cols, rows) {\n this.colCount = +cols;\n this.rowCount = +rows;\n this.colNames = [];\n this.rowNames = [];\n this.contents = new Array(+rows);\n for (var i = 0; i < rows; i += 1) {\n this.contents[i] = new Array(+cols);\n }\n this.lastChanged = Date.now();\n}", "title": "" }, { "docid": "5178e35bb68f035d91c375ff339595cf", "score": "0.61668843", "text": "function Table() {\n //sets attributes\n this.header = [];\n this.data = [[]];\n this.tableClass = ''\n\t}", "title": "" }, { "docid": "61d702a2b8870374ec95752ed296fca2", "score": "0.6163349", "text": "get rows() {\n // ˅\n return 1;\n // ˄\n }", "title": "" }, { "docid": "c8ababce1b73d49ca76432bd47cfaf69", "score": "0.6132677", "text": "hasRows () {\n return this.getData().length > 0;\n }", "title": "" }, { "docid": "5d8c4c61eb17cdecce771e25b5e4e889", "score": "0.61320853", "text": "openTableRow () {\r\n if (!(this._stackItem instanceof TableStackItem)) {\r\n throw new Error('Can\\'t add table row to something that is not a table! Check the formatter.');\r\n }\r\n this._stackItem = new TableRowStackItem(this._stackItem);\r\n }", "title": "" }, { "docid": "33223be4388f0e2bcfdd18cedaee0005", "score": "0.6120011", "text": "openTableRow () {\n if (!(this._stackItem instanceof TableStackItem)) {\n throw new Error('Can\\'t add a table row to something that is not a table! Check the formatter.');\n }\n this._stackItem = new TableRowStackItem(this._stackItem);\n }", "title": "" }, { "docid": "025fa171e38e4dfa01c5b354bf444a44", "score": "0.6100662", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"D\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, {\n defaultProps: {\n as: cellAs\n }\n });\n }));\n}", "title": "" }, { "docid": "e033643c2e22bf54988f52bc676a13b8", "score": "0.60980105", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n var classes = cx(useKeyOnly(active, 'active'), useKeyOnly(disabled, 'disabled'), useKeyOnly(error, 'error'), useKeyOnly(negative, 'negative'), useKeyOnly(positive, 'positive'), useKeyOnly(warning, 'warning'), useTextAlignProp(textAlign), useVerticalAlignProp(verticalAlign), className);\n var rest = getUnhandledProps(TableRow, props);\n var ElementType = getElementType(TableRow, props);\n\n if (!childrenUtils.isNil(children)) {\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), children);\n }\n\n return React.createElement(ElementType, _extends({}, rest, {\n className: classes\n }), _map(cells, function (cell) {\n return TableCell.create(cell, {\n defaultProps: {\n as: cellAs\n }\n });\n }));\n}", "title": "" }, { "docid": "71fd66d20ef4ca87e76388d051250890", "score": "0.6095687", "text": "acceptsTableEdit(row) {\n throw new Error('Not implemented: acceptsTableEdit');\n }", "title": "" }, { "docid": "f35b910ee15024aeb7b6cb445d484eee", "score": "0.60713875", "text": "function validRow() {\n\n}", "title": "" }, { "docid": "e5d5770818041ce6610096e640d5f116", "score": "0.6067525", "text": "function checkTable(got) {\n expect(got).to.have.length(1);\n const t = got[0];\n expect(t.type).to.equal('table');\n expect(t)\n .to.deep.equal({\n type: 'table',\n header: ['Field A', 'Field B', 'Field C'],\n rows: [['A1', 'B1', 'C1'], ['A2', 'B2', 'C2']],\n });\n }", "title": "" }, { "docid": "d29a9c987052114dd31573ba8dc92fcc", "score": "0.60649866", "text": "function createRow(value1, value2) {\n makeRow('table-s', value1, value2);\n}", "title": "" }, { "docid": "c647a4925209c8635728bbbb15f0b4a3", "score": "0.6064371", "text": "function Table(width) {\n this.width = width;\n\n // collection of row instances\n this.rows = [];\n\n this.addHeader = function() {\n return \"\\\\trowd\\\\trgaph70\\\\trleft-108\\\\trpaddl70\\\\trpaddr70\\\\trpaddfl3\\\\trpaddfr3\";\n };\n\n // generate the rtf that belongs to this table\n //\n // @return [String] string that generates the rtf table\n this.toRtf = function() {\n\n var rtf = \"\\\\viewkind4\\\\uc1\";\n\n for (var idx = 0; idx < this.rows.length; idx++) {\n\n var row = this.rows[idx];\n if (!row.isValid()) continue;\n\n rtf += this.addHeader();\n rtf += row.toRtf();\n rtf += \"\\\\row\";\n }\n\n // ending this table\n rtf += \"\\\\pard\\\\nowidctlpar\\\\par\";\n\n // ensures that the following parsed rtf code being rendered on a new page.\n rtf += \"\\\\page\";\n return rtf;\n };\n\n // Appens a series of cells to this table.\n //\n // @param cells [Array<Cell>] columns of row.\n this.addSimpleRow = function(cells) {\n this.rows.push(new SimpleRow(cells, this.width));\n };\n\n // Appends a row of cell-lists and cells to this table.\n //\n // @param cells [Array<Array<Cell, String>>] columns of row.\n this.addNestedRow = function(cells) {\n this.rows.push(new NestedRow(cells, this.width));\n };\n}", "title": "" }, { "docid": "cbb9fea92ad7761976be8344bc04b506", "score": "0.6039681", "text": "function renderRows() {\n var rows = '';\n for (var i = 0, len = datasource.length; i < len; i++) {\n rows += '<tr>';\n var row = datasource[i];\n for (var prop in row) {\n if (visibleProps.indexOf(prop) > -1) {\n rows += '<td>' + row[prop] + '</td>';\n }\n }\n rows += '</tr>';\n }\n rows = '<tbody>' + rows + '</tbody>';\n return rows;\n }", "title": "" }, { "docid": "4c23de656a9d09eadedcee02cbbd9ec5", "score": "0.6038698", "text": "function rowRenderTable(table, dataArray) {\r\n var newRow = render(table, \"tr\");\r\n for (var f = 0; f < dataArray.length; f++) {\r\n render(newRow, \"td\", dataArray[f]);\r\n }\r\n}", "title": "" }, { "docid": "288df9ee15272273629badb0bc5da108", "score": "0.60352904", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"B\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"E\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"G\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, { defaultProps: { as: cellAs } });\n })\n );\n}", "title": "" }, { "docid": "b88eb87d2ad2e3345b221fd918f1b3d1", "score": "0.60350657", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"D\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"q\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, { defaultProps: { as: cellAs } });\n })\n );\n}", "title": "" }, { "docid": "e0987179fbd25751a179a356ba796ec4", "score": "0.6026264", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"F\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"H\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"s\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"r\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, { defaultProps: { as: cellAs } });\n })\n );\n}", "title": "" }, { "docid": "94c210333aeb49f16fd80a5bfb2de755", "score": "0.6021969", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_3_classnames___default()(Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(active, 'active'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(disabled, 'disabled'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(error, 'error'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(negative, 'negative'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(positive, 'positive'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"x\" /* useKeyOnly */])(warning, 'warning'), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"A\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"C\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"p\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_6__lib__[\"o\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_6__lib__[\"d\" /* childrenUtils */].isNil(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, { defaultProps: { as: cellAs } });\n })\n );\n}", "title": "" }, { "docid": "eb05480993a45df4ecc1a6d5ccdbf686", "score": "0.6019365", "text": "getTableRows(data) {\n return this.client.call(\"/v1/chain/get_table_rows\", data);\n }", "title": "" }, { "docid": "2984d6b6f58c9b1df2e0356cd572704a", "score": "0.60071486", "text": "function manageRow(data) {\n var rows = '';\n $.each(data, function (key, value) {\n rows = rows + '<tr >';\n rows = rows + '<td>' + value.MaBai + '</td>';\n rows = rows + '<td>' + value.TieuDe + '</td>';\n rows = rows + '<td>' + value.Muc + '</td>';\n rows = rows + '<td>' + value.LinkAudio + '</td>';\n rows = rows + '<td>' + value.Transcript + '</td>';\n rows = rows + '<td>' + value.TieuChuan + '</td>';\n rows = rows + '<td>' + value.HiddenWords + '</td>';\n rows = rows + '</tr>';\n });\n\n\n $(\"tbody\").html(rows);\n}", "title": "" }, { "docid": "68114183a9f5ed42a4d885d676d64d29", "score": "0.6005482", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_4_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(active, 'active'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(disabled, 'disabled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(error, 'error'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(negative, 'negative'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(positive, 'positive'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"a\" /* useKeyOnly */])(warning, 'warning'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"u\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"b\" /* getUnhandledProps */])(TableRow, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__lib__[\"c\" /* getElementType */])(TableRow, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_5_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(cells, function (cell) {\n return __WEBPACK_IMPORTED_MODULE_7__TableCell__[\"a\" /* default */].create(cell, { as: cellAs });\n })\n );\n}", "title": "" }, { "docid": "63f028c51d5c12ca1c0456abf46c4a1c", "score": "0.59954137", "text": "function appendRow() {\n table.append(\"<tr></tr>\");\n}", "title": "" }, { "docid": "1e93dd5e8a0844e40e9402d78ad35c06", "score": "0.5989669", "text": "addRowsToTable(dataArray, table) {\n var parsedArray = JSON.parse(dataArray);\n\n if (parsedArray.length > 0) {\n parsedArray.forEach(rowElement => {\n this.addRowToTable(rowElement, table);\n });\n }\n }", "title": "" }, { "docid": "c128236d2b18688ee6ceac9050b58075", "score": "0.59864706", "text": "function addRows() {\n \n}", "title": "" }, { "docid": "0683502fc0e90e3f7b892787e0b9a622", "score": "0.5975803", "text": "function newRows(table) {\n let row = document.createElement(\"tr\");\n for (let i = 1; i < arguments.length; i++){\n let cell = document.createElement(\"td\");\n cell.innerHTML = arguments[i];\n row.append(cell);\n }\n table.append(row);\n}", "title": "" }, { "docid": "7103c668c068eb28677c1b15c1319985", "score": "0.59731054", "text": "function divTableRow() {\n let attrs = {\n class: \"table-row\",\n style: {\n display: \"table-row\"\n }\n };\n return applyAttributes(document.createElement(\"div\"), attrs);\n}", "title": "" }, { "docid": "66ae98654c06d4a93968481ec6a56e20", "score": "0.5964213", "text": "tableAdd(data){\n // in case what we want is actualy editing a paticular row \n if (this.getEditTarget != null){\n // we get that row\n let row = this.getRows.filter( row => row.getId == this.getEditTarget)[0];\n\t\t\t\t\t// we modify its content\n row.setData = data; \n\t\t\t\t\t// then refresh it\n row.hideRow();\n row.showRow(); \n\t\t\t\t\t// then kicking it out of the selection stack \n ISelection = deleteFromArray(ISelection, this.getEditTarget);\n // and turn off the edition flag\n this.setEditTarget = null;\n }\n else{\n\t\t\t\t// when it comes to new data, that's the easy job, we create a new row\n let new_row = new Row(data , this.getIdTracker);\n\t\t\t\t// add it to the table properties\n this.addRow = new_row;\n\t\t\t\t// and show it in the actual table\n new_row.showRow();\n }\n }", "title": "" }, { "docid": "87570870609a13053dc1cf8407962bab", "score": "0.59637713", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n var classes = (0, _classnames[\"default\"])((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useVerticalAlignProp)(verticalAlign), className);\n var rest = (0, _lib.getUnhandledProps)(TableRow, props);\n var ElementType = (0, _lib.getElementType)(TableRow, props);\n\n if (!_lib.childrenUtils.isNil(children)) {\n return _react[\"default\"].createElement(ElementType, (0, _extends2[\"default\"])({}, rest, {\n className: classes\n }), children);\n }\n\n return _react[\"default\"].createElement(ElementType, (0, _extends2[\"default\"])({}, rest, {\n className: classes\n }), (0, _map2[\"default\"])(cells, function (cell) {\n return _TableCell[\"default\"].create(cell, {\n defaultProps: {\n as: cellAs\n }\n });\n }));\n}", "title": "" }, { "docid": "9016036ef81e46a7a11b96804cc2a1e7", "score": "0.5952282", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()(Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(active, 'active'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(disabled, 'disabled'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(error, 'error'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(negative, 'negative'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(positive, 'positive'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useKeyOnly\"])(warning, 'warning'), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"useVerticalAlignProp\"])(verticalAlign), className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getUnhandledProps\"])(TableRow, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_6__[\"getElementType\"])(TableRow, props);\n\n if (!_lib__WEBPACK_IMPORTED_MODULE_6__[\"childrenUtils\"].isNil(children)) {\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n }\n\n return react__WEBPACK_IMPORTED_MODULE_5___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), lodash_map__WEBPACK_IMPORTED_MODULE_2___default()(cells, function (cell) {\n return _TableCell__WEBPACK_IMPORTED_MODULE_7__[\"default\"].create(cell, {\n defaultProps: {\n as: cellAs\n }\n });\n }));\n}", "title": "" }, { "docid": "40d97d703520538649cb8510a0223a0a", "score": "0.5942801", "text": "function addTableRow (context, elements, content) {\n var PARENT = elements.ROOT;\n if (elements.PARENT.getType() === DocumentApp.ElementType.TABLE) {\n PARENT = elements.PARENT;\n }\n PARENT = PARENT.appendTableRow();\n return PARENT;\n }", "title": "" }, { "docid": "aa117ba0ff797bd9e6965712f4773a34", "score": "0.5935984", "text": "function tbody(node, index, parent) {\n var prev = before(parent, index)\n var head = first(node)\n\n /* Previous table section was already omitted. */\n if (\n element(prev, tableContainers) &&\n closing(prev, place(parent, prev), parent)\n ) {\n return false\n }\n\n return head && element(head, tableRow)\n}", "title": "" }, { "docid": "d6bd2b4cecdfca6d276dbfd572f6ca8f", "score": "0.5928768", "text": "function TableRow(props) {\n var active = props.active,\n cellAs = props.cellAs,\n cells = props.cells,\n children = props.children,\n className = props.className,\n disabled = props.disabled,\n error = props.error,\n negative = props.negative,\n positive = props.positive,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n warning = props.warning;\n\n var classes = (0, _classnames2.default)((0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useKeyOnly)(error, 'error'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(warning, 'warning'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useVerticalAlignProp)(verticalAlign), className);\n var rest = (0, _lib.getUnhandledProps)(TableRow, props);\n var ElementType = (0, _lib.getElementType)(TableRow, props);\n\n if (!_lib.childrenUtils.isNil(children)) {\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), children);\n }\n\n return _react2.default.createElement(ElementType, (0, _extends3.default)({}, rest, { className: classes }), (0, _map3.default)(cells, function (cell) {\n return _TableCell2.default.create(cell, { defaultProps: { as: cellAs } });\n }));\n}", "title": "" }, { "docid": "e6128b62c2a5a5d09a9a77cdaae953b2", "score": "0.59272903", "text": "async function getTableRowsReadOnly(args) {\n return await eosReadOnly\n .getTableRows(args)\n}", "title": "" }, { "docid": "3a7d1cf41d7344d54a127ca1e68aa85f", "score": "0.5917667", "text": "function createTable(rows, cols, data) {\n\n // TODO\n\n return tbl;\n}", "title": "" }, { "docid": "9b6094bec0332feba1bd396124fd8736", "score": "0.5904835", "text": "function setTableRows() {\r\n $(\".sn-table-body-cell\").remove();\r\n //Set table cell values.\r\n $(objs).each(function (index) {\r\n addNewRowToTable(this.type, this.extdesc, this.description, this.amount, this.differed, this.date, index);\r\n });\r\n}", "title": "" }, { "docid": "263ce5792af9db33e613358186f898a9", "score": "0.5904151", "text": "addRowToTable(dataArray, table) {\n var row = $(\"<tr></tr>\");\n\n var disableState = dataArray[\"enabled\"];\n delete dataArray[\"enabled\"];\n\n row.on(\"click\", this.selectionEvent);\n for (const key in dataArray) {\n if (dataArray.hasOwnProperty(key)) {\n const element = dataArray[key];\n\n row.append($(\"<td class='align-middle'>\" + element + \"</td>\"));\n }\n }\n\n if (table.find(\"tbody\").length) {\n table.find(\"tbody\").append(row);\n } else {\n table.find(\"tbody\").append(row);\n }\n }", "title": "" }, { "docid": "702eae81277e77d260f640b70f4dba52", "score": "0.58965075", "text": "function tbody(node, index, parent) {\n var previous = before(parent, index)\n var head = first(node)\n\n // Previous table section was already omitted.\n if (\n element(previous, tableContainers) &&\n closing(previous, place(parent, previous), parent)\n ) {\n return false\n }\n\n return head && element(head, tableRow)\n}", "title": "" }, { "docid": "9d31528e24bde2d99b8e9d7e419a7c2e", "score": "0.58894247", "text": "function tbody(node, index, parent) {\n var prev = before(parent, index)\n var head = first(node)\n\n // Previous table section was already omitted.\n if (\n element(prev, tableContainers) &&\n closing(prev, place(parent, prev), parent)\n ) {\n return false\n }\n\n return head && element(head, tableRow)\n}", "title": "" }, { "docid": "28471d84bc4403f4f860af5c90f2da0d", "score": "0.58829623", "text": "get getRows(){ return this.rows;}", "title": "" }, { "docid": "277e5ce032a8b9ba466a569c9d0acdea", "score": "0.586838", "text": "function OrdersTable()\n{\n Table.call(this);\n}", "title": "" }, { "docid": "9845bf73798c322d4d768ac70d0e9460", "score": "0.58636177", "text": "function count_row(tbl,tipo){\n\tvar id = tbl.attr('id'), table=$('#'+id+' tbody tr').length;\n\tif(table<=0){\n\t\tmensaje('DEBE SELECCIONAR POR LO MENOS '+tipo+'!',\"ERROR\");\n\t\treturn false;\n\t}else{\n\t\tclear_log();\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "a7a37847983a489a6c021ae8f6334d6f", "score": "0.58631444", "text": "function generate_table_row(w) {\n\tvar rp = []\n\tfor (var i = 0; i < w; i++) {\n\t\trp.push(document.createElement('td'));\n\t}\n\treturn rp;\n}", "title": "" }, { "docid": "45851ac00970a369f2c472ec88b333fd", "score": "0.5858494", "text": "validateTableRow(row, lineNumber, page) {\n\t\tif (row[0] !== '|' || row[row.length-1] !== '|') {\n\t\t\tthrow new Error(`Invalid table row in '${page}' (line ${lineNumber}): line does not start and end with '|'`)\n\t\t}\n\t}", "title": "" }, { "docid": "52f07c090808844197a1e487888906d1", "score": "0.58464456", "text": "get rows(){\n return this._rows;\n }", "title": "" }, { "docid": "df96db20acf8c72f41b0f02c97d0b2fd", "score": "0.58446467", "text": "function createRow () {\n\tvar tr = document.createElement('tr');\n\t_.map(_.toArray(arguments), function (v, k) {\n\t\tvar td = document.createElement('td');\n\t\tif (typeof v == 'object')\n\t\t\ttd.appendChild(v)\n\t\telse\n\t\t\ttd.innerHTML = v;\n\t\ttr.appendChild(td);\n\t});\n\treturn tr;\n}", "title": "" }, { "docid": "51374237256fe0051e5e86101059d67a", "score": "0.58424896", "text": "function cellsWithinTable(opts: Options): Rule {\n return {\n match(node) {\n return (\n (node.object === 'document' || node.object === 'block') &&\n node.type !== opts.typeRow\n );\n },\n\n // Find child cells nodes not in a row\n validate(node) {\n const cells = node.nodes.filter(n => n.type === opts.typeCell);\n\n if (cells.isEmpty()) {\n return undefined;\n }\n\n return {\n cells\n };\n },\n\n // If any, wrap all cells in a row block\n normalize(change, node, { cells }: { cells: Node[] }) {\n cells.forEach(cell =>\n change.wrapBlockByKey(cell.key, opts.typeRow, {\n normalize: false\n })\n );\n\n return change;\n }\n };\n}", "title": "" }, { "docid": "1e244ad45535ed9fd616f989a44abb5d", "score": "0.58390725", "text": "markOversizedRows() {\n if (this.wtSettings.getSetting('externalRowCalculator')) {\n return;\n }\n let rowCount = this.TBODY.childNodes.length;\n const expectedTableHeight = rowCount * this.wtSettings.getSetting('defaultRowHeight');\n const actualTableHeight = innerHeight(this.TBODY) - 1;\n let previousRowHeight;\n let rowInnerHeight;\n let sourceRowIndex;\n let currentTr;\n let rowHeader;\n\n if (expectedTableHeight === actualTableHeight && !this.wtSettings.getSetting('fixedRowsBottom')) {\n // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them\n return;\n }\n\n while (rowCount) {\n rowCount -= 1;\n sourceRowIndex = this.rowFilter.renderedToSource(rowCount);\n previousRowHeight = this.getRowHeight(sourceRowIndex);\n currentTr = this.getTrForRow(sourceRowIndex);\n rowHeader = currentTr.querySelector('th');\n\n if (rowHeader) {\n rowInnerHeight = innerHeight(rowHeader);\n } else {\n rowInnerHeight = innerHeight(currentTr) - 1;\n }\n\n if ((!previousRowHeight && this.wtSettings.getSetting('defaultRowHeight') < rowInnerHeight ||\n previousRowHeight < rowInnerHeight)) {\n rowInnerHeight += 1;\n this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;\n }\n }\n }", "title": "" }, { "docid": "93e40b9055cf80a08bfb657d12bb2e25", "score": "0.58389735", "text": "getRow(specifier) {\n return this.DataTable.row(specifier);\n }", "title": "" }, { "docid": "26e74c6f7e946a12c0411d29e72b5c1a", "score": "0.58299553", "text": "function Table({ columns, data }) {\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n } = useTable({\n columns,\n data,\n })\n \n return (\n <table {...getTableProps()}>\n <thead>\n {headerGroups.map(headerGroup => (\n <tr {...headerGroup.getHeaderGroupProps()}>\n {headerGroup.headers.map(column => (\n <th {...column.getHeaderProps()}>{column.render('Header')}</th>\n ))}\n </tr>\n ))}\n </thead>\n <tbody {...getTableBodyProps()}>\n {rows.map((row, i) => {\n prepareRow(row)\n return (\n <tr {...row.getRowProps()}>\n {row.cells.map(cell => {\n return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>\n })}\n </tr>\n )\n })}\n </tbody>\n </table>\n )\n}", "title": "" }, { "docid": "e47b4bf81c692c621a80aa7bc85ca1c9", "score": "0.58298504", "text": "function printRows(){\n let table = document.createElement('table');\n \n for(let i = 0; i < 10; i++){\n let tr = document.createElement('tr');\n for(let j = 0; j < 5; j++){\n let td = document.createElement('td');\n td.style.border = '1px solid black';\n td.style.width = '20px';\n td.style.height = '20px';\n tr.appendChild(td);\n }\n table.appendChild(tr);\n }\n document.body.appendChild(table);\n}", "title": "" }, { "docid": "1a4468c56c0e1cd3e9446c73a4bccba7", "score": "0.582697", "text": "getRows(){\n return this.rows;\n }", "title": "" }, { "docid": "a7afb0a8abecfff91d5aa4966e88c073", "score": "0.5824692", "text": "function TableHead() {}", "title": "" }, { "docid": "a9ef7b52dd7c361d7bbfc4ab63590c97", "score": "0.58208054", "text": "function tr(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, tableRow)\n}", "title": "" }, { "docid": "a9ef7b52dd7c361d7bbfc4ab63590c97", "score": "0.58208054", "text": "function tr(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, tableRow)\n}", "title": "" }, { "docid": "a9ef7b52dd7c361d7bbfc4ab63590c97", "score": "0.58208054", "text": "function tr(node, index, parent) {\n var next = after(parent, index)\n return !next || element(next, tableRow)\n}", "title": "" }, { "docid": "b0d3c16d72c8a1f169942c94afe9c5cf", "score": "0.58124834", "text": "function addtable() {\n tbody.html(\"\");\n console.log(`There are ${tableDatashape.length} records in this table.`);\n console.log(\"----------\");\n tableDatashape.forEach(function(sighting) {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "title": "" }, { "docid": "a9f4c620fecbd59a46277b7e268e4f8e", "score": "0.5795612", "text": "function addRowToTable(row) {\n document.getElementById(\"rows\").appendChild(row);\n}", "title": "" }, { "docid": "fe8689def744e8726344174f66e6e2ed", "score": "0.57886934", "text": "function getMasterPillarRow(table) {\n\t\tvar $rows = table.$.rows;\n\n\t\tvar maxCells = 0;\n\n\t\tvar cellsCount = void 0;\n\n\t\tvar $elected = void 0;\n\n\t\tvar $tr = void 0;\n\n\t\tfor (var i = 0, len = $rows.length; i < len; i++) {\n\t\t\t$tr = $rows[i];\n\t\t\tcellsCount = $tr.cells.length;\n\n\t\t\tif (cellsCount > maxCells) {\n\t\t\t\tmaxCells = cellsCount;\n\t\t\t\t$elected = $tr;\n\t\t\t}\n\t\t}\n\n\t\treturn $elected;\n\t}", "title": "" }, { "docid": "9bb8c8c2a50d9c001b43a2dfc367e48c", "score": "0.5779185", "text": "function rows() {\n var $rows = $(tbody).find('tr:not(.tablepager-initiallyhidden)');\n return $rows;\n }", "title": "" }, { "docid": "ea0999710b8532dae3f61b99a1f650e4", "score": "0.57776064", "text": "allRows(table) {\n return this.camelCase(\n // Was: `all-${this.pluralize(this._singularizedTableName(table))}`\n // Now:\n this.pluralize(this._singularizedTableName(table))\n );\n }", "title": "" }, { "docid": "36a351d0556fc1babb9b1b95c8ef7c64", "score": "0.5770849", "text": "function M(t,e){return h(t,\"table\")&&h(11!==e.nodeType?e:e.firstChild,\"tr\")&&xt(t).children(\"tbody\")[0]||t}", "title": "" }, { "docid": "1c5a69a4375a471c8735f63cb2534cd6", "score": "0.5747912", "text": "function createEmptyRow() {\n return {\n elements: []\n };\n }", "title": "" }, { "docid": "45044711af15f58779f0906039713f56", "score": "0.5747613", "text": "createRows() {\n this.rows = [];\n this.data.forEach((el, index) => {\n this.rows.push(new _row__WEBPACK_IMPORTED_MODULE_0__[\"Row\"](index, el, this));\n });\n }", "title": "" }, { "docid": "b25f21f5cf0cd59803a575193a15be3c", "score": "0.57444733", "text": "function row(key, value) {\n return $(\n tr(\n td(key) +\n td(value) +\n td(editButton(key)) +\n td(deleteButton(key)) +\n td(seeButton(key))));\n}", "title": "" }, { "docid": "4611b2baf0dff86053cfcd5d274fdbfb", "score": "0.57431287", "text": "function table(Tdata) {\n // Clears the HTML Table\n tbody.html(\"\")\n // Go through each row of data and create a table with that data in HTML\n Tdata.forEach(function (line) {\n var row = {}\n row = tbody.append('tr');\n Object.entries(line).map(function([x , y]) {\n row.append('td').text(y).style('border' , 'solid thin black')\n })\n }) \n}", "title": "" }, { "docid": "399c7579adef0abd348732d8376e4a77", "score": "0.5734565", "text": "function addMultTable(rows, col) {\n var tble = document.createElement(\"TABLE\");\n document.body.appendChild(tble);\n for (let i = 0; i < rows; i++) {\n row = tble.insertRow(0);\n for (let i = 0; i < col; i++) {\n cell1 = row.insertCell(0);\n }\n }\n document.body.appendChild(tble);\n\n}", "title": "" }, { "docid": "6d1900a34014261f92c3b265bafacfe8", "score": "0.57328844", "text": "get tableElement() {\n return this._tableElement;\n }", "title": "" }, { "docid": "38570b58a7e560a738a550a4b802c037", "score": "0.573075", "text": "function makeRow()\r\n{\r\n enclose('<tr>\\n<td>', '</td>\\n</tr>');\r\n}", "title": "" }, { "docid": "e5e237c6dae04e95b4da0bee54435551", "score": "0.5729052", "text": "function renderTableRows(clients) {\n for (x in clients) {\n renderTableRow(clients[x]);\n }\n }", "title": "" }, { "docid": "4bc78f1cbaf85430a7119af6e82d908d", "score": "0.57280797", "text": "function Table({ columns, data }) {\n\t const {\n\t getTableProps,\n\t getTableBodyProps,\n\t headerGroups,\n\t rows,\n\t prepareRow,\n\t } = useTable({\n\t columns,\n\t data,\n\t })\n\t \n\t return (\n\t <table {...getTableProps()}>\n\t <thead>\n\t {headerGroups.map(headerGroup => (\n\t <tr {...headerGroup.getHeaderGroupProps()}>\n\t {headerGroup.headers.map(column => (\n\t <th {...column.getHeaderProps()}>{column.render('Header')}</th>\n\t ))}\n\t </tr>\n\t ))}\n\t </thead>\n\t <tbody {...getTableBodyProps()}>\n\t {rows.map((row, i) => {\n\t prepareRow(row)\n\t return (\n\t <tr {...row.getRowProps()}>\n\t {row.cells.map(cell => {\n\t return <td {...cell.getCellProps()}>{cell.render('Cell')}</td>\n\t })}\n\t </tr>\n\t )\n\t })}\n\t </tbody>\n\t </table>\n\t )\n}", "title": "" }, { "docid": "074f5596598d49438816c9ee24498e54", "score": "0.5721874", "text": "function TableRow(props, context) {\n\t var _classNames;\n\n\t var children = props.children,\n\t classes = props.classes,\n\t classNameProp = props.className,\n\t Component = props.component,\n\t hover = props.hover,\n\t selected = props.selected,\n\t other = (0, _objectWithoutProperties3.default)(props, ['children', 'classes', 'className', 'component', 'hover', 'selected']);\n\t var table = context.table;\n\n\n\t var className = (0, _classnames2.default)(classes.root, (_classNames = {}, (0, _defineProperty3.default)(_classNames, classes.head, table && table.head), (0, _defineProperty3.default)(_classNames, classes.footer, table && table.footer), (0, _defineProperty3.default)(_classNames, classes.hover, table && hover), (0, _defineProperty3.default)(_classNames, classes.selected, table && selected), _classNames), classNameProp);\n\n\t return _react2.default.createElement(\n\t Component,\n\t (0, _extends3.default)({ className: className }, other),\n\t children\n\t );\n\t}", "title": "" }, { "docid": "ed177f1fcd6f198e098b29accd5135dd", "score": "0.5721273", "text": "function SubRows({ row, rowProps, visibleColumns, data, loading }) {\n if (loading) {\n return (\n <tr>\n <td />\n <td />\n <td colSpan={visibleColumns.length - 1}>\n Loading...\n </td>\n </tr>\n );\n }\n\n\n return (\n <>\n {data.map((x, i) => {\n return (\n <tr\n {...rowProps}\n // key={`${rowProps.key}-expanded-${i}`}\n >\n {row.cells.map((cell) => {\n return (\n <td\n {...cell.getCellProps()}\n >\n {cell.render(cell.column.SubCell ? 'SubCell' : 'Cell', {\n value:\n cell.column.accessor &&\n cell.column.accessor(x, i),\n row: { ...row, original: x }\n })}\n </td>\n );\n })}\n </tr>\n );\n })}\n </>\n );\n}", "title": "" }, { "docid": "1b0aa8e0e5e9c12dcf1a9d176596044f", "score": "0.5712376", "text": "function Table() {\n return (\n <Wrapper>\n <TableHeadWrapper>\n <TableHead>Cryptocurrency</TableHead>\n <TableHead>Price</TableHead>\n <TableHead>Market Cap</TableHead>\n <TableHead>24H Change</TableHead>\n </TableHeadWrapper>\n <Wrapper>\n <TableRowWithData2 />\n </Wrapper>\n </Wrapper>\n );\n}", "title": "" }, { "docid": "0b8c563589f6082092643a0a7582d9b6", "score": "0.57074285", "text": "displayTable() {\n const table = document.querySelector(\"#table\");\n const headingRow = document.createElement(\"tr\");\n table.appendChild(headingRow);\n for (let j = 0; j <= ui.DEFAULT_COLUMNS; j++) {\n let cell;\n if (j) cell = ui._createColumnHeader(j);\n else {\n cell = document.createElement(\"td\");\n cell.classList.add(\"row-header\");\n }\n headingRow.appendChild(cell);\n }\n for (let i = 1; i <= ui.DEFAULT_ROWS; i++) table.appendChild(ui._createRow(i, ui.DEFAULT_COLUMNS));\n }", "title": "" }, { "docid": "d26c4c191fe20fe8af255ad1b70272b2", "score": "0.5700203", "text": "function createTable() {\n tbody.html(\"\");\n tableData.forEach((one_row) => {\n var newrow = tbody.append('tr');\n Object.entries(one_row).forEach(([k, v]) => {\n newrow.append('td').text(v);\n });\n });\n}", "title": "" }, { "docid": "fb5c323bd28e84c39ffc6e1080c3c917", "score": "0.5691327", "text": "function addRow(tableID, columnas, datos) {\r\n var table = document.getElementById(tableID);\r\n var rowCount = table.tBodies[0].rows.length;\r\n var row = table.tBodies[0].insertRow(rowCount);\r\n var idTR = tableID + \"_tr_\" + rowCount;\r\n var idTD = tableID + \"_td_\" + rowCount;\r\n for (i = 0; i < columnas; i++) {\r\n var cellX = row.insertCell(i);\r\n cellX.scope = \"row\";\r\n cellX.innerHTML = datos[i];\r\n cellX.id = idTD + '_' + i;\r\n }\r\n row.id = idTR;\r\n\r\n}", "title": "" }, { "docid": "8b178fe53429926ac53da325940dc7ed", "score": "0.5680522", "text": "loadSlottedTable() {\n let table = this.children.item(0);\n // support wrapping editable-table-display tag or primative\n if (table && table.tagName === \"EDITABLE-TABLE-DISPLAY\") {\n table = table.children.item(0);\n }\n if (\n !!table &&\n table.tagName === \"TABLE\" &&\n table.children &&\n table.children.length > 0\n ) {\n this.importHTML(table);\n }\n }", "title": "" }, { "docid": "b8b6f991b359f830791a88e37c06aa3a", "score": "0.5673283", "text": "getTable() {\n const eos = Eos();\n eos.getTableRows({\n \"json\": true,\n \"code\": \"notechainacc\", // contract who owns the table\n \"scope\": \"notechainacc\", // scope of the table\n \"table\": \"notestruct\", // name of the table as specified by the contract abi\n \"limit\": 100,\n }).then(result => this.setState({ noteTable: result.rows }));\n }", "title": "" }, { "docid": "40b4490057975ab748e57bd70111753c", "score": "0.5671518", "text": "render() {\n return (\n <div>\n {\n this.props.rowData.length === 0 ? <div className=\"text-center\"> No rows to display. </div> :\n <Table striped bordered hover size=\"sm\">\n {this.getHeaders()}\n {this.getRows()}\n </Table>\n }\n </div>\n );\n }", "title": "" } ]
8acb4e737b3d1ee3dc276199cd1bcc03
Dynamically Add New Field article
[ { "docid": "ea21ae9d08415970f6c8589067a1c2e3", "score": "0.5840132", "text": "addarticleRow() {\n this.article = new _app_modals_premiumprofile__WEBPACK_IMPORTED_MODULE_9__[\"article\"]();\n const control = this.premiumMemberForm.controls['articleRows'];\n control.push(this.initarticleRows());\n this.premiumProfile.articleImg.push(this.article);\n }", "title": "" } ]
[ { "docid": "07fc59801d5c4b47f9af5dc73ddc85db", "score": "0.6732993", "text": "function add_fields(link, association, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\")\n $(link).up().insert({\n before: content.replace(regexp, new_id)\n });\n}", "title": "" }, { "docid": "0583dc38b286c05353aeb1a2ac14c3fb", "score": "0.66434693", "text": "function addField() {\n vm.field.count++;\n\n var newField = {\n \"id\": vm.field.count,\n \"title\": vm.field.type,\n \"type\": vm.field.type,\n \"value\": \"\",\n \"required\": true,\n \"disabled\": false\n };\n vm.formModel.formFields.push(newField);\n }", "title": "" }, { "docid": "e606f0df5be714e277608c292b7a6508", "score": "0.6569265", "text": "function articleAdd(caller){\n var frmId = caller.dataset.frm;\n var frm = document.querySelector(`#${frmId}`);\n var frmData = new FormData(frm);\n fetch('/article',{credentials:'include', method: 'post', body: frmData})\n .then(function(data){\n document.querySelector('div[data-cmd=\"article\"]').click();\n })\n .catch(function(err){\n console.log(err);\n })\n }", "title": "" }, { "docid": "82449ec5bd489155441c1e856c682e54", "score": "0.6465501", "text": "function add_fields(link, association, content){\n\tvar new_id = new Date().getTime();\n\tvar regexp = new RegExp(\"new_\" + association, \"g\");\n\t$(link).parent().before(content.replace(regexp, new_id));\n}", "title": "" }, { "docid": "47982b9fa466c495cd27e00f31979aa9", "score": "0.63098264", "text": "function addField () {\n\tfields.innerHTML += '<li><h4>New field:</h4><input type=\"text\"></li>'\n}", "title": "" }, { "docid": "52b9125c52180ee73bf784b720bd4f86", "score": "0.63071465", "text": "function add_fields(link, association, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\")\n $(link).parent().before(content.replace(regexp, new_id));\n var upload_label = $('label.upload_image');\n if($(upload_label).length > 0) {\n $(upload_label).text('browse');\n }\n}", "title": "" }, { "docid": "c82617c7e66af91bf281702c06e13ae6", "score": "0.62707996", "text": "function add_fields(association, content, prefix) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\");\n $(\"#add-attachment-\" + prefix).before(content.replace(regexp, new_id));\n}", "title": "" }, { "docid": "be4d0fa1149bee52d48495082f60ad9b", "score": "0.62297386", "text": "function appendArticle() {\n let articleMaster = document.querySelector('.articles');\n let clonedArticle = articleMaster.firstElementChild.cloneNode(true);\n new Article(clonedArticle);\n clonedArticle.querySelector('h2').textContent = headlineInput.value\n clonedArticle.querySelector('.date').textContent = new Date();\n clonedArticle.querySelector('p:nth-of-type(2)').textContent = paragraphInput.value;\n clonedArticle.querySelector('p:nth-of-type(3)').textContent = paragraphInput.value;\n clonedArticle.querySelector('p:last-of-type').textContent = paragraphInput.value;\n if (headlineInput.value.length > 0 && paragraphInput.value.length > 0) {\n articleMaster.appendChild(clonedArticle);\n headlineInput.value = null;\n paragraphInput.value = null;\n } else {\n return alert('You must enter a headline and an article.');\n }\n \n}", "title": "" }, { "docid": "dc6dac9aea6d8b72bce213b90634efe3", "score": "0.62229854", "text": "newField(embed, field) {\n\t\tthis.webhookForm.embeds[embed].fields.push(field);\n\t}", "title": "" }, { "docid": "21119f58d440c50d26bf685d8dd45c85", "score": "0.6201534", "text": "function add_fields(link, content) {\n\tvar count = $(link).up().previous(\".research\").down(\".count\").innerHTML;\n\tvar regexp = new RegExp(\"1\", \"g\")\n\t\n $(link).up().insert({\t\t\t\n\t before: content.replace(regexp,(count *1) + 1)\n\t });\n}", "title": "" }, { "docid": "25dc8c8c8a7057dda740f5ba1118892f", "score": "0.6158693", "text": "function addField(fieldType) {\n\n var hasRequired, hasChoices;\n var includeRequiredHTML = '';\n var includeChoicesHTML = '';\n\n switch (fieldType) {\n case 'radio':\n hasRequired = true;\n hasChoices = true;\n break;\n case 'checkbox':\n hasRequired = false;\n hasChoices = true;\n break;\n }\n\n if (hasRequired) {\n includeRequiredHTML = '' +\n '<label>¿Es requerido? ' +\n '<input class=\"toggle-required\" type=\"checkbox\">' +\n '</label>'\n }\n\n if (hasChoices) {\n includeChoicesHTML = '' +\n '<div class=\"choices\">' +\n '<ul></ul>' +\n '<button type=\"button\" class=\"add-choice\">Agregar opción</button>' +\n '</div>'\n }\n\n return '' +\n '<div class=\"field\" data-type=\"' + fieldType + '\">' +\n '<button type=\"button\" class=\"delete\">Eliminar pregunta</button>' +\n '<h3>' + fieldType + '</h3>' +\n '<label>Enunciado:' +\n '<input type=\"text\" class=\"field-label\">' +\n '</label>' +\n includeRequiredHTML +\n includeChoicesHTML +\n '</div>'\n }", "title": "" }, { "docid": "a7f464449468f7fa72d3196cec627438", "score": "0.61568403", "text": "function add_fields(link, association, content, hide_onclick) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\");\n $(link).parent().before(content.replace(regexp, new_id));\n if(hide_onclick){\n $(link).hide();\n }\n}", "title": "" }, { "docid": "db5eb27a775e49456c7fee652ecb846b", "score": "0.615014", "text": "function populateArticle(value)\n{\n let container = $(\"<div class='article-div'></div>\");\n let btnDelete = $(\"<button class='btn btn-danger del-article' style='margin-left: 15px'>Delete Article</button>\");\n let btnNote = $(\"<button class='btn btn-info add-note'>Add Note</button>\")\n btnNote.attr(\"data-id\", value._id);\n btnDelete.attr(\"data-id\", value._id);\n container.append(\"<p data-id='\" + value._id + \"'>\" + value.title + \"<br />\");\n container.append(\"<a href=\" + value.link + \">\"+value.link+\"</a><br />\");\n container.append(btnNote);\n container.append(btnDelete);\n container.append(\"<hr/>\");\n $(\"#saved-articles\").append(container);\n}", "title": "" }, { "docid": "7825d8694def6ce5c4962d43f0c63f83", "score": "0.6142342", "text": "add(fieldTitleOrInternalName) {\n return Object(_operations_js__WEBPACK_IMPORTED_MODULE_5__[\"spPost\"])(this.clone(ViewFields, `addviewfield('${fieldTitleOrInternalName}')`));\n }", "title": "" }, { "docid": "b2db1423ea80a8fd3293334d2a1aa3af", "score": "0.61308956", "text": "function fieldAdded (tr) {\n /* Setup event handling on clone */\n setupSlugGenerator(tr);\n \n /* Get the selected type for the new field */\n var internalFieldType = setFieldType(tr);\n \n /* Add corresponding field options */\n addFieldOptions(tr, internalFieldType);\n }", "title": "" }, { "docid": "1abea3962b1ef3def78b2211185af6d4", "score": "0.60575044", "text": "function newArticle() {\n $log.info('newArticle');\n vm.post = postArticle;\n }", "title": "" }, { "docid": "532cf3713d351d9c23a5e1e54455ade7", "score": "0.60509354", "text": "function createField() {\n\t field.impl = uiFields[field.type](field, context)\n\t .on('change', function(t, onInput) {\n\t dispatch$1.call('change', field, t, onInput);\n\t });\n\n\t if (entity) {\n\t field.entityID = entity.id;\n\t // if this field cares about the entity, pass it along\n\t if (field.impl.entity) {\n\t field.impl.entity(entity);\n\t }\n\t }\n\t }", "title": "" }, { "docid": "a8c2e946d80f547483b34a39c8886e0f", "score": "0.6030246", "text": "function newItem(){\n sendRequest(\n 'articles',\n {\n 'action': 'getNewItemForm',\n \"id_menucategory\": $('#kategoria').val(),\n 'lang': $('#kategoria').find(\"option:selected\").parent().attr('title')\n }, function(data){\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n initTinyMce();\n initDatepickers();\n });\n}", "title": "" }, { "docid": "2f78c9def8f6a7277a6989b7ebb2c77f", "score": "0.60145575", "text": "function simple_fields_field_group_add_field() {\n\n\t\tsimple_fields_highest_field_id++;\n\n\t\tvar data = {\n\t\t\taction: 'simple_fields_field_group_add_field',\n\t\t\tsimple_fields_highest_field_id: simple_fields_highest_field_id\n\t\t};\n\n\t\t$.post(ajaxurl, data, function(response) {\n\t\t\tvar ul = $(\"#simple-fields-field-group-existing-fields ul:first\"),\n\t\t\t\t$response = $(response);\n\t\t\tul.append($response);\n\t\t\tul.find(\".simple-fields-field-group-one-field:last\").effect(\"highlight\").find(\".simple-fields-field-group-one-field-name\").focus();\n\t\t});\n\n\t}", "title": "" }, { "docid": "3319b6599207919abdbb6468a3cedf9f", "score": "0.60060865", "text": "function addField(data, datatype) {\n\tlet somediv = document.getElementById(data);\n\tlet numid = data+$newfields;\n\tlet textbox = document.createElement(\"input\");\n\ttextbox.type = \"text\";\n textbox.name = datatype;\n\ttextbox.placeholder = \"Additional data...\"\n\tlet newbut = document.createElement(\"input\")\n\tnewbut.type = \"button\";\n\tnewbut.style = \"float: right;\";\n\tnewbut.class = \"btn btn-warning\";\n\tnewbut.onclick = function() {removeField(data, numid)};\n\tnewbut.value = \"-\";\n\tlet newdiv = document.createElement(\"div\");\n\tnewdiv.setAttribute('id', numid)\n\t// to limit boxes\n\tif($newfields<MAX_TEXT){\n\t\tnewdiv.appendChild(document.createElement(\"br\"));\n\t\tnewdiv.appendChild(textbox);\n\t\tnewdiv.appendChild(newbut);\n\t\t$newfields++;\n\t\tsomediv.appendChild(newdiv)\n\t}\n}", "title": "" }, { "docid": "d97e883a759bd9de21dc74d8a5cb2ae7", "score": "0.5978388", "text": "function addField (name, field, removable, mceReplace)\n{\n\tnewField = createField (name, field, removable)\n\tthis.fields[newField.id] = newField\n\tthis.mainDiv.appendChild (newField)\n\n if (mceReplace && this.getField(field['id']))\n {\n tinyMCE.execCommand (\"mceAddControl\", true, field['id'])\n }\n\n\treturn newField\n}", "title": "" }, { "docid": "93001953d1e428ad38c34c2fb6e4e172", "score": "0.59685856", "text": "add(title, fieldType, properties) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const postBody = Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_4__[\"body\"])(Object.assign(Object(_utils_metadata_js__WEBPACK_IMPORTED_MODULE_3__[\"metadata\"])(fieldType), {\n \"Title\": title,\n }, properties));\n if (!_telemetry_js__WEBPACK_IMPORTED_MODULE_7__[\"tag\"].isTagged(this)) {\n _telemetry_js__WEBPACK_IMPORTED_MODULE_7__[\"tag\"].configure(this, \"fs.add\");\n }\n const data = yield Object(_operations_js__WEBPACK_IMPORTED_MODULE_6__[\"spPost\"])(this.clone(Fields, null), postBody);\n return {\n data,\n field: this.getById(data.Id),\n };\n });\n }", "title": "" }, { "docid": "ec4e13e3837352e6241ec81fee98bc83", "score": "0.5966497", "text": "function simple_fields_field_group_add_field() {\n\t\tsimple_fields_highest_field_id++;\n\t\tvar data = {\n\t\t\taction: 'simple_fields_field_group_add_field',\n\t\t\tsimple_fields_highest_field_id: simple_fields_highest_field_id\n\t\t}\n\t\t$.post(ajaxurl, data, function(response) {\n\t\t\tvar ul = $(\"#simple-fields-field-group-existing-fields ul:first\");\n\t\t\t$response = $(response);\n\t\t\tul.append($response);\n\t\t\tul.find(\".simple-fields-field-group-one-field:last\").effect(\"highlight\").find(\".simple-fields-field-group-one-field-name\").focus();\n\t\t\t//$response.effect(\"highlight\").find(\".simple-fields-field-group-one-field-name\").focus();\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "7d18ad83f299d857e774853e47144740", "score": "0.5936525", "text": "static modifyFields() {\n return [\n 'article_id',\n 'tag_id',\n ];\n }", "title": "" }, { "docid": "1cbf4b11e402530587c69729736fe0d4", "score": "0.59271", "text": "function addDescriptionField(n) {\r\n divWhereToAdd = \"#break-\" + n;\r\n\r\n if ($(divWhereToAdd).children().length >= 1) {\r\n toastr.error('Só é possível adicionar instruções a uma tarefa que esteja vazia.');\r\n } else {\r\n $(divWhereToAdd).append('<div class=\"well well-sm\" id=\"instDivField-' + instField + '\">' +\r\n '<button type=\"button\" class=\"btn btn-danger btn-xs btn-right\" title=\"Apagar\" onclick=\"deleteElementInsidePanel(' + instDivField + ',' + instField + ',' + n + ')\"><span class=\"fa fa-trash-o\"></span></button> ' +\r\n '<i class=\"title-in-well\"><span class=\"glyphicon glyphicon-font\"></span> Campo de instrução</i><br/>' +\r\n '<label>Instruções a apresentar:</label><textarea class=\"form-control\" rows=\"3\" id=\"fixed-description\"></textarea></div>');\r\n $(divWhereToAdd + \"-panel\").find('#fixed-break input[type=\"checkbox\"]').prop(\"checked\", true); // a description field has to be fixed\r\n $(divWhereToAdd + \"-panel\").find('#fixed-break input[type=\"checkbox\"]').prop(\"disabled\", true); // blocks the fixed attribute\r\n }\r\n}", "title": "" }, { "docid": "402d2e851eb95df29860180e262610c0", "score": "0.5887134", "text": "function addFields(numToAdd) {\n numFields = numToAdd;\n var template1 = '<div class=\"fields\">\\n</div><input class=\"field form-control\" id=\"field';\n var template2 = '\" placeholder=\"Enter Field Name (Ex: Grade)\">\\n</div>\\n';\n var temp = \"<label>Fields</label>\";\n //For making the first field called \"label\"\n temp += '<div class=\"fields\">\\n</div><input class=\"field form-control\" id=\"field1\" placeholder=\"label (the first field must be called label)\" disabled>\\n</div>\\n';\n //Set i to equal 1 if the first field does not need to be \"label\". Also delete the line above and the jQuery call in saveFields()\n for (var i = 2; i < numToAdd + 1; i++) {\n temp += template1 + i + template2;\n }\n document.getElementById(\"moreFields\").innerHTML=temp;\n $(\"#saveFields\").show();\n}", "title": "" }, { "docid": "c117f13d1ce9d433454915715cfd8763", "score": "0.58866394", "text": "function addLinkField() {\n var place = document.getElementById('form');\n var newField = document.createElement(\"input\");\n newField.className = \"ui input link\";\n newField.type = \"text\";\n place.appendChild(newField);\n}", "title": "" }, { "docid": "223cbaab01a0e8dee7dc8843ca7a021f", "score": "0.58793503", "text": "function displayArticle(article) {\n const templateItem = document.getElementById(\"templateArticle\")\n const cloneItem = document.importNode(templateItem.content, true)\n \n cloneItem.getElementById(\"picture\").setAttribute(\"src\", article.imageUrl), // setAttribute ->img\n cloneItem.getElementById(\"nameItem\").textContent= article.name,\n cloneItem.getElementById(\"price\").textContent= displayPrice(article.price),\n cloneItem.getElementById(\"productLink\").href += `?id=${article._id}`, // recuperation/id\n \n document.getElementById(\"furniture\").appendChild(cloneItem) // creation d'un enfant\n}", "title": "" }, { "docid": "d14316f13bccf03197149045d6969bca", "score": "0.5875073", "text": "function createField (name, field, removable)\n{\n\tdesc = field['desc']\n\ttype = field['type']\n\n\t// Create the title of the field\n\ttitle = document.createElement (\"span\")\n\ttext = document.createTextNode (name)\n\n\ttitle.setAttribute (\"class\", \"fieldName\")\n\ttitle.appendChild (text)\n\n\tdate = new Date ()\n\tid = new String (date.getTime ())\n\tvar rmL = null\n\n\tif (removable) {\n\t\trm = document.createElement (\"span\")\n\t\trm.setAttribute (\"class\", \"removeButton\")\n\t\trm.setAttribute (\"id\", id)\n\t\trm.appendChild (document.createTextNode (\"Remove\"))\n\t\trm.onclick = removeField\n\t}\n\n\t// Create the description tag\n\tdescTag = document.createElement (\"div\")\n\tdescTag.setAttribute (\"class\", \"descriptionField\")\n\tdescTag.appendChild (document.createTextNode (desc))\n\n\t// Determine which type of field we want\n\tswitch (type)\n\t{\n\t\tcase TYPE_ENTRY:\n\t\t\tentry = document.createElement (\"input\")\n entry.id = field['id']\n\t\t\tentry.setAttribute (\"type\", \"text\")\n\t\t\tentry.style.width = \"90%\"\n\t\t\tentry.style.margin = \"20px\"\n\t\t\tentry.style.border = \"thin solid #7777cc\"\n\t\t\tentry.tabIndex = \"-1\"\n\t\t\tbreak\n\t\tcase TYPE_TEXTAREA:\n\t\t\tentry = document.createElement (\"div\")\n\t\t\tentry.style.width = \"90%\"\n\t\t\tentry.style.margin = \"20px\"\n\n\t\t\ttextarea = document.createElement (\"textarea\")\n\t\t\tentry.appendChild (textarea)\n\t\t\ttextarea.setAttribute (\"rows\", 10)\n\t\t\ttextarea.id = field['id']\n\t\t\ttextarea.style.width = \"100%\"\n\t\t\tbreak\n\t\tcase TYPE_LINK:\n\t\t\trmL = document.createElement (\"span\")\n\t\t\trmL.setAttribute (\"class\", \"removeButton\")\n\t\t\trmL.setAttribute (\"id\", id)\n\t\t\trmL.appendChild (document.createTextNode (\"Remove All\"))\n\n\t\t\tlinkID = field['id']\n\t\t\tentry = document.createElement (\"div\")\n\t\t\tentry.style.width = \"90%\"\n\t\t\tentry.style.margin = \"20px\"\n\t\t\tentry.id = linkID\n\t\t\tentry.linkObj = new LinkField (entry, rmL)\n\t\t\tbreak\n case TYPE_FILELINK:\n\t\t\trmL = document.createElement (\"span\")\n\t\t\trmL.setAttribute (\"class\", \"removeButton\")\n\t\t\trmL.setAttribute (\"id\", id)\n\t\t\trmL.appendChild (document.createTextNode (\"Remove All\"))\n\n\t\t\tlinkID = field['id']\n\t\t\tentry = document.createElement (\"div\")\n\t\t\tentry.style.width = \"90%\"\n\t\t\tentry.style.margin = \"20px\"\n\t\t\tentry.id = linkID\n\t\t\tentry.linkObj = new LinkField (entry, rmL, true)\n\t\t\tbreak\n \n\t\tdefault:\n\t\t\tentry = document.createElement (\"textarea\")\n\t\t\tbreak\n\t}\n\n\t// Package it all up and return it\n\tdiv = document.createElement (\"div\")\n\tdiv.setAttribute (\"id\", id)\n\tdiv.style.marginTop = \"20px\"\n\tdiv.appendChild (title)\n\tif (removable)\n\t\tdiv.appendChild (rm)\n\n\tif (rmL)\n\t{\n\t\tdiv.appendChild (rmL)\n\t\tdiv.linkObj = entry.linkObj\n\t}\n\n\tdiv.appendChild (document.createElement (\"br\"))\n\tdiv.appendChild (descTag)\n\tdiv.appendChild (entry)\n\tdiv.fieldName = name\n\n\treturn div\n}", "title": "" }, { "docid": "180cc47d109fe9aae69c0b7d1952a923", "score": "0.5864435", "text": "function article(){\n fetch('/menuitems', {method : 'get'})\n .then(function(data){\n return data.json();\n })\n .then(function(jsonData){\n if(jsonData){\n var dropdown = document.createElement(\"select\");\n dropdown.name=\"catId\";\n var option = document.createElement(\"option\");\n option.value = 0;\n option.textContent = \"Vælg kategori\";\n dropdown.appendChild(option);\n jsonData.forEach(function(jd){\n option = document.createElement(\"option\");\n option.value = jd.id;\n option.textContent = jd.name;\n dropdown.appendChild(option);\n });\n var form = document.createElement(\"form\")\n form.id = \"frmArticle\";\n\n var title = document.createElement(\"input\")\n title.width = 50;\n title.type = \"text\";\n title.name = \"title\";\n title.placeholder = \"Artikel overskrift\";\n var textarea = document.createElement(\"textarea\")\n textarea.name = \"article\";\n form.appendChild(title);\n form.appendChild(textarea);\n form.appendChild(dropdown);\n var btn = document.createElement('button')\n btn.type = \"button\";\n btn.dataset.cmd = \"articleAdd\"\n btn.dataset.frm = \"frmArticle\";\n btn.innerHTML = \"Upload\";\n form.appendChild(btn);\n var container = document.createElement(\"div\");\n container.className = \"tbl-container\";\n container.appendChild(form);\n var content = document.querySelector('#content');\n content.innerHTML = '';\n content.appendChild(container);\n }\n })\n .catch(function(err){\n console.log(err);\n })\n }", "title": "" }, { "docid": "cef006c1d4a18c0adbdb0e8b2e83f04e", "score": "0.5859029", "text": "addFields(type,text){\n let fields=this.fields\n let field\n //Depending on the field selected by the user the variable field get an input text,email or button\n switch (type) {\n case 'text':\n field=new InputText(text)\n break;\n case 'email':\n field=new InputEmail(text)\n break;\n case 'button':\n field=new Button(text)\n break;\n default:\n throw new Error('Type not valid '+type)\n break;\n }\n fields.push(field)\n }", "title": "" }, { "docid": "86c3a10cb964bd6a560332651bc5c159", "score": "0.5845446", "text": "function f_add_sub (\n p_field\n ) {\n\n /****\n * Wrap the field and insert\n ****/\n var v_field = '[sub{'+p_field.text+'}]'\n Ext.getCmp('fp_ed_body').setActive(true);\n Ext.getCmp('fp_ed_body').insertAtCursor(v_field);\n }", "title": "" }, { "docid": "86c3a10cb964bd6a560332651bc5c159", "score": "0.5845446", "text": "function f_add_sub (\n p_field\n ) {\n\n /****\n * Wrap the field and insert\n ****/\n var v_field = '[sub{'+p_field.text+'}]'\n Ext.getCmp('fp_ed_body').setActive(true);\n Ext.getCmp('fp_ed_body').insertAtCursor(v_field);\n }", "title": "" }, { "docid": "38144104e9404c0d09db3aa2c59a8b1f", "score": "0.5810823", "text": "function createFields(uniqueFields) {\n \n // Get the DIV where we will add out INPUT controls.\n var entryFields = document.getElementById(\"entryFields\");\n\n // Clear the contents in case it has already been populated with INPUT controls.\n while (entryFields.hasChildNodes()) {\n entryFields.removeChild(entryFields.lastChild);\n }\n\n // Create a unique INPUT element for each unique content control tag.\n for (var i = 0; i < uniqueFields.length; i++) {\n entryFields.appendChild(document.createTextNode(uniqueFields[i].title + ': '));\n var input = document.createElement(\"input\");\n input.type = \"text\";\n input.id = uniqueFields[i].tag;\n entryFields.appendChild(input);\n entryFields.appendChild(document.createElement(\"br\"));\n }\n }", "title": "" }, { "docid": "58ee4618d299b5117ef5a986d254f548", "score": "0.57849604", "text": "addField(element_id, config=null) {\n const default_conf = {\n \"element\": \"div\",\n \"classes\": []\n }\n if(config == null) {\n config = default_conf\n } else {\n // fill missing config keys with defaults\n for(let prop in default_conf) {\n if(!(prop in config)) {\n config[prop] = default_conf[prop]\n }\n }\n }\n if(!(element_id in this.fields)) {\n this.fields[element_id] = config\n this.onNodeAdd[element_id] = function() {}\n this.onNodeDrop[element_id] = function() {}\n }\n }", "title": "" }, { "docid": "f076567feb712e09b990adf2b015dc56", "score": "0.5776998", "text": "function addChildPage() {\n Sitecore.PageModes.PageEditor.postRequest('webedit:new()');\n}", "title": "" }, { "docid": "0b72f0abd90c0d72727ba780e22a07bf", "score": "0.5760238", "text": "function ajaxAddField(id) {\n $.ajax(\n {\n type: \"POST\",\n url: newfield_url + id,\n data: \"id=\" + id,\n cache: false,\n success: function(newElement) {\n \n // Stop after 10 inserts\n if (11 > id) {\n // Insert new element before the Add button\n $(\"#addElement-label\").before(newElement);\n \n // Parse the element to receive Dojo style\n var n = dojo.byId(\"newType\" + id);\n n.outerHTML = newElement;\n dojo.parser.parse(n);\n \n // Increment and store id\n $(\"#id\").val(++id);\n }\n }\n }\n );\n}", "title": "" }, { "docid": "a0483ecf935d8d997df33149a36e2fa7", "score": "0.5670576", "text": "function citations_field() {\n\t\tvar citations_div = $(\"<div/>\").attr(\"id\",\"nb-citations\");\n\t\t \n var citationsLabel = $(\"<label/>\")\n .addClass(\"fieldlabel\")\n .attr(\"for\",\"nb-citations\")\n .text(\"Citations for third party resources: \");\n\n var citation_container = $(\"<div/>\").addClass(\"nb-citation-container\");\n\n var citationCount = 0;\n\n\t var addCitationButton = $(\"<button/>\")\n\t .addClass(\"btn btn-xs btn-default btn-add add-citation-button\")\n\t .attr(\"id\",\"add-nb-citation-button\")\n\t .attr(\"type\",\"button\")\n\t .attr(\"aria-label\",\"Add citation\")\n\t .click(addCitation)\n\t .append($(\"<i>\").addClass(\"fa fa-plus\"));\n\t \n\t var lastCitation;\n function addCitation() {\n var newCitation_div = $(\"<div/>\").addClass(\"nb-citation-div\");\n var newCitation = $(\"<input/>\")\n .attr(\"class\",\"nb-citation citation\")\n .attr(\"type\",\"text\")\n .attr(\"id\",\"nb-citation-\" + citationCount);\n\n //detach from the previously last url input\n //so we can put it back on the new one\n addCitationButton.detach(); \n \n var deleteCitation = $(\"<button/>\")\n .addClass(\"btn btn-xs btn-default btn-remove remove-nb-citation-button remove-citation-button\")\n .attr(\"type\",\"button\")\n .attr(\"aria-label\",\"Remove citation\")\n .append($(\"<i>\").addClass(\"fa fa-trash\")\n .attr(\"aria-hidden\",\"true\"));\n \n if (lastCitation != undefined) {\n \tlastCitation.append(deleteCitation);\n }\n \n citation_container.append(newCitation_div.append(newCitation)\n \t\t .append(addCitationButton));\n\n lastCitation = newCitation_div;;\n \n citationCount++;\n\n return newCitation;\n }\n \n citations_div.append(citationsLabel).append(citation_container);\n \n var citation_array = md.reportmetadata.citations;\n \n if (citation_array == undefined || citation_array.length == 0) {\n \taddCitation();\n }\n \n if (citation_array != undefined) {\n citation_array.forEach(function(item,index) {\n var newCitation = addCitation();\n newCitation.val(item);\n });\n }\n\n return citations_div;\n\t}", "title": "" }, { "docid": "a16640ebd81deb60181ae91b7500ac7c", "score": "0.56627107", "text": "function createFieldInForm(formId, newField){\n\n return FormModel\n .findById(formId)\n .then(function(result) {\n result.fields.push(newField);\n return result.save();\n });\n }", "title": "" }, { "docid": "e8c44c49a14997e5a8bf97165f159fcf", "score": "0.5658269", "text": "function beginAddField(workItemField) {\n\t return RestClient.getClient().createField(workItemField)\n\t .then(function (field) {\n\t console.log(JSON.stringify(field));\n\t return field;\n\t });\n\t }", "title": "" }, { "docid": "dc688f742498ecd838032e109c1ba1c3", "score": "0.564717", "text": "function addField(parentFieldName, fields) {\n const { ...newFields } = state.fields;\n\n // Generate the last field index\n const lastParentField = getFields(parentFieldName).slice(-1)[0];\n let newFieldIndex = 0;\n if (lastParentField) {\n const LAST_INDEX_REGEX = /(\\d+)(?!.*\\d)/;\n const lastFieldIndex = lastParentField.match(LAST_INDEX_REGEX)[0];\n newFieldIndex = parseInt(lastFieldIndex) + 1;\n }\n\n fields.forEach(field => {\n const newFieldName = `${parentFieldName}.${newFieldIndex}.${field.name}`;\n const newField = createField({\n name: newFieldName,\n value: field.value,\n validator: field.validator,\n dirty: true,\n createdAfter: true,\n });\n\n newFields[newFieldName] = newField;\n });\n\n setState({ fields: newFields, dirty: true });\n }", "title": "" }, { "docid": "d172579a053015980bcd3789e58e6953", "score": "0.56211436", "text": "function setUpRealEditableField() {\n fieldElem = dom.createElement(TagName.DIV);\n fieldElem.id = 'myField';\n document.body.appendChild(fieldElem);\n fieldElem.appendChild(anchorElem);\n fieldObj = new Field('myField', document);\n fieldObj.makeEditable();\n /** @suppress {checkTypes} suppression added to enable type checking */\n linkObj = new Link(fieldObj.getElement().firstChild, isNew);\n // Register the plugin to that field.\n plugin = new LinkDialogPlugin();\n fieldObj.registerPlugin(plugin);\n}", "title": "" }, { "docid": "2d1c17e8bd0229104483d1bfd3255156", "score": "0.56021523", "text": "function handleAssociateEntry($event, node) {\n $log.info(\"creating article\");\n // TODO need to offer option of create or link\n // TODO magic string\n\n var type = 'thematic';\n var title = node.label;\n\n // TODO display prompt dialog, allow entry of title, selection of type (but not)\n // TODO error handling!!\n var article = articlesRepo.create(type, title);\n var articlePromise = articlesRepo.save(article);\n var linkPromise = articlePromise.then(linkArticle);\n\n $q.all({\n article: articlePromise,\n ref: linkPromise\n }).then(openEditor);\n\n function linkArticle(article) {\n var ref = repo.nodes.link(node, {\n id: article.ref.id,\n type: article.ref.type\n });\n return ref.$promise;\n }\n\n function openEditor(values) {\n $state.go(\"article.edit\", {\n id: values.article.id\n });\n }\n // TODO creates article and (once created) associates\n // that article with this node in the hierarchy.\n // On completion, opens that article in the editor.\n }", "title": "" }, { "docid": "538b9478e7d4340b8c00669b8643ee7f", "score": "0.559065", "text": "function x(e,i,t){var l=B(e,i,t).getClonedData();return ti.trigger({type:gi.fieldcreate,field:l}),l}", "title": "" }, { "docid": "538b9478e7d4340b8c00669b8643ee7f", "score": "0.559065", "text": "function x(e,i,t){var l=B(e,i,t).getClonedData();return ti.trigger({type:gi.fieldcreate,field:l}),l}", "title": "" }, { "docid": "bc53c86249a4a33efba63c461428c409", "score": "0.5568531", "text": "function createArticle(title, articleContent, addRedColor) {\n\tlet infoContainer = document.getElementById(\"toolbar_MSDetailedInfo\"), article, content;\n\n\tarticle = document.createElement(\"SPAN\");\n\tarticle.className = \"article\";\n\tif (addRedColor) {\n\t\tarticle.classList.add(\"serverDown\");\n\t}\n\tarticle.textContent = title;\n\tcontent = document.createElement(\"SPAN\");\n\tcontent.textContent = articleContent;\n\tinfoContainer.appendChild(article);\n\tinfoContainer.appendChild(content);\n\tinfoContainer.appendChild(document.createElement(\"BR\"));\n}", "title": "" }, { "docid": "b7277c35dfce4f039fcda1ae103538e3", "score": "0.55642784", "text": "addarticlePdfRow() {\n this.article = new _app_modals_premiumprofile__WEBPACK_IMPORTED_MODULE_9__[\"article\"]();\n const control = this.premiumMemberForm.controls['articlePdfRows'];\n control.push(this.initarticlePdfRows());\n this.premiumProfile.articlePdf.push(this.article);\n }", "title": "" }, { "docid": "b7277c35dfce4f039fcda1ae103538e3", "score": "0.55642784", "text": "addarticlePdfRow() {\n this.article = new _app_modals_premiumprofile__WEBPACK_IMPORTED_MODULE_9__[\"article\"]();\n const control = this.premiumMemberForm.controls['articlePdfRows'];\n control.push(this.initarticlePdfRows());\n this.premiumProfile.articlePdf.push(this.article);\n }", "title": "" }, { "docid": "e9ccdbfefd210a15fd9cfd1ae70140cc", "score": "0.5562011", "text": "function createPreview() {\n let sectionToAppend = document.querySelector(\".create-post-section\")//this section is the same where you find newPostSection\n console.log(sectionToAppend)\n let newPost = {\n title: \"A tree in blossom\",\n content: \"Spring is finally here... I just love the colours.\",\n image: {\n src: \"https://images.unsplash.com/photo-1616745309504-0cb79e9ae590?ixid=MXwxMjA3fDB8MHx0b3BpYy1mZWVkfDI0fDZzTVZqVExTa2VRfHxlbnwwfHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60\",\n alt: \"a tree in blossom\"\n }\n }\n let previewPost = createPost(newPost)\n console.log(previewPost)\n sectionToAppend.append(previewPost)\n // return previewPost\n}", "title": "" }, { "docid": "70cec4e741be759c4eeab1a9314ae50a", "score": "0.5556087", "text": "function createPanel(article) {\n var panel = \n $([\"<div class = 'panel panel-default'>\",\n \"<div class = 'panel-heading'>\",\n \"<h3>\",\n article.headline,\n \"<a class = 'btn btn-success save'>\",\n \"Save Article\",\n \"</a>\",\n \"</h3>\",\n \"</div>\",\n \"<div class = 'panel-body'>\",\n article.summary,\n \"</div>\",\n \"</div>\"\n ].join(\"\"));\n panel.data(\"_id\", article._id);\n return panel;\n }", "title": "" }, { "docid": "f53b5739e61e8dfa51fd4a410fb8a906", "score": "0.5551595", "text": "add(data) {\n if (!this.readonly && this.__fieldNode) {\n this.__fieldNode.add(data);\n if (this.focusOnCreate) {\n // setTimeout(()=>{\n this._repeaterNode.select(this.__fieldNode.repeats.length - 1);\n // },16)\n }\n }\n }", "title": "" }, { "docid": "a2c87299e5f4a31571c0d321e4eb8e93", "score": "0.5537186", "text": "function addField(fieldsObj, fieldToAdd) {\n var chain;\n // Dimension vs Metric\n if (fieldToAdd.semantics.conceptType === 'DIMENSION') {\n chain = fieldsObj.newDimension();\n }\n else {\n chain = fieldsObj.newMetric();\n }\n // Field ID and Name\n chain.setId(fieldToAdd.id);\n chain.setName(fieldToAdd.name);\n // OPT: Description\n if (typeof fieldToAdd.description === 'string') {\n chain.setDescription(fieldToAdd.description);\n }\n // Semantics\n chain.setType(fieldToAdd.semantics.semanticType);\n if (fieldToAdd.semantics.isReaggregatable && typeof fieldToAdd.semantics.aggregationType !== 'undefined') {\n chain.setIsReaggregatable(true);\n chain.setAggregation(fieldToAdd.semantics.aggregationType);\n }\n // Custom Formula / Calculated Field\n if (fieldToAdd.formula && fieldToAdd.formula.length > 0) {\n chain.setFormula(fieldToAdd.formula);\n }\n // Return the whole field object\n return chain;\n}", "title": "" }, { "docid": "8a744e2e8d53545b3b680b90c6eb6ac1", "score": "0.5533825", "text": "function Field(conf){ // atomic af\n // internal object representing working field(wfo) is a layer over the mundane HTML and also groups multiple elemental fields\n var wfo = {}; // it is gradually incarnated and used for namespacing all the field's internal helpers\n var article_type = token.type.field, name = conf.name;\n Article.call(this, util.getArticleInfo(conf, token.type.field));\n if(!conf){ util.complainer(\"Configuration needed for instantiating a field.\", true); }\n if(conf.custom_component instanceof Function){\n wfo = conf.custom_component(conf); // should return an external object representing the field for that outsider component\n wfo[token.external] = true;\n }\n this.getArticleType = function(){\n return article_type;\n }\n }", "title": "" }, { "docid": "46754c0469b48399f7424cd739002876", "score": "0.55307996", "text": "function insert_article_into_page(article) {\n // Main article div container\n var article_div = $('<div>');\n article_div.addClass('article');\n\n // Article title line\n //TODO add the title from the article retrieved in the AJAX request to the element below\n var article_title = $('<h3>').text('THIS SHOULD BE THE TITLE FROM THE ARTICLE IN THE AJAX REQUEST');\n //TODO add the class 'article-body to the 'p' element created above\n\n // Article body\n //TODO add the content from the article retrieved in the AJAX request to the element below\n var article_body = $('<p>').text('THIS SHOULD BE THE CONTENT FROM THE ARTICLE IN THE AJAX REQUEST');\n //TODO add the class 'article-body to the 'p' element created above\n\n\n var article_read_more = $('<div>').text('Show full content');\n article_read_more.addClass('article-read-more');\n article_read_more.addClass('button');\n //TODO add the id from the article retrieved in the AJAX request to the 'article_id' attribute below\n article_read_more.attr('article_id', 'THIS SHOULD BE THE ID FROM THE ARTICLE'); // Store the article id for later use\n\n // Nest all the elements inside the main article div\n article_div.append(article_title);\n article_div.append(article_body);\n article_div.append(article_read_more);\n\n $('#article-load-button').before(article_div);\n\n //TODO add a click handler that will run the function 'load_full_article' to all divs with the class 'article-read-more'\n\n }", "title": "" }, { "docid": "16e9170fc835afea8f42968142e23c38", "score": "0.55307376", "text": "function addItem() {\n\t\t// first check values to make sure a user has entered something\n\t\tif (checkValues('fieldType', 'fieldDesc', 'fieldVal')) {\n\t\t\t// increment counter for unique ID\n\t\t\tcounter += 1;\n\t\t\t// retrieve and store DOM values in scoped var\n\t\t\tlet domValues = getValues();\n\t\t\t// set item type\n\t\t\tlet itemType = domValues.type;\n\t\t\t// add values as data to data structure\n\t\t\t(0, _data.addDataItem)(itemType, domValues, function (budget) {\n\t\t\t\t// now that we've returned, pass DOM field values into HTML template and add it to the DOM\n\t\t\t\tselector.get(`${itemType}List`).insertAdjacentHTML('beforeend', template(domValues));\n\t\t\t\t// display totals and percentages\n\t\t\t\tdisplayTotals(budget);\n\t\t\t\t// clear fields\n\t\t\t\tupdateAllFields('type', 'clear');\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "fd380bb49fb9eed24bd52de503f13feb", "score": "0.55253434", "text": "function insertIntoFormlyFields(index,question,fields,model,questionMap) {\n\n if(index === undefined || index === null) index = fields.length - 1;\n\n var modelType = question.modelType;\n //Not the best solution but a quick attempt to generalize how to get a type and produce a formly field\n var field = modelTypes[modelType](question, model);\n\n if(\"id\" in question) {\n if(question.id in questionMap) {\n questionMap[question.id].push(field);\n }\n else {\n questionMap[question.id] = [field];\n }\n\n }\n\n\n var front = _.slice(fields,0,index);\n var back = _.slice(fields,index);\n\n front.push(field);\n _.remove(fields); //this strategy used to maintain reference of fields array.\n Array.prototype.push.apply(fields,front);\n\n if (\"questions\" in question) {\n //the last model will be the one just created\n var nestedFields = [];\n field.data.fields = [];\n //questionsToFormlyFields(question.questions, nestedFields, field.data.recursiveModel, questionMap);\n questionsToFormlyFields(question.questions, field.data.fields, field.data.recursiveModel, questionMap);\n //Array.prototype.push.apply(fields,nestedFields);\n }\n Array.prototype.push.apply(fields,back);\n }", "title": "" }, { "docid": "cbe7c2d991493ed27c39f46c57f833c3", "score": "0.55244714", "text": "function displayArticle(article) {\n //Récupérer le temmplate\n const templateElt = document.getElementById(\"templateArticle\")\n //Cloner le template\n const cloneElt = document.importNode(templateElt.content, true)\n\n cloneElt.getElementById(\"name\").textContent = article.name\n cloneElt.getElementById(\"price\").textContent = `${article.price / 100}.00 €`\n cloneElt.getElementById(\"description\").textContent = article.description\n cloneElt.getElementById(\"imageUrl\").src = article.imageUrl\n cloneElt.getElementById('articleLink').href += `?id=${article._id}`\n //Intégrer les élèments cloner avec appendChild\n document.getElementById(\"main\").appendChild(cloneElt)\n}", "title": "" }, { "docid": "b2d594edd6ab6debe4235008ef6b2fb6", "score": "0.5506962", "text": "function add_skill_fields(link, association, content) {\n var new_id = new Date().getTime();\n var regexp = new RegExp(\"new_\" + association, \"g\")\n var table = $(link).parents('table');\n var tbody = table.find('tbody');\n var ar = tbody.append(content.replace(regexp, new_id));\n}", "title": "" }, { "docid": "71abe01bd31c3a76e83446213daa143b", "score": "0.54889095", "text": "function addDocument(document){\n\tvar code = form_template;\n\t/* Se reemplazan las etiquetas por los Metadatos extraidos */\n\tvar title = document['title'] ? document['title']:''\n\tif (title == '' || title == null){\n\t\ttitle = document['original_filename'];\n\t}\n\tcode = code\n\t\t.replace(/\\$index/g, document['id'])\n\t\t.replace(/\\$title/g, title)\n\t\t.replace(/\\$author/g, document['author'] ? document['author']:'')\n\t\t.replace(/\\$thumbnail/g, document['thumbnail'] ? static_link.replace('999', document['thumbnail']):'')\n\t\t.replace(/\\$date/g, document['date'] ? document['date']:'');\n\t/* Se agrega al frontend */\n\t$('#form').append(code);\n\t/* Se realiza la primera consulta a crossref */\n\tlast_cr_query[document['id']] = title;\n\tcrossref_query(title, document['id']);\n\n\t\n}", "title": "" }, { "docid": "6bd02dc019509e507cba38a53c3bc646", "score": "0.5471803", "text": "function vulMetBasics(myArticle, filmInfo) {\n let Titel = document.createElement('h2');\n let smallPlot = document.createElement('p');\n let ReleaseDateGenre = document.createElement('p');\n let image = document.createElement('img');\n\n Titel.textContent = filmInfo.title;\n smallPlot.textContent = filmInfo.simple_plot;\n image.src = filmInfo.cover;\n var date = new Date(filmInfo.release_date);\n ReleaseDateGenre.textContent = date.getFullYear() + \" | \" + filmInfo.genres.join(' / ');\n\n myArticle.setAttribute(\"id\", 'Article' + filmInfo.id);\n smallPlot.setAttribute(\"id\", 'sP' + filmInfo.id);\n ReleaseDateGenre.setAttribute(\"id\", 'rDg' + filmInfo.id);\n\n /* article leeg maken */\n myArticle.textContent = \"\";\n /* article vullen */\n myArticle.appendChild(Titel);\n myArticle.appendChild(image);\n myArticle.appendChild(ReleaseDateGenre);\n myArticle.appendChild(smallPlot);\n}", "title": "" }, { "docid": "1be9e307fc5b73e2b45de7ab8de8714c", "score": "0.5467452", "text": "function setArticleView(article) {\n document.getElementById(\"articleTitle\").textContent = article.title;\n document.getElementById(\"articleDesc\").textContent = article.text;\n //still need to figure out how to insert images\n $(\"#articlePic\").attr(\"src\", article.image);\n }", "title": "" }, { "docid": "f874bf0aa5e87937c05896945b163889", "score": "0.5463095", "text": "function AddArticleId(id) {\n setArticleId(id);\n console.log(id, \"from addarticleid context\");\n }", "title": "" }, { "docid": "18f9d32c9ee9bee25b69227df9352e3e", "score": "0.54615444", "text": "saveArticle (articleOperation) {\n const articleId = \"\";\n if (articleOperation === \"edit\") { \n articleId = document.getElementById(\"field__article__articleId\").value;\n }\n const articleUserId = parseInt(sessionStorage.getItem(\"activeUser\")); \n const articleTitle = document.getElementById(\"field__article__title\").value;\n const articleSynopsis = document.getElementById(\"field__article__synopsis\").value;\n const articleUrl = document.getElementById(\"field__article__url\").value;\n const articleTimestamp = new Date();\n\n const articleObject = articleFunctions.createArticleObject( articleUserId,articleTitle, articleSynopsis, articleUrl, articleTimestamp );\n return articleObject;\n }", "title": "" }, { "docid": "1e9aa2db557645414d6c3d6ab1a1a521", "score": "0.545676", "text": "createAndAppendForm (articleId, interestObjToEdit) {\n\n // Building the edit form with fields for the name, Description and type of the interest item. Each of the input fields contains the existing values from the database.\n // let interestNameField = document.createElement(\"p\")\n\n // let interestNameLabel = document.createElement(\"label\")\n // interestNameLabel.textContent = \"Name\"\n // let interestNameInput = document.createElement(\"input\")\n // interestNameInput.value = interestObjToEdit.name\n\n // interestNameField.appendChild(interestNameLabel)\n // interestNameField.appendChild(interestNameInput)\n\n // let interestDescriptionField = document.createElement(\"p\")\n\n // let interestDescriptionLabel = document.createElement(\"label\")\n // interestDescriptionLabel.textContent = \"Description\"\n // let interestDescriptionInput = document.createElement(\"input\")\n // interestDescriptionInput.value = interestObjToEdit.description\n\n // interestDescriptionField.appendChild(interestDescriptionLabel)\n // interestDescriptionField.appendChild(interestDescriptionInput)\n\n let interestCostField = document.createElement(\"p\")\n\n let interestCostLabel = document.createElement(\"label\")\n interestCostLabel.textContent = \"Cost\"\n let interestCostInput = document.createElement(\"input\")\n interestCostInput.value = interestObjToEdit.cost\n\n interestCostField.appendChild(interestCostLabel)\n interestCostField.appendChild(interestCostInput)\n \n let interestReviewField = document.createElement(\"p\")\n\n let interestReviewLabel = document.createElement(\"label\")\n interestReviewLabel.textContent = \"Review\"\n let interestReviewInput = document.createElement(\"input\")\n interestReviewInput.value = interestObjToEdit.review\n\n interestReviewField.appendChild(interestReviewLabel)\n interestReviewField.appendChild(interestReviewInput)\n\n let updateButton = document.createElement(\"button\")\n updateButton.textContent = \"Update\"\n\n // There is an event listener on the Update button which will take the new values in the input fields and build an object for the interest item to be edited. items and display them.\n\n updateButton.addEventListener(\"click\", () => {\n let editedInterest = {\n name: interestObjToEdit.name,\n placeId: interestObjToEdit.placeId,\n description: interestObjToEdit.description,\n cost: interestCostInput.value,\n review: interestReviewInput.value\n }\n \n interestCollection.putExistingInterest(interestObjToEdit.id, editedInterest)\n .then(response => {\n interestList.travelerify()\n })\n })\n\n // We passed in the id of the article so we know exactly where to append the edit form.\n let interestItemArticle = document.querySelector(`#${articleId}`)\n\n // Because we want to replace what is currently in the article element with the edit form, we clear out all children HTML elements in our targeted element before appending our edit form to it.\n while (interestItemArticle.firstChild) {\n interestItemArticle.removeChild(interestItemArticle.firstChild);\n }\n\n interestItemArticle.appendChild(interestCostField)\n interestItemArticle.appendChild(interestReviewField)\n interestItemArticle.appendChild(updateButton)\n }", "title": "" }, { "docid": "f5c8725d8539a2408072547072934d16", "score": "0.5452891", "text": "function addToGrid(article) {\n if (article == null) {\n return;\n } else {\n let div = document.createElement(\"div\");\n div.innerHTML = article.title;\n div.className = `span-${article.columns}`;\n\n document.getElementById(\"landingContent\").appendChild(div);\n }\n}", "title": "" }, { "docid": "a8327d03909b86097db4d1ae9eab4ccd", "score": "0.54435945", "text": "function createNewInputField(){\n pluginsNumber++;\n appendNewInput()\n $('#plugin'+pluginsNumber).load(\"/static/views/plugins/plugins.dust\",function(){\n $('#plugin'+pluginsNumber).find('#file')\n .attr(\"id\", 'file' + pluginsNumber)\n $('#plugin'+pluginsNumber).find('label')\n .attr(\"for\", 'file' + pluginsNumber)\n $('#plugin'+pluginsNumber).css(\"opacity\",\"0\");\n fade('plugin'+pluginsNumber, 1, ANIMATIONTIME, null, 'inline-block');\n createSingleEventListeners('file'+pluginsNumber);\n if ($( \".switch\" ).find(\"input\").is( \":checked\" )) {\n $('#plugin'+pluginsNumber).find('#file'+pluginsNumber).attr(\"webkitdirectory\", \"webkitdirectory\");\n }\n });\n}", "title": "" }, { "docid": "3b19acf644bf7fb6beb9981a35845218", "score": "0.5442047", "text": "function handleSubmit(event){\n event.preventDefault();\n const newArticle = {\n \"headline\": event.target.headline.value,\n \"summary\": event.target.summary.value,\n \"fullstory\": event.target.fullstory.value,\n \"dateCreated\": event.target.date.value,\n \"image\": event.target.image.value,\n \"readCount\": 0,\n \"category\": event.target.category.value,\n \"journalist\": event.target.journalist.value\n }\n props.handleArticlePost(newArticle);\n\n }", "title": "" }, { "docid": "9b6c1ff2ce810c1ec0dcc44a6903f8ce", "score": "0.54394454", "text": "function createFields(){\r\n\tvar fragment = document.createDocumentFragment(),\r\n\t\thero = document.getElementsByClassName('hero')[0],\r\n\t\tkey;\r\n\t\t\r\n\t\tfor (key in createFields.object) {\r\n\t\t\tif (createFields.object.hasOwnProperty(key)) {\r\n\t\t\t\tvar paragraph = document.createElement('p'),\r\n\t\t\t\t\tspan = document.createElement('span');\r\n\t\t\t\tparagraph.innerHTML = createFields.object[key];\r\n\t\t\t\tspan.classList.add(key);\r\n\t\t\t\tparagraph.appendChild(span);\r\n\t\t\t\tfragment.appendChild(paragraph);\r\n\t\t\t};\r\n\t\t};\r\n\thero.appendChild(fragment)\r\n}", "title": "" }, { "docid": "4ed0faaa3331d688f94c9283761d4ff1", "score": "0.5437838", "text": "function addPhotoField() {\n //pegar o container de fotos #images\n const container = document.querySelector('#images');\n //pegar o container para duplicar .new-image\n const fieldsContainer = document.querySelectorAll('.new-upload');\n //realizar o clone da ultima imagem adicionada\n const newFieldContainer = fieldsContainer[(fieldsContainer.length) - 1].cloneNode(true);\n //verificar se o campo está vazio se sim não adicionar novo container\n if (newFieldContainer.children[0].value == \"\"){\n return;\n }\n //limpar o campo antes de adicionar\n newFieldContainer.children[0].value = \"\";\n //adiocionar o clone ao container de #images\n container.appendChild(newFieldContainer);\n\n}", "title": "" }, { "docid": "b4769ec0e8c0d3732b1708c5c93e42dc", "score": "0.5437085", "text": "function addPhotoField(){\n // pegar o container de fotod #Images\n const container=document.querySelector('#images')\n\n // pegar o container para duplicar .new-image\n const newsImage=document.querySelectorAll('.new-upload')\n\n // realizar o clone da ultima imagem adicionada\n const cloneLastImage= newsImage[newsImage.length - 1].cloneNode(true)\n\n // verificar se o campo do está vazio. Se sim não add ao container \n const input=cloneLastImage.children[0]\n if(input.value == ''){\n return\n }\n // limpar campo antes da adicionar a imagem ao container\n input.value=''\n // adicionar o clone ao container de #imagem\n container.appendChild(cloneLastImage)\n }", "title": "" }, { "docid": "ecd363045b5551bb3bb4bfeb2e2092db", "score": "0.5436241", "text": "function addNewAQField(){\n //alert(\"Working\");\n let newNode=document.createElement(\"textarea\");\n newNode.classList.add(\"form-control\");\n newNode.classList.add(\"eqField\");\n newNode.classList.add(\"mt-2\");\n newNode.setAttribute(\"rows\",2);\n newNode.setAttribute(\"placeholder\",\"Enter here\")\n\n let aqOb=document.getElementById(\"aq\");\n let aqAddButtonOb=document.getElementById(\"aqAddButton\");\n\n aqOb.insertBefore(newNode,aqAddButtonOb);\n\n}", "title": "" }, { "docid": "482ed7a8d4be256d97e882fc6ede9e68", "score": "0.54255927", "text": "function add_post(contents) {\n\n //Create new post\n const post = document.createElement('div');\n post.innerHTML = contents;\n\n //Add post to DOMContentLoadeddocument.querySelector('#posts').append(post);\n}", "title": "" }, { "docid": "b1de2b0098cd73c63d2f5ced8f77c173", "score": "0.54202914", "text": "function createPanel(article) {\n var panel = \n $([\"<div class = 'panel panel-default'>\",\n \"<div class = 'panel-heading'>\",\n \"<h3>\",\n article.headline,\n \"<a class = 'btn btn-danger delete'>\",\n \"Delete Article\",\n \"</a>\",\n \"<a class = 'btn btn-info notes'>Article Notes</a>\",\n \"</h3>\",\n \"</div>\",\n \"<div class = 'panel-body'>\",\n article.summary,\n \"</div>\",\n \"</div>\"\n ].join(\"\"));\n panel.data(\"_id\", article._id);\n return panel;\n }", "title": "" }, { "docid": "981460b4bba8a2dbfbab6d44398bac30", "score": "0.54178184", "text": "async function createArticle(articleData) {\n // create a post/article\n const response = await fetch(apiUrl, {\n method: \"POST\",\n body: JSON.stringify(articleData),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n // refetch and refresh the UI\n fetchPostList();\n }", "title": "" }, { "docid": "26002f7516ce812ab8ac311eac01ec64", "score": "0.5417396", "text": "function setUpAddNode() {\n \n h = $$('input[name=newcNme]');\n s = $$('select[name=cNme]');\n toggleField(s, h);\n \n}", "title": "" }, { "docid": "722c22e9cb9a3d85a91041bf6a7df1cc", "score": "0.5416625", "text": "addTextField(placeholder, name) {\n this.fields.push(new Field(this, name, placeholder));\n }", "title": "" }, { "docid": "04a479bf1d80d8cb40dd1f40db9459ac", "score": "0.5413055", "text": "function lib_data_xml_create_tree_item_field(itemId, fieldId, content)\r\n{\r\n var currItem = getDBElementById(this.db_buffer, itemId);\r\n\r\n if (currItem != undefined) \r\n {\r\n // field not yet created ? -> Good !\r\n if (currItem.getElementsByTagName(fieldId).length == 0)\r\n {\r\n var myItemField = this.db_buffer.createElement(fieldId);\r\n if (fieldId == \"eval\")\r\n {\r\n if (content == \"\")\r\n {\r\n content = jQuery.extend(true, [], this.empty_eval_struct);\r\n } \r\n for (var i=0; i<this.eval_cat_num; i++)\r\n { \r\n var myCatField = this.db_buffer.createElement(c_LANG_UC_BROWSING_PANEL2_EVAL_CATS[i+1][0]);\r\n var myAvgField = this.db_buffer.createElement(\"avg\");\r\n setInnerHTML(myAvgField, String(content[i].avg));\r\n var myNumField = this.db_buffer.createElement(\"num\");\r\n setInnerHTML(myNumField, String(content[i].num)); \r\n myCatField.appendChild(myAvgField); \r\n myCatField.appendChild(myNumField); \r\n myItemField.appendChild(myCatField); \r\n } \r\n }\r\n else\r\n {\r\n setInnerHTML(myItemField, content);\r\n }\r\n currItem.appendChild(myItemField);\r\n }\r\n else\r\n {\r\n // output if field already exists\t\r\n alert(c_LANG_WARNING_FIELD_REDUNDANCE[this.global_setup.curr_lang] + fieldId + \" !\");\r\n }\r\n }\r\n else\r\n { \r\n alert(c_LANG_WARNING_ITEM_MISSING[this.global_setup.curr_lang] + itemId + \" !\");\r\n }\r\n this.dump_tree();\r\n \r\n}", "title": "" }, { "docid": "e698fb0ccb8427e2a65dd2a556b9d51a", "score": "0.54118997", "text": "function attachFieldListControls() {\n\t$('#addfield')\n\t\t.bind('click', function() {\n\t\t\tvar newField = \"<div class=\\\"fieldcontainer\\\"><div class=\\\"onefield\\\"><table><tr><td><select><option value=\\\"text\\\" selected=\\\"yes\\\">Basic Text</option><option value=\\\"rich\\\">Rich Text</option><option value=\\\"list\\\">List</option><option value=\\\"hidden\\\">Hidden</option></select></td><td><input type=\\\"text\\\" size=\\\"50\\\"></td><td><a href=\\\"#\\\" class=\\\"remove_link\\\">X</a></td></tr></table></div><div class=\\\"onefield_break\\\"></div></div>\";\n\t\t\t$('#fields')\n\t\t\t\t.append(newField);\n\t\t\t$('#addfield')\n\t\t\t\t.appendTo('#fields');\n\t\t\t$('#toCollation')\n\t\t\t\t.appendTo('#fields');\n\t\t\tmakeDragAndDrops();\n\t\t\tbindRemoveLink();\n\t\t\treturn false;\n\t});\n}", "title": "" }, { "docid": "a157b8424bc65b8e2a8c3e10b4b8745d", "score": "0.5410189", "text": "function onSubmit(e){\n e.preventDefault();\n fire.firestore()\n .collection('feed')\n .add({\n title,\n desc,\n feature,\n vote:0,\n })\n .then(()=>{\n setTitle('')\n setDesc('')\n setFeature('')\n })\n }", "title": "" }, { "docid": "4d691a495936f3b3a6888acf543f7807", "score": "0.5400033", "text": "addLookup(title, lookupListId, lookupFieldName, properties) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const props = Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])({\n FieldTypeKind: 7,\n LookupFieldName: lookupFieldName,\n LookupListId: lookupListId,\n Title: title,\n }, properties);\n const postBody = Object(_pnp_odata__WEBPACK_IMPORTED_MODULE_4__[\"body\"])({\n \"parameters\": Object(_pnp_common__WEBPACK_IMPORTED_MODULE_2__[\"assign\"])(Object(_utils_metadata_js__WEBPACK_IMPORTED_MODULE_3__[\"metadata\"])(\"SP.FieldCreationInformation\"), props),\n });\n const data = yield Object(_operations_js__WEBPACK_IMPORTED_MODULE_6__[\"spPost\"])(this.clone(Fields, \"addfield\"), postBody);\n return {\n data,\n field: this.getById(data.Id),\n };\n });\n }", "title": "" }, { "docid": "08ba6598fe3acbd9a39ba3cd23efb48e", "score": "0.5397318", "text": "function createNewTextField(mode, type) {\n var functionName = \"load_\" + type;\n window[functionName](); \n $(\"#textfields\").append(submitButtonString);\n if (mode === \"add\") {\n $(\"button#submitForm\").html(\"Add New Resource\");\n } else if (mode === \"edit\") {\n $(\"button#submitForm\").html(\"Submit Change\");\n } else if (mode === \"remove\") {\n $(\"button#submitForm\").html(\"Remove Resource\");\n }\n}", "title": "" }, { "docid": "599407a0c4db12df09c89848ef6bb8c7", "score": "0.53925574", "text": "function addEvents(elem)\n {\n elem.find(\".field-editor\").append(\"<div class = 'perc-form-ui-menu'><span class='toggle-editor'><img src='../rx_resources/widgets/form/images/edit.png' ></span><span class='delete-field'><img src='../rx_resources/widgets/form/images/delete.png'></span></div>\");\n }", "title": "" }, { "docid": "83845d140f5e2e44a6909b5ff219af09", "score": "0.53907704", "text": "function generateArticleContent(articleContent){\n var articleContentElem=$(\"<article></article>\");\n \n article.ContentElem.html(articleContent);\n containerElement.append(articleContentElem);\n }", "title": "" }, { "docid": "4b833d1481a1c54c886eac6d6a16fa44", "score": "0.5388785", "text": "function createArticleInfoBox() {\n var id = \"ArticleInformationBox\";\n var box = document.getElementById(id);\n if (box) return box;\n newSidebarSection(id, \"Article information\", \"\");\n box = document.getElementById(id);\n moveLangBox(box);\n return box;\n}", "title": "" }, { "docid": "7c72be699912b1845e24c5e034b77a89", "score": "0.53834844", "text": "function addFavoriteField(field){\n var newListItem = $(\"<li/>\", {\n id: 'favfield' + field.id\n });\n\n var gridADiv = $(\"<div/>\", {\n class: 'ui-grid-a'\n }).appendTo(newListItem);\n\n var blockADiv = $(\"<div/>\", {\n class: 'ui-block-a',\n html: field.field\n }).click(function(event) {\n // TODO: not really sure what, though. needs to be discussed\n }).appendTo(gridADiv);\n\n var blockBDiv = $(\"<div/>\", {\n class: 'ui-block-b right-aligning'\n }).appendTo(gridADiv);\n\n $(\"<img/>\", {\n class: 'remove-icon',\n src: 'images/remove-icon.png',\n alt: 'Remove',\n \"data-fieldid\": field.id\n }).click(function(event) {\n removeFavoriteField((this).getAttribute(\"data-fieldid\"))\n }).appendTo(blockBDiv);\n\n $(\"#favoritefields\").append(newListItem);\n $(\"#favoritefields\").listview(\"refresh\");\t\n}", "title": "" }, { "docid": "5ca8da4ad5ea238c23d5cfb090537ff2", "score": "0.536189", "text": "function addImageThingie(){\n\tcount++;\n\timagesCount.val(count);\n\tvar newImage = imagesContainer.append(imagesTemplate.html());\n\t$(\".field\").last().children(\"label, input\").each(function(){\n\t\t$(this).attr(\"name\", function(i, val){\n\t\t\treturn val + String(count);\n\t\t});\n\t\t$(\".remove-image\").last().attr(\"value\", count);\n\t});\n}", "title": "" }, { "docid": "c880ec4289b4907c3db1486ebbda95bd", "score": "0.53612125", "text": "function addArticle(title, content) {\n return new Promise(function (resolve, reject) {\n var utc = (new Date()).getTime();\n globalDB.run(`INSERT INTO ARTICLES VALUES(NULL, ?, ?, ?);`,\n [utc, title, content], err => {\n if (err) {\n reject(err);\n } else {\n globalDB.get(`SELECT ID FROM ARTICLES WHERE DATE = ?`,utc,(err,row)=>{\n resolve(row);\n });\n }\n });\n });\n}", "title": "" }, { "docid": "bf377d5ab7972b80091b92b48a339da8", "score": "0.5358455", "text": "function createField(){\n var newLabel = document.createElement('label');\n newLabel.setAttribute(\"for\", \"generic\"+incNum); //two args, what attribute, and the value\n newLabel.innerHTML = \"Generic Label\";\n // newLabel.textContent - this works as well\n var newInput = document.createElement('input');\n newInput.id = \"generic\"+incNum;\n newInput.name = \"generic\";\n newInput.type = \"text\";\n newInput.placeholder = \"Generic Input\";\n addToForm(newLabel, newInput);\n incNum++;\n}", "title": "" }, { "docid": "9d0ced389c9ae629e4c1afc67e528eb4", "score": "0.5354741", "text": "function createFieldForForm(req, res) {\n var field = req.body;\n var formId = req.params.formId;\n fieldModel.createFieldForForm(formId, field)\n .then(\n function (doc) {\n res.json(doc);\n },\n function (err) {\n res.status(400).send(err);\n }\n );\n }", "title": "" }, { "docid": "bf88c6912c6224ba70aa7a1a26a53e85", "score": "0.5351736", "text": "function newItem(id){\n sendRequest(\n 'minislider',\n {\n 'action': 'getNewItemForm',\n 'lang': $('#show_lang').val()\n },function(data) {\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n });\n}", "title": "" }, { "docid": "4b5bf422bcb5cdbc4c6ec6052eb1a400", "score": "0.5351662", "text": "function createArticle(req, res, next) {\n const {\n keyword, title, description, publishedAt, source, url, urlToImage,\n } = req.body;\n Article.create({\n keyword, title, description, publishedAt, source, url, urlToImage, owner: req.user._id,\n })\n .then((article) => {\n res.send(article);\n })\n .catch((err) => {\n if (err.name === 'ValidationError') { throw new InvalidError(invalidDataMessage); }\n })\n .catch(next);\n}", "title": "" }, { "docid": "e3c3f7500090337fe9c643a61a644650", "score": "0.5348713", "text": "function insertNewArticle(req, res) {\n console.log(\"IM IN insertNewArticle\");\n console.log(req.body);\n let currentArticle = {\n title: req.body.title,\n web_url: req.body.web_url,\n snippet: req.body.snippet,\n date_published: req.body.pub_date\n };\n Articles.create(currentArticle, function (err, data) {\n if (err) {\n console.log(`There was a DB error from insertNewArticle: ${err} `);\n res.status(500).end();\n } else {\n res.send(\"success\");\n }\n });\n}", "title": "" }, { "docid": "bd1197e9a089f2107c1c0cc4fca5d78a", "score": "0.53431505", "text": "addDependentLookupField(displayName, primaryLookupFieldId, showField) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const path = `adddependentlookupfield(displayName='${displayName}', primarylookupfieldid='${primaryLookupFieldId}', showfield='${showField}')`;\n const data = yield Object(_operations_js__WEBPACK_IMPORTED_MODULE_6__[\"spPost\"])(this.clone(Fields, path));\n return {\n data,\n field: this.getById(data.Id),\n };\n });\n }", "title": "" }, { "docid": "b4ef33a11fb7f5283896a00fb7314040", "score": "0.5337944", "text": "function addPhotoField() {\n // pegar o container de fotos #images\n const container = document.querySelector(\"#images\");\n\n // pegar o container para duplicar .new-upload\n const fieldsContainer = document.querySelectorAll(\".new-upload\");\n\n // clonar a última imagem adicionada.\n const newFieldContainer = fieldsContainer[fieldsContainer.length - 1].cloneNode(true);\n\n // verificar de o campo está vazio. Se sim, não adicionar ao container de imagem\n const input = newFieldContainer.children[0];\n if (input.value == \"\") {\n return;\n }\n\n // limpar o campo antes de adicionar ao container\n input.value = \"\";\n\n // adicionar o clone ao container de #images\n container.appendChild(newFieldContainer);\n}", "title": "" }, { "docid": "45b744d8529b74878b56a742270f718b", "score": "0.53315467", "text": "function domInsert(data) {$('#main').append($('<article class=\"article\">').append($('<section class=\"featuredImage\">').append(data.thumb)).append($('<section class=\"articleContent\">').append((data.link).append(data.title)).append(data.author).append(data.source).append(data.fullCopy)).append($('<div class=\"clearfix\">')));}", "title": "" }, { "docid": "4f373c71a9570a4b8696e9d68d170fb5", "score": "0.5329672", "text": "function addBlogPost(title, author, content) {\n var blogPost = new BlogTemplate(title, author,content);\n blogContainer.appendChild(blogPost);\n}", "title": "" }, { "docid": "fe9017d7cd01ea58b6ec163f2e8d7a94", "score": "0.5325365", "text": "function createNewPost(doc) {\r\n console.log(\"createNewPost\");\r\n //Creates the new elements that will become the post\r\n //Creates the div continer for each individual image andsets its properties\r\n var newPost = document.createElement('div');\r\n newPost.style.height = 150 + 'px';\r\n newPost.style.width = 150 + 'px';\r\n newPost.style.backgroundColor = \"white\";\r\n newPost.style.padding = 7.5 + \"px\";\r\n newPost.style.marginRight = 20 + \"px\";\r\n newPost.style.overflowY = \"scroll\";\r\n newPost.style.wordWrap = \"break-word\";\r\n newPost.style.position = 'relative';\r\n\r\n //Creates the image tag that stores each Image Url\r\n var newImage = document.createElement('img');\r\n newImage.src = doc.data().Post_text;\r\n newImage.style.width = 100 + '%';\r\n newImage.style.zIndex = 1;\r\n\r\n //Creates the text tag that is placed beneath the image\r\n var newText = document.createElement('p');\r\n newText.innerHTML = doc.data().Caption_text;\r\n\r\n //Appends the created image and text to the created div\r\n newPost.appendChild(newImage);\r\n newPost.appendChild(newText);\r\n\r\n //Gets the location of the post\r\n var locationPost = document.getElementById('container_bottom');\r\n locationPost.appendChild(newPost);\r\n\r\n //Creates a new icon that is a x-button\r\n var icon = document.createElement('p');\r\n var iconText = document.createTextNode('X');\r\n icon.appendChild(iconText)\r\n newPost.appendChild(icon);\r\n icon.style.cursor = \"pointer\";\r\n icon.style.fontWeight = 900;\r\n icon.style.fontSize = 25 + 'px';\r\n icon.style.position = 'absolute';\r\n icon.style.zIndex = 5;\r\n icon.style.top = -20 + 'px';\r\n icon.style.right = -0 + 'px';\r\n\r\n //Adds an individual number as the id for newPost tag\r\n var newPost_id = String(Math.random())\r\n newPost.id = newPost_id;\r\n\r\n //Adds an event lsitener that check to see if an X button has been pressed\r\n icon.addEventListener('click', function () {\r\n //Removes the post form hte HTML\r\n document.getElementById(newPost_id).remove();\r\n //Removes the post from the google firebase\r\n db.collection(\"Post\").doc(doc.id).delete();\r\n });\r\n}", "title": "" }, { "docid": "03739f62598f17c87df7f4a88d26993f", "score": "0.53251857", "text": "function showExistingFields(){\n\tvar form = View.panels.get(\"abSchemaAddField_form\");\n\tvar tableName = form.getFieldValue(\"afm_flds.table_name\");\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n\tView.selectValue(\"abSchemaAddField_form\", \n\t\t\tgetMessage(\"title_fieldName\"), \n\t\t\t['afm_flds.field_name'], \n\t\t\t'afm_flds',\n\t\t\t['afm_flds.field_name'], \n\t\t\t['afm_flds.table_name', 'afm_flds.field_name', 'afm_flds.ml_heading'], \n\t\t\trestriction);\n}", "title": "" }, { "docid": "240a07666df9b63bfa40f4ca9422d198", "score": "0.5324406", "text": "function addFeatured(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Featured.collection.insert(data);\n}", "title": "" } ]
e867d090d2524a570101fa596b9c7279
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a single octet. The `Uint8Array` prototype remains unmodified.
[ { "docid": "e7e70226a03d0ef9dc14e6d8fbcb7483", "score": "0.0", "text": "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}", "title": "" } ]
[ { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.7353769", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.7353769", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.7353769", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "27c4d72adc4b0a180c9a8efcfc65e9e4", "score": "0.6850177", "text": "function arrayish2Buffer(arr) {\n\t if (arr instanceof Buffer) {\n\t return arr;\n\t }\n\t else if (arr instanceof Uint8Array) {\n\t return uint8Array2Buffer(arr);\n\t }\n\t else {\n\t return Buffer.from(arr);\n\t }\n\t}", "title": "" }, { "docid": "135e19201d1632a528da9ec87b64e157", "score": "0.68486476", "text": "function Buffer (arg) {\n\t\t if (!(this instanceof Buffer)) {\n\t\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t return new Buffer(arg)\n\t\t }\n\n\t\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t\t this.length = 0\n\t\t this.parent = undefined\n\t\t }\n\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t return fromNumber(this, arg)\n\t\t }\n\n\t\t // Slightly less common case.\n\t\t if (typeof arg === 'string') {\n\t\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t }\n\n\t\t // Unusual.\n\t\t return fromObject(this, arg)\n\t\t}", "title": "" }, { "docid": "135e19201d1632a528da9ec87b64e157", "score": "0.68486476", "text": "function Buffer (arg) {\n\t\t if (!(this instanceof Buffer)) {\n\t\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t return new Buffer(arg)\n\t\t }\n\n\t\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t\t this.length = 0\n\t\t this.parent = undefined\n\t\t }\n\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t return fromNumber(this, arg)\n\t\t }\n\n\t\t // Slightly less common case.\n\t\t if (typeof arg === 'string') {\n\t\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t }\n\n\t\t // Unusual.\n\t\t return fromObject(this, arg)\n\t\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.68475544", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.68373424", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.68373424", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.68373424", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.68373424", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.68373424", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.68373424", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "41828d53feb7f84585b2d1d9d24e8ba5", "score": "0.6819277", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "41828d53feb7f84585b2d1d9d24e8ba5", "score": "0.6819277", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "41828d53feb7f84585b2d1d9d24e8ba5", "score": "0.6819277", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.67836726", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "5b8d498fa0cb03f9736170ee426c9aff", "score": "0.6765775", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\n if(typeof arg===\"number\"){if(typeof encodingOrOffset===\"string\"){throw new Error(\"If encoding is specified then the first argument must be a string\")}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "862a87dabfb1ad952871d7324f366a44", "score": "0.6749748", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "8aa5753adfbc730bd331a2dbd05b2966", "score": "0.674604", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "105fa89efc5104d3587b79c82e8b9f52", "score": "0.6739392", "text": "function Buffer(){}", "title": "" }, { "docid": "afb54f2c8a904095d3a3ca04239dead4", "score": "0.6721138", "text": "function Buffer (arg, encodingOrOffset, length) { // 99\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { // 100\n return new Buffer(arg, encodingOrOffset, length) // 101\n } // 102\n // 103\n // Common case. // 104\n if (typeof arg === 'number') { // 105\n if (typeof encodingOrOffset === 'string') { // 106\n throw new Error( // 107\n 'If encoding is specified then the first argument must be a string' // 108\n ) // 109\n } // 110\n return allocUnsafe(this, arg) // 111\n } // 112\n return from(this, arg, encodingOrOffset, length) // 113\n} // 114", "title": "" }, { "docid": "7e55ae131c51602b557e50ab00138544", "score": "0.66638875", "text": "function Buffer(arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error('If encoding is specified then the first argument must be a string');\n }\n\n return allocUnsafe(arg);\n }\n\n return from(arg, encodingOrOffset, length);\n } // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66490275", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66490275", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.66490275", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "4c718d0643d96e89a15b054166fe7696", "score": "0.66428405", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "60a9bcca920835dd0b5d1ae02aaf9516", "score": "0.66404325", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t\t return new Buffer(arg, encodingOrOffset, length)\n\t\t }\n\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t if (typeof encodingOrOffset === 'string') {\n\t\t throw new Error(\n\t\t 'If encoding is specified then the first argument must be a string'\n\t\t )\n\t\t }\n\t\t return allocUnsafe(this, arg)\n\t\t }\n\t\t return from(this, arg, encodingOrOffset, length)\n\t\t}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "7c2640afdd88400691acc188585d8c85", "score": "0.6635135", "text": "function Buffer (subject, encoding) {\n var self = this\n if (!(self instanceof Buffer)) return new Buffer(subject, encoding)\n\n var type = typeof subject\n var length\n\n if (type === 'number') {\n length = +subject\n } else if (type === 'string') {\n length = Buffer.byteLength(subject, encoding)\n } else if (type === 'object' && subject !== null) {\n // assume object is array-like\n if (subject.type === 'Buffer' && isArray(subject.data)) subject = subject.data\n length = +subject.length\n } else {\n throw new TypeError('must start with number, buffer, array or string')\n }\n\n if (length > kMaxLength) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' +\n kMaxLength.toString(16) + ' bytes')\n }\n\n if (length < 0) length = 0\n else length >>>= 0 // coerce to uint32\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Preferred: Return an augmented `Uint8Array` instance for best performance\n self = Buffer._augment(new Uint8Array(length)) // eslint-disable-line consistent-this\n } else {\n // Fallback: Return THIS instance of Buffer (created by `new`)\n self.length = length\n self._isBuffer = true\n }\n\n var i\n if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') {\n // Speed optimization -- use set if we're copying from a typed array\n self._set(subject)\n } else if (isArrayish(subject)) {\n // Treat array-ish objects as a byte array\n if (Buffer.isBuffer(subject)) {\n for (i = 0; i < length; i++) {\n self[i] = subject.readUInt8(i)\n }\n } else {\n for (i = 0; i < length; i++) {\n self[i] = ((subject[i] % 256) + 256) % 256\n }\n }\n } else if (type === 'string') {\n self.write(subject, 0, encoding)\n } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT) {\n for (i = 0; i < length; i++) {\n self[i] = 0\n }\n }\n\n if (length > 0 && length <= Buffer.poolSize) self.parent = rootParent\n\n return self\n}", "title": "" }, { "docid": "46c861a4d643ee6be3dd13b0fc7cffad", "score": "0.66294557", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t\t return new Buffer(arg, encodingOrOffset, length)\n\t\t }\n\t\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t if (typeof encodingOrOffset === 'string') {\n\t\t throw new Error(\n\t\t 'If encoding is specified then the first argument must be a string'\n\t\t )\n\t\t }\n\t\t return allocUnsafe(this, arg)\n\t\t }\n\t\t return from(this, arg, encodingOrOffset, length)\n\t\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "b98f3fd020042241aec5258afa3844a5", "score": "0.6615738", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "f330b00c59c5f1076605cd57748f5c22", "score": "0.6607455", "text": "function Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n }", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65922797", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" }, { "docid": "ad75aa62fbcacc74958266fb14d5e912", "score": "0.6591809", "text": "function Buffer (arg, encodingOrOffset, length) {\n\t if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n\t return new Buffer(arg, encodingOrOffset, length)\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(this, arg)\n\t }\n\t return from(this, arg, encodingOrOffset, length)\n\t}", "title": "" } ]
090eb4bf4d76449af9c12d67c23ef567
checks to see if missle hit or not
[ { "docid": "207d19198a7cebd80fd7611fe00b82b7", "score": "0.64121604", "text": "function missleCheck(coordCheck, checkArr) {\n var check0 = checkArr[0].position;\n var check1 = checkArr[1].position;\n var check2 = checkArr[2].position;\n var check3 = checkArr[3].position;\n var check4 = checkArr[4].position;\n\n if (check0.includes(coordCheck)) {\n checkArr[0].hits += 1\n return 'Hit!'\n } else if (check1.includes(coordCheck)) {\n checkArr[1].hits += 1\n return 'Hit!'\n } else if (check2.includes(coordCheck)) {\n checkArr[2].hits += 1\n return 'Hit!'\n } else if (check3.includes(coordCheck)) {\n checkArr[3].hits += 1\n return 'Hit!'\n } else if (check4.includes(coordCheck)) {\n checkArr[4].hits += 1\n return 'Hit!'\n } else {\n return 'Miss!'\n }\n}", "title": "" } ]
[ { "docid": "f59e47f9de4d98c03614e88ef7769b5a", "score": "0.72662807", "text": "hitNoHit() { return this.accuracy >= Math.random(); }", "title": "" }, { "docid": "82e9e6cc7766f3772f271d23212bdc19", "score": "0.6625765", "text": "function checkCrashedWalpurgis() {\n for (let i = 0; i < allMissiles.length; i++) {\n if(walpurgis.crashWith(allMissiles[i]) === true){\n allMissiles.splice(i,1)\n barWalpurgis.life -= 1 //Poner a 1\n HITWALPURGIS.pause();\n HITWALPURGIS.currentTime = 0;\n HITWALPURGIS.play()\n break\n }\n }\n}", "title": "" }, { "docid": "45b02e95e5db7124a5ec0da32ffc8d56", "score": "0.6588164", "text": "checkForMiss() {\n N.event(\"sight_reading\", \"note\", \"miss\");\n\n let missed = this.state.notes.currentColumn()\n .filter((n) => !this.state.heldNotes[n]);\n\n this.state.stats.missNotes(missed);\n\n this.setState({\n noteShaking: true,\n heldNotes: {},\n touchedNotes: {},\n });\n\n setTimeout(() => this.setState({noteShaking: false}), 500);\n return true;\n }", "title": "" }, { "docid": "f13073b364cef99a0aec42931f102b68", "score": "0.65727645", "text": "function checkHit(result) {\n if (result == \"hit\") {\n return \"hit!\";\n } else {\n return \"miss!\";\n }\n }", "title": "" }, { "docid": "4412a18a3d04cafff8dba36e5b302958", "score": "0.6550295", "text": "deliversHit() {}", "title": "" }, { "docid": "a2b5fe8321f9a4acaf4a9ac409dd3b83", "score": "0.64803374", "text": "hasHit() {\n return this.fraction !== -1;\n }", "title": "" }, { "docid": "402da9908aa6bc0f6304859ea9bcc6b3", "score": "0.63729554", "text": "function isSunk() {\n if (getHits().length === length) {\n setSunk(true);\n }\n }", "title": "" }, { "docid": "09d477cc9b86e38fc072a1f8932a2019", "score": "0.63701457", "text": "checkGameOver(board) {\n let hits = 0;\n for(let i = 0; i < board.length; ++i) {\n if ((board[i].hit === true) && (board[i].type !== \"empty\")) ++hits;\n }\n return hits === 17 ? true : false;\n }", "title": "" }, { "docid": "873f77f9ee96e80d97d5501bce88f3cb", "score": "0.6361262", "text": "function willAttackMiss (accuracy) {\r\n //console.log(Math.floor(Math.random() * 100) > accuracy);\r\n return Math.floor(Math.random() * 100) > accuracy;\r\n}", "title": "" }, { "docid": "9d092a8e468e7ba8ddc987d2a063da84", "score": "0.62447214", "text": "checkForHit() {\n let touched = Object.keys(this.state.touchedNotes);\n if (this.state.notes.matchesHead(touched)) {\n N.event(\"sight_reading\", \"note\", \"hit\");\n\n this.state.notes.shift();\n this.state.notes.pushRandom();\n this.state.stats.hitNotes(touched);\n\n this.setState({\n notes: this.state.notes,\n noteShaking: false,\n heldNotes: {},\n touchedNotes: {},\n });\n\n this.state.slider.add(this.state.noteWidth);\n\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "288e310281427b77e548a13e449f3729", "score": "0.62445784", "text": "function checkHit(){\r\n/* \tif(hitRectangle(johnRun, zorg)=== true){\r\n\t\tlose();\r\n\t} */\r\n\t\r\n\tif(hitRectangle(johnRun, finish)=== true){\r\n\t\twin();\r\n\t\tgame_state = 4;\r\n\t}\r\n\t\r\n\r\n\tvar collisiontest = tu.hitTestTile(johnRun, bombs, 0, world, \"every\");\r\n\tif (!collisiontest.hit){\r\n console.log(\"hit\");\r\n\t johnRun.position.x = johnRun.position.x;\r\n\t lose();}\r\n\t \r\n\tvar collisiontest2 = tu.hitTestTile(johnRun, steps, 0, world, \"every\");\r\n\tif (!collisiontest2.hit){\r\n\tconsole.log(\"hit\");}\r\n\t\r\n\tvar collisiontest3 = tu.hitTestTile(johnRun, finish, 0, world, 'every');\r\n\t\r\n\tif (!collisiontest3.hit){\r\n\t\t console.log(\"win\");\r\n\t\twin();\r\n\t}\r\n\t \r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "deca7feccbbea779e0b00b3a7bf5d669", "score": "0.6222565", "text": "isSunk() {\n return this.damaged.every(el => el);\n }", "title": "" }, { "docid": "efa00dbee4a3e5e6c96eccffc2ffb40d", "score": "0.61582375", "text": "function latch() {\n\tif (hitChain.length > 0 && nextMove !== '') {\n\t\tvar nextTargetedCell = nextMove;\n\t\tif (pBoard.isAHit(nextTargetedCell)) { // nextTargetedCell is a hit\n\t\t\t$('#p'+nextTargetedCell).addClass('hit');\n\t\t\tpBoard.hitCells.push(nextTargetedCell);\n\t\t\tpBoard.uncheckedCells = pBoard.uncheckedCells.without(nextTargetedCell);\n\t\t\thitChain.unshift(nextTargetedCell);\n\t\t\tnextMove = getNextMoveFromChain();\n\t\t}\n\t\telse { // nextTargetedCell is a miss\n\t\t\t$('#p'+nextTargetedCell).addClass('miss');\n\t\t\tpBoard.uncheckedCells = pBoard.uncheckedCells.without(nextTargetedCell);\n\t\t\tif (hitChain.length > 1) {\n\t\t\t\tnextMove = getNextMoveFromChain();\n\t\t\t}\n\t\t\telse if (hitChain.length === 1) {\n\t\t\t\tvar surroundingCells = getAdjacentCells(hitChain[0]);\n\t\t\t\tif (surroundingCells.length > 0) {\n\t\t\t\t\tnextMove = surroundingCells.getRandomElem();\n\t\t\t\t} else clearTargetingData();\n\t\t\t}\n\t\t}\n\t}\n\telse hunt();\n}", "title": "" }, { "docid": "56b07da26a266a1948058e4b4c030308", "score": "0.61237925", "text": "checkLose(x, y) {\n if (this.isMine(x, y)) {\n this.stopGame();\n this.losePoint = {\n x: x,\n y: y,\n };\n\n this.forEachField((x, y) => {\n let flag = this.isFlagged(x, y);\n let mine = this.isMine(x, y);\n if ((mine || flag) && flag != mine) {\n this.uncovered[x][y] = true; // raw uncover here\n }\n });\n }\n }", "title": "" }, { "docid": "3df9b37ca93b5148c3c785e3770e3886", "score": "0.6076739", "text": "crashwith(player) {\n var crashed= (\n (player.x+this.w >= this.x && player.x <= this.x+this.w) \n &&\n (player.y <= this.y+this.h && player.y+this.h >= this.y)\n );\n if (crashed){\n this.hit = true;\n }\n return crashed;\n }", "title": "" }, { "docid": "61c3ff1993d3c06cd8d210b349c9b333", "score": "0.6051783", "text": "function hitOrMiss(attacker, attack, health) {\n let a = Math.floor(Math.random() * 4);\n if (a < 2) {\n console.log(attacker + \" missed their attack!\");\n }\n else {\n let damage = health - attack;\n console.log(attacker + \" did \" + damage + \" damage!\");\n }\n }", "title": "" }, { "docid": "0524aa038d3991c57a543032a1b108dc", "score": "0.60450184", "text": "hasSafeTiles(){\n return (this._numberOfTiles !== this._numberOfBombs);\n }", "title": "" }, { "docid": "7b37d700b06aaeb688f68c83a3fba53b", "score": "0.6031546", "text": "function checkAlly(number) {\n\tif(ally.tileFrom[1]*mapW + ally.tileFrom[0] === number)\n\t{\n\t\tally.placeAt(0,1);\n\t\tplayer.score-=1500;\n\t\tally.alive=false;\n\t\tsounds.deathAlly.play();\n\t}\n}", "title": "" }, { "docid": "39865594926828a034bf486269187fb8", "score": "0.59923416", "text": "checkForHit(target, gameData, opponentString, playerString) {\n let shipString = `${opponentString}_ships`;\n let opponentShips = JSON.parse(gameData[shipString]);\n let playerHits = JSON.parse(gameData[`${playerString}_hits`]);\n\n let result = 'miss';\n let ship = null;\n let sunk = null;\n\n for (let i = 0; i < opponentShips.length; i++) {\n if (opponentShips[i].spaces.includes(target)) {\n result = 'hit';\n ship = opponentShips[i].name;\n playerHits = playerHits ? [...playerHits, target] : [target];\n if (opponentShips[i].spaces.every(value => playerHits.includes(value))) {\n sunk = true;\n }\n break;\n }\n }\n return { result, ship, sunk };\n }", "title": "" }, { "docid": "46c87af152e678be4ba879e59ea47f1c", "score": "0.59878486", "text": "hitP1() {\n const _hitP1 = hitP1 && hitP1++;\n if (hitP1 > 1)\n hitP1 = false;\n return _hitP1;\n }", "title": "" }, { "docid": "75e2b89f712483e5419c6ff75963ca16", "score": "0.5966649", "text": "function checkForSunk(array, squaresHit, player, cpu){\n array.forEach(obj => {\n if((obj.index.every(index => squaresHit.includes(index))) &&\n (obj.sunk === false)){\n player.text(`${obj.name} was sunk`)\n if(!cpu){\n logArray.unshift(`${obj.name} was sunk`)\n updateLog()\n obj.index.forEach(index => {\n $fireSquares.eq(index).removeClass()\n $fireSquares.eq(index).addClass('dead')\n })\n cpuShipsDestroyed++\n }\n obj.sunk = true\n if(cpu){\n logArray.unshift(`Your ${obj.name} was sunk`)\n updateLog()\n recentHits.forEach(index => {\n player.text(`Your ${obj.name} was sunk`)\n $shipSquares.eq(index).removeClass()\n $shipSquares.eq(index).addClass('dead')\n })\n userShipsDestroyed ++\n originalHit = undefined\n recentHits = []\n }\n }\n })\n }", "title": "" }, { "docid": "fa6ec76c4ce81196ca4e6e26f4d1a603", "score": "0.5948783", "text": "function validAtBat(battingResults, fieldingResults, sacrificeFly){\n\t\t\treturn (!battingResults.hitByPitchOrWalk && !sacrificeFly && !fieldingResults.sacrificeBunt) /*OR REACH ON INTERFERANCE*/;\n\t\t}", "title": "" }, { "docid": "1845b9296112cdd09a2ef5958c8b3f09", "score": "0.59273285", "text": "function shipCheckHit(){\n\tfor(let i = 0; i < ship.length; i++){\n\t\tif(ship[i].spawn_protection == 0){\n\t\t\tfor(let j = 0; j < projectile.length; j++){\n\t\t\t\tif(ship[i] != null && projectile[j].id != ship[i].id) //Ignore friendly fire\n\t\t\t\tif(projectile[j].x >= ship[i].x - 10 && projectile[j].x <= ship[i].x + 10 && projectile[j].y >= ship[i].y -5 && projectile[j].y <= ship[i].y + 15){\n\n\t\t\t\t\tlet _ship = getShipByID(projectile[j].id);\n\t\t\t\t\tif(_ship != null)\n\t\t\t\t\t\t_ship.score += 100;\n\n\t\t\t\t\tif(ship[i].lives == 1){\n\t\t\t\t\t\t//Send kill code\n\t\t\t\t\t\tio.to(ship[i].id).emit('death', \"\");\n\t\t\t\t\t\t//Remove ship from array\n\t\t\t\t\t\tship.splice(i, 1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tship[i].lives--;\n\t\t\t\t\t\tship[i].spawn_protection = SPAWN_PROTECTION;\n\t\t\t\t\t}\n\t\t\t\t\t//Remove projectile from array\n\t\t\t\t\tprojectile.splice(j,1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(let j = 0; j < asteroid.length; j++){\n\t\t\t\tif(ship[i] != null && getDistance(ship[i].x,ship[i].y,asteroid[j].x,asteroid[j].y) <= asteroid[j].size/2){\n\t\t\t\t\tif(ship[i].lives == 1){\n\t\t\t\t\t\t//Send kill code\n\t\t\t\t\t\tio.to(ship[i].id).emit('death', \"\");\n\t\t\t\t\t\t//Remove ship from array\n\t\t\t\t\t\tship.splice(i, 1);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tship[i].lives--;\n\t\t\t\t\t\tship[i].spawn_protection = SPAWN_PROTECTION;\n\t\t\t\t\t}\n\t\t\t\t\tif(asteroid[j].level > 1){\n\t\t\t\t\t\tasteroid.push(new Asteroid(SpawnAsteroid(asteroid[j].x,asteroid[j].y,asteroid[j].level-1,randomN(-0.5,0.5),randomN(-0.5,0.5))));\n\t\t\t\t\t\tasteroid.push(new Asteroid(SpawnAsteroid(asteroid[j].x,asteroid[j].y,asteroid[j].level-1,randomN(-0.5,0.5),randomN(-0.5,0.5))));\n\t\t\t\t\t}\n\t\t\t\t\tio.sockets.emit('explosion', {x: asteroid[j].x, y: asteroid[j].y});\n\t\t\t\t\tasteroid.splice(j,1);\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t//Log.w('spawn protection')\n\t\t\tship[i].spawn_protection--;\n\t\t}\n\t\t//Check if ship is outside screen\n\t\tif(ship[i] != null && ship[i].border()){\n\t\t\t//Send kill code\n\t\t\tio.to(ship[i].id).emit('death', \"\");\n\t\t\t//Remove ship from array\n\t\t\tship.splice(i, 1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "a891d3dfc65fe58a703cb4599b784e4e", "score": "0.5925421", "text": "function hit() { /* can be overwritten */ }", "title": "" }, { "docid": "f33ddefa084ccb5703de1e1df70d9576", "score": "0.59192395", "text": "function checkCrashedFamiliars() {\n for (let i = 0; i < allFamiliars.length; i++) {\n for (let j = 0; j < allMissiles.length; j++) {\n if(allFamiliars[i].crashWith(allMissiles[j]) === true){\n allFamiliars.splice(i,1)\n allMissiles.splice(j,1)\n HITFAMILIAR.pause();\n HITFAMILIAR.currentTime = 0;\n HITFAMILIAR.play()\n break\n }\n }\n }\n}", "title": "" }, { "docid": "15d5d90d2451172f119d0823ca876065", "score": "0.59057266", "text": "function checkHit(aliens, num) {\r\n if (bullets[i].hits(aliens[num])) {\r\n aliens[num].shrink();\r\n bullets[i].directHit();\r\n }\r\n }", "title": "" }, { "docid": "917190a15cde76e71577fd7169fa4c01", "score": "0.5896286", "text": "function calculateMiss(missedBall) {\n\n const { race, playerScore, ghostScore, difficulty } = this.props;\n\n// easy [10% - 40%], medium [30% - 90%], hard [50-100%]\n\n const difficultyValues = [\n /* 1 ball */ [10, 25, 50],\n /* 2 ball */ [15, 30, 60],\n /* 3 ball */ [20, 35, 70],\n /* 4 ball */ [20, 40, 80],\n /* 5 ball */ [25, 45, 85],\n /* 6 ball */ [30, 50, 90],\n /* 7 ball */ [30, 60, 100],\n /* 8 ball */ [35, 70, 100],\n /* 9 ball */ [40, 85, 100]\n ]\n\n let randomNum = Math.floor(Math.random() * 100 + 1);\n\n let difficultyValue = difficultyValues[missedBall]\n let difficultyCheck = difficultyValue[difficulty]\n\n\n console.log('Player Roll: ' + randomNum , 'Ghost Roll: ' + difficultyCheck)\n\n if (ghostScore + 1 === race) {\n this.props.ghostWins();\n }\n else if (randomNum < difficultyCheck) {\n this.props.setBanner1(false);\n this.props.setBanner2(false);\n this.props.setBanner3(true);\n setTimeout(() => {\n this.props.setBanner3(false);\n }, 5000);\n this.props.incrementGhostScore();\n }\n else {\n this.props.setBanner1(false);\n this.props.setBanner3(false);\n this.props.setBanner2(true);\n setTimeout(() => {\n this.props.setBanner2(false);\n }, 5000);\n }\n}", "title": "" }, { "docid": "1257794cfbfc8371a3d869150ea8b4a2", "score": "0.58892196", "text": "get sunk() {\r\n return this.hits === this.damage;\r\n }", "title": "" }, { "docid": "51cd20e993fad57a410c268afb151ed5", "score": "0.5886946", "text": "function checkAliensShot(){\n shots.getShots().each(function(){\n var shot = $(this); // jQuery wrapper over DOM object\n aliens.getAliens().each(function(){\n var alien = $(this); // jQuery wrapper over DOM objects\n if(collide(shot, alien)){\n shot.attr(\"data-dead\", true); // flag to prevent multiple hits\n alien.attr(\"data-dead\", true);\n trackScore(1);\n }\n });\n });\n $(\"[data-dead=true]\").remove(); // clear dead elements\n}", "title": "" }, { "docid": "b47ff0a58eecc16d40f33415b7a5ce78", "score": "0.58788884", "text": "hasSafeTiles() {\n return this._numberOfTiles != this._numberOfBombs;\n }", "title": "" }, { "docid": "ddfd78f852670cb5f9229fe6690e70d5", "score": "0.58702916", "text": "isHit() {\n return this.hit;\n }", "title": "" }, { "docid": "5087075aad5b1d93ee3a2d70a62e777e", "score": "0.5869834", "text": "hitP2() {\n const _hitP2 = hitP2 && hitP2++;\n if (hitP2 > 1)\n hitP2 = false;\n return _hitP2;\n }", "title": "" }, { "docid": "ef1d1aa287c44cddfa5b517fba20dad1", "score": "0.58670706", "text": "function hunt() {\n\tif (pBoard.uncheckedCells.length > 0) {\n\t\tclearTargetingData();\n\t\tvar targetedCell = pBoard.uncheckedCells.getRandomElem();\n\t\tif (pBoard.isAHit(targetedCell)) { // targetedCell is a hit\n\t\t\t//printMessage('Hunt successful!');\n\t\t\t$('#p'+targetedCell).addClass('hit'); // mark the cell as 'hit'\n\t\t\tpBoard.hitCells.push(targetedCell); // add targetedCell to pBoard.hitCells\n\t\t\tpBoard.uncheckedCells = pBoard.uncheckedCells.without(targetedCell); // remove targetedCell from pBoard.uncheckedCells\n\t\t\thitChain.unshift(targetedCell); // add targetedCell to beginning of hitChain (which should be initially empty)\n\t\t\tvar surroundingCells = getAdjacentCells(targetedCell);\n\t\t\t//$('body').append('<p>checkpoint3</p>');\n\t\t\t//$('body').append('<p>Surrounding Cells: '+surroundingCells+'</p>');\n\t\t\tif (surroundingCells.length > 0) {\n\t\t\t\t// set nextMove to a random available cell surrounding targetedCell\n\t\t\t\tnextMove = getAdjacentCells(targetedCell).getRandomElem();\n\t\t\t\t//printMessage('nextMove (from hunt): '+nextMove);\n\t\t\t} else {\n\t\t\t\t//printMessage('Clearing targeting data...');\n\t\t\t\tclearTargetingData();\n\t\t\t}\n\t\t} else { // targetedCell is a miss\n\t\t\t$('#p'+targetedCell).addClass('miss'); // mark the cell as 'miss'\n\t\t\tpBoard.uncheckedCells = pBoard.uncheckedCells.without(targetedCell); // remove targetedCell from pBoard.uncheckedCells\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1bbc03e5a6ef6211599dd26d0a06200d", "score": "0.58612484", "text": "function checkGameOver() {\n if (\n squares[pacmanCurrentIndex].classList.contains('ghost') &&\n !(squares[pacmanCurrentIndex].classList.contains('scared-ghost'))\n )\n gameOverHandler();\n}", "title": "" }, { "docid": "f580650a7a799b0abdf686d901dbab05", "score": "0.5858333", "text": "function spookyOverlapExist(referencePoint,otherPoint){\n\tdistance = new Phaser.Line(referencePoint.x,referencePoint.y,otherPoint.x,otherPoint.y);\n\tif (distance.length<5){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "85a73ef6f29c6c4c26b05ffdf58bbe3e", "score": "0.5829492", "text": "function checkGameOver(){\n if(aliens.getAliens().length === 0){ // all aliens dead!\n gameOver(\"You win!\");\n }\n if(aliens.getAliens().last().data(\"top\") >= endBoundary){ // aliens advanced\n gameOver(\"You lose!\");\n } \n}", "title": "" }, { "docid": "0f36b009dc79a9faf7e7e40ca5c5ffb1", "score": "0.5829087", "text": "function collisionHandle() {\nif ( (x >= badX) && (x <= badX + spriteWidth) && (y >= badY) && (y <= badY + spriteHeight) ) {\n\tbadCollision = true;\n} else {\n\tbadCollision = false;\n}\n}", "title": "" }, { "docid": "b63c4b4fa6296ad08356b603508df2a7", "score": "0.5820813", "text": "ignore(event, objectRef) {\n if (LineupTrackingManager.getInstance().ignoreNext === event) {\n LineupTrackingManager.getInstance().ignoreNext = null;\n return true;\n }\n return LineupTrackingManager.getInstance().temporaryUntracked.has(objectRef.hash);\n }", "title": "" }, { "docid": "77856e2cfd88f98140e0d17346b6bc98", "score": "0.58121955", "text": "function checkBugCollisions() {\n var buffer = 50; // This is the assumed width of the enemy.\n allEnemies.forEach(function(Enemy) {\n if (Enemy.x < player.x + buffer &&\n Enemy.x + buffer > player.x &&\n Enemy.y < player.y + buffer &&\n Enemy.y + buffer > player.y) {\n app.loseCount++; //If a bug hits the player its treated as a collision and the player is reset to the intial location.\n console.log(\"Collision!\", \"LoseCount = \", app.loseCount, \"Points = \", app.points,\n \"Total GEMS = \", app.gemCount);\n player.reset();\n }\n });\n}", "title": "" }, { "docid": "0958f562e0ad4dc83e5c90b2bd623449", "score": "0.5805057", "text": "function checkOverlap() {\n let d = dist(blueFairy.x, blueFairy.y, pinkFairy.x, pinkFairy.y);\n if (d < blueFairy.size/3 + pinkFairy.size/3) {\n state = `love`;\n }\n }", "title": "" }, { "docid": "0172857be2e4566e787dcf6c8d2e55e7", "score": "0.5803331", "text": "hasSafeTiles() {\n return this._numberOfTiles !== this._numberOfBombs;\n}", "title": "" }, { "docid": "fc85d862466884f1f5bae47f3485f60f", "score": "0.5796757", "text": "function checkIfLost() {\n var misses = wrongGuesses.length;\n if (misses < 6) {\n return false;\n }\n else {\n return true;\n }\n}", "title": "" }, { "docid": "13069b9c3df9efeb7f40f993112c3135", "score": "0.57873195", "text": "hit() {}", "title": "" }, { "docid": "8472aad989b0eb65388528be69a9143f", "score": "0.57871926", "text": "hasSafeTiles() {\n\t\treturn this._numberOfTiles !== this._numberOfBombs;//returns TRUE cuz statement is TRUTHY, otherwise false\n\t}", "title": "" }, { "docid": "b2b61cc13bc80c5df8f8d090ba2587a0", "score": "0.5786302", "text": "function checkSneak(target){\n let count = 0;\n let adjacent = findAdjacent(target);\n for(let i = 0; i < adjacent.length; i++){\n let y = adjacent[i][0], x = adjacent[i][1];\n if(Game.board[y][x].type === \"player\"){\n count++;\n }\n }\n return count > 1;\n }", "title": "" }, { "docid": "f5e926c8eb41dab4f86cd5f56f2b495e", "score": "0.57850397", "text": "attemptedShot(row,col){\n\t\tif(this.board[row][col] == 0){//empty spot - valid shot \n\t\t\tthis.board[row][col]=1;//if shot takes place replace zero with 1\n\t\t\treturn 'M';\n\t\t}\n\t\telse if(this.board[row][col] instanceof ship){//if a boat is hit - valid shot \n\t\t\tlet boat = this.board[row][col];\n\t\t\tlet [rowHead, colHead] = boat.getHead();\n\t\t\tlet distance = Math.abs((rowHead-row)+(col-colHead));\n\t\t\tif(boat.hits[distance] != 1){\n\t\t\t\tboat.registerHit(distance);\n\t\t\t\treturn 'H';\n\t\t\t}\t\n\t\t}\n\t\telse if(this.board[row][col] instanceof trap){//if a boat is hit - valid shot \n\t\t\tconsole.log(\"trap hit\")\n\t\t\treturn \"T\"\n\t\t}\n\t\treturn 'I';//not a valid shot \n\t}", "title": "" }, { "docid": "9b572ee80a8e803a01669993e07e1b25", "score": "0.5784991", "text": "function checker(){\n var b=catchingBowl.locater();\n \n \n //runs through the list of foods and returns the location of the food\n for (i = 0; i<foods.length; i++){\n var f=foods[i].locater();\n if (overlap(b,f)){\n //what happens when food is caught \n \n score+=foods[i].score;\n scoreBanner.updateMessage(score, \"|score|\");\n foods[i].die();\n }\n \n \n }\n}", "title": "" }, { "docid": "5b38688c1f8796ed7f4f4d0fff90097a", "score": "0.5777276", "text": "function checkFailureConditions(){\n \n //Collided with self\n for (i=1; i < segments.length; i++){\n if (segments[0].xPos == segments[i].xPos && segments[0].yPos == segments[i].yPos){\n endGame();\n }\n }\n \n //Collided with wall\n if (segments[0].xPos < 0 || segments[0].xPos > (numXCells * cellX) || segments[0].yPos < 0 || segments[0].yPos > (numYCells * cellY)) {\n endGame();\n }\n}", "title": "" }, { "docid": "8887de5a116b95d13b45af335213e810", "score": "0.57765377", "text": "function onMiss(party) {\n //console they missed\n console.log(`${party.name} nuke missed and instead landed in the ocean`);\n callAtack(party.name)\n}", "title": "" }, { "docid": "90ded8f529efeb527db13943c92030b5", "score": "0.57710606", "text": "function checkGameOver() {\n let crashed = obstaclesPosition.some(function (obstacle) {\n return car.crashWith(obstacle);\n });\n\n if (crashed) {\n myGameArea.stop();\n // show text\n myGameArea.gameOver();\n }\n}", "title": "" }, { "docid": "84bd1076e38afa980d56dfcd655e034f", "score": "0.5761748", "text": "function isGameOver(){\n return !(currentBlock.every(index =>{\n return (!squares[currentPosition + index].classList.contains('landed-block'));\n }));\n }", "title": "" }, { "docid": "0c9773951e04b4b8173c136c11259f49", "score": "0.5760107", "text": "gameOver() {\n return (\n this.level.isCollide(this.potato.bounds()) || this.potato.outOfBounds()\n )\n \n }", "title": "" }, { "docid": "08f5a6325523fbd0d0876c8d2d145a7f", "score": "0.5756651", "text": "function isGameOver() {\n return lives <= 0 || beanCount === 0;\n }", "title": "" }, { "docid": "124b5774812d78525e531e2e5a484f97", "score": "0.5751577", "text": "function hasWon() {\n var condition = true;\n for (var i = 0; i < map.length; i++) {\n for (var j = 0; j < map[i].length; j++) {\n if ((map[i][j] == 2 && bombs[i][j] != 1) || (map[i][j] != 2 && bombs[i][j] == 1)) {\n condition = false;\n }\n }\n }\n if (condition) {\n $(\"#smiley\").attr('src', 'img/love/' + random(1, 2) + '.png');\n setTimeout(function () {\n gameOver(1);\n }, 200);\n }\n}", "title": "" }, { "docid": "166e96e8b7055e2a25942ec09dfe7d65", "score": "0.5745684", "text": "function wrongHit(){\n if (score > 0){\n score--;\n } else {\n return;\n }\n}", "title": "" }, { "docid": "6f0603162d16b271930c39d7451461bb", "score": "0.57435125", "text": "checkMiss() {\n let poofs = $('.item');\n for (let poof of poofs) {\n let y1 = poofs.offset().top;\n let cheesyHeight = poofs.outerHeight(true);\n let entirePoofHeight = y1 + cheesyHeight;\n if (entirePoofHeight > 550) {\n this.counter -= 5;\n $('#counter').text(this.counter);\n poof.remove();\n }\n }\n }", "title": "" }, { "docid": "1a48a0d24fad755c3cabbf2569d57e57", "score": "0.5733161", "text": "function checkHit(player) {\n ghostModule.ghosts.forEach(function (ghost, index, array) {\n if (ghost.xPos > player.xPos && ghost.xPos < (player.xPos + (player.width * 0.75)) && ghost.yPos > player.yPos && ghost.yPos < (player.yPos + (player.height * 0.75)) || (ghost.xPos + (ghost.width * 0.75)) > player.xPos && (ghost.xPos + (ghost.width * 0.75)) < (player.xPos + (player.width * 0.75)) && ghost.yPos > player.yPos && ghost.yPos < (player.yPos + (player.height * 0.75))) {\n gameOver = true;\n }\n });\n }", "title": "" }, { "docid": "71312d875ad4808190993fb28c114659", "score": "0.57326704", "text": "function checkHitsOnEnemy(){\n const squareId = $(this).index();\n if (playerGuesses.all.includes(squareId)){\n $('.info-bar').text('You\\'ve already bombed this location. Bomb another one.');\n return;\n }\n gunShotSound();\n playerGuesses.all.push(squareId);\n // Turn player clicking off because it's the computer's turn\n $trackingSquareList.off('click', checkHitsOnEnemy);\n // Cycle through enemy ships to see if you've made a hit\n checkHits(playerGuesses,enemyShips,squareId,this);\n // The computer makes their move next after a time lag\n\n // Making sure that if there's a hit, there's enough time to hear the sound if the sound effects are on\n if (playerGuesses.all[playerGuesses.all.length-1]===playerGuesses.hits[playerGuesses.hits.length-1] && !sfxMuted){\n setTimeout(computerTurn, compMoveTimeDelay+750);\n } else {\n setTimeout(computerTurn, compMoveTimeDelay);\n }\n }", "title": "" }, { "docid": "c13964ab1be684861d054915086aa895", "score": "0.57132167", "text": "function misses() {\r\n return this.__misses;\r\n }", "title": "" }, { "docid": "936e4ac57de7ee4de9a8d0f6f2613eab", "score": "0.570058", "text": "checkLose() {\r\n if (this.gs.board.findIndex(elt => elt === 0) > -1) {\r\n this.gs.over = false; // still have empty space\r\n return false;\r\n }\r\n for (let r = 0; r < this.dim; r++) {\r\n for (let c = 0; c < this.dim - 1; c++) {\r\n //horizontal direction\r\n let idx = this.dim * r + c;\r\n if (this.gs.board[idx] === this.gs.board[idx + 1]) {\r\n this.gs.over = false; return false;\r\n }\r\n //vertical direction\r\n idx = this.dim * c + r;\r\n if (this.gs.board[idx] === this.gs.board[idx + this.dim]) {\r\n this.gs.over = false; return false;\r\n }\r\n }\r\n }\r\n this.gs.over = true; // update gamestate\r\n this.onLose();\r\n return true;\r\n }", "title": "" }, { "docid": "6252fceeff29a6675e5624662dba1704", "score": "0.5697751", "text": "function missileHits(){// end of show, missile hits version\r\n\t\tsetInterval(function(){\r\n\t\t/* page imitates monitor disconnection */\r\n\t\t\t$( \"html\" ).css( 'background','#040380' );\r\n\t\t\t$( \"html\" ).html(\"No Input Signal\").css( {'color':'#ffffff','font-family':'\"Lucida Console\", Monaco, monospace','font-size':'4vw','text-align':'center','margin-top':'20%'} );\r\n\t\t}, 600);// after a short hesitation\r\n\t//return;\r\n }", "title": "" }, { "docid": "ba8ed4641c35bd781e1860a312967439", "score": "0.5694046", "text": "function isGameOver(){\r\n\tfor(var i=0;i<3;i++){\r\n\t\tfor(var j=0;j<3;j++){\r\n\t\t\tif(_2048.numbers[i][j] == _2048.numbers[i][j+1] || _2048.numbers[i][j] == _2048.numbers[i+1][j]){\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tfor(var i=0;i<3;i++){\r\n\t\tif(_2048.numbers[3][i] == _2048.numbers[3][i+1] || _2048.numbers[i][3] == _2048.numbers[i+1][3]){\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\treturn 1;\r\n}", "title": "" }, { "docid": "6f89237daf3ed324b5a51836172a6424", "score": "0.56919074", "text": "function checkGun(t_gun)\n{\n if(realPos > t_gun.x_pos - t_gun.size && realPos < t_gun.x_pos + t_gun.size)\n {\n if(!t_gun.isFound)\n {\n t_gun.isFound = true;\n score += 1;\n console.log(score);\n }\n }\n}", "title": "" }, { "docid": "a7f60dbc089137259ae377ad8132f1cd", "score": "0.568905", "text": "function check_lost() {\n\n // check to see if we got \"lost\" E/W\n if (Robot.position[0] > world[0] || Robot.position[0] < 1) {\n console.log(Robot.position[0] + \" \" + Robot.position[1] + \" \" + Robot.direction + \" LOST\");\n Robot.leave_scent();\n Robot.position = [0,0];\n return;\n }\n\n // check to see if we got \"lost\" N/S\n if (Robot.position[1] > world[1] || Robot.position[1] < 1) {\n console.log(Robot.position[0] + \" \" + Robot.position[1] + \" \" + Robot.direction + \" LOST\");\n Robot.leave_scent();\n Robot.position = [0,0];\n return;\n }\n}", "title": "" }, { "docid": "168de387f9ef763da18bd0b8606505dd", "score": "0.56873965", "text": "willLikelySurvive() {\n let COrGMatches = 0;\n for (i = 0; i < this.dna.length; i++) {\n if (this.dna[i] === 'C' || this.dna[i] === 'G') {\n COrGMatches += 1\n }\n }\n let percentageMatch = ((CorGMatches / this.dna.length) * 100);\n if (percentageMatch < 60) {\n return false\n } else {\n return true\n }\n }", "title": "" }, { "docid": "a4d7ed99e52dbcb990cb9ea44e2a6d17", "score": "0.5684919", "text": "missileContact (player) {\n let i, baddy, dist, min_dist, missile;\n for (i in this.shots) {\n missile = this.shots[i];\n //console.log(missile);\n baddy = player;\n dist = baddy.position.distance(missile);\n min_dist = baddy.radius;\n\n if (dist < min_dist) {\n // console.log(dist, min_dist);\n missile=null;\n this.shots.splice(i,1);\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "d6ec3ce1b7220f6d35e239eb41b1b210", "score": "0.56800914", "text": "targetReached() {\n let d = p5.Vector.dist(this.pos, this.target);\n return (d < 1);\n }", "title": "" }, { "docid": "e1bbfa7e58e3fa13abfbdc56c168ee07", "score": "0.5675576", "text": "get noMissBonus() {\n if (this._missedCount == 0)\n return (this._destroyedArray.length * NO_MISS_MULTIPLIER);\n return 0;\n }", "title": "" }, { "docid": "1d2f78cd65a5fdadeb09e50d1929c52f", "score": "0.56702065", "text": "function privateCheckCollision() {\n\t\t\n\t}", "title": "" }, { "docid": "a9a5bd2dfcfa29a9441921d38f180ea5", "score": "0.5666795", "text": "checkCannonballHit() {\n this.tentacleArr.forEach(function (tentacle) {\n // var tentacle = tentacleArr[x]\n var tentacleIndex = this.tentacleArr.indexOf(tentacle);\n this.cannonballArr.forEach(function (cannonball) {\n var cannonballIndex = this.cannonballArr.indexOf(cannonball);\n // var cannonball = cannonballArr[x]\n if (cannonball.cannonballHit(tentacle)) {\n // destroy both the tentacler and cannonball\n this.tentacleArr.splice(tentacleIndex, 1);\n this.cannonballArr.splice(cannonballIndex, 1);\n // extra points for killing tentacles\n this.killScore = this.killScore + 10;\n // sound for tentacle hit\n this.soundSquish.volume = 0.1;\n this.soundSquish.currentTime = 0;\n this.soundSquish.play();\n }\n }, this);\n }, this);\n }", "title": "" }, { "docid": "4d488404ab5a228023aae72bb31294a0", "score": "0.5662943", "text": "trapCheck() {\n\n let d = dist(user.x, user.y, this.trapX, this.trapY);\n if (d < this.trapSize / 2 + user.size / 2) {\n\n score -= 1;\n user.x = this.repositionX;\n user.y = this.repositionY;\n squeakSFX.play();\n\n }\n }", "title": "" }, { "docid": "475de5c92514c81a7dc4c71ed960723a", "score": "0.565752", "text": "function verification() {\n\t//When losing - Touching the wall (the frame)\n\tif(x[0]<0 || x[0]>630 || y[0]<0 || y[0]>430){\n\t\t\n\t\tdpx=dp;\n\t\tdpy=0;\n\t\t//Start or Restat\n\t\tstart();\n\n\t}\n\n\t//When eating\n\t//If the head of Snake == Position (x, y) of food - Means when eating\n\tif(x[0]==xPosFood && y[0]==yPosFood){\n\t\t\n\n\t\tx[n]=kx;\n\t\ty[n]=ky;\n\t\tn++;\n\n\t\t//Add a new part of snake\n\t\taddps();\n\n\t}\n\n\n// Touching a part of the snake - Lose -> Start\n\tjps=1;\n\twhile(jps<n){\n\n\t\tif(y[0]==y[jps] && x[0]==x[jps]){\n\t\t\tdpx=dp; //Means horizontal movement\n\t\t\tdpy=0;\n\t\t\t//Start or Restat\n\t\t\tstart();\n\t\t}\n\n\t\tjps++;\n\n\t}\n}", "title": "" }, { "docid": "01754bdf354921651b314168d5cd1048", "score": "0.56571084", "text": "function checkCatching() {\n // Get distance of playerGargamel to smurf\n let d = dist(playerGargamelX, playerGargamelY, smurfX, smurfY);\n // Check if it's an overlap. Addition each image * their scale and divide them by two to\n if (d < (playerGargamelLeftImage.width * playerGargamelscale) / 2 + (smurfImage1.width * smurfscale) / 2) {\n // Increase the playerGargamel Hope, because he gains hope\n playerGargamelHope = playerGargamelHope + eatHope;\n // Constrain to the possible range\n playerGargamelHope = constrain(playerGargamelHope, 0, playerGargamelMaxHope);\n // Reduce the smurf Hope\n smurfHope = smurfHope - eatHope;\n // Constrain to the possible range\n smurfHope = constrain(smurfHope, 0, smurfMaxHope);\n // play an evil laugh sound, because the player is evil and happy\n evilLaugh.play();\n\n // Make the player Gargamel a little bit bigger,\n // because his hope in his soul actually makes him bigger.\n playerGargamelscale += 0.002;\n\n // Check if the smurf died (Hope 0)\n if (smurfHope === 0) {\n // Choice a random smurf\n randomSmurf = random(0, 1);\n // Move the \"new\" smurf to a random position\n smurfX = random(0, width);\n smurfY = random(0, height);\n // Give it full Hope\n smurfHope = smurfMaxHope;\n // Track how many smurf were eaten\n smurfCaught = smurfCaught + 1;\n\n // Check if gargamel catched 20 smurf. If so the player won.\n if (smurfCaught > 19) {\n game = 3;\n }\n }\n }\n}", "title": "" }, { "docid": "6d34642d30b1cd7321b2a61ec7bb89ac", "score": "0.565583", "text": "function checkGameOver() {\n const head = state.snake[0];\n // Checking if head collides with snake other parts. if collides gameover returns true\n if (state.snake.some(\n (part, i) => i !== 0 && head.x === part.x && head.y === part.y\n ) == true) {\n let finalScore = state.score\n updateUserTrees(finalScore, thisUser);\n return true;\n } else {\n return false;\n }\n \n // Note: You can add blocks or check if it is colliding the boundary and make it game over\n}", "title": "" }, { "docid": "10ba03e1019a55dda59b4b2717efe6d7", "score": "0.56555176", "text": "function checkCollision(lane) {\n if (!lane.beats.length) {\n resCtx.drawImage(result.bad, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n }\n let didHit = false\n\n for (let i = lane.beats.length; i > 0; i -= 1) {\n const sI = i - 1\n const sprite = lane.beats[sI]\n const sY = Math.floor(sprite.y)\n\n if (!sprite.hit) {\n if (sY >= ZONE_CHECK_BOTTOM) {\n // console.log('index', sI, 'too late')\n // resCtx.drawImage(result.bad, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n // continue\n\n // // This sprite was MISSED\n // Decrement the scorre/add a strike/whatever\n sprite.hit = true\n didHit = true\n\n continue\n }\n if (sY <= ZONE_CHECK_TOP) {\n // console.log('index', sI, 'too soon')\n // resCtx.drawImage(result.bad, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n continue\n // Shouldn't do anything about this one - just know that it will impac the score somehow.\n }\n if (sY < ZONE_CHECK_PERFECT_BOTTOM && sprite.y > ZONE_CHECK_PERFECT_TOP) {\n // console.log('... PERFECT ...')\n resCtx.drawImage(result.perfect, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n sprite.hit = true\n didHit = true\n continue\n }\n if (sY < ZONE_CHECK_GOOD_BOTTOM && sprite.y > ZONE_CHECK_GOOD_TOP) {\n // console.log('... GOOD ...')\n resCtx.drawImage(result.good, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n sprite.hit = true\n didHit = true\n continue\n }\n if (sY < ZONE_CHECK_OK_BOTTOM && sprite.y > ZONE_CHECK_OK_TOP) {\n // console.log('... OK ...')\n resCtx.drawImage(result.ok, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n sprite.hit = true\n didHit = true\n continue\n }\n if (sY < ZONE_CHECK_BOTTOM && sprite.y > ZONE_CHECK_TOP) {\n // console.log('... MEH ...')\n resCtx.drawImage(result.meh, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n sprite.hit = true\n didHit = true\n continue\n }\n }\n }\n\n if (!didHit) {\n resCtx.drawImage(result.bad, lane.drawX, BOARD_HEIGHT - (SECTION_HEIGHT * 2))\n }\n}", "title": "" }, { "docid": "140427bad33d43ed515f41587bb80a52", "score": "0.56547046", "text": "checkTarget() {\n let d = dist(this.position.x, this.position.y, target.position.x, target.position.y);\n if (d < this.recordDist) this.recordDist = d;\n\n if (target.contains(this.position) && !this.hitTarget) {\n this.hitTarget = true;\n } else if (!this.hitTarget) {\n this.finishTime++;\n }\n }", "title": "" }, { "docid": "39180e40faa079c5ae060f5daa64288b", "score": "0.56545806", "text": "function checkBallHit() {\n var ballHit = false;\n for (var i = 0; i < ballsArray.length; i++) {\n var px2Ball = dist(ballsArray[i].posX, ballsArray[i].posY, mouseX, mouseY);\n if (px2Ball <= ballsArray[i].diameter / 2) {\n ballHit = true;\n ballsArray.splice(i, 1);\n }\n }\n if (ballHit == true) {\n score++;\n } else {\n misses++;\n }\n}", "title": "" }, { "docid": "98b0c0388224df3eb6fea8df3e14adb5", "score": "0.5650578", "text": "function crashed(snake){\n return snake.x === BOARD_SIZE || snake.x === -1 || snake.y === BOARD_SIZE || snake.y === -1 || $scope.board[snake.y][snake.x];\n }", "title": "" }, { "docid": "c8929d5ebb73d8155da53ecbec382187", "score": "0.5648463", "text": "isEnemyCanBeCaught() {\n let noCatch = document.querySelector('#divFightOptions .nocatch');\n return noCatch != null;\n }", "title": "" }, { "docid": "95c9d01d5ab914b9ce40d7d32c2ce06a", "score": "0.56462085", "text": "function checkWinLoss () {\n\t\tif(gameState.displayWord.indexOf(\"_\") === -1) {\n\t\t\twonGame();\n\t\t}\n\t\tif(gameState.chances === 0) {\n\t\t\tlostGame();\n\t\t}\n\t}", "title": "" }, { "docid": "afee6fd2d11598dc6416ec7d2463621f", "score": "0.5645522", "text": "function game_over(){\n return in_checkmate() || in_stalemate() || in_draw();\n }", "title": "" }, { "docid": "c12513ab6077c1104e3fda47abd90011", "score": "0.5635478", "text": "function hitplayer(x, y) {\n\n var monster = player.level.monsters[x][y];\n if (!monster) {\n return;\n }\n\n lastnum = monster; /* killed by a ${monstername} */\n\n var damageModifier = 1; // will alway be 1 for classic Larn\n\n if (monster.matches(POLTERGEIST) || monster.matches(SPIRITNAGA)) {\n if (player.SPIRITPRO || isCarrying(OSPIRITSCARAB)) {\n if (ULARN) {\n /* spirit naga's and poltergeist's damage is halved if scarab of negate spirit */\n damageModifier = 0.5;\n } else {\n /* spirit naga's and poltergeist's do nothing if scarab of negate spirit */\n return;\n }\n }\n }\n\n if (monster.matches(VAMPIRE) || monster.matches(WRAITH) || monster.matches(ZOMBIE)) {\n if (player.UNDEADPRO || isCarrying(OCUBEofUNDEAD)) {\n if (ULARN) {\n /*\thalved if undead and cube of undead control\t*/\n damageModifier = 0.5;\n } else {\n /* do nothing */\n return;\n }\n }\n }\n\n if ((player.level.know[x][y] & KNOWHERE) == 0)\n show1cell(x, y);\n\n var bias = getDifficulty() + 1;\n hitflag = 1;\n\n cursors();\n ifblind(x, y);\n\n if (ULARN && monster.matches(LEMMING)) {\n return;\n }\n\n if (!(ULARN && monster.isDemon())) {\n if ((player.INVISIBILITY > 0) && (rnd(33) < 20)) {\n updateLog(`The ${monster} misses wildly${period}`);\n return;\n }\n }\n\n if (!(ULARN && (monster.isDemon() || monster.matches(PLATINUMDRAGON)))) {\n if ((player.CHARMCOUNT > 0) && (rnd(30) + 5 * monster.level - player.CHARISMA < 30)) {\n updateLog(`The ${monster} is awestruck at your magnificence!`);\n return;\n }\n }\n\n var dam;\n if (monster.matches(BAT)) {\n dam = 1;\n } else {\n dam = monster.damage;\n dam += rnd(((dam < 1) ? 1 : dam)) + monster.level;\n }\n\n /* demon damage is reduced if wielding Slayer */\n if (monster.isDemon() && player.WIELD && player.WIELD.matches(OSLAYER)) {\n dam = (1 - (0.1 * rnd(5)) * dam);\n }\n\n /* take damage reductions into account for ularn special artifacts */\n dam *= damageModifier;\n\n var playerHit = false;\n var lifeCount = player.LIFEPROT;\n\n if (monster.attack > 0)\n if (((dam + bias + 8) > player.AC) || (rnd(((player.AC > 0) ? player.AC : 1)) == 1)) {\n if (spattack(monster, monster.attack, x, y)) {\n // spattack returns 1 if the monster disappears (theft)\n return;\n }\n playerHit = true;\n bias -= 2;\n //cursors();\n }\n\n if (player.HP <= 0 || lifeCount != player.LIFEPROT) {\n debug('already killed');\n return;\n }\n\n if (((dam + bias) > player.AC) || (rnd(((player.AC > 0) ? player.AC : 1)) == 1)) {\n updateLog(` The ${monster} hit you${period}`);\n playerHit = true;\n if ((dam -= player.AC) < 0) dam = 0;\n if (dam > 0) {\n player.losehp(dam);\n }\n }\n if (!playerHit) updateLog(` The ${monster} missed${period}`);\n}", "title": "" }, { "docid": "ae99cd21e7e355f669441aa2e4284a85", "score": "0.5632837", "text": "function physicsCheckCrashLand(){\n if(ground === false && viewOrigin[2] <= AIRPLANE_HEIGHT && \n (velocity[2] <= -CRASH_ON_LAND_VELOCITY_THRESHOLD || \n Math.abs(getRoll()) >= CRASH_ON_LAND_ROLL_THRESHOLD || \n Math.abs(getPitch()) >= CRASH_ON_LAND_PITCH_THRESHOLD ) ){\n gameover(\"GAMEOVER! You crashed on land. Press R to restart.\");\n }\n}", "title": "" }, { "docid": "bc31b768fc6e148b1d52e13702d6e033", "score": "0.563125", "text": "function checking() {\n if(board[rover.y][rover.x] !== 'null') {\n rover.travelLog.pop();\n rover.y = rover.travelLog[rover.travelLog.length-1][0];\n rover.x = rover.travelLog[rover.travelLog.length-1][1];\n console.log('You are gonna hit something smelly yo! Try move somewhere else!');\n return;\n }\n}", "title": "" }, { "docid": "138287e06c92c03b08f7f6b524cca3b5", "score": "0.56293476", "text": "checkShoot(point) {\n if (this.turn == Player.player1) {\n return this.isHit(point, this.player2Ships);\n }\n else {\n return this.isHit(point, this.player1Ships);\n }\n }", "title": "" }, { "docid": "cbcfbd4b60e3379795cd53836686583c", "score": "0.56230587", "text": "checkShipSunk(c) {\n for (let i = 0; i < this.ships.length; i++) {\n if (this.ships[i].isHit(c)) {\n return this.ships[i].isSunk();\n }\n }\n return false;\n }", "title": "" }, { "docid": "139bf62b92cafee3c94eda91be31b84e", "score": "0.56206745", "text": "function handleRetaliate() {\r\n var canRetaliate = false;\r\n $em('Player').each(function (e, c) {\r\n // can the opposing player see you ?\r\n // is the attacker in range ?\r\n if ($em(opposer).exists() && c.hasEntity(opposer) && $em(opposer).comp('Health').current > 0) { // player has this unit...\r\n var tileKey = boc.utils.toTileKey($em(attacker).comp('MapElement'));\r\n var opposerTileRange = bbq.utils.getTilesWithinAttackRange({\r\n entityManager: em,\r\n entity: opposer,\r\n costMap: map.costMap(),\r\n costNodes: map.attackMap(),\r\n sizeX: map.numColumns(),\r\n sizeY: map.numRows(),\r\n rangeOffset: 0\r\n });\r\n\r\n if (c.visibleMapTiles.indexOf(tileKey) >= 0 && opposerTileRange.indexOf(tileKey) >= 0) {\r\n var dmg = Math.floor($em(opposer).comp('Retaliate').damage);\r\n attackRoutine(opposer, attacker, dmg, function () {\r\n state = 'cleanup';\r\n });\r\n canRetaliate = true;\r\n }\r\n }\r\n });\r\n if (canRetaliate) {\r\n state = 'retaliating';\r\n }\r\n else {\r\n state = 'cleanup';\r\n }\r\n return canRetaliate;\r\n }", "title": "" }, { "docid": "efa5304e8745ce86f2739776354023d3", "score": "0.56204706", "text": "metHole() {\r\n return this._field[this._locationY][this._locationX] == hole;\r\n }", "title": "" }, { "docid": "bbe530ab33bbace89749e95d3d535af6", "score": "0.56167024", "text": "checkComplete(){\n\t\tlet over = false;\n\t\tlet n_mine_flag = 0;\n\t\tfor (let i = 0; i < gameBoard.width; i++){\n\t\t\tfor (let j = 0; j < gameBoard.height; j++){\n\t\t\t\tif (this.n_array[i][j] == 29){\n\t\t\t\t\tn_mine_flag++;\n\t\t\t\t}\n\t\t\t\tif (this.n_array[i][j] >= 20 && this.n_array[i][j] < 29){\n\t\t\t\t\treturn over;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (n_mine_flag == gameBoard.nmines)\n\t\t{\n\t\t\tover = true;\n\t\t\treturn over;\n\t\t}\n\t}", "title": "" }, { "docid": "bf56d090bca2de08308c2e5c622eb565", "score": "0.5604563", "text": "function isGameOver() {\n for (let x in cellObj) {\n if (cellObj[x].found == false) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "be18cc103679478131ef8ddd10d6f9bc", "score": "0.55958146", "text": "function illegalPlacementNotice(dummyArray) {\n for (i=0;i<dummyArray.length;i++) {\n if(occupiedBoxArray.includes(dummyArray[i])) {\n console.log('ILLEGAL PLACEMENT')\n alert('Sorry, you may not place your ship there, as it will conflict with another ship already placed.')\n return false\n }\n } return true\n }", "title": "" }, { "docid": "26c7c199eb9aab6da01422dfa363b3ea", "score": "0.559328", "text": "function checkGameOver() {\n const cellsWithoutMines = gLevel.SIZE * gLevel.SIZE - gLevel.MINES;\n if (gGame.shownCount === cellsWithoutMines && gGame.markedCount === gLevel.MINES) {\n gameOver(true);\n } \n}", "title": "" }, { "docid": "fcc2b87805abc75efb562d47a48c2e8e", "score": "0.559199", "text": "function hit_mult_check() {\n if (mult_active) {\n if (mult_x - 10 <= 70 && mult_x + 30 >= 50) {\n if (rocket_y + 20 > mult_y - 10 && rocket_y < mult_y + 30) {\n mult_active = false;\n score_mult++;\n }\n }\n }\n}", "title": "" }, { "docid": "df860ad105c4b1f9dd3ad358fa157358", "score": "0.55906135", "text": "function checkHit(attacker, defender) {\n\n var hitRoll = roll(1, 6);\n\n if (hitRoll > defender.armor) {\n return true;\n }\n console.log(attacker.name + ' failed to hit ' + defender.name + '.');\n\n return false;\n}", "title": "" }, { "docid": "9e656b66bf62deca24454204ff9a30f0", "score": "0.55892545", "text": "function checkIfgameLost() {\n if(mistakes === maxWrong)\n alert(\"You Lost! :(\")\n }", "title": "" }, { "docid": "b618cdca270958a2179a90ff4b867cac", "score": "0.5587192", "text": "attempt() {\n return Math.random() > this.rewardThreshold;\n }", "title": "" }, { "docid": "15877a5f709c11fbf77971b2d00f5b17", "score": "0.55835193", "text": "function check_eaten() {\n for (var x = 4; x < snake.length; ++x) {\n for (var y = 0; y < snake.length; ++y) {\n if (x != y & snake[x].x == snake[y].x & snake[x].y == snake[y].y) {\n return true;\n }\n }\n }\n}", "title": "" }, { "docid": "59ee93f617bcd396de1999c7f11cbc4b", "score": "0.5572957", "text": "function isPathLoss(path) {\n let {col, row} = projectToTile(path, Tile.size / 3);\n log(\"next tile; col=\" + col + \", row=\" + row);\n return col < 0 || col >= 6 || row < 0 || row >= 6;\n}", "title": "" }, { "docid": "ca5a99c23d064a0de8b8f9782c82239f", "score": "0.55726737", "text": "takeHit( index ) {\r\n // Not been hit on that spot yet\r\n if (!this.hitSpots[index]) {\r\n // Indicate that ship's been hit on spot\r\n this.hitSpots[index] = true;\r\n\r\n // Increase hits received\r\n this.hits++;\r\n\r\n // Decrease health\r\n this.health--;\r\n return true;\r\n }\r\n\r\n // Has been hit\r\n return false;\r\n }", "title": "" }, { "docid": "b5c85343730a12238c848baaea29b4ca", "score": "0.5572138", "text": "isTied(){\n\t\tif(this.board[0] != NONE &&\n\t\t\tthis.board[1] != NONE &&\n\t\t\tthis.board[2] != NONE &&\n\t\t\tthis.board[3] != NONE &&\n\t\t\tthis.board[4] != NONE &&\n\t\t\tthis.board[5] != NONE &&\n\t\t\tthis.board[6] != NONE &&\n\t\t\tthis.board[7] != NONE &&\n\t\t\tthis.board[8] != NONE){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" } ]
40f763a9e606f00d9f81f2cd47cb2cfb
While `isCollapsed` is available on the Selection object and `collapsed` is available on the Range object, IE11 sometimes gets them wrong. If the anchor/focus nodes and offsets are the same, the range is collapsed.
[ { "docid": "75a2301c1afc1d534a498c92fd97e5b7", "score": "0.0", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n return anchorNode === focusNode && anchorOffset === focusOffset;\n}", "title": "" } ]
[ { "docid": "30e076f5dea711154ac8b724ab49d967", "score": "0.7644242", "text": "isCollapsed(range) {\n var {\n anchor,\n focus\n } = range;\n return Point.equals(anchor, focus);\n }", "title": "" }, { "docid": "d8c3fe36cef6314099f01c3277269e76", "score": "0.7555012", "text": "isCollapsed(range) {\n var {\n anchor,\n focus\n } = range;\n return Point.equals(anchor, focus);\n }", "title": "" }, { "docid": "0b0bcf902a022295f94c116ebb2ddde7", "score": "0.7342206", "text": "function isCollapsed(anchorNode,anchorOffset,focusNode,focusOffset){return anchorNode===focusNode&&anchorOffset===focusOffset}", "title": "" }, { "docid": "e337148202f519f22eef1e850d1b8abb", "score": "0.7329955", "text": "function isCollapsed() {\n var rgs = ranges();\n\n for (var i = 0; i < rgs.length; i++) {\n if (!rgs[i].collapsed) {\n return false;\n }\n }\n\n return true;\n } // From: http://www.coderexception.com/0B1B33z1NyQxUQSJ/contenteditable-div-how-can-i-determine-if-the-cursor-is-at-the-start-or-end-of-the-content", "title": "" }, { "docid": "53e39114d1b323dbb033bed0fb8b0623", "score": "0.7303941", "text": "function isCollapsed(anchorNode,anchorOffset,focusNode,focusOffset){return anchorNode===focusNode&&anchorOffset===focusOffset;}", "title": "" }, { "docid": "e5ccd34ab7d20d6c71bd2cd44a1f4451", "score": "0.71962905", "text": "function isCollapsed(selection) {\n\treturn Doc.positionEqual(selection.anchor, selection.focus);\n}", "title": "" }, { "docid": "5c6f75bd29ebe2db1b3581fd03c1fe2c", "score": "0.70573264", "text": "function isCollapsedRange(range) {\n return range.pos === range.end;\n }", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "6449a5f088a4f078e15d6a6ae4c28339", "score": "0.7013318", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n\t return anchorNode === focusNode && anchorOffset === focusOffset;\n\t}", "title": "" }, { "docid": "bbef3408c7e0c6c8a814e474bc9692b6", "score": "0.69981396", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n return anchorNode === focusNode && anchorOffset === focusOffset;\n }", "title": "" }, { "docid": "bbef3408c7e0c6c8a814e474bc9692b6", "score": "0.69981396", "text": "function isCollapsed(anchorNode, anchorOffset, focusNode, focusOffset) {\n return anchorNode === focusNode && anchorOffset === focusOffset;\n }", "title": "" } ]
0428b7b9c857f724dbf912ffc67e23ec
This sample demonstrates how to Updates tags of a Security Partner Provider resource.
[ { "docid": "3b7835e597287b45dbbf28c303dcb271", "score": "0.8075357", "text": "async function updateSecurityPartnerProviderTags() {\n const credential = new DefaultAzureCredential();\n const client = createNetworkManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rg1\";\n const securityPartnerProviderName = \"securityPartnerProvider\";\n const options = {\n body: { tags: { tag1: \"value1\", tag2: \"value2\" } },\n queryParameters: { \"api-version\": \"2022-05-01\" },\n };\n const result = await client\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/securityPartnerProviders/{securityPartnerProviderName}\",\n subscriptionId,\n resourceGroupName,\n securityPartnerProviderName\n )\n .patch(options);\n console.log(result);\n}", "title": "" } ]
[ { "docid": "3426e08c3a6c1623d9564152945687d4", "score": "0.58738506", "text": "function updateTechnologyProvider(id, body, scb, fcb) {\n request('PUT', '/technologyProviders/' + id, getHeaders(true), body, scb, fcb);\n }", "title": "" }, { "docid": "cf819e1366f471e5d142781935239339", "score": "0.55510324", "text": "function applytags(tags,resources){\n if(tags.length > 0){\n var tagparrams = {\n Resources: resources,\n Tags: tags\n };\n ec2.createTags(tagparrams, function(err, data) {\n if (err) {\n console.log('Tag Error: ', err);\n context.fail('Tag Error: ', err );\n } else {\n //console.log(data);\n return data\n };\n });\n } else {\n var tagparrams = {\n Resources: resources\n };\n ec2.deleteTags(tagparrams, function(err, data) {\n if (err) {\n console.log('Tag Error: ', err);\n context.fail('Tag Error: ', err );\n } else {\n //console.log(data);\n return data\n };\n });\n }; \n }", "title": "" }, { "docid": "362f74791d0ad2eb2ca7ea76ef88151e", "score": "0.554762", "text": "function addTags(resourceName, tags, callback){\n //console.log(\"resourceName: \", resourceName);\n var query = Resource.find({name: resourceName}).limit(1);\n query.exec(function(err, resource){\n if(err){\n callback(err, null);\n }else{\n //console.log(\"resource: \", resource);\n resource = resource[0];\n //var resourceTags = resource.tags;\n resource.tags = resource.tags.concat(tags);\n resource.markModified('tags');\n resource.save(function(){\n callback(null, \"success\");\n });\n }\n });\n}", "title": "" }, { "docid": "101bb1b80c8a17c5acbc626e82ba14d9", "score": "0.5495699", "text": "async function updateAnExtensionResource() {\n const subscriptionId = \"0de7f055-dbea-498d-8e9e-da287eedca90\";\n const resourceGroupName = \"VS-Example-Group\";\n const accountResourceName = \"ExampleAccount\";\n const extensionResourceName = \"Example\";\n const body = {\n location: \"Central US\",\n plan: {\n name: \"ExamplePlan\",\n product: \"ExampleExtensionName\",\n promotionCode: \"\",\n publisher: \"ExampleExtensionPublisher\",\n version: \"1.0\",\n },\n properties: {},\n tags: {},\n };\n const credential = new DefaultAzureCredential();\n const client = new VisualStudioResourceProviderClient(credential, subscriptionId);\n const result = await client.extensions.update(\n resourceGroupName,\n accountResourceName,\n extensionResourceName,\n body\n );\n console.log(result);\n}", "title": "" }, { "docid": "3979ca2f159a04445a0545446a1447f8", "score": "0.5350364", "text": "function serviceUpdateModelTags(req, resp) {\n\t\tlogger.info(\"<Service> UpdateModelTags.\");\n\t\tvar reqData = parseRequest(req, ['id', 'tags']);\n\t\t\n\t\twriteHeaders(resp);\n\t\thasPermissionModel(true, req.user, reqData.id, function(permOk) {\n\t\t\tif (permOk) {\n\t\t\t\tupdateModelTags(reqData.id, reqData.tags, function(err, status) {\n\t\t\t\t\tif (err) error(2, resp);\n\t\t\t\t\telse resp.end(JSON.stringify({ status: status })); \n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\terror(3, resp);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "251ff085f8b8757a38493ac354d98215", "score": "0.52731174", "text": "async setTags(tags2, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-setTags\", options);\n try {\n return await this.blobContext.setTags(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)), { tags: toBlobTags(tags2) }));\n } catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message\n });\n throw e;\n } finally {\n span.end();\n }\n }", "title": "" }, { "docid": "aaf76b24047b715eb12d334d0c6bbac1", "score": "0.5250402", "text": "function changeTags(ropen, rclose) {\n\t\trtags = Sparky.render(rtagstemplate, arguments);\n\t\trsimpletags = Sparky.render(rsimpletagstemplate, arguments);\n\t\trclasstags = Sparky.render(rclasstagstemplate, arguments);\n\t}", "title": "" }, { "docid": "4d8c557b447208594e3e7ec3820d0e84", "score": "0.51422954", "text": "async function updateResource() {\n const subscriptionId =\n process.env[\"RECOVERYSERVICES_SUBSCRIPTION_ID\"] || \"77777777-b0c6-47a2-b37c-d8e65a629c18\";\n const resourceGroupName = process.env[\"RECOVERYSERVICES_RESOURCE_GROUP\"] || \"HelloWorld\";\n const vaultName = \"swaggerExample\";\n const vault = { tags: { patchKey: \"PatchKeyUpdated\" } };\n const credential = new DefaultAzureCredential();\n const client = new RecoveryServicesClient(credential, subscriptionId);\n const result = await client.vaults.beginUpdateAndWait(resourceGroupName, vaultName, vault);\n console.log(result);\n}", "title": "" }, { "docid": "831ed290ad076416b3ac23bcc081983d", "score": "0.50992984", "text": "async function updateConnectionMonitorTags() {\n const credential = new DefaultAzureCredential();\n const client = createNetworkManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rg1\";\n const networkWatcherName = \"nw1\";\n const connectionMonitorName = \"cm1\";\n const options = {\n body: { tags: { tag1: \"value1\", tag2: \"value2\" } },\n queryParameters: { \"api-version\": \"2022-05-01\" },\n };\n const result = await client\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}\",\n subscriptionId,\n resourceGroupName,\n networkWatcherName,\n connectionMonitorName\n )\n .patch(options);\n console.log(result);\n}", "title": "" }, { "docid": "9fc357e08eaa35ac32d2623082c1952d", "score": "0.50869155", "text": "async function serviceRunnersCreateOrUpdate() {\n const subscriptionId = \"{subscriptionId}\";\n const resourceGroupName = \"resourceGroupName\";\n const labName = \"{devtestlabName}\";\n const name = \"{servicerunnerName}\";\n const serviceRunner = {\n identity: {\n type: \"{identityType}\",\n clientSecretUrl: \"{identityClientSecretUrl}\",\n principalId: \"{identityPrincipalId}\",\n tenantId: \"{identityTenantId}\",\n },\n location: \"{location}\",\n tags: { tagName1: \"tagValue1\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new DevTestLabsClient(credential, subscriptionId);\n const result = await client.serviceRunners.createOrUpdate(\n resourceGroupName,\n labName,\n name,\n serviceRunner\n );\n console.log(result);\n}", "title": "" }, { "docid": "11429df02a506f09b84366b9756d756c", "score": "0.5083487", "text": "editIntegrationServerAuthProvider (providerId, key, value) {\n console.log('editIntegrationServerAuthProvider:', providerId, key);\n let user = Auth.requireAuthentication();\n \n // Validate the data is complete\n check(providerId, String);\n check(key, String);\n check(value, Match.Any);\n \n // Get the server record to make sure this is authorized\n let server = IntegrationServerAuthProviders.findOne(providerId);\n \n // Validate that the current user is an administrator\n if (user.isAdmin()) {\n if (server) {\n let update = {};\n update[ key ] = value;\n \n // Update the contributor\n IntegrationServerAuthProviders.update(providerId, { $set: update });\n \n // Fetch the provider record\n let provider = IntegrationServerAuthProviders.findOne(providerId);\n \n // Update the serviceConfiguration if it's enabled\n if (provider.isEnabled) {\n console.log('editIntegrationServerAuthProvider updating auth provider:', provider._id, provider.authServiceKey, provider.loginFunctionName);\n try {\n let update = { $set: provider.compileAuthConfig() };\n \n ServiceConfiguration.configurations.upsert({\n service: provider.authServiceKey\n }, update);\n } catch (e) {\n console.error('editIntegrationServerAuthProvider failed to update provider:', provider._id, provider.authServiceKey, provider.loginFunctionName, e);\n }\n } else if (key === 'isEnabled' && value === false) {\n console.log('editIntegrationServerAuthProvider removing auth provider:', provider._id, provider.authServiceKey, provider.loginFunctionName);\n ServiceConfiguration.configurations.remove({\n service: provider.authServiceKey\n });\n }\n } else {\n throw new Meteor.Error(404);\n }\n } else {\n console.error('Non-admin user tried to edit an integration server auth provider:', user.username, key, value, providerId);\n throw new Meteor.Error(403);\n }\n }", "title": "" }, { "docid": "f33a4b90e552a152a90813a7704619de", "score": "0.50816375", "text": "async function approveOrRejectPrivateEndPointConnectionForAPrivateLinkService() {\n const credential = new DefaultAzureCredential();\n const client = createNetworkManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rg1\";\n const serviceName = \"testPls\";\n const peConnectionName = \"testPlePeConnection\";\n const options = {\n body: {\n name: \"testPlePeConnection\",\n properties: {\n privateEndpoint: {\n id: \"/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testPe\",\n },\n privateLinkServiceConnectionState: {\n description: \"approved it for some reason.\",\n status: \"Approved\",\n },\n },\n },\n queryParameters: { \"api-version\": \"2022-05-01\" },\n };\n const result = await client\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateLinkServices/{serviceName}/privateEndpointConnections/{peConnectionName}\",\n subscriptionId,\n resourceGroupName,\n serviceName,\n peConnectionName\n )\n .put(options);\n console.log(result);\n}", "title": "" }, { "docid": "6e6b443dbf97650c2577ed17346411e4", "score": "0.5057128", "text": "updateTagRequest(tagId, data) {\n $.ajax({\n url: urlConfig.tagURL.getOne(tagId),\n method: \"PUT\",\n data: data,\n crossDomain: true,\n success: function() {\n noty({ text: 'tag is updated', type: 'success' });\n $(`.tag[data-tag-id='${tagId}']`).find(\".tag__title\").text(data.title);\n $(`.simple-tags__item[data-tag-id='${tagId}']`).text(data.title);\n },\n error: function() {\n noty({ text: 'updating error', type: 'error'});\n }\n })\n}", "title": "" }, { "docid": "ff6e5387e4f6e0bf518b3f1b3e76a22b", "score": "0.5019704", "text": "async function updateResourceWithUserAssignedIdentity() {\n const subscriptionId =\n process.env[\"RECOVERYSERVICES_SUBSCRIPTION_ID\"] || \"77777777-b0c6-47a2-b37c-d8e65a629c18\";\n const resourceGroupName = process.env[\"RECOVERYSERVICES_RESOURCE_GROUP\"] || \"HelloWorld\";\n const vaultName = \"swaggerExample\";\n const vault = {\n identity: {\n type: \"UserAssigned\",\n userAssignedIdentities: {\n \"/subscriptions/85bf5e8c30844f42Add2746ebb7e97b2/resourcegroups/defaultrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplemsi\":\n {},\n },\n },\n tags: { patchKey: \"PatchKeyUpdated\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new RecoveryServicesClient(credential, subscriptionId);\n const result = await client.vaults.beginUpdateAndWait(resourceGroupName, vaultName, vault);\n console.log(result);\n}", "title": "" }, { "docid": "22d24fdd703a17e11d954e0091dd6f1c", "score": "0.50150794", "text": "function update(username, password){\n var attributeList = [];\n attributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({\n Name: \"custom:scope\",\n Value: \"some new value\"\n }));\n attributeList.push(new AmazonCognitoIdentity.CognitoUserAttribute({\n Name: \"name\",\n Value: \"some new value\"\n }));\n \n var authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({\n Username: username,\n Password: password,\n });\n\n var userData = {\n Username: username,\n Pool: userPool\n };\n var cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);\n\n cognitoUser.updateAttributes(attributeList, (err, result) => {\n if (err) {\n //handle error\n } else {\n console.log(result);\n }\n });\n}", "title": "" }, { "docid": "e06d77f1ae3e5acbda966922e22012aa", "score": "0.5006871", "text": "async function updateResourceWithCustomerManagedKeys2() {\n const subscriptionId =\n process.env[\"RECOVERYSERVICES_SUBSCRIPTION_ID\"] || \"77777777-b0c6-47a2-b37c-d8e65a629c18\";\n const resourceGroupName = process.env[\"RECOVERYSERVICES_RESOURCE_GROUP\"] || \"HelloWorld\";\n const vaultName = \"swaggerExample\";\n const vault = {\n identity: { type: \"SystemAssigned\" },\n properties: {\n encryption: { kekIdentity: { useSystemAssignedIdentity: true } },\n },\n tags: { patchKey: \"PatchKeyUpdated\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new RecoveryServicesClient(credential, subscriptionId);\n const result = await client.vaults.beginUpdateAndWait(resourceGroupName, vaultName, vault);\n console.log(result);\n}", "title": "" }, { "docid": "bf2be0dce3626f3ec91667ecc2c34f6c", "score": "0.50015485", "text": "async function virtualHubUpdate() {\n const credential = new DefaultAzureCredential();\n const client = createNetworkManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rg1\";\n const virtualHubName = \"virtualHub2\";\n const options = {\n body: { tags: { key1: \"value1\", key2: \"value2\" } },\n queryParameters: { \"api-version\": \"2022-05-01\" },\n };\n const result = await client\n .path(\n \"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}\",\n subscriptionId,\n resourceGroupName,\n virtualHubName\n )\n .patch(options);\n console.log(result);\n}", "title": "" }, { "docid": "39822f1c7b0e16aa0eca42ae05f76ade", "score": "0.4968464", "text": "function removeTags(resourceName, tags, callback){\n var query = Resource.find({name: resourceName}).limit(1);\n query.exec(function(err, resource){\n if(err){\n callback(err, null)\n }else{\n resource = resource[0];\n var tempArray = resource.tags;\n for(var i=0;i<resource.tags.length;i++){\n if(resource.tags.indexOf(tags[i]) > -1){ //if a tag we're removing is in our resource array of tags\n //remove that tag\n resource.tags.splice(resource.tags.indexOf(tags[i]),1); //removes that tag from the array\n i--;\n }\n }\n resource.markModified('tags');\n resource.save(function(err){\n if(err){\n callback(err,null);\n }\n else{\n callback(null, \"success\");\n }\n\n })\n }\n\n\n });\n}", "title": "" }, { "docid": "0b993c67e91d763dd928c7208ecd83ea", "score": "0.4940419", "text": "updateTag() {\n this.payload.id = this.tagEditing.id;\n this.payload.count = this.tagEditing.count;\n axios.post('/admin/tags?handler=update', this.payload, this.$root.headers)\n .then(resp => {\n this.closeDialog();\n // replace\n let idx = this.tags.findIndex(c => c.id === resp.data.id);\n this.tags[idx] = resp.data;\n // sort\n this.sortTags();\n this.$root.toast('Tag updated.');\n })\n .catch(err => {\n this.errMsg = err.response.data;\n this.$root.toastError('Update tag failed.');\n });\n }", "title": "" }, { "docid": "6c6c76b10b9e03e15ae63919e3f29916", "score": "0.49121553", "text": "setTags(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec);\n }", "title": "" }, { "docid": "a8ab4122046e2f495ffe13a04146335c", "score": "0.48897693", "text": "function setTags(tags) {\n callOnHub('setTags', tags);\n}", "title": "" }, { "docid": "86fd647b4a72119eb04ec9bb17497b13", "score": "0.48586923", "text": "function updateServProviderName(reqNo, phone, providerName) {\r\n $(`#${phone}-serv-${reqNo}`).html(providerName);\r\n}", "title": "" }, { "docid": "aa8b33061ed5b6bf264b97a05a2b122f", "score": "0.4793352", "text": "static async updateTags(productTags, body, params, ProductTag) {\n // get list of current tag_ids\n const productTagIds = productTags.map(({ tag_id }) => tag_id);\n\n // create filtered list of new tag_ids\n const newProductTags = body.tagIds\n .filter((tag_id) => !productTagIds.includes(tag_id))\n .map((tag_id) => {\n return {\n product_id: parseInt(params.id),\n tag_id,\n };\n });\n\n // if Product currently has 1 or more tags\n if (productTags.length > 0) {\n // figure out which ones to remove\n const productTagsToRemove = productTags\n .filter(({ tag_id }) => !body.tagIds.includes(tag_id))\n .map(({ id }) => id);\n\n // run both actions\n const promise = await Promise.all([\n ProductTag.destroy({ where: { id: productTagsToRemove } }),\n ProductTag.bulkCreate(newProductTags)\n ]);\n return {\n deleted: promise[0],\n created: promise[1]\n };\n }\n\n const promise = await ProductTag.bulkCreate(newProductTags)\n return {created: promise};\n }", "title": "" }, { "docid": "3510a907c99e36ae523722b519eaed53", "score": "0.47594583", "text": "_createOrUpdateResourcesStack() {\n\n const projectName = S.getProject().getName(),\n stage = this.evt.options.stage,\n region = this.evt.options.region,\n aws = S.getProvider('aws'),\n stackName = S.getProject().getRegion(stage, region).getVariables().resourcesStackName || aws.getResourcesStackName(stage, projectName);\n\n // CF Params\n let params = {\n Capabilities: [\n 'CAPABILITY_IAM'\n ],\n Parameters: [],\n TemplateBody: JSON.stringify(this.cfTemplate)\n };\n\n // Helper function to create Stack\n let createStack = () => {\n\n params.Tags = [{\n Key: 'STAGE',\n Value: stage\n }];\n\n params.StackName = stackName;\n params.OnFailure = 'DELETE';\n return aws.request('CloudFormation', 'createStack', params, stage, region);\n };\n\n // Check to see if Stack Exists\n return aws.request('CloudFormation', 'describeStackResources', {StackName: stackName}, stage, region)\n .then(function(data) {\n\n params.StackName = stackName;\n\n // Update stack\n return aws.request('CloudFormation', 'updateStack', params, stage, region)\n })\n .catch(function(e) {\n\n // No updates are to be performed\n if (e.message == 'No updates are to be performed.') {\n return 'No resource updates are to be performed.';\n }\n\n // If does not exist, create stack\n if (e.message.indexOf('does not exist') > -1) {\n return createStack();\n }\n\n // Otherwise throw another error\n throw new SError(e.message);\n });\n }", "title": "" }, { "docid": "62a6a5d78265f64a3f4f7c7a99a15198", "score": "0.47578743", "text": "function setTags(tags) {\r\n callOnHub('setTags', tags);\r\n }", "title": "" }, { "docid": "5dce2d44d91d4461eb60cf3159de56c3", "score": "0.47285163", "text": "async function tagPR(context, prs, tag) {\n const color = '2196F3'\n // if tag is not exist then we will create it.\n await lableutil.ensureLabelExists(context, tag, color)\n prs.forEach(async (pr) => {\n const { number } = pr\n await context.github.issues.addLabels(context.repo({\n number: number,\n labels: [tag]\n }))\n })\n}", "title": "" }, { "docid": "02a750f16f701f4ec69518d770948ca6", "score": "0.47062454", "text": "async function controllersUpdate() {\n const subscriptionId = \"00000000-0000-0000-0000-000000000000\";\n const resourceGroupName = \"myResourceGroup\";\n const name = \"myControllerResource\";\n const controllerUpdateParameters = {\n tags: { key: \"value\" },\n targetContainerHostCredentialsBase64: \"QmFzZTY0IEVuY29kZWQgVmFsdWUK\",\n };\n const credential = new DefaultAzureCredential();\n const client = new DevSpacesManagementClient(credential, subscriptionId);\n const result = await client.controllers.update(\n resourceGroupName,\n name,\n controllerUpdateParameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "6a90ba3e4e5ae0125f5535bf9a1be16a", "score": "0.46638685", "text": "async function dpsUpdate() {\n const subscriptionId =\n process.env[\"DEVICEPROVISIONINGSERVICES_SUBSCRIPTION_ID\"] ||\n \"91d12660-3dec-467a-be2a-213b5544ddc0\";\n const resourceGroupName =\n process.env[\"DEVICEPROVISIONINGSERVICES_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const provisioningServiceName = \"myFirstProvisioningService\";\n const iotDpsDescription = {\n identity: {\n type: \"SystemAssigned,UserAssigned\",\n userAssignedIdentities: {\n \"/subscriptions/91d126603dec467aBe2a213b5544ddc0/resourcegroups/testrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/testidentity\":\n {},\n },\n },\n location: \"East US\",\n properties: { enableDataResidency: false },\n sku: { name: \"S1\", capacity: 1 },\n tags: {},\n };\n const credential = new DefaultAzureCredential();\n const client = new IotDpsClient(credential, subscriptionId);\n const result = await client.iotDpsResource.beginCreateOrUpdateAndWait(\n resourceGroupName,\n provisioningServiceName,\n iotDpsDescription\n );\n console.log(result);\n}", "title": "" }, { "docid": "beae75573333b8d4459e26b3ffcf3d0c", "score": "0.4646519", "text": "function updateTagList(){\n $('#tagList').find('ul').first().html(\"\");\n $(tags).each(function () {\n var opt = '<li class=\"list-group-item\" data-id=\"' + this.id + '\">' + this.title + '</li>';\n $('#tagList').find('ul').first().append(opt);\n });\n addTagListListener();\n }", "title": "" }, { "docid": "0541d1d13d370b376e604a17118d105a", "score": "0.46422094", "text": "invokeUpdate(tags){\n this.state.tags = tags;\n this.setState(this.state);\n }", "title": "" }, { "docid": "ccace42fae4d7cef72a1e707ee51fc5b", "score": "0.46320656", "text": "function addRating(newrating, objId){\n console.log('from service newrating ' + newrating + 'and objId'+ objId );\n return $http ({\n // url : `${eventURL}/${objId}`,\n url : eventURL+'/'+objId,\n method : 'PUT',\n data:{ratings : newrating},\n headers : PARSE.CONFIG.headers\n });\n }", "title": "" }, { "docid": "d02ec54b5499d686bab247024b9f3506", "score": "0.46308503", "text": "function addTagsToMeetup(req, res) {\n\t// Validation\n\tconst { error } = validator.validateTags(req.body);\n\tif (error) {\n\t\tres.status(400).json({\n\t\t\tstatus: 400,\n\t\t\terror: error.details[0].message\n\t\t});\n\t\treturn;\n\t}\n\tconst { id } = { id: req.params.id };\n\t// Fetch meetup to update\n\tconst meetup = models.meetups.find(m => m.id === parseInt(id, 10));\n\tif (!meetup) {\n\t\tres.status(404).json({\n\t\t\tstatus: 404,\n\t\t\terror: 'The meetup you are trying to update does not exist.'\n\t\t});\n\t\treturn;\n\t}\n\tconst {\ttags } = req.body;\n\tconst newTags = tags.split(', ');\n\t// Update meetup\n\tmeetup.tags = meetup.tags.concat(newTags);\n\tres.json({\n\t\tstatus: 200,\n\t\tdata: {\n\t\t\tmeetup: meetup.id,\n\t\t\ttopic: meetup.topic,\n\t\t\ttags: meetup.tags\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7ada03a5814d9206792e2db38ee6ff58", "score": "0.46245778", "text": "async function sapVirtualInstancesUpdate() {\n const subscriptionId = \"8e17e36c-42e9-4cd5-a078-7b44883414e0\";\n const resourceGroupName = \"test-rg\";\n const sapVirtualInstanceName = \"X00\";\n const body = {\n identity: { type: \"None\" },\n tags: { key1: \"svi1\" },\n };\n const options = { body };\n const credential = new DefaultAzureCredential();\n const client = new WorkloadsClient(credential, subscriptionId);\n const result = await client.sAPVirtualInstances.update(\n resourceGroupName,\n sapVirtualInstanceName,\n options\n );\n console.log(result);\n}", "title": "" }, { "docid": "76e8140d0dc071bfda558be7eaa83f06", "score": "0.46108797", "text": "function setTag(key, value) {\n callOnHub('setTag', key, value);\n}", "title": "" }, { "docid": "95e85321a81322061647d1e7825963f1", "score": "0.46075118", "text": "async function updateResourceWithCustomerManagedKeys3() {\n const subscriptionId =\n process.env[\"RECOVERYSERVICES_SUBSCRIPTION_ID\"] || \"77777777-b0c6-47a2-b37c-d8e65a629c18\";\n const resourceGroupName = process.env[\"RECOVERYSERVICES_RESOURCE_GROUP\"] || \"HelloWorld\";\n const vaultName = \"swaggerExample\";\n const vault = {\n identity: {\n type: \"UserAssigned\",\n userAssignedIdentities: {\n \"/subscriptions/85bf5e8c30844f42Add2746ebb7e97b2/resourcegroups/defaultrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplemsi\":\n {},\n },\n },\n properties: {\n encryption: {\n keyVaultProperties: {\n keyUri: \"https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3\",\n },\n },\n },\n tags: { patchKey: \"PatchKeyUpdated\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new RecoveryServicesClient(credential, subscriptionId);\n const result = await client.vaults.beginUpdateAndWait(resourceGroupName, vaultName, vault);\n console.log(result);\n}", "title": "" }, { "docid": "5a3238f624fad01972f6053f025ea72f", "score": "0.4603626", "text": "function updateTagsElement(newTags) {\n var Obj = document.getElementById(\"wallabag-tag-list\");\n Obj.outerHTML = newTags;\n}", "title": "" }, { "docid": "4a006ef88b85b97e7bfb6dd8f436cde1", "score": "0.45663834", "text": "async function updateResourceWithCustomerManagedKeys() {\n const subscriptionId =\n process.env[\"RECOVERYSERVICES_SUBSCRIPTION_ID\"] || \"77777777-b0c6-47a2-b37c-d8e65a629c18\";\n const resourceGroupName = process.env[\"RECOVERYSERVICES_RESOURCE_GROUP\"] || \"HelloWorld\";\n const vaultName = \"swaggerExample\";\n const vault = {\n identity: {\n type: \"UserAssigned\",\n userAssignedIdentities: {\n \"/subscriptions/85bf5e8c30844f42Add2746ebb7e97b2/resourcegroups/defaultrg/providers/MicrosoftManagedIdentity/userAssignedIdentities/examplemsi\":\n {},\n },\n },\n properties: {\n encryption: {\n infrastructureEncryption: \"Enabled\",\n kekIdentity: {\n userAssignedIdentity:\n \"/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi\",\n },\n keyVaultProperties: {\n keyUri: \"https://cmk2xkv.vault.azure.net/keys/Key1/0767b348bb1a4c07baa6c4ec0055d2b3\",\n },\n },\n },\n tags: { patchKey: \"PatchKeyUpdated\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new RecoveryServicesClient(credential, subscriptionId);\n const result = await client.vaults.beginUpdateAndWait(resourceGroupName, vaultName, vault);\n console.log(result);\n}", "title": "" }, { "docid": "c40ad610159bc836a0984de1c78f7628", "score": "0.45549747", "text": "async function getTagsOnAResource() {\n const subscriptionId =\n process.env[\"RESOURCES_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const scope =\n \"subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd/resourcegroups/myResourceGroup/providers/myPRNameSpace/VM/myVm\";\n const credential = new DefaultAzureCredential();\n const client = new ResourceManagementClient(credential, subscriptionId);\n const result = await client.tagsOperations.getAtScope(scope);\n console.log(result);\n}", "title": "" }, { "docid": "70576cbe9b2af776707e669028dec3a6", "score": "0.45489633", "text": "function multiActivityRsvpUpdates(pusherKey){\n var pusher = new Pusher(pusherKey);\n\n var multiActivityChannel = pusher.subscribe(\"multi-activity-channel\");\n multiActivityChannel.bind('create-rsvp', function(res) {\n if(res.is_friend === true){\n $(\"#people-\"+res.event_id).prepend(fbProfileImage(res.photo_url,res.is_friend,res.full_name).attr('id','attendee-'+res.uid)).hide().fadeIn('slow');\n }else{\n $(\"#people-\"+res.event_id).append(fbProfileImage(res.photo_url,res.is_friend,res.full_name).attr('id','attendee-'+res.uid)).hide().fadeIn('slow');\n }\n incrementAttendeesCount(res.event_id)\n })\n\n multiActivityChannel.bind('remove-rsvp', function(res) {\n $(\"#people-\"+res.event_id+\" \"+\"#attendee-\"+res.uid).fadeOut(300, function(){\n $(this).remove();\n });\n decrementAttendeesCount(res.event_id)\n })\n\n}", "title": "" }, { "docid": "6c1a893fc9dfda3d5912df24d9052ab8", "score": "0.45444614", "text": "async function storageAccountPutPrivateEndpointConnection() {\n const subscriptionId = process.env[\"STORAGE_SUBSCRIPTION_ID\"] || \"{subscription-id}\";\n const resourceGroupName = process.env[\"STORAGE_RESOURCE_GROUP\"] || \"res7687\";\n const accountName = \"sto9699\";\n const privateEndpointConnectionName = \"{privateEndpointConnectionName}\";\n const properties = {\n privateLinkServiceConnectionState: {\n description: \"Auto-Approved\",\n status: \"Approved\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new StorageManagementClient(credential, subscriptionId);\n const result = await client.privateEndpointConnections.put(\n resourceGroupName,\n accountName,\n privateEndpointConnectionName,\n properties\n );\n console.log(result);\n}", "title": "" }, { "docid": "b59707583e33a4e3e08a9a1737ce8b6e", "score": "0.4540044", "text": "setTags(tags) {\n let newContext = new EventMessage_1.EventTraceMetadata(this.getContext());\n for (let key in tags) {\n newContext.tags[key] = tags[key];\n }\n this.spanContext = Object.freeze(new EventMessage_1.EventTraceMetadata(newContext));\n return this;\n }", "title": "" }, { "docid": "3720eb60ca0f19f16d64d3f7452cba1d", "score": "0.45320654", "text": "function changeTags(entityIDs, changed, onInput) {\n\n var actions = [];\n for (var i in entityIDs) {\n var entityID = entityIDs[i];\n var entity = context.entity(entityID);\n\n var tags = Object.assign({}, entity.tags); // shallow copy\n\n for (var k in changed) {\n if (!k) continue;\n var v = changed[k];\n if (v !== undefined || tags.hasOwnProperty(k)) {\n tags[k] = v;\n }\n }\n\n if (!onInput) {\n tags = utilCleanTags(tags);\n }\n\n if (!deepEqual(entity.tags, tags)) {\n actions.push(actionChangeTags(entityID, tags));\n }\n }\n\n if (actions.length) {\n var combinedAction = function(graph) {\n actions.forEach(function(action) {\n graph = action(graph);\n });\n return graph;\n };\n=======\n\n function manageSection(klass, shouldHave, update, create) {\n var section = body.selectAll('.' + klass.split(' ')[0])\n .data(shouldHave ? [0] : []);\n\n section.exit().remove();\n\n var sectionEnter = section.enter()\n .append('div')\n .attr('class', klass);\n\n if (create && !sectionEnter.empty()) {\n create(sectionEnter);\n }\n\n section = sectionEnter\n .merge(section);\n\n if (update && !section.empty()) {\n update(section);\n }\n }\n\n manageSection('selection-list', _entityIDs.length > 1, function(section) {\n section\n .call(selectionList\n .setSelectedIDs(_entityIDs)\n );\n });\n\n manageSection('preset-list-item inspector-inner', entityID, function(section) {\n\n if (_presetFavorite) {\n section.selectAll('.preset-list-button-wrap .accessory-buttons')\n .call(_presetFavorite.button);\n }\n\n // update header\n if (_tagReference) {\n section.selectAll('.preset-list-button-wrap .accessory-buttons')\n .call(_tagReference.button);\n\n section.selectAll('.preset-list-item')\n .call(_tagReference.body);\n }\n\n section.selectAll('.preset-reset')\n .on('click', function() {\n if (presetBrowser.isShown()) {\n presetBrowser.hide();\n } else {\n presetBrowser.setAllowedGeometry([context.geometry(entityID)]);\n presetBrowser.show();\n }\n })\n .on('mousedown', function() {\n d3_event.preventDefault();\n d3_event.stopPropagation();\n })\n .on('mouseup', function() {\n d3_event.preventDefault();\n d3_event.stopPropagation();\n });\n\n section.select('.preset-list-item button')\n .call(uiPresetIcon(context)\n .geometry(context.geometry(entityID))\n .preset(_activePreset)\n .pointMarker(false)\n );\n\n // NOTE: split on en-dash, not a hypen (to avoid conflict with hyphenated names)\n var label = section.select('.label-inner');\n var nameparts = label.selectAll('.namepart')\n .data(_activePreset.name().split(' – '), function(d) { return d; });\n\n nameparts.exit()\n .remove();\n\n nameparts\n .enter()\n .append('div')\n .attr('class', 'namepart')\n .text(function(d) { return d; });\n\n }, function(sectionEnter) {\n\n var presetButtonWrap = sectionEnter\n .append('div')\n .attr('class', 'preset-list-button-wrap');\n\n var presetButton = presetButtonWrap.append('button')\n .attr('class', 'preset-list-button preset-reset')\n .call(tooltip().title(t('inspector.back_tooltip')).placement('bottom'));\n\n presetButton\n .append('div')\n .attr('class', 'label')\n .append('div')\n .attr('class', 'label-inner');\n\n presetButtonWrap.append('div')\n .attr('class', 'accessory-buttons');\n\n presetButtonWrap\n .call(presetBrowser.scrollContainer(body));\n\n // start with the preset browser open if the feature is new and untagged\n if (_newFeature && !entity.hasNonGeometryTags()) {\n presetBrowser.setAllowedGeometry([context.geometry(entityID)]);\n presetBrowser.show();\n }\n\n });\n\n manageSection('entity-issues', entityID, function(section) {\n section\n .call(entityIssues\n .entityID(entityID)\n );\n });\n\n manageSection('preset-editor', entityID, function(section) {\n section\n .call(presetEditor\n .preset(_activePreset)\n .entityID(entityID)\n .tags(tags)\n .state(_state)\n );\n });\n\n manageSection('raw-tag-editor inspector-inner', true, function(section) {\n section\n .call(rawTagEditor\n .preset(_activePreset)\n .entityIDs(_entityIDs)\n .state(_state)\n );\n });\n\n manageSection('raw-member-editor inspector-inner', entity && entity.type === 'relation', function(section) {\n section\n .call(rawMemberEditor\n .entityID(entityID)\n );\n });\n\n manageSection('raw-membership-editor inspector-inner', entityID, function(section) {\n section\n .call(rawMembershipEditor\n .entityID(entityID)\n );\n });\n\n manageSection('key-trap-wrap', true, function(section) {\n section.select('key-trap')\n .on('keydown.key-trap', function() {\n // On tabbing, send focus back to the first field on the inspector-body\n // (probably the `name` field) #4159\n if (d3_event.keyCode === 9 && !d3_event.shiftKey) {\n d3_event.preventDefault();\n body.select('input').node().focus();\n }\n });\n }, function(sectionEnter) {\n sectionEnter\n .append('input')\n .attr('type', 'text')\n .attr('class', 'key-trap');\n });\n\n var footer = selection.selectAll('.inspector-footer')\n .data([0]);\n\n footer = footer.enter()\n .append('div')\n .attr('class', 'inspector-footer')\n .merge(footer);\n\n footer\n .call(uiViewOnOSM(context)\n .what(entityID && context.hasEntity(entityID))\n );\n>>>>>>> af4ea2c4ddd394e18be57c4998a7860f8e535444\n\n var annotation = t('operations.change_tags.annotation');\n\n<<<<<<< HEAD\n if (_coalesceChanges) {\n context.overwrite(combinedAction, annotation);\n } else {\n context.perform(combinedAction, annotation);\n _coalesceChanges = !!onInput;\n }\n }", "title": "" }, { "docid": "40408b111ba58177a407e704adde52e3", "score": "0.45319557", "text": "async function createOrUpdateALinkedSubscription() {\n const subscriptionId = \"dd8597b4-8739-4467-8b10-f8679f62bfbf\";\n const resourceGroup = \"azurestack\";\n const linkedSubscriptionName = \"testLinkedSubscription\";\n const resource = {\n linkedSubscriptionId: \"104fbb77-2b0e-476a-83de-65ad8acd1f0b\",\n location: \"eastus\",\n registrationResourceId:\n \"/subscriptions/dd8597b4-8739-4467-8b10-f8679f62bfbf/resourceGroups/azurestack/providers/Microsoft.AzureStack/registrations/testRegistration\",\n };\n const credential = new DefaultAzureCredential();\n const client = new AzureStackManagementClient(credential, subscriptionId);\n const result = await client.linkedSubscriptions.createOrUpdate(\n resourceGroup,\n linkedSubscriptionName,\n resource\n );\n console.log(result);\n}", "title": "" }, { "docid": "7981bec35f3a866932f38028398a7a20", "score": "0.45286918", "text": "function combineAndRemoveTags(IDtoReplace, clusterNumber) {\n var cluster = tagCluster[clusterNumber];\n Object.keys(cardList).forEach(function (cardID) {\n cardList[cardID].forEach(function(labelID) {\n if(cluster[labelID] && labelID != IDtoReplace) {\n console.log(\"Removed: \" + labelID);\n console.log(\"Added: \" + IDtoReplace);\n delete tagCluster[clusterNumber][labelID];\n displayTags()\n /*\n Trello.post('/cards/'+cardID+'/idLabels/',{value: IDtoReplace},\n function(response) {\n console.log(\"Tag added: \" + response);\n }, function(response) {\n console.log(\"Error:\" + response)\n });\n Trello.delete('/cards/'+cardID+'/idLabels/',{value: labelID},\n function(response) {\n console.log(\"Tag deleted: \" + response);\n }, function(response) {\n console.log(\"Error: \" + response);\n });\n */\n }\n });\n });\n}", "title": "" }, { "docid": "20a4c17a9097fd69f59367d45c89d6ca", "score": "0.45257786", "text": "function setTag(key, value) {\r\n callOnHub('setTag', key, value);\r\n }", "title": "" }, { "docid": "abde8d78071f6fbc555c59c6bd947f25", "score": "0.4514557", "text": "static updateProvider(id, name) {\n return new Promise(async (resolve, reject) => {\n try {\n const res = await axios.patch(`${url}${id}`, { name });\n const data = res.data;\n resolve(data);\n } catch(err) {\n const { response } = err;\n reject(response.data);\n }\n });\n }", "title": "" }, { "docid": "b7ac5d7954d8953cb4f1e741e7697122", "score": "0.44916365", "text": "async function templateSpecsCreateUpdate() {\n const subscriptionId = \"00000000-0000-0000-0000-000000000000\";\n const resourceGroupName = \"templateSpecRG\";\n const templateSpecName = \"simpleTemplateSpec\";\n const templateSpec = {\n description: \"A very simple Template Spec\",\n location: \"eastus\",\n };\n const credential = new DefaultAzureCredential();\n const client = new TemplateSpecsClient(credential, subscriptionId);\n const result = await client.templateSpecs.createOrUpdate(\n resourceGroupName,\n templateSpecName,\n templateSpec\n );\n console.log(result);\n}", "title": "" }, { "docid": "6688a039d36868430e8971eebb3f1d8b", "score": "0.44806352", "text": "function updateProviderService(providerService) {\n return $q(function(resolve, reject) {\n ProviderServiceResource.updateProviderService(providerService).then(function (response) {\n var result = response.data;\n if(((result.responseCode != undefined && result.responseCode == Constants.RESPONSE_SUCCESS )))\n {\n return resolve(result.data);\n }\n else\n {\n return reject(result.data);\n }\n \n }, function (error) {\n return reject(null);\n });\n })\n }", "title": "" }, { "docid": "fd844de8d30aad38a4e17baae2af9238", "score": "0.44695622", "text": "function associateTags(artist, tags) {\n\n for (var i = 0; i < tags.length; i++) {\n for (var j = i + 1; j < tags.length; j++) {\n\n // the tag_pair is sorted so that the pairs\n // [\"Rock\", \"Jazz\"] and [\"Jazz\", \"Rock\"] will be\n // counted properly\n var tag_pair = [tags[i]['name'], tags[j]['name']].sort();\n if (tag_relationships[tag_pair]) {\n ++tag_relationships[tag_pair];\n } else {\n tag_relationships[tag_pair] = 1;\n }\n\n }\n }\n\n // outstanding_request_count is something of a poor-man's\n // semaphore. Once it reaches 0 there are no outstanding\n // calls to get tags and we can display our results.\n --outstanding_request_count;\n if (outstanding_request_count <= 0) {\n showTagPairs(tag_relationships);\n }\n }", "title": "" }, { "docid": "0dd589964098903e038841d4fb3895ae", "score": "0.44618925", "text": "function ProfileController($scope, $auth, RestFul) {\n RestFul.global(\n {\"action\": \"Account:UserProfile\", \"params\": {}},\n function(response) {\n if (!response) { return; };\n if (response.hasOwnProperty('message')) {\n $scope.userProfile = response.data;\n $scope.tags = [];\n tags = angular.copy($scope.userProfile.tags);\n if (tags.length > 0) {\n for (i in tags.split(\",\")) {\n val = tags.split(\",\")[i];\n $scope.tags.push({\"text\": val});\n }\n }\n }\n }\n )\n}", "title": "" }, { "docid": "bef436a45a318ca3c91260feeff8db4c", "score": "0.44378674", "text": "onAttach()\n {\n tagsInput(this.ui.resourceLabels[0]);\n }", "title": "" }, { "docid": "7a95da6ffbabd965fa6f49fdb57fc4c4", "score": "0.44186276", "text": "function mutateTag( srcName, srcCode, idList, node ) {\n\tif( debug ) {\n\t\tconsole.log( 'mutateTag( node=%s )', summariseNode( 0, node ) ) ;\n\t}\n\tconst current = node.attributes.value.toLowerCase() ;\n\tconst options = [\t[ 'memory', 'storage', 'calldata', ' ' ],\n\t\t\t\t[ 'public', 'private', 'internal', 'external', 'constant', ' ' ],\n\t\t\t\t[ 'payable', ' ' ]\n\t\t\t] ;\n\tconst alternative = getRandomAlternative( current, options ) ;\n\tif( current !== alternative ) {\n\t\treturn replaceCode( 'TRD', node, bgn( node ), srcCode, current, alternative, end( node ) ) ;\n\t}\n\treturn null ;\n}", "title": "" }, { "docid": "241c3a8e5ba2a579bef8eb7faabfc572", "score": "0.44081563", "text": "function updateTags() {\n if (selectedTags.length === 0) {\n document.getElementById(\"selected-tags\").innerText = \"none\";\n }\n else {\n var text = selectedTags.join(\", \");\n document.getElementById(\"selected-tags\").innerText = isUnderscore ? text : text.replace(/_/g, \" \");\n }\n\n if (negativeTags.length === 0) {\n document.getElementById(\"negative-tags\").innerText = \"none\";\n }\n else {\n var text = negativeTags.join(\", \");\n document.getElementById(\"negative-tags\").innerText = isUnderscore ? text : text.replace(/_/g, \" \");\n }\n}", "title": "" }, { "docid": "6cb9871c1de46a99eb137c18653d3929", "score": "0.44034794", "text": "set(tagKey, tagValue) {\n if (!validation_1.isValidTagKey(tagKey)) {\n throw new Error(`Invalid TagKey name: ${tagKey.name}`);\n }\n if (!validation_1.isValidTagValue(tagValue)) {\n throw new Error(`Invalid TagValue: ${tagValue.value}`);\n }\n this.registeredTags.set(tagKey, tagValue);\n }", "title": "" }, { "docid": "59545bd457ad8c53ccb5832d5947fbe9", "score": "0.43972936", "text": "function updateResource(bundleID){\n\tconsole.log(\"update resource is being called\");\n\tvar theForm = document.getElementById(\"bundle-resource-select,\" + bundleID);\n\tvar newResource = theForm.options[theForm.selectedIndex].value;\n\tvar theBundle = getBundleById(bundleID);\n\tconsole.log(\"Setting bundle #\" + bundleID + \"'s resource to \" + newResource);\n\ttheBundle.setResource(newResource);\n}// /updateResource", "title": "" }, { "docid": "75df1886c53e89fbb8e0903ee9598cc0", "score": "0.43784153", "text": "addNewTag(newPageTags) {\n this.setState({ newPageTags });\n }", "title": "" }, { "docid": "13f77dbc13e7d905411867c5f735ed29", "score": "0.4372985", "text": "static add(scope, key, value, props = {}) {\n annotations_1.Annotations.of(scope).addDeprecation('@aws-cdk/core.Tag.add(scope,k,v)', 'Use \"Tags.of(scope).add(k,v)\" instead');\n Tags.of(scope).add(key, value, props);\n }", "title": "" }, { "docid": "15e482ce8d67f8614a57d39c3b3f1c14", "score": "0.4372255", "text": "function setTag() {\n if (settings.challengeResponse) {\n var currentRecording = uploaded + uploading;\n if (currentRecording > 0 && currentRecording < settings.recordings) {\n if (tags.length >= currentRecording) {\n // use the preset (typically via the BWS access token) tags!\n tag = tags[currentRecording - 1]\n }\n else {\n var newtag = tag;\n if (currentRecording % 2 === 1) {\n // create a random tag\n var r = Math.random();\n if (currentRecording === 1) {\n if (r < 0.25) { newtag = 'up'; }\n else if (r < 0.5) { newtag = 'down'; }\n else if (r < 0.75) { newtag = 'left'; }\n else { newtag = 'right'; }\n }\n else {\n // create a tag in a direction different to the last movement axis \n if (tag === 'up' || tag === 'down') {\n if (r < 0.5) { newtag = 'left'; }\n else { newtag = 'right'; }\n }\n else {\n if (r < 0.5) { newtag = 'up'; }\n else { newtag = 'down'; }\n }\n }\n }\n else {\n // create a tag in the opposite direction of the last tag\n switch (tag) {\n case 'left':\n newtag = 'right';\n break;\n case 'right':\n newtag = 'left';\n break;\n case 'up':\n newtag = 'down';\n break;\n case 'down':\n newtag = 'up';\n break;\n default:\n break;\n }\n }\n console.log('Switched tag for recording #' + currentRecording + ' from ' + tag + ' to ' + newtag);\n tag = newtag;\n }\n }\n else { tag = 'any'; }\n }\n \n if (statusCallback) { statusCallback('DisplayTag', tag); }\n if (tag !== 'any' && capturing) {\n // give user some time to react!\n capturing = false;\n setTimeout(function () { capturing = true; }, 800);\n }\n }", "title": "" }, { "docid": "f86c9088d46a9818c56d9ffe8ed78604", "score": "0.4368149", "text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }", "title": "" }, { "docid": "f86c9088d46a9818c56d9ffe8ed78604", "score": "0.4368149", "text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }", "title": "" }, { "docid": "f86c9088d46a9818c56d9ffe8ed78604", "score": "0.4368149", "text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }", "title": "" }, { "docid": "f86c9088d46a9818c56d9ffe8ed78604", "score": "0.4368149", "text": "function addTag() {\n\t\t\tTagService.addTag(ctrl.tagArray, ctrl.newTag);\n ctrl.newTag = '';\n }", "title": "" }, { "docid": "dcabd27360f33a4549e7ee964efb198b", "score": "0.43675128", "text": "function onSubmitTags(req, res){\n\tparseJSON_POST(req, function(json){\n\t\tconsole.log('got tags in POST', json)\n\t\tvar user = account(json.email)\n\t\tuser.tags = json.tags\n\t\t\n\t\tOK(res)\n\t})\n}", "title": "" }, { "docid": "c3b79e1f4433ae7ed2dc176c781c5222", "score": "0.43571904", "text": "function updateExternalLoginProviderStatus(name, isInUse)\n {\n $.each(vm.externalLoginProviders(), function (i, v) {\n if (v.name() === name) {\n v.isInUse(isInUse);\n }\n });\n }", "title": "" }, { "docid": "fe16d2b2ee17eab04a551a702fb3f530", "score": "0.43546107", "text": "handleTagsUpdate (tags) {\n this.setState({ tags });\n }", "title": "" }, { "docid": "c9c59da56cffa75724c1bf248e02d89d", "score": "0.43476287", "text": "function updateTag(tagName, iter) {\n tagStore.tagName = tagStore.tagName + iter;\n }", "title": "" }, { "docid": "702ace10a2ff5e7e7b2e9f4faa4cb8cb", "score": "0.4344968", "text": "function addTag() {\n tags.forEach((tag, index) => {\n db.collection(\"users\")\n .doc(userId)\n .collection(\"tagsFollowed\")\n .doc(tag)\n .set({\n tagLower: tag,\n timeStamp: firebase.firestore.FieldValue.serverTimestamp(),\n })\n .then(() => {\n // console.log(`Added tag: ${tag}`);\n })\n .catch(() => {\n console.error(`Error writing tag: ${tag}`);\n });\n });\n }", "title": "" }, { "docid": "4fc4793c70952672d56ea66d6886b432", "score": "0.43449298", "text": "function onOKEditTag()\n{\n var tagService = Components.classes[\"@mozilla.org/messenger/tagservice;1\"]\n .getService(Components.interfaces.nsIMsgTagService);\n // get the tag name of the current key we are editing\n var existingTagName = tagService.getTagForKey(dialog.editTagKey);\n\n // it's ok if the name didn't change\n if (existingTagName != dialog.nameField.value)\n {\n // don't let the user edit a tag to the name of another existing tag\n if (tagService.getKeyForTag(dialog.nameField.value))\n {\n alertForExistingTag();\n return false; // abort the OK\n }\n\n tagService.setTagForKey(dialog.editTagKey, dialog.nameField.value);\n }\n\n tagService.setColorForKey(dialog.editTagKey, document.getElementById(\"tagColorPicker\").color);\n return dialog.okCallback();\n}", "title": "" }, { "docid": "b56f3d86f46c8ab46693fa833f47b9ce", "score": "0.43383184", "text": "function singleActivityRsvpUpdates(pusherKey){\n var pusher = new Pusher(pusherKey);\n var singleActivityChannel = pusher.subscribe(\"single-activity-channel\");\n singleActivityChannel.bind('create-rsvp', function(res) {\n if(res.is_friend === true){\n $(\"#people-\"+res.event_id).prepend(linkToProfile(res.url,res.photo_url,res.is_friend,res.name,res.uid)).hide().fadeIn('slow');\n }else{\n $(\"#people-\"+res.event_id).append(linkToProfile(res.url,res.photo_url,res.is_friend,res.name,res.uid)).hide().fadeIn('slow');\n }\n incrementAttendeesCount(res.event_id)\n })\n singleActivityChannel.bind('remove-rsvp', function(res) {\n $(\"#people-\"+res.event_id+\" \"+\"#attendee-\"+res.uid).fadeOut(300, function(){\n $(this).remove();\n });\n decrementAttendeesCount(res.event_id)\n })\n}", "title": "" }, { "docid": "83ba17a6bbe8ca4828c134339ba78c02", "score": "0.43238062", "text": "function writeTagsToPLC(url, tags, fail_callback, success_callback) {\n $.ajax({\n type: \"POST\",\n url: url,\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Upgrade-Insecure-Requests\": 1,\n \"User-Agent\":\n \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n Accept:\n \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8\"\n },\n datatype: \"text\",\n data: tags,\n success: success_callback,\n error: fail_callback\n });\n}", "title": "" }, { "docid": "f8c398c27b1c8c505b6ae637eeba1140", "score": "0.43066514", "text": "function setProvider(prov) {\r\n let providerChoice;\r\n switch(prov){\r\n case '0':\r\n providerChoice = PROVIDERS.MAINNET;\r\n break;\r\n case '1':\r\n providerChoice = PROVIDERS.ROPSTEN;\r\n break;\r\n case '2':\r\n providerChoice = PROVIDERS.KOVAN;\r\n break;\r\n case '3':\r\n providerChoice = PROVIDERS.RINKEBY;\r\n break;\r\n default:\r\n providerChoice = PROVIDERS.MAINNET;\r\n }\r\n var providerString = `https://${providerChoice}.infura.io/v3/948f5de972d84e8b8d7d8978cbbf3a96`\r\n var provider = new JsonRpcProvider(providerString);\r\n}", "title": "" }, { "docid": "57af10aa131094ad0bbd3f07538c8d71", "score": "0.42957205", "text": "tagResource() {\n let _this = this;\n return co(function* () {\n let credentials = yield _this.assumeRole();\n _this.ec2 = new AWS.EC2({\n region: _this.event.awsRegion,\n credentials: credentials\n });\n yield _this.tagEC2Resources([_this.getInternetGatewayId()]);\n });\n }", "title": "" }, { "docid": "f6d56354e4e7076caad1bb39b7582663", "score": "0.4292369", "text": "function updateTechnologyUser(id, body, scb, fcb) {\n request('PUT', '/technologyUsers/' + id, getHeaders(true), body, scb, fcb);\n }", "title": "" }, { "docid": "2155efdf4e14808cc65c99d6df82ac69", "score": "0.42821634", "text": "function updateModelTags(id, name, cb) {\n\t\t\tmodelModel.findByIdAndUpdate(id, {tags: tags}, { upsert: true, multi: false }, function (err, numberAffected, raw) {\n\t\t\t\t\tif (err) { logger.error(err); return cb(err, raw); }\n\t\t\t\t\telse { return cb(err, 'ok'); }\n\t\t\t});\n\t}", "title": "" }, { "docid": "d86844fc57fb8488d9e53fdec0a043fa", "score": "0.4275121", "text": "function updateInsRec(a) {\n return getParticipantRegistry('org.xbank.partyInfo.insProvider')\n .then(function(participantRegistry) {\n return participantRegistry.update(a)\n })\n}", "title": "" }, { "docid": "1e81673251721192917fa7c92c774bc9", "score": "0.4273223", "text": "function update_tags() {\n var tags = new Array();\n $(wrapper_sel+' '+tag_sel).each( function () {\n tags.push($(this).text());\n });\n $(target_sel).val(tags.join(','));\n }", "title": "" }, { "docid": "f4aee79b59e1b57bb5c41a9cdfc39f02", "score": "0.42664015", "text": "function w5toolbar_tag_change (tag, ctx) {\n var checkboxes = document.getElementById(\"w5toolbar_group_checkboxes\");\n var _newtags = [];\n\n for (var i=0; i<checkboxes.childNodes.length; i++) {\n var box = checkboxes.childNodes[i];\n if (box.getAttribute (\"disabled\") == \"false\") {\n if ((box.getAttribute (\"checked\")) && (tag != box.getAttribute (\"realtagname\")) ||\n (!box.getAttribute (\"checked\")) && (tag == box.getAttribute (\"realtagname\")))\n _newtags.push (box.getAttribute (\"tagval\"));\n }\n }\n newtags[ctx] = _newtags;\n ddump (DB_HEADER, \"new tags for \" + ctx + \" is \" + newtags[ctx] + \"\\n\");\n}", "title": "" }, { "docid": "fd93fd6f176b15a716b2cf09f07da6c9", "score": "0.4250641", "text": "async function updateProducerVote(voter, proxy = '', producers = []) {\n return eos.voteproducer(voter, proxy, producers);\n}", "title": "" }, { "docid": "b137376af5c5c6ff7b30d1a3c801267f", "score": "0.42404664", "text": "function updatePalletInfo(tag, updatedInfo) {\n\n console.log(\"Attempting to update pallet information...\");\n\n if (!(tag in palletDB)) {\n\n console.log(\"Palled ID \" + tag + \" not found in database.\")\n\n } else {\n\n updatedInfo[\"rfid\"] = tag;\n palletDB[tag] = updatedInfo;\n console.log(\"Pallet info updated!\");\n console.log(palletDB[tag]);\n }\n}", "title": "" }, { "docid": "fb4124ed06da560f3ec16006a8d58e16", "score": "0.42396402", "text": "function upsertProduct(product, cb2){\n\n grunt.log.debug( JSON.stringify( grunt.config.get(\"apigee_profiles\") ) );\n\n apigeeSdk.getProductList(grunt.config.get(\"apigee_profiles\"),\n function(error, response, body){\n grunt.log.debug(response.statusCode);\n grunt.log.debug(body);\n upsertProductList(body, product, cb2);\n }, grunt.option('curl'));\n\n }", "title": "" }, { "docid": "02002fea33b61d2ef780ccd09a5395ee", "score": "0.42373818", "text": "function editTags(){\n document.getElementById(\"f4pUpload-tags\").disabled = false;\n document.getElementById(\"editButton\").disabled = false;\n}", "title": "" }, { "docid": "8e7d7edbf8025ed2bd720daf7fed2ecc", "score": "0.42169815", "text": "function addTag(tagName, callback) {\r\n\r\n Tag.update({tagName: tagName}, {tagName: tagName}, {upsert: true}, callback);\r\n\r\n}", "title": "" }, { "docid": "a5e6c12ba9b0adfd9a68a7129280896b", "score": "0.42122224", "text": "function service_change(m, ii, ins, out, os){\n\tvar data_service = {\"enable\": \"true\",\n \"serviceId\": \"40\", //doesn't work. SID of output service must be pre-defined eg. by WEB gui\n \"pmtPid\": \"4000\",\n\t\t\t\t\t\t\"startPid\": \"4001\",\n\t\t\t\t\t\t\"inputRef\": \"in/\"+ii+\"/services/\"+ ins\t\t\t\t\n\t};\n\tvar datas = JSON.stringify(data_service)\n\tCF.request(url+\"/modules/\"+m+\"/out/\"+out+\"/services/\"+os, \"PUT\", null, datas, function(status, headers, body){\n\t\tif (status == \"200\"){\n\t\t\tCF.log(ins + \" ON AIR!\"); //debug message\n\t\t\tCF.setJoin(\"s201\", ins)\n\t\t} else {\n\t\t\tCF.log(\"Operation failed. Check arguments. Status: \"+ status + headers + body); //debug message\n\t\t}\n\t});\n}", "title": "" }, { "docid": "56338bb00d70b491b859ae0f2de27df7", "score": "0.42105326", "text": "async function getTagsOnASubscription() {\n const subscriptionId =\n process.env[\"RESOURCES_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const scope = \"subscriptions/eaee6a92-e973-4922-9471-3a0a6abf81cd\";\n const credential = new DefaultAzureCredential();\n const client = new ResourceManagementClient(credential, subscriptionId);\n const result = await client.tagsOperations.getAtScope(scope);\n console.log(result);\n}", "title": "" }, { "docid": "ad32a836ad377b42ed5f7270b9a99483", "score": "0.4206802", "text": "function setProviders(){\n var form = View.panels.get('panel_providers');\n if (form.getFieldValue(\"helpdesk_sla_response.em_id\")) {\n provider = \"em\";\n form.enableField(\"helpdesk_sla_response.em_id\", true);\n form.enableField(\"helpdesk_sla_response.vn_id\", false);\n form.enableField(\"helpdesk_sla_response.activity_id\", false);\n enableButton(\"acceptance\", \"APPROVED\", false);\n \n enableRadioButtons(\"notify_service_provider\", true);\n }\n else \n if (form.getFieldValue(\"helpdesk_sla_response.vn_id\")) {\n provider = \"vn\";\n form.enableField(\"helpdesk_sla_response.em_id\", false);\n form.enableField(\"helpdesk_sla_response.activity_id\", false);\n form.enableField(\"helpdesk_sla_response.vn_id\", true);\n enableButton(\"acceptance\", \"APPROVED\", false);\n \n enableRadioButtons(\"notify_service_provider\", true);\n }\n else \n if(form.getFieldValue(\"helpdesk_sla_response.activity_id\")){\n \tprovider = \"afm_activities\";\n form.enableField(\"helpdesk_sla_response.em_id\", false);\n form.enableField(\"helpdesk_sla_response.vn_id\", false);\n form.enableField(\"helpdesk_sla_response.activity_id\", true);\n enableButton(\"acceptance\", \"APPROVED\", false);\n \n enableRadioButtons(\"notify_service_provider\", true);\n }\n else {\n \tvar requestType = responsePanel.getFieldValue('helpdesk_sla_response.activity_type');\n \t//KB3032157 - set default service provider for 'SERVICE DESK - GROUP MOVE' 'SERVICE DESK - INDIVIDUAL MOVE' and 'SERVICE DESK - DEPARTMENT SPACE'\n \tif(requestType == 'SERVICE DESK - GROUP MOVE' || requestType == 'SERVICE DESK - INDIVIDUAL MOVE'){\n \t\tprovider = \"afm_activities\";\n form.enableField(\"helpdesk_sla_response.em_id\", false);\n form.enableField(\"helpdesk_sla_response.vn_id\", false);\n form.enableField(\"helpdesk_sla_response.activity_id\", true);\n enableButton(\"acceptance\", \"APPROVED\", false);\n \n enableRadioButtons(\"notify_service_provider\", true);\n \t} else if(requestType == 'SERVICE DESK - DEPARTMENT SPACE' ){\n \t\t provider = \"em\";\n \t form.enableField(\"helpdesk_sla_response.em_id\", true);\n \t form.enableField(\"helpdesk_sla_response.vn_id\", false);\n \t form.enableField(\"helpdesk_sla_response.activity_id\", false);\n \t enableButton(\"acceptance\", \"APPROVED\", false);\n \t \n \t enableRadioButtons(\"notify_service_provider\", true);\n \t}else{\n \t\tprovider = \"accept\";\n \t form.enableField(\"helpdesk_sla_response.em_id\", false);\n \t form.enableField(\"helpdesk_sla_response.vn_id\", false);\n \t enableButton(\"acceptance\", \"APPROVED\", true);\n \t \n \t enableRadioButtons(\"notify_service_provider\", false);\n \t}\n }\n \n var buttons = document.getElementsByName(\"serviceProvider\");\n for (i = 0; i < buttons.length; i++) {\n if (buttons[i].value == provider) {\n buttons[i].checked = true;\n }\n else {\n buttons[i].checked = false;\n }\n }\n \n}", "title": "" }, { "docid": "e7afd4076a0229d9debf65a59ead67e0", "score": "0.4199302", "text": "function setProviderIdAndEmail(providerName) {\n var foundProvider = null;\n for (var i = 0 ; i < serviceProviders.length; i++) {\n if (serviceProviders[i].Name === providerName) {\n foundProvider = serviceProviders[i];\n break;\n }\n }\n\n if (foundProvider != null) {\n $(\"#ServiceProviderId\").val(foundProvider.Id);\n if (foundProvider.Locations != undefined && foundProvider.Locations[0] != undefined) {\n $(\"#InviteeEmailAddress\").val(foundProvider.Locations[0].Contact.Email);\n }\n }\n else {\n $(\"#ServiceProviderId\").val(0);\n $(\"#InviteeEmailAddress\").val('');\n }\n }", "title": "" }, { "docid": "504e2538780c80711ad5cf6ffb6951d6", "score": "0.4195806", "text": "update(req, res) {\n console.log('update req===>', req.body);\n let queryVars = req.body;\n Tag.update(req.body, {\n where: {\n id: queryVars.id\n }\n })\n .then(function (updatedRecords) {\n res.status(200).json(updatedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "title": "" }, { "docid": "111ec9df7bee5be883e9126465c8a9aa", "score": "0.4195617", "text": "function changeTags(changed, onInput) {\n\n var actions = [];\n for (var i in _entityIDs) {\n var entityID = _entityIDs[i];\n var entity = context.entity(entityID);\n\n var tags = Object.assign({}, entity.tags); // shallow copy\n\n>>>>>>> af4ea2c4ddd394e18be57c4998a7860f8e535444\n for (var k in changed) {\n if (!k) continue;\n var v = changed[k];\n if (v !== undefined || tags.hasOwnProperty(k)) {\n tags[k] = v;\n }\n }\n\n<<<<<<< HEAD\n\n tags = utilCleanTags(tags);\n=======\n if (!onInput) {\n tags = utilCleanTags(tags);\n }\n>>>>>>> af4ea2c4ddd394e18be57c4998a7860f8e535444\n\n if (!deepEqual(entity.tags, tags)) {\n actions.push(actionChangeTags(entityID, tags));\n }\n<<<<<<< HEAD\n\n=======\n>>>>>>> af4ea2c4ddd394e18be57c4998a7860f8e535444\n }\n\n if (actions.length) {\n var combinedAction = function(graph) {\n actions.forEach(function(action) {\n graph = action(graph);\n });\n return graph;\n };\n\n var annotation = t('operations.change_tags.annotation');\n\n if (_coalesceChanges) {\n context.overwrite(combinedAction, annotation);\n } else {\n context.perform(combinedAction, annotation);\n<<<<<<< HEAD\n _coalesceChanges = false;\n=======\n _coalesceChanges = !!onInput;\n>>>>>>> af4ea2c4ddd394e18be57c4998a7860f8e535444\n }\n }\n\n context.validator().validate();\n }", "title": "" }, { "docid": "81a7d554745a4f413097536890df844c", "score": "0.4188596", "text": "async function updateVaultWithMonitoringSetting() {\n const subscriptionId =\n process.env[\"RECOVERYSERVICES_SUBSCRIPTION_ID\"] || \"77777777-b0c6-47a2-b37c-d8e65a629c18\";\n const resourceGroupName = process.env[\"RECOVERYSERVICES_RESOURCE_GROUP\"] || \"HelloWorld\";\n const vaultName = \"swaggerExample\";\n const vault = {\n properties: {\n monitoringSettings: {\n azureMonitorAlertSettings: { alertsForAllJobFailures: \"Enabled\" },\n classicAlertSettings: { alertsForCriticalOperations: \"Disabled\" },\n },\n },\n tags: { patchKey: \"PatchKeyUpdated\" },\n };\n const credential = new DefaultAzureCredential();\n const client = new RecoveryServicesClient(credential, subscriptionId);\n const result = await client.vaults.beginUpdateAndWait(resourceGroupName, vaultName, vault);\n console.log(result);\n}", "title": "" }, { "docid": "a12290b4fca1e46be0e7e2e7e3199531", "score": "0.41706094", "text": "setProviderToken (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: `/provider-set-token/${this.provider}`,\n\t\t\t\tdata: this.data,\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tthis.setProviderTokenResponse = response;\n\t\t\t\tdelete this.data;\t// don't need this anymore\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "6842a64ee9f9e98843f57e21e7eb4674", "score": "0.41682452", "text": "updateSubscription({ accountId, id, model } = {}) {\n var path = this.buildUrl({\n url: `/api/v2/accounts/${accountId}/subscriptions/${id}`,\n parameters: {}\n });\n return this.restCall({ url: path, verb: 'put', payload: model });\n }", "title": "" }, { "docid": "d89de6b8a4baefca011e0aad9cefd5e0", "score": "0.41621977", "text": "function UpdateEntities(data){\n // Set the headers\n var headers = {\n 'Authorization': 'Bearer b90129cb0a5a4b568bc2e960e1397168',\n 'Content-Type': 'application/json'\n }\n //Json to update entities, if not create -> create new entities\n var bodyJson =\n [\n {\n \"entries\": data,\n \"name\": ENTITIES\n }\n ]\n //Sap xep lai bodyJson\n var body = JSON.stringify(bodyJson);\n // Configure the request\n var options = {\n url: 'https://api.dialogflow.com/v1/entities?v=20150910&lang=en',\n method: 'PUT',\n headers: headers,\n body: body\n }\n // Start the request\n request(options, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n // Print out the response body\n console.log(\"Dialogflow response: \" + JSON.stringify(body));\n }\n })\n}", "title": "" }, { "docid": "aade66652581308120f734a9cce3c5f6", "score": "0.4158469", "text": "function onPlayerStateChange(event){\n if(event.data === 0) {\n //method is in videos.js\n Meteor.call('updateSuggestedTags', Meteor.user(),\n Session.get('ytId'), function(error, result) {\n if(error) {\n console.log(error);\n }\n })\n }\n }", "title": "" }, { "docid": "b51b519bffcf00abdc4d253192de18d5", "score": "0.41551173", "text": "async function updateAlexaChannel() {\n const subscriptionId = process.env[\"BOTSERVICE_SUBSCRIPTION_ID\"] || \"subscription-id\";\n const resourceGroupName = process.env[\"BOTSERVICE_RESOURCE_GROUP\"] || \"OneResourceGroupName\";\n const resourceName = \"samplebotname\";\n const channelName = \"AlexaChannel\";\n const location = \"global\";\n const properties = {\n channelName: \"AlexaChannel\",\n properties: { alexaSkillId: \"XAlexaSkillIdX\", isEnabled: true },\n };\n const options = { location, properties };\n const credential = new DefaultAzureCredential();\n const client = new AzureBotService(credential, subscriptionId);\n const result = await client.channels.update(\n resourceGroupName,\n resourceName,\n channelName,\n options\n );\n console.log(result);\n}", "title": "" }, { "docid": "35fae65132d136cee3f2fbdcb774d654", "score": "0.4153764", "text": "function createResourceGroup(callback) {\n var groupParameters = { location: location, tags: { sampletag: 'sampleValue' } };\n console.log('\\nCreating resource group: ' + resourceGroupName);\n return resourceClient.resourceGroups.createOrUpdate(resourceGroupName, groupParameters, callback);\n}", "title": "" }, { "docid": "b2af2fa9b6afe77f53a67fed9ee702ba", "score": "0.41528714", "text": "function updateSlackProfile(){\n var nowplaying = getNowPlayingTrack_();\n var profile = createProfile_(nowplaying);\n var encodedProfile = encodeURIComponent(JSON.stringify(profile));\n var url = 'https://slack.com/api/users.profile.set?token=' + SLACK_API_TOKEN + '&user='+ SLACK_USER_ID +'&profile=' + encodedProfile\n UrlFetchApp.fetch(url);\n}", "title": "" }, { "docid": "c3eda757b6532a5be41b06d5211f583a", "score": "0.41419587", "text": "updateAssociatedEntities(entity, cancelToken) {\n if (entity && entity.associatedEntitiesResourceName) {\n return this.invokeRequest({\n verb: 'PUT',\n requestURL: this.buildURL(null, entity.associatedEntitiesResourceName, entity),\n headers: this.computeHeaders(),\n requestData: entity.associatedEntities.length ? entity.buildJSON() : '[]',\n cancelToken\n });\n }\n else {\n return Promise.reject(\"Associated entities and associated entity resource is required\");\n }\n }", "title": "" }, { "docid": "4f93647b5d2698c6b81effe7488704b2", "score": "0.41309914", "text": "function tagNER(data) {\n\t\n\t\tner.get({ port:9191, host:'localhost' }, data.src, function(err, res){\n\t\t\n\t\t\tdata.tags = {\n\t\t\t\t'ORGANIZATION': [],\n\t\t\t\t'PERSON': [], \n\t\t\t\t'LOCATION': []\n\t\t\t};\n\t\t\t\n\t\t\tif(!res || !res.raw)\n\t\t\t\treturn\n\t\t\t\n\t\t\tvar tokens = res.raw.split(' ');\n\t\t\n\t\t\ttokens.forEach(function(token) {\n\t\t\t\t\t\n\t\t\t\tvar cols = token.split('/');\n\t\t\t\tvar keys = Object.keys(data.tags);\n\t\t\t\t\t\n\t\t\t\tif(cols[1] && keys.indexOf(cols[1]) >= 0)\n\t\t\t\t\tdata.tags[cols[1]].push(cols[0]);\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\tdata.organization = data.tags['ORGANIZATION'];\n\t\t\tdata.person = data.tags['PERSON'];\n\t\t\tdata.location = data.tags['LOCATION'];\n\t\t\t\n\t\t\tconsole.log(\"saving to tags\");\n\t\t\tconsole.log(data);\n\t\t\t\t\n\t\t\t\n\t\t});\n\t\n\t}", "title": "" }, { "docid": "d27f6dbe819b7303c95ef96aa79a3acd", "score": "0.41193157", "text": "update(subscription, newData) {\n const id = this.subscriptionParamToString(subscription);\n if (!id) {\n return Promise.reject(new Error('invalid_id'));\n }\n return this.iugu.makeRequest('PUT', `/subscriptions/${id}`).begin(newData).then(s => this.recreateExpires(s));\n }", "title": "" }, { "docid": "61bc570f48519358c989454ddfc57e57", "score": "0.41159844", "text": "static remove(scope, key, props = {}) {\n annotations_1.Annotations.of(scope).addDeprecation('@aws-cdk/core.Tag.remove(scope,k,v)', 'Use \"Tags.of(scope).remove(k,v)\" instead');\n Tags.of(scope).remove(key, props);\n }", "title": "" } ]
31f82f422b6eee73a29641e6f83748a0
fetches all the devices
[ { "docid": "2aff8a9827303a7e9ad3b9d7a65c5e65", "score": "0.6944296", "text": "function getAllDevices($scope) {\n\tmyCuiJs.getDevices()\n\t.then(function(response) {\n\t\t$scope.deviceList = [];\n\t\tresponse.forEach(function(fetchedDeviceFromList) {\n\t\t\tif(fetchedDeviceFromList.state.lifecycleState == \"active\"){ //checks if state of each device is active\n\t\t\t\t\t$scope.deviceList.push(fetchedDeviceFromList);//filtered device list is pushed in \"deviceList\" array\n\t\t\t\t\t$scope.$apply();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n}", "title": "" } ]
[ { "docid": "c2713de38acf696e489ecb4d26e85aa0", "score": "0.7711439", "text": "function getDevices() {\n\t// Return early if we're already getting devices\n\tif(getting_devices)\n\t\treturn;\n\n\t// Flag that we're getting devices\n\tgetting_devices = true;\n\t_log('retrieving devices');\n\n\t// Make the call to get the device list\n\tspark.listDevices(function(err, data) {\n\t\t// Oh noes!\n\t\tif(err) {\n\t\t\tconsole.error('ERROR', err);\n\t\t\treturn;\n\t\t}\n\n\t\t// Reset the device list (and add \"001\" => \"Computer\" since it's kinda reserved for CLI publishes)\n\t\tdevices = {'001': 'Computer'};\n\n\t\t// Loop through response data and store in an object\n\t\tfor(var i in data)\n\t\t\tdevices[data[i].id.toUpperCase().trim()] = data[i].name.trim();\n\n\t\t_log('retrieved '+Object.keys(devices).length+' devices', devices);\n\n\t\t// Let's do this again sometime!\n\t\tsetTimeout(getDevices, DEVICE_REFRESH);\n\n\t\t// Unflag that we're getting devices\n\t\tgetting_devices = false;\n\t});\n}", "title": "" }, { "docid": "a7bfd4a1d41e57e4dbd8ad3c84a4d37a", "score": "0.7464494", "text": "function getAllDevices() {\n return new Promise((resolve, reject) => {\n let query = Arduino.where({})\n query.find((err,results) => {\n if (err) return console.error('[ERR] Erro buscando todos os dispositivos do banco para WEB.')\n resolve(results)\n })\n })\n }", "title": "" }, { "docid": "8d3fdd6045648982eebf4f4127bd7989", "score": "0.7431877", "text": "async function _getAllDevicesFromDB() {\n SpecialBle.getAllDevices((devices) => {\n setDevices(devices)\n })\n }", "title": "" }, { "docid": "1bcfa7c7510462820898ea1a3cfb113d", "score": "0.7263997", "text": "GetAllDevices(callback) {\n this.dbus.driver.invoke({\n destination: 'org.freedesktop.NetworkManager',\n path: '/org/freedesktop/NetworkManager',\n 'interface': 'org.freedesktop.NetworkManager',\n member: 'GetAllDevices'\n }, (err, data) => callback && callback(err, data))\n }", "title": "" }, { "docid": "96e6c43ce8a5a79955f8a90802211523", "score": "0.7225071", "text": "function _getDevices(results) {\n dispatch(_GetDevices(results));\n }", "title": "" }, { "docid": "5fa8b593288ab264c1a649d889c9e5e0", "score": "0.70535994", "text": "function fetchDevices () {\n let config = {\n baseURL: apiURL,\n headers: {'Authorization': `Bearer ${conf.get('token')}`}\n }\n\n console.log(chalk.green('Fetching Points...'))\n\n axios.get('/devices', config)\n .then(function (res) {\n console.log(`Found ${res.data.devices.length} Point`)\n let allDevices = _.map(res.data.devices, function (n) {\n console.log(`Name: ${n.description}`)\n return {id: n.device_id, name: n.description}\n })\n conf.set('devices', allDevices)\n })\n .catch(function (res) {\n console.log(chalk.red(res.data.message))\n })\n}", "title": "" }, { "docid": "6ec2e8ebf96a66d22e55debd5f864e01", "score": "0.7049137", "text": "GetDevices(callback) {\n this.dbus.driver.invoke({\n destination: 'org.freedesktop.NetworkManager',\n path: '/org/freedesktop/NetworkManager',\n 'interface': 'org.freedesktop.NetworkManager',\n member: 'GetDevices'\n }, (err, data) => callback && callback(err, data))\n }", "title": "" }, { "docid": "0aedf35fdb72f1e7043b9877164b544e", "score": "0.6861907", "text": "function listDevices(api, query) {\n return api_1.GET(api, `/devices`, { query })\n}", "title": "" }, { "docid": "2568f4a99f34d3739c9512a4f7765a8a", "score": "0.68537176", "text": "function devices() {\n return SystemDeviceTypeService.index().then(function(data) {\n return _.filter(data, function(device) {\n return _.includes(device.tags, 'UC-One')\n })\n })\n }", "title": "" }, { "docid": "0f7cb9e507444ec964cad55de375c6f4", "score": "0.68423426", "text": "async getDevices() {\n if (!this.contract) {\n return;\n }\n\n const coinbase = await this.web3.eth.getCoinbase();\n\n const devices = await this.contract.methods.tokensOfOwner(coinbase).call();\n\n this.state.devices = [];\n\n // Load all device device by quering the blockchain\n await Promise.all(\n devices.map(async device => {\n const current_device = await this.contract.methods\n .getDevice(device)\n .call();\n\n current_device.deviceId = device;\n current_device.loading = false;\n\n this.state.devices.push(current_device);\n })\n );\n\n // Sort after all devices are loaded\n const devices_sorted = this.state.devices.sort((a, b) => {\n return parseInt(a.deviceId) > parseInt(b.deviceId);\n });\n\n this.setState({ devices: this.state.devices });\n }", "title": "" }, { "docid": "6954abb262ae89cad9fd214e2e35cdfe", "score": "0.67916244", "text": "function getAllDevices(req, res, next){\t\n\tvar user = req.user;\n\tutils.dbHandler(req, res, next, function(){\n\t\treturn dbDevice.getAllDevices(user);\n\t});\n}", "title": "" }, { "docid": "e801b2c74233b202dd047d903938adcf", "score": "0.67596895", "text": "function listDevices() {\n return particle.listDevices({ auth: token }).then(res => res.body);\n}", "title": "" }, { "docid": "5b4b47e567403fdbd951fd92b298562e", "score": "0.6738411", "text": "listDevices(){\n return api.callAuthorized(api.getNetwork, this.id)\n .then(network => network.devices.map(device => {\n device.networkId = this.id;\n return new Device(device);\n }));\n }", "title": "" }, { "docid": "58d955ef4abc2cf40c396f8496190be6", "score": "0.6606846", "text": "getWirelessDevices(callback) {\n this.GetDevices((err, data) => {\n if (err) return callback(err)\n let count = data[0].elems.length\n if (count === 0) return callback(null, [])\n let devices = []\n data[0].elems.forEach(x => {\n this.Get(x.value, 'org.freedesktop.NetworkManager.Device', 'DeviceType', (err, data) => {\n if (!err) {\n // device type\n if (data[0].elems[1].value === 2) {\n devices.push(x.value)\n }\n }\n if (!--count) {\n return callback(null, devices)\n }\n })\n })\n })\n }", "title": "" }, { "docid": "42e0a553e244f57a9760e5d3ad24926f", "score": "0.65693647", "text": "get devices() {\n return this._devices;\n }", "title": "" }, { "docid": "f088428c2fe8c556ee338d8bef9bb084", "score": "0.6559556", "text": "async getDevices(siteId, token) {\n const devices = await connectionHelpers.getDevices({siteId, token})\n console.log(devices)\n }", "title": "" }, { "docid": "af751e186aa08a797339462767926b4d", "score": "0.6555268", "text": "function listAllDevicesForProfile(api, id, query) {\n return api_1.GET(api, `/profiles/${id}/devices`, { query })\n}", "title": "" }, { "docid": "a2f3b65ae43556c4a9de7b96ddf611c0", "score": "0.64418346", "text": "function updateDevices() {\n getConnectedDevices().then(devices => {\n let videos = devices.filter(device => device.kind === \"videoinput\");\n let audioinput = devices.filter(device => device.kind === \"audioinput\");\n let audiooutput = devices.filter(device => device.kind === \"audiooutput\");\n updateCameraList(videos, 'select#videoDevices');\n updateCameraList(audioinput, 'select#audioDevices');\n updateCameraList(audiooutput, 'select#speakers');\n })\n}", "title": "" }, { "docid": "f9535747c321b5522ad033ca21b0eedd", "score": "0.64008284", "text": "async onPairListDevices() {\n return [\n // Example device data, note that `store` is optional\n // {\n // name: 'My Device',\n // data: {\n // id: 'my-device',\n // },\n // store: {\n // address: '127.0.0.1',\n // },\n // },\n ];\n }", "title": "" }, { "docid": "8e33c312d07b066ddc0a567285f1580d", "score": "0.638626", "text": "list() {\n\t\treturn this.devices.map(d => d.toJSON());\n\t}", "title": "" }, { "docid": "ac6a9f709b3b04b1393a07b9cac0905f", "score": "0.63485235", "text": "function refreshDevices(){\n\tsensors= temper.getDevices().map( _temperPromise)\n\treturn sensors\n}", "title": "" }, { "docid": "55dd560cb55f0d708495fee4eb08cb0a", "score": "0.633623", "text": "function getAllDevicesReturned( event, sucess, data, response ) {\n if(sucess && data != null) {\n var parsed = JSON.parse(JSON.stringify(data));\n initLivingRoom(parsed.allRooms[0]);\n initKitchen(parsed.allRooms[1]);\n }\n\n //todo - add error handling to UI here\n }", "title": "" }, { "docid": "826f07f1aefe778428119b959d611064", "score": "0.62961555", "text": "function findDevices() {\n if (DEVICEADDR) console.log(\"Scanning for \"+DEVICEADDR);\n else console.log(\"Scanning for any device...\");\n\n var devices = [];\n function handleDeviceFound(device, selectFn) {\n if (!DEVICEADDR) return true;\n return device.id==DEVICEADDR;\n }\n\n var bluetooth = new webbluetooth.Bluetooth({\n deviceFound: handleDeviceFound\n });\n bluetooth.requestDevice({ filters:[{ name: \"DfuTarg\" }]}).then(function(bluetoothDevice) {\n if (DELAY) console.log(\"Waiting \"+DELAY+\" msec\");\n setTimeout(function() {\n updateDevice(bluetoothDevice);\n }, DELAY);\n }).catch(function(e) {\n console.log(e);\n console.log(\"Not found.\");\n });\n}", "title": "" }, { "docid": "b864863d4e39093c9f8395d40dee8c8e", "score": "0.6275396", "text": "async getAllDeviceMapperDevices() {\n const filesystem = this;\n let result;\n let devices = [];\n let args = [\n \"-c\",\n 'for file in $(ls -la /dev/mapper/* | grep \"\\\\->\" | grep -oP \"\\\\-> .+\" | grep -oP \" .+\"); do echo $(F=$(echo $file | grep -oP \"[a-z0-9-]+\");echo $F\":\"$(ls \"/sys/block/${F}/slaves/\");); done;',\n ];\n\n try {\n result = await filesystem.exec(\"sh\", args);\n\n for (const dm of result.stdout.trim().split(\"\\n\")) {\n if (dm.length < 1) {\n continue;\n }\n devices.push(\"/dev/\" + dm.split(\":\")[0].trim());\n }\n return devices;\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "7ed4bc95cb2c649a6341aac720059d8a", "score": "0.62666523", "text": "async configureNewDevices() {\n const authorizedDevice = await navigator.usb.requestDevice({\n filters: [{ vendorId: ARDUINO_VENDOR_ID, productId: ARDUINO_PRODUCT_ID }]\n });\n this._devices.push(authorizedDevice);\n }", "title": "" }, { "docid": "55ac86b2e4b7383b612e120e010da0f1", "score": "0.6194092", "text": "function LoadDevices() {\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: StatsAPI + \"/GetAllDevices\",\n\t\tsuccess: function (data) {\n\t\t\tconst tBody = $(\".User_Inputs #Device_Selector\");\n\t\t\t\n\t\t\t$(tBody).empty();\n\t\t\t$.each(data, function (key, item)\n\t\t\t{\n\t\t\t\ttBody.append($(\"<option value=\" + item.uuid + \">\" + item.device_Name +\"</option>\"))\n\t\t\t});\n\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6d74e63e6eaf7d4633c08d8302838b92", "score": "0.61908484", "text": "async scanDevices() {\n\t\t// Browse and listen for WLED devices\n\t\tconst browser = await bonjour.find({\n\t\t\t'type': 'wled'\n\t\t});\n\t\tthis.log.info('Bonjour service startet, new devices will be detected automatically :-) ');\n\n\t\t// Event listener if new devices are detected\n\t\tbrowser.on('up', (data) => {\n\t\t\tconst id = data.txt.mac;\n\t\t\tconst ip = data.referer.address;\n\n\t\t\t// Check if device is already know\n\t\t\tif (this.devices[ip] === undefined) {\n\t\t\t\tthis.log.info('New WLED device found ' + data.name + ' on IP ' + data.referer.address);\n\n\t\t\t\t// Add device to array\n\t\t\t\tthis.devices[ip] = id;\n\t\t\t\tthis.log.debug('Devices array from bonjour scan : ' + JSON.stringify(this.devices));\n\n\t\t\t\t// Initialize device\n\t\t\t\tthis.readData(ip);\n\t\t\t} else {\n\t\t\t\t// Update memory with current ip address\n\t\t\t\tthis.devices[ip] = id;\n\t\t\t}\n\n\t\t\tthis.log.debug('Devices array from bonjour scan : ' + JSON.stringify(this.devices));\n\t\t});\n\n\t}", "title": "" }, { "docid": "f02c73f47a0683c5e91c97c0b8065c36", "score": "0.61835384", "text": "enumerate_devices() {\n const filters = {filters: [\n {vendorId: 0x16D0}\n ]};\n\n if (!this.usb) {\n this.log(\"error: WebUSB not supported\\n\", \"red\");\n return;\n }\n\n this.usb.requestDevice(filters)\n .then(dev => this.connect_device(dev))\n .catch(error => {\n if (String(error) === \"SecurityError: Must be handling a user gesture to show a permission request.\") {\n this.log(\"Please click 'Connect Device' on the left toolbar.\", \"black\");\n } else if (String(error) === \"NotFoundError: No device selected.\") {\n this.log(\"Please select a WebUSB device.\", \"red\");\n } else {\n this.log(String(error));\n this.log(\"error: unable to enumerate USB device list\");\n }\n });\n }", "title": "" }, { "docid": "91f9cf49355faed5230e535c79c8b387", "score": "0.6178031", "text": "function findDevices(){\n $('.drive-list').html('<p>Searching for drives...</p>')\n drivelist.list((error, drives) => { \n if (error) {\n throw error;\n }\n renderDrives(drives);\n });\n}", "title": "" }, { "docid": "bc6d61bb496c3af01aa3d4d7e1491bba", "score": "0.6150862", "text": "getDevices() {\n\t\tvar loadAnimation = \"<img src='https://cdn.glitch.com/bf30ed1e-b7e0-4de4-96b9-e0f42640f6a3%2Fload.gif?v=1575593902414' />\";\n\t\tdocument.querySelector('.deviceList').innerHTML=loadAnimation;\n\t\t\n\t\tlet devices = [];\n\t\tvar locationId = document.querySelector('select.locationList').value;\n localStorage.setItem('location', locationId);\n\t\tif (locationId === \"null\") {\n\t\t\tdocument.querySelector('.deviceList').innerHTML='';\n\t\t\treturn false;\n\t\t}\n\t\tvar authToken = \"Bearer \"+localStorage.getItem('authToken');\n\t\t// Check API\n var apiEndpoint = \"https://api.smartthings.com/devices?locationId=\"+locationId;\n var getDevices = new XMLHttpRequest();\n getDevices.open('GET', apiEndpoint);\n getDevices.setRequestHeader(\"Authorization\", authToken);\n getDevices.setRequestHeader(\"Content-type\", \"application/json\");\n getDevices.onload = function() {\n var data = JSON.parse(getDevices.responseText);\n for (let i = 0; i < data['items'].length; i++) {\n devices.push(data['items'][i]);\n }\n var newDevices = \"\";\n for (let i = 0; i < devices.length; i++) {\n newDevices += \"<li value='\"+devices[i]['deviceId']+\"'>\";\n newDevices += devices[i]['name'];\n newDevices += \"<ul>\";\n newDevices += \"<li style='list-style-type:none;margin:5px 0;font-size:15px;font-weight:600;'>Capabilities</li>\";\n for (let x = 0; x < devices[i]['components'][0]['capabilities'].length; x++){\n newDevices += \"<li>\";\n newDevices += devices[i]['components'][0]['capabilities'][x]['id'];\n newDevices += \"</li>\";\n }\n newDevices += \"</ul>\";\n newDevices += \"</li>\";\n }\n setTimeout(function() {\n localStorage.setItem('devices', JSON.stringify(devices));\n document.querySelector('.deviceList').innerHTML='';\n document.querySelector('.deviceList').insertAdjacentHTML('beforeend', newDevices);\n }, 1000);\n }\n getDevices.send();\n\t}", "title": "" }, { "docid": "7acaf44e264b8dd08f1d8220266039c1", "score": "0.6132183", "text": "function scanForDevices() {\n responseDiv.html('scanning for devices.');\n // if device list is already populated, remove it to refresh:\n if (deviceList) deviceList.remove();\n\n deviceList = createSelect(); // create a new select element\n deviceList.position(10, 110);\n deviceList.size(150, 30)\n deviceList.option('Pick a device', ''); // set default option\n deviceList.changed(selectDevice);\n\n //scan for the serviceUUID for 5 seconds:\n ble.scan([myDevice.serviceUUID], 5, discoverDevice, bleError);\n // set a timeout to announce the end of the scan:\n setTimeout(ble.stopScan, 5000, scanFinished, bleError);\n}", "title": "" }, { "docid": "d5c43568ae80344424db8de51c8f7184", "score": "0.61184454", "text": "async function getConnectedDevices() {\n const devices = await navigator.mediaDevices.enumerateDevices();\n return devices\n}", "title": "" }, { "docid": "3bab5297995b7849fc005c5de30b58c5", "score": "0.61175823", "text": "function listDevices(service, subservice, limit, offset, callback) {\n var condition = {\n service: service,\n subservice: subservice\n },\n query = Device.model.find(condition).sort();\n\n if (limit) {\n query.limit(parseInt(limit, 10));\n }\n\n if (offset) {\n query.skip(parseInt(offset, 10));\n }\n\n query.exec(callback);\n}", "title": "" }, { "docid": "305c67d1e317d8ed93b5de40416d629e", "score": "0.61102015", "text": "function listDevices (client, registryName, cb) {\n const request = {\n parent: registryName\n };\n\n client.projects.locations.registries.devices.list(request, (err, data) => {\n if (err) {\n console.log('Could not list devices');\n console.log(err);\n cb(err);\n } else {\n console.log('Current devices in registry:', data['devices']);\n cb(null);\n }\n });\n}", "title": "" }, { "docid": "5e107b5b853d588821e51bb7f441f929", "score": "0.6087946", "text": "function getListRMDevice(){\n\treturn rmBroadlink.devices;\n}", "title": "" }, { "docid": "c3a38190123812ac082bc0a06aa89f4b", "score": "0.60636055", "text": "function DBreadAllDevices() {\n\n return (\n knex(device_table_name).select().then(function (database_result) {\n return JSON.stringify(database_result);\n })\n\n );\n\n}", "title": "" }, { "docid": "9ab166f9e23688dc5d211c0a5bc7c6f4", "score": "0.604591", "text": "async getAllBlockDevices() {\n const filesystem = this;\n let args = [\"-a\", \"-b\", \"-l\", \"-J\", \"-O\"];\n let result;\n\n try {\n result = await filesystem.exec(\"lsblk\", args);\n const parsed = JSON.parse(result.stdout);\n return parsed.blockdevices;\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "c24232f4873453c3c39c439062748d14", "score": "0.6019034", "text": "async function getDevicesOfUser(userid) {\n var response;\n try {\n response = await redis.get(`gbridge:u${userid}:devices`);\n } catch (e) {\n console.error(\n \"Redis client error while fetching device for user \" + userid + \": \" + e\n );\n throw e;\n }\n\n if (response == null) {\n throw \"Redis client error while fetching devices for user \" +\n userid +\n \": device list empty\";\n return;\n }\n\n var info;\n\n try {\n info = JSON.parse(response);\n } catch (e) {\n console.error(\"JSON parsing error for user \" + userid + \": \" + e, null);\n throw e;\n }\n\n return info;\n}", "title": "" }, { "docid": "b824f4b068e6407729894b77fee39cd3", "score": "0.5995953", "text": "function showTopDevices(store) {\n store.getTopDevices().forEach(device => {\n device.getEvents().then(events => {\n console.log(`Device ${device.deviceId}:`);\n events.forEach(event => console.log(` ${event.timestamp} ${event.event}`));\n });\n });\n}", "title": "" }, { "docid": "4886c2ec93b36fd013df2ee269aa24b7", "score": "0.59943575", "text": "onDeviceListChanged(devices) {\n console.info(\"current devices\", devices);\n }", "title": "" }, { "docid": "4641b70cad3d70bd1df89941c7b020e7", "score": "0.5975918", "text": "scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }", "title": "" }, { "docid": "4641b70cad3d70bd1df89941c7b020e7", "score": "0.5975918", "text": "scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }", "title": "" }, { "docid": "4641b70cad3d70bd1df89941c7b020e7", "score": "0.5975918", "text": "scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }", "title": "" }, { "docid": "4641b70cad3d70bd1df89941c7b020e7", "score": "0.5975918", "text": "scan (){\n this.comm.getDeviceList().then(result => {\n this.runtime.emit(this.runtime.constructor.PERIPHERAL_LIST_UPDATE, result);\n });\n }", "title": "" }, { "docid": "7bceb79b4db93b79f13df95cbce51933", "score": "0.59733605", "text": "function findDevices (json, req, res) {\n\tvar token = req.query.token;\n\t\tvar paginate = config.paginate;\n\t\tvar page_limit = config.page_limit;\n\t\tvar sort = 'desc';\n\t\tvar from = null, to = null;\n\n\t\tif (req.query.macAddr) {\n\t\t\tif (req.query.macAddr.length === 0 ) {\n\t\t\t\tres.send({\n\t\t\t\t\t\"responseCode\" : '999',\n\t\t\t\t\t\"responseMsg\" : 'Missing parameter'\n\t\t\t\t});\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tjson['macAddr'] = util.getMacString(req.query.macAddr);\n\t\t}\n\t\tif (req.query.fport) {\n\t\t\tjson['fport'] = Number(req.query.fport);\n\t\t}\n\t\tif (req.query.sort) {\n\t\t\tsort = req.query.sort;\n\t\t}\n\n\t\tif (req.query.from){\n\t\t\tfrom = req.query.from;\n\t\t}\n\n\t\tif (req.query.to) {\n\t\t to = req.query.to;\n\t\t}\n\n\t\tif(req.query.paginate) {\n\t\t\tpaginate = (req.query.paginate === 'true');\n\t\t}\n\n\t\tif (req.query.limit) {\n\t\t\tpage_limit = Number(req.query.limit);\n\t\t}\n\n\t\tvar page = 1;\n\t\tif(req.query.page)\n\t\t\tpage = req.query.page;\n\t\tvar offset = (page-1) * page_limit;\n\n\t\t//Calculate pages\n\t\tvar next = Number(page)+1;\n\t\tif(page != 1)\n\t\t\tvar previous = Number(page)-1;\n\t\telse\n\t\t\tvar previous = Number(page);\n\t\t// var json = {macAddr: mac};\n\t\tif(from !== null && to !== null) {\n\t\t\tjson.recv = {$gte: from, $lte: to};\n\t\t}\n\t\t// Check token then get devices\n\t\t// json.macAddr = '0000000005010118';\n\n util.checkAndParseToken(token, res, function(err,result){\n\t\t\tif (err) {\n\t\t\t\tres.send({err});\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t//Token is ok\n\t\t\t\tconsole.log('**** query json :\\n'+JSON.stringify(json));\n\t\t\t\t// paginate = false;\n\t\t\t\tdbEvent.find(json, paginate, offset, page_limit, sort).then(function(data) {\n\t\t\t\t\t// on fulfillment(已實現時)\n\t\t\t\t\tif (paginate) {\n\t\t\t\t\t\tconsole.log('find devices : ' + data.docs.length);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log('find devices : ' + data.length);\n\t\t\t\t\t}\n\n\t\t\t\t\tres.status(200);\n\t\t\t\t\tres.setHeader('Content-Type', 'application/json');\n\t\t\t\t\tif (paginate) {\n\t\t\t\t\t\tres.json({\n\t\t\t\t\t\t\t\"responseCode\" : '000',\n\t\t\t\t\t\t\t\"pages\" : {\n\t\t\t\t\t\t\t\t\"next\": next,\n\t\t\t\t\t\t\t\t\"previous\": previous,\n\t\t\t\t\t\t\t\t\"last\": Math.ceil(data.total/page_limit),\n\t\t\t\t\t\t\t\t\"limit\": page_limit\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"total\": data.total,\n\t\t\t\t\t\t\t\"data\" : data.docs\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tres.json({\n\t\t\t\t\t\t\t\"responseCode\" : '000',\n\t\t\t\t\t\t\t\"total\": data.length,\n\t\t\t\t\t\t\t\"data\" : data\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}, function(reason) {\n\t\t\t\t\t// on rejection(已拒絕時)\n\t\t\t\t\tres.send({\n\t\t\t\t\t\t\"responseCode\" : '999',\n\t\t\t\t\t\t\"responseMsg\" : reason\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "17ce9bb56e2c5ce68f9452f5f3f37910", "score": "0.59698117", "text": "function particleListDevice(deviceName) {\n // get device info devices\n particle\n .listDevices({ auth: config.accessToken })\n .then(\n function(devices) {\n // search for the device name\n for (var i = 0; i < devices.body.length; i++) {\n console.log('Available device names: ', devices.body[i].name);\n\n // get id from device\n if (devices.body[i].name === deviceName) {\n config.deviceId = devices.body[i].id;\n console.log('Device found: ', devices.body[i].name, devices.body[i].id);\n\n // ok activate interaction\n $('#command').show();\n loggedIn = true;\n console.log('You are logged in and can use the device now :)');\n\n }\n }\n\n // particleGetVar('ps-voltage');\n\n // show the available commands when connection to the device has been established\n },\n function(err) {\n console.log('List devices call failed: ', err);\n }\n );\n }", "title": "" }, { "docid": "e5c866eb8c97c692a15466558b5a90d2", "score": "0.5963751", "text": "async function EnumerateDevices() {\n let devices = await navigator.usb.getDevices();\n\n numberOfDevices = 0;\n let detectedDevices = [];\n \n for (var device of devices) {\n do {\n var deviceName = null;\n\n if ((device.vendorId == 0x0E53 && device.productId == 0x2517) || (device.vendorId == 0x2C0D && device.productId == 0x0002)) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_PLUS_30S;\n } else if ((device.vendorId == 0x2C0D && device.productId == 0x0010)) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_PLUS_40S;\n } else if ((device.vendorId == 0x0E53 && device.productId == 0x2516) || (device.vendorId == 0x2C0D && device.productId == 0x0001)) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_STANDARD_30;\n } else if ((device.vendorId == 0x2C0D && device.productId == 0x000C)) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_STANDARD_40;\n } else if (device.vendorId == 0x2C0D && device.productId == 0x0006) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_WIRELESS_30S;\n } else if (device.vendorId == 0x2C0D && device.productId == 0x000B) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_WIRELESS_40S;\n } else if (device.vendorId == 0x2C0D && device.productId == 0x0009) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_EMBRAVA_EMBEDDED;\n } else if ((device.vendorId == 0x0E53 && device.productId == 0x2519) || (device.vendorId == 0x2C0D && device.productId == 0x0003)) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_MINI_30S;\n } else if (device.vendorId == 0x2C0D && device.productId == 0x000A) {\n deviceName = DEVICE_NAME_BLYNCLIGHT_MINI_40S;\n } else if (device.vendorId == 0x2C0D && device.productId == 0x0011) {\n\t\t\t\tdeviceName = DEVICE_NAME_BLYNCLIGHT_MINI_41S;\n\t\t\t}\n\n if (deviceName !== null) {\n\n var detectedDevice = new Object();\n detectedDevice.deviceName = deviceName;\n detectedDevice.device = device;\n detectedDevices[numberOfDevices] = detectedDevice;\n \n numberOfDevices++;\n }\n\n } while (false);\n }\n return detectedDevices;\n}", "title": "" }, { "docid": "1e535150f57649d071877bffafa51581", "score": "0.5951395", "text": "function getDevices(){\n $.ajax({\n url: '/device/list',\n type: 'GET',\n headers: { 'x-auth' : window.localStorage.getItem(\"authToken\") },\n dataType: 'json'\n }) .done(getDevicesSuccess)\n .fail(getDevicesFailure);\n}", "title": "" }, { "docid": "b7fd7942592da8ba815849ef0b67ae4c", "score": "0.5934834", "text": "function setDeviceData(){\n let headers = loadHeaders();\n let getData = callAPI(server + \"/api/mdm/devices/search\",headers,\"devicesData\");\n ogPicker(); //always set the og list\n}", "title": "" }, { "docid": "ec0412927aa12897cb3d7f7c9e967b94", "score": "0.592989", "text": "async listDevices(scraping_id) {\r\n const sql = `select device_id from scraping_pieces_index group by device_id`\r\n try {\r\n const result = await this.runQuery(sql);\r\n return result;\r\n } catch (err) {\r\n return null;\r\n }\r\n }", "title": "" }, { "docid": "69ab8c5b705d805098f19a5e47550155", "score": "0.5929624", "text": "function vektorResultDevices(models){\n VektorChooser.resultDevices = new VektorChooser.DeviceCollection(models);\n}", "title": "" }, { "docid": "69ab8c5b705d805098f19a5e47550155", "score": "0.5929624", "text": "function vektorResultDevices(models){\n VektorChooser.resultDevices = new VektorChooser.DeviceCollection(models);\n}", "title": "" }, { "docid": "706c878b277b16c2fbca5648b6d1ded8", "score": "0.59227496", "text": "async tryKnownDevices() {\n\n\t\tconst knownDevices = await this.getDevicesAsync();\n\t\tif (!knownDevices) return; // exit function if no known device are detected\n\t\tthis.log.info('Try to contact known devices');\n\n\t\t// Get IP-Adress of known devices and start reading data\n\t\tfor (const i in knownDevices) {\n\t\t\tconst deviceName = knownDevices[i].common.name;\n\t\t\tconst deviceIP = knownDevices[i].native.ip;\n\t\t\tconst deviceMac = knownDevices[i].native.mac;\n\n\t\t\tthis.log.info('Try to contact : \"' + deviceName + '\" on IP : ' + deviceIP);\n\n\t\t\t// Add IP adress to polling array\n\t\t\tthis.devices[knownDevices[i].native.ip] = deviceMac;\n\t\t\t// Refresh information\n\t\t\tconst result = await this.readData(deviceIP);\n\n\t\t\t// Error handling\n\t\t\tif (!result || result === 'failed') {\n\t\t\t\tthis.log.warn('Unable to connect to device : ' + deviceName + ' on IP : ' + deviceIP + ' Will retry at interval time');\n\t\t\t} else {\n\t\t\t\tthis.log.info('Device : \"' + deviceName + '\" Successfully connected on IP : ' + deviceIP);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "3b4613093fb7ef855172af59a9e3b3ff", "score": "0.5921633", "text": "function getAll (callback) {\n // returns all products\n Product.find({})\n .populate('manufacturer')\n .exec((error, products) => {\n if (error) return callback(`Failed to get product. => ${error}.`);\n productsResults = [];\n each(products, (item) => {\n const productItem = buildProduct(item);\n productsResults.push(productItem);\n });\n return callback(undefined, productsResults);\n });\n}", "title": "" }, { "docid": "5fd4eafe2f81960cfde5e92b95384264", "score": "0.59023756", "text": "static fetchAll(cb) {\n getProductsFile(cb);\n }", "title": "" }, { "docid": "44edcbb98bf9637755e7c87537149e72", "score": "0.5871966", "text": "async function listStore() {\n listClients({\n find: {\n matrix_id: infoUser.matrix_id,\n },\n filter: {\n name: 1\n }\n })\n .then((resp) => {\n setlistStores(resp);\n })\n .catch((error) => {\n console.log(error);\n });\n\n await listProducts({\n matrix_id: infoUser.matrix_id,\n limit: 5\n })\n .then(resp => {\n setDataProducts(resp);\n }).catch(err => console.log(err))\n }", "title": "" }, { "docid": "d3c31a5d48c68cc1b06a591186042b3b", "score": "0.5863748", "text": "async getDevice(name) {\n let self=this;\n /* check our cache */\n if(self.deviceCache.has(name)) {\n return self.deviceCache.get(name);\n }\n\n /* iterate over devices on Chain */\n for(let link of self.devices) {\n //console.log(link, link.title, name);\n if(link.title == name) {\n let device = await link.fetch();\n self.deviceCache.set(name, device);\n return device;\n }\n }\n\n /* create device */\n try {\n let device = await self.devices.create({\n name\n });\n console.log(\"Created \", name);\n self.deviceCache.set(name, device);\n return device;\n } catch(e) {\n console.log(\"Failed to create device %s: %s\", name, e.toString());\n //console.log(self.devices.items);\n }\n }", "title": "" }, { "docid": "0e80d3ff77c40e79afaa8ede87066326", "score": "0.5854562", "text": "async function getConnectedDevices(type) {\n const devices = await navigator.mediaDevices.enumerateDevices();\n return devices.filter(device => device.kind === type)\n}", "title": "" }, { "docid": "866dd94baf7d656d4090587135c55487", "score": "0.5848189", "text": "function getAirwatchDevices(groupId, search) {\n var tenant = scriptProps.getProperty(\"airWatchTenant\");\n var airwatchParams = getAirwatchParams();\n var response = UrlFetchApp.fetch(\"https://\" + tenant + \"/api/mdm/devices/search?pagesize=2000&lgid=\" + groupId + search, airwatchParams); \n var text = response.getContentText();\n var json = JSON.parse(text);\n var data = json.Devices;\n\n log(\"getAirwatchDevice data\", data);\n\n var airwatchDevices = {\n \"options\": []\n };\n\n for (var i = 0; i < data.length; i++) {\n var name = data[i].DeviceFriendlyName;\n\n //Slack max characters = 75\n //shorten computer name if > 50 characters (leaves 25 characters for SN)\n if (name.length > 50) {\n name = name.substring(0, 49);\n };\n\n var serialNumber = data[i].SerialNumber;\n\n //shorten SN if > 25 characters\n if (serialNumber.length > 25) {\n serialNumber = serialNumber.substring(0, 24);\n };\n\n name = name + \" - \" + serialNumber;\n var value = data[i].Id.Value;\n airwatchDevices.options[i] = {\n \"text\": {\n \"emoji\": true,\n \"type\": \"plain_text\",\n \"text\": name\n },\n \"value\": value.toString()\n }\n };\n\n return airwatchDevices;\n}", "title": "" }, { "docid": "a7bd4d2b620080df5b9d45518bd936ae", "score": "0.5844566", "text": "async function getConnectedDevices(type) {\n const devices = await navigator.mediaDevices.enumerateDevices()\n return devices.filter(device => device.kind === type)\n}", "title": "" }, { "docid": "43b61978348c5e5401fd159c17bcb171", "score": "0.5844467", "text": "function _LoadMoreDevices() {\n setModalVisible(true);\n dispatch(_GetDevices(resultCount + 2));\n setModalVisible(false);\n setResultCount(resultCount + 2);\n }", "title": "" }, { "docid": "387aa2a2b2c720ff49e97222fd0b372c", "score": "0.58183724", "text": "async getAllServices() {\n debug('get Dot4 service IDs from dot4SaKpiRepository');\n this.allServices = await this.request({\n method: 'get',\n url: '/api/service',\n });\n debug(`loaded ${this.allServices.length} services`);\n }", "title": "" }, { "docid": "5571568773bc434c36f89cc4f616b42a", "score": "0.58015376", "text": "async getAllSensorOnNodeByDevices(devices) {\n await Promise.all(devices.map(async device => {\n const sensor = await knex('sensors').select('*').where({ device_id: device.id });\n device.sensors = sensor;\n return 'deviceSensor'\n }));\n return devices;\n }", "title": "" }, { "docid": "0cdeea385628085250057a069d437182", "score": "0.57969886", "text": "function all() {\n var deferred = $q.defer();\n\n $http.get('/api/desembolsos/?format=json')\n .success(function (data) {\n deferred.resolve(data);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "b870ecbc24dbd48a7dc80bcc3092b7dd", "score": "0.5793721", "text": "function getDrivers() {\n $.get(\"/api/drivers\", renderDriverList);\n }", "title": "" }, { "docid": "2bc68086ca17dc6b9df3e1f5bebe9001", "score": "0.5791616", "text": "function get_device_list() {\n MsgBox(\"\\n获取设备信息 ...\");\n\n $(\"#button2\").attr('disabled',true);\n $.ajax({\n type: 'GET',\n url: 'http://127.0.0.1:3883/get_device_list',\n dataType:\"json\", //返回格式为json\n async:true,//请求是否异步,默认为异步,这也是ajax重要特性\n //data: $('#form1').serialize(),\n success: function (result) {\n console.log(result);//打印服务端返回的数据(调试用)\n devices=result.msg.device_list;\n setDevices();\n //alert(devices.length);\n var status = \"\\n获取设备信息: \"+result.resultCode+\"\\n\"+result.msg;\n MsgBox(status); \n $(\"#button2\").attr('disabled',false);\n },\n error : function() {\n MsgBox(\"发送错误: 获取设备信息 \\n\" + Error);\n $(\"#button2\").attr('disabled',false);\n }\n });\n}", "title": "" }, { "docid": "fb3b93110f4c0a68e150f5f17b3c37b5", "score": "0.5780697", "text": "discoverDevices() {\n const devices = this.config.devices;\n // loop over the discovered devices and register each one if it has not already been registered\n for (const device of devices) {\n const uuid = this.api.hap.uuid.generate(device.id);\n // see if an accessory with the same uuid has already been registered and restored from\n // the cached devices we stored in the `configureAccessory` method above\n const existingAccessory = this.accessories.find(accessory => accessory.UUID === uuid);\n if (existingAccessory) {\n // the accessory already exists\n this.log.info('Restoring existing accessory from cache:', existingAccessory.displayName);\n // Update config\n existingAccessory.context.device = device;\n this.api.updatePlatformAccessories([existingAccessory]);\n new platformAccessory_1.SomfyRTSPlatformAccessory(this, existingAccessory);\n // it is possible to remove platform accessories at any time using `api.unregisterPlatformAccessories`, eg.:\n // remove platform accessories when no longer present\n // this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [existingAccessory]);\n // this.log.info('Removing existing accessory from cache:', existingAccessory.displayName);\n }\n else {\n // the accessory does not yet exist, so we need to create it\n this.log.info('Adding new accessory:', device.name);\n // create a new accessory\n const accessory = new this.api.platformAccessory(device.name, uuid);\n // store a copy of the device object in the `accessory.context`\n accessory.context.device = device;\n new platformAccessory_1.SomfyRTSPlatformAccessory(this, accessory);\n this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);\n }\n }\n }", "title": "" }, { "docid": "1d2821dfb433dbbc10e88e7996db6be7", "score": "0.57777613", "text": "discoverDevices() {\n const upsDevices = [\n {\n uniqueId: 'ups1',\n displayName: 'UPS',\n },\n ];\n // loop over the discovered devices and register each one if it has not already been registered\n for (const device of upsDevices) {\n // generate a unique id for the accessory this should be generated from\n // something globally unique, but constant, for example, the device serial\n // number or MAC address\n const uuid = this.api.hap.uuid.generate(device.uniqueId);\n // see if an accessory with the same uuid has already been registered and restored from\n // the cached devices we stored in the `configureAccessory` method above\n const existingAccessory = this.accessories.find(accessory => accessory.UUID === uuid);\n if (existingAccessory) {\n // the accessory already exists\n this.log.info('Restoring existing accessory from cache:', existingAccessory.displayName);\n // if you need to update the accessory.context then you should run `api.updatePlatformAccessories`. eg.:\n // existingAccessory.context.device = device;\n // this.api.updatePlatformAccessories([existingAccessory]);\n // create the accessory handler for the restored accessory\n // this is imported from `platformAccessory.ts`\n new platformAccessory_1.UpsBatteryServiceAccessory(this, this.log, this.config, this.api, existingAccessory);\n }\n else {\n // the accessory does not yet exist, so we need to create it\n this.log.info('Adding new accessory:', device.displayName);\n // create a new accessory\n const accessory = new this.api.platformAccessory(device.displayName, uuid);\n // store a copy of the device object in the `accessory.context`\n // the `context` property can be used to store any data about the accessory you may need\n accessory.context.device = device;\n // create the accessory handler for the newly create accessory\n // this is imported from `platformAccessory.ts`\n new platformAccessory_1.UpsBatteryServiceAccessory(this, this.log, this.config, this.api, accessory);\n // link the accessory to your platform\n this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [accessory]);\n }\n // it is possible to remove platform accessories at any time using `api.unregisterPlatformAccessories`, eg.:\n // this.api.unregisterPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory]);\n }\n }", "title": "" }, { "docid": "9afab67f32b8840ae886551730d2e04f", "score": "0.57732475", "text": "function loadAll() {\n return AirportService.fetch();\n }", "title": "" }, { "docid": "6e9768499974174cdd3fe0971e58b1b5", "score": "0.57641447", "text": "static fetchAll(cb) {\n getProductsFromFile(cb);\n }", "title": "" }, { "docid": "dfed22aa2e228418d5641acee0eb6408", "score": "0.5743044", "text": "function populateDevices() {\n const result = $.ajax({\n url: 'https://api.spotify.com/v1/me/player/devices',\n type: 'GET',\n headers: {\n 'Authorization': 'Bearer ' + access_token\n },\n error: function () {\n console.log(\"error fetching devices!\");\n return;\n }\n })\n\n //successfully grabbed devices list\n result.done(function (data) {\n let $dropdown = $(\"#device-dropdown\");\n data.devices.forEach(function (device) {\n $dropdown.append($(\"<option>\", {\n value: device.id,\n text: device.name\n }));\n });\n });\n\n //failed to grab devices list\n result.fail(function (jqXHR, textStatus, errorThrown) {\n console.log(textStatus + ': ' + errorThrown);\n });\n}", "title": "" }, { "docid": "7e66fae901c34fe6055de9bab99b17d1", "score": "0.5742007", "text": "function retrieveAll() {\n console.log(\"* ProductsController: retrieveAll\");\n ProductsService\n .retrieveAll()\n .then(function (data) {\n console.log(\"> Controller Result:\", data);\n vm.result = data;\n // vm.result.sort(CommonService.sortCusine);\n })\n .catch(function (err) {\n console.log(\"> Controller Error:\", err);\n // console.log(\"Controller Error 2:\", JSON.stringify(err));\n });\n }", "title": "" }, { "docid": "f06455d7e8070184975f2978eb5b3970", "score": "0.57360286", "text": "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "title": "" }, { "docid": "4da7e1ee2d78f7c61c9870c3966fb3fc", "score": "0.5731553", "text": "async function loadOsListAll() {\n setLoadingOsList(true);\n const situationsString = \"3,4,5,6,7\";\n\n try {\n const response = await api.get(\n `/serviceOrders/index/?situations=${situationsString}`\n );\n\n if (response) {\n console.log(response.data);\n setOsList(response.data);\n setLoadingOsList(false);\n }\n } catch (error) {\n setLoadingOsList(false);\n\n if (error.response) {\n const dataError = error.response.data;\n const statusError = error.response.status;\n console.error(dataError);\n console.error(statusError);\n\n if (statusError === 400 && dataError.message) {\n switch (dataError.message) {\n // case '\"nameFantasyClient\" is required':\n // notify(\n // \"error\",\n // \"Oops, algo deu errado, entre em contato com o suporte de TI. Erro: o QUERY PARAM 'nameFantasyClient' não foi encontrado no endereço da rota.\"\n // );\n // break;\n\n default:\n notify(\"warning\", dataError.message);\n }\n }\n\n if (statusError === 401) {\n switch (dataError.message) {\n default:\n notify(\"warning\", dataError.message);\n }\n }\n } else if (error.request) {\n notify(\n \"error\",\n `Oops, algo deu errado, entre em contato com o suporte de TI. ${error}`\n );\n } else {\n notify(\n \"error\",\n `Oops, algo deu errado, entre em contato com o suporte de TI. ${error}`\n );\n }\n }\n }", "title": "" }, { "docid": "b4095510510a5610ad80cc53b4338b71", "score": "0.57224244", "text": "static fetchAll(cb) {\n getProductsFromFile(cb);\n }", "title": "" }, { "docid": "fb1309b9c1129db83bad48d5d1321e2f", "score": "0.5721908", "text": "async function getProducts() {\r\n\ttry {\r\n\t\tconst response = await fetch(`http://localhost:${PORT}/api/productos`);\r\n\t\tio.sockets.emit(\"listProducts\", await response.json());\r\n\t} catch (err) {\r\n\t\tlogger.error(err);\r\n\t}\r\n}", "title": "" }, { "docid": "5282fdb2f09059718ed5b9cc4e5375b3", "score": "0.57148486", "text": "onDevices(devices) {\r\n\r\n function addDevice(device) {\r\n var deviceType = (device.kind === 'videoinput') ? 'camera' :\r\n (device.kind === 'audioinput') ? 'microphone' :\r\n (device.kind === 'audiooutput') ? 'speaker' : 'unknown';\r\n\r\n var option = document.createElement('option');\r\n option.text = deviceType + ': ' + device.label;\r\n option.value = device.id;\r\n selectList.options.add(option);\r\n }\r\n\r\n var selectList = document.getElementById(deviceListId);\r\n // Empty the select list.\r\n for (var i = selectList.options.length; i >= 0; i--) {\r\n selectList.remove(i);\r\n }\r\n\r\n // Add all of the devices to the select list.\r\n var safeDevices = {\r\n camera: devices.camera || [],\r\n microphone: devices.microphone || [],\r\n speaker: devices.speaker || []\r\n };\r\n var deviceList = safeDevices.camera.concat(safeDevices.microphone).concat(safeDevices.speaker);\r\n deviceList.forEach(addDevice);\r\n }", "title": "" }, { "docid": "5282fdb2f09059718ed5b9cc4e5375b3", "score": "0.57148486", "text": "onDevices(devices) {\r\n\r\n function addDevice(device) {\r\n var deviceType = (device.kind === 'videoinput') ? 'camera' :\r\n (device.kind === 'audioinput') ? 'microphone' :\r\n (device.kind === 'audiooutput') ? 'speaker' : 'unknown';\r\n\r\n var option = document.createElement('option');\r\n option.text = deviceType + ': ' + device.label;\r\n option.value = device.id;\r\n selectList.options.add(option);\r\n }\r\n\r\n var selectList = document.getElementById(deviceListId);\r\n // Empty the select list.\r\n for (var i = selectList.options.length; i >= 0; i--) {\r\n selectList.remove(i);\r\n }\r\n\r\n // Add all of the devices to the select list.\r\n var safeDevices = {\r\n camera: devices.camera || [],\r\n microphone: devices.microphone || [],\r\n speaker: devices.speaker || []\r\n };\r\n var deviceList = safeDevices.camera.concat(safeDevices.microphone).concat(safeDevices.speaker);\r\n deviceList.forEach(addDevice);\r\n }", "title": "" }, { "docid": "45875d59d9263948b8a31fc8b2ccd445", "score": "0.57123804", "text": "function updateDeviceList() {\n var timeNow = Date.now();\n\n $.each(devices, function(key, device) {\n // Only show devices that have been updated during the last 10 seconds.\n if (device.timeStamp + 10000 > timeNow) {\n displayDevice(device)\n } else {\n // Remove inactive device.\n removeDevice(device)\n }\n })\n }", "title": "" }, { "docid": "47cf3851142dc8d1391f505349362f80", "score": "0.5695394", "text": "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "title": "" }, { "docid": "45ec613bb87dcb3974effe585f24cae2", "score": "0.56859887", "text": "function getAllData(){\n\t$.get( getData_endpoint, function( data ) {\n\t\tconsole.log(data);\n\n //Don't refresh dataset unless it is necessary\n if (dataset.version == data.version){ console.log(\"No new data\"); return true;}\n\n\t\t//INIT MODE - Still not doing packet Capturing\n\t\tif (data.mode == \"init\"){\n //Avoid overfilling the dropdown for AP selection\n if (document.getElementById(\"setup_ap\").options.length <= 1){\n AP_update(data);\n }\n\t\t}\n //MONITOR MODE - Capturing mode\n\t\telse{\n\n //If we are switching from AP select to monitor mode. Then make all graphs and spaces visible.\n if (dataset.mode != \"mon\"){\n prep_monitor_mode(data)\n refreshMainTable(data)\n }\n\n //Update the list of APs in case it hasn;t already been updated\n if (document.getElementById(\"setup_ap\").options.length <= 1){\n AP_update(data);\n //TODO: Not that imporant, but perhaps fill the AP_select and AP_pass in\n }\n\n\t\t //Check if we need to add any more clients to the website.\n\t\t if ((dataset.clients == undefined) || (data.clients.length > dataset.clients.length)){\n\t\t \tn = 0\n\t\t \tif (dataset.clients != undefined){ n = dataset.clients.length}\n\n\t\t \tfor (i = n; i < data.clients.length; i++){\n if (data.clients[i].mac != data.monitor_info.mac){ //Don't Add The AP\n \t\t\t\taddClient(data.clients[i])\n \t\t\t\t//console.log(\"Created: \"+data.clients[i].mac)\t\n }\n\t\t \t}\n\n\t\t }\n\n refreshClientInfo(data) //Refresh Client Info (Leaks Usage, etc..)\n\t\t refreshClientGraphs(data)\t//Refresh Client Graphs\n refreshMainGraph(data) //Refresh Main Graph\n\t\t}\n\n\n\t\tdataset = data \t//Update Dataset\n\t});\t\n}", "title": "" }, { "docid": "e6b3e0ea0ba0b2a2c42d108547ab3549", "score": "0.5678979", "text": "function queryAllProducts() {\n\n console.log();\n console.log(\"ALL AVAILABLE ITEMS:\");\n console.log(\"-----------------------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price);\n }\n console.log(\"-----------------------------------\\n\");\n });\n}", "title": "" }, { "docid": "b5035245de5312ddb3f88e6ae7a0ff79", "score": "0.566119", "text": "fetch () {\n this._makeRequest('GET', resources);\n }", "title": "" }, { "docid": "ad5e01d6f6a6ac0691f518f6387fd1bf", "score": "0.5648899", "text": "async fetchAll(requisition, response){\n await Model.find({mac:{'$in': requisition.params.mac}}).sort('when').then(resp => {\n return response.status(200).json(resp);\n }).catch(error =>{ return response.status(500).json(error)});\n }", "title": "" }, { "docid": "ecc3f93014dbfa998c2493288ba25863", "score": "0.5647992", "text": "async init () {\r\n debug('Initializing plugin');\r\n var rawDevices = await idbCompanion.list();\r\n\r\n this.availableDevices = deviceList.parse(rawDevices);\r\n debug(`Found ${this.availableDevices.length} devices`);\r\n }", "title": "" }, { "docid": "97fcb5b54ee057aec29b2f4a5a5785ea", "score": "0.56479216", "text": "function getDeviceTypes() {\n return deviceService.getTypes()\n .then(function (data) {\n vm.deviceTypes = data.data;\n });\n }", "title": "" }, { "docid": "4b2bb5f58ba100a0bd11e758bb77dcee", "score": "0.56410795", "text": "static fetchAll() {\n return db.execute('SELECT * FROM products');\n }", "title": "" }, { "docid": "dc8467465ee3ce54af3f5df84521f6e0", "score": "0.5626895", "text": "function getdevicelist (dev, callback)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n {\n if (typeof (dev) === 'undefined' || dev === null || dev.length < 1) dev = '-12';\n webphone_api.plhandler.GetDeviceList(dev, callback);\n }\n}", "title": "" }, { "docid": "8d16b0e8633a96f3f834da90d6b31628", "score": "0.5617069", "text": "function getAllDeviceResourceIdsForProfile(api, id, query) {\n return api_1.GET(api, `/profiles/${id}/relationships/devices`, { query })\n}", "title": "" }, { "docid": "2d22a9d112f8e2212b8cd6c9cba0ed9f", "score": "0.5608575", "text": "function fetchAllUsers() {\n var deferred = $q.defer();\n $http.get(REST_SERVICE_URI)\n .then(\n function (response) {\n deferred.resolve(response.data);\n },\n function(errResponse){\n console.error('Error while fetching Users');\n deferred.reject(errResponse);\n }\n );\n return deferred.promise;\n }", "title": "" }, { "docid": "8f9b68ab984a428f93ecc98d047022fe", "score": "0.5606963", "text": "async function fetchEquipmentModels() {\n\t\ttry {\n\t\t\tconst res = await getEquipmentModels();\n\t\t\treturn res;\n\t\t} catch (e) {\n\t\t\tsetModelData();\n\t\t\tconsole.error(e.message);\n\t\t}\n\t}", "title": "" }, { "docid": "3db4225d75666f5a2e826bbbd1ea63d5", "score": "0.55908763", "text": "componentDidMount() {\n if (this.props.devices.length === 0) {\n this.props.getUserDevices(this.props.userInfo._id);\n }\n }", "title": "" }, { "docid": "a2f1a5a5bd4143c4e4919186bdc13baf", "score": "0.5580888", "text": "load() {\n\t\ttry {\n\t\t\tif(!Device) {\n\t\t\t\tDevice = require('./device');\n\t\t\t}\n\n\t\t\tlet devices = fs.readFileSync('./devices.json');\n\t\t\tdevices = JSON.parse(devices);\n\n\t\t\tdevices = devices.map(d => Device.fromJSON(d));\n\t\t\tthis.devices = devices;\n\t\t} catch(err) {\n\t\t\treturn redfox.error('[MANAGER] Could not load device list, file exists ?', err);\n\t\t}\n\t}", "title": "" }, { "docid": "b98f75057810c512819d769a1d30e27f", "score": "0.55731326", "text": "function _cleanAllDevicesFromDB() {\n SpecialBle.cleanDevicesDB();\n _getAllDevicesFromDB();\n }", "title": "" }, { "docid": "cce6f8fa0a44ca8e3ad73026d8e5defb", "score": "0.5571745", "text": "function listDevices(client, registryId, projectId, cloudRegion) {\n // [START iot_list_devices]\n // Client retrieved in callback\n // getClient(serviceAccountJson, function(client) {...});\n // const cloudRegion = 'us-central1';\n // const projectId = 'adjective-noun-123';\n // const registryId = 'my-registry';\n const parentName = `projects/${projectId}/locations/${cloudRegion}`;\n const registryName = `${parentName}/registries/${registryId}`;\n\n const request = {\n parent: registryName,\n };\n\n client.projects.locations.registries.devices.list(request, (err, res) => {\n if (err) {\n console.log('Could not list devices');\n console.log(err);\n } else {\n const data = res.data;\n console.log('Current devices in registry:', data['devices']);\n }\n });\n // [END iot_list_devices]\n}", "title": "" }, { "docid": "015e7ec4c464034592bed622599db5f6", "score": "0.5568736", "text": "function getMediaDevices() {\n navigator.getMediaDevices(function(devices) {\n returnToTest(JSON.stringify(devices));\n });\n}", "title": "" }, { "docid": "bac29bb4f22d751af28418db33af7451", "score": "0.5566305", "text": "static all() {\n return request.get(`cards/all`);\n }", "title": "" }, { "docid": "c9ee3fcd46a093c6986f9d9ea22ede40", "score": "0.55618113", "text": "function queryAllProducts (){\n\tconnection.query(\"SELECT * FROM products\", function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Id: \" + res[i].id + \" | \" + res[i].productName + \" | \" + \"$\" + res[i].price);\n\t\t}\n\t\tconsole.log(\"---------------------------------------------------\");\n\t});\n}", "title": "" }, { "docid": "5dc655aef2df0be6b02feb9be241aac0", "score": "0.5557957", "text": "function readProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n //displays all the products\n //callback(res);\n if (err) throw err;\n displayAll(res);\n anotherAction();\n });\n}", "title": "" }, { "docid": "a59f044463d52e81df69da3d6d5a5219", "score": "0.5555269", "text": "function getAllDeviceTypes(req, res, next){\t\n\tutils.dbHandler(req, res, next, function(){\n\t\treturn dbDevice.getAllDeviceTypes();\n\t});\n}", "title": "" } ]
bf14b45a74d75081ec512c1678c47ba4
=========================================================================== Save the match info and tally the frequency counts. Return true if the current block must be flushed.
[ { "docid": "745adf751257bd1075cb5cd6d7e4a7de", "score": "0.0", "text": "function _tr_tally(s, dist, lc)\n// deflate_state *s;\n// unsigned dist; /* distance of matched string */\n// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */\n{\n //var out_length, in_length, dcode;\n\n s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;\n s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;\n\n s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;\n s.last_lit++;\n\n if (dist === 0) {\n /* lc is the unmatched char */\n s.dyn_ltree[lc*2]/*.Freq*/++;\n } else {\n s.matches++;\n /* Here, lc is the match length - MIN_MATCH */\n dist--; /* dist = match distance - 1 */\n //Assert((ush)dist < (ush)MAX_DIST(s) &&\n // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&\n // (ush)d_code(dist) < (ush)D_CODES, \"_tr_tally: bad match\");\n\n s.dyn_ltree[(_length_code[lc]+LITERALS+1) * 2]/*.Freq*/++;\n s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;\n }\n\n// (!) This block is disabled in zlib defailts,\n// don't enable it for binary compatibility\n\n//#ifdef TRUNCATE_BLOCK\n// /* Try to guess if it is profitable to stop the current block here */\n// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {\n// /* Compute an upper bound for the compressed length */\n// out_length = s.last_lit*8;\n// in_length = s.strstart - s.block_start;\n//\n// for (dcode = 0; dcode < D_CODES; dcode++) {\n// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);\n// }\n// out_length >>>= 3;\n// //Tracev((stderr,\"\\nlast_lit %u, in %ld, out ~%ld(%ld%%) \",\n// // s->last_lit, in_length, out_length,\n// // 100L - out_length*100L/in_length));\n// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {\n// return true;\n// }\n// }\n//#endif\n\n return (s.last_lit === s.lit_bufsize-1);\n /* We avoid equality with lit_bufsize because of wraparound at 64K\n * on 16 bit machines and because stored blocks are restricted to\n * 64K-1 bytes.\n */\n}", "title": "" } ]
[ { "docid": "0ca90ef8fb3f1efbd838cf2cc95ccf50", "score": "0.52413577", "text": "function increaseMatchCount() {\n gameData.matchCount++;\n }", "title": "" }, { "docid": "12214a13ee3db1f6f7c712fc675a2e8c", "score": "0.523929", "text": "function updateMatches(){\n checkMatches = 1;\n}", "title": "" }, { "docid": "bfc74dd8995f2276413d700c8bab7e9b", "score": "0.5234234", "text": "function checkForMatch(){\n if(firstTile.dataset.type === secondTile.dataset.type) {\n matchCounter++;\n matchCount.innerHTML = `Total Matches: ${matchCounter}`;\n disableTiles();\n return;\n }\n unflipTiles();\n}", "title": "" }, { "docid": "b6a3e566f53a9cfd1b66a5cbb4f2b170", "score": "0.51704645", "text": "finishMatch(round, match) {\n this.matchStatus[round][match] = true;\n this.updateStatus();\n }", "title": "" }, { "docid": "47b7c42021c6f3a1df237b335b6bf6ab", "score": "0.50959414", "text": "function matcher() {\n tracker.matchingBlocks = tracker.activeBlocks.filter(function(elem) {\n return elem.word.slice(0, current.length).toLowerCase() == current.join('').toLowerCase();\n });\n if (tracker.matchingBlocks.length != 0 && tracker.matchingBlocks.length != tracker.activeBlocks.length) {\n tracker.lastMatches = tracker.matchingBlocks;\n };\n }", "title": "" }, { "docid": "fa042d41ef2beb5f24606060ec028064", "score": "0.5083766", "text": "function checkMatch() {\n console.log('checking match');\n movesCount++;\n document.getElementById('moves').innerHTML = movesCount;\n if (firstFlippedCard.dataset.cardId === secondFlippedCard.dataset.cardId) {\n markCardsComplete();\n console.log('match = true');\n if (gameFinishedCount == 8) {\n gameFinished();\n }\n return;\n }\n console.log('match = false');\n reflipCards();\n}", "title": "" }, { "docid": "67f18ceade06d47f3d2f0bb3d3349326", "score": "0.49240538", "text": "shouldComponentUpdate({ count }) {\n const pending = count - this.lastFlushCount\n\n if (pending >= this.flushCount) {\n this.log('flush count (age %dms)', this.age())\n return true\n }\n\n if (this.age() >= this.flushInterval) {\n this.log('flush interval (count %d)', pending)\n return true\n }\n\n return false\n }", "title": "" }, { "docid": "79e49213301c6ea39ffd419d8412aaa0", "score": "0.4908257", "text": "function allMatched() {\n setTimeout(function() {\n correctCount = 0;\n cardStartCount++;\n arrangeCards(cardStartCount);\n }, flipSpeed);\n }", "title": "" }, { "docid": "db869cae44d2bca71a9f4ab9bf80fc1d", "score": "0.4869295", "text": "function startMatch() {\n if (matchWords()) {\n isPlaying = true;\n time = currentLevel + 1;\n wordsData();\n wordInput.value = '';\n score++;\n if (localStorage.getItem('hiScore') < score) {\n localStorage.setItem('hiScore', score);\n displayHiScore();\n }\n };\n if (score === -1) {\n scoreDisplay.innerHTML = 0;\n } else {\n scoreDisplay.innerHTML = score;\n }\n}", "title": "" }, { "docid": "c54d208fa7c769c8ceea221e0c7ed41a", "score": "0.48325133", "text": "function checkWin() {\n matchesFound += 1;\n if (matchesFound == stack.length) {\n setTimeout(showResults, 750); /* gives the user a second to look at the final match before showing the success modal*/\n }\n}", "title": "" }, { "docid": "3c7301c576e33a882c0a6b3c7a6218bd", "score": "0.48096946", "text": "function isMatch () {\n ++game.score;\n const list = document.body.querySelector('.deck');\n let match = list.querySelectorAll('li.card.open.show');\n match[0].className = 'card match';\n match[1].className = 'card match';\n\n game.cardA = null;\n game.cardB = null;\n\n if(game.score === (game.deck.length/2)) {\n popCongrats();\n resetTimer();\n }\n }", "title": "" }, { "docid": "a73f7f769898ea747ad44e51eae87d8d", "score": "0.48092794", "text": "function noteMatch(matchArr) {\n if ($(matchArr[1][0]).attr('src') === $(matchArr[2][0]).attr('src')) {\n correctCount++;\n clicksAllowed = true;\n } else {\n $(matchArr[1]).parents('.card').removeClass('flipped');\n $(matchArr[2]).parents('.card').removeClass('flipped');\n setTimeout(function() {\n TweenLite.to([\n $(matchArr[1]).parents('.card'),\n $(matchArr[2]).parents('.card')\n ], speed, {\n rotationY: -360,\n ease: Back.easeOut,\n onComplete: function() { clicksAllowed = true; }\n });\n }, flipSpeed);\n }\n if (cardCountArray[cardStartCount] === correctCount) {\n allMatched();\n }\n matchCount = 0;\n }", "title": "" }, { "docid": "1a84e2aeb1d04ee0ca2c351d372d3350", "score": "0.48057726", "text": "function recordData() {\n\n\n //Skip the rest of the request if there aren't any matches that need to be updated.\n if (matchesData.length == 0) {\n completeData();\n return;\n }\n\n console.log(\"Recording Data!\");\n\n var matchesBuffer = [];\n\n for (match in matchesData) {\n\n\n var matchData = buildMatchData.build({statusCode: \"200\", body: JSON.stringify(matchesData[match])});\n\n matchesBuffer.push(matchData);\n\n }\n\n console.log(\"Matches Buffer:\");\n\n console.log(matchesBuffer);\n\n var bufferOutput = readBuffer.read(matchesBuffer);\n\n console.log(bufferOutput);\n\n\t\t\tvar con = mysql.createConnection({\n\t\t\t\thost: \"localhost\",\n\t\t\t\tuser: \"frickmh\",\n\t\t\t\tpassword: \"rbbsbfh11\",\n\t\t\t\tdatabase: \"carryfactor_\" + region\n\t\t\t}); \n\n completeData();\n\n basicQuery.query(con, bufferOutput.sql);\n\n }", "title": "" }, { "docid": "69eed36dd13e90415d67c451606b2eff", "score": "0.4803976", "text": "checkMatchesStatus() {\n var numMatches = 0;\n\n if (matchesArr !== undefined) {\n matchesArr.forEach(match => {\n var messageAlreadySent = messagesSent.includes(match.id);\n\n if (!messageAlreadySent) {\n var matchDate = moment.utc(match.utcDate);\n var now = moment.utc(moment.now());\n var diff = moment.duration(matchDate.diff(now));\n var diffMinutes = Math.floor(diff.asMinutes());\n\n // send message if match has started in the last 5 minutes\n // the reason for this is that the MatchThreadder bot doesn't seem to respond\n // consistently to messages made 5 minutes before a match.\n if (diffMinutes <= 0 && diffMinutes >= -5) {\n numMatches++\n var homeTeam = match.homeTeam.name;\n var awayTeam = match.awayTeam.name;\n \n message.sendMessage(homeTeam, awayTeam);\n messagesSent.push(match.id);\n utils.log(`Sent message for ${homeTeam} vs ${awayTeam}.`);\n }\n }\n });\n\n if (numMatches === 0) {\n utils.log(\"No new matches in progress.\");\n }\n }\n }", "title": "" }, { "docid": "1ea4f04a840514836e33bc38e7d3e243", "score": "0.47966054", "text": "function addMatchCount(){\n \tsetTimeout(function(){\n \t\tmatchCount++;\n \t\tif(matchCount === cardOptions.length/2){\n \t\t\tclearInterval(myTimer);\n \t\t\tdisplayWinScreen();\n \t\t}\n \t}, 2000);\n }", "title": "" }, { "docid": "326d65f91c9cf3666669682741b85f4d", "score": "0.4745075", "text": "verifyData() {\n this.verifyStatus = true;\n const self = this;\n if(this.ownBuffer.length) {\n var own = this.ownBuffer.shift();\n if(this.lastAdded) {\n while(this.lastAdded.t > own.t || (this.lastAdded.t === own.t && this.lastAdded.type >= own.type)) {\n if(this.ownBuffer.length) own = this.ownBuffer.shift();\n else {\n own = {};\n break;\n }\n }\n }\n }\n else var own = {};\n var others = [];\n for(var [key, each] of Object.entries(self.otherBuffers)) {\n if(each.length) {\n var other = each.shift();\n if(this.lastAdded) {\n while(this.lastAdded.t > other.t || (this.lastAdded.t === other.t && this.lastAdded.type >= other.type)) {\n if(each.length) other = each.shift();\n else {\n other = {};\n break;\n }\n }\n }\n if(other !== {}) {\n other.src = key;\n others.push(other);\n }\n }\n }\n if(own === {} && others === []) {\n this.verifyStatus = false;\n return;\n }\n var [state, trueData] = this.getTrueData(own, others);\n if(!state) {\n this.verifyStatus = false;\n return;\n }\n database.addData(trueData, function () {\n self.lastAdded = {type: trueData.type, t: trueData.t};\n self.verifyData();\n });\n }", "title": "" }, { "docid": "dcf5ae7bdb1cccf4aad6166f5e763d86", "score": "0.47343153", "text": "function recordUpdater (battleInfo) {\n\tlet newRecords = { ...battleInfo.recordTracker};\n\n\tif (battleInfo.tick === 0) {\n\t\tlet recordsToTrack = [...recordKeys];\n\t\tlet allyFound = false;\n\t\tbattleInfo.objectsToRender.forEach((object)=>{\n\t\t\tif (object.type === 'User') {\n\t\t\t\tif (object.attributes.CurrentCapacitor < newRecords.minEnergyStored){\n\t\t\t\t\tnewRecords.minEnergyStored = object.attributes.CurrentCapacitor;\n\t\t\t\t}\n\t\t\t} else if (object.team === 0) {\n\t\t\t\tallyFound = true;\n\t\t\t}\n\t\t})\n\t\tif (!allyFound) {\n\t\t\trecordsToTrack.splice(recordsToTrack.indexOf('allyHasDied'), 1);\n\t\t}\n\t\tnewRecords.recordsToTrack = recordsToTrack;\n\t} else {\n\t\tlet recordsToTrack = [...battleInfo.recordTracker.recordsToTrack];\n\t\trecordsToTrack.forEach((recordType, recordIndex)=>{\n\t\t\tswitch(recordType) {\n\t\t\t\tcase 'totalDamageTaken' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'damageTaken') {\n\t\t\t\t\t\t\t\tnewRecords.totalDamageDealt += entry.value\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'totalDamageDealt' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'damageDealt') {\n\t\t\t\t\t\t\t\tnewRecords.totalDamageDealt += entry.value\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'minEnergyStored' : {\n\t\t\t\t\tbattleInfo.objectsToRender.forEach((object)=>{\n\t\t\t\t\t\tif (object.type === 'User' && object.attributes.CurrentCapacitor < newRecords.minEnergyStored) {\n\t\t\t\t\t\t\tnewRecords.minEnergyStored = object.attributes.CurrentCapacitor;\n\t\t\t\t\t\t\tif (object.attributes.CurrentCapacitor === 0) {\n\t\t\t\t\t\t\t\trecordsToTrack.splice(recordIndex, 1);\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'dealtNonCollision' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'damageDealt' && !entry.superTypes.includes('Collision')) {\n\t\t\t\t\t\t\t\tnewRecords.dealtNonCollision = true;\n\t\t\t\t\t\t\t\trecordsToTrack.splice(recordIndex, 1);\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'dealtNonMelee' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'damageDealt' && !entry.superTypes.includes('Melee')) {\n\t\t\t\t\t\t\t\tnewRecords.dealtNonMelee = true;\n\t\t\t\t\t\t\t\trecordsToTrack.splice(recordIndex, 1);\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'dealtNonRanged' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'damageDealt' && !entry.superTypes.includes('Ranged')) {\n\t\t\t\t\t\t\t\tnewRecords.dealtNonRanged = true;\n\t\t\t\t\t\t\t\trecordsToTrack.splice(recordIndex, 1);\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'allyHasDied' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'allyDied') {\n\t\t\t\t\t\t\t\tnewRecords.allyHasDied = true;\n\t\t\t\t\t\t\t\trecordsToTrack.splice(recordIndex, 1);\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'hasMoved' : {\n\t\t\t\t\tif (battleInfo.recordTracker.recordChanges.length > 0){\n\t\t\t\t\t\tbattleInfo.recordTracker.recordChanges.forEach((entry)=>{\n\t\t\t\t\t\t\tif (entry.name === 'userBotMoved') {\n\t\t\t\t\t\t\t\tnewRecords.hasMoved = true;\n\t\t\t\t\t\t\t\trecordsToTrack.splice(recordIndex, 1);\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\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\tnewRecords.recordsToTrack = recordsToTrack;\n\t}\n\tnewRecords.recordChanges = [];\n\t// console.log({newRecords});\n\treturn newRecords;\n}", "title": "" }, { "docid": "97c9567a704c21ebfae94a4abac831d1", "score": "0.4725765", "text": "function isFlush(){\n for(var i = 0; i < 4; i ++){\n if(suitsArray[i] != suitsArray[i+1]){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "ee359714143027f55ffe897621268655", "score": "0.46985298", "text": "function checkMatch(currId){\n if (Number(flagElements[currId].id)+1 == flagorder[Flagcounter-1]){\n // console.log(\"TJOHO!\");\n score +=1;\n facit.style.display = 'block';\n facit.className = \"facitR2\";\n facit.innerHTML = \"Correct!\";\n deltest3.score += 1;\n if (score == 9) {\n nextLink.style.display = 'block';\n facit.innerHTML = \"Wow, full points!\";\n }\n }else {\n // console.log(\"Wrong\");\n toggleClickable();\n nextLink.style.display = 'block';\n facit.style.display = 'block';\n facit.className = \"facitF2\";\n facit.innerHTML = \"Wrong!\";\n }\n scoreKeeper.innerHTML = \"score: \" + deltest3.score;\n\n \t}", "title": "" }, { "docid": "e9c0c25f0d8416990400e315f11f4595", "score": "0.46614942", "text": "function deflate_fast(flush) {\n\t\t\t// short hash_head = 0; // head of the hash chain\n\t\t\tvar hash_head = 0; // head of the hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\t// At this point we have always match_length < MIN_MATCH\n\n\t\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\t\t\t\t}\n\t\t\t\tif (match_length >= MIN_MATCH) {\n\t\t\t\t\t// check_match(strstart, match_start, match_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n\t\t\t\t\tlookahead -= match_length;\n\n\t\t\t\t\t// Insert new strings in the hash table only if the match length\n\t\t\t\t\t// is not too large. This saves time but degrades compression.\n\t\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n\t\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\tstrstart++;\n\n\t\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\n\t\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n\t\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n\t\t\t\t\t\t} while (--match_length !== 0);\n\t\t\t\t\t\tstrstart++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstrstart += match_length;\n\t\t\t\t\t\tmatch_length = 0;\n\t\t\t\t\t\tins_h = window[strstart] & 0xff;\n\n\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask;\n\t\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n\t\t\t\t\t\t// not\n\t\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// No match, output a literal byte\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart] & 0xff);\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tstrstart++;\n\t\t\t\t}\n\t\t\t\tif (bflush) {\n\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_block_only(flush == Z_FINISH);\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "4df2e29878586d63d6d2256775e67bdb", "score": "0.4649817", "text": "function checkfinished()\n{\n // Check for end of game\n if ((checkfound()==3) || (gs.arsenal.used==gs.arsenal.total))\n {\n gs.finished=true;\n showenemies();\n\n if (checkfound()==3)\n {\n if ((gs.arsenal.used<gs.record) || (gs.record==0))\n {\n gs.confettitype=0;\n gs.record=gs.arsenal.used;\n try\n {\n window.localStorage.craterspace_record=gs.record;\n }\n catch (e) {}\n showrecord();\n }\n else\n gs.confettitype=1;\n \n startconfetti();\n }\n gs.state=3;\n\n showui();\n }\n}", "title": "" }, { "docid": "9e2c30f9a925a9852cd24cc79be686d1", "score": "0.46438208", "text": "function checkMatchCount(){\n if (matches === 8) {\n youWon();\n }\n}", "title": "" }, { "docid": "f97794a131e85c7263891d898d47f949", "score": "0.4635399", "text": "function hasMatch() {\n let choices = document.querySelectorAll('.open');\n choices[0].classList.add('match', 'animated', 'rubberBand');\n choices[1].classList.add('match', 'animated', 'rubberBand');\n choices[0].classList.remove('open');\n choices[1].classList.remove('open');\n openCards = [];\n\n // If it's the last match\n let parent = document.querySelector('.deck')\n if (parent.children.length == parent.querySelectorAll('.match').length) {\n completed();\n };\n\n}", "title": "" }, { "docid": "1cae292684632b954930a6cf5bfafed1", "score": "0.46348155", "text": "shouldBeSent(){\n return this.redundancy > this.currentProcessorCount + (2*this.totalCount - this.majorityCount);\n }", "title": "" }, { "docid": "962cdffb4325bc0c57eb3c0fa15e5008", "score": "0.46318612", "text": "function updateWinRecord() {\n\tif (game.userScore === 3) {\n\t\tgame.winRecord++;\n\t\t$('#win-record').text(`${game.winRecord}`);\n\t} else {\n\t\tgame.loseRecord++;\n\t\t$('#lose-record').text(`${game.loseRecord}`);\n\t}\n\tlocalStorage.setItem('winRecord', game.winRecord);\n\tlocalStorage.setItem('loseRecord', game.loseRecord);\n}", "title": "" }, { "docid": "8a33c574e085917b6a6906ddcb1a1fbd", "score": "0.4626877", "text": "function flush_block(eof) { // true if this is the last block for a file\n\t\tvar opt_lenb, static_lenb, // opt_len and static_len in bytes\n\t\t\tmax_blindex, // index of last bit length code of non zero freq\n\t\t\tstored_len, // length of input block\n\t\t\ti;\n\n\t\tstored_len = strstart - block_start;\n\t\tflag_buf[last_flags] = flags; // Save the flags for the last 8 items\n\n\t\t// Construct the literal and distance trees\n\t\tbuild_tree(l_desc);\n\t\t// Tracev((stderr, \"\\nlit data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\n\t\tbuild_tree(d_desc);\n\t\t// Tracev((stderr, \"\\ndist data: dyn %ld, stat %ld\",\n\t\t// encoder->opt_len, encoder->static_len));\n\t\t// At this point, opt_len and static_len are the total bit lengths of\n\t\t// the compressed block data, excluding the tree representations.\n\n\t\t// Build the bit length tree for the above two trees, and get the index\n\t\t// in bl_order of the last bit length code to send.\n\t\tmax_blindex = build_bl_tree();\n\n\t // Determine the best encoding. Compute first the block length in bytes\n\t\topt_lenb = (opt_len + 3 + 7) >> 3;\n\t\tstatic_lenb = (static_len + 3 + 7) >> 3;\n\n\t// Trace((stderr, \"\\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u dist %u \", opt_lenb, encoder->opt_len, static_lenb, encoder->static_len, stored_len, encoder->last_lit, encoder->last_dist));\n\n\t\tif (static_lenb <= opt_lenb) {\n\t\t\topt_lenb = static_lenb;\n\t\t}\n\t\tif (stored_len + 4 <= opt_lenb && block_start >= 0) { // 4: two words for the lengths\n\t\t\t// The test buf !== NULL is only necessary if LIT_BUFSIZE > WSIZE.\n\t\t\t// Otherwise we can't have processed more than WSIZE input bytes since\n\t\t\t// the last block flush, because compression would have been\n\t\t\t// successful. If LIT_BUFSIZE <= WSIZE, it is never too late to\n\t\t\t// transform a block into a stored block.\n\t\t\tsend_bits((STORED_BLOCK << 1) + eof, 3); /* send block type */\n\t\t\tbi_windup(); /* align on byte boundary */\n\t\t\tput_short(stored_len);\n\t\t\tput_short(~stored_len);\n\n\t\t\t// copy block\n\t\t\t/*\n\t\t\t\tp = &window[block_start];\n\t\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\t\tput_byte(p[i]);\n\t\t\t\t}\n\t\t\t*/\n\t\t\tfor (i = 0; i < stored_len; i++) {\n\t\t\t\tput_byte(window[block_start + i]);\n\t\t\t}\n\t\t} else if (static_lenb === opt_lenb) {\n\t\t\tsend_bits((STATIC_TREES << 1) + eof, 3);\n\t\t\tcompress_block(static_ltree, static_dtree);\n\t\t} else {\n\t\t\tsend_bits((DYN_TREES << 1) + eof, 3);\n\t\t\tsend_all_trees(l_desc.max_code + 1, d_desc.max_code + 1, max_blindex + 1);\n\t\t\tcompress_block(dyn_ltree, dyn_dtree);\n\t\t}\n\n\t\tinit_block();\n\n\t\tif (eof !== 0) {\n\t\t\tbi_windup();\n\t\t}\n\t}", "title": "" }, { "docid": "09a47e5a1f3aec8344ef2a95f25abd33", "score": "0.46234933", "text": "function C007_LunchBreak_Sidney_GoodMatch() {\n\tC007_LunchBreak_Sidney_MatchCount++;\n\tC007_LunchBreak_Sidney_CalcParams();\n}", "title": "" }, { "docid": "4aec46fee06fc76c4d4ffdf1ee4c0a4d", "score": "0.46033975", "text": "function checkMatch(){\n\n\tconsole.log(\"I'm checking a match\");\n\n\tif (check[0].src !== check[1].src || check[0].parentElement.id === check[1].parentElement.id){\n\t\t\tconsole.log(\"there is NO match\");\n\t\t\tcheck[0].classList.add(\"hidden\");\n\t\t\tcheck[1].classList.add(\"hidden\");\n\t\t\tcheck = [];\n\t\t\tclicks = 0; \n\t} else {\n\t\tconsole.log(\"YES, there is a match\");\n\t\tcheck = [];\n\t\tclicks = 0\n\t\tmatches++;\n\t\tconsole.log(\"there have been \" + matches + \" matches\");\n\t}\n\n\tattempts++//The number of matching attempts are counted as they weigh into the scoring formula.\n\n\tif (matches === 18) { //When 18 matches are met the board is complete, timer stops and round is finished.\n\t\tclearInterval(TIMER)\n\n\t\tfinishRound();\n\t}\n}", "title": "" }, { "docid": "b4d40bdc89b11d937d65481ec2a11fd6", "score": "0.45989725", "text": "infoResponseIsInStore() {\n const responses = this.currentInfoResponses();\n if (responses.length === this.currentCanvases().length) {\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "c883b078bc4a61dc0bd58022e4f25cf4", "score": "0.45872262", "text": "function recordbeat() {\n if (record) {\n record = false;\n }\n else {\n record = true;\n }\n }", "title": "" }, { "docid": "376d09a7dc84bc8f31f95789af5820dc", "score": "0.45866656", "text": "function allMatch() {\n\tlet matches = $( 'li.match' ).length;\n\tlet stars = $( '.stars li' ).length;\n\tif (newDeck.length === matches) {\n\t\tstopClock();\n\t\talert(\"You win!\" + \"\\nTotal guesses: \" + counter + \"\\nStar ranking: \" + stars + \"\\nTime: \" + timer);\n\t\tlet playAgain = prompt(\"Play again? Y/N?\").toLowerCase();\n\t\tif \t(playAgain = \"y\" || \"yes\") {\n\t\t\tlocation.reload();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fc1fa1bc3e5da4f83631202a4a2cb833", "score": "0.45809677", "text": "function doMeasurement(matcher, prevHeapUsed, matchTime) {\n var heapUsed = getHeapUsed();\n var memoTableUsage = (heapUsed - prevHeapUsed) / 1000;\n var memoEntryCount = matcher.memoTable ? countMemoEntries(matcher.memoTable) : 0;\n var avgUsage = memoTableUsage / memoEntryCount * 1000;\n\n console.log(` | ${matchTime.toFixed(1)}ms, ${memoTableUsage.toFixed(3)}k (avg ${avgUsage.toFixed()} bytes/entry)`);\n}", "title": "" }, { "docid": "c18684768d9475ef341105ce6052231c", "score": "0.4572053", "text": "function noteTimeKeeper(){\n state.outputCount = 0\n for (i = 0; i < history.length; i++){\n if (history[i].type == \"continue\"){\n state.outputCount++\n }\n }\n}", "title": "" }, { "docid": "083b8e630035c567dff348d81e092037", "score": "0.4550806", "text": "function addMatch(match) {\n // Pull off the character index\n var c = match.index;\n var newPoints = 0;\n\n // A match means that we need to do some scoring bookkeeping.\n // Start with points added for any match\n if (DEBUG_SCORES) {\n scoreDebug.match += MATCH_POINTS;\n }\n newPoints += MATCH_POINTS;\n\n if (match.upper) {\n if (DEBUG_SCORES) {\n scoreDebug.upper += UPPER_CASE_MATCH;\n }\n newPoints += UPPER_CASE_MATCH;\n }\n\n // A bonus is given for characters that match at the beginning\n // of the filename\n if (c === lastSegmentStart) {\n if (DEBUG_SCORES) {\n scoreDebug.beginning += BEGINNING_OF_NAME_POINTS;\n }\n newPoints += BEGINNING_OF_NAME_POINTS;\n }\n\n // If the new character immediately follows the last matched character,\n // we award the consecutive matches bonus. The check for score > 0\n // handles the initial value of lastMatchIndex which is used for\n // constructing ranges but we don't yet have a true match.\n if (score > 0 && lastMatchIndex + 1 === c) {\n // Continue boosting for each additional match at the beginning\n // of the name\n if (c - numConsecutive === lastSegmentStart) {\n if (DEBUG_SCORES) {\n scoreDebug.beginning += BEGINNING_OF_NAME_POINTS;\n }\n newPoints += BEGINNING_OF_NAME_POINTS;\n }\n\n numConsecutive++;\n\n var boost = CONSECUTIVE_MATCHES_POINTS * numConsecutive;\n\n // Consecutive matches that started on a special are a\n // good indicator of intent, so we award an added bonus there.\n if (currentRangeStartedOnSpecial) {\n boost = boost * 2;\n }\n\n if (DEBUG_SCORES) {\n scoreDebug.consecutive += boost;\n }\n newPoints += boost;\n } else {\n numConsecutive = 1;\n }\n\n // add points for \"special\" character matches\n if (match instanceof SpecialMatch) {\n if (DEBUG_SCORES) {\n scoreDebug.special += SPECIAL_POINTS;\n }\n newPoints += SPECIAL_POINTS;\n }\n\n score += newPoints;\n\n // points accumulated in the last segment get an extra bonus\n if (c >= lastSegmentStart) {\n lastSegmentScore += newPoints;\n }\n\n // if the last range wasn't a match or there's a gap, we need to close off\n // the range to start a new one.\n if ((currentRange && !currentRange.matched) || c > lastMatchIndex + 1) {\n closeRangeGap(c);\n }\n lastMatchIndex = c;\n\n // set up a new match range or add to the current one\n if (!currentRange) {\n currentRange = {\n text: str[c],\n matched: true\n };\n\n // Check to see if this new matched range is starting on a special\n // character. We penalize those ranges that don't, because most\n // people will search on the logical boundaries of the name\n currentRangeStartedOnSpecial = match instanceof SpecialMatch;\n } else {\n currentRange.text += str[c];\n }\n }", "title": "" }, { "docid": "62d10a43936cc5885bb2032032efb902", "score": "0.45370418", "text": "function activeMatchUpdateLoop() {\n console.log(new Date() + ' There are ' + Object.keys(active_matches).length + ' active matches');\n for (var match in active_matches) {\n active_matches[match].updateActive();\n }\n\n setTimeout(activeMatchUpdateLoop, idleUpdateInterval);\n}", "title": "" }, { "docid": "ec097776686cb5e94c81cb386fc378c1", "score": "0.4529629", "text": "function deflate_slow(flush) {\n\t\t\t// short hash_head = 0; // head of hash chain\n\t\t\tvar hash_head = 0; // head of hash chain\n\t\t\tvar bflush; // set if current block must be flushed\n\t\t\tvar max_insert;\n\n\t\t\t// Process the input block.\n\t\t\twhile (true) {\n\t\t\t\t// Make sure that we always have enough lookahead, except\n\t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n\t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n\t\t\t\t// string following the next match.\n\n\t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n\t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n\t\t\t\tif (lookahead >= MIN_MATCH) {\n\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t}\n\n\t\t\t\t// Find the longest match, discarding those <= prev_length.\n\t\t\t\tprev_length = match_length;\n\t\t\t\tprev_match = match_start;\n\t\t\t\tmatch_length = MIN_MATCH - 1;\n\n\t\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\t// To simplify the code, we prevent matches with the string\n\t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n\t\t\t\t\t// of the string with itself at the start of the input file).\n\n\t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n\t\t\t\t\t\tmatch_length = longest_match(hash_head);\n\t\t\t\t\t}\n\t\t\t\t\t// longest_match() sets match_start\n\n\t\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n\t\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n\t\t\t\t\t\t// but we will ignore the current match anyway.\n\t\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// If there was a match at the previous step and the current\n\t\t\t\t// match is not better, output the previous match:\n\t\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n\t\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n\t\t\t\t\t// Do not insert strings in hash table beyond this.\n\n\t\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n\t\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n\t\t\t\t\t// Insert in hash table all strings up to the end of the match.\n\t\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n\t\t\t\t\t// enough lookahead, the last two strings are not inserted in\n\t\t\t\t\t// the hash table.\n\t\t\t\t\tlookahead -= prev_length - 1;\n\t\t\t\t\tprev_length -= 2;\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (++strstart <= max_insert) {\n\t\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n\t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n\t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n\t\t\t\t\t\t\thead[ins_h] = strstart;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (--prev_length !== 0);\n\t\t\t\t\tmatch_available = 0;\n\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n\t\t\t\t\tstrstart++;\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\t}\n\t\t\t\t} else if (match_available !== 0) {\n\n\t\t\t\t\t// If there was no match at the previous position, output a\n\t\t\t\t\t// single literal. If there was a match but the current match\n\t\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n\t\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\n\t\t\t\t\tif (bflush) {\n\t\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\t}\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t} else {\n\t\t\t\t\t// There is no previous match to compare with, wait for\n\t\t\t\t\t// the next step to decide.\n\n\t\t\t\t\tmatch_available = 1;\n\t\t\t\t\tstrstart++;\n\t\t\t\t\tlookahead--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (match_available !== 0) {\n\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\t\t\t\tmatch_available = 0;\n\t\t\t}\n\t\t\tflush_block_only(flush == Z_FINISH);\n\n\t\t\tif (strm.avail_out === 0) {\n\t\t\t\tif (flush == Z_FINISH)\n\t\t\t\t\treturn FinishStarted;\n\t\t\t\telse\n\t\t\t\t\treturn NeedMore;\n\t\t\t}\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "0de8cf99acb8c11e63db1e99d8c1c48c", "score": "0.45287737", "text": "function check() {\r\n clearInterval(timer); //stop timer\r\n clicks = 0;\r\n if (faces[secondchoice] == faces[firstchoice]) {\r\n match++;\r\n document.getElementById(\"matches\").innerHTML = match;\r\n } else {\r\n document.images[firstchoice].src = backcard;\r\n document.images[secondchoice].src = backcard;\r\n return;\r\n }\r\n }", "title": "" }, { "docid": "47ce15858f37f70a8e515f53c20ddb67", "score": "0.45239475", "text": "function checkFinish() {\n if (correct_matches === 8) {\n finishGame();\n }\n}", "title": "" }, { "docid": "ea9a242bebd10a838ec9c7316b1cc6cd", "score": "0.45224744", "text": "function isWinner() {\n matchFound += 1;\n //Show the results to the user if all sets have been matched\n //Since the card deck has 16 cards, we have 8 sets\n if (matchFound == 8) {\n showResult();\n }\n}", "title": "" }, { "docid": "374b87724029149060a87c91acc1c808", "score": "0.451769", "text": "function addFootScore(match, reader)\n{\n var id = match.id;\n var color;\n var read = readFootMatchScore(match);\n \n read += \", \";\n \n if (match.state == \"SCHEDULED\")\n {\n if (match.startTime)\n {\n var time = parseDate(match.startTime);\n \n if (time)\n {\n var now = new Date();\n if (time.getDate() == now.getDate() && time.getMonth() == now.getMonth() && time.getYear() == now.getYear())\n {\n // Match is today\n read += \"prévu à \"+time.getHours()+\"h\"+time.getMinutes();\n }\n else\n {\n // Match is another day\n read += \"prévu le \" + readDate(time);\n }\n }\n else\n {\n read += \"à venir\";\n }\n }\n else\n {\n read += \"à venir\";\n }\n color = CYAN;\n }\n else if (match.state == \"HALF_TIME\")\n {\n read += \"mi-temps\";\n color = YELLOW;\n }\n else if (match.state == \"END_TIME\")\n {\n read += \"prolongation\";\n color = YELLOW;\n }\n else if (match.state == \"HALF_PROL\")\n {\n read += \"mi-temps de la prolongation\";\n color = YELLOW;\n }\n else if (match.state == \"PENALTY\")\n {\n read += \"tir au but\";\n color = GREEN;\n }\n else if (match.state == \"TERMINATED\")\n {\n read += \"terminé\";\n color = BLUE;\n }\n else if (match.state == \"STOPPED\")\n {\n read += \"match interrompu\";\n color = RED;\n }\n else if (match.state == \"CANCELLED\")\n {\n read += \"match annulé\";\n color = RED;\n }\n else\n {\n color = GREEN;\n \n if (match.playingTime && match.playingTime > 0)\n {\n read += readMinute(match.playingTime);\n }\n else if (match.state == \"FIRST_HALF\")\n {\n read += \"1ère mi-temps\";\n }\n else if (match.state == \"SECOND_HALF\")\n {\n read += \"2ème mi-temps\";\n }\n else if (match.state == \"FIRST_PROL\")\n {\n read += \"1ère mi-temps de la prolongation\";\n }\n else if (match.state == \"SECOND_PROL\")\n {\n read += \"2ème mi-temps de la prolongation\";\n }\n }\n \n read += \".\";\n \n reader.add(read, id, COLOR_SPEAK);\n}", "title": "" }, { "docid": "098c8e184a465b4ca87bcfd8193889d3", "score": "0.45026478", "text": "function gameCompleted() {\r\n if (matches === 16) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "b0474c53512461abd72adcf4137649f6", "score": "0.4498888", "text": "function saveSuccessfull(response) {\n tracker.resolve(response);\n }", "title": "" }, { "docid": "b0474c53512461abd72adcf4137649f6", "score": "0.4498888", "text": "function saveSuccessfull(response) {\n tracker.resolve(response);\n }", "title": "" }, { "docid": "b0474c53512461abd72adcf4137649f6", "score": "0.4498888", "text": "function saveSuccessfull(response) {\n tracker.resolve(response);\n }", "title": "" }, { "docid": "933eb3430dbb4f6eb740cde9a0ed0953", "score": "0.44939", "text": "function match() {\n $(flippedCards[0]).find(\"figure.back\").addClass(\"match\");\n $(flippedCards[2]).find(\"figure.back\").addClass(\"match\");\n flippedCards = [];\n matchesMade++;\n //Ends the game when all matches have been made\n if (matchesMade == 8) {\n gameClock(false);\n matchesMade = 0;\n gameOver();\n };\n}", "title": "" }, { "docid": "439f5c356b05a44a428925217ec6865e", "score": "0.44817927", "text": "function testComplete() {\n return STORE.questions.length === STORE.currentQuestion; \n}", "title": "" }, { "docid": "56d184e9d60750e3d816396022706e0d", "score": "0.44799367", "text": "function deflate_stored(flush) {\n\t\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n\t\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n\t\t\tvar max_block_size = 0xffff;\n\t\t\tvar max_start;\n\n\t\t\tif (max_block_size > pending_buf_size - 5) {\n\t\t\t\tmax_block_size = pending_buf_size - 5;\n\t\t\t}\n\n\t\t\t// Copy as much as possible from input to output:\n\t\t\twhile (true) {\n\t\t\t\t// Fill the window as much as possible:\n\t\t\t\tif (lookahead <= 1) {\n\t\t\t\t\tfill_window();\n\t\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t\tif (lookahead === 0)\n\t\t\t\t\t\tbreak; // flush the current block\n\t\t\t\t}\n\n\t\t\t\tstrstart += lookahead;\n\t\t\t\tlookahead = 0;\n\n\t\t\t\t// Emit a stored block if pending_buf will be full:\n\t\t\t\tmax_start = block_start + max_block_size;\n\t\t\t\tif (strstart === 0 || strstart >= max_start) {\n\t\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n\t\t\t\t\tlookahead = (strstart - max_start);\n\t\t\t\t\tstrstart = max_start;\n\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\n\t\t\t\t}\n\n\t\t\t\t// Flush if we may have to slide, otherwise block_start may become\n\t\t\t\t// negative and the data will be gone:\n\t\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n\t\t\t\t\tflush_block_only(false);\n\t\t\t\t\tif (strm.avail_out === 0)\n\t\t\t\t\t\treturn NeedMore;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tflush_block_only(flush == Z_FINISH);\n\t\t\tif (strm.avail_out === 0)\n\t\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n\t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n\t\t}", "title": "" }, { "docid": "ef31d6672612c16a78b2ecd7f7bdf090", "score": "0.4475616", "text": "function updateMatchingStatusInGraphs() {\n clearMatchedStatusForGraph(entityAlign.graphA)\n clearMatchedStatusForGraph(entityAlign.graphB)\n for (match in entityAlign.currentMatches) {\n // set matched attributes\n var match_record = entityAlign.currentMatches[match]\n //console.log('match',match,'match_record',match_record)\n var ga_index = match_record.ga\n var gb_index = match_record.gb\n //console.log('match',match,'ga',ga_index)\n var ga_node = entityAlign.graphA.nodes[ga_index]\n var gb_node = entityAlign.graphB.nodes[gb_index]\n ga_node.matched = match_record.gb\n gb_node.matched = match_record.ga\n }\n}", "title": "" }, { "docid": "51df0598d405073c68ded66f451b7fff", "score": "0.44719318", "text": "function match() {\n\tif (openCards[0].dataset.card == openCards[1].dataset.card) {\n\t\topenCards[0].classList.add('match');\n\t\topenCards[1].classList.add('match');\n\t\tmatchCount += 2;\n\t\tsetTimeout(function() {\n\t\t\topenCards = []; //clear array only after match animation completes\n\t\t}, 600);\n\t} else {\n\t\topenCards[0].classList.add('noMatch');\n\t\topenCards[1].classList.add('noMatch');\n\t}\n// }, 700);\n}", "title": "" }, { "docid": "90a06369df9354d006986aa6f99c455a", "score": "0.44641453", "text": "function deflate_slow(flush) {\n \t\t\t// short hash_head = 0; // head of hash chain\n \t\t\tvar hash_head = 0; // head of hash chain\n \t\t\tvar bflush; // set if current block must be flushed\n \t\t\tvar max_insert;\n\n \t\t\t// Process the input block.\n \t\t\twhile (true) {\n \t\t\t\t// Make sure that we always have enough lookahead, except\n \t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n \t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n \t\t\t\t// string following the next match.\n\n \t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n \t\t\t\t\tfill_window();\n \t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\t}\n \t\t\t\t\tif (lookahead === 0)\n \t\t\t\t\t\tbreak; // flush the current block\n \t\t\t\t}\n\n \t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n \t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n \t\t\t\tif (lookahead >= MIN_MATCH) {\n \t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n \t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\thead[ins_h] = strstart;\n \t\t\t\t}\n\n \t\t\t\t// Find the longest match, discarding those <= prev_length.\n \t\t\t\tprev_length = match_length;\n \t\t\t\tprev_match = match_start;\n \t\t\t\tmatch_length = MIN_MATCH - 1;\n\n \t\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n \t\t\t\t\t// To simplify the code, we prevent matches with the string\n \t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n \t\t\t\t\t// of the string with itself at the start of the input file).\n\n \t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n \t\t\t\t\t\tmatch_length = longest_match(hash_head);\n \t\t\t\t\t}\n \t\t\t\t\t// longest_match() sets match_start\n\n \t\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n \t\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n \t\t\t\t\t\t// but we will ignore the current match anyway.\n \t\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n \t\t\t\t\t}\n \t\t\t\t}\n\n \t\t\t\t// If there was a match at the previous step and the current\n \t\t\t\t// match is not better, output the previous match:\n \t\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n \t\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n \t\t\t\t\t// Do not insert strings in hash table beyond this.\n\n \t\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n \t\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n \t\t\t\t\t// Insert in hash table all strings up to the end of the match.\n \t\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n \t\t\t\t\t// enough lookahead, the last two strings are not inserted in\n \t\t\t\t\t// the hash table.\n \t\t\t\t\tlookahead -= prev_length - 1;\n \t\t\t\t\tprev_length -= 2;\n \t\t\t\t\tdo {\n \t\t\t\t\t\tif (++strstart <= max_insert) {\n \t\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n \t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\t\t\thead[ins_h] = strstart;\n \t\t\t\t\t\t}\n \t\t\t\t\t} while (--prev_length !== 0);\n \t\t\t\t\tmatch_available = 0;\n \t\t\t\t\tmatch_length = MIN_MATCH - 1;\n \t\t\t\t\tstrstart++;\n\n \t\t\t\t\tif (bflush) {\n \t\t\t\t\t\tflush_block_only(false);\n \t\t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\t}\n \t\t\t\t} else if (match_available !== 0) {\n\n \t\t\t\t\t// If there was no match at the previous position, output a\n \t\t\t\t\t// single literal. If there was a match but the current match\n \t\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n \t\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\n \t\t\t\t\tif (bflush) {\n \t\t\t\t\t\tflush_block_only(false);\n \t\t\t\t\t}\n \t\t\t\t\tstrstart++;\n \t\t\t\t\tlookahead--;\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t} else {\n \t\t\t\t\t// There is no previous match to compare with, wait for\n \t\t\t\t\t// the next step to decide.\n\n \t\t\t\t\tmatch_available = 1;\n \t\t\t\t\tstrstart++;\n \t\t\t\t\tlookahead--;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tif (match_available !== 0) {\n \t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \t\t\t\tmatch_available = 0;\n \t\t\t}\n \t\t\tflush_block_only(flush == Z_FINISH);\n\n \t\t\tif (strm.avail_out === 0) {\n \t\t\t\tif (flush == Z_FINISH)\n \t\t\t\t\treturn FinishStarted;\n \t\t\t\telse\n \t\t\t\t\treturn NeedMore;\n \t\t\t}\n\n \t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n \t\t}", "title": "" }, { "docid": "90a06369df9354d006986aa6f99c455a", "score": "0.44641453", "text": "function deflate_slow(flush) {\n \t\t\t// short hash_head = 0; // head of hash chain\n \t\t\tvar hash_head = 0; // head of hash chain\n \t\t\tvar bflush; // set if current block must be flushed\n \t\t\tvar max_insert;\n\n \t\t\t// Process the input block.\n \t\t\twhile (true) {\n \t\t\t\t// Make sure that we always have enough lookahead, except\n \t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n \t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n \t\t\t\t// string following the next match.\n\n \t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n \t\t\t\t\tfill_window();\n \t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\t}\n \t\t\t\t\tif (lookahead === 0)\n \t\t\t\t\t\tbreak; // flush the current block\n \t\t\t\t}\n\n \t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n \t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n\n \t\t\t\tif (lookahead >= MIN_MATCH) {\n \t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n \t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\thead[ins_h] = strstart;\n \t\t\t\t}\n\n \t\t\t\t// Find the longest match, discarding those <= prev_length.\n \t\t\t\tprev_length = match_length;\n \t\t\t\tprev_match = match_start;\n \t\t\t\tmatch_length = MIN_MATCH - 1;\n\n \t\t\t\tif (hash_head !== 0 && prev_length < max_lazy_match && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n \t\t\t\t\t// To simplify the code, we prevent matches with the string\n \t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n \t\t\t\t\t// of the string with itself at the start of the input file).\n\n \t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n \t\t\t\t\t\tmatch_length = longest_match(hash_head);\n \t\t\t\t\t}\n \t\t\t\t\t// longest_match() sets match_start\n\n \t\t\t\t\tif (match_length <= 5 && (strategy == Z_FILTERED || (match_length == MIN_MATCH && strstart - match_start > 4096))) {\n\n \t\t\t\t\t\t// If prev_match is also MIN_MATCH, match_start is garbage\n \t\t\t\t\t\t// but we will ignore the current match anyway.\n \t\t\t\t\t\tmatch_length = MIN_MATCH - 1;\n \t\t\t\t\t}\n \t\t\t\t}\n\n \t\t\t\t// If there was a match at the previous step and the current\n \t\t\t\t// match is not better, output the previous match:\n \t\t\t\tif (prev_length >= MIN_MATCH && match_length <= prev_length) {\n \t\t\t\t\tmax_insert = strstart + lookahead - MIN_MATCH;\n \t\t\t\t\t// Do not insert strings in hash table beyond this.\n\n \t\t\t\t\t// check_match(strstart-1, prev_match, prev_length);\n\n \t\t\t\t\tbflush = _tr_tally(strstart - 1 - prev_match, prev_length - MIN_MATCH);\n\n \t\t\t\t\t// Insert in hash table all strings up to the end of the match.\n \t\t\t\t\t// strstart-1 and strstart are already inserted. If there is not\n \t\t\t\t\t// enough lookahead, the last two strings are not inserted in\n \t\t\t\t\t// the hash table.\n \t\t\t\t\tlookahead -= prev_length - 1;\n \t\t\t\t\tprev_length -= 2;\n \t\t\t\t\tdo {\n \t\t\t\t\t\tif (++strstart <= max_insert) {\n \t\t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n \t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\t\t\thead[ins_h] = strstart;\n \t\t\t\t\t\t}\n \t\t\t\t\t} while (--prev_length !== 0);\n \t\t\t\t\tmatch_available = 0;\n \t\t\t\t\tmatch_length = MIN_MATCH - 1;\n \t\t\t\t\tstrstart++;\n\n \t\t\t\t\tif (bflush) {\n \t\t\t\t\t\tflush_block_only(false);\n \t\t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\t}\n \t\t\t\t} else if (match_available !== 0) {\n\n \t\t\t\t\t// If there was no match at the previous position, output a\n \t\t\t\t\t// single literal. If there was a match but the current match\n \t\t\t\t\t// is longer, truncate the previous match to a single literal.\n\n \t\t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n\n \t\t\t\t\tif (bflush) {\n \t\t\t\t\t\tflush_block_only(false);\n \t\t\t\t\t}\n \t\t\t\t\tstrstart++;\n \t\t\t\t\tlookahead--;\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t} else {\n \t\t\t\t\t// There is no previous match to compare with, wait for\n \t\t\t\t\t// the next step to decide.\n\n \t\t\t\t\tmatch_available = 1;\n \t\t\t\t\tstrstart++;\n \t\t\t\t\tlookahead--;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tif (match_available !== 0) {\n \t\t\t\tbflush = _tr_tally(0, window[strstart - 1] & 0xff);\n \t\t\t\tmatch_available = 0;\n \t\t\t}\n \t\t\tflush_block_only(flush == Z_FINISH);\n\n \t\t\tif (strm.avail_out === 0) {\n \t\t\t\tif (flush == Z_FINISH)\n \t\t\t\t\treturn FinishStarted;\n \t\t\t\telse\n \t\t\t\t\treturn NeedMore;\n \t\t\t}\n\n \t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n \t\t}", "title": "" }, { "docid": "27d30ede033479074b90c23c3fa451b2", "score": "0.44532", "text": "match(string, metadata = {depth: 0, parentId: null}){\n let matchFound = false //indicates if rulelist is valid\n let ruleMatched = false //used in the do loop to determine if any of the rules match\n let tempString = string\n\n let internalMatches = [] //internalMatches refers to the rules that are matched while matching a rule list\n do{\n ruleMatched = false\n let matchInformation = null\n for (let i = 0; i < this.rules.length; i++){\n matchInformation = this.rules[i].match(tempString, {depth: 1, parentId: this.id})\n if (matchInformation.matchFound){\n ruleMatched = true\n break\n }\n }\n if (ruleMatched){\n internalMatches.push(matchInformation)\n tempString = tempString.substring(matchInformation.matchLength)\n }else{\n break\n }\n }while(ruleMatched&&tempString != '')\n\n let totalLength = 0\n if (ruleMatched){\n for (let i = 0; i < internalMatches.length; i++){\n totalLength = totalLength + internalMatches[i].matchLength\n }\n matchFound = true\n }\n\n let returnValue = {type: this['friendly node type name'],id: this.id, depth: metadata.depth, matchFound, matchLength: totalLength, matchString: string.substring(0, totalLength), internalMatches}\n\n this.saveData(returnValue)\n return returnValue\n }", "title": "" }, { "docid": "e4f24d7c26679c415feb7d29a122cfbf", "score": "0.44528228", "text": "function nextMatch() {\n setIndex(index + 1);\n setCheck(fadeIndex[index + 1]);\n }", "title": "" }, { "docid": "81ee11183582478e92a04e36304d404b", "score": "0.4449808", "text": "isComplete(){\n var participantsList = this.participants.length;\n var winnerlength = this.matchList.length;\n if ((participantsList/winnerlength) == 2){\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "726f10ff19351387418d041f947a9c16", "score": "0.4444914", "text": "function updateMatchedWords(){\n if(artistAlreadyAdded(lastMatch) == false){\n $scope.artistMatches.push(lastMatch);\n }\n }", "title": "" }, { "docid": "e750b78730eecb1bf1ec291deac1608a", "score": "0.44426984", "text": "function loopRecordedData() {\n\n if (Date.now() > sentTime + loopTime) {\n bodyTracked(skeletonData[i][currentFrame]);\n sentTime = Date.now();\n\n if (currentFrame < skeletonData[i].length-1) {\n currentFrame++;\n } else {\n currentFrame = 0;\n }\n }\n}", "title": "" }, { "docid": "7ef0ebd9df9b5913550f1b845488d247", "score": "0.44274777", "text": "function matchesWonPerTeam() {\r\n fs.createReadStream(\"matches.csv\")\r\n .pipe(fcsv.parse({ headers: true }))\r\n .on(\"data\", match => {\r\n if (match.winner in matchesWon) {\r\n if (match.season in matchesWon[match.winner])\r\n matchesWon[match.winner][match.season]++\r\n else\r\n matchesWon[match.winner][match.season] = 1\r\n }\r\n else {\r\n matchesWon[match.winner] = {}\r\n matchesWon[match.winner][match.season] = 1\r\n }\r\n })\r\n .on(\"end\", matchCount => {\r\n console.log(\"2. Number of matches won of per team per year in IPL.\")\r\n console.log(matchesWon)\r\n console.log(\"\\n\\n\\n---------------------------------------------------------------------------------------------------\")\r\n });\r\n}", "title": "" }, { "docid": "e5238269ea87fd32a02e414cf15ba503", "score": "0.4422042", "text": "function matchCards() {\n if (openedCards.length === 2) {\n const areMatched = verifyMatch(openedCards[0], openedCards[1]);\n if (areMatched === true) {\n matchedCounter += 2;\n lockOpenCards(openedCards[0], openedCards[1]);\n openedCards = [];\n }\n else {\n hideSymbols(openedCards[0], openedCards[1]);\n openedCards = [];\n }\n\n }\n\n }", "title": "" }, { "docid": "12d461464d76695108a3345887c11c25", "score": "0.44159973", "text": "function matched() {\n\topenedCards[0].classList.add(\"match\");\n\topenedCards[1].classList.add(\"match\");\n\topenedCards[0].classList.remove(\"open\");\n\topenedCards[1].classList.remove(\"open\", \"lolo\");\n\topenedCards = [];\n\tvar mached = document.getElementsByClassName(\"match\");\n\tfor (let o = 0; o < mached.length; o++) {\n\t\tmached[o].parentNode.removeEventListener(\"click\", cardOpened);\n\t\tmached[o].parentNode.removeEventListener(\"click\", tryMe);\n\t}\n\tcomplt.innerHTML = (mached.length / dis.length) * 100;\n\tif (((mached.length / dis.length) * 100) === 100) {\n\t\tfinished();\n\t}\n}", "title": "" }, { "docid": "5131a589569f2419a1cd3f4e6dc93a9d", "score": "0.4413033", "text": "function checkIfFinished(){\n var complete = true;\n for(var i = 0; i < cardArray.length; i++){\n if(!cardArray[i].removed){\n complete = false;\n }\n }\n if(complete){\n var time = timeCount(gameTime());\n var difficulty = 'score' + userRows;\n for(var j = 0; j < objArray.length; j++){\n if(objArray[j].active){\n objArray[j][difficulty] = time;\n }\n }\n localStorage.setItem('objArray', JSON.stringify(objArray))\n setTimeout(function(){renderScores()}, 3100);\n }\n}", "title": "" }, { "docid": "a562d8ca6bb61caf2f7b28eef4bb6485", "score": "0.4412356", "text": "function deflate_fast(flush) {\n \t\t\t// short hash_head = 0; // head of the hash chain\n \t\t\tvar hash_head = 0; // head of the hash chain\n \t\t\tvar bflush; // set if current block must be flushed\n\n \t\t\twhile (true) {\n \t\t\t\t// Make sure that we always have enough lookahead, except\n \t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n \t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n \t\t\t\t// string following the next match.\n \t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n \t\t\t\t\tfill_window();\n \t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\t}\n \t\t\t\t\tif (lookahead === 0)\n \t\t\t\t\t\tbreak; // flush the current block\n \t\t\t\t}\n\n \t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n \t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \t\t\t\tif (lookahead >= MIN_MATCH) {\n \t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n \t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\thead[ins_h] = strstart;\n \t\t\t\t}\n\n \t\t\t\t// Find the longest match, discarding those <= prev_length.\n \t\t\t\t// At this point we have always match_length < MIN_MATCH\n\n \t\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n \t\t\t\t\t// To simplify the code, we prevent matches with the string\n \t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n \t\t\t\t\t// of the string with itself at the start of the input file).\n \t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n \t\t\t\t\t\tmatch_length = longest_match(hash_head);\n \t\t\t\t\t}\n \t\t\t\t\t// longest_match() sets match_start\n \t\t\t\t}\n \t\t\t\tif (match_length >= MIN_MATCH) {\n \t\t\t\t\t// check_match(strstart, match_start, match_length);\n\n \t\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n \t\t\t\t\tlookahead -= match_length;\n\n \t\t\t\t\t// Insert new strings in the hash table only if the match length\n \t\t\t\t\t// is not too large. This saves time but degrades compression.\n \t\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n \t\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n \t\t\t\t\t\tdo {\n \t\t\t\t\t\t\tstrstart++;\n\n \t\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n \t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\t\t\thead[ins_h] = strstart;\n\n \t\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n \t\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n \t\t\t\t\t\t} while (--match_length !== 0);\n \t\t\t\t\t\tstrstart++;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tstrstart += match_length;\n \t\t\t\t\t\tmatch_length = 0;\n \t\t\t\t\t\tins_h = window[strstart] & 0xff;\n\n \t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask;\n \t\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n \t\t\t\t\t\t// not\n \t\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n \t\t\t\t\t}\n \t\t\t\t} else {\n \t\t\t\t\t// No match, output a literal byte\n\n \t\t\t\t\tbflush = _tr_tally(0, window[strstart] & 0xff);\n \t\t\t\t\tlookahead--;\n \t\t\t\t\tstrstart++;\n \t\t\t\t}\n \t\t\t\tif (bflush) {\n\n \t\t\t\t\tflush_block_only(false);\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tflush_block_only(flush == Z_FINISH);\n \t\t\tif (strm.avail_out === 0) {\n \t\t\t\tif (flush == Z_FINISH)\n \t\t\t\t\treturn FinishStarted;\n \t\t\t\telse\n \t\t\t\t\treturn NeedMore;\n \t\t\t}\n \t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n \t\t}", "title": "" }, { "docid": "a562d8ca6bb61caf2f7b28eef4bb6485", "score": "0.4412356", "text": "function deflate_fast(flush) {\n \t\t\t// short hash_head = 0; // head of the hash chain\n \t\t\tvar hash_head = 0; // head of the hash chain\n \t\t\tvar bflush; // set if current block must be flushed\n\n \t\t\twhile (true) {\n \t\t\t\t// Make sure that we always have enough lookahead, except\n \t\t\t\t// at the end of the input file. We need MAX_MATCH bytes\n \t\t\t\t// for the next match, plus MIN_MATCH bytes to insert the\n \t\t\t\t// string following the next match.\n \t\t\t\tif (lookahead < MIN_LOOKAHEAD) {\n \t\t\t\t\tfill_window();\n \t\t\t\t\tif (lookahead < MIN_LOOKAHEAD && flush == Z_NO_FLUSH) {\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\t}\n \t\t\t\t\tif (lookahead === 0)\n \t\t\t\t\t\tbreak; // flush the current block\n \t\t\t\t}\n\n \t\t\t\t// Insert the string window[strstart .. strstart+2] in the\n \t\t\t\t// dictionary, and set hash_head to the head of the hash chain:\n \t\t\t\tif (lookahead >= MIN_MATCH) {\n \t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n\n \t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\thead[ins_h] = strstart;\n \t\t\t\t}\n\n \t\t\t\t// Find the longest match, discarding those <= prev_length.\n \t\t\t\t// At this point we have always match_length < MIN_MATCH\n\n \t\t\t\tif (hash_head !== 0 && ((strstart - hash_head) & 0xffff) <= w_size - MIN_LOOKAHEAD) {\n \t\t\t\t\t// To simplify the code, we prevent matches with the string\n \t\t\t\t\t// of window index 0 (in particular we have to avoid a match\n \t\t\t\t\t// of the string with itself at the start of the input file).\n \t\t\t\t\tif (strategy != Z_HUFFMAN_ONLY) {\n \t\t\t\t\t\tmatch_length = longest_match(hash_head);\n \t\t\t\t\t}\n \t\t\t\t\t// longest_match() sets match_start\n \t\t\t\t}\n \t\t\t\tif (match_length >= MIN_MATCH) {\n \t\t\t\t\t// check_match(strstart, match_start, match_length);\n\n \t\t\t\t\tbflush = _tr_tally(strstart - match_start, match_length - MIN_MATCH);\n\n \t\t\t\t\tlookahead -= match_length;\n\n \t\t\t\t\t// Insert new strings in the hash table only if the match length\n \t\t\t\t\t// is not too large. This saves time but degrades compression.\n \t\t\t\t\tif (match_length <= max_lazy_match && lookahead >= MIN_MATCH) {\n \t\t\t\t\t\tmatch_length--; // string at strstart already in hash table\n \t\t\t\t\t\tdo {\n \t\t\t\t\t\t\tstrstart++;\n\n \t\t\t\t\t\t\tins_h = ((ins_h << hash_shift) ^ (window[(strstart) + (MIN_MATCH - 1)] & 0xff)) & hash_mask;\n \t\t\t\t\t\t\t// prev[strstart&w_mask]=hash_head=head[ins_h];\n \t\t\t\t\t\t\thash_head = (head[ins_h] & 0xffff);\n \t\t\t\t\t\t\tprev[strstart & w_mask] = head[ins_h];\n \t\t\t\t\t\t\thead[ins_h] = strstart;\n\n \t\t\t\t\t\t\t// strstart never exceeds WSIZE-MAX_MATCH, so there are\n \t\t\t\t\t\t\t// always MIN_MATCH bytes ahead.\n \t\t\t\t\t\t} while (--match_length !== 0);\n \t\t\t\t\t\tstrstart++;\n \t\t\t\t\t} else {\n \t\t\t\t\t\tstrstart += match_length;\n \t\t\t\t\t\tmatch_length = 0;\n \t\t\t\t\t\tins_h = window[strstart] & 0xff;\n\n \t\t\t\t\t\tins_h = (((ins_h) << hash_shift) ^ (window[strstart + 1] & 0xff)) & hash_mask;\n \t\t\t\t\t\t// If lookahead < MIN_MATCH, ins_h is garbage, but it does\n \t\t\t\t\t\t// not\n \t\t\t\t\t\t// matter since it will be recomputed at next deflate call.\n \t\t\t\t\t}\n \t\t\t\t} else {\n \t\t\t\t\t// No match, output a literal byte\n\n \t\t\t\t\tbflush = _tr_tally(0, window[strstart] & 0xff);\n \t\t\t\t\tlookahead--;\n \t\t\t\t\tstrstart++;\n \t\t\t\t}\n \t\t\t\tif (bflush) {\n\n \t\t\t\t\tflush_block_only(false);\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tflush_block_only(flush == Z_FINISH);\n \t\t\tif (strm.avail_out === 0) {\n \t\t\t\tif (flush == Z_FINISH)\n \t\t\t\t\treturn FinishStarted;\n \t\t\t\telse\n \t\t\t\t\treturn NeedMore;\n \t\t\t}\n \t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n \t\t}", "title": "" }, { "docid": "8e0c78df9b41df34df41e068e98daf39", "score": "0.44109318", "text": "processRecord(record) {\n if (record.length > 0) {\n let newNumber = Number(record);\n this.data.push(newNumber);\n let newLength = this.data.length;\n if (newLength > this.preambleLength) {\n for (let loop1 = newLength - this.preambleLength - 1; loop1 < newLength - 1; loop1++)\n for (let loop2 = loop1 + 1; loop2 < newLength; loop2++)\n if (this.data[loop1] + this.data[loop2] == newNumber)\n return true;\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "7c1d83e681df4acb91d99dcf0c42dd6a", "score": "0.44100115", "text": "async function tryProcess() {\n profiler.done(\"buffer filled\");\n profiler = undefined;\n\n logger.info(\"processing batch\", {\n players: player_data.size,\n matches: match_data.size\n });\n\n // clean up to allow processor to accept while we wait for db\n clearTimeout(idle_timer);\n clearTimeout(load_timer);\n idle_timer = undefined;\n load_timer = undefined;\n\n if (player_data.size + match_data.size == 0) {\n logger.info(\"nothing to do\");\n return;\n }\n const player_objects = new Set(player_data),\n match_objects = new Set(match_data);\n player_data.clear();\n match_data.clear();\n\n try {\n await process(player_objects, match_objects);\n\n logger.info(\"acking batch\", {\n size: player_objects.size + match_objects.size\n });\n await Promise.map(player_objects, async (m) => await ch.ack(m));\n await Promise.map(match_objects, async (m) => await ch.ack(m));\n\n // notify web\n await Promise.map(match_objects, async (m) => {\n if (m.properties.headers.notify == undefined) return;\n await ch.publish(\"amq.topic\", m.properties.headers.notify,\n new Buffer(\"match_update\"));\n });\n await Promise.map(player_objects, async (m) => {\n if (m.properties.headers.notify == undefined) return;\n await ch.publish(\"amq.topic\", m.properties.headers.notify,\n new Buffer(\"player_update\"));\n });\n // …global about new matches\n if (match_objects.length > 0)\n await ch.publish(\"amq.topic\", \"global\", new Buffer(\"matches_update\"));\n // notify follow up services\n if (DOANALYZEMATCH) {\n await Promise.each(match_objects, async (msg) => {\n await ch.publish(\"amq.topic\", msg.properties.headers.notify,\n new Buffer(\"analyze_pending\"));\n await ch.sendToQueue(ANALYZE_QUEUE,\n new Buffer(msg.content.id), {\n persistent: true,\n headers: { notify: msg.properties.headers.notify }\n });\n });\n }\n } catch (err) {\n if (err instanceof Seq.TimeoutError ||\n (err instanceof Seq.DatabaseError && err.errno == 1213)) {\n // deadlocks / timeout\n logger.error(\"SQL error\", err);\n await Promise.map(player_objects, async (m) =>\n await ch.nack(m, false, true)); // retry\n await Promise.map(match_objects, async (m) =>\n await ch.nack(m, false, true));\n } else {\n // log, move to error queue and NACK\n logger.error(err);\n await Promise.map(player_objects, async (m) => {\n await ch.sendToQueue(QUEUE + \"_failed\",\n new Buffer(JSON.stringify(m.content)), {\n persistent: true,\n type: m.properties.type,\n headers: m.properties.headers\n });\n await ch.nack(m, false, false);\n });\n await Promise.map(match_objects, async (m) => {\n await ch.sendToQueue(QUEUE + \"_failed\",\n new Buffer(JSON.stringify(m.content)), {\n persistent: true,\n type: m.properties.type,\n headers: m.properties.headers\n });\n await ch.nack(m, false, false);\n });\n }\n }\n }", "title": "" }, { "docid": "3646bef7ae585bcf2a6c79c004f1ddec", "score": "0.44058383", "text": "_registerSummary() {\n this._inspector.on('end', () => {\n var numFiles = this._inspector.numFiles;\n var files = (numFiles > 1) ? 'files' : 'file';\n var matches = (this._found > 1) ? 'matches' : 'match';\n var summary;\n\n if (!this._found) {\n summary = chalk.black.bgGreen(util.format(\n '\\n No matches found across %d %s', numFiles, files));\n } else {\n summary = chalk.bgRed(util.format('\\n %d %s found across %d %s',\n this._found, matches, numFiles, files));\n }\n\n this._writableStream.write(summary + '\\n');\n });\n }", "title": "" }, { "docid": "1daf36a0e1502b21d8472707566e03a3", "score": "0.4404883", "text": "increment() {\n const oldCount = this.getCount()\n const newCount = oldCount + 1\n fs.writeFileSync(this.counterFile, newCount)\n return newCount\n }", "title": "" }, { "docid": "cee2e2769ba7d43580b5cbefec13bda2", "score": "0.4393803", "text": "function checkForMatch() {\n disableCardsTemporaly();\n\n if (cardsChosen[0].dataset.name === cardsChosen[1].dataset.name) {\n cardsMatched.push(cardsChosen);\n\n setTimeout(() => {\n cardsChosen[0].classList.add(\"match\");\n cardsChosen[1].classList.add(\"match\");\n\n enableCards();\n\n cardsChosen = [];\n\n resultDisplay.textContent = cardsMatched.length;\n if (cardsMatched.length === emogisArray.length) {\n document.getElementById(\"score-title\").textContent =\n \"¡Felicidades, has emparejado todas las tarjetas! 🎉\";\n }\n }, 1000);\n } else {\n notMatched();\n }\n}", "title": "" }, { "docid": "eb8158fdabfb4c56c2b6243141c0a20c", "score": "0.43889868", "text": "function deflate_stored(flush) {\n \t\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n \t\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n \t\t\tvar max_block_size = 0xffff;\n \t\t\tvar max_start;\n\n \t\t\tif (max_block_size > pending_buf_size - 5) {\n \t\t\t\tmax_block_size = pending_buf_size - 5;\n \t\t\t}\n\n \t\t\t// Copy as much as possible from input to output:\n \t\t\twhile (true) {\n \t\t\t\t// Fill the window as much as possible:\n \t\t\t\tif (lookahead <= 1) {\n \t\t\t\t\tfill_window();\n \t\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\tif (lookahead === 0)\n \t\t\t\t\t\tbreak; // flush the current block\n \t\t\t\t}\n\n \t\t\t\tstrstart += lookahead;\n \t\t\t\tlookahead = 0;\n\n \t\t\t\t// Emit a stored block if pending_buf will be full:\n \t\t\t\tmax_start = block_start + max_block_size;\n \t\t\t\tif (strstart === 0 || strstart >= max_start) {\n \t\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n \t\t\t\t\tlookahead = (strstart - max_start);\n \t\t\t\t\tstrstart = max_start;\n\n \t\t\t\t\tflush_block_only(false);\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n\n \t\t\t\t}\n\n \t\t\t\t// Flush if we may have to slide, otherwise block_start may become\n \t\t\t\t// negative and the data will be gone:\n \t\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n \t\t\t\t\tflush_block_only(false);\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tflush_block_only(flush == Z_FINISH);\n \t\t\tif (strm.avail_out === 0)\n \t\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n \t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n \t\t}", "title": "" }, { "docid": "eb8158fdabfb4c56c2b6243141c0a20c", "score": "0.43889868", "text": "function deflate_stored(flush) {\n \t\t\t// Stored blocks are limited to 0xffff bytes, pending_buf is limited\n \t\t\t// to pending_buf_size, and each stored block has a 5 byte header:\n\n \t\t\tvar max_block_size = 0xffff;\n \t\t\tvar max_start;\n\n \t\t\tif (max_block_size > pending_buf_size - 5) {\n \t\t\t\tmax_block_size = pending_buf_size - 5;\n \t\t\t}\n\n \t\t\t// Copy as much as possible from input to output:\n \t\t\twhile (true) {\n \t\t\t\t// Fill the window as much as possible:\n \t\t\t\tif (lookahead <= 1) {\n \t\t\t\t\tfill_window();\n \t\t\t\t\tif (lookahead === 0 && flush == Z_NO_FLUSH)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t\tif (lookahead === 0)\n \t\t\t\t\t\tbreak; // flush the current block\n \t\t\t\t}\n\n \t\t\t\tstrstart += lookahead;\n \t\t\t\tlookahead = 0;\n\n \t\t\t\t// Emit a stored block if pending_buf will be full:\n \t\t\t\tmax_start = block_start + max_block_size;\n \t\t\t\tif (strstart === 0 || strstart >= max_start) {\n \t\t\t\t\t// strstart === 0 is possible when wraparound on 16-bit machine\n \t\t\t\t\tlookahead = (strstart - max_start);\n \t\t\t\t\tstrstart = max_start;\n\n \t\t\t\t\tflush_block_only(false);\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n\n \t\t\t\t}\n\n \t\t\t\t// Flush if we may have to slide, otherwise block_start may become\n \t\t\t\t// negative and the data will be gone:\n \t\t\t\tif (strstart - block_start >= w_size - MIN_LOOKAHEAD) {\n \t\t\t\t\tflush_block_only(false);\n \t\t\t\t\tif (strm.avail_out === 0)\n \t\t\t\t\t\treturn NeedMore;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\tflush_block_only(flush == Z_FINISH);\n \t\t\tif (strm.avail_out === 0)\n \t\t\t\treturn (flush == Z_FINISH) ? FinishStarted : NeedMore;\n\n \t\t\treturn flush == Z_FINISH ? FinishDone : BlockDone;\n \t\t}", "title": "" }, { "docid": "c9ecb086b89897512c250e08fde57d4d", "score": "0.43811497", "text": "function checkForMatch() {\n if (openCards[0].children().attr(\"class\") === openCards[1].children().attr(\"class\")) {\n setTimeout(lockCardsInOpenPosition, 2000);\n } else {\n setTimeout(clearOpenCards, 2000);\n }\n}", "title": "" }, { "docid": "7992f8492444c1d397f71f7b6947bf37", "score": "0.43755704", "text": "function checkCount() {\n if (count == restaurants.length) {\n end();\n } else {\n runCamera();\n }\n }", "title": "" }, { "docid": "b021130c3edf1705867ed0f4ff88e405", "score": "0.43630612", "text": "function checkForMatch () {\n if (cardsInPlay[0].backgroundImage === cardsInPlay[1].backgroundImage && cardsInPlay[0].cardId !== cardsInPlay[1].cardId) {\n $messageDisplay.text('Science on!');\n setTimeout( ()=> {\n $messageDisplay.text('');\n }, 700);\n $(`#card-${cardsInPlayIds[0]}`).css('visibility', 'hidden');\n $(`#card-${cardsInPlayIds[1]}`).css('visibility', 'hidden');\n matchScore += 1;\n } else {\n $(`#card-${cardsInPlayIds[0]}`).css('backgroundImage', 'url(\"images/finback-whale.png\")');\n $(`#card-${cardsInPlayIds[1]}`).css('backgroundImage', 'url(\"images/finback-whale.png\")');\n $messageDisplay.text('Try again!');\n setTimeout( ()=> {\n $messageDisplay.text('');\n }, 700);\n }\n cardsInPlayIds = [];\n }", "title": "" }, { "docid": "46bd5239d3f6d58af62506b9be45ddaa", "score": "0.43629122", "text": "isItDone(){\n console.log(\"(Log) Done Counter : \",this.DONE_COUNTER);\n if(this.DONE_COUNTER == 0){\n return true;\n }else{\n return false;\n }\n }", "title": "" }, { "docid": "3dd90161b53ea5533a215d8c4bf3dd4f", "score": "0.43567857", "text": "function matched() {\r\n setTimeout(function() {\r\n $(`#${openedCards[0]}`).toggleClass('open show match');\r\n $(`#${openedCards[1]}`).toggleClass('open show match');\r\n setTimeout(function() {\r\n $(`#${openedCards[0]}`).off();\r\n $(`#${openedCards[1]}`).off();\r\n solved++;\r\n clearOpened();\r\n if (solved === 8) {\r\n end();\r\n }\r\n $('.card').removeClass('disabled');\r\n }, 1000);\r\n }, 1000);\r\n}", "title": "" }, { "docid": "4e04c6a863e01a0a37e451cab8a5c568", "score": "0.4353815", "text": "function report() {\n doneCount++;\n console.log(list.length + '__' + doneCount);\n if(doneCount === list.length)\n callback();\n }", "title": "" }, { "docid": "ab572f505cebefff18e16de95322bd84", "score": "0.43485725", "text": "isDone () {\n return (this.downloadQueue.length == this.successCount + this.errorCount);\n }", "title": "" }, { "docid": "6a5f3fba6b013f0cc85287f6da5faafc", "score": "0.43476576", "text": "function checkForMatch() {\n\t/*If it is a match*/\n\tif (\n\t\ttoggledCards[0].firstElementChild.className ===\n\t\ttoggledCards[1].firstElementChild.className\n\t) {\n\t\ttoggledCards[0].classList.toggle('match');\n\t\ttoggledCards[1].classList.toggle('match');\n\t\ttoggledCards = [];\n\t\tmatched++;\n\t\t if (matched === 8) {\n gameOver();\n }\n\t}/*If it is not a match*/\n\t else {\n\t\tsetTimeout(() => {\n\t\ttoggleCard(toggledCards[0]);\n\t\ttoggleCard(toggledCards[1]);\n\t\ttoggledCards = [];\n\t\t}, 1000);\n\t}\n}", "title": "" }, { "docid": "bf9d9f17dac757b2b11b4cd9d0a46191", "score": "0.43426472", "text": "function count(fileContent){\n let buffer = '';\n for(let i = 0; i < fileContent.length; i++){\n if(takenAccount.includes(fileContent[i])){\n buffer += fileContent[i];\n }else{\n if(buffer) wordsScore[buffer] = (wordsScore[buffer] || 0) + 1;\n buffer = '';\n }\n }\n}", "title": "" }, { "docid": "384953a1a23324e3bbb6cc9292249c0a", "score": "0.43424743", "text": "eatWhile(match) {\n const start = this.pos;\n while (!this.eof() && this.eat(match)) { }\n return !this.pos.isEqual(start);\n }", "title": "" }, { "docid": "5a03ab8c3a3858d2f11521f4e90d0c15", "score": "0.4337594", "text": "function hollowCount() {\r\n\tif (sessionStorage.fuzzyStuff === undefined) {\r\n\t\tsessionStorage.fuzzyStuff = 'unlock oneFuzzy';\r\n\t\thollowCountText();\r\n\t} else if (sessionStorage.fuzzyStuff === \"unlock oneFuzzy\") {\r\n\t\tsessionStorage.fuzzyStuff = 'unlock twoFuzzy';\r\n\t\thollowCountText();\r\n\t} else if (sessionStorage.fuzzyStuff === \"unlock twoFuzzy\") {\r\n\t\tsessionStorage.fuzzyStuff = 'unlock threeFuzzy';\r\n\t\thollowCountText();\r\n\t} else if (sessionStorage.fuzzyStuff === \"unlock threeFuzzy\") {\r\n\t\tsessionStorage.fuzzyStuff = 'unlock fourFuzzy';\r\n\t\thollowCountText();\r\n\t} else {\r\n\t\tsessionStorage.fuzzyStuff = 'unlock fiveFuzzy';\r\n\t\thollowCountText();\r\n\t\tapprehensionFruitCheck();\r\n\t}\r\n}", "title": "" }, { "docid": "2aea80a1304d2a70ab1fd3f47d923ee0", "score": "0.4337559", "text": "function saveMatch(returnImageID, newImageURL, faceID, confidence){\n if (signedIn && userID) {\n // User is signed in and their ID is being stored locally.\n console.log(\"About to send FaceID: \" + faceID)\n matchInfo = {\n submitUser: userID,\n returnImageID: returnImageID,\n newImageURL: newImageURL,\n faceID: faceID,\n confidence: confidence\n };\n $.post(\"/matches\", matchInfo, function(data) {\n // If the save is successful, local storage is wiped out. \n localStorage.setItem(\"returnImageID\", \"\");\n localStorage.setItem(\"newImageURL\", \"\");\n });\n } else if (signedIn) {\n // If the user is signed in, but their ID is not available, their ID should be checked.\n checkID();\n saveMatch(returnImageID, newImageURL, data.persistedFaceId, confidence);\n } else {\n // If the user is not signed in, their information should be stored locally. \n localStorage.setItem(\"returnImageID\", returnImageID);\n localStorage.setItem(\"newImageURL\", newImageURL);\n localStorage.setItem(\"newFaceID\", faceID);\n localStorage.setItem(\"confidence\", confidence);\n }\n}", "title": "" }, { "docid": "123ffd1e884fd2a36a2ff2f18f303d8c", "score": "0.4335204", "text": "function matchHandler(link) {\n request(link, function (err, response, data) {\n // console.log(\"Match Data Recieved\");\n // console.log(response);clear\n if (err === null && response.statusCode === 200) {\n // console.log(`match${count} recieved`);\n // work end => sequence \n fs.writeFileSync(`match${count}.html`, data);\n count--;\n handleEachMatch(data);\n if (count == 0) {\n // console.log(\"All match processed\");\n console.table(leaderboard);\n }\n // console.log(\"Processing Data\");\n } else if (response.statusCode === 404) {\n console.log(\"Page Not found\");\n } else {\n console.log(err);\n console.log(response.statusCode)\n }\n })\n}", "title": "" }, { "docid": "b4d71902d286eeb3010188e5c0c0acac", "score": "0.43347356", "text": "function handleMatch(match, loopNdx, quantifierRecurse) {\n\t\t\t\t\t\tfunction isFirstMatch(latestMatch, tokenGroup) {\n\t\t\t\t\t\t\tvar firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;\n\t\t\t\t\t\t\tif (!firstMatch) {\n\t\t\t\t\t\t\t\t$.each(tokenGroup.matches, function(ndx, match) {\n\t\t\t\t\t\t\t\t\tif (match.isQuantifier === true) {\n\t\t\t\t\t\t\t\t\t\tfirstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]);\n\t\t\t\t\t\t\t\t\t\tif (firstMatch) return false;\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\treturn firstMatch;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfunction resolveNdxInitializer(pos, alternateNdx) {\n\t\t\t\t\t\t\tvar bestMatch = selectBestMatch(pos, alternateNdx);\n\t\t\t\t\t\t\treturn bestMatch ? bestMatch.locator.slice(bestMatch.alternation + 1) : [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (testPos > 10000) {\n\t\t\t\t\t\t\tthrow \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + getMaskSet().mask;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (testPos === pos && match.matches === undefined) {\n\t\t\t\t\t\t\tmatches.push({\n\t\t\t\t\t\t\t\t\"match\": match,\n\t\t\t\t\t\t\t\t\"locator\": loopNdx.reverse(),\n\t\t\t\t\t\t\t\t\"cd\": cacheDependency\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t} else if (match.matches !== undefined) {\n\t\t\t\t\t\t\tif (match.isGroup && quantifierRecurse !== match) { //when a group pass along to the quantifier\n\t\t\t\t\t\t\t\tmatch = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx);\n\t\t\t\t\t\t\t\tif (match) return true;\n\t\t\t\t\t\t\t} else if (match.isOptional) {\n\t\t\t\t\t\t\t\tvar optionalToken = match;\n\t\t\t\t\t\t\t\tmatch = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\tlatestMatch = matches[matches.length - 1].match;\n\t\t\t\t\t\t\t\t\tif (isFirstMatch(latestMatch, optionalToken)) {\n\t\t\t\t\t\t\t\t\t\tinsertStop = true; //insert a stop\n\t\t\t\t\t\t\t\t\t\ttestPos = pos; //match the position after the group\n\t\t\t\t\t\t\t\t\t} else return true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (match.isAlternator) {\n\t\t\t\t\t\t\t\tvar alternateToken = match,\n\t\t\t\t\t\t\t\t\tmalternateMatches = [],\n\t\t\t\t\t\t\t\t\tmaltMatches,\n\t\t\t\t\t\t\t\t\tcurrentMatches = matches.slice(),\n\t\t\t\t\t\t\t\t\tloopNdxCnt = loopNdx.length;\n\t\t\t\t\t\t\t\tvar altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\n\t\t\t\t\t\t\t\tif (altIndex === -1 || typeof altIndex === \"string\") {\n\t\t\t\t\t\t\t\t\tvar currentPos = testPos,\n\t\t\t\t\t\t\t\t\t\tndxInitializerClone = ndxInitializer.slice(),\n\t\t\t\t\t\t\t\t\t\taltIndexArr = [],\n\t\t\t\t\t\t\t\t\t\tamndx;\n\t\t\t\t\t\t\t\t\tif (typeof altIndex == \"string\") {\n\t\t\t\t\t\t\t\t\t\taltIndexArr = altIndex.split(\",\");\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (amndx = 0; amndx < alternateToken.matches.length; amndx++) {\n\t\t\t\t\t\t\t\t\t\t\taltIndexArr.push(amndx);\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\tfor (var ndx = 0; ndx < altIndexArr.length; ndx++) {\n\t\t\t\t\t\t\t\t\t\tamndx = parseInt(altIndexArr[ndx]);\n\t\t\t\t\t\t\t\t\t\tmatches = [];\n\t\t\t\t\t\t\t\t\t\t//set the correct ndxInitializer\n\t\t\t\t\t\t\t\t\t\tndxInitializer = resolveNdxInitializer(testPos, amndx);\n\t\t\t\t\t\t\t\t\t\tmatch = handleMatch(alternateToken.matches[amndx] || maskToken.matches[amndx], [amndx].concat(loopNdx), quantifierRecurse) || match;\n\t\t\t\t\t\t\t\t\t\tif (match !== true && match !== undefined && (altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length)) { //no match in the alternations (length mismatch) => look further\n\t\t\t\t\t\t\t\t\t\t\tvar ntndx = $.inArray(match, maskToken.matches) + 1;\n\t\t\t\t\t\t\t\t\t\t\tif (maskToken.matches.length > ntndx) {\n\t\t\t\t\t\t\t\t\t\t\t\tmatch = handleMatch(maskToken.matches[ntndx], [ntndx].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse);\n\t\t\t\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t\t\t\taltIndexArr.push(ntndx.toString());\n\t\t\t\t\t\t\t\t\t\t\t\t\t$.each(matches, function(ndx, lmnt) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlmnt.alternation = loopNdx.length - 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\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\tmaltMatches = matches.slice();\n\t\t\t\t\t\t\t\t\t\ttestPos = currentPos;\n\t\t\t\t\t\t\t\t\t\tmatches = [];\n\t\t\t\t\t\t\t\t\t\t//cloneback\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < ndxInitializerClone.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tndxInitializer[i] = ndxInitializerClone[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//fuzzy merge matches\n\t\t\t\t\t\t\t\t\t\tfor (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\n\t\t\t\t\t\t\t\t\t\t\tvar altMatch = maltMatches[ndx1];\n\t\t\t\t\t\t\t\t\t\t\taltMatch.alternation = altMatch.alternation || loopNdxCnt;\n\t\t\t\t\t\t\t\t\t\t\tfor (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar altMatch2 = malternateMatches[ndx2];\n\t\t\t\t\t\t\t\t\t\t\t\t//verify equality\n\t\t\t\t\t\t\t\t\t\t\t\tif (altMatch.match.def === altMatch2.match.def && (typeof altIndex !== \"string\" || $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (altMatch.match.mask === altMatch2.match.mask) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmaltMatches.splice(ndx1, 1);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tndx1--;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (altMatch2.locator[altMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taltMatch2.locator[altMatch.alternation] = altMatch2.locator[altMatch.alternation] + \",\" + altMatch.locator[altMatch.alternation];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taltMatch2.alternation = altMatch.alternation; //we pass the alternation index => used in determineLastRequiredPosition\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tmalternateMatches = malternateMatches.concat(maltMatches);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (typeof altIndex == \"string\") { //filter matches\n\t\t\t\t\t\t\t\t\t\tmalternateMatches = $.map(malternateMatches, function(lmnt, ndx) {\n\t\t\t\t\t\t\t\t\t\t\tif (isFinite(ndx)) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar mamatch,\n\t\t\t\t\t\t\t\t\t\t\t\t\talternation = lmnt.alternation,\n\t\t\t\t\t\t\t\t\t\t\t\t\taltLocArr = lmnt.locator[alternation].toString().split(\",\");\n\t\t\t\t\t\t\t\t\t\t\t\tlmnt.locator[alternation] = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\tlmnt.alternation = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\tfor (var alndx = 0; alndx < altLocArr.length; alndx++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tmamatch = $.inArray(altLocArr[alndx], altIndexArr) !== -1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (mamatch) { //rebuild the locator with valid entries\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (lmnt.locator[alternation] !== undefined) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlmnt.locator[alternation] += \",\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlmnt.locator[alternation] += altLocArr[alndx];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else lmnt.locator[alternation] = parseInt(altLocArr[alndx]);\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlmnt.alternation = alternation;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (lmnt.locator[alternation] !== undefined) return lmnt;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tmatches = currentMatches.concat(malternateMatches);\n\t\t\t\t\t\t\t\t\ttestPos = pos;\n\t\t\t\t\t\t\t\t\tinsertStop = matches.length > 0; //insert a stopelemnt when there is an alternate - needed for non-greedy option\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// if (alternateToken.matches[altIndex]) { //if not in the initial alternation => look further\n\t\t\t\t\t\t\t\t\tmatch = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [altIndex].concat(loopNdx), quantifierRecurse);\n\t\t\t\t\t\t\t\t\t// } else match = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (match) return true;\n\t\t\t\t\t\t\t} else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) {\n\t\t\t\t\t\t\t\tvar qt = match;\n\t\t\t\t\t\t\t\tfor (var qndx = (ndxInitializer.length > 0) ? ndxInitializer.shift() : 0;\n\t\t\t\t\t\t\t\t\t(qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max)) && testPos <= pos; qndx++) {\n\t\t\t\t\t\t\t\t\tvar tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\n\t\t\t\t\t\t\t\t\tmatch = handleMatch(tokenGroup, [qndx].concat(loopNdx), tokenGroup); //set the tokenGroup as quantifierRecurse marker\n\t\t\t\t\t\t\t\t\tif (match) {\n\t\t\t\t\t\t\t\t\t\t//get latest match\n\t\t\t\t\t\t\t\t\t\tlatestMatch = matches[matches.length - 1].match;\n\t\t\t\t\t\t\t\t\t\tlatestMatch.optionalQuantifier = qndx > (qt.quantifier.min - 1);\n\t\t\t\t\t\t\t\t\t\tif (isFirstMatch(latestMatch, tokenGroup)) { //search for next possible match\n\t\t\t\t\t\t\t\t\t\t\tif (qndx > (qt.quantifier.min - 1)) {\n\t\t\t\t\t\t\t\t\t\t\t\tinsertStop = true;\n\t\t\t\t\t\t\t\t\t\t\t\ttestPos = pos; //match the position after the group\n\t\t\t\t\t\t\t\t\t\t\t\tbreak; //stop quantifierloop\n\t\t\t\t\t\t\t\t\t\t\t} else return true;\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\treturn true;\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} else {\n\t\t\t\t\t\t\t\tmatch = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n\t\t\t\t\t\t\t\tif (match) return true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else testPos++;\n\t\t\t\t\t}", "title": "" }, { "docid": "1ccc42a0780d1316105596b73c4179b8", "score": "0.43322673", "text": "function testMatchesCount(refCount) {\n\ttest(\"Test matches count\", function(target, app) {\n\t\n\t\ttarget.delay(2);\n\n\t\t//-- Tap on Spieltage/Videos tab \n\t\ttestTabBarItem(app, \"Spieltage/Videos\", \"13. Spieltag\");\n\t\t\n\t\ttarget.delay(2);\t\n\t\t\t\n\t\t//-- Assert that the count of matches is referenced one\n\t\tUIALogger.logMessage(\"Assert that the count of matches is : \" + refCount);\n\t\tvar window = app.mainWindow();\n\t\tassertEquals(refCount, window.collectionViews()[0].elements().length);\n\n\t});\n}", "title": "" }, { "docid": "b8071ec12c04409d5a4f3dc3506110ea", "score": "0.43305337", "text": "function checkMatch(){\r\n\t\t\r\n\t\tattempts += 1; // track match attempts made.\r\n\t\t\r\n\t\t// If both cards are the same, reset all values, and\r\n\t\t// subtract 2 cards from total cards as they are no longer\r\n\t\t// in play.\r\n\t\t// If they are different, add back the click listeners\r\n\t\t// and hide/flip them back.\r\n\t\tif (firstNum == secondNum) {\r\n\t\t\tfirstCard = \"\";\r\n\t\t\tfirstNum = -1;\r\n\t\t\tsecondCard = \"\";\r\n\t\t\tsecondNum = -1;\r\n\t\t\t\r\n\t\t\t// set active cards to 0 after a delay so user cannot choose third card.\r\n\t\t\twindow.setTimeout(function() {flipped = 0;}, 1500);\r\n\t\t\ttotalCards -= 2;\r\n\t\t} else {\r\n\t\t\tfirstCard.on(\"click\", chooseTile);\r\n\t\t\tfirstCard.attr(\"data-isflipped\", \"false\");\r\n\t\t\tsecondCard.attr(\"data-isflipped\", \"false\");\r\n\t\t\tsecondCard.on(\"click\", chooseTile);\r\n\t\t\twindow.setTimeout(hideCards, 1500);\t\r\n\t\t}\r\n\t\t\r\n\t\t// If the last two cards have been matched,\r\n\t\t// then totalCards = 0.\r\n\t\t// Tell the user they won, and initiate end game procedures.\r\n\t\tif (totalCards === 0) {\r\n\t\t\twindow.setTimeout (function() {\r\n\t\t\t\talert(\"You won! It took you \" + attempts + \" matching attempts.\")\r\n\t\t\t\tgameOver();\r\n\t\t\t}, 1500);\r\n\t\t}\r\n\t} // end of checkMatch", "title": "" }, { "docid": "e66ba27ea97dba7d6cdac0629802bff9", "score": "0.43304837", "text": "function checkDone() {\n // Make sure all files have been read\n if (!(head && packedRefs && typeof master !== 'undefined')) { return; }\n // Parse the sha1 out of the files.\n try {\n if (master) {\n shaCache = master.match(/([a-f0-9]{40})\\n/)[1];\n } else {\n shaCache = packedRefs.match(\n new RegExp(\"([a-f0-9]{40}) \" + head)\n )[1];\n }\n } catch (err) { groupCallback(err); return; }\n\n // return the value to the caller's callback\n groupCallback(null, shaCache);\n\n // Leave the cache alive for a little bit in case of heavy load.\n setTimeout(function () { shaCache = false; }, CACHE_LIFE[1]);\n }", "title": "" }, { "docid": "8ab57fe7d42f84f8f0d303203ba834d4", "score": "0.43289077", "text": "allSurveysComplete() {\n if (!this.state.loaded) {\n return false;\n }\n //Improvement: factor out all of the parsing of localstorage to put this into state\n // But need to make sure setState when the previous completions change...\n\n let finishedCount = 0;\n const previousCompletions = JSON.parse(\n localStorage.getItem(\"prevCompletions\")\n );\n for (const survey of this.state.allSurveys) {\n if (\n !previousCompletions ||\n !previousCompletions.hasOwnProperty(survey.surveyId)\n ) {\n // return false;\n // If a survey is yet to be finished, do not count\n } else {\n finishedCount = finishedCount + 1;\n }\n }\n if (finishedCount >= (this.state.allSurveys.length - 1)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "53e9cbdce239664aa31e0783fdd54c74", "score": "0.43275884", "text": "function saveTargetCount(txn, metadata) {\r\n\t var globalStore = txn.store(DbTargetGlobal.store);\r\n\t var targetStore = txn.store(DbTarget.store);\r\n\t return targetStore.count().next(function (count) {\r\n\t metadata.targetCount = count;\r\n\t return globalStore.put(DbTargetGlobal.key, metadata);\r\n\t });\r\n\t}", "title": "" }, { "docid": "c5fb4cf8fe6f6dcac4e7f9dfba8c9e16", "score": "0.43254426", "text": "function gameCompleted(){\r\n\tlet completedCount = document.querySelectorAll('li.match').length;\r\n\treturn completedCount == cards.length * 2;\r\n}", "title": "" }, { "docid": "d0442ae68d668fd36609b1445c3312f2", "score": "0.43221238", "text": "function cardsMatched() {\n increaseMatchCount()\n gameData.openCards[0].removeClass(\"animated bounceIn\");\n gameData.openCards[1].removeClass(\"animated bounceIn\");\n if (gameData.matchCount === 8) {\n gameData.openCards[0].addClass(\"open show match tada animated\");\n gameData.openCards[1].addClass(\"open show match tada animated\");\n setTimeout(endGame, 700)\n }\n else {\n gameData.openCards[0].addClass(\" open show match tada animated\");\n gameData.openCards[1].addClass(\" open show match tada animated\");\n }\n }", "title": "" }, { "docid": "de3894df5673c313eec4b2a2c4854e3a", "score": "0.43174002", "text": "function testMatchesCount(refCount) {\n\ttest(\"Test matches count\", function(target, app) {\n\t\n\t\ttarget.delay(2);\n\n\t\t//-- Tap on Spieltage/Videos tab \n\t\ttestTabBarItem(app, \"Spieltage/Videos\", \"12. Spieltag\");\n\t\t\n\t\ttarget.delay(2);\t\n\t\t\t\n\t\t//-- Assert that the count of matches is referenced one\n\t\tUIALogger.logMessage(\"Assert that the count of matches is : \" + refCount);\n\t\tvar window = app.mainWindow();\n\t\tassertEquals(refCount, window.collectionViews()[0].elements().length);\n\n\t});\n}", "title": "" }, { "docid": "e1791bbac16afab85d989db602061874", "score": "0.43128258", "text": "get matchCount() {\n return this._results.length;\n }", "title": "" }, { "docid": "4c22371e8e1800118971139a067537d2", "score": "0.43125203", "text": "function tracker() {\n\n if (pointStore === randomTarget) {\n winTrack++;\n $(\"#win-tracker\").text(\"You've collected \" + winTrack + \". Well Done.\")\n resetGame();\n }\n\n else if (pointStore > randomTarget) {\n lossTrack++;\n $(\"#loss-tracker\").text(\"You've lost \" + lossTrack + \". Not Good, Friend.\")\n resetGame();\n }\n }", "title": "" }, { "docid": "3531350bece614cc9be88348ff7f66c7", "score": "0.43115956", "text": "function checkForMatch() {\n if (toggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className) {\n toggledCards[0].classList.toggle('match');\n toggledCards[1].classList.toggle('match');\n toggledCards = [];\n matched++;\n } else {\n setTimeout(() => {\n toggleCard(toggledCards[0]);\n toggleCard(toggledCards[1]);\n toggledCards = [];\n }, 1000);\n }\n}", "title": "" }, { "docid": "45abdff26499e6199572555df02bac00", "score": "0.43097472", "text": "function match(){\n maxOpen.forEach(\n function(card){\n card.classList.remove('open','show');\n card.classList.add('match');\n matchCards += 1;\n }\n )\n counter();\n score();\n maxOpen = [];\n }", "title": "" }, { "docid": "27fa8092994a8fabba6e10af789305d0", "score": "0.43088153", "text": "function checkPresent(Present)\n{\n if(realPos > Present.x_pos && realPos < Present.x_pos + Present.size)\n {\n if(!Present.isFound)\n {\n Present.isFound = true;\n score += 1;\n console.log(score);\n }\n \n }\n}", "title": "" }, { "docid": "a88318a7515c2f61fc04a9e6f3ab9909", "score": "0.43047446", "text": "eatWhile(match) {\n const start = this.pos;\n while (!this.eof() && this.eat(match)) { /* */ }\n return this.pos !== start;\n }", "title": "" }, { "docid": "562675650d3a5c460aee2d66e20f6de9", "score": "0.43032882", "text": "function match() {\n incrementMoves();\n for(let i = 0; i < openCards.length; i++) {\n openCards[i].classList.add(\"match\");\n listOfMatches.push(openCards[i]);\n }\n //when listOfMatches is full of matched cards, invoke endingGame()\n if(listOfMatches.length == 16) {\n endingGame();\n }\n openCards = [];\n }", "title": "" }, { "docid": "b6f205d291cfb68953f3e3f06c7ed511", "score": "0.4302613", "text": "function incrementMatch () {\r\n return 2 + increment++\r\n }", "title": "" }, { "docid": "4fa29c50989772808f18a35c6256393e", "score": "0.43008226", "text": "function savoury() {\n savouryScore += 1; \n questionCount += 1;\n\n console.log(\"questionCount = \" + questionCount + \"\\t\" + \"savouryScore = \" + savouryScore);\n\n if (questionCount == 5) {\n console.log(\"The quiz is done!\")\n updateResult();\n }\n\n}", "title": "" }, { "docid": "9ef63c68b20fdd3a1124651e03f1c655", "score": "0.42980084", "text": "function isMatch() {\r\n\r\n if ($$('.face-up img').getAttribute('src') === $$('.match img').getAttribute('src')) {\r\n oneCardTurned = false;\r\n $$('#correct').innerHTML++;\r\n $$('.face-up').classList.add(\"matched\");\r\n $$('.face-up').classList.remove(\"face-up\");\r\n $$('.match').classList.add(\"matched\");\r\n $$('.match').classList.remove(\"match\");\r\n\r\n //Ending the game\r\n if ($$('#correct').innerHTML == (difficulty / 2)) {\r\n setTimeout(function () {\r\n $$('#end').classList.remove(\"hide\");\r\n $$('#endtime').innerHTML = (\" \" + $$('#correct').innerHTML + \" moves\");\r\n $$('#restart').classList.add(\"pulse\");\r\n }, 300);\r\n }\r\n } else {\r\n setTimeout(function () {\r\n oneCardTurned = false;\r\n $$('#miss').innerHTML++;\r\n flipImage($$('.face-up'));\r\n flipImage($$('.match'));\r\n $$('.face-up').classList.remove(\"face-up\");\r\n $$('.match').classList.remove(\"match\");\r\n }, 300);\r\n }\r\n\r\n }", "title": "" } ]
deb92a39f03acd7a5be1c902e429b6fe
a function to zip an array of arrays similar to zip in Python this code from stack exchange
[ { "docid": "7fb49a2f39695e483772a0a6fe251c12", "score": "0.80162704", "text": "function zip(arrays) {\n return arrays[0].map(function(_,i){\n return arrays.map(function(array){return array[i]})\n });\n}", "title": "" } ]
[ { "docid": "d56ffd027fd38c5e8347d86e22316f4f", "score": "0.80427647", "text": "function zip(arrays) {\n return arrays[0].map(function(_, i) {\n return arrays.map(function(array) { return array[i]; })\n });\n }", "title": "" }, { "docid": "2b61330afc5d9859393b6c385d7010d4", "score": "0.80364054", "text": "function zip(arrays) {\n return arrays[0].map(function(_,i){\n return arrays.map(function(array){return array[i]})\n });\n}", "title": "" }, { "docid": "3d49d728151dbde73bc8a83d24b13c16", "score": "0.80269", "text": "function zip(arrays) {\n return arrays[0].map(function(_,i){\n return arrays.map(function(array){return array[i]});\n });\n}", "title": "" }, { "docid": "c7e445361452d3463c7b7c61b3cbc9a5", "score": "0.7849504", "text": "function zip(array) {\n var args = Array.from(arguments);\n return args[0].reduce(function (acc, cur, idx0) {\n var temp = [];\n args.forEach(function (a, idx) {\n temp.push(args[idx][idx0]);\n });\n acc.push(temp);\n return acc;\n }, []);\n\n // with two forEach-es\n // var newArr = [];\n // args[0].forEach(function (a0, idx0){\n // var temp = [];\n // args.forEach(function(a, idx){\n // temp.push(args[idx][idx0]);\n // });\n // newArr.push(temp);\n // });\n // return newArr;\n}", "title": "" }, { "docid": "5467613635f96ce76d65b88140f8e7b9", "score": "0.77459645", "text": "function zip(arrays) {\n return arrays.length == 0 ? [] : arrays[0].map(function(_, i) {\n return arrays.map(function(array) {\n return array[i];\n });\n });\n}", "title": "" }, { "docid": "71949c0b7b585e154901bc1e929939a6", "score": "0.7579628", "text": "function zipArrays() {\n var zipped = [];\n var arrays = [].slice.call(arguments);\n for (var valueI = 0; arrays.length > 0; valueI++) {\n for (var arrayI = 0; arrayI < arrays.length; arrayI++) {\n if (arrays[arrayI].length - 1 < valueI) {\n arrays.splice(arrayI, 1);\n continue;\n }\n zipped.push(arrays[arrayI][valueI]);\n }\n }\n return zipped;\n}", "title": "" }, { "docid": "fbc8b6aa128b4b0adcb263922702b643", "score": "0.7578709", "text": "function zip() {\n var arrs = argsToArray(arguments);\n var arrLengths = arrs.map(function (a) { return a.length; });\n var zipLength = Math.min.apply(null, arrLengths);\n return range(zipLength).map(function (i) {\n return arrs.map(function (a) { return a[i]; });\n });\n}", "title": "" }, { "docid": "5f4c968fad8bd47e097cff7ee73d7b0e", "score": "0.7486662", "text": "function zip(){\n var result = [];\n for (let n = 0; n < arguments[0].length; n++) {\n result.push([]);\n }\n // there should be N nested arrays for N elements in each array passed in\n // e.g. if first array has 10 elements, resulting number of nested arrays is 10\n\n // loop through the arguments (they are all arrays)\n // grab first/i element of each one, add to a new array\n // add that new array to the result\n for (let i = 0; i < arguments[0].length; i++) {\n for (let j = 0; j < arguments.length; j++) {\n result[i].push(arguments[j][i]);\n }\n }\n return result;\n} // note that this will only work if the longest array in the arguments is the 1st one passed in", "title": "" }, { "docid": "491ab898655b0ccfeb550e0a1a6ae15b", "score": "0.7463428", "text": "function zip (arr1, arr2) {\n var output = [];\n for (var i = 0; i < arr1.length; i++){\n output.push(arr1[i]);\n output.push(arr2[i]);\n }\n return output;\n}", "title": "" }, { "docid": "b369f8aa808490673d992e6afa81d6a0", "score": "0.7257924", "text": "function zipArray(a, b) {\n if (a.length < b.length) {\n return a.map(function (elem, idx) { return [elem, b[idx]]; });\n }\n else {\n return b.map(function (elem, idx) { return [a[idx], elem]; });\n }\n}", "title": "" }, { "docid": "a6ecfd4cca80187fb824e3e27900c441", "score": "0.70217144", "text": "function zipper() {\n\tvar combine = _identity2.default;\n\n\tfunction zip() {\n\t\tvar n = arguments.length;\n\t\tif (!n) return [];\n\t\tvar m = (0, _d3Array.min)(arguments, d3_zipLength);\n\n\t\t// eslint-disable-next-line prefer-const\n\t\tvar i = void 0,\n\t\t zips = new Array(m);\n\t\tfor (i = -1; ++i < m;) {\n\t\t\tfor (var j = -1, _zip = zips[i] = new Array(n); ++j < n;) {\n\t\t\t\t_zip[j] = arguments[j][i];\n\t\t\t}\n\t\t\tzips[i] = combine.apply(this, zips[i]);\n\t\t}\n\t\treturn zips;\n\t}\n\tfunction d3_zipLength(d) {\n\t\treturn d.length;\n\t}\n\tzip.combine = function (x) {\n\t\tif (!arguments.length) {\n\t\t\treturn combine;\n\t\t}\n\t\tcombine = x;\n\t\treturn zip;\n\t};\n\treturn zip;\n}", "title": "" }, { "docid": "be6dc78827e40770e83a8eb40136ea87", "score": "0.69740766", "text": "function Array_static_zip(a1, a2, combiner) {\n var l1 = a1.length;\n var l2 = a2.length;\n return Multicore.build(\n\tfunction (i) {\n\t var v = i < l1 ? a1[i] : undefined;\n\t var w = i < l2 ? a2[i] : undefined;\n\t return combiner(v, w);\n\t},\n\tnew Array(Math.max(l1, l2)),\n\t[[0, Math.max(l1, l2)]]);\n}", "title": "" }, { "docid": "25455ff233dacf4bfe7ce546658e60d4", "score": "0.69728935", "text": "function zip(arr1, arr2){\n var finalArr = [];\n var length;\n if (arr1.length > arr2.length){\n length = arr1.length;\n\n }else {\n length = arr2.length;\n\n }\n for (var i =0; i < length; i++){\n var elem1 = arr1.shift();\n var elem2 = arr2.shift();\n if (arr1.length >0 && arr2.length > 0){\n finalArr.push(elem1, elem2);\n\n }else if (arr1.length > 0 || arr2.length === 0){\n finalArry.push(elem1);\n\n }else if (arr1.length === 0 || arr2.length > 0){\n finalArr.push(elem2);\n\n }else {\n finalArry.push(elem2);\n }\n }\n return finalArr;\n}", "title": "" }, { "docid": "940173eb2718df648f63154c0cd7bf6d", "score": "0.69260633", "text": "function zip(first, second) {\n var realArray;\n var zipped = [];\n if (first.length <= second.length) {\n realArray = first;\n } else {\n realArray = second;\n }\n for (var i = 0; i < realArray.length; i++) {\n zipped.push([first[i], second[i]]);\n }\n return zipped;\n\n}", "title": "" }, { "docid": "1118f4bb369061b4e541af988a1d5836", "score": "0.6902526", "text": "function zip(a, b) {\n var zipped = [];\n for (var i = 0, l = a.length; i < l; i++) {\n zipped.push([a[i], b[i]]);\n }\n return zipped;\n}", "title": "" }, { "docid": "1118f4bb369061b4e541af988a1d5836", "score": "0.6902526", "text": "function zip(a, b) {\n var zipped = [];\n for (var i = 0, l = a.length; i < l; i++) {\n zipped.push([a[i], b[i]]);\n }\n return zipped;\n}", "title": "" }, { "docid": "5be1a9e08ec331f39cebef3573f21100", "score": "0.68166757", "text": "function zipper() {\n\tvar combine = _identity__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n\n\tfunction zip() {\n\t\tvar n = arguments.length;\n\t\tif (!n) return [];\n\t\tvar m = Object(d3_array__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(arguments, d3_zipLength);\n\n\t\t// eslint-disable-next-line prefer-const\n\t\tvar i = void 0,\n\t\t zips = new Array(m);\n\t\tfor (i = -1; ++i < m;) {\n\t\t\tfor (var j = -1, _zip = zips[i] = new Array(n); ++j < n;) {\n\t\t\t\t_zip[j] = arguments[j][i];\n\t\t\t}\n\t\t\tzips[i] = combine.apply(this, zips[i]);\n\t\t}\n\t\treturn zips;\n\t}\n\tfunction d3_zipLength(d) {\n\t\treturn d.length;\n\t}\n\tzip.combine = function (x) {\n\t\tif (!arguments.length) {\n\t\t\treturn combine;\n\t\t}\n\t\tcombine = x;\n\t\treturn zip;\n\t};\n\treturn zip;\n}", "title": "" }, { "docid": "dc91388e26728b52372382cc074566c7", "score": "0.66014135", "text": "function zip(a, b) {\n var accum = [],\n i;\n\n for(i = 0; i < Math.min(a.length, b.length); i++) {\n accum.push([a[i], b[i]]);\n }\n\n return accum;\n}", "title": "" }, { "docid": "5cf4ba12b1380d193860f824a808ac09", "score": "0.65995103", "text": "function unzip(){ // unzip takes in a result in the format of what's returned from zip\n // e.g. [['a', 1, true], ['b', 2, false]], which has a length of 1\n var result = [];\n // there should be N nested arrays for N elements in each arg\n for (let n = 0; n < arguments[0][0].length; n++) {\n result.push([]);\n }\n\n // loop through the arguments (they are all arrays)\n // grab first/i element of each one, add to a new array\n // add that new array to the result\n for (let i = 0; i < result.length; i++) {\n for (let j = 0; j < arguments[0].length; j++) {\n result[i].push(arguments[0][j][i]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "faae7e48c5ccdf31127ab07fbe3993ce", "score": "0.6485868", "text": "function zip(left, right) {\n if (right === undefined) {\n return function (right) {\n return zip(left, right);\n };\n }\n\n var result = [];\n var length = Math.min(left.length, right.length);\n\n for (var i = 0; i < length; i++) {\n result[i] = [left[i], right[i]];\n }\n\n return result;\n}", "title": "" }, { "docid": "24e303f8a348dde7753eafa129585b87", "score": "0.64702994", "text": "function Zip() {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n var self = this instanceof Zip ? this : Object.create(Zip.prototype);\n self._sources = sources;\n for (var i = 0; i < self._sources.length; i++) {\n if (isArrayLike(self._sources[i])) {\n self._sources[i] = FromArray_1.default(self._sources[i]);\n }\n }\n return self;\n}", "title": "" }, { "docid": "2e4d4e14d945afaf44b4fe97fd302808", "score": "0.64627916", "text": "function zip() {\n var args = Array.prototype.slice.call(arguments, 0);\n var liveIters = args.length;\n var item;\n while (true) {\n item = new Array(args.length);\n for (var i = 0; i < args.length; i++) {\n if (args[i] == null) continue;\n try {\n item[i] = args[i].next()\n } catch (e if e instanceof StopIteration) {\n args[i] = null;\n liveIters--;\n if (0 == liveIters) throw StopIteration;\n }\n }\n yield item;\n }\n}", "title": "" }, { "docid": "971ffaeb1037214e888b03fa6ddfee27", "score": "0.64047474", "text": "function zip$1() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n return function zipOperatorFunction(source) {\n return source.lift.call(zip.apply(void 0, [source].concat(observables)));\n };\n}", "title": "" }, { "docid": "ff8086d85c68ad003f8b0c4a72409ca2", "score": "0.63936126", "text": "function zip(fb) {\n return zipWith(fb, Tp.tuple);\n}", "title": "" }, { "docid": "fd6d7ff1dbbcf3fd6c5466408bc25ca0", "score": "0.6366075", "text": "function zipWith3(f, xs, ys, zs) {\n return zs.length ? [f(xs[0], ys[0], zs[0])].concat(\n zipWith3(f, xs.slice(1), ys.slice(1), zs.slice(1))) : [];\n }", "title": "" }, { "docid": "de24c1297f453c2aafaf101c6590de64", "score": "0.63613665", "text": "function zip() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i] = arguments[_i];\n }\n var resultSelector = observables[observables.length - 1];\n if (typeof resultSelector === 'function') {\n observables.pop();\n }\n return fromArray(observables, undefined).lift(new ZipOperator(resultSelector));\n}", "title": "" }, { "docid": "adc90cafcc20a4a3314495f119096274", "score": "0.6356341", "text": "function zip(a, b) {\n if (!b) {\n return a;\n }\n if (!a) {\n return b;\n }\n const pairs = [];\n for (let i = 0, aLength = a.length, bLength = b.length; i < aLength || i < bLength; i++) {\n pairs.push([a[i], b[i]]);\n }\n return pairs;\n}", "title": "" }, { "docid": "4f77cb0afd6fa066850396796af6753f", "score": "0.6347522", "text": "function __zipper(array, handler, r) {\n var length = array.length;\n if (length < 2)\n return;\n var i = 0, l = length - 1;\n while (i < l) {\n r = handler(array[i++], array[i], r);\n }\n return r;\n }", "title": "" }, { "docid": "8caaf857839b12515d38ab73f93d3e56", "score": "0.6347407", "text": "function convertArray(){\n var arr = new Array();\n\n for(let i=0; i<7; i++){\n let l = collect[i+1].length;\n let t = new Array();\n\n for(let j=0; j<(7-l); j++)\n t.push(\" \");\n \n for(j = 0; j<l-1; j++){\n t.push(collect[i+1][j]);\n }\n arr[i] = t;\n }\n\n return zip(arr); \n}", "title": "" }, { "docid": "405bdea46d754907ab866ced08c20274", "score": "0.6341744", "text": "function zip(arr1, arr2, out = {}) {\n arr1.map((val, idx) => { out[val] = arr2[idx]; });\n return out;\n}", "title": "" }, { "docid": "9b37056f71cd72dcf0b994a798219289", "score": "0.6327075", "text": "function zip(a, b) {\n return new IteratorWithOperators(new zip_1.ZipIterator(utils_1.toIterator(a), utils_1.toIterator(b)));\n}", "title": "" }, { "docid": "2e11618ff48b5a1e7b432cf05a99d1dc", "score": "0.62582624", "text": "function zip_(fa, fb) {\n return zipWith_(fa, fb, Tp.tuple);\n}", "title": "" }, { "docid": "3c749d5123c52a83b622d3677a8f00d2", "score": "0.61634886", "text": "function zip_ntc(...args) {\n\tfunction zip_iter(iters, acc) {\n\t\tif (iters.some(x => x.length === 0))\n\t\t\treturn acc;\n\n\t\tconst heads = iters.map(x => x[0]);\n\t\tconst rests = iters.map(x => x.slice(1));\n\t\treturn zip_iter(rests, [...acc, heads]);\n\t}\n\n\tif (args.length === 0) return [];\n\treturn zip_iter(args, []);\n}", "title": "" }, { "docid": "414e4944eff9244028b8ed43f181c8cd", "score": "0.6102185", "text": "function zipWith_(fa, fb, f) {\n const fc = [];\n const len = Math.min(fa.length, fb.length);\n\n for (let i = 0; i < len; i++) {\n fc[i] = f(fa[i], fb[i]);\n }\n\n return fc;\n}", "title": "" }, { "docid": "9065d921a0264d3ec5d68f9508bb5e5e", "score": "0.6042081", "text": "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}", "title": "" }, { "docid": "9065d921a0264d3ec5d68f9508bb5e5e", "score": "0.6042081", "text": "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}", "title": "" }, { "docid": "9065d921a0264d3ec5d68f9508bb5e5e", "score": "0.6042081", "text": "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}", "title": "" }, { "docid": "9065d921a0264d3ec5d68f9508bb5e5e", "score": "0.6042081", "text": "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}", "title": "" }, { "docid": "9065d921a0264d3ec5d68f9508bb5e5e", "score": "0.6042081", "text": "function zip(a, b) {\n var arr = [];\n for (var ch in a) arr.push([a[ch], b[ch]]);\n return arr;\n}", "title": "" }, { "docid": "d1703df3ad72ceae23cda648be029ab3", "score": "0.6027638", "text": "function zip(a, b) {\n var i;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < a.length)) return [3 /*break*/, 4];\n return [4 /*yield*/, [a[i], b[i]]];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n}", "title": "" }, { "docid": "b5d9673b3ddc48cdc4f94d08fde3d828", "score": "0.596065", "text": "function zipArraysToMap(arr1, arr2) {\n var result = {};\n for (i = 0; i < arr1.length; i++) {\n result[arr1[i]] = arr2[i];\n }\n return result;\n}", "title": "" }, { "docid": "569dd5c51092404394b07122b1b79c70", "score": "0.5951969", "text": "function interleave (arr, arr2) \n {\n let newArr = [];\n for (let i = 0; i < arr.length; i++) \n {\n newArr.push(arr[i], arr2[i]);\n }\n \n return newArr;\n }", "title": "" }, { "docid": "1a0040891002496e6406936b49878221", "score": "0.5949901", "text": "function zipBuffer(as, bs, f) {\n var buffer = [];\n bs.subscribe(b => {\n buffer.push(b);\n });\n\n return as.map(a => {\n var tBuffer = buffer;\n if (buffer.length) {\n buffer = [];\n }\n return f(a, tBuffer)\n });\n}", "title": "" }, { "docid": "4c2775537721ade85db275cc63c1c9c9", "score": "0.5943071", "text": "function zipWith(f, xs, ys) {\n return xs.length === ys.length ? (\n xs.map(function (x, i) {\n return f(x, ys[i]);\n })\n ) : undefined;\n }", "title": "" }, { "docid": "c940e1732b89c82ac6c9269ee59aa90c", "score": "0.59077895", "text": "function transpose(arrays) {\n //return array of transposed arrays\n //iterate the array of arrays\n //in each array, push the elements at the same indices to their own array\n //return array containing the result arrays\n let result = []; //eventually contain result arrays\n\tlet idx = 0;\n \n for (let i = 0; i < arrays[i].length; i++) { //accesses each array\n let toPush = [];\n \n \n for (let j = 0; j < arrays.length; j++) { //accesses each element in the current array\n toPush.push(arrays[j][i]);\n console.log(toPush);\n }\n result.push(toPush);\n }\n return result;\n}", "title": "" }, { "docid": "4f1882426d78146cac5d4c35729a0419", "score": "0.58943856", "text": "function zipperJoin(firstInput, secondInput){\n let returnArray = [];\n if (firstInput.length == secondInput.length){\n for (let i = 0; i < firstInput.length; i++){\n returnArray.push(firstInput[i]);\n returnArray.push(secondInput[i]);\n }\n }\n\n return returnArray;\n}", "title": "" }, { "docid": "8c935f125d70eab17ce24e09ecd45608", "score": "0.5855045", "text": "function zip(x, y) {\n var d = {}\n for (let i = 0; i < x.length; i++) {\n d[x[i]] = y[i]\n }\n console.log(d)\n}", "title": "" }, { "docid": "d5f7123504c16f4b3113c870999e3079", "score": "0.58134735", "text": "function zipWith() {\n var args = Array.prototype.slice.call(arguments, 0);\n var fun = args.shift();\n var liveIters = args.length;\n var item;\n while (true) {\n items = new Array(args.length);\n for (var i = 0; i < args.length; i++) {\n if (args[i] == null) continue;\n try {\n items[i] = args[i].next()\n } catch (e if e instanceof StopIteration) {\n args[i] = null;\n liveIters--;\n if (0 == liveIters) throw StopIteration;\n }\n }\n // don't know what a useful \"thisArg\" might be here\n yield fun.apply(items, items);\n }\n}", "title": "" }, { "docid": "89e4bc6de381c4016293f3e426da8a77", "score": "0.5791773", "text": "function zip(that) {\n return self => zip_(self, that);\n}", "title": "" }, { "docid": "89e4bc6de381c4016293f3e426da8a77", "score": "0.5791773", "text": "function zip(that) {\n return self => zip_(self, that);\n}", "title": "" }, { "docid": "8c50e85ca89cca3c9b633cc908298ce9", "score": "0.57639235", "text": "function zip(itemList, priceList) {\n let final = [];\n itemList.forEach((item, index) => {\n final.push({\n item: item,\n price: priceList[index]\n });\n });\n return final;\n}", "title": "" }, { "docid": "9a7ddd97af6e8588b4405bb67e6f1331", "score": "0.5755201", "text": "function interleaveArrays(arr1, arr2) {\n let j = 1;\n let longer;\n let shorter;\n if (arr1 <= arr2) {\n longer = arr2;\n shorter = arr1;\n } else {\n longer = arr1;\n shorter = arr2;\n }\n for (var i = 0; i < shorter.length; i++) {\n longer.splice(j, 0, shorter[i]);\n j += 2;\n }\n return longer;\n}", "title": "" }, { "docid": "05c40c8c3eed8e66e17f55fc884c3da8", "score": "0.57373655", "text": "function flattenArray(arrays) {}", "title": "" }, { "docid": "dd44dee77cc7daf8b5a24d262cd6a591", "score": "0.5687785", "text": "function arrayTuples() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 0)\n return [];\n var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER\n var i, result = [];\n for (i = 0; i < maxArrayLen; i++) {\n // This is a hot function\n // Unroll when there are 1-4 arguments\n switch (args.length) {\n case 1:\n result.push([args[0][i]]);\n break;\n case 2:\n result.push([args[0][i], args[1][i]]);\n break;\n case 3:\n result.push([args[0][i], args[1][i], args[2][i]]);\n break;\n case 4:\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\n break;\n default:\n result.push(args.map(function (array) { return array[i]; }));\n break;\n }\n }\n return result;\n}", "title": "" }, { "docid": "dd44dee77cc7daf8b5a24d262cd6a591", "score": "0.5687785", "text": "function arrayTuples() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args.length === 0)\n return [];\n var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER\n var i, result = [];\n for (i = 0; i < maxArrayLen; i++) {\n // This is a hot function\n // Unroll when there are 1-4 arguments\n switch (args.length) {\n case 1:\n result.push([args[0][i]]);\n break;\n case 2:\n result.push([args[0][i], args[1][i]]);\n break;\n case 3:\n result.push([args[0][i], args[1][i], args[2][i]]);\n break;\n case 4:\n result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);\n break;\n default:\n result.push(args.map(function (array) { return array[i]; }));\n break;\n }\n }\n return result;\n}", "title": "" }, { "docid": "d343469bac0b88e9d2cef99086e78aa8", "score": "0.5666442", "text": "function transpose(xs) {\n const shortest = Math.min.apply(null, R.map(R.length, xs));\n return R.reduce(R.zipWith(R.flip(R.append)), R.repeat([], shortest), xs);\n}", "title": "" }, { "docid": "904f536b04ebf0d093cd1c440a7dada6", "score": "0.5651248", "text": "function unzip(as) {\n const fa = [];\n const fb = [];\n\n for (let i = 0; i < as.length; i++) {\n fa[i] = as[i].get(0);\n fb[i] = as[i].get(1);\n }\n\n return Tp.tuple(fa, fb);\n}", "title": "" }, { "docid": "34bf3d345c572a8b42ca677d38fe3404", "score": "0.5594984", "text": "function zip_tc(a, b, acc = []) {\n\tif (a.length === 0 || b.length === 0)\n\t\treturn acc;\n\n\tconst [x, ...xs] = a;\n\tconst [y, ...ys] = b;\n\treturn zip_tc(xs, ys, acc.concat([[x, y]]));\n}", "title": "" }, { "docid": "1f499709e99b04b2361e881bfda92b4f", "score": "0.5584431", "text": "function transpose(arr, callback) {\n arrayv = new Array(arr[0].length);\n for (var i = 0; i < arr[0].length; i++) {\n arrayv[i] = new Array(arr.length);\n }\n callback(arrayv);\n}", "title": "" }, { "docid": "a5baf2758014ba3fca8627fa78ec6a06", "score": "0.55611545", "text": "function zipWith(fb, f) {\n return fa => zipWith_(fa, fb, f);\n}", "title": "" }, { "docid": "0d2f92ccaa4f120f4f103902ef3d6844", "score": "0.55531627", "text": "function combinePairs (arr = []) {\n const length = arr.length\n const result = []\n for (let i = 0; i < length; i++) {\n for (let j = i + 1; j < length; j++) {\n result.push([arr[i], arr[j]])\n }\n }\n return result\n}", "title": "" }, { "docid": "4d76206c3b3eb7f95c12445b0c5f6771", "score": "0.5552063", "text": "function zip_(self, that) {\n return zipWith_(self, that, Tp.tuple);\n}", "title": "" }, { "docid": "4d76206c3b3eb7f95c12445b0c5f6771", "score": "0.5552063", "text": "function zip_(self, that) {\n return zipWith_(self, that, Tp.tuple);\n}", "title": "" }, { "docid": "187b7b211f82ab124181e9bc1707afd8", "score": "0.55451876", "text": "function joinArrays(...arrs){\n return arrs.reduce((acc, next) => [...acc, ...next]);\n}", "title": "" }, { "docid": "54d541ccdfde42a1a4dce156213d84d0", "score": "0.55159336", "text": "function intertwineTwoArrays(a, b) {\n var newArray = [];\n\n for (var i = 0; i < a.length; i++) {\n newArray[newArray.length] = a[i];\n newArray[newArray.length] = b[i];\n }\n\n return newArray;\n}", "title": "" }, { "docid": "e7967937d9b65a393c962bd14a8d514d", "score": "0.5507191", "text": "function zipListTheSimpleWay(list1, list2) {\n return _.flatten(_.zip(list1, list2));\n}", "title": "" }, { "docid": "5a4d57873d8ef5ccb30c4675cea8f125", "score": "0.5457272", "text": "function TO_array_transpose() {\n var self = this;\n var rows = self.length;\n var cols = self[0].length;\n return Multicore.build((i,j) => self[j][i], \n\t\t\t new (TypedObject.objectType(self).elementType.elementType.array(cols,rows)),\n\t\t\t [[0,cols],[0,rows]],\n\t\t\t Multicore.FINE|Multicore.BALANCED);\n}", "title": "" }, { "docid": "b5d68133ce488a31000203c07a01f61c", "score": "0.54435456", "text": "function unzip3(xs) /* forall<a,b,c> (xs : list<(a, b, c)>) -> (list<a>, list<b>, list<c>) */ {\n function iter(ys, acc1, acc2, acc3) /* forall<a,b,c> (list<(a, b, c)>, list<a>, list<b>, list<c>) -> (list<a>, list<b>, list<c>) */ { tailcall: while(1)\n {\n if (ys != null) {\n {\n var _x0 = $std_core.Cons(ys.head.fst, acc1);\n var _x1 = $std_core.Cons(ys.head.snd, acc2);\n var _x2 = $std_core.Cons(ys.head.thd, acc3);\n ys = ys.tail;\n acc1 = _x0;\n acc2 = _x1;\n acc3 = _x2;\n continue tailcall;\n }\n }\n else {\n return $std_core._tuple3_($std_core.reverse(acc1), $std_core.reverse(acc2), $std_core.reverse(acc3));\n }\n }}\n return iter(xs, $std_core.Nil, $std_core.Nil, $std_core.Nil);\n}", "title": "" }, { "docid": "89958dbcd2249a381a3e0018c06d793e", "score": "0.54430294", "text": "function copy2d(array) {\n return array.map(copy1d);\n}", "title": "" }, { "docid": "96316736293d49a0508d8d682bf9dfa6", "score": "0.5441512", "text": "function zip() {\n for (var _len3 = arguments.length, sources = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n sources[_key3] = arguments[_key3];\n }\n\n return new Observable(function (observer) {\n if (sources.length === 0) {\n return Observable.from([]);\n }\n\n var queues = sources.map(function () {\n return [];\n });\n\n function done() {\n return queues.some(function (q, i) {\n return q.length === 0 && subscriptions[i].closed;\n });\n }\n\n var subscriptions = sources.map(function (source, index) {\n return Observable.from(source).subscribe({\n next: function next(v) {\n queues[index].push(v);\n\n if (queues.every(function (q) {\n return q.length > 0;\n })) {\n observer.next(queues.map(function (q) {\n return q.shift();\n }));\n\n if (done()) {\n observer.complete();\n }\n }\n },\n error: function error(e) {\n observer.error(e);\n },\n complete: function complete() {\n if (done()) {\n observer.complete();\n }\n }\n });\n });\n return function () {\n return subscriptions.forEach(function (s) {\n return s.unsubscribe();\n });\n };\n });\n }", "title": "" }, { "docid": "91571bb9825129e21e4e65d6ef258540", "score": "0.5433486", "text": "function arrayTranspose_(data) {\r\n if (data.length == 0 || data[0].length == 0) {\r\n return null;\r\n }\r\n\r\n var ret = [];\r\n for (var i = 0; i < data[0].length; ++i) {\r\n ret.push([]);\r\n }\r\n\r\n for (var i = 0; i < data.length; ++i) {\r\n for (var j = 0; j < data[i].length; ++j) {\r\n ret[j][i] = data[i][j];\r\n }\r\n }\r\n\r\n return ret;\r\n}", "title": "" }, { "docid": "ad04f801ca369ab9eaedad0db79a2869", "score": "0.54254633", "text": "function zipAll(project) {\n return function (source) { return source.lift(new ZipOperator(project)); };\n}", "title": "" }, { "docid": "56d71f4c620e347247a616736842bcd9", "score": "0.5398923", "text": "function metaDataAwareZip() {\n var d = arguments;\n var n = d.length;\n if (!n) return [];\n var m = d3.min(d, function(a) { return a.length; });\n var zips = new Array(m);\n for (var i = 0; i < m; ++i) {\n zips[i] = new Array(n);\n for (var j = 0; j < n; ++j) zips[i][j] = d[j][i];\n }\n function buildOrder(lev) {\n var this_levels = [];\n if (d[lev].metadata && d[lev].metadata.categoryOrder)\n this_levels = d[lev].metadata.categoryOrder.split(/;/);\n if (lev >= d.length - 1) return this_levels;\n var next_levels = buildOrder(lev + 1);\n var ret = [];\n if (this_levels.length == 0)\n next_levels.forEach(function(n) { ret.push(',' + n); });\n else\n this_levels.forEach(function(t) {\n next_levels.forEach(function(n) { ret.push(t + ',' + n); });\n });\n return ret;\n };\n var do_order = false;\n for (var i = 0; i < n; ++i)\n if (d[i].metadata && d[i].metadata.categoryOrder) {\n do_order = true;\n break;\n }\n if (do_order)\n zips.metadata = { categoryOrder: buildOrder(0).join(';') };\n return zips;\n }", "title": "" }, { "docid": "d093d99c53ca567ad88b79b611d0cb16", "score": "0.5367416", "text": "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.478571745174750E+02, -0.122590101561808E+03),\n new google.maps.LatLng( 0.478552720000000E+02, -0.122590276000000E+03),\n new google.maps.LatLng( 0.478558210000000E+02, -0.122584130000000E+03),\n new google.maps.LatLng( 0.478539470000000E+02, -0.122584062000000E+03),\n new google.maps.LatLng( 0.478539470000000E+02, -0.122584062000000E+03),\n new google.maps.LatLng( 0.478550840000000E+02, -0.122602500000000E+03),\n new google.maps.LatLng( 0.478544890000000E+02, -0.122606473000000E+03),\n new google.maps.LatLng( 0.478567529083677E+02, -0.122607100702781E+03),\n new google.maps.LatLng( 0.478567529083677E+02, -0.122607100702781E+03),\n new google.maps.LatLng( 0.478568116049480E+02, -0.122604734075907E+03),\n new google.maps.LatLng( 0.478571745174750E+02, -0.122590101561808E+03),\n ];\n\n return zipCoords\n}", "title": "" }, { "docid": "0738cbab76cb1ff4dddd851b3b8c3ad7", "score": "0.5362587", "text": "function arrayTranspose(data) {\n \n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n\n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n\n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i][j];\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "b611f87eb2b7060173d5fbc2cb1d952e", "score": "0.53571683", "text": "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.471873170000000E+02, -0.122931850000000E+03),\n new google.maps.LatLng( 0.471892770000000E+02, -0.122930439000000E+03),\n new google.maps.LatLng( 0.471908990000000E+02, -0.122928226000000E+03),\n new google.maps.LatLng( 0.471913790000000E+02, -0.122925510000000E+03),\n new google.maps.LatLng( 0.471904650000000E+02, -0.122924471000000E+03),\n new google.maps.LatLng( 0.471850240000000E+02, -0.122925910000000E+03),\n new google.maps.LatLng( 0.471836130000000E+02, -0.122927176000000E+03),\n new google.maps.LatLng( 0.471831250000000E+02, -0.122930091000000E+03),\n new google.maps.LatLng( 0.471833760000000E+02, -0.122931983000000E+03),\n new google.maps.LatLng( 0.471840020000000E+02, -0.122932868000000E+03),\n new google.maps.LatLng( 0.471848640000000E+02, -0.122933234000000E+03),\n new google.maps.LatLng( 0.471873170000000E+02, -0.122931850000000E+03),\n ];\n\n return zipCoords\n}", "title": "" }, { "docid": "34bd4577b06acc86b4b8b543f54ab664", "score": "0.53424376", "text": "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.476726920000000E+02, -0.117363845000000E+03),\n new google.maps.LatLng( 0.476727020000000E+02, -0.117368369000000E+03),\n new google.maps.LatLng( 0.476716960000000E+02, -0.117368335000000E+03),\n new google.maps.LatLng( 0.476716920000000E+02, -0.117387146000000E+03),\n new google.maps.LatLng( 0.476716920000000E+02, -0.117387146000000E+03),\n new google.maps.LatLng( 0.476748800000000E+02, -0.117383631000000E+03),\n new google.maps.LatLng( 0.476776140000000E+02, -0.117375821000000E+03),\n new google.maps.LatLng( 0.476793160000000E+02, -0.117368310000000E+03),\n new google.maps.LatLng( 0.476778920000000E+02, -0.117363845000000E+03),\n new google.maps.LatLng( 0.476778920000000E+02, -0.117363845000000E+03),\n new google.maps.LatLng( 0.476726920000000E+02, -0.117363845000000E+03),\n ];\n\n return zipCoords\n}", "title": "" }, { "docid": "780a709814a07220979e5111622eaddf", "score": "0.5333276", "text": "function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n\n return r;\n }", "title": "" }, { "docid": "1120e148a31fe571fdf73b388555243d", "score": "0.5329602", "text": "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.464963050000000E+02, -0.122179013000000E+03),\n new google.maps.LatLng( 0.464970330000000E+02, -0.122179197000000E+03),\n new google.maps.LatLng( 0.464970330000000E+02, -0.122179197000000E+03),\n new google.maps.LatLng( 0.464994380000000E+02, -0.122179201000000E+03),\n new google.maps.LatLng( 0.465008420000000E+02, -0.122178146000000E+03),\n new google.maps.LatLng( 0.464999820000000E+02, -0.122168792000000E+03),\n new google.maps.LatLng( 0.464995460000000E+02, -0.122168840000000E+03),\n new google.maps.LatLng( 0.464965500000000E+02, -0.122172888000000E+03),\n new google.maps.LatLng( 0.464944360000000E+02, -0.122178072000000E+03),\n new google.maps.LatLng( 0.464963050000000E+02, -0.122179013000000E+03),\n ];\n\n return zipCoords\n}", "title": "" }, { "docid": "5c57ce7f8cdf55251fd90f3147c3729e", "score": "0.53254396", "text": "function mapPairwise(arr, func){\n var l = [];\n for(var i=0;i<arr.length-1;i++){\n l.push(func(arr[i], arr[i+1]));\n }\n return l;\n}", "title": "" }, { "docid": "0239f01a37829c6f6bf1614e6bdb6be9", "score": "0.53240687", "text": "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.482381740000000E+02, -0.117169182000000E+03),\n new google.maps.LatLng( 0.482385630000000E+02, -0.117173493000000E+03),\n new google.maps.LatLng( 0.482391800000000E+02, -0.117174861000000E+03),\n new google.maps.LatLng( 0.482405740000000E+02, -0.117172671000000E+03),\n new google.maps.LatLng( 0.482419220000000E+02, -0.117168702000000E+03),\n new google.maps.LatLng( 0.482419660000000E+02, -0.117160731000000E+03),\n new google.maps.LatLng( 0.482411420000000E+02, -0.117154642000000E+03),\n new google.maps.LatLng( 0.482406840000000E+02, -0.117155121000000E+03),\n new google.maps.LatLng( 0.482381740000000E+02, -0.117169182000000E+03),\n ];\n\n return zipCoords\n}", "title": "" }, { "docid": "29329215cd903491da1a31e904403cf7", "score": "0.5315182", "text": "function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n }", "title": "" }, { "docid": "c110e2d060c61fef5a53cc303a19c88a", "score": "0.5309899", "text": "function transpose(array){\n if ( array === undefined ) {return undefined};\n\n var tmp=[];\n if ( array[0] === undefined || array[0].forEach === undefined ) {array=[array]}\n var ny=array[0] && array[0].length;\n var nx=array.length;\n\n tmp.length=ny;\n \n for(var y=0; y<ny; y++) {\n var line=tmp[y]=[];\n line.length=nx;\n for(var x=0; x<nx; x++) {\n tmp[y][x]=array[x][y];\n }\n }\n \n // copy the tmp back\n array.length=tmp.length;\n for(var y=0; y<ny; y++) {\n array[y]=tmp[y];\n }\n\n return array;\n}", "title": "" }, { "docid": "946a5be1d739ddbfad860742f148b8aa", "score": "0.5300945", "text": "function constructZipCodeArray() \n{ \n\n var zipCoords = [ \n new google.maps.LatLng( 0.466002020000000E+02, -0.117876935000000E+03),\n new google.maps.LatLng( 0.466022140000000E+02, -0.117877065000000E+03),\n new google.maps.LatLng( 0.466071390000000E+02, -0.117876046000000E+03),\n new google.maps.LatLng( 0.466090250000000E+02, -0.117873809000000E+03),\n new google.maps.LatLng( 0.466091630000000E+02, -0.117872549000000E+03),\n new google.maps.LatLng( 0.466078370000000E+02, -0.117872283000000E+03),\n new google.maps.LatLng( 0.466044310000000E+02, -0.117873108000000E+03),\n new google.maps.LatLng( 0.466008640000000E+02, -0.117875359000000E+03),\n new google.maps.LatLng( 0.466002020000000E+02, -0.117876935000000E+03),\n ];\n\n return zipCoords\n}", "title": "" }, { "docid": "4900659b533354813fcec4a03f20a9ff", "score": "0.5289785", "text": "function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n }", "title": "" }, { "docid": "4900659b533354813fcec4a03f20a9ff", "score": "0.5289785", "text": "function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n }", "title": "" }, { "docid": "4900659b533354813fcec4a03f20a9ff", "score": "0.5289785", "text": "function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n }", "title": "" }, { "docid": "4900659b533354813fcec4a03f20a9ff", "score": "0.5289785", "text": "function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n }", "title": "" }, { "docid": "4900659b533354813fcec4a03f20a9ff", "score": "0.5289785", "text": "function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n }", "title": "" }, { "docid": "384e172cdf54e3295477cb711c889f84", "score": "0.5289631", "text": "function arrayTranspose(data) {\n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n\n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n\n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i][j];\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "384e172cdf54e3295477cb711c889f84", "score": "0.5289631", "text": "function arrayTranspose(data) {\n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n\n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n\n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i][j];\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "384e172cdf54e3295477cb711c889f84", "score": "0.5289631", "text": "function arrayTranspose(data) {\n if (data.length == 0 || data[0].length == 0) {\n return null;\n }\n\n var ret = [];\n for (var i = 0; i < data[0].length; ++i) {\n ret.push([]);\n }\n\n for (var i = 0; i < data.length; ++i) {\n for (var j = 0; j < data[i].length; ++j) {\n ret[j][i] = data[i][j];\n }\n }\n\n return ret;\n}", "title": "" }, { "docid": "9f28a5232856b97bb2b6577665b3bfaa", "score": "0.5289423", "text": "function adjCell(array, array2, array3, array4) {\n let ans = [];\n\n\n\n for (var i = 0; i < array.length; i++) {\n ans.push(array[i]);\n }\n\n for (var h = 0; h < array2.length; h++) {\n ans.push(array2[h]);\n }\n\n for (var j = array3.length - 1; j >= 0; j--) {\n ans.push(array3[j]);\n }\n\n for (var k = array4.length -1; k >= 0; k--) {\n ans.push(array4[k]);\n }\n\n return ans;\n}", "title": "" }, { "docid": "6234ef14674d8776e080dbf3a6bbc15d", "score": "0.5288171", "text": "function unzip(array) {\n var length = array && max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}", "title": "" }, { "docid": "85a095fd233638b344da93cef443dc4e", "score": "0.52570486", "text": "function transpose2(x){\n var r = [];\n var m00 = m[0 * 4 + 0];\n var m01 = m[0 * 4 + 1];\n var m10 = m[1 * 4 + 0];\n var m11 = m[1 * 4 + 1];\n r[ 0] = m00;\n r[ 1] = m10;\n r[ 2] = m01;\n r[ 3] = m11;\n return r;\n }", "title": "" }, { "docid": "f8a83b46551fb95d818157afba13a6a4", "score": "0.5254576", "text": "function transpose(array) {\n let result = [[],[],[]];\n let arr1 = [];\n let arr2 = [];\n let arr3 = [];\n\n for (let count = 0; count < array.length; count += 1) {\n for (let innerCounter = 0; innerCounter < 3; innerCounter += 1) {\n result[innerCounter].push(array[count][innerCounter]);\n // arr2.push(array[count][1]);\n // arr3.push(array[count][2]);\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "bced5e18793e0738e69457534688735d", "score": "0.52510154", "text": "function combineArrays(arr1, arr2) {\n var newArr = [];\n\n while (arr1.length > 0 && arr2.length > 0) {\n if (arr1[0] < arr2[0]) {\n newArr.push(arr1.shift());\n } else {\n newArr.push(arr2.shift());\n }\n }\n if(arr1.length > 0){\n newArr.push(...arr1);\n } else if(arr2.length > 0){\n newArr.push(...arr2);\n }\n\n return newArr;\n}", "title": "" }, { "docid": "3acb1679fb9297505cecce71c513dc5c", "score": "0.5250094", "text": "function unzip(array) {\n\t var length = array && max(array, getLength).length || 0;\n\t var result = Array(length);\n\n\t for (var index = 0; index < length; index++) {\n\t result[index] = pluck(array, index);\n\t }\n\t return result;\n\t }", "title": "" }, { "docid": "3acb1679fb9297505cecce71c513dc5c", "score": "0.5250094", "text": "function unzip(array) {\n\t var length = array && max(array, getLength).length || 0;\n\t var result = Array(length);\n\n\t for (var index = 0; index < length; index++) {\n\t result[index] = pluck(array, index);\n\t }\n\t return result;\n\t }", "title": "" }, { "docid": "ab884d058d987d06ad85577da9f61b84", "score": "0.5248064", "text": "function concatenates_arrays(first_arr,second_arr){\n var third_arr = [];\n var x = 0;\n\n for (var i = 0; i < first_arr.length; i++) {\n\n third_arr[x] = first_arr[i];\n x++;\n }\n\n for (var i = 0; i < first_arr.length; i++) {\n\n third_arr[x] = second_arr[i];\n x++;\n\n }return third_arr\n\n}", "title": "" } ]
3b2b4d27e57dbf2079b2d501aa49c4ee
Function to write tasks to screen
[ { "docid": "7a5d0efb81f5f02d34a4f4e67d67803f", "score": "0.5243783", "text": "function displayTasks(task) {\n \n if(typeof task.taskDesc == 'undefined') {\n throw 'This task has no task description!';\n }\n \n if(typeof task.completed == 'undefined') {\n throw 'This task has no completion status!';\n }\n \n if(task.completed) {\n return $('<li/>', {'class' : 'list-group-item success'}).text(' ' + task.taskDesc).prepend($('<span/>', {'class' : 'glyphicon glyphicon-ok'})).append($('<span/>', {'class' : 'list-group-item-right success'}).text(' ' + task.dueDate));\n } else {\n return $('<li/>', {'class' : 'list-group-item'}).text(' ' + task.taskDesc).prepend($('<span/>', {'class' : 'glyphicon glyphicon-pushpin'})).append($('<span/>', {'class' : 'list-group-item-right'}).text(' ' + task.dueDate));\n }\n}", "title": "" } ]
[ { "docid": "3114747be012ec92c4889f1ad35997f9", "score": "0.63786566", "text": "function printTasks(project) {\n let allProjects = JSON.parse(localStorage.getItem('projectArray'));\n let stick = findTasks(project);\n \n for (var i = 0; i < stick.length; i++) {\n let index = i;\n taskPrint.projectPrint(stick[i], index);\n }\n }", "title": "" }, { "docid": "c71409352827153dc527bb14eb00f293", "score": "0.63170195", "text": "writeToScreen(options) {\n //set full or partial update\n options.unshift(this.fullOrPartial(options));\n //Add name of screen_writer script\n options.unshift(this.screenWriter);\n console.log(\"Writing to screen\");\n this.spawn.spawn('python', options);\n this.lastScreenContent = options;\n //console.log(options);\n }", "title": "" }, { "docid": "d75e93d4068e19ab424c70f5b170de93", "score": "0.6282934", "text": "function showTasks(tasks) {\n tasks.forEach(showSingleTask);\n}", "title": "" }, { "docid": "af84ede5d3ed5a04a9ae4daf01c50608", "score": "0.61579883", "text": "function display(){\n for(let i = 0; i < size ; i++){\n let a = i+1;\n console.log('[task ' + a + ']: ' + list1[i] + ', Description: ' + list2[i] + ', created on: ' + list3[i] + ', due: ' + list4[i] + \", Status: \" + list5[i] +\".\");\n }\n console.log(); //for spacing in terminal for easier reading\n}", "title": "" }, { "docid": "518fa9b55553bbc31e733f787fbfc63e", "score": "0.6147054", "text": "function render () {\r\n //app.running_time = new Date().getTime() - app.start_time;\r\n \r\n current_count = 0;\r\n for (tsk of client.tasks) {\r\n if (tsk.task.status != 'completed' && tsk.task.status != 'error') { current_count++; }\r\n }\r\n\r\n //--- \"RENDER\" ----\r\n var render = [];\r\n console.clear();\r\n render.push ('');\r\n render.push (`${app.name.toUpperCase()} CLIENT ${app.version}`);\r\n render.push (`${client.hostname} @ ${client.ip} (${client.free_threads}/${client.max_threads} threads)`);\r\n //render.push (`\\tRunning time: ${app.running_time}\\n`);\r\n render.push (`${datetime()}\\n`);\r\n\r\n //render.push (`DATABASE: ${app.options.database}`);\r\n render.push (`SERVER: ${server.hostname} http://${server.ip}:${server.port}\\n`);\r\n \r\n render.push (`LAST REQUEST: ${connection.status}\\n`);\r\n\r\n render.push (`Tasks (${current_count}/${client.tasks.length}):\\n`);\r\n var index = 1;\r\n for (tsk of client.tasks) {\r\n render.push (`${index}. ${tsk.task.status} ${tsk.job.name} [${tsk.task.index}] > ${tsk.task.name}` );\r\n\r\n /* \r\n index++;\r\n if (tsk.task.status != 'completed') {\r\n console.log (`\\t\\t${index}. ${tsk.task.status} ${tsk.job.name} [${tsk.task.index}] > ${tsk.task.name}` );\r\n index++;\r\n }\r\n */ \r\n }\r\n\r\n //console.clear();\r\n //console.log (util.inspect (client, {compact: 6, showHidden: false, depth: null, colors: true}));\r\n //console.log (util.inspect (TASKS, {compact: 6, showHidden: false, depth: null, colors: true}));\r\n\r\n console.log (render.join('\\n '));\r\n}", "title": "" }, { "docid": "abe68cd03a303827daba48b2c2ff72b1", "score": "0.6077647", "text": "function report (tasklist) {\n tasklist.forEach(({ label, tasks }, index) => {\n console.log(colors.yellow(`${index + 1}. ${label}`))\n console.log('-------------------------------------------')\n tasks.forEach(({ label, route }) => {\n console.log(` ${label}${route ? '' : colors.red(' **** NOT IMPLEMENTED ****')}`)\n })\n console.log()\n })\n}", "title": "" }, { "docid": "4f50009af5161b60b5cef2f83f4abb5c", "score": "0.60001117", "text": "function listAllTasks() {\n console.log(\"\");\n console.log(\"START: Items on list\");\n console.log(\"\");\n tasks.forEach(function (task) {\n console.log(task);\n });\n console.log(\"\");\n console.log(\"END: Items on list\");\n console.log(\"\");\n}", "title": "" }, { "docid": "67a5ec36c947bff80da91160641948ab", "score": "0.59798795", "text": "function showTasks()\n {\n var open = [];\n var completed = [];\n for (var i = 0; i < currentList.tasks.length; i++)\n {\n var task = currentList.tasks[i];\n if (task.isCompleted)\n {\n completed.push(buildCompletedTask(task, i));\n }\n else\n {\n open.push(buildOpenTask(task, i));\n }\n }\n if (open.length === 0)\n open.push('<tr><td colspan=\"3\">No open tasks</td></tr>');\n if (completed.length === 0)\n completed.push('<tr><td colspan=\"3\">No completed tasks</td></tr>');\n $(\"#open-tasks\").html(open.join(\"\\n\"));\n $(\"#completed-tasks\").html(completed.join(\"\\n\"));\n }", "title": "" }, { "docid": "75a2e06a95204f4c4253304650c10bea", "score": "0.5947652", "text": "function addTask(task) {\n if (task) {\n tasks.push(task);\n }\n var insertion = \"se ha insertado \" + task + \" a la lista \";\n var totalTask = \" en tu lista tienes \" + tasks + \" con \" + tasks.length + \" tareas\";\n return console.log(\"\\n =========== NEW TASK ===========\\n TASK : \" + insertion + \"\\n \" + totalTask + \"\\n \");\n}", "title": "" }, { "docid": "293bd998c70403ebb1657365e663efe6", "score": "0.58945525", "text": "printDiv() {\n let tasksHtmlListTodo = [], tasksHtmlListInProgress = [],tasksHtmlListReview= [],tasksHtmlListDone = [];\n \n for (let i = 0; i < this.tasks.length; i++) { \n let taskItem = this.tasks[i].task;\n const taskHtml = createTaskHtml(\n taskItem.name,\n taskItem.description,\n taskItem.assignedTo,\n taskItem.dueDate,\n taskItem.status,\n taskItem.id\n );\n\n // Push it to the tasksHtmlList array according to status\n if (taskItem.status===\"To Do\")\n tasksHtmlListTodo.push(taskHtml);\n if (taskItem.status===\"In Progress\")\n tasksHtmlListInProgress.push(taskHtml);\n if (taskItem.status===\"Review\")\n tasksHtmlListReview.push(taskHtml);\n if (taskItem.status===\"Done\")\n tasksHtmlListDone.push(taskHtml);\n }\n \n // Create the tasksHtml by joining them with space in between\n \n const tasksHtmlTodo = tasksHtmlListTodo.join(\"\\n\");\n const tasksHtmlInProgress = tasksHtmlListInProgress.join(\"\\n\");\n const tasksHtmlReview = tasksHtmlListReview.join(\"\\n\");\n const tasksHtmlDone = tasksHtmlListDone.join(\"\\n\");\n\n // Set the inner html of the tasksList on the page\n const tasksListTodo = document.querySelector(\".todo .todoSection\");\n const tasksListInProgress = document.querySelector(\".inProgress .inProgressSection\");\n const tasksListReview = document.querySelector(\".review .reviewSection\");\n const tasksListDone = document.querySelector(\".done .doneSection\");\n\n \n tasksListTodo.innerHTML= tasksHtmlTodo;\n tasksListInProgress.innerHTML= tasksHtmlInProgress;\n tasksListReview.innerHTML= tasksHtmlReview;\n tasksListDone.innerHTML= tasksHtmlDone;\n \n\n\n for (let i = 0; i < this.tasks.length; i++) {\n if(this.tasks[i].task.status === \"Done\")\n {\n document.getElementById(this.tasks[i].task.id).style.display = \"none\";\n }\n } \n this.save(); \n }", "title": "" }, { "docid": "2b798741443159f105b70202b8164f78", "score": "0.5873407", "text": "function showTaskOutput(){\n let store = localStorage;\n let doneTasks = JSON.parse(store.getItem('DoneTasks'));\n let i = 1;\n\n if(doneTasks === null){\n console.log('Izvršeni zadataci su trenutno prazni!')\n\n }else{\n\n doneTasks.forEach( (task) => {\n\n let row = document.createElement('tr');\n row.innerHTML = `\n <td>${i}</td>\n <td>${task.task}</td>\n <td style=\"font-weight: 600\" class=\"green lighten-2 center white-text\">DONE</td>\n `\n tableOut.appendChild(row);\n i++;\n });\n }\n\n\n}", "title": "" }, { "docid": "f853ee2e7c862278e80eb510c2782c8d", "score": "0.5835015", "text": "render() {\n const taskItem = document.createElement('div');\n\n taskItem.classList.add('wrapper-task');\n taskItem.innerHTML = task(this.model.getTaskInfo());\n\n this.root.append(taskItem);\n\n this.attachListeners(taskItem);\n }", "title": "" }, { "docid": "ac06aa5f3d2ccac79cbf7af57097e669", "score": "0.58231896", "text": "displayCompletedTasks() {\n let helperMethods = new HelperMethods()\n\n this.categories.forEach((category) => {\n\n if (this.hasACompletedTask(category)) {\n\n let HTML = helperMethods.createCategoryHTML(category.name, category.id)\n this.display.appendChild(HTML)\n\n category.tasks.forEach((task) => {\n if (task.completed) {\n let taskHTML = helperMethods.createHTMLTask(task.name, task.id, task.completed)\n this.display.appendChild(taskHTML)\n }\n })\n }\n\n })\n }", "title": "" }, { "docid": "cb231a9863ddd0676675dcb7abe48c8e", "score": "0.5804739", "text": "function makeOutput(completedTasks) {\n // Get the current time\n let now = DateTime.local();\n // Start creating the PDF. Name it with the current date/time\n doc.pipe(fs.createWriteStream(path.join(__dirname, `${pdfWriteLocation}/canvas-theme-status-${now.year}-${now.month}-${now.day}-${now.hour}-${now.minute}-${now.second}.pdf`)));\n // Put the date at the top right of the PDF\n doc.fontSize(12).text(now.toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS), {\n align: 'right'\n });\n // Loop through all of the completed tasks and create a page for each task\n completedTasks.forEach((completedTask, i) => {\n // Add the title to the top of the page\n doc.fontSize(25).text(completedTask.title, {\n align: 'center'\n });\n // Add intended under the title\n doc.fontSize(18).text('Intended', {\n align: 'center'\n });\n // Add the intended image to the page\n doc.image(path.join(__dirname, `/correct_screenshots/${completedTask.filename}`), {\n fit: [500, 310],\n align: 'center'\n });\n // Add current under the intended picture\n doc.moveDown();\n doc.fontSize(18).text('Current', {\n align: 'center'\n });\n // Add the current image to the page\n doc.image(path.join(__dirname, `/screenshots/${completedTask.filename}`), {\n fit: [500, 310],\n align: 'center'\n });\n // Check if another page needs to be added\n if (i !== completedTasks.length - 1) {\n doc.addPage();\n }\n });\n // Finalize and write the document\n doc.end();\n console.log('Writing PDF Document. The program will close when completed.');\n}", "title": "" }, { "docid": "5c3fa64ce24f4185f34852debe5ac09f", "score": "0.5783286", "text": "liveRunLog() {\n let task = this.getTask();\n let displayName = this.path;\n if (task.removeRemote) {\n if (this.remoteStat === 'dir') {\n console.log(chalk_1.default.red(' remote dir removed : ') + displayName);\n }\n else {\n console.log(chalk_1.default.red('remote file removed : ') + displayName);\n }\n }\n else if (task.hasError) {\n console.log(chalk_1.default.bgRed(` error : ${displayName}`));\n }\n else if (task.skip) {\n console.log(chalk_1.default.gray(' skipped : ') + displayName);\n }\n else if (task.method === 'noop') {\n console.log(chalk_1.default.gray(' ignored : ') + displayName);\n }\n if (task.method === 'sync') {\n console.log(chalk_1.default.cyan(' sync completed : ') + displayName);\n }\n else if (task.method === 'upload') {\n console.log(chalk_1.default.yellow(' file uploaded : ') + displayName);\n }\n }", "title": "" }, { "docid": "f5caf8855f48f646d197e466eecbe1ce", "score": "0.5770718", "text": "function print() {\n OPTIONS.logger.log(chalk.bold('Usage: gulp [task] [options]'));\n OPTIONS.logger.log(chalk.bold('Tasks:'));\n\n var groups = Object.keys(reflection);\n var isMultiGroup = groups.length > 1;\n\n groups.filter(function (groupName) {\n return hasTasks(groupName);\n })\n .sort()\n .sort(function (a, b) { // ordering groups by @order tags\n return Math.min.apply(null,\n Object.keys(reflection[a]).map(function (task) {\n return reflection[a][task].order;\n })) - Math.min.apply(null,\n Object.keys(reflection[b]).map(function (task) {\n return reflection[b][task].order;\n }));\n })\n .map(function (groupName) {\n var reflectionGroup = reflection[groupName];\n var groupTasks = Object.keys(reflectionGroup);\n\n if (isMultiGroup ||\n !isMultiGroup && groupName !== OPTIONS.defaultGroupName\n ) {\n OPTIONS.logger.log(\n ' '.repeat(OPTIONS.groupPadding) +\n chalk.bold[OPTIONS.groupColor](groupName)\n );\n }\n\n groupTasks.filter(function (name) {\n return reflectionGroup[name].public;\n })\n .sort()\n .sort(function(a, b) { // ordering tasks inside group by @order tags\n return reflectionGroup[a].order - reflectionGroup[b].order;\n })\n .forEach(function (name) {\n var task = reflectionGroup[name];\n var deps = task.dep.filter(function (dep) {\n return reflectionGroup[dep] && reflectionGroup[dep].public;\n });\n var text = ' '.repeat(OPTIONS.padding) +\n chalk.bold.green(task.name) +\n ' '.repeat(\n Math.max(1,OPTIONS.keysColumnWidth -\n OPTIONS.padding -\n task.name.length)\n );\n var chunks = chunk(task.desc, OPTIONS.lineWidth -\n OPTIONS.keysColumnWidth);\n var i = 0;\n\n OPTIONS.logger.log(text + chalk.bold(chunks[i]));\n\n if (chunks.length > 1) {\n while (chunks.length > ++i) {\n (chunks[i].trim()) && (OPTIONS.logger.log(\n ' '.repeat(OPTIONS.keysColumnWidth) +\n chalk.bold(chunks[i])\n ));\n }\n }\n\n task.args.forEach(function (arg) {\n var chunks = arg.desc ?\n chunk(arg.desc,\n OPTIONS.lineWidth - OPTIONS.keysColumnWidth) :\n ['[boolean]'];\n var i = 0;\n\n OPTIONS.logger.log(\n ' '.repeat(OPTIONS.padding + 1) +\n chalk.bold.cyan('--' + arg.name) +\n ' '.repeat(Math.max(1,\n OPTIONS.keysColumnWidth - OPTIONS.padding -\n arg.name.length - 3)) +\n chunks[i]\n );\n\n while (chunks.length > ++i) {\n (chunks[i].trim()) && (OPTIONS.logger.log(\n ' '.repeat(OPTIONS.keysColumnWidth) +\n chunks[i]\n ));\n }\n });\n\n if (OPTIONS.displayDependencies && deps.length) {\n OPTIONS.logger.log(\n ' '.repeat(OPTIONS.keysColumnWidth) +\n chalk.bold.gray('Depends: ') +\n chalk.grey(JSON.stringify(deps))\n );\n }\n\n if (OPTIONS.emptyLineBetweenTasks) {\n OPTIONS.logger.log('');\n }\n });\n });\n}", "title": "" }, { "docid": "03a0f2a0944dd9a4c14b1a2f5cc29bae", "score": "0.57289636", "text": "function earthLogger() {\n console.log(\"Here is for 4th task : Earth\");\n}", "title": "" }, { "docid": "c8e0f77d5534d9041c1737929f569a4e", "score": "0.56853163", "text": "function showTasks() {\n loadAllTasks();\n if (allTasks.length != 0) {\n document.getElementById('empty-task-list-box').classList.add('d-none');\n }\n let list = document.getElementById('list-box');\n compileAndAddTask(list);\n}", "title": "" }, { "docid": "672424193ba51e587880a98e94fb1eef", "score": "0.5678057", "text": "function displayAllTask()\n{\n let taskContainer = document.querySelectorAll(\".task_container\");\n for(let i=0;i<taskContainer.length;i++)\n {\n taskContainer[i].remove();\n }\n for (let i = 0; i < taskArr.length; i++) {\n let { id, color, task } = taskArr[i];\n createTask(color, task, false, id);\n }\n}", "title": "" }, { "docid": "1bd4ebeb0550e02b646242f2a8b53490", "score": "0.56729037", "text": "callback(task) {\n // code to be executed on each run \n //console.log(`${task.id} task has run times.${Math.ceil(task.totalRuns - task.currentRuns)}`);\n document.getElementById(\"text-cooldown\").innerHTML = Math.ceil(task.totalRuns - task.currentRuns) + \" Sec\"\n document.getElementsByTagName('title')[0].text = `${wax.userAccount} - ${Math.ceil(task.totalRuns - task.currentRuns)} Sec`\n }", "title": "" }, { "docid": "6c1bfdf7a803fad1dcbfd214bcbe70f1", "score": "0.5656738", "text": "function listAllTasks(tasks) {\n tasks.forEach(function (element) {\n return console.log(element);\n });\n}", "title": "" }, { "docid": "fc77a44525a7a694d952d74ce6d26e0f", "score": "0.56124514", "text": "function ScreedTodoTask() {\n}", "title": "" }, { "docid": "b1b0046363ef3fb4fe72047370a780ab", "score": "0.5611246", "text": "function printProgressBar() {\n }", "title": "" }, { "docid": "3aeab2599d73749c2fa1a389a0efb203", "score": "0.56077456", "text": "function displayTask(task) {\n var task = task||getTask();\n $(\"#dtitle\").html(task.title);\n $(\"#state\").html(task.state);\n $(\"#dcontent\").html(toDisp(task.description));\n $(\"#created\").html((new Date(task.created).toDateString()));\n $(\"#modified\").html((new Date(task.modified).toDateString()));\n if (task.state == \"Open\") {\n $(\"#btnHold\").html(\"Hold\").attr(\"href\", \"#popupHold\");\n $(\"#btnComp\").html(\"Complete\").attr(\"href\", \"#popupComplete\");\n $(\"#holdInfo\").html(\"\");\n $(\"#state\").parent().css({\"color\":\"white\", \"background\" : color.blue});\n }\n if (task.state == \"On Hold\") {\n $(\"#btnHold\").html(\"End Hold\").attr(\"href\", \"#popupEndHold\");\n $(\"#btnComp\").html(\"Complete\").attr(\"href\", \"#popupComplete\");\n $(\"#holdInfo\").html(\"<hr />Hold Start: \" + ((new Date(task.hold.start).toDateString())) + \"<br />Hold Duration: \" + task.hold.duration);\n $(\"#state\").parent().css({\"color\":\"white\", \"background\" : color.gray});\n }\n if (task.state == \"Completed\") {\n $(\"#btnHold\").html(\"Hold\").attr(\"href\", \"#popupHold\");\n $(\"#btnComp\").html(\"Reopen\").attr(\"href\", \"#popupReopen\");\n $(\"#holdInfo\").html(\"\");\n $(\"#state\").parent().css({\"color\":\"black\", \"background\" : color.gold});\n }\n if (task.persist.start) {\n $(\"#persistInfo\").html(\"<hr />Persist Start: \" + ((new Date(task.persist.start).toDateString())) + \"<br />Persist Interval: \" + task.persist.duration);\n } else {\n $(\"#persistInfo\").html(\"\");\n }\n tasks.current = task;\n}", "title": "" }, { "docid": "9e97d947f68c2120c3a8e45e3bf0b4be", "score": "0.55815417", "text": "function appendToScreen(obj){\n outPut.innerText = obj\n }", "title": "" }, { "docid": "e2febd30aeae856bf7c35272432f1c77", "score": "0.5581121", "text": "function Tasks() {\n return;\n}", "title": "" }, { "docid": "9564b86dc7505377182f697b2f8ebc0c", "score": "0.55574256", "text": "function showTasks(e) {\n\tupdateContent(typeof e.index !== 'undefined' ? e.index : INDEXES[e.source.title]);\n}", "title": "" }, { "docid": "9da7a501235c6b742d617ce44acd8e73", "score": "0.55479515", "text": "function log_task (tsk, string) {\r\n var filepath = `${app.options.dirs.temp}/${tsk.job.id}/log_${tsk.job.id}-${tsk.task.index}.txt`;\r\n if (!string.endsWith('\\n')) { string += '\\n'; }\r\n string = `${datetime()}:${new Date().getMilliseconds()} ${string}`;\r\n\r\n try {\r\n fs.appendFile(filepath, string, 'utf8', ()=>{});\r\n } catch (err) {\r\n console.error (err);\r\n //process.exit(1);\r\n }\r\n}", "title": "" }, { "docid": "b7d65d6bd182774ece866081e10d9245", "score": "0.5540207", "text": "function onTasksReceived( tasks ) {\n $resultTasksBlock.innerHTML = ''\n\n tasks.forEach( task => {\n const li = document.createElement( 'li' )\n li.innerHTML = task.title\n li.dataset.id = task.id\n $resultTasksBlock.appendChild( li )\n })\n}", "title": "" }, { "docid": "e91a3d8f3128c1f5e02068d75e67be77", "score": "0.55365884", "text": "function printList() {\r\n //Emptying the div so it's printed just once\r\n $('div#result').empty();\r\n $(document).ready(function () {\r\n $.each(taskArray, function (index, value) {\r\n setHtml(index,value);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "4f6b382bb9c4f288f995fa599c53f995", "score": "0.5524743", "text": "function taskDefault() {\n console.log('Here are the current Gulp commands:');\n console.log('gulp all - Do all tasks');\n console.log('gulp html - Process all HTML');\n console.log('gulp js - Process all JS');\n}", "title": "" }, { "docid": "cb733e93bc2f8533d71e3b0d7321025a", "score": "0.5517627", "text": "static output(task, args){\n if(!Netcode.Socket)\n return;\n Netcode.Socket.emit('_GAME_', task, args);\n }", "title": "" }, { "docid": "8d775cfe2a34fb3ed7754e5823459a58", "score": "0.5498593", "text": "dryRunLog() {\n let taskName = '';\n let task = this.getTask();\n function label(stat) {\n switch (stat) {\n case 'dir': return chalk_1.default.cyan('D');\n case 'file': return chalk_1.default.yellow('F');\n case 'excluded': return chalk_1.default.gray('X');\n case 'error': return chalk_1.default.red('!');\n default: return ' ';\n }\n }\n if (this.remoteStat === 'error') {\n taskName = 'denied';\n }\n else if (task.removeRemote) {\n taskName = 'remove remote';\n if (task.method !== 'noop') {\n taskName += ' and ' + task.method;\n }\n }\n else if (task.skip) {\n taskName = 'skip';\n }\n else if (task.method === 'noop') {\n taskName = 'ignore';\n }\n else {\n taskName = task.method;\n }\n console.log(`[ ${label(this.localStat)} | ${label(this.remoteStat)} ] ${this.path}`);\n console.log(chalk_1.default.magenta(` -> ${taskName}`));\n console.log('');\n }", "title": "" }, { "docid": "a3ac7dad009ae1f180e488734b45ba11", "score": "0.54885864", "text": "function screeningTask(tasks = [], dependencies = []) {\n\n var result = []\n if (tasks.length > 50) {\n return \"Error: Tasks cannot be more than 50\";\n } else if (tasks.length == 0) {\n return tasks;\n } else if (dependencies.length == 0) {\n return tasks;\n } else {\n return dependencyConverter(dependencies, tasks, (err, result) => {\n if (err) {\n return err\n } else {\n return result\n }\n\n })\n }\n}", "title": "" }, { "docid": "855d604e0eca81434c56b42ccd564572", "score": "0.5484588", "text": "function displayTask(key, title, detail, duedate, donePeople, inProgressPeople) {\n $(TASK_TEMPLATE).appendTo(\".container--task\").attr(\"id\", key);\n var task = $(\"#\" + key);\n task.find('.title--task').text(title);\n task.find('.content--task').text(detail);\n task.find('.content--due-date').text(duedate);\n\n var doneCount = 0;\n for (var person in donePeople) {\n task.find('.container--people-done > .people-list').append(\"<li>\" + donePeople[person] + \"</li>\");\n doneCount++;\n }\n task.find('.done-people').text(doneCount + \" \");\n\n var inprogressCount = 0;\n for (var person in inProgressPeople) {\n task.find('.container--people-inprogress > .people-list').append(\"<li>\" + inProgressPeople[person] + \"</li>\");\n inprogressCount++;\n }\n task.find('.in-progress-people').text(inprogressCount + \" \");\n toggleTaskState();\n toggleList();\n deleteTask();\n }", "title": "" }, { "docid": "e6e863008265a751fe60df70b3573544", "score": "0.5468295", "text": "printQueue() {\r\n console.log(\"---- Queue: ----\");\r\n console.log(priority.HIGH + \": \");\r\n for (var j = 0; j < this.highTasks.length; j++)\r\n console.log(\" \" + this.highTasks[j].getName());\r\n console.log(priority.MEDIUM + \": \");\r\n for (var j = 0; j < this.mediumTasks.length; j++)\r\n console.log(\" \" + this.mediumTasks[j].getName());\r\n console.log(priority.LOW + \": \");\r\n for (var j = 0; j < this.lowTasks.length; j++)\r\n console.log(\" \" + this.lowTasks[j].getName());\r\n console.log(priority.NONE + \": \");\r\n for (var j = 0; j < this.tasks.length; j++)\r\n console.log(\" \" + this.tasks[j].getName());\r\n }", "title": "" }, { "docid": "4b1672a54e45ce63e4bd3e259306fd30", "score": "0.54664594", "text": "function showTasks(operation) {\n let retrievedTasks = getTasks();\n let tasks = document.getElementById('tasks');\n tasks.innerHTML = '';\n if (retrievedTasks == null)\n return;\n for (let i = 0; i < retrievedTasks.length; i++) {\n let task = retrievedTasks[i];\n\n //template for the tasks-refers to the function ctor to build the template. as one of the classes, set i to the latest task added so that only that one fades in when it's being added (and not all the tasks fade in each time)\n const tasksTemplate = `<div class=\"col-md-3 col-sm-6 col-xs-6 task ${operation === 'add' && i === retrievedTasks.length-1 && 'fade'}\" id='${task.timestamp}'>\n <div class='button-wrapper'><button type=\"button\" class=\"btn btn-default\" id=\"btn-trash\" aria-label=\"Right Align\" onclick='removeTask(event, ${task.timestamp})'>\n <span class=\"glyphicon glyphicon-trash\" aria-hidden=\"true\"></span>\n </button>\n </div>\n <p>${task.todo}</p>\n <div class='note-footer'>\n <p>${task.date}</p>\n <p>${task.time}</p>\n </div>\n </div>`\n tasks.innerHTML += tasksTemplate;\n }\n}", "title": "" }, { "docid": "ad0a9afa6245dfefb3a2b01cb1a6df97", "score": "0.54412645", "text": "function showTasks(tasksData) {\n // clear task container:\n tasksBoxEl.innerHTML = '';\n\n // let tasksData = getTasksFromLs();\n for (let i = 0; i < tasksData.length; i++) {\n createNewTask(tasksData[i]);\n }\n}", "title": "" }, { "docid": "3221da8d5cc2fd3be980584fb08671e1", "score": "0.543702", "text": "function comp () {\n var task = getTask();\n tasks.edit(task, null, fromDisp(document.getElementById(\"dcontent\")), \"Completed\");\n displayTask(task);\n}", "title": "" }, { "docid": "46d834d5298442a917daaa673b4d12cb", "score": "0.5435508", "text": "function writeWorkLog() {\n console.log('writeWorkLog not yet implemented.')\n}", "title": "" }, { "docid": "c2b81cca78523f76a1fcf429752603f2", "score": "0.5434364", "text": "function listAllItems() {\n tasks.forEach(function (task) {\n console.log(task);\n });\n}", "title": "" }, { "docid": "cdf78d24c532a0aa851c53760a8d8f35", "score": "0.5426184", "text": "displayTask() {\n // Use for loop to run through the array\n for (let i = 0; i < this.tasks.length; i++) {\n // \"i\" doesn't mean anything, it is just good practise for the variable name in a for loop. Arrays all start at 0 (even though we think of it as book \"1\").\n // It finishes the loop when gets to the end of the objects held in the array, ie. end of the tasks. And tasks can keep getting added and this loop will run until it goes through all tasks because of the length parameter (this.tasks.length)\n //if you add .xxx, Eg.(this.tasks[i].taskName) it would return all the task names of the task list\n }\n // Test: console.log(this.tasks[i]);\n }", "title": "" }, { "docid": "abf53680c55ed0f6ed68c57a9d45cf99", "score": "0.5417446", "text": "function writeConsole( text, style ) {\n\t\tvar div = commands.panel.item;\n\t\tvar line = window.document.createElement( 'div' );\n\t\tline.classList.add( style );\n\t\tline.textContent = text;\n\t\tdiv.appendChild( line );\n\t\tdiv.scrollTop = div.scrollHeight;\t\t\n\t}", "title": "" }, { "docid": "bd8996f9586a6c6e7c028809ed0a0204", "score": "0.54060024", "text": "async dispatch() {\n let resolvedPromises = await Promise.all (\n Object.values ( this.tasks ) .map ( t => t() )\n )\n this.actuallyNote ( resolvedPromises ) // logs own events to self!\n }", "title": "" }, { "docid": "5de2bc616ff8868ede55ea79a81de73d", "score": "0.54036456", "text": "function showScheduler() {\n tasks = localStorage.getItem(\"events\");\n tasks = JSON.parse(tasks);\n for (var i = 0; i < tasks.length; i++) {\n var itemText = tasks[i].taskItem;\n var itemHour = tasks[i].hour;\n\n $(\"[data-time = \" + itemHour + \"]\").children(\"textarea\").val(itemText);\n }\n }", "title": "" }, { "docid": "1fde029742cd8ec1474770545f619cc0", "score": "0.539917", "text": "addTask(task) {\n console.log('added task!');\n }", "title": "" }, { "docid": "be9a45a5e00a4044f018745aaadfad80", "score": "0.5396346", "text": "function resultDisplay() {\n\n // Data is stored as an array...join will create line breaks in between each item and prep it for display.\n finalData = displayData.join(\"\\n\");\n console.log(finalData);\n\n // Special header for log.txt entries...then appending to the file\n var header = \"***************************\\nCommand: \" + myCommand + \"\\nSearch Terms: \" + myString + \"\\n\";\n fs.appendFile(\"log.txt\", header + finalData, function(err) {\n if(err) {\n return console.log(err);\n }\n\n });\n\n} // end resultDisplay function", "title": "" }, { "docid": "c6b6c4772e83afc94f65f23dad26296b", "score": "0.53902215", "text": "stdout_writeline(msg) {\n this.outElem.innerText += msg + '\\n';\n if (this.autoShowOnNextLine) {\n this.classList.remove('py-terminal-hidden');\n this.autoShowOnNextLine = false;\n }\n }", "title": "" }, { "docid": "3d716562adfb4847516edc96e514643b", "score": "0.538741", "text": "function myOutput() {\n //spent way too much time on this because i was viewing in notepad which does not show new lines \n //i tried many different ways to display this in a file but this is what i had when i realized i was \n //opening the file wrong. it still works and is good for display to screen.\n //this will append each time to a file called log.txt\n outputArray.push(\"------------------------------------------\\n\");\n var info = \"\";\n for (i = 0; i < outputArray.length; i++) {\n info = outputArray[i]\n fs.appendFile(\"./log.txt\", info + \"\\n\", 'utf8', function(err) {\n if (err) {\n return console.log(err);\n }\n });\n console.log(info);\n }\n\n}", "title": "" }, { "docid": "9f8e601d2461e1e39b3a3b47b4b08623", "score": "0.5348465", "text": "function show_task(title, desc, date, time, tags, id) {\n $(\".task-list\").append(\"<div class='listings' id='all-\" + id.toString()\n + \"'></div>\");\n $(\"#all-\" + id.toString()).append(\"<button class='open text-center btn btn-block'><h2>\" + title\n + \"</h2></button>\");\n $(\"#all-\" + id.toString()).append(\"<div class='to-close'></div>\");\n $(\"#all-\" + id.toString() + \" .to-close\").append(\"<h4>Task:</h4>\");\n $(\"#all-\" + id.toString() + \" .to-close\").append(\"<p class='show-title'>\" + title + \"</p>\");\n $(\"#all-\" + id.toString() + \" .to-close\").append(\"<h4>Description:</h4>\");\n $(\"#all-\" + id.toString() + \" .to-close\").append(\"<p class='show-desc'>\" + desc + \"</p>\");\n $(\"#all-\" + id.toString() + \" .to-close\").append(\"<h4>End:</h4>\");\n $(\"#all-\" + id.toString() + \" .to-close\").append(\"<p class='show-end'>\" + date + \" \"\n + time + \"</p>\");\n $(\"#all-\" + id.toString() + \" .to-close\")\n .append(\"<button class='remove btn btn-danger'>Remove</button>\");\n $(\"#all-\" + id.toString() + \" .to-close\")\n .append(\"<button class='edit btn btn-default'>Edit</button\");\n}", "title": "" }, { "docid": "1b129d7736e5a91d80bd83fa9b9cc52c", "score": "0.53414816", "text": "function tasksummary(lectureid,taskid){\n var correct = lectures[lectureid].tasks[taskid].correct;\n var wrong = lectures[lectureid].tasks[taskid].wrong;\n var loggedon = lectures[lectureid].students.length;\n console.log('sending summary to teacher')\n io.to(lectures[lectureid].teacherid).emit('sendtasksummay',taskid,correct,wrong, loggedon);\n}", "title": "" }, { "docid": "23c491b30b5a352f64908a322abbfd29", "score": "0.53411794", "text": "function printTask(){\nconsole.clear()\nconsole.log('Hi there, this is your learning tasks to front-end developer career: ')\nfor(let x=1;x <= task.length;x++){\n console.log('#'+x+'. '+task[x-1].Skill)\n console.log('Complete: '+ task[x-1].complete)\n\n \n }\n }", "title": "" }, { "docid": "a4d193ea6e25c230fd8f87e49f094ffe", "score": "0.53381795", "text": "function writeTask(task) {\n\n let id = task.id;\n let description = task.description;\n let priority = task.priority;\n let status = task.status;\n console.log(status);\n if (status == 1) {\n status = 'complete';\n } else {\n status = 'incomplete';\n }\n\n if (priority === undefined) {\n alert('No priority selected! Please select a priority.');\n } else {\n $('#ul-tasks').append('<li id = \"' + id + '\" class= \"' + status + '\">' +\n '<input class=\"checkbox\" type=\"checkbox\">' +\n '<label class=\"taskName ' + priority + '\">' + description + '</label>' +\n '<div class=\"itemButtons\">' +\n '<button class=\"btn-edit-task\"\">Edit</button>' +\n '<button class=\"btn-delete-task\">Delete</button>' +\n '</div>' +\n '</li>');\n console.log('Task Added');\n }\n\n if ($('#' + id).hasClass('complete')) {\n $('#' + id).children()[1].style.textDecoration = 'line-through';\n $('#' + id).children()[0].checked = true;\n }\n }", "title": "" }, { "docid": "c66a7ec20f017badc28c581c659f5118", "score": "0.5333505", "text": "function printTasks() {\n \n var codeTask = ''; \n var sheetName = '';\n var headingName = '';\n var cellVal = '' ;\n var j = 0; \n var nextID = '';\n var solVal = '';\n var taskList = [];\n var colIndex = 0;\n var maxTasks = 0;\n \n var ss = SpreadsheetApp.openById(sheetID);\n var sheet = ss.getSheetByName(\"Tasks\");\n \n \n var lastCol = sheet.getLastColumn(); \n \n var doWeLimit = sheet.getRange(1, 1, 1,1).getValue();\n \n \n //create array of all task column identifiers, including only tasks that have been marked as \"Included\"\n for (j=2; j<lastCol; j++ ) { \n if ( sheet.getRange(3, j, 1,1).getValue() == 'Included' ) {\n taskList.push(j); \n maxTasks++;\n } \n } \n\n //reset the number of max tasks to display if needed (and if it is lower than the number of included tasks)\n if( doWeLimit != 'Display all') { \n var mTasks = Number(/\\d+/.exec(doWeLimit));\n if ( mTasks < maxTasks ) { maxTasks = mTasks; }\n }\n \n //create list of elements to display\n taskList = shuffle(taskList); //shuffle the list of tasks\n taskList = taskList.slice(0, maxTasks); //truncate the list of tasks to the desired number\n taskList.push('thankyou'); //the l;ast item to display is the \"thank you\" box\n \n \n \n //print welcome message\n codeTask += '<div id=\"welcome\" class=\"boxMessage\">'; \n codeTask += '<p>' + ss.getSheetByName(settingsName).getRange(13, 7, 1,1).getValue().replace(/\\n/gm,\"</p><p>\") + '</p>'; \n codeTask += '<button class=\"control green\" onclick=\"var el= this.parentNode; hide(el); show(\\'task' + taskList[0] + '\\');\">Hide this message and show the first task</button>';\n codeTask += '</div>';\n \n \n \n //print list of tasks\n codeTask += '<div id=\"task-wrapper\">';\n \n \n for (j=0; j<maxTasks; j++ ){\n \n colIndex = taskList[j];\n \n cellVal = sheet.getRange(1, colIndex, 1,1).getValue();\n \n \n \n //print a task only if there is a task description (or else the feedback column will create trouble)\n if (cellVal.length > 1) {\n solVal = sheet.getRange(2, colIndex, 1,1).getValue();\n \n codeTask += '<div class=\"task hidden\" id=\"task' + colIndex + '\">';\n \n //print the task description and start button\n codeTask += '<div id=\"taskText' + colIndex + '\" class=\"boxMessage\">'; \n codeTask += '<p id=\"p' + colIndex + '\">' + cellVal + '</p>'; //task description\n codeTask += '<button id=\"start' + colIndex + '\" class=\"control red\" onclick=\"startTask(' + colIndex + ',\\'' + solVal + '\\') \">Start</button>'; \n codeTask += '</div>';\n \n \n //print task reminder and the \"I give up\" button (start as hidden)\n codeTask += '<div id=\"taskBtn' + colIndex + '\" class=\"hidden taskbtn-wrapper\">'; \n codeTask += '<p>Task: '+ cellVal + '</p>'; // add reminder text above the \"I give up\" button\n codeTask += '<button id=\"out' + colIndex + '\" class=\"control red giveup\" onclick=\"stopTask(); setSolution(\\'I give up\\'); \">I give up!</button>';\n codeTask += '</div>';\n \n \n //print the input fields to store the results\n codeTask += '<input class=\"hidden\" type=\"text\" id=\"storeStart' + colIndex + '\" name=\"storeStart' + colIndex + '\" value=\"\" />';\n codeTask += '<input class=\"hidden\" type=\"text\" id=\"storeStop' + colIndex + '\" name=\"storeStop' + colIndex + '\" value=\"\" />';\n codeTask += '<input class=\"hidden\" type=\"text\" id=\"storeClicks' + colIndex + '\" name=\"storeClicks' + colIndex + '\" value=\"\" />';\n codeTask += '<input class=\"hidden\" type=\"textarea\" id=\"storeMouse' + colIndex + '\" name=\"storeMouse' + colIndex + '\" />';\n \n codeTask += '</div>'; \n }\n \n }\n\n codeTask += '</div>';\n\n \n \n \n //print feedback textarea, thank you message, and \"Submit\" button\n codeTask += '<div id=\"thankyou\" class=\"hidden boxMessage thankyou\">';\n codeTask += '<textarea id=\"feedback\" name=\"feedback\" value=\"\" placeholder=\"Any feedback? Type it here!\"></textarea>';\n codeTask += '<p class=\"message\">Click on \"Submit\", and you are done!</p>'; \n codeTask += '<button class=\"control red\" onclick=\"var outV = outArray(' + lastCol + '); google.script.run.printResult(outV, \\'Tasks\\'); hide(\\'thankyou\\'); show(\\'restart\\')\">Submit</button>';\n codeTask += '</div>';\n \n \n //print restart code\n codeTask += '<div id=\"restart\" class=\"hidden\" >';\n codeTask += '<a class=\"control red\" href=\"' + scriptURL + '?action=measure\" style=\"display:inline-block;\">Do it again?</a>';\n codeTask += '<p class=\"message\">The list of tasks is randomly generated every time</p>';\n codeTask += '</div>';\n \n \n return codeTask; \n}", "title": "" }, { "docid": "3d6cf7ba2bf9eb746dae0a51096bcf23", "score": "0.53275853", "text": "async print() {\n const self = this;\n\n let output = self.prettyPrintHeader();\n self.shiftOrder.forEach(shiftId => {\n const shift = self.shifts[shiftId];\n output += self.prettyPrintEntry(shiftId, shift);\n });\n output += self.messages.prettyPrintBorder;\n output += self.summary(self.totalSeconds);\n return Promise.resolve(output);\n }", "title": "" }, { "docid": "8884a3c56b2db4c9be53afb70c2f9080", "score": "0.5323824", "text": "function addTask(text,file)\n{\n\tif (GLib.file_test(file, GLib.FileTest.EXISTS))\n\t{\n\t\tlet content = Shell.get_file_contents_utf8_sync(file);\n\t\tcontent = content + text + \"\\n\";\n\t\t\n\t\tlet f = Gio.file_new_for_path(file);\n\t\tlet out = f.replace(null, false, Gio.FileCreateFlags.NONE, null);\n\t\tShell.write_string_to_stream (out, content);\n\t}\n\telse \n\t{ global.logError(\"Todo list : Error while reading file : \" + file); }\n}", "title": "" }, { "docid": "0e6144ce5eb5a274914b7794a07dc759", "score": "0.53196377", "text": "function display(...args) {\n const str = document.createTextNode(args.join(' ') + '\\n')\n output.appendChild(str)\n\n /* Scroll to bottom of output when we write to it. */\n output.scrollTop = output.scrollHeight\n}", "title": "" }, { "docid": "33084ad0e26b2ea515b18342dc03e221", "score": "0.531478", "text": "function renderTasks() {\n\n var retrieveTasks = localStorage.getItem('task');\n console.log(retrieveTasks);\n}", "title": "" }, { "docid": "1c8cb201d310aaa8ca87d45e68aebdfb", "score": "0.53134954", "text": "render() {\n if (!this.hasStopped) {\n this.editor.setText(this.screenArray.join(''));\n }\n }", "title": "" }, { "docid": "d25b545aa54b45a7474db7038e3a1694", "score": "0.53120685", "text": "renderTasks() {\n if (this._isLoadingTasks) {\n return this.renderLoadingTask();\n }\n let tasks = this._tasks;\n if (tasks && this.taskFilter) {\n tasks = tasks.filter(task => this.taskFilter(task));\n }\n const taskTemplates = Object(lit_html_directives_repeat__WEBPACK_IMPORTED_MODULE_2__[\"repeat\"])(tasks, task => task.id, task => this.renderTask(task));\n return lit_element__WEBPACK_IMPORTED_MODULE_0__[\"html\"] `\n ${taskTemplates}\n `;\n }", "title": "" }, { "docid": "5dd48a1af75e4f9dda78d3462acb68c8", "score": "0.53012466", "text": "function updateOutput() {\n // reference to target element\n const outputElement = document.getElementById('todo-output');\n\n // Check if there is added tasks, or if all tasks are completed\n const noTodosAdded = getNumberOfTodos() === 0;\n const allTodosCompeted = getNumberOfDoneTodos() === getNumberOfTodos();\n\n // Display special message if there is nothing to do\n if (noTodosAdded || allTodosCompeted) {\n outputElement.innerHTML = \"You've got nothing to do! Add tasks, or call it a day.\";\n return;\n }\n\n // update output with number of tasks left to do\n outputElement.innerHTML = getNumberOfDoneTodos() + '/' + getNumberOfTodos() + ' tasks completed.';\n}", "title": "" }, { "docid": "27694abe8706985ce1a11d82e196d59a", "score": "0.5290503", "text": "displayTask(){\n if(localStorage.getItem(\"tasks\")){\n JSON.parse(localStorage.getItem(\"tasks\")).forEach((item)=>{\n this.displayHtml(item.id,item.name,item.details,item.assignee,item.dueDate,item.status);\n });\n }\n }", "title": "" }, { "docid": "3ee9a0dea2619dcb93afa276e4473ebb", "score": "0.52837485", "text": "function displayTasks () {\n deleteTable()\n var duplicateArray = []\n for (var index = 0; index < taskDetailsArray.length; index++) {\n duplicateArray[index] = index\n }\n addRowsToTable(duplicateArray)\n}", "title": "" }, { "docid": "604537de88c145e14320ac7900b9479a", "score": "0.52777684", "text": "function done(err, list) {\n if(err) {\n cli.raise(err);\n }\n if(cli.print && list[cli.print]) {\n process.stdout.write(list[cli.print].document);\n }\n if(cli.verbose) {\n var diff = process.hrtime(time);\n var precision = 3;\n var millis = (diff[1] / 1000000);\n log.info('completed in %ds, %dms', diff[0],\n millis.toFixed(precision));\n }\n process.exit();\n }", "title": "" }, { "docid": "5a7827a0da2e3df25e333dc7cb042af4", "score": "0.52694696", "text": "function showInfo(taskName, taskDef)\n {\n if (ROOT.alias['help'].indexOf(taskName) != -1)\n return;\n u.white();\n var description = taskDef.description || 'No description available';\n u.writeln(taskName[style.task] + ':', description[style.descr]);\n }", "title": "" }, { "docid": "32c8ec63c43669d8a423711142b0a016", "score": "0.5265894", "text": "function runTasks()\n{\n var fn;\n while (taskQueue.length > 0)\n {\n fn = taskQueue.shift();\n fn[0].apply(this, [fn[1]]);\n postMessage({'whatType': 'log', 'content': 'Box ' + fn[1] + ' finished executing ' + fn[0].name});\n }\n postMessage({'whatType': 'done', 'content': this.boxNumber});\n}", "title": "" }, { "docid": "6bd8fc0a35098ebf15a3edd793f08b33", "score": "0.5253496", "text": "output (...msg) {\n log.clearProgress()\n // eslint-disable-next-line no-console\n console.log(...msg)\n log.showProgress()\n }", "title": "" }, { "docid": "3f02dfefe586f779b680fe18e19470c1", "score": "0.52496785", "text": "static showTasks(task){\n \n //Create the first option for the task menu depending on task status\n const taskStatusOption = task.status === 'done' ? 'open' : 'done';\n const menuEditAvailable = task.status === 'done' ? 'btn-disabled' : '';\n \n //Creating a new DOM-element for a task\n const taskItem = document.createElement('div');\n taskItem.dataset.taskId = task.id;\n taskItem.className = `task-item task-${task.status}`;\n taskItem.innerHTML = \n `<h4 class=\"task-title\">${task.title}</h4>\n <p class=\"task-description\">${task.descr}</p>\n <div class=\"task-status\">\n <p class=\"task-priority\">${task.priority}</p>\n <a href=\"#\" class=\"task-manage-btn\">...</a>\n <ul class='task-menu'>\n <li class=\"task-menu-stat\">${taskStatusOption}</li>\n <li class=\"task-menu-edit ${menuEditAvailable}\">edit</li>\n <li class=\"task-menu-del\">detele</li>\n </ul>\n </div>\n `;\n \n //Add a new element to the page\n tasksContainer.appendChild(taskItem);\n \n }", "title": "" }, { "docid": "8e1118fe567822bf471deff051803777", "score": "0.5249276", "text": "function taskFill() {\n for (i = plannerStart; i < plannerEnd; i++) {\n $(`#${i}`).text(dailyTasks[i]);\n }\n }", "title": "" }, { "docid": "291682f0681eef8cd7769d97ae1af17a", "score": "0.52437437", "text": "showAllTasksList() {\r\n this.clearTasksList();\r\n for (let task of this.tasks) {\r\n this.tasksList.appendChild(task.getTask());\r\n }\r\n this.filters.setCounterValue(this.tasks.length);\r\n }", "title": "" }, { "docid": "47ca8f04afc0cdb08aaaea8ee9cc0d77", "score": "0.52431214", "text": "print () {\n const lastMessage = this.messages[this.messages.length - 1]\n const output = `#${lastMessage.lnum} - ${_.map(lastMessage.info, 'text').join('; ')}`\n if (lastMessage.status === constants.ProcessingStatus.Skipped) {\n logger.warn(output)\n }\n if (lastMessage.status === constants.ProcessingStatus.Successful) {\n logger.info(output)\n }\n if (lastMessage.status === constants.ProcessingStatus.Failed) {\n logger.error(output)\n }\n }", "title": "" }, { "docid": "dc79b53b90d842526b221874a0251c87", "score": "0.52301913", "text": "function showIncomplete()\n\t{\n\t\t// show incomplete tasks\n\t\t// hide completed tasks\n\t\tvar incompletedOutput = document.getElementById(\"incompletedOutput\");\n\t\tvar completedOutput = document.getElementById(\"completedOutput\");\n\t\tincompletedOutput.style.display = 'block';\n\t\tcompletedOutput.style.display = 'none';\n\t\t\n\t}", "title": "" }, { "docid": "dc79b53b90d842526b221874a0251c87", "score": "0.52301913", "text": "function showIncomplete()\n\t{\n\t\t// show incomplete tasks\n\t\t// hide completed tasks\n\t\tvar incompletedOutput = document.getElementById(\"incompletedOutput\");\n\t\tvar completedOutput = document.getElementById(\"completedOutput\");\n\t\tincompletedOutput.style.display = 'block';\n\t\tcompletedOutput.style.display = 'none';\n\t\t\n\t}", "title": "" }, { "docid": "651dffcaeda2b21fefcf25a3ba47a77a", "score": "0.52192694", "text": "function newTask(x,y,z,o){\n document.getElementById('myTasks').innerHTML +=\n '<div class=\"col l3 m4 s12 animated zoomIn\"> <h4>'+z+ ':</h1>'+\n '<p>'+y+'</p>' +\n '<p>By: '+x+'</p>' +\n '<p>Due: ' +o +'</p>'+\n '<div class=\"btn red\" >Delete</div>'+\n '</div>'\n}", "title": "" }, { "docid": "f0ad769ab64aa1c6453f3552acd75c1a", "score": "0.52161336", "text": "function build(){\n try {\n var currentBuild = builder.build();\n } catch(o_O){\n vscode.window.showErrorMessage( '(T-T) ' + o_O );\n return;\n };\n\n if( currentBuild ){\n vscode.window.setStatusBarMessage( '[' + progress + '/' + total + '] write [' + created + '] skiped [' + skiped + ']' );\n fs.write({\n path : createPath( currentTask.output, currentBuild.path ),\n string : currentBuild.html,\n writeIfOld : currentBuild.updatedAt\n }, writeFileDispatcher );\n } else {\n vscode.window.setStatusBarMessage( '[' + progress + '/' + total + '] (^-^) Task complete!' );\n startTask();\n };\n }", "title": "" }, { "docid": "e4cc75f8c6f9a0b1f804dbd5b7267747", "score": "0.5211676", "text": "function task3(callback) {\n callback.maximumProgress = 100;\n for (let i = 0; i <= 100; ++i) {\n if (i == 50) {\n callback.title = 'Phase II';\n }\n callback.currentProgress = i;\n callback.status = 'Step ' + i, 100;\n sleep(50);\n }\n}", "title": "" }, { "docid": "56cf4d08e71b561e2f24ca0e9fff2e72", "score": "0.5209772", "text": "function renderSavedTask() {\n // Retrieve the last tasks from localStorage using `getItem()`\n var item9AM = localStorage.getItem('item9AM');\n var item10AM = localStorage.getItem('item10AM');\n var item11AM = localStorage.getItem('item11AM');\n var item12PM = localStorage.getItem('item12PM');\n var item1PM = localStorage.getItem('item1PM');\n var item2PM = localStorage.getItem('item2PM');\n var item3PM = localStorage.getItem('item3PM');\n var item4PM = localStorage.getItem('item4PM');\n var item5PM = localStorage.getItem('item5PM');\n \n // Set the text of the hourly tasks to the corresponding \n //values from localStorage\n if (item9AM === null) {return;\n } else {textArea9AM.textContent = item9AM;}\n\n if (item10AM === null) {return;\n } else {textArea10AM.textContent = item10AM;}\n\n if (item11AM === null) {return;\n } else {textArea11AM.textContent = item11AM;}\n\n if (item12PM === null) {return;\n } else {textArea12PM.textContent = item12PM;}\n\n if (item1PM === null) {return;\n } else {textArea1PM.textContent = item1PM;}\n\n if (item2PM === null) {return;\n } else {textArea2PM.textContent = item2PM;}\n\n if (item3PM === null) {return;\n } else {textArea3PM.textContent = item3PM;}\n\n if (item4PM === null) {return;\n } else {textArea4PM.textContent = item4PM;}\n\n if (item5PM === null) {return;\n } else {textArea5PM.textContent = item5PM;}\n \n}", "title": "" }, { "docid": "eac7f26092d522c75f4e41bbebadc032", "score": "0.5208409", "text": "plotTaskData() {\n \n if (this.taskdata===null) {\n webutil.createAlert('No task definitions in memory',true);\n return;\n }\n\n this.createTaskPlotWindow();\n const footer=this.dialogElement.getFooter();\n const parsedRuns = this.taskdata.runs;\n const runKeys=Object.keys(parsedRuns);\n\n\n for (let i=0;i<runKeys.length;i++) {\n let runName=runKeys[i];\n this.addItemToFooter(footer,runName);\n }\n \n webutil.createbutton({\n 'name' : 'Take Snapshot',\n 'type' : 'success',\n 'parent' : footer,\n 'css' : {\n 'margin-left': '50px',\n 'margin-right': '10px',\n 'margin-top' : '0px',\n },\n callback : ( () => {\n this.takeSnapshot();\n })\n });\n\n\n const taskNames = this.taskdata.taskNames;\n \n let canvas=this.canvas;\n let context=canvas.getContext(\"2d\");\n context.font='14px Arial';\n this.textWidth=context.measureText(taskNames[0]).width;\n for (let i=1;i<taskNames.length;i++) {\n let w=context.measureText(taskNames[i]).width;\n if (w>this.textWidth)\n this.textWidth=w;\n }\n this.textWidth*=1.5;\n \n this.legendMargin=Math.ceil(this.textWidth+OFFSET);\n this.margins=[OFFSET,OFFSET+50,(canvas.width-this.legendMargin-OFFSET),canvas.height-2*OFFSET-50 ];\n this.htask=Math.floor((this.margins[3]-AXIS-OFFSET)/taskNames.length);\n this.htaskbase=this.margins[0]+0.1*this.htask;\n this.plotTaskDataRun(runKeys[0]);\n }", "title": "" }, { "docid": "5d811e8e0721c65ede2c32c49cdf51aa", "score": "0.520243", "text": "function startTask(){\n builder.reset();\n\n if( progress < total ){\n currentTask = tasks.shift();\n if( currentTarget = currentTask.htmlRoot ){\n ++progress;\n fs.find({\n rootPath : currentTarget.rootPath,\n include : currentTarget.include || createPath( currentTarget.rootPath, '**/*.htm*' ),\n exclude : currentTarget.exclude,\n getText : true\n }, findFileDispatcher );\n } else {\n vscode.window.showErrorMessage( '(T-T) Not fonund \"htmlRoot\"!' );\n };\n } else {\n vscode.window.setStatusBarMessage( '[' + progress + '/' + total + '] (^-^) All Tasks complete!' );\n };\n }", "title": "" }, { "docid": "320cc204a404f3f33b573b8edf5f81b7", "score": "0.5201514", "text": "function showInstructions(txt) {\n trialOrder = shuffle(randomArray)\n totalAccArray = []\n dir = path.join(savePath, 'PolarData', 'PhonTx', getSubjID(), getSessID())\n if (!fs.existsSync(dir)) {\n mkdirp.sync(dir)\n }\n fileToSave = path.join(dir,subjID+'_'+sessID+'_PhonTx_level_'+level+'_'+getDateStamp()+'.csv')\n clearScreen()\n var textDiv = document.createElement(\"div\")\n textDiv.style.textAlign = 'center'\n var p = document.createElement(\"p\")\n var txtNode = document.createTextNode(txt)\n p.appendChild(txtNode)\n textDiv.appendChild(p)\n var lineBreak = document.createElement(\"br\")\n var startBtnDiv = document.createElement(\"div\")\n var startBtn = document.createElement(\"button\")\n var startBtnTxt = document.createTextNode(\"Start\")\n startBtn.appendChild(startBtnTxt)\n startBtn.onclick = function() {\n showNextTrial(level)\n }\n startBtnDiv.appendChild(startBtn)\n var practiceBtnDiv = document.createElement(\"div\")\n var practiceBtn = document.createElement(\"button\")\n var practiceBtnTxt = document.createTextNode(\"Practice\")\n practiceBtn.appendChild(practiceBtnTxt)\n practiceBtn.onclick = function() {\n showNextPracticeTrial(level)\n }\n practiceBtnDiv.appendChild(practiceBtn)\n content.appendChild(textDiv)\n content.appendChild(lineBreak)\n content.appendChild(startBtnDiv)\n content.appendChild(lineBreak)\n content.appendChild(practiceBtnDiv)\n return getTime()\n}", "title": "" }, { "docid": "53a76d855d570b2cd1547f03689dd7bb", "score": "0.52009153", "text": "function updateTasks() {\n if (totalTasks === 1) {\n tasks.innerText = `${totalTasks} Task`;\n } else {\n tasks.innerText = `${totalTasks} Tasks`;\n }\n}", "title": "" }, { "docid": "10a09528e0c29bd540e519dabb4d0629", "score": "0.52001816", "text": "function log() {\n if (timing || (task_length == 0)) {\n return false;\n }\n $.post('log', {\"seconds\":task_length}, function(data, textStatus) {\n $('#current').css('color', '#000000').text(duration(data.total_time));\n }, 'json');\n $('#nav').show();\n task_length = 0;\n return true;\n}", "title": "" }, { "docid": "c9e610ea9c589d7231f47cf73ceef201", "score": "0.5185201", "text": "function viewProjectTasks(pid,callback){\n \tconnection = init();\n\tconsole.log(\"View all tasks for Project: \"+ pid);\n\tconnection.query(\"SELECT projectTitle, taskTitle, status FROM Projects NATURAL JOIN Tasks WHERE projectID=?;\", pid, function (error, rows, fields) {\n\t\tcallback(\"\"+JSON.stringify(rows));\n\t});\n\n connection.end(); \n}", "title": "" }, { "docid": "f577109b7c50593ba21c7bc106873f60", "score": "0.5183195", "text": "function display(){\n console.log(chalk.yellow.underline.bold(\"Please use one of the following commands:\"))\n console.log(chalk.blue('\\tconcert-this')+\" to find the bands in the town\")\n console.log(chalk.blue('\\tspotify-this-song') + \" to get the song details\")\n console.log(chalk.blue('\\tmovie-this')+ \" to movie details\")\n console.log(chalk.blue('\\tdo-what-it-says') + \" to allow LIRI talk to to random.txt\")\n console.log(chalk.blue('\\tq') + \" to quit the terminal\\n\")\n}", "title": "" }, { "docid": "4228f34a1c8a5aa2f0baa7a5e1119bc1", "score": "0.5182302", "text": "showTaskUsage(meowCli) {\n\t\towIsMeow(meowCli);\n\n\t\tterminal.echo(`\\n${this.getTaskUsage(meowCli.input[0])}`);\n\t\tterminal.exit();\n\t}", "title": "" }, { "docid": "95f161244ef241a28f8e1176d9daddc6", "score": "0.5180878", "text": "function goToPrintingScreen(msg) {\r\n\tsetTimeout(printingScreenTimeout, 5000);\r\n document.getElementById('state-printing').style.display = 'flex';\r\n document.getElementById('state-printing-text').innerHTML = msg;\r\n}", "title": "" }, { "docid": "a2b87f5e46caae55df34152834d8fdf3", "score": "0.5174403", "text": "function storeTasks(file, tasks){\n fs.writeFile(file, JSON.stringify(tasks), 'utf8', (err)=>{\n if(err) throw err;\n console.log(\"Saved tasks\");\n });\n}", "title": "" }, { "docid": "76ff13da95cc882509f517edba493a54", "score": "0.51573414", "text": "function showCompletedTask(e){\n\tvar section = $.completedList.sections[e.sectionIndex];\n\tshowTask(section,e);\n}", "title": "" }, { "docid": "a54c6e7727181f66831849e71df8de0c", "score": "0.5147183", "text": "formatOutput() {\n\t\tvar output = \"\";\n\t\tvar modelComponentsEvents = Rx.Observable.from(model.components);\n\t\tif(this.flag) {\n\t\t\tvar actions = modelComponentsEvents.map((component)=> {\n\t\t\t\treturn component.actions.viewLoaded$;\n\t\t\t}).mergeAll().subscribe((a)=>{\n\t\t\t\toutput += a + \"=======>\";\n\t\t\t\t$('h2').hide();\n\t\t\t\tconsole.log(\"Hello this view was loaded\",\"from spinner\");\n\t\t\t});\n\t\t\tthis.flag = false;\n\t\t}\n\t}", "title": "" }, { "docid": "95778c5bb71dfe96d09f62b0f0511fc5", "score": "0.5145408", "text": "function print(txt) {\n document.getElementById(\"time-display\").innerHTML = txt;\n }", "title": "" }, { "docid": "a099211ce47773f19e729e3927148b91", "score": "0.5139501", "text": "function listTasks() {\n for(let i = 0; i < tasks.length; i++) {\n var task = new Task(tasks[i].taskTitle, tasks[i].taskTime, tasks[i].completed);\n task.createTask(task.taskTitle, task.taskTime, task.completed);\n }\n}", "title": "" }, { "docid": "4481df06396d0790192d5b58dd0dc840", "score": "0.5118672", "text": "function printTaskNameCentre(taskId) {\n\t//GET TASK NAME\n\tcurrentTaskName = databaseGetTaskName(currentTaskId);\n\t$(\"taskName\").empty();\n\t$(\"taskName\").setStyles({\n\t\tposition : \"fixed\",\n\t\ttop : \"50%\",\n\t\tleft : \"50%\",\n\t\t\"margin-top\" : \"-60px\",\n\t\t\"margin-left\" : \"-60px\",\n\t\t\"width\" : \"120px\",\n\t\t\"height\" : \"120px\",\n\t\t\"display\" : \"table\",\n\t\t\"border-radius\" : \"120px\",\n\t\t\"background-color\" : \"rgba(112,138,144,0.6)\",\n\t\t\"z-index\" : \"-2\",\n\t\t\"text-align\" : \"center\"\n\t});\n\t$(\"taskName\").adopt(\n\t\t\tnew Element(\"p#tasknametext\", {\n\t\t\t\ttext : currentTaskName,\n\t\t\t\tstyles : {\n\t\t\t\t\tposition : \"relative\",\n\t\t\t\t\t\"font-size\" : \"14px\",\n\t\t\t\t\t\"display\" : \"table-cell\",\n \t\t\t\t\t\"vertical-align\" : \"middle\",\n \t\t\t\t\t\"text-align\" : \"center\"\n\t\t\t\t}\n\t\t\t})\n\t\t);\n\tdocument.title = \"TIC - \" + currentTaskName;\n\tdrawPICCircles();\n}", "title": "" }, { "docid": "741e8c035b0181bbc19b83e2f3467bfc", "score": "0.5117533", "text": "function publishRoleDetails(rolename, div_id){\n $DOM(\"#roleName\").innerHTML = rolename;\n var tasks = rolesInfo[rolename];\n var innerHTML = \"\";\n for(var task_idx in tasks){\n innerHTML += \"<tr><td>\";\n var task = tasks[task_idx];\n var task_idx_human = parseInt(task_idx) + 1;\n var count = 0;\n for(var inner_task_key in task){\n if(count == 0){\n innerHTML += \"#\" + task_idx_human + \" <i>\" + inner_task_key + \"</i>: <b>\" + task[inner_task_key] + \"</b> <i onClick=\\\"toggleTaskDetail(this);\\\" class=\\\"toggle-icon icon-plus-sign\\\"></i><blockquote class=\\\"task-detail\\\">\";\n } else {\n innerHTML += \"<div><i>\" + inner_task_key + \"</i>: <b>\" + task[inner_task_key] + \"</b></div>\";\n }\n count += 1;\n }\n innerHTML += \"</blockquote></td></tr>\";\n }\n $DOM(div_id).innerHTML = innerHTML;\n}", "title": "" }, { "docid": "c08c6d77268889853fdd305d8b1aae10", "score": "0.5117473", "text": "callback(task) {\n // code to be executed on each run\n timer.reset();\n console.log(`System ${task.id}`);\n document.getElementById(\"text-cooldown\").innerHTML = \"CPU Checked\"\n document.getElementsByTagName('title')[0].text = `${wax.userAccount} - CPU Checked`\n document.getElementById(\"btn-mine\").disabled = false\n async function CPUchecking() {\n await bott.CPUchecked();\n }\n CPUchecking();\n }", "title": "" }, { "docid": "dce95991e5f6c1503b353dd43bf2d16d", "score": "0.51166457", "text": "function printer(name, seconds) {\n setTimeout(\n () => console.log(name),\n seconds * 1000,\n );\n}", "title": "" }, { "docid": "71b0a74879f704f95e63a0674d04d389", "score": "0.51160884", "text": "function taskCompleted() {\n $('#taskCompleted').show();\n setTimeout(function () {\n changeLocation();\n }, 1000);\n}", "title": "" }, { "docid": "68ea0254be7648e97b5b3462f6b0b2a1", "score": "0.51121664", "text": "function test1_delayedTasks() {\n var t = new Date();\n save_delayedTasks_(\"Do some tasks\", \"hey\", {});\n save_delayedTasks_(\"Do some tasks\", \"foo\", {});\n save_delayedTasks_(\"Do some tasks\", \"baz\", {});\n save_delayedTasks_(\"Do some tasks\", \"bar\", {});\n\n var tasks = get_delayedTasks_(\"Do some tasks\");\n console.log(tasks);\n}", "title": "" }, { "docid": "c9f93b45693cc536e59c47f12a30f6e8", "score": "0.51118726", "text": "printUsage ()\n {\n // Print errors\n if (0 !== this.errors.length)\n {\n this.errors.forEach(\n (error) => console.log(`❗️ ${chalk.red(error)}`)\n );\n console.log(\"\");\n console.log(\"\");\n }\n\n // Print usage\n console.log(chalk.yellow(`Usage`));\n console.log(chalk.yellow(`=====`));\n console.log(\"\");\n\n console.log(chalk.yellow(\"Run a task\"));\n console.log(chalk.yellow(\"----------\"));\n console.log(\"\");\n\n console.log(`$ ${chalk.blue(\"kaba\")} ${chalk.underline(\"task\")}`);\n console.log(\"\");\n\n if (0 !== this.registeredTasks.length)\n {\n console.log(`The following tasks are registered:`);\n this.registeredTasks.forEach((task) => {\n const taskName = (this.DEFAULT_TASK_NAME === task)\n ? `${chalk.yellow.italic(\"default task\")} (run without parameter)`\n : chalk.yellow(task);\n\n console.log(` • ${taskName}`);\n });\n }\n\n console.log(``);\n console.log(``);\n\n console.log(chalk.yellow(\"Initialize a local kaba project\"));\n console.log(chalk.yellow(\"-------------------------------\"));\n console.log(\"\");\n\n console.log(`$ ${chalk.blue(\"kaba\")} --init=${chalk.underline(\"file\")}`);\n console.log(\"\");\n\n if (0 !== this.registeredInitFiles.length)\n {\n console.log(`The following files are available:`);\n this.registeredInitFiles.forEach(\n (file) => console.log(` • ${chalk.yellow(file)}`)\n );\n }\n\n console.log(\"\");\n }", "title": "" }, { "docid": "dda5f23e5e6924dcbb54f2d3bf69d6d3", "score": "0.51054484", "text": "render() {\n this.getTasksInfo();\n }", "title": "" }, { "docid": "cd5279555ad0e4d67eb1ca22bdc487f2", "score": "0.51019424", "text": "function displayTasks(taskData) {\n //listForTreeMap = new Array();\n\n var $ul = $tasks.find('div');\n var frag = document.createDocumentFragment();\n taskData.forEach(function (task) {\n // add row to tree map\n // listForTreeMap.push(getTreeMapRow(task, null));\n // create UI row\n var $li = $('<a class=\"list-group-item\" rel=\"' + task.id + '\" href=\"#task-' + task.id + ' \">' + task.title + '</a>');\n frag.appendChild($li[0]);\n });\n $ul.html(frag);\n\n // redraw tree map to show tasks priority\n redrawTreeMap(listForTreeMap);\n\n bindToTasks();\n }", "title": "" } ]
98cdeb23b219f1d5ddef1242e86cf5b6
Multiplies the two elements of GF(2^8) together and returns the result. See the Rijndael spec, but should be straightforward: for each power of the indeterminant that has a 1 coefficient in x, add y times that power to the result. x and y should be bytes representing elements of GF(2^8)
[ { "docid": "d2ff8d646ee41c550d5682009dadac28", "score": "0.7305053", "text": "function mult_GF256(x, y) {\n var bit, result = 0;\n \n for (bit = 1; bit < 256; bit *= 2, y = xtime(y)) {\n if (x & bit) \n result ^= y;\n }\n return result;\n}", "title": "" } ]
[ { "docid": "fcc246544038a581f9ae0a6d1b669208", "score": "0.71034324", "text": "function mult(x, y){\n let m = x.countBits();\n let n = y.countBits();\n let c = BB.makeBits(m + n);\n let carry = 0;\n let k = 0;\n for (let j = 0; j < n; j++){\n k = j;\n carry = 0;\n if (y.getBit(j)){\n for (let i = 0; i < m; i++){\n let total = x.getBit(i) * y.getBit(j) + c.getBit(k) + carry;\n let sum = total % 2;\n c.setBit(k, sum);\n carry = (total - sum) / 2;\n k++;\n }\n c.setBit(k, carry);\n }\n }\n return c;\n }", "title": "" }, { "docid": "ab95d51605b7b6504a63dfbeaf517f3b", "score": "0.70569646", "text": "static reedSolomonMultiply(x, y) {\n if (x >>> 8 != 0 || y >>> 8 != 0)\n throw \"Byte out of range\";\n // Russian peasant multiplication\n let z = 0;\n for (let i = 7; i >= 0; i--) {\n z = (z << 1) ^ ((z >>> 7) * 0x11D);\n z ^= ((y >>> i) & 1) * x;\n }\n if (z >>> 8 != 0)\n throw \"Assertion error\";\n return z;\n }", "title": "" }, { "docid": "e9f83868202ff983493104bd010cb163", "score": "0.6643235", "text": "function caml_int64_mul(x,y) {\n var z1 = x[1] * y[1];\n var z2 = ((z1 * caml_int64_offset) | 0) + x[2] * y[1] + x[1] * y[2];\n var z3 = ((z2 * caml_int64_offset) | 0) + x[3] * y[1] + x[2] * y[2] + x[1] * y[3];\n return [255, z1 & 0xffffff, z2 & 0xffffff, z3 & 0xffff];\n}", "title": "" }, { "docid": "d88d576d3822e6a72ba711ea24a0df40", "score": "0.64508927", "text": "function multiplyRijndael(polyA, polyB) {\n const degreeA = degree(polyA);\n const degreeB = degree(polyB);\n\n const revertedA = JSON.parse(JSON.stringify(polyA)).reverse();\n const revertedB = JSON.parse(JSON.stringify(polyB)).reverse();\n\n let revertedR = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n\n for (let iA = 0; iA <= degreeA; iA++) {\n if (revertedA[iA] > 0) {\n for (let iB = 0; iB <= degreeB; iB++) {\n if (revertedB[iB] > 0) {\n revertedR[iA + iB] += 1;\n }\n }\n }\n }\n\n revertedR = revertedR.map(x => x % 2);\n\n // L'opération de modulo est équivalente à remplacer X^8 par X^4 + X^3 + X + 1, X^9 par X^5 + X^4 + X^2 + X, etc...\n for (let i = revertedR.length - 1; i >= 8; i--) {\n if (revertedR[i] == 1) {\n revertedR[i - 4] += 1;\n revertedR[i - 5] += 1;\n revertedR[i - 7] += 1;\n revertedR[i - 8] += 1;\n revertedR = revertedR.map(x => x % 2);\n }\n }\n\n revertedR = revertedR.slice(0, 8).reverse();\n\n return revertedR;\n}", "title": "" }, { "docid": "242d45c3327d1f3f1ccf8d105287aeb6", "score": "0.62652797", "text": "function bmul(x,y) {\n var n = x.length;\n var t = y.length;\n var r = zeros(n+t-1);\n var c, i, j;\n\n for(i = 0; i < t; i++) {\n c = 0;\n for(j = 0; j < n; j++) {\n c = ip(r,i+j,x[j],y[i],c);\n }\n r[i+n] = c;\n }\n\n return zclip(r);\n}", "title": "" }, { "docid": "1b9418eea1932b55d1ea0018571ee167", "score": "0.6220909", "text": "function v64_addMul(i1, i2)\r\n{\r\n\tvar al = i1&0xffff; var ah = i1>>>16;\r\n\tvar bl = i2&0xffff; var bh = i2>>>16;\r\n\tvar A = ah*bh;\r\n\tvar B = al*bl;\r\n\tvar C = (al+ah)*(bl+bh);\r\n\tvar K = C-A-B;\r\n\r\n\tvar lo = (K&0xffff)*(1<<16) + B;\r\n\tvar hi = 0;\r\n\tif (lo > 0xffffffff) {\r\n\t\tlo -= 0x100000000;\r\n\t\thi = 1;\r\n\t}\r\n\thi += ((A)+(K>>>16)) ;\r\n\r\n\tthis.lo += lo;\r\n\tthis.hi += hi;\r\n\r\n\t// and-ing changes sign, so I must do :/\r\n\t// -= instead ;/\r\n\tif (this.lo > 0xffffffff) {\r\n\t\tthis.hi ++;\r\n\t\tthis.lo -= 0x100000000;\r\n\t}\r\n\tif (this.hi > 0xffffffff) this.hi -= 0x100000000;\r\n\treturn this;\r\n}", "title": "" }, { "docid": "b0b0f2d539a15f91f60aaa519002f75c", "score": "0.6142629", "text": "function mult_(x, y) {\n var i;\n if (ss.length !== 2 * x.length)\n ss = new Array(2 * x.length);\n copyInt_(ss, 0);\n for (i = 0; i < y.length; i++)\n if (y[i])\n linCombShift_(ss, x, y[i], i); //ss=1*ss+y[i]*(x<<(i*bpe))\n copy_(x, ss);\n }", "title": "" }, { "docid": "42c801daae3358c7d56d98857364cc8c", "score": "0.6083693", "text": "function gfMul(a, b, modulo, size)\n{\n\tsize = size || 256;\n\n\tlet result = 0;\n\twhile (b !== 0)\n\t{\n\t\tif ((b & 1) !== 0)\n\t\t{\n\t\t\tresult ^= a;\n\t\t}\n\t\ta <<= 1;\n\t\tif (a >= size)\n\t\t{\n\t\t\ta ^= modulo;\n\t\t}\n\t\tb >>>= 1;\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "9a3efb17e78d8e9f11d828b49252e522", "score": "0.6058616", "text": "function P16Inv1(x, y)\n{\n\ty[2] ^= x[0];\n\ty[3] ^= x[1];\n\ty[0] ^= x[2];\n\ty[1] ^= x[3];\n\tx[2] ^= y[2];\n\tx[3] ^= y[3];\n\tx[0] ^= y[0];\n\tx[1] ^= y[1];\n}", "title": "" }, { "docid": "39c29c70cba343048696143598dd49d7", "score": "0.603797", "text": "function mult_(x, y) {\n var i;\n if (ss.length != 2 * x.length) ss = new Array(2 * x.length);\n copyInt_(ss, 0);\n for (i = 0; i < y.length; i++) {\n if (y[i]) linCombShift_(ss, x, y[i], i);\n } //ss=1*ss+y[i]*(x<<(i*bpe))\n copy_(x, ss);\n}", "title": "" }, { "docid": "a30e1a6d42f863f4f887bfa9d6113cf4", "score": "0.60175586", "text": "function add(x, y){\n let n = Math.max(x.countBits(), y.countBits());\n let c = BB.makeBits(n + 1);\n let carry = 0;\n for (let i = 0; i < n; i++){\n let total = BB.getBit(x, i) + BB.getBit(y, i) + carry;\n let sumBit = total % 2;\n BB.setBit(c, i, sumBit);\n carry = (total - sumBit) / 2;\n }\n BB.setBit(c, n, carry);\n return c;\n }", "title": "" }, { "docid": "320bb4ffefd80f0067b8f640429e97fd", "score": "0.59827375", "text": "function mul(r, x, y, arrFactory) {\n var carry;\n var t = arrFactory.getUint32Array(64);\n for (var i = 0; i < 64; i += 1) {\n t[i] = 0;\n }\n for (var i = 0; i < 32; i += 1) {\n for (var j = 0; j < 32; j += 1) {\n t[i + j] += x[i] * y[j];\n }\n }\n /* Reduce coefficients */\n for (var i = 0; i < 63; i += 1) {\n carry = t[i] >>> 8;\n t[i + 1] += carry;\n t[i] &= 0xff;\n }\n barrett_reduce(r, t, arrFactory);\n arrFactory.recycle(t);\n}", "title": "" }, { "docid": "b2c596ca97f2fe4335a1565881d12053", "score": "0.5796651", "text": "function bitwise(x, y, f){\n let n = Math.max(x.countBits(), y.countBits());\n let z = BB.makeBits(n);\n for (let i = 0; i < n; i++){\n z.setBit(i, (f(x.getBit(i), y.getBit(i))));\n }\n return z;\n }", "title": "" }, { "docid": "77ae27aa455b421ca1c13ceb48f1416d", "score": "0.5768473", "text": "function P16_1(x, y)\n{\n\tx[0] ^= y[0];\n\tx[1] ^= y[1];\n\tx[2] ^= y[2];\n\tx[3] ^= y[3];\n\ty[0] ^= x[2];\n\ty[1] ^= x[3];\n\ty[2] ^= x[0];\n\ty[3] ^= x[1];\n}", "title": "" }, { "docid": "1fce66b29d8b656c1160f69f11f2131c", "score": "0.5749779", "text": "function ___muldsi3($a, $b) {\r\n $a = $a | 0;\r\n $b = $b | 0;\r\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\r\n $1 = $a & 65535;\r\n $2 = $b & 65535;\r\n $3 = Math_imul($2, $1) | 0;\r\n $6 = $a >>> 16;\r\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\r\n $11 = $b >>> 16;\r\n $12 = Math_imul($11, $1) | 0;\r\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\r\n}", "title": "" }, { "docid": "1fce66b29d8b656c1160f69f11f2131c", "score": "0.5749779", "text": "function ___muldsi3($a, $b) {\r\n $a = $a | 0;\r\n $b = $b | 0;\r\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\r\n $1 = $a & 65535;\r\n $2 = $b & 65535;\r\n $3 = Math_imul($2, $1) | 0;\r\n $6 = $a >>> 16;\r\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\r\n $11 = $b >>> 16;\r\n $12 = Math_imul($11, $1) | 0;\r\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\r\n}", "title": "" }, { "docid": "dd915195b56c2fc6b3e68ad738225a28", "score": "0.57444936", "text": "function bnModPow(e,m){var i=e.bitLength(),k,r=nbv(1),z;if(i<=0)return r;else if(i<18)k=1;else if(i<48)k=3;else if(i<144)k=4;else if(i<768)k=5;else k=6;if(i<8)z=new Classic(m);else if(m.isEven())z=new Barrett(m);else z=new Montgomery(m);// precomputation\nvar g=new Array(),n=3,k1=k-1,km=(1<<k)-1;g[1]=z.convert(this);if(k>1){var g2=new BigInteger();z.sqrTo(g[1],g2);while(n<=km){g[n]=new BigInteger();z.mulTo(g2,g[n-2],g[n]);n+=2;}}var j=e.t-1,w,is1=true,r2=new BigInteger(),t;i=nbits(e[j])-1;while(j>=0){if(i>=k1)w=e[j]>>i-k1&km;else{w=(e[j]&(1<<i+1)-1)<<k1-i;if(j>0)w|=e[j-1]>>this.DB+i-k1;}n=k;while((w&1)==0){w>>=1;--n;}if((i-=n)<0){i+=this.DB;--j;}if(is1){// ret == 1, don't bother squaring or multiplying it\ng[w].copyTo(r);is1=false;}else{while(n>1){z.sqrTo(r,r2);z.sqrTo(r2,r);n-=2;}if(n>0)z.sqrTo(r,r2);else{t=r;r=r2;r2=t;}z.mulTo(r2,g[w],r);}while(j>=0&&(e[j]&1<<i)==0){z.sqrTo(r,r2);t=r;r=r2;r2=t;if(--i<0){i=this.DB-1;--j;}}}return z.revert(r);}// (public) gcd(this,a) (HAC 14.54)", "title": "" }, { "docid": "214ea54dd282f1bdc18ddb81bcf741cd", "score": "0.5740854", "text": "function b2NextPowerOfTwo(x)\r\n{\r\n\tx |= (x >> 1);\r\n\tx |= (x >> 2);\r\n\tx |= (x >> 4);\r\n\tx |= (x >> 8);\r\n\tx |= (x >> 16);\r\n\treturn x + 1;\r\n}", "title": "" }, { "docid": "9bfdbd996892b5208fc7f57dac685f93", "score": "0.5730407", "text": "function bnModPow(e,m){var i=e.bitLength(),k,r=nbv(1),z;if(i<=0)return r;else if(i<18)k=1;else if(i<48)k=3;else if(i<144)k=4;else if(i<768)k=5;else k=6;if(i<8)z=new Classic(m);else if(m.isEven())z=new Barrett(m);else z=new Montgomery(m);// precomputation\nvar g=new Array(),n=3,k1=k-1,km=(1<<k)-1;g[1]=z.convert(this);if(k>1){var g2=nbi();z.sqrTo(g[1],g2);while(n<=km){g[n]=nbi();z.mulTo(g2,g[n-2],g[n]);n+=2;}}var j=e.t-1,w,is1=true,r2=nbi(),t;i=nbits(e[j])-1;while(j>=0){if(i>=k1)w=e[j]>>i-k1&km;else{w=(e[j]&(1<<i+1)-1)<<k1-i;if(j>0)w|=e[j-1]>>this.DB+i-k1;}n=k;while((w&1)==0){w>>=1;--n;}if((i-=n)<0){i+=this.DB;--j;}if(is1){// ret == 1, don't bother squaring or multiplying it\ng[w].copyTo(r);is1=false;}else{while(n>1){z.sqrTo(r,r2);z.sqrTo(r2,r);n-=2;}if(n>0)z.sqrTo(r,r2);else{t=r;r=r2;r2=t;}z.mulTo(r2,g[w],r);}while(j>=0&&(e[j]&1<<i)==0){z.sqrTo(r,r2);t=r;r=r2;r2=t;if(--i<0){i=this.DB-1;--j;}}}return z.revert(r);}// (public) gcd(this,a) (HAC 14.54)", "title": "" }, { "docid": "4410922b12babb5e4366c54408d87d0e", "score": "0.5708241", "text": "function fnv_multiply(a) {\r\n return a + (a << 1) + (a << 4) + (a << 7) + (a << 8) + (a << 24);\r\n }", "title": "" }, { "docid": "44721b5323b106e177c3a1f69c9f7f66", "score": "0.56939656", "text": "function product(x, y) {\n return x * y;\n }", "title": "" }, { "docid": "50f76ebb74a70032bf079869c4da3ae6", "score": "0.5680247", "text": "function bnModPow(e,m){var i=e.bitLength(),k,r=nbv(1),z;if(i<=0)return r;else if(i<18)k=1;else if(i<48)k=3;else if(i<144)k=4;else if(i<768)k=5;else k=6;if(i<8)z=new Classic(m);else if(m.isEven())z=new Barrett(m);else z=new Montgomery(m);\n// precomputation\nvar g=new Array,n=3,k1=k-1,km=(1<<k)-1;g[1]=z.convert(this);if(k>1){var g2=nbi();z.sqrTo(g[1],g2);while(n<=km){g[n]=nbi();z.mulTo(g2,g[n-2],g[n]);n+=2}}var j=e.t-1,w,is1=true,r2=nbi(),t;i=nbits(e[j])-1;while(j>=0){if(i>=k1)w=e[j]>>i-k1&km;else{w=(e[j]&(1<<i+1)-1)<<k1-i;if(j>0)w|=e[j-1]>>this.DB+i-k1}n=k;while((w&1)==0){w>>=1;--n}if((i-=n)<0){i+=this.DB;--j}if(is1){// ret == 1, don't bother squaring or multiplying it\ng[w].copyTo(r);is1=false}else{while(n>1){z.sqrTo(r,r2);z.sqrTo(r2,r);n-=2}if(n>0)z.sqrTo(r,r2);else{t=r;r=r2;r2=t}z.mulTo(r2,g[w],r)}while(j>=0&&(e[j]&1<<i)==0){z.sqrTo(r,r2);t=r;r=r2;r2=t;if(--i<0){i=this.DB-1;--j}}}return z.revert(r)}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "ec0d0d79c340781caebecdc19e32fa47", "score": "0.56782234", "text": "function ___muldsi3($a, $b) {\n $a = $a | 0;\n $b = $b | 0;\n var $1 = 0, $2 = 0, $3 = 0, $6 = 0, $8 = 0, $11 = 0, $12 = 0;\n $1 = $a & 65535;\n $2 = $b & 65535;\n $3 = Math_imul($2, $1) | 0;\n $6 = $a >>> 16;\n $8 = ($3 >>> 16) + (Math_imul($2, $6) | 0) | 0;\n $11 = $b >>> 16;\n $12 = Math_imul($11, $1) | 0;\n return (tempRet0 = (($8 >>> 16) + (Math_imul($11, $6) | 0) | 0) + ((($8 & 65535) + $12 | 0) >>> 16) | 0, 0 | ($8 + $12 << 16 | $3 & 65535)) | 0;\n}", "title": "" }, { "docid": "a94a41ad9d9f40384ef1f21b681ca5c9", "score": "0.5658301", "text": "function multiplicar(x,y) {\n\treturn x*y;\n}", "title": "" }, { "docid": "003e310497da8e12c3dc8dca97ccae73", "score": "0.56558204", "text": "function enc(dataByte,keyByte){ \n var keys = generateKeys(keyByte); \n var ipByte = initPermute(dataByte); \n var ipLeft = new Array(32);\n var ipRight = new Array(32);\n var tempLeft = new Array(32);\n var i = 0,j = 0,k = 0,m = 0, n = 0;\n for(k = 0;k < 32;k ++){\n ipLeft[k] = ipByte[k];\n ipRight[k] = ipByte[32+k];\n } \n for(i = 0;i < 16;i ++){\n for(j = 0;j < 32;j ++){\n tempLeft[j] = ipLeft[j];\n ipLeft[j] = ipRight[j]; \n } \n var key = new Array(48);\n for(m = 0;m < 48;m ++){\n key[m] = keys[i][m];\n }\n var tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight),key))), tempLeft); \n for(n = 0;n < 32;n ++){\n ipRight[n] = tempRight[n];\n } \n \n } \n \n \n var finalData =new Array(64);\n for(i = 0;i < 32;i ++){\n finalData[i] = ipRight[i];\n finalData[32+i] = ipLeft[i];\n }\n return finallyPermute(finalData); \n}", "title": "" }, { "docid": "be7b459b91086e0837798f071d376223", "score": "0.5627285", "text": "function multipl(x, y) {\r\n return x * y;\r\n }", "title": "" }, { "docid": "c0a71cbbd64e9fbdc670690f6f87c843", "score": "0.5620228", "text": "function interlace(x, y) {\n x = (x | (x << 8)) & 0x00ff00ff;\n x = (x | (x << 4)) & 0x0f0f0f0f;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n y = (y | (y << 8)) & 0x00ff00ff;\n y = (y | (y << 4)) & 0x0f0f0f0f;\n y = (y | (y << 2)) & 0x33333333;\n y = (y | (y << 1)) & 0x55555555;\n return (x << 1) | y;\n }", "title": "" }, { "docid": "237401c74d5f66564558db2744a542b9", "score": "0.558314", "text": "function x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[0] += m[0] * n[3] + m[1] * n[2] + m[2] * n[1] + m[3] * n[0];\n o[0] &= 0xffff;\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n }", "title": "" }, { "docid": "663d77f1bfef2e9b3b429e0423da009e", "score": "0.55818504", "text": "function fnv_multiply(a) {\n return a + (a << 1) + (a << 4) + (a << 7) + (a << 8) + (a << 24);\n }", "title": "" }, { "docid": "663d77f1bfef2e9b3b429e0423da009e", "score": "0.55818504", "text": "function fnv_multiply(a) {\n return a + (a << 1) + (a << 4) + (a << 7) + (a << 8) + (a << 24);\n }", "title": "" }, { "docid": "ab2484f0248c45c5886189f10381f2a1", "score": "0.5561504", "text": "function x64Multiply(m, n) {\n m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n var o = [0, 0, 0, 0];\n o[3] += m[3] * n[3];\n o[2] += o[3] >>> 16;\n o[3] &= 0xffff;\n o[2] += m[2] * n[3];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[2] += m[3] * n[2];\n o[1] += o[2] >>> 16;\n o[2] &= 0xffff;\n o[1] += m[1] * n[3];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[2] * n[2];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n o[1] += m[3] * n[1];\n o[0] += o[1] >>> 16;\n o[1] &= 0xffff;\n\n return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n}", "title": "" }, { "docid": "92e83d3b2899810b68941bc4aeadc06e", "score": "0.5560125", "text": "function h$ghcjsbn_mulTo_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mulTo_bb b2\");\n var t = h$ghcjsbn_mul_bb(b1, b2);\n h$ghcjsbn_copy(b1, t);\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb result\");\n}", "title": "" }, { "docid": "92e83d3b2899810b68941bc4aeadc06e", "score": "0.5560125", "text": "function h$ghcjsbn_mulTo_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mulTo_bb b2\");\n var t = h$ghcjsbn_mul_bb(b1, b2);\n h$ghcjsbn_copy(b1, t);\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb result\");\n}", "title": "" }, { "docid": "92e83d3b2899810b68941bc4aeadc06e", "score": "0.5560125", "text": "function h$ghcjsbn_mulTo_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mulTo_bb b2\");\n var t = h$ghcjsbn_mul_bb(b1, b2);\n h$ghcjsbn_copy(b1, t);\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb result\");\n}", "title": "" }, { "docid": "92e83d3b2899810b68941bc4aeadc06e", "score": "0.5560125", "text": "function h$ghcjsbn_mulTo_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mulTo_bb b2\");\n var t = h$ghcjsbn_mul_bb(b1, b2);\n h$ghcjsbn_copy(b1, t);\n h$ghcjsbn_assertValid_b(b1, \"mulTo_bb result\");\n}", "title": "" }, { "docid": "d971e8f49659c050deebcce23dba3c34", "score": "0.55528307", "text": "function U8Mix(a, b, x) {\n return (x == 255)? b : x * b + (255 - x) * a >> 8;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "de9c38390c053a91aa0916b93b28edb5", "score": "0.55372226", "text": "function pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "acc55f8e5567818197b6ea4e553b6cba", "score": "0.55370176", "text": "function add(x, y)\r\n{\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n}", "title": "" }, { "docid": "a2f5e6dffeb8dfca694ac4389bec6be3", "score": "0.5536601", "text": "function pointFpMultiplyTwo(j,x,k) {\r\n var i;\r\n if(j.bitLength() > k.bitLength())\r\n i = j.bitLength() - 1;\r\n else\r\n i = k.bitLength() - 1;\r\n\r\n var R = this.curve.getInfinity();\r\n var both = this.add(x);\r\n while(i >= 0) {\r\n R = R.twice();\r\n if(j.testBit(i)) {\r\n if(k.testBit(i)) {\r\n R = R.add(both);\r\n }\r\n else {\r\n R = R.add(this);\r\n }\r\n }\r\n else {\r\n if(k.testBit(i)) {\r\n R = R.add(x);\r\n }\r\n }\r\n --i;\r\n }\r\n\r\n return R;\r\n}", "title": "" }, { "docid": "801e9245bc5a6989a301b1ed3039fe87", "score": "0.5524628", "text": "function ml_z_of_bits(z1, z2) {\n\n}", "title": "" }, { "docid": "0aa03bdb5ef2764f960123e887f53479", "score": "0.5522154", "text": "function fnv_multiply(a) {\n return a + (a << 1) + (a << 4) + (a << 7) + (a << 8) + (a << 24);\n }", "title": "" }, { "docid": "f3a27aea8977f16ee1d9ea426b9770ff", "score": "0.55192286", "text": "function multiply (x,y) {\n\treturn x * y ;\n}", "title": "" }, { "docid": "7c736bf3a983c222217d2cc33abf8e0e", "score": "0.550848", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "7c736bf3a983c222217d2cc33abf8e0e", "score": "0.550848", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "0c6e0f0aff46ef961da0a1f22c3f91fa", "score": "0.5496013", "text": "function pointFpMultiplyTwo(j, x, k) {\n var i;\n if (j.bitLength() > k.bitLength()) i = j.bitLength() - 1;else i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while (i >= 0) {\n R = R.twice();\n if (j.testBit(i)) {\n if (k.testBit(i)) {\n R = R.add(both);\n } else {\n R = R.add(this);\n }\n } else {\n if (k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "0c6e0f0aff46ef961da0a1f22c3f91fa", "score": "0.5496013", "text": "function pointFpMultiplyTwo(j, x, k) {\n var i;\n if (j.bitLength() > k.bitLength()) i = j.bitLength() - 1;else i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while (i >= 0) {\n R = R.twice();\n if (j.testBit(i)) {\n if (k.testBit(i)) {\n R = R.add(both);\n } else {\n R = R.add(this);\n }\n } else {\n if (k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}", "title": "" }, { "docid": "2b5360bed6dec8854474982854328441", "score": "0.5493374", "text": "function add(x, y){\r\n\t\t\t\tvar lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n\t\t\t\tvar msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n\t\t\t\treturn (msw << 16) | (lsw & 0xFFFF);\r\n\t\t\t}", "title": "" }, { "docid": "fef9876dd79f518be6a1f8140ecebe1b", "score": "0.54845214", "text": "function enc(dataByte,keyByte){\n var keys = generateKeys(keyByte);\n var ipByte = initPermute(dataByte);\n var ipLeft = new Array(32);\n var ipRight = new Array(32);\n var tempLeft = new Array(32);\n var i = 0,j = 0,k = 0,m = 0, n = 0;\n for(k = 0;k < 32;k ++){\n ipLeft[k] = ipByte[k];\n ipRight[k] = ipByte[32+k];\n }\n for(i = 0;i < 16;i ++){\n for(j = 0;j < 32;j ++){\n tempLeft[j] = ipLeft[j];\n ipLeft[j] = ipRight[j];\n }\n var key = new Array(48);\n for(m = 0;m < 48;m ++){\n key[m] = keys[i][m];\n }\n var tempRight = xor(pPermute(sBoxPermute(xor(expandPermute(ipRight),key))), tempLeft);\n for(n = 0;n < 32;n ++){\n ipRight[n] = tempRight[n];\n }\n\n }\n\n\n var finalData =new Array(64);\n for(i = 0;i < 32;i ++){\n finalData[i] = ipRight[i];\n finalData[32+i] = ipLeft[i];\n }\n return finallyPermute(finalData);\n}", "title": "" }, { "docid": "6dd1a332f2db5428ebf59d674f23d96c", "score": "0.5482676", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "6dd1a332f2db5428ebf59d674f23d96c", "score": "0.5482676", "text": "function add(x, y)\n{\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "11f50e05637d3a52574196660b30336e", "score": "0.54652506", "text": "function add(x, y) {\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\r\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n }", "title": "" }, { "docid": "44d777a63686099599c78e52b28e7ebe", "score": "0.5463667", "text": "function P32inv(x, y)\n{\n\ty[4] ^= x[0];\n\ty[5] ^= x[1];\n\ty[6] ^= x[2];\n\ty[7] ^= x[3];\n\n\ty[0] ^= x[4];\n\ty[1] ^= x[5];\n\ty[2] ^= x[6];\n\ty[3] ^= x[7];\n\n\tx[4] ^= y[4];\n\tx[5] ^= y[5];\n\tx[6] ^= y[6];\n\tx[7] ^= y[7];\n\n\tx[0] ^= y[0];\n\tx[1] ^= y[1];\n\tx[2] ^= y[2];\n\tx[3] ^= y[3];\n}", "title": "" }, { "docid": "dd23c119e8472fde51feae42a51e0fc2", "score": "0.54633015", "text": "function add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "dd23c119e8472fde51feae42a51e0fc2", "score": "0.54633015", "text": "function add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n}", "title": "" }, { "docid": "be582c51966047b5490b1832b2d82675", "score": "0.5443941", "text": "function GF256( primitive)\r\n{\r\n\tthis.expTable = new Array(256);\r\n\tthis.logTable = new Array(256);\r\n\tvar x = 1;\r\n\tfor (var i = 0; i < 256; i++)\r\n\t{\r\n\t\tthis.expTable[i] = x;\r\n\t\tx <<= 1; // x = x * 2; we're assuming the generator alpha is 2\r\n\t\tif (x >= 0x100)\r\n\t\t{\r\n\t\t\tx ^= primitive;\r\n\t\t}\r\n\t}\r\n\tfor (var i = 0; i < 255; i++)\r\n\t{\r\n\t\tthis.logTable[this.expTable[i]] = i;\r\n\t}\r\n\t// logTable[0] == 0 but this should never be used\r\n\tvar at0=new Array(1);at0[0]=0;\r\n\tthis.zero = new GF256Poly(this, new Array(at0));\r\n\tvar at1=new Array(1);at1[0]=1;\r\n\tthis.one = new GF256Poly(this, new Array(at1));\r\n\t\r\n\tthis.__defineGetter__(\"Zero\", function()\r\n\t{\r\n\t\treturn this.zero;\r\n\t});\r\n\tthis.__defineGetter__(\"One\", function()\r\n\t{\r\n\t\treturn this.one;\r\n\t});\r\n\tthis.buildMonomial=function( degree, coefficient)\r\n\t\t{\r\n\t\t\tif (degree < 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArgumentException\";\r\n\t\t\t}\r\n\t\t\tif (coefficient == 0)\r\n\t\t\t{\r\n\t\t\t\treturn zero;\r\n\t\t\t}\r\n\t\t\tvar coefficients = new Array(degree + 1);\r\n\t\t\tfor(var i=0;i<coefficients.length;i++)coefficients[i]=0;\r\n\t\t\tcoefficients[0] = coefficient;\r\n\t\t\treturn new GF256Poly(this, coefficients);\r\n\t\t}\r\n\tthis.exp=function( a)\r\n\t\t{\r\n\t\t\treturn this.expTable[a];\r\n\t\t}\r\n\tthis.log=function( a)\r\n\t\t{\r\n\t\t\tif (a == 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArgumentException\";\r\n\t\t\t}\r\n\t\t\treturn this.logTable[a];\r\n\t\t}\r\n\tthis.inverse=function( a)\r\n\t\t{\r\n\t\t\tif (a == 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArithmeticException\";\r\n\t\t\t}\r\n\t\t\treturn this.expTable[255 - this.logTable[a]];\r\n\t\t}\r\n\tthis.multiply=function( a, b)\r\n\t\t{\r\n\t\t\tif (a == 0 || b == 0)\r\n\t\t\t{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif (a == 1)\r\n\t\t\t{\r\n\t\t\t\treturn b;\r\n\t\t\t}\r\n\t\t\tif (b == 1)\r\n\t\t\t{\r\n\t\t\t\treturn a;\r\n\t\t\t}\r\n\t\t\treturn this.expTable[(this.logTable[a] + this.logTable[b]) % 255];\r\n\t\t}\t\t\r\n}", "title": "" }, { "docid": "fc7daa0beb9d35b7770e917c1a2d0bde", "score": "0.5441892", "text": "function multiply(x, y) {\n // base\n if (y === 0) return 0;\n \n return x + multiply(x, y-1);\n}", "title": "" }, { "docid": "86d7dd7aa82ec9a026614c0e683183a6", "score": "0.5440765", "text": "function GF256( primitive)\r\n{\r\n\tthis.expTable = new Array(256);\r\n\tthis.logTable = new Array(256);\r\n\tvar x = 1;\r\n\tfor (var i = 0; i < 256; i++)\r\n\t{\r\n\t\tthis.expTable[i] = x;\r\n\t\tx <<= 1; // x = x * 2; we're assuming the generator alpha is 2\r\n\t\tif (x >= 0x100)\r\n\t\t{\r\n\t\t\tx ^= primitive;\r\n\t\t}\r\n\t}\r\n\tfor (var i = 0; i < 255; i++)\r\n\t{\r\n\t\tthis.logTable[this.expTable[i]] = i;\r\n\t}\r\n\t// logTable[0] == 0 but this should never be used\r\n\tvar at0=new Array(1);at0[0]=0;\r\n\tthis.zero = new GF256Poly(this, new Array(at0));\r\n\tvar at1=new Array(1);at1[0]=1;\r\n\tthis.one = new GF256Poly(this, new Array(at1));\r\n\t\r\n\tthis.__defineGetter__(\"Zero\", function()\r\n\t{\r\n\t\treturn this.zero;\r\n\t});\r\n\tthis.__defineGetter__(\"One\", function()\r\n\t{\r\n\t\treturn this.one;\r\n\t});\r\n\tthis.buildMonomial=function( degree, coefficient)\r\n\t\t{\r\n\t\t\tif (degree < 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArgumentException\";\r\n\t\t\t}\r\n\t\t\tif (coefficient == 0)\r\n\t\t\t{\r\n\t\t\t\treturn this.zero;\r\n\t\t\t}\r\n\t\t\tvar coefficients = new Array(degree + 1);\r\n\t\t\tfor(var i=0;i<coefficients.length;i++)coefficients[i]=0;\r\n\t\t\tcoefficients[0] = coefficient;\r\n\t\t\treturn new GF256Poly(this, coefficients);\r\n\t\t}\r\n\tthis.exp=function( a)\r\n\t\t{\r\n\t\t\treturn this.expTable[a];\r\n\t\t}\r\n\tthis.log=function( a)\r\n\t\t{\r\n\t\t\tif (a == 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArgumentException\";\r\n\t\t\t}\r\n\t\t\treturn this.logTable[a];\r\n\t\t}\r\n\tthis.inverse=function( a)\r\n\t\t{\r\n\t\t\tif (a == 0)\r\n\t\t\t{\r\n\t\t\t\tthrow \"System.ArithmeticException\";\r\n\t\t\t}\r\n\t\t\treturn this.expTable[255 - this.logTable[a]];\r\n\t\t}\r\n\tthis.multiply=function( a, b)\r\n\t\t{\r\n\t\t\tif (a == 0 || b == 0)\r\n\t\t\t{\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t\tif (a == 1)\r\n\t\t\t{\r\n\t\t\t\treturn b;\r\n\t\t\t}\r\n\t\t\tif (b == 1)\r\n\t\t\t{\r\n\t\t\t\treturn a;\r\n\t\t\t}\r\n\t\t\treturn this.expTable[(this.logTable[a] + this.logTable[b]) % 255];\r\n\t\t}\t\t\r\n}", "title": "" }, { "docid": "980972d704d5296f0157408ed61f6351", "score": "0.5438631", "text": "function P32(x, y)\n{\n\tx[0] ^= y[0];\n\tx[1] ^= y[1];\n\tx[2] ^= y[2];\n\tx[3] ^= y[3];\n\n\tx[4] ^= y[4];\n\tx[5] ^= y[5];\n\tx[6] ^= y[6];\n\tx[7] ^= y[7];\n\n\ty[0] ^= x[4];\n\ty[1] ^= x[5];\n\ty[2] ^= x[6];\n\ty[3] ^= x[7];\n\n\ty[4] ^= x[0];\n\ty[5] ^= x[1];\n\ty[6] ^= x[2];\n\ty[7] ^= x[3];\n}", "title": "" }, { "docid": "bbf42e405dad5580e92439d9b0f36019", "score": "0.5438039", "text": "function add(x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF);\n var msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n }", "title": "" }, { "docid": "99b4007e2df86c47823a0fecbe4dca0f", "score": "0.54292417", "text": "function multiply (x,y){\n\treturn x*y;\n}", "title": "" }, { "docid": "609513f2c6ca838ad4f0d63d6eda410a", "score": "0.54281664", "text": "function multiply(x, y) {\r\n return x * y;\r\n }", "title": "" }, { "docid": "de3bd0175b8f6da8f8dd4f8264c619c4", "score": "0.5427611", "text": "function bilinear( x1, x2, y1, y2, z11, z12, z21, z22, x, y ) {\n\n\tlet [ b00, b10, b01, b11 ] =\n\t\tbilinearCoeffs( x1, x2, y1, y2, z11, z12, z21, z22 );\n\tlet fromCoeffs = b00 + b10 * x + b01 * y + b11 * x * y;\n\n\t//The following is supposed to be equivalent. Some tests yielding identical results (and no tests so far yielding different results) suggest that the calculations are in fact equivalent.\n\t/*let mux = (x-x1)/(x2-x1);\n\tlet muy = (y-y1)/(y2-y1);\n\tlet fromUnitSquare = bilinearUnitSquare(z11, z12, z21, z22, mux, muy);\n\n\tconsole.log(\"fromCoeffs=\", fromCoeffs, \", fromUnitSquare=\", fromUnitSquare);*/\n\n\treturn fromCoeffs;\n\n}", "title": "" }, { "docid": "c5b4a874c488c9d5cf2e8ebee9c408f4", "score": "0.5419752", "text": "function egcd32(x, y, a, b)\r\n{\r\n var i, an, bn = 32, qn;\r\n for (i = 0; i < 32; i++) {\r\n x[i] = y[i] = 0;\r\n\t}\r\n x[0] = 1;\r\n an = numsize(a, 32);\r\n if (an==0) {\r\n return y;\t/* division by zero */\r\n\t}\r\n\r\n var temp = new Uint8Array(32);\r\n while (1)\r\n {\r\n qn = bn - an + 1;\r\n divmod(temp, b, bn, a, an);\r\n bn = numsize(b, bn);\r\n if (bn==0) {\r\n\t return x;\r\n\t\t}\r\n mula32(y, x, temp, qn, -1);\r\n\r\n qn = an - bn + 1;\r\n divmod(temp, a, an, b, bn);\r\n an = numsize(a, an);\r\n if (an==0) {\r\n\t return y;\r\n\t\t}\r\n mula32(x, y, temp, qn, -1);\r\n }\r\n\treturn undefined;\r\n}", "title": "" }, { "docid": "3ee4b5a37693e8d6fedf1876053e1eb0", "score": "0.5419639", "text": "function UInt64_add (x, y) {\n\n var output = new UInt64_t(0, 0);\n\n // The operations will be performed on four 2-byte (16-bit) half-words.\n // This will allow us to left-shift the values by 16-bits while avoiding\n // overflow in the later operations.\n var hw = new Array (4);\n\n // The (hw[(0...2)] >>> 16) operations handle the carry operation.\n // (Recall: '>>>' is the zero-fill right-shift operator.)\n hw[0] = (x.lo & 0xffff) + (y.lo & 0xffff);\n hw[1] = (x.lo >>> 16) + (y.lo >>> 16) + (hw[0] >>> 16);\n hw[2] = (x.hi & 0xffff) + (y.hi & 0xffff) + (hw[1] >>> 16);\n hw[3] = (x.hi >>> 16) + (y.hi >>> 16) + (hw[2] >>> 16);\n\n // Concatenate the half-words into the 64-bit integer.\n output.hi = (hw[3] << 16) | (hw[2] & 0xffff);\n output.lo = (hw[1] << 16) | (hw[0] & 0xffff);\n\n return output;\n}", "title": "" }, { "docid": "7116e18dc2225fb372d390748f26cfd7", "score": "0.541678", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "7116e18dc2225fb372d390748f26cfd7", "score": "0.541678", "text": "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "title": "" }, { "docid": "3e113c397a813ff62cb4ee0015756a2e", "score": "0.53827256", "text": "function h$ghcjsbn_mul_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mul_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mul_bb b2\");\n var l1 = b1[0], l2 = b2[0];\n/* if(l1 > 50 && l2 > 50) {\n return h$ghcjsbn_mul_karatsuba_bb(b1, b2);\n } fixme update this */\n var n = l1 + l2, i, t = [0];\n for(i = 1; i <= n; i++) t[i] = 0;\n if(l1 > l2) {\n for(i = 0; i < l2; i++) {\n t[i + l1 + 1] = h$ghcjsbn_mul_limb(0, b1, b2[i+1], t, i, 0, l1);\n }\n } else {\n for(i = 0; i < l1; i++) {\n t[i + l2 + 1] = h$ghcjsbn_mul_limb(0, b2, b1[i+1], t, i, 0, l2);\n }\n }\n for(i = l1 + l2; i > 0 && t[i] === 0; i--);\n t[0] = i;\n h$ghcjsbn_assertValid_b(t, \"mul_bb result\");\n return t;\n}", "title": "" }, { "docid": "3e113c397a813ff62cb4ee0015756a2e", "score": "0.53827256", "text": "function h$ghcjsbn_mul_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mul_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mul_bb b2\");\n var l1 = b1[0], l2 = b2[0];\n/* if(l1 > 50 && l2 > 50) {\n return h$ghcjsbn_mul_karatsuba_bb(b1, b2);\n } fixme update this */\n var n = l1 + l2, i, t = [0];\n for(i = 1; i <= n; i++) t[i] = 0;\n if(l1 > l2) {\n for(i = 0; i < l2; i++) {\n t[i + l1 + 1] = h$ghcjsbn_mul_limb(0, b1, b2[i+1], t, i, 0, l1);\n }\n } else {\n for(i = 0; i < l1; i++) {\n t[i + l2 + 1] = h$ghcjsbn_mul_limb(0, b2, b1[i+1], t, i, 0, l2);\n }\n }\n for(i = l1 + l2; i > 0 && t[i] === 0; i--);\n t[0] = i;\n h$ghcjsbn_assertValid_b(t, \"mul_bb result\");\n return t;\n}", "title": "" }, { "docid": "3e113c397a813ff62cb4ee0015756a2e", "score": "0.53827256", "text": "function h$ghcjsbn_mul_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mul_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mul_bb b2\");\n var l1 = b1[0], l2 = b2[0];\n/* if(l1 > 50 && l2 > 50) {\n return h$ghcjsbn_mul_karatsuba_bb(b1, b2);\n } fixme update this */\n var n = l1 + l2, i, t = [0];\n for(i = 1; i <= n; i++) t[i] = 0;\n if(l1 > l2) {\n for(i = 0; i < l2; i++) {\n t[i + l1 + 1] = h$ghcjsbn_mul_limb(0, b1, b2[i+1], t, i, 0, l1);\n }\n } else {\n for(i = 0; i < l1; i++) {\n t[i + l2 + 1] = h$ghcjsbn_mul_limb(0, b2, b1[i+1], t, i, 0, l2);\n }\n }\n for(i = l1 + l2; i > 0 && t[i] === 0; i--);\n t[0] = i;\n h$ghcjsbn_assertValid_b(t, \"mul_bb result\");\n return t;\n}", "title": "" }, { "docid": "3e113c397a813ff62cb4ee0015756a2e", "score": "0.53827256", "text": "function h$ghcjsbn_mul_bb(b1, b2) {\n h$ghcjsbn_assertValid_b(b1, \"mul_bb b1\");\n h$ghcjsbn_assertValid_b(b2, \"mul_bb b2\");\n var l1 = b1[0], l2 = b2[0];\n/* if(l1 > 50 && l2 > 50) {\n return h$ghcjsbn_mul_karatsuba_bb(b1, b2);\n } fixme update this */\n var n = l1 + l2, i, t = [0];\n for(i = 1; i <= n; i++) t[i] = 0;\n if(l1 > l2) {\n for(i = 0; i < l2; i++) {\n t[i + l1 + 1] = h$ghcjsbn_mul_limb(0, b1, b2[i+1], t, i, 0, l1);\n }\n } else {\n for(i = 0; i < l1; i++) {\n t[i + l2 + 1] = h$ghcjsbn_mul_limb(0, b2, b1[i+1], t, i, 0, l2);\n }\n }\n for(i = l1 + l2; i > 0 && t[i] === 0; i--);\n t[0] = i;\n h$ghcjsbn_assertValid_b(t, \"mul_bb result\");\n return t;\n}", "title": "" }, { "docid": "fb341d7f3eea06c8bbb37dac59340ba3", "score": "0.538107", "text": "function node_u8xor(a,b) {\n\tlet buf = Buffer.from(a, 'utf8');\n\tif( !b.keybuf ) { /*console.trace( \"Key needs buf....\" );*/ b.keybuf = Buffer.from( b.key, 'utf8' ); }\n\tlet c = b.keybuf;//Buffer.from(b.key, 'utf8');\n\t//var buf = TE.encode(a);\n\tlet outBuf = new Buffer( buf.length );\n\tlet o = b.step;\n\tb.step += buf.length;\n\tlet keylen = b.key.length-5;\n\tb.step %= keylen;\n\tlet _mask = 0x3F;\n\tlet l = 0;\n //console.log( \"Decode length:\", buf.length );\n\tfor( var n = 0; n < buf.length; n++ ) {\n\t\tlet v = buf[n];\n\t\tlet mask = _mask;\n\n\t\tif( (v & 0x80) == 0x00 ) { if( l ) throw new Error( \"short utf8 sequence found\" ); mask=0x3f; _mask = 0x3f; }\n\t\telse if( (v & 0xC0) == 0x80 ) { if( !l ) throw new Error( \"invalid utf8 sequence\" ); l--; _mask = 0x3f; }\n\t\telse if( (v & 0xE0) == 0xC0 ) { if( l ) throw new Error( \"short utf8 sequence found\" ); l = 1; mask=0x1;_mask = 0x3f; } // 6 + 1 == 7\n\t\telse if( (v & 0xF0) == 0xE0 ) { if( l ) throw new Error( \"short utf8 sequence found\" ); l = 2; mask=0; _mask = 0x1f; } // 6 + 5 + 0 == 11 \n\t\telse if( (v & 0xF8) == 0xF0 ) { if( l ) throw new Error( \"short utf8 sequence found\" ); l = 3; mask=0; _mask = 0x0f; } // 6(2) + 4 + 0 == 16\n\t\telse if( (v & 0xFC) == 0xF8 ) { if( l ) throw new Error( \"short utf8 sequence found\" ); l = 4; mask=0; _mask = 0x07; } // 6(3) + 3 + 0 == 21\n\t\telse if( (v & 0xFE) == 0xFC ) { if( l ) throw new Error( \"short utf8 sequence found\" ); l = 5; mask=0; _mask = 0x03; } // 6(4) + 2 + 0 == 26\n\n\t\tif( mask )\n\t\t\toutBuf[n] = (v & ~mask ) | ( u8xor_code_encodings2[ ((v & mask)<<7) + (c[(n+o)%(keylen)]) ] & mask )\n\t\telse\n\t\t\toutBuf[n] = v;\n\t}\n\treturn outBuf.toString( \"utf8\" );\n}", "title": "" }, { "docid": "8c0930b1883aae5fae268e0bfd2ab714", "score": "0.5375557", "text": "function pow(x, y) {\n let res = 1\n for (let i = 0; i < y; i++) {\n res *= x\n }\n return res\n}", "title": "" }, { "docid": "5dd7ad1766cc30392382597d76fd1e6f", "score": "0.53733325", "text": "function enc8(text) {\n\t\t\tvar i = 0, b = text.slice(), fval, keysi = 0,\n\t\t\t\tl, r, x; // left, right, accumulator\n\n\t\t\t// Squash 8 bytes to 2 ints\n\t\t\tl = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];\n\t\t\tr = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];\n\n\t\t\tx = ((l >>> 4) ^ r) & 0x0f0f0f0f;\n\t\t\tr ^= x;\n\t\t\tl ^= (x << 4);\n\t\t\tx = ((l >>> 16) ^ r) & 0x0000ffff;\n\t\t\tr ^= x;\n\t\t\tl ^= (x << 16);\n\t\t\tx = ((r >>> 2) ^ l) & 0x33333333;\n\t\t\tl ^= x;\n\t\t\tr ^= (x << 2);\n\t\t\tx = ((r >>> 8) ^ l) & 0x00ff00ff;\n\t\t\tl ^= x;\n\t\t\tr ^= (x << 8);\n\t\t\tr = (r << 1) | ((r >>> 31) & 1);\n\t\t\tx = (l ^ r) & 0xaaaaaaaa;\n\t\t\tl ^= x;\n\t\t\tr ^= x;\n\t\t\tl = (l << 1) | ((l >>> 31) & 1);\n\n\t\t\tfor (i = 0; i < 8; ++i) {\n\t\t\t\tx = (r << 28) | (r >>> 4);\n\t\t\t\tx ^= keys[keysi++];\n\t\t\t\tfval = SP7[x & 0x3f];\n\t\t\t\tfval |= SP5[(x >>> 8) & 0x3f];\n\t\t\t\tfval |= SP3[(x >>> 16) & 0x3f];\n\t\t\t\tfval |= SP1[(x >>> 24) & 0x3f];\n\t\t\t\tx = r ^ keys[keysi++];\n\t\t\t\tfval |= SP8[x & 0x3f];\n\t\t\t\tfval |= SP6[(x >>> 8) & 0x3f];\n\t\t\t\tfval |= SP4[(x >>> 16) & 0x3f];\n\t\t\t\tfval |= SP2[(x >>> 24) & 0x3f];\n\t\t\t\tl ^= fval;\n\t\t\t\tx = (l << 28) | (l >>> 4);\n\t\t\t\tx ^= keys[keysi++];\n\t\t\t\tfval = SP7[x & 0x3f];\n\t\t\t\tfval |= SP5[(x >>> 8) & 0x3f];\n\t\t\t\tfval |= SP3[(x >>> 16) & 0x3f];\n\t\t\t\tfval |= SP1[(x >>> 24) & 0x3f];\n\t\t\t\tx = l ^ keys[keysi++];\n\t\t\t\tfval |= SP8[x & 0x0000003f];\n\t\t\t\tfval |= SP6[(x >>> 8) & 0x3f];\n\t\t\t\tfval |= SP4[(x >>> 16) & 0x3f];\n\t\t\t\tfval |= SP2[(x >>> 24) & 0x3f];\n\t\t\t\tr ^= fval;\n\t\t\t}\n\n\t\t\tr = (r << 31) | (r >>> 1);\n\t\t\tx = (l ^ r) & 0xaaaaaaaa;\n\t\t\tl ^= x;\n\t\t\tr ^= x;\n\t\t\tl = (l << 31) | (l >>> 1);\n\t\t\tx = ((l >>> 8) ^ r) & 0x00ff00ff;\n\t\t\tr ^= x;\n\t\t\tl ^= (x << 8);\n\t\t\tx = ((l >>> 2) ^ r) & 0x33333333;\n\t\t\tr ^= x;\n\t\t\tl ^= (x << 2);\n\t\t\tx = ((r >>> 16) ^ l) & 0x0000ffff;\n\t\t\tl ^= x;\n\t\t\tr ^= (x << 16);\n\t\t\tx = ((r >>> 4) ^ l) & 0x0f0f0f0f;\n\t\t\tl ^= x;\n\t\t\tr ^= (x << 4);\n\n\t\t\t// Spread ints to bytes\n\t\t\tx = [r, l];\n\t\t\tfor (i = 0; i < 8; i++) {\n\t\t\t\tb[i] = (x[i>>>2] >>> (8*(3 - (i%4)))) % 256;\n\t\t\t\tif (b[i] < 0) { b[i] += 256; } // unsigned\n\t\t\t}\n\t\t\treturn b;\n\t\t}", "title": "" }, { "docid": "3326a992876a09833968986ba88814a1", "score": "0.53603494", "text": "function powMod_(x, y, n) {\n var k1, k2, kn, np;\n if (s7.length !== n.length)\n s7 = dup(n);\n\n //for even modulus, use a simple square-and-multiply algorithm,\n //rather than using the more complex Montgomery algorithm.\n if ((n[0] & 1) === 0) {\n copy_(s7, x);\n copyInt_(x, 1);\n while (!equalsInt(y, 0)) {\n if (y[0] & 1)\n multMod_(x, s7, n);\n divInt_(y, 2);\n squareMod_(s7, n);\n }\n return;\n }\n\n //calculate np from n for the Montgomery multiplications\n copyInt_(s7, 0);\n for (kn = n.length; kn > 0 && !n[kn - 1]; kn--);\n np = radix - inverseModInt(modInt(n, radix), radix);\n s7[kn] = 1;\n multMod_(x, s7, n); // x = x * 2**(kn*bp) mod n\n\n if (s3.length !== x.length)\n s3 = dup(x);\n else\n copy_(s3, x);\n\n for (k1 = y.length - 1; k1 > 0 & !y[k1]; k1--); //k1=first nonzero element of y\n if (y[k1] === 0) { //anything to the 0th power is 1\n copyInt_(x, 1);\n return;\n }\n for (k2 = 1 << (bpe - 1); k2 && !(y[k1] & k2); k2 >>= 1); //k2=position of first 1 bit in y[k1]\n for (; ;) {\n if (!(k2 >>= 1)) { //look at next bit of y\n k1--;\n if (k1 < 0) {\n mont_(x, one, n, np);\n return;\n }\n k2 = 1 << (bpe - 1);\n }\n mont_(x, x, n, np);\n\n if (k2 & y[k1]) //if next bit is a 1\n mont_(x, s3, n, np);\n }\n }", "title": "" }, { "docid": "f64e47154c0f199fd886800c1d814843", "score": "0.53439456", "text": "function AxisMultiply(in1, in2, out) {\n\tout[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];\n\tout[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];\n\tout[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];\n\n\tout[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];\n\tout[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];\n\tout[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];\n\n\tout[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];\n\tout[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];\n\tout[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];\n}", "title": "" }, { "docid": "f64e47154c0f199fd886800c1d814843", "score": "0.53439456", "text": "function AxisMultiply(in1, in2, out) {\n\tout[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] + in1[0][2] * in2[2][0];\n\tout[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] + in1[0][2] * in2[2][1];\n\tout[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] + in1[0][2] * in2[2][2];\n\n\tout[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] + in1[1][2] * in2[2][0];\n\tout[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] + in1[1][2] * in2[2][1];\n\tout[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] + in1[1][2] * in2[2][2];\n\n\tout[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] + in1[2][2] * in2[2][0];\n\tout[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] + in1[2][2] * in2[2][1];\n\tout[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] + in1[2][2] * in2[2][2];\n}", "title": "" }, { "docid": "14391d51c734ff1dbb82ed7b9f8504e3", "score": "0.5340539", "text": "function mul2(first, second) {\r\n return _pushOperation(\"mul2\", [first, second]);\r\n}", "title": "" }, { "docid": "f3789f480fb83779ea84b7fb60003637", "score": "0.53370714", "text": "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "title": "" }, { "docid": "f3789f480fb83779ea84b7fb60003637", "score": "0.53370714", "text": "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "title": "" }, { "docid": "f3789f480fb83779ea84b7fb60003637", "score": "0.53370714", "text": "function bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}", "title": "" } ]
15dd29c29947e97fc9fcba590dceb19d
format date using native date object
[ { "docid": "2923086ff129513837f903d316046337", "score": "0.0", "text": "function formatMoment(m, format) {\n if (!m.isValid()) {\n return m.localeData().invalidDate();\n }\n\n format = expandFormat(format, m.localeData());\n formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);\n\n return formatFunctions[format](m);\n}", "title": "" } ]
[ { "docid": "6eba55e654070a28047bd4442b23aa8a", "score": "0.7389412", "text": "formatDate(date) {\n const d = new Date(date);\n let dd = d.getDate();\n if (dd < 10) dd = '0' + dd;\n\n let mm = d.getMonth() + 1;\n if (mm < 10) mm = '0' + mm;\n\n let yy = d.getFullYear();\n\n return dd + '.' + mm + '.' + yy;\n }", "title": "" }, { "docid": "e8caa73f6aca1571b48c4bcba35e6e46", "score": "0.7371435", "text": "function formatdate(date) {\n return new Date(date).toLocaleDateString();\n }", "title": "" }, { "docid": "fec8426e78480cd7b8249d49215f4932", "score": "0.7344133", "text": "formatDate(date, format) {\n if (!date) {\n return '';\n }\n\n let iFormat;\n const lookAhead = (match) => {\n const matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);\n if (matches) {\n iFormat++;\n }\n return matches;\n },\n formatNumber = (match, value, len) => {\n let num = '' + value;\n if (lookAhead(match)) {\n while (num.length < len) {\n num = '0' + num;\n }\n }\n return num;\n },\n formatName = (match, value, shortNames, longNames) => {\n return (lookAhead(match) ? longNames[value] : shortNames[value]);\n };\n let output = '';\n let literal = false;\n\n if (date) {\n for (iFormat = 0; iFormat < format.length; iFormat++) {\n if (literal) {\n if (format.charAt(iFormat) === '\\'' && !lookAhead('\\'')) {\n literal = false;\n } else {\n output += format.charAt(iFormat);\n }\n } else {\n switch (format.charAt(iFormat)) {\n case 'd':\n output += formatNumber('d', this.props.utc ? date.getUTCDate() : date.getDate(), 2);\n break;\n case 'D':\n output += formatName('D', this.props.utc ? date.getUTCDay() : date.getDay(), this.props.locale.dayNamesShort, this.props.locale.dayNames);\n break;\n case 'o':\n if (this.props.utc) {\n output += formatNumber('o',\n Math.round((\n new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()).getTime() -\n new Date(date.getUTCFullYear(), 0, 0).getTime()) / 86400000), 3);\n } else {\n output += formatNumber('o',\n Math.round((\n new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -\n new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);\n }\n break;\n case 'm':\n output += formatNumber('m', (this.props.utc ? date.getUTCMonth() : date.getMonth()) + 1, 2);\n break;\n case 'M':\n output += formatName('M', this.props.utc ? date.getUTCMonth() : date.getMonth(), this.props.locale.monthNamesShort, this.props.locale.monthNames);\n break;\n case 'y':\n output += (lookAhead('y') ? (this.props.utc ? date.getUTCFullYear() : date.getFullYear()) :\n ((this.props.utc ? date.getUTCFullYear() : date.getFullYear()) % 100 < 10 ? '0' : '') +\n (this.props.utc ? date.getUTCFullYear() : date.getFullYear()) % 100);\n break;\n case '@':\n output += date.getTime();\n break;\n case '!':\n output += date.getTime() * 10000 + this.ticksTo1970;\n break;\n case '\\'':\n if (lookAhead('\\'')) {\n output += '\\'';\n } else {\n literal = true;\n }\n break;\n default:\n output += format.charAt(iFormat);\n }\n }\n }\n }\n return output;\n\t}", "title": "" }, { "docid": "ed348a9446516d58a0d6ca589edd4111", "score": "0.73283625", "text": "function format(date) \n {\n date = new Date(date); \n var day = ('0' + date.getDate()).slice(-2);\n var month = ('0' + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear();\n return year + '-' + month + '-' + day;\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7292591", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "a4fc1d335d8683cfac98297d3990daf6", "score": "0.7292591", "text": "_format(dtf, date) {\n // Passing the year to the constructor causes year numbers <100 to be converted to 19xx.\n // To work around this we use `setUTCFullYear` and `setUTCHours` instead.\n const d = new Date();\n d.setUTCFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n d.setUTCHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());\n return dtf.format(d);\n }", "title": "" }, { "docid": "49741f79a55d46958cd16bf94903d7fd", "score": "0.7257251", "text": "function dateFormatter (date, format) {\n //return moment(new Date(date)).format(format);\n return date; // TODO\n }", "title": "" }, { "docid": "cb15e277cb3365b812dedea19c0fa935", "score": "0.7245657", "text": "function formatDate(date, format) {\n\t\tvar dd = date.getDate();\n\t\tvar mm = date.getMonth() + 1; //Jan = 0\n\t\tvar yyyy = date.getFullYear();\n\t\t\n\t\tif (dd < 10) {\n\t\t\tdd = '0' + dd;\n\t\t}\n\t\t\n\t\tif (mm < 10) {\n\t\t\tmm = '0' + mm;\n\t\t}\n\t\t\n\t\tif (format === 'display') {\n\t\t\treturn mm + '/' + dd + '/' + yyyy;\n\t\t}\n\t\t\n\t\treturn yyyy + '-' + mm + '-' + dd;\n\t}", "title": "" }, { "docid": "063752124628e76dbad57b668ce61196", "score": "0.72040653", "text": "function formatDate(date) {\n return date.toLocaleDateString();\n }", "title": "" }, { "docid": "643b492b3370374f1c6034381eb0537e", "score": "0.71712565", "text": "function formatDate(date) {\n\t\t\t\treturn new Intl.DateTimeFormat('en-US').format(date)\n\t\t\t}", "title": "" }, { "docid": "d5160ef9f85da8b83287909c77514a4c", "score": "0.71641886", "text": "function formatDate(date, format) {\n return date.format(format);\n }", "title": "" }, { "docid": "634e575c60bfa12b11ba04fbaa77635f", "score": "0.7162969", "text": "function formatDate(date) {\n return getTwoDigitsDate(date.getDate()) + '.' + getTwoDigitsDate(date.getMonth() + 1) + '.' + date.getFullYear() + ' ' + date.getHours() + ':' + getTwoDigitsDate(date.getMinutes());\n }", "title": "" }, { "docid": "1fb3c8a9eb185dab5fea01428aa024f4", "score": "0.7145033", "text": "static formatDate(date) {\n return moment_1.default(date).format(CLOCKIFY_DATE_FORMAT);\n }", "title": "" }, { "docid": "4eeeaca5024c18b1698ad446c38b0f31", "score": "0.71390396", "text": "function formatDate(date) {\n const dateObj = new Date(date);\n\n const dateString = dateObj.toLocaleDateString();\n\n return dateString\n}", "title": "" }, { "docid": "10afc74e0960fc419460e42df1c4728c", "score": "0.7130555", "text": "function formatDate(date){\n var dd = date.getDate();\n var mm = date.getMonth()+1;\n var yyyy = date.getFullYear();\n if(dd<10) {dd='0'+dd}\n if(mm<10) {mm='0'+mm}\n date = yyyy + '-' + mm +'-' + dd;\n return date\n }", "title": "" }, { "docid": "b587756b729237c30cfd82954fa01ea5", "score": "0.71117294", "text": "function formatDate(\n date = null // The date to format as YYYY-MM-DD, given as Date object\n)\n{\n var month = date.getUTCMonth() + 1; //months from 1-12\n var day = date.getUTCDate();\n var year = date.getUTCFullYear();\n date = year + \"-\" + \"0\"+month + \"-\" + day;\n return date;\n}", "title": "" }, { "docid": "d1ee90248587e2ca6fa2da196a85d812", "score": "0.71066177", "text": "function formatDate(date) {\n\n var dd = date.getDate(); \n if (dd < 10) dd = '0' + dd;\n\n var mm = date.getMonth() + 1; \n if (mm < 10) mm = '0' + mm;\n\n var yy = date.getFullYear(); \n\n return dd + '.' + mm + '.' + yy;\n}", "title": "" }, { "docid": "aa3a0134179f4246685e5cc44424b821", "score": "0.70885515", "text": "function formatDate(date) {\r\n var newDate = stringifyDate(date);\r\n if (newDate) {\r\n return newDate;\r\n }\r\n else {\r\n return date;\r\n }\r\n}", "title": "" }, { "docid": "ea03d52358b8fabcf7f2f712c56922c0", "score": "0.7084443", "text": "dateCustomFormat(date) {\n let stringDate = '';\n if (date) {\n stringDate += this.isNumber(date.month) ? this.padNumber(date.month) + '/' : '';\n stringDate += this.isNumber(date.day) ? this.padNumber(date.day) + '/' : '';\n stringDate += date.year;\n }\n return stringDate;\n }", "title": "" }, { "docid": "fc002b6821a4b497a5b23560f6546f73", "score": "0.7069754", "text": "_convertDateObjToString(obj){let date=\"\";if(obj&&obj.day&&obj.month&&obj.year){let month=obj.month+\"\",day=obj.day+\"\",year=obj.year+\"\";if(2>month.length){month=\"0\"+month}if(2>day.length){day=\"0\"+day}if(4>year.length){for(var l=4-year.length,i=0;i<l;i++){year=\"0\"+year}}date=year+\"-\"+month+\"-\"+day}return date}", "title": "" }, { "docid": "53500fea8c55a4a69909b24b3c7df8ae", "score": "0.70640457", "text": "formatDate(datenow){\n var date = new Date(datenow);\n var options = {\n year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric'\n };\n var result = date.toLocaleDateString('en', options);\n return result;\n }", "title": "" }, { "docid": "c1cdb2d96cce9103ff4a3fb69e104339", "score": "0.7064029", "text": "function formatDate(date) {\n\tvar dd = date.getDate();\n\tvar mm = date.getMonth() + 1;\n\tvar yyyy = date.getFullYear();\n\tif (dd < 10) {\n\t\tdd = '0' + dd;\n\t}\n\tif (mm < 10) {\n\t\tmm = '0' + mm;\n\t}\n\tdate = yyyy + '-' + mm + '-' + dd;\n\n\treturn date;\n}", "title": "" }, { "docid": "05ed2b7c5db85f2df515f94540b063d4", "score": "0.70579183", "text": "function formatDate(date) {\r\n date = new Date(date);\r\n\r\n let month = '' + (date.getMonth() + 1);\r\n let day = date.getDate() + '';\r\n let year = date.getFullYear();\r\n\r\n month = month.length < 2 ? '0' + month : month;\r\n day = day.length < 2 ? '0' + day : day;\r\n\r\n return `${year}-${month}-${day}`\r\n }", "title": "" }, { "docid": "d88825407455d59a48d8d1c3ea08701c", "score": "0.70449007", "text": "function formatDate(date){\n\t\t \t\t\t\tvar year = date.getFullYear().toString().slice(-2);\n\t\t \t\t\t\tvar time = date.toTimeString().slice(0,8);\n\t\t \t\t\t\treturn (date.getMonth()+1) + \"/\" + date.getDate() + \"/\" + year + \" \" +time;\n\t\t \t\t\t}", "title": "" }, { "docid": "8c2f00cdf9a2cab460ebcc7095500ef3", "score": "0.7040074", "text": "function formatDate(dateObj){\r\n\tvar months = new Array(\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\");\r\n\tvar month = months[dateObj.getMonth()];\r\n\tvar day = padString(dateObj.getDate(),2);\r\n\t\r\n//\treturn hours + \":\" + minutes + \":\" + seconds + meridian;\r\n\treturn month + \". \" + day;\r\n}", "title": "" }, { "docid": "153b0e529d033df9cf87c2c7f1bf0a6f", "score": "0.7039222", "text": "function formatDate(date) {\n return date.toLocaleDateString();\n}", "title": "" }, { "docid": "5de77b5d9419f495ca037db57d878335", "score": "0.7031887", "text": "function formatDate(date) {\n return format({\n value: date,\n type: formatter.Type.DATE\n });\n }", "title": "" }, { "docid": "6fb72b2b2df39391b28ac74e11292244", "score": "0.7031037", "text": "_turnDateToString(date){\n date = date.toLocaleDateString();\n return date;\n }", "title": "" }, { "docid": "d668d6abef7c13ccf1260a1b6c9328b4", "score": "0.69975114", "text": "function formatDate(date) {\n const d = new Date(date)\n const options = { year: 'numeric', month: 'long', day: 'numeric' }\n return (\n `${d.toLocaleDateString('en-US', options)}`\n )\n }", "title": "" }, { "docid": "b5342dcda80a9f02d04fe781d4f9bae5", "score": "0.69866616", "text": "static formatDate(date, format) {\n if (!format) {\n format = DateUtil.defaultFormat\n }\n if (date) {\n if (date instanceof Date) {\n return moment(date.getTime()).format(format);\n } else if (date instanceof moment) {\n return date.format(format);\n }\n } else {\n return undefined;\n }\n }", "title": "" }, { "docid": "2e9227e4568a4ef145b401a69b92ffbe", "score": "0.69866395", "text": "function format(d) {\n\t\treturn d.getUTCFullYear() + '-' + pad(1 + d.getUTCMonth()) + '-' + pad(d.getUTCDate());\n\t}", "title": "" }, { "docid": "17131cad5cab3a4e748bf12ab4deba16", "score": "0.69807124", "text": "function formatDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n return dd + '/' + mm + '/' + yyyy;\n}", "title": "" }, { "docid": "b56467ef15ff3426b93f8d41b43478c0", "score": "0.6977076", "text": "formatDate() {\n let d = new Date(), formatDateVal = [this.formatNumber(d.getFullYear()), this.formatNumber(('' + (d.getMonth() + 1))), this.formatNumber(('' + d.getDate()))], formatTimeval = [this.formatNumber(('' + d.getHours())), this.formatNumber(('' + d.getMinutes())), this.formatNumber(('' + d.getSeconds()))];\n return formatDateVal.join('-') + ' ' + formatTimeval.join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6972984", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6972984", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "53f4b12cc05f48fbe298003d49d4d3bf", "score": "0.6972984", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n \n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "149391b3e22fa5d490a882ebf4b2b59d", "score": "0.69693923", "text": "function getFormattedDate(date){\r\n\treturn \"'\"+date.getFullYear()+'-'+ (date.getMonth()+1)+'-'+date.getDate()+\"'\";\r\n}", "title": "" }, { "docid": "a25196e6a644ad46167886fdf8789f83", "score": "0.6965176", "text": "function formatDate(date, format, utc) {\n var MMMM = [\"\\x00\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var MMM = [\"\\x01\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n var dddd = [\"\\x02\", \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n var ddd = [\"\\x03\", \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\n function ii(i, len) {\n var s = i + \"\";\n len = len || 2;\n while (s.length < len) s = \"0\" + s;\n return s;\n }\n\n var y = utc ? date.getUTCFullYear() : date.getFullYear();\n format = format.replace(/(^|[^\\\\])yyyy+/g, \"$1\" + y);\n format = format.replace(/(^|[^\\\\])yy/g, \"$1\" + y.toString().substr(2, 2));\n format = format.replace(/(^|[^\\\\])y/g, \"$1\" + y);\n\n var M = (utc ? date.getUTCMonth() : date.getMonth()) + 1;\n format = format.replace(/(^|[^\\\\])MMMM+/g, \"$1\" + MMMM[0]);\n format = format.replace(/(^|[^\\\\])MMM/g, \"$1\" + MMM[0]);\n format = format.replace(/(^|[^\\\\])MM/g, \"$1\" + ii(M));\n format = format.replace(/(^|[^\\\\])M/g, \"$1\" + M);\n\n var d = utc ? date.getUTCDate() : date.getDate();\n format = format.replace(/(^|[^\\\\])dddd+/g, \"$1\" + dddd[0]);\n format = format.replace(/(^|[^\\\\])ddd/g, \"$1\" + ddd[0]);\n format = format.replace(/(^|[^\\\\])dd/g, \"$1\" + ii(d));\n format = format.replace(/(^|[^\\\\])d/g, \"$1\" + d);\n\n var H = utc ? date.getUTCHours() : date.getHours();\n format = format.replace(/(^|[^\\\\])HH+/g, \"$1\" + ii(H));\n format = format.replace(/(^|[^\\\\])H/g, \"$1\" + H);\n\n var h = H > 12 ? H - 12 : H == 0 ? 12 : H;\n format = format.replace(/(^|[^\\\\])hh+/g, \"$1\" + ii(h));\n format = format.replace(/(^|[^\\\\])h/g, \"$1\" + h);\n\n var m = utc ? date.getUTCMinutes() : date.getMinutes();\n format = format.replace(/(^|[^\\\\])mm+/g, \"$1\" + ii(m));\n format = format.replace(/(^|[^\\\\])m/g, \"$1\" + m);\n\n var s = utc ? date.getUTCSeconds() : date.getSeconds();\n format = format.replace(/(^|[^\\\\])ss+/g, \"$1\" + ii(s));\n format = format.replace(/(^|[^\\\\])s/g, \"$1\" + s);\n\n var f = utc ? date.getUTCMilliseconds() : date.getMilliseconds();\n format = format.replace(/(^|[^\\\\])fff+/g, \"$1\" + ii(f, 3));\n f = Math.round(f / 10);\n format = format.replace(/(^|[^\\\\])ff/g, \"$1\" + ii(f));\n f = Math.round(f / 10);\n format = format.replace(/(^|[^\\\\])f/g, \"$1\" + f);\n\n var T = H < 12 ? \"AM\" : \"PM\";\n format = format.replace(/(^|[^\\\\])TT+/g, \"$1\" + T);\n format = format.replace(/(^|[^\\\\])T/g, \"$1\" + T.charAt(0));\n\n var t = T.toLowerCase();\n format = format.replace(/(^|[^\\\\])tt+/g, \"$1\" + t);\n format = format.replace(/(^|[^\\\\])t/g, \"$1\" + t.charAt(0));\n\n var tz = -date.getTimezoneOffset();\n var K = utc || !tz ? \"Z\" : tz > 0 ? \"+\" : \"-\";\n if (!utc) {\n tz = Math.abs(tz);\n var tzHrs = Math.floor(tz / 60);\n var tzMin = tz % 60;\n K += ii(tzHrs) + \":\" + ii(tzMin);\n }\n format = format.replace(/(^|[^\\\\])K/g, \"$1\" + K);\n\n var day = (utc ? date.getUTCDay() : date.getDay()) + 1;\n format = format.replace(new RegExp(dddd[0], \"g\"), dddd[day]);\n format = format.replace(new RegExp(ddd[0], \"g\"), ddd[day]);\n\n format = format.replace(new RegExp(MMMM[0], \"g\"), MMMM[M]);\n format = format.replace(new RegExp(MMM[0], \"g\"), MMM[M]);\n\n format = format.replace(/\\\\(.)/g, \"$1\");\n\n return format;\n}", "title": "" }, { "docid": "91c9f72d1ead2857a0795ca0c34eb18a", "score": "0.6964773", "text": "function format_date(date, format)\n{\n\tif (!date)\n\t{\n\t\treturn ''\n\t}\n\n\treturn moment(date).format(format)\n}", "title": "" }, { "docid": "454a222039505bbfb42789c07f4917e5", "score": "0.69600445", "text": "function formatDate(date) {\n console.log(date);\n const d = new Date(date);\n console.log(d);\n const formattedDate = `${d.getMonth() + 1}/${d.getDate()}/${d.getFullYear()}`;\n return formattedDate;\n}", "title": "" }, { "docid": "5b5797da18d6ed105bbb4881b9dcb4da", "score": "0.69550544", "text": "function _date(obj) {\n return exports.PREFIX.date + ':' + obj.toISOString();\n}", "title": "" }, { "docid": "c74a23f2f45dc42fafbf56e21456b425", "score": "0.69536996", "text": "function formatDate(date) \r\n{\r\n var d = new Date(date),\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n\r\n return [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "27faff1a9adffa6307b254d882b4e299", "score": "0.6931034", "text": "function formatDate(date) {\r\n if (!date) {\r\n return '';\r\n }\r\n var month = date.getMonth() + 1;\r\n var year = date.getFullYear();\r\n var day = date.getDate();\r\n month = (month < 10) ? \"0\" + month : month;\r\n day = (day < 10) ? \"0\" + day : day;\r\n return year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "a35aea1642736b3771fdfd8455040deb", "score": "0.69235456", "text": "function formatDate(d) {\n date = new Date(d)\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n if (dd < 10) { dd = '0' + dd }\n if (mm < 10) { mm = '0' + mm };\n return d = yyyy + '-' + mm + '-' + dd;\n}", "title": "" }, { "docid": "175c95c3fc4cf64819044867c3ca8cdc", "score": "0.69220716", "text": "function formatDate(date) {\n let yyyy = date.getFullYear();\n let mm = date.getMonth()+1;\n if (mm<10) {\n mm = \"0\" + mm;\n }\n let dd = date.getDate();\n if (dd<10) {\n dd = \"0\" + dd;\n }\n let formattedDate = yyyy + \"-\" + mm + \"-\" + dd;\n return formattedDate;\n}", "title": "" }, { "docid": "9726bf51cf7b7975b6f118b2f2c7e1d0", "score": "0.6920367", "text": "function formatDate(date) {\n // var d = new Date(date);\n //console.log(Object.values(date));\n var split = date.toString().split(\"-\");\n var month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n var m = month[split[1] - 1];\n var dateFormat = m + \" \" + split[2] + \", \" + split[0];\n return dateFormat;\n}", "title": "" }, { "docid": "56c7bce60e458db7e6f85a51007e1baa", "score": "0.69144744", "text": "function formatDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n if(dd<10){\n dd='0'+dd;\n }\n if(mm<10){\n mm='0'+mm;\n }\n var dstr = yyyy+'-'+mm+'-'+dd;\n return dstr;\n}", "title": "" }, { "docid": "b7c53f78bcf4805e5bad02f971422bcd", "score": "0.6909679", "text": "formatDate(x) {\n let date = new Date(x)\n let _month = date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1\n let _date = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()\n let _hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()\n let _minute = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()\n let _second = date.getSeconds() < 10 ? `0${date.getSeconds()}` : date.getSeconds()\n let dateStr = `${date.getFullYear()}-${_month}-${_date} ${_hour}:${_minute}:${_second}`\n return dateStr\n }", "title": "" }, { "docid": "d0df702b22854536628817491872bd80", "score": "0.69089824", "text": "static formatDateForOutput(date) {\n\n const dateObject = this.getDateAsObjectOfStrings(date);\n\n return dateObject.day + \"-\" +\n dateObject.month + \"-\" +\n dateObject.year + \" \" +\n dateObject.hours + \":\" +\n dateObject.minutes;\n }", "title": "" }, { "docid": "d0168c7c4d4d98a812743c3d4d88c8d1", "score": "0.6907174", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = '0' + month;\n }\n if (day.length < 2) {\n day = '0' + day;\n }\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "06236f4fe2ed2038ca21c40a86ef1468", "score": "0.6906871", "text": "function formattedDate(date) {\n return moment(date).format(\"DD.MM.YYYY\");\n}", "title": "" }, { "docid": "697e8acf42ca01fb33099aa108ff5ef7", "score": "0.6905836", "text": "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "6a391e43335e8060a72a821213d89081", "score": "0.6904495", "text": "function getFormattedDate(date) {\n let year = date.getFullYear();\n let month = (1 + date.getMonth()).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n\n return month + '/' + day + '/' + year;\n}", "title": "" }, { "docid": "77969297e5e1e39589e6c2a65081e2d9", "score": "0.68957996", "text": "function getFormatedDate(date) {\n var day = date.getDate();\n day = day < 10 ? '0' + day : day;\n var month = date.getMonth() + 1;\n var year = date.getFullYear();\n\n return `${day}-${month}-${year}`;\n}", "title": "" }, { "docid": "54dd350a13f2b9f6fe6907a4353b1948", "score": "0.6884217", "text": "function formatDate(date) {\n let dd = String(date.getDate()). padStart(2, '0');\n let mm = String(date.getMonth() + 1). padStart(2, '0'); //January is 0!\n let yyyy = date.getFullYear();\n let formattedDate = yyyy + mm + dd;\n return formattedDate;\n}", "title": "" }, { "docid": "1350a2da48e52ad700b12e651af09bd8", "score": "0.68775845", "text": "function formatDate (date) { \n if (typeof date === 'string') {\n return date.slice(0, 10)\n } else if (typeof date === 'object') {\n return date.toISOString().slice(0, 10)\n } else {\n throw new Error('unknown date type')\n }\n}", "title": "" }, { "docid": "6315df1f562ca23be0c64a9deff26bdd", "score": "0.6872405", "text": "function getFormattedDate(date = new Date()) {\r\n const dd = String(date.getDate()).padStart(2, '0');\r\n const mm = String(date.getMonth() + 1).padStart(2, '0'); // January is 0!\r\n const yyyy = date.getFullYear();\r\n const getFormattedDate = `${dd}/${mm}/${yyyy}`;\r\n \r\n return getFormattedDate;\r\n }", "title": "" }, { "docid": "a55a6db6ae9801afb1cc32fc1bc647c5", "score": "0.6864739", "text": "function formatDate(date) {\n function formatNum(num) {\n if (num < 10) return '0' + num;\n return String(num);\n }\n return formatNum(date.getDate()) + '/' + formatNum(date.getMonth() + 1) + '/' + date.getFullYear();\n }", "title": "" }, { "docid": "5ac85ae948e78812debc0a7ded190b62", "score": "0.6842265", "text": "format_date_api() {\n let date = this.state.date;\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let dt = date.getDate();\n\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n let changed_date = year + \"-\" + month + \"-\" + dt;\n\n return changed_date;\n }", "title": "" }, { "docid": "9ed9f629a6da3d11f6afdd0dc3c9c58c", "score": "0.68405765", "text": "function formatDate(date) {\n const input = new Date(date);\n const day = input.getDate();\n const month = input.getMonth() + 1;\n const year = input.getFullYear();\n // if day or month value is less than 10 add 0 in front\n return `${day <= 9 ? '0' + day : day}/${month <= 9 ? '0' + month : month}/${year}`;\n}", "title": "" }, { "docid": "9a61e9d840951f2f72f13ced89964184", "score": "0.68389064", "text": "function formatDate(date, formatStr) {\n\t\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n\t}", "title": "" }, { "docid": "2d7de51d16440bf9c4120a120c26289c", "score": "0.6837495", "text": "function formatDate(date){\n return moment(date, 'YYYY/MM/DD');\n}", "title": "" }, { "docid": "131becd669c9792993880795fdcf88cf", "score": "0.6830544", "text": "function formatDate(d){\n function addZero(n){\n return n < 10 ? '0' + n : '' + n;\n }\n return addZero(d.getMonth()+1)+\"/\"+ addZero(d.getDate()) + \"/\" + d.getFullYear() + \" \" + \n addZero(d.getHours()) + \":\" + addZero(d.getMinutes());\n }", "title": "" }, { "docid": "f403b580e4f61e80e00a268386bd8260", "score": "0.6827385", "text": "function formatDate(d){\n function addZero(n){\n return n < 10 ? '0' + n : '' + n;\n }\n return addZero(d.getMonth()+1)+\"/\"+ addZero(d.getDate()) + \"/\" + d.getFullYear() + \" \" + \n addZero(d.getHours()) + \":\" + addZero(d.getMinutes());\n }", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "21b136668c26881d30a9828e1e73b95a", "score": "0.6824828", "text": "function formatDate(date, format, options) {\n\treturn formatDates(date, null, format, options);\n}", "title": "" }, { "docid": "b6d14ef1dd2b354629eea0d9d7bde709", "score": "0.68231", "text": "format(attrs) {\n return this.fixDates(attrs);\n }", "title": "" }, { "docid": "b9855dabe71ec1d6f135e44cb7d905bf", "score": "0.6820978", "text": "function formatDate(date) {\r\n\tvar month=date.getMonth()+1;\r\n\tvar year=date.getFullYear();\r\n\tvar day=date.getDate()\r\n\tmonth=(month<10)?\"0\"+month:month;\r\n\tday=(day<10)?\"0\"+day:day;\r\n\treturn year + \"-\" + month + \"-\" + day;\r\n}", "title": "" }, { "docid": "c73daf6143102f3d305c0ab89a6e717b", "score": "0.6818612", "text": "static format(date) {\n\t\tconst months = [\n\t\t\t'01',\n\t\t\t'02',\n\t\t\t'03',\n\t\t\t'04',\n\t\t\t'05',\n\t\t\t'06',\n\t\t\t'07',\n\t\t\t'08',\n\t\t\t'09',\n\t\t\t'10',\n\t\t\t'11',\n\t\t\t'12',\n\t\t]\n\t\tconst hours = [\n\t\t\t'01',\n\t\t\t'02',\n\t\t\t'03',\n\t\t\t'04',\n\t\t\t'05',\n\t\t\t'06',\n\t\t\t'07',\n\t\t\t'08',\n\t\t\t'09',\n\t\t\t'10',\n\t\t\t'11',\n\t\t\t'12',\n\t\t\t'13',\n\t\t\t'14',\n\t\t\t'15',\n\t\t\t'16',\n\t\t\t'17',\n\t\t\t'18',\n\t\t\t'19',\n\t\t\t'20',\n\t\t\t'21',\n\t\t\t'22',\n\t\t\t'23',\n\t\t\t'24',\n\t\t]\n\t\tlet result =\n\t\t\tdate.getUTCFullYear() +\n\t\t\t'-' +\n\t\t\tmonths[date.getUTCMonth()] +\n\t\t\t'-' +\n\t\t\tdate.getUTCDate() +\n\t\t\t'-T' +\n\t\t\thours[date.getUTCHours()] +\n\t\t\t':' +\n\t\t\tthis.pad(date.getUTCMinutes()) +\n\t\t\t':' +\n\t\t\tthis.pad(date.getUTCSeconds()) +\n\t\t\t'.' +\n\t\t\tthis.pad(date.getUTCMilliseconds()) +\n\t\t\t'000+0000'\n\t\treturn result\n\t}", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.68113256", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "b433a68f409a48c8436e8d694b2496b5", "score": "0.68113256", "text": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n\n return [year, month, day].join('-');\n }", "title": "" }, { "docid": "1529ab643a144e92d2bf34af0fad0aee", "score": "0.6808913", "text": "format_date_display() {\n let date = this.state.date;\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let dt = date.getDate();\n let return_str = \"\";\n if (dt < 10) {\n dt = \"0\" + dt;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return dt + \"-\" + month + \"-\" + year;\n }", "title": "" }, { "docid": "5cb63ebc4e4b6b86839d5aaf3cb499e5", "score": "0.6807339", "text": "function FormatDate(date) {\n try {\n var new_date = new Date(date);\n\n //refactor date provided to make it suitable (mm-dd)\n var day = ('0' + new_date.getDate()).slice(-2);\n var month = ('0' + (new_date.getMonth() + 1)).slice(-2);\n\n new_date = new_date.getFullYear() + \"-\" + (month) + \"-\" + (day);\n return new_date\n } catch(error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "b1911795d581a812e22dd51829940772", "score": "0.6806193", "text": "function formatDate(date) {\n var fullDate = new Date(date);\n var dd = fullDate.getDate();\n var mm = fullDate.getMonth() + 1; //January is 0!\n var yyyy = fullDate.getFullYear();\n if (dd < 10) dd = '0' + dd\n if (mm < 10) mm = '0' + mm\n fullDate = mm + '/' + dd + '/' + yyyy;\n return fullDate;\n}", "title": "" }, { "docid": "6153f3de18659592df06818e77262cb5", "score": "0.68041766", "text": "formatDate(date) {\n\t\tlet d = new Date(date);\n\n\t\tlet month = '' + (d.getMonth() + 1);\n\t\tlet day = '' + d.getDate();\n\t\tlet year = d.getFullYear();\n\t\tlet hour = d.getHours();\n\t\tlet min = ('0'+d.getMinutes()).slice(-2);\n\n\t\tif (month.length < 2)\n\t\t\tmonth = '0' + month;\n\t\tif (day.length < 2)\n\t\t\tday = '0' + day;\n\n\t\tlet res = [year, month, day].join('-');\n\t\tres = res.concat(' ');\n\t\tres = res.concat(hour.toString());\n\t\tres = res.concat(':');\n\t\tres = res.concat(min.toString());\n\n\t\treturn res;\n\t}", "title": "" }, { "docid": "bddf2b6b0fc80e29bc5cb7758a8d40ee", "score": "0.68012434", "text": "function formatDate(date) {\n let day = date.getDate().toString();\n let month = (date.getMonth() + 1).toString();\n const year = date.getFullYear().toString();\n\n // append zero to single digits day and month\n if (day.length === 1) day = \"0\" + day;\n if (month.length === 1) month = \"0\" + month;\n\n return `${day}-${month}-${year}`;\n}", "title": "" }, { "docid": "82475fae7fb5941a26b2ceebd1a222b1", "score": "0.6801231", "text": "function formatDate (d) {\n let day = d.getDate();\n\n // Adding 0 to dates up to 9. (01, 02, 03 etc:)\n if (day < 10) {\n day = '0' + day;\n }\n// adding 1 to month so its not 0-11 but 1-12\n let month = d.getMonth() + 1;\n if (month < 10) {\n month = '0' + month;\n }\n\n let year = d.getFullYear();\n\n // Returns date formatted with forward slashes\n return day + ' / ' + month + ' / ' + year;\n\n}", "title": "" }, { "docid": "9a11996e3ef12f22cc409ca98da4128a", "score": "0.6800204", "text": "function formatDate(date) {\n let dateStr = date.getUTCFullYear() + '-' +\n pad(date.getUTCMonth() + 1) + '-' +\n pad(date.getUTCDate() + 1)\n return dateStr;\n }", "title": "" }, { "docid": "13bae9e4dce16f4fe0862d1a6001c927", "score": "0.6799291", "text": "function formatDate(date, format, options) {\r\n\treturn formatDates(date, null, format, options);\r\n}", "title": "" }, { "docid": "39f537527c46fdb3d37e1d74e6192adf", "score": "0.67978036", "text": "formatDate(date) {\n const splittedDate = date.split('-')\n\n return `${splittedDate[2]}/${splittedDate[1]}/${splittedDate[0]}`\n }", "title": "" }, { "docid": "e87bce4efc68da9a48f7cd220dc99ee6", "score": "0.67937064", "text": "function getFormattedDate(date) {\n\treturn date.getFullYear()\n\t+ \"-\"\n\t+ (\"0\" + (date.getMonth() + 1)).slice(-2)\n\t+ \"-\"\n\t+ (\"0\" + date.getDate()).slice(-2);\n}", "title": "" }, { "docid": "4deacab12fd60d846f71070d5dab2eaa", "score": "0.6792987", "text": "function formatDate(date) {\r\n var d = new Date(date),\r\n month = '' + (d.getMonth()),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n\r\n if (month.length < 2) month = '0' + month;\r\n if (day.length < 2) day = '0' + day;\r\n\r\n return [year, month, day].join('-');\r\n}", "title": "" }, { "docid": "a5b34e67c964428cbecac63d2819fe44", "score": "0.67841005", "text": "formatDate( date ) {\n if ( !date ) { return null; }\n\n return moment( date ).format( this.getConfig( 'date_format' ) );\n }", "title": "" }, { "docid": "f55d784f9d59326c4b12e0affb2bafec", "score": "0.678409", "text": "function Get_FormatDate(date,format)\n{\n var curr_date = date.getDate();\n var curr_month = date.getMonth();\n var curr_year = date.getFullYear();\n \n var dateStr\n \n switch(format)\n {\n case \"MMM d, yyyy\":\n dateStr = m_names[curr_month] + \" \" + curr_date + \", \" + curr_year;\n break;\n \n case \"yyyy/MM/dd\":\n dateStr = curr_year + \"/\" + String(Get_2figureNumber(curr_month+1)) + \"/\" + Get_2figureNumber(curr_date);\n break;\n \n case \"yyyy-MM-dd\":\n dateStr = curr_year + \"-\" + String(Get_2figureNumber(curr_month+1)) + \"-\" + Get_2figureNumber(curr_date);\n break;\n \n default:\n break;\n }\n \n return dateStr;\n}", "title": "" }, { "docid": "3493012255dc7d133178dafc8f7204aa", "score": "0.67780566", "text": "function formatDate(date) {\n return `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()\n } ${date.getDate()}${months[date.getMonth()]}${date.getFullYear()}`;\n}", "title": "" }, { "docid": "02adc2b66de5ccb6e60cf5c126f7b7df", "score": "0.6776852", "text": "function formatDate(date) {\n\n\n\tif (date.getDate() < 10){\n\t\tvar day = '0'+ date.getDate();\n\t}\n\n\tif(date.getMonth() + 1 < 10){\n\t\tvar month = '0'+ (date.getMonth() +1);\n\t}\n\n return day + \"/\" + month +\n \"/\" + date.getFullYear();\n}", "title": "" }, { "docid": "8bfeb43557211e2b6921e7b57589dd9a", "score": "0.6769254", "text": "function setFormatoDate(data) {\n\n let dd = (\"0\" + (data.getDate())).slice(-2);\n let mm = (\"0\" + (data.getMonth() + 1)).slice(-2);\n let yyyy = data.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "title": "" }, { "docid": "f0698daa29325ae81f03c346c14bfaa9", "score": "0.67663825", "text": "function formatDate($dt) {\n $year = $dt.getUTCFullYear();\n if ($year < 1000) {\n $year += 1900;\n }\n return ($dt.getUTCDate() + \"-\" + ($dt.getUTCMonth() + 1) + \"-\" + $year);\n }", "title": "" }, { "docid": "27862aba9df865a82a2b422afa6ee15e", "score": "0.6763993", "text": "function formatDate(date, formatStr) {\n\treturn formatDateWithChunks(date, getFormatStringChunks(formatStr));\n}", "title": "" } ]
bb000c9e04ec5068a6d4acddf5c93ba5
Validates a legend item and merges it with a default. Removes any invalid values and logs appropriate warnings.
[ { "docid": "6fe011eb2c593ac7411d18f532f593c8", "score": "0.638266", "text": "function getValidatedLegendItem(config) {\n var valid = new Validator().ofType('object').validate(config, 'Seat picker legend item');\n if (!valid || !config)\n return {};\n if ('show' in config) {\n var valid_8 = new Validator()\n .ofType('boolean')\n .validate(config.show, 'Seat picker legend item show');\n if (!valid_8)\n delete config.show;\n }\n if ('index' in config) {\n var valid_9 = new Validator()\n .ofType('number')\n .validate(config.index, 'Seat picker legend item index');\n if (!valid_9)\n delete config.index;\n }\n if ('icon' in config) {\n var valid_10 = new Validator()\n .ofType('string')\n .minLength(1)\n .allowNull().allowUndefined()\n .validate(config.icon, 'Seat picker legend item icon');\n if (!valid_10)\n delete config.icon;\n }\n return config;\n}", "title": "" } ]
[ { "docid": "f2d91990f59d3d8887703be9cc157eed", "score": "0.64948946", "text": "function mapLegendItemConfig(defaultConfig, config) {\n if (!config)\n return defaultConfig;\n var validatedConfig = getValidatedLegendItem(config);\n return __assign({}, defaultConfig, validatedConfig);\n}", "title": "" }, { "docid": "fc16f03f4dcb66575a20e48fee423dcb", "score": "0.6191825", "text": "function legend() {\n obj.extend(_.config, _.defaults);\n return legend;\n }", "title": "" }, { "docid": "71092c6c0680355e1a15fd8613f95328", "score": "0.57152796", "text": "function legend() {\n // add the legend group element to the svg\n var legend = svg.append(\"g\")\n .attr(\"class\", \"mylegend\")\n .attr(\"transform\", \"translate(0,0)\");\n\n // icon values & space between legend elements\n var iconWidth = 35;\n var iconHeight = 10;\n var margin = 10;\n\n // we set these manually because it's not based off of what's in an array/ we can't loop through an array to draw the icons in the legend\n\n var total = legend.append(\"g\")\n .attr(\"class\", \"legendGroup\");\n\n total.append(\"rect\")\n .attr(\"height\", iconHeight)\n .attr(\"width\", iconWidth)\n .attr(\"fill\", \"#f1735f\")\n .attr(\"opacity\", .4);\n\n total.append(\"text\")\n .attr(\"x\", iconWidth + 5)\n .attr(\"y\", iconHeight)\n .style(\"text-anchor\", \"start\")\n .attr(\"class\", \"legendLabel\")\n .text(\"Overall Rate\");\n\n var ls = legend.append(\"g\")\n .attr(\"class\", \"legendGroup\")\n .attr(\"transform\", function () {\n return \"translate(\" + (total.node().getBBox().width + margin) + \",0)\" // total.node().getBBox().width gives us the width of the \"total\" element (icon and text) we created above. Translate the next element over this much plus the margin\n });\n\n ls.append(\"rect\")\n .attr(\"height\", iconHeight)\n .attr(\"width\", iconWidth)\n .attr(\"fill\", \"#f1735f\")\n .attr(\"opacity\", .8);\n\n ls.append(\"text\")\n .attr(\"x\", iconWidth + 5)\n .attr(\"y\", iconHeight)\n .style(\"text-anchor\", \"start\")\n .attr(\"class\", \"legendLabel\")\n .text(\"Late Stage Rate\");\n }", "title": "" }, { "docid": "48e792535ad817096c5d35187860fac1", "score": "0.5633415", "text": "function legend_scaler(data) {\n return d3.scaleLinear()\n .domain([(d3.min(mergedData, d => d[data])), (d3.max(mergedData, d => d[data]))])\n .range([legendHeight, 0]);\n }", "title": "" }, { "docid": "6221ed9df4c650aa2162d9c85602d53a", "score": "0.5616836", "text": "function setChartColors(toolData, legendData, defaultColorArray) {\r\n //function handles 3 color inputs\r\n //toolData as an array in toolData\r\n //toolData as an object\r\n //toolData as 'none'\r\n //any other case will result in using defaultColorArray\r\n\r\n var colors = {},\r\n usedColors = [],\r\n unaccountedLegendElements = [];\r\n\r\n //toolData is array\r\n if (Array.isArray(toolData)) {\r\n if (toolData.length > 0) {\r\n colors = createColorsWithDefault(legendData, toolData);\r\n } else {\r\n colors = createColorsWithDefault(legendData, defaultColorArray);\r\n }\r\n } else if (toolData === Object(toolData)) {\r\n for (var i = 0; i < legendData.length; i++) {\r\n var obj = legendData[i];\r\n if (toolData.hasOwnProperty(obj)) {\r\n usedColors.push(toolData[obj]);\r\n } else {\r\n unaccountedLegendElements.push(legendData[i]);\r\n }\r\n }\r\n //check if object has desired keys\r\n if (usedColors.length === legendData.length) {\r\n colors = toolData;\r\n } else if (usedColors.length > 0) {\r\n var toolDataAsArray = Object.values(toolData);\r\n if (toolDataAsArray.length > legendData.length) {\r\n colors = createColorsWithDefault(legendData, toolDataAsArray);\r\n } else {\r\n colors = createColorsWithDefault(legendData, defaultColorArray);\r\n }\r\n } else {\r\n var toolDataAsArray = Object.values(toolData);\r\n if (toolDataAsArray.length > legendData.length) {\r\n colors = createColorsWithDefault(legendData, toolDataAsArray);\r\n } else {\r\n colors = createColorsWithDefault(legendData, defaultColorArray);\r\n }\r\n }\r\n } else {\r\n colors = createColorsWithDefault(legendData, defaultColorArray);\r\n }\r\n\r\n return colors;\r\n}", "title": "" }, { "docid": "c20a3afde08dc72a1d20f2f9ddc9b878", "score": "0.561135", "text": "function handleLeave(evt, item, legend) {\n legend.chart.data.datasets[0].backgroundColor.forEach((color, index, colors) => {\n colors[index] = color.length === 9 ? color.slice(0, -2) : color;\n });\n legend.chart.update();\n}", "title": "" }, { "docid": "9b7a32f72157669284de5ac483dee8b5", "score": "0.55603576", "text": "function LegendItem() {\n _classCallCheck(this, LegendItem);\n\n var _this = _possibleConstructorReturn(this, _ComponentInterface.call(this));\n\n _this._stateCosmetics = {};\n _this._legendState = [];\n return _this;\n }", "title": "" }, { "docid": "0e3c9d178f774264977dc73e997cd4e0", "score": "0.5557976", "text": "function mapLegendItemsConfig(defaultConfig, config) {\n if (!config)\n return defaultConfig;\n return {\n available: mapLegendItemConfig(defaultConfig.available, config.available),\n unavailable: mapLegendItemConfig(defaultConfig.unavailable, config.unavailable),\n selected: mapLegendItemConfig(defaultConfig.selected, config.selected),\n wheelchair: mapLegendItemConfig(defaultConfig.wheelchair, config.wheelchair),\n companion: mapLegendItemConfig(defaultConfig.companion, config.companion),\n friend: mapLegendItemConfig(defaultConfig.friend, config.friend),\n };\n}", "title": "" }, { "docid": "48156b68d6ebff74e40d550cf4514996", "score": "0.55284053", "text": "function updateLegendItems() {\n $(\".ui-chart-legend-item-text > span\").each(function () {\n var txt = $(this).text(),\n idx = txt.lastIndexOf(\"(\");\n if (idx != -1) {\n $(this).text(txt.substr(0, idx));\n } else {\n return false;\n }\n });\n }", "title": "" }, { "docid": "18f1c89bacb76d0b1b79f7994729af45", "score": "0.54916704", "text": "function mapLegendConfig(config) {\n var defaultConfig = defaultSeatPickerConfig.legend;\n if (config === undefined)\n return defaultConfig;\n var validatedConfig = getValidatedLegendConfig(config);\n return __assign({}, defaultConfig, validatedConfig, { items: mapLegendItemsConfig(defaultConfig.items, config.items) });\n}", "title": "" }, { "docid": "4fd1569a87718f61d49206e3e7d6c16f", "score": "0.54416275", "text": "function draw_common_chart_legend(svg, items, line_x_start, line_y, line_width) {\n var chart_legend_g = svg.append('g')\n .attr('class', 'series')\n var text_bbox;\n for (var i = 0; i < items.length; i++) {\n if(text_bbox) { line_x_start = text_bbox.x + text_bbox.width + 18; }\n chart_legend_g.append('line')\n .attr('class', 'series ' + items[i].replace(' ', ''))\n .attr('x1', line_x_start)\n .attr('y1', line_y)\n .attr('x2', line_x_start + line_width)\n .attr('y2', line_y);\n var text = chart_legend_g.append('text')\n .attr('x', line_x_start + line_width + 6)\n .attr('y', line_y + 5)\n .text(Main_Areas[i]);\n text_bbox = text.node().getBBox();\n }\n}", "title": "" }, { "docid": "28e324e6990fbffd274e5de19b6f3408", "score": "0.54372597", "text": "function getValidatedLegendConfig(config) {\n if ('position' in config) {\n var valid = new Validator()\n .ofType('string')\n .includedInValues(Object.values(SeatPickerWidgetLegendPosition))\n .validate(config.position, 'Seat picker legend position');\n if (!valid)\n delete config.position;\n }\n if ('seatSize' in config) {\n var valid = new Validator()\n .ofType('number').min(0)\n .validate(config.seatSize, 'Seat picker legend seat size');\n if (!valid)\n delete config.seatSize;\n }\n if ('seatIconSize' in config) {\n var valid = new Validator()\n .ofType('number').min(0).max(100)\n .validate(config.seatIconSize, 'Seat picker legend seat icon size');\n if (!valid)\n delete config.seatIconSize;\n }\n if ('seatShape' in config) {\n var valid = new Validator()\n .ofType('string')\n .includedInValues(Object.values(SeatPickerWidgetShape))\n .validate(config.seatShape, 'Seat picker legend seat shape');\n if (!valid)\n delete config.seatShape;\n }\n if ('seatBorderRadius' in config) {\n var valid = new Validator()\n .ofType('number').min(0)\n .validate(config.seatBorderRadius, 'Seat picker legend seat border radius');\n if (!valid)\n delete config.seatBorderRadius;\n }\n if ('seatBorderWidth' in config) {\n var valid = new Validator()\n .ofType('number').min(0)\n .validate(config.seatBorderWidth, 'Seat picker legend seat border width');\n if (!valid)\n delete config.seatBorderWidth;\n }\n return config;\n}", "title": "" }, { "docid": "7fd0d27e9c091f45ddf4daf44f5623c1", "score": "0.53951395", "text": "validate() {\n let legend = this.field.querySelector(\"legend\");\n if (this.requiredError) {\n this.error = true;\n this.errorMessage = this.requiredMessage || `required`;\n } else if (this.numberError) {\n this.error = true;\n this.errorMessage =\n this.numberMessage ||\n (this.numberError > 0\n ? `select ${this.numberError} more`\n : `select ${0 - this.numberError} fewer`);\n } else if (this.patternError) {\n this.error = true;\n this.errorMessage = this.patternMessage || `invalid format`;\n }\n if (this.hasFieldset && legend) {\n legend.innerHTML = legend.innerHTML.replace(\n /\\**\\s*$/,\n this.error ? \"*\" : \"\"\n );\n legend.style.color = this.error\n ? \"var(--simple-fields-error-color, #b40000)\"\n : \"\";\n }\n // return true if we have no errors\n // return false if we DO have errors\n return !this.error;\n }", "title": "" }, { "docid": "99dd89f63bb9ca7fc71c6d69a20536b6", "score": "0.5386887", "text": "function updateLegend(selected) {\n \n // append the gradient color ba\n var gradient = chartGroup.append('defs')\n .append('linearGradient')\n .attr('id', 'gradient')\n .attr('x1', '0%') // bottom\n .attr('y1', '0%')\n .attr('x2', '0%') // to top\n .attr('y2', '100%')\n .attr('spreadMethod', 'pad');\n \n // Generate the gradient for the legend by creating an array of \n // [pct, colour] pairs as stop values for legend (pct = percent)\n var colours = ['#1D465B', '#256770', '#2E857E', '#379A7C', '#41ae76', '#59BA76', '#71C67B', '#8FD28A', '#B2DDA3', '#D0E7BD', '#E7F1D7']\n \n // Creats an array of % values between 0-100 to match the colours above\n var pct = linspace(0, 100, colours.length).map(function(d) {\n return Math.round(d) + '%';\n });\n \n // Combine the colour and pct values into pairs in a single variable\n var colourPct = d3.zip(pct, colours);\n\n // Create the gradient\n colourPct.forEach(function(d) {\n gradient.append('stop')\n .attr('offset', d[0])\n .attr('stop-color', d[1])\n .attr('stop-opacity', 1);\n });\n \n // Create a rectangle with the gradient and append it to the id created above\n chartGroup.append('rect')\n .attr('x', width - legendWidth)\n .attr('y', 0)\n .attr('width', legendWidth)\n .attr('height', legendHeight)\n .style('fill', 'url(#gradient');\n \n // Create a scale and axis for the legend\n var legendScale = legend_scaler(selected)\n \n // Create the legend axis\n var legendAxis = d3.axisRight(legendScale)\n .tickFormat(d3.format(\"d\"));\n \n // Add a transition for the legend axis change\n chartGroup.select(\".legend-axis\")\n .transition()\n .duration(400)\n .call(legendAxis);\n\n }", "title": "" }, { "docid": "f9755bc8408e38f33808faa2e724a9da", "score": "0.5380549", "text": "function legendTick(d) {\n // Get current information\n const el = d3.select(this);\n const currX = parseInt(el.attr('x'));\n const currScore = d.value.filter(dd => dd.key == 'score')[0].value;\n const currFavCount = d.value.filter(dd => dd.key == 'fav_count')[0].value;\n\n // Translate the legend <g> to the current x coordinate - y is always 0.\n legend.attr('transform', `translate(${currX}, 0)`);\n\n if (sdVisible) {\n // If we're currently showing the standard deviation, set the text of\n // the legend to the current score/fav count, plus the std dev away\n // from the mean.\n const currScoreSd = d.value.filter(dd => dd.key == 'total_score_sd')[0].value;\n const currFavCountSd = d.value.filter(dd => dd.key == 'total_fav_count_sd')[0].value;\n legendScoreText.text(\n `rel. score: ${_f(currScore)} (${_f(Math.abs(currScore / currScoreSd))})`);\n legendFavCountText.text(\n `rel. fav count: ${_f(currFavCount)} (${_f(Math.abs(currFavCount / currFavCountSd))})`);\n } else {\n // Otherwise, just set it to the current score/fav count.\n legendScoreText.text(`rel. score: ${_f(currScore)}`);\n legendFavCountText.text(`rel. fav count: ${_f(currFavCount)}`);\n }\n\n // Get the width of the <text> for the legend and set the width\n // of the backing <rect> acordingly. Also, set the x offset: if the\n // legend item will go off the edge of the <svg>, shift it to the other\n // side of the guide line.\n const currScoreWidth = legendScoreText.node().getBBox().width;\n const currScoreX_offset = currScoreWidth + currX + 60 > width ?\n -currScoreWidth - 14 : 4;\n legendScoreRect.attr('width', currScoreWidth + 10);\n const currFavCountWidth = legendFavCountText.node().getBBox().width;\n const currFavCountX_offset = currFavCountWidth + currX + 60 > width ?\n -currFavCountWidth - 14 : 4;\n legendFavCountRect.attr('width', currFavCountWidth + 10);\n\n // Set the Y offset so that the legend items never cross each other,\n // mostly by setting it so that whichever number is greatest, the\n // item is above the line, and whichever is lowest, the item is\n // below the line.\n let currScoreY_offset = yScale(currScore) + 17;\n let currFavCountY_offset = yScale(currFavCount) - 8;\n if (currScore >= currFavCount) {\n currScoreY_offset = yScale(currScore) - 8;\n currFavCountY_offset = yScale(currFavCount) + 17;\n }\n\n // Translate the legend items.\n legendScore.attr(\n 'transform',\n `translate(${currScoreX_offset}, ${currScoreY_offset})`);\n legendFavCount.attr(\n 'transform',\n `translate(${currFavCountX_offset}, ${currFavCountY_offset})`);\n\n // Translate the date item.\n date.text(d.key);\n const currDateWidth = date.node().getBBox().width;\n if (currDateWidth + currX + 60 > width) {\n date.attr('x', -currDateWidth - 3);\n } else {\n date.attr('x', 3);\n }\n }", "title": "" }, { "docid": "a04def54951d72505884b4328559cc19", "score": "0.535765", "text": "function validateColor(input, defaultVal) {\n var colorValidation = [\"Pink\", \"LightPink\", \"HotPink\", \"DeepPink\", \"PaleVioletRed\", \"MediumVioletRed\", \"LightSalmon\", \"Salmon\", \"DarkSalmon\", \"LightCoral\", \"IndianRed\", \"Crimson\", \"Firebrick\", \"DarkRed\", \"Red\",\n \"OrangeRed\", \"Tomato\", \"Coral\", \"DarkOrange\", \"Orange\", \"Yellow\", \"LightYellow\", \"LemonChiffon\", \"LightGoldenrodYellow \", \"PapayaWhip\", \"Moccasin\", \"PeachPuff\", \"PaleGoldenrod\", \"Khaki\", \"DarkKhaki\", \"Gold\",\n \"Cornsilk\", \"BlanchedAlmond\", \"Bisque\", \"NavajoWhite\", \"Wheat\", \"Burlywood\", \"Tan\", \"RosyBrown\", \"SandyBrown\", \"Goldenrod\", \"DarkGoldenrod\", \"Peru\", \"Chocolate\", \"SaddleBrown\", \"Sienna\", \"Brown\", \"Maroon\",\n \"DarkOliveGreen\", \"Olive\", \"OliveDrab\", \"YellowGreen\", \"LimeGreen\", \"Lime\", \"LawnGreen\", \"Chartreuse\", \"GreenYellow\", \"SpringGreen\", \"MediumSpringGreen \", \"LightGreen\", \"PaleGreen\", \"DarkSeaGreen\", \"MediumAquamarine\",\n \"MediumSeaGreen\", \"SeaGreen\", \"ForestGreen\", \"Green\", \"DarkGreen\", \"Aqua\", \"Cyan\", \"LightCyan\", \"PaleTurquoise\", \"Aquamarine\", \"Turquoise\", \"MediumTurquoise\", \"DarkTurquoise\", \"LightSeaGreen\", \"CadetBlue\",\n \"DarkCyan\", \"Teal\", \"LightSteelBlue\", \"PowderBlue\", \"LightBlue\", \"SkyBlue\", \"LightSkyBlue\", \"DeepSkyBlue\", \"DodgerBlue\", \"CornflowerBlue\", \"SteelBlue\", \"RoyalBlue\", \"Blue\", \"MediumBlue\", \"DarkBlue\", \"Navy\",\n \"MidnightBlue\", \"Lavender\", \"Thistle\", \"Plum\", \"Violet\", \"Orchid\", \"Fuchsia\", \"Magenta\", \"MediumOrchid\", \"MediumPurple\", \"BlueViolet\", \"DarkViolet\", \"DarkOrchid\", \"DarkMagenta\", \"Purple\", \"Indigo\", \"DarkSlateBlue\",\n \"SlateBlue\", \"MediumSlateBlue \", \"White\", \"Snow\", \"Honeydew\", \"MintCream\", \"Azure\", \"AliceBlue\", \"GhostWhite\", \"WhiteSmoke\", \"Seashell\", \"Beige\", \"OldLace\", \"FloralWhite\", \"Ivory\", \"AntiqueWhite\", \"Linen\",\n \"LavenderBlush\", \"MistyRose\", \"Gainsboro\", \"LightGray\", \"Silver\", \"DarkGray\", \"Gray\", \"DimGray\", \"LightSlateGray\", \"SlateGray\", \"DarkSlateGray\", \"Black\"\n ].map(x => x.toLowerCase());\n var hexValidation = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"0\"].join('')\n\n var hex = true;\n var htmlColor = true;\n for (var i = 1; i < input.length; i++) {\n if (hexValidation.indexOf(input[i].toLowerCase()) < 0) {\n hex = false;\n }\n if (!((input.length === 7 || input.length === 4) && (input[0] === \"#\"))) {\n hex = false;\n }\n }\n\n if (colorValidation.indexOf(input) < 0) {\n htmlColor = false;\n }\n\n if (hex || htmlColor) {\n return input;\n }\n return defaultVal;\n}", "title": "" }, { "docid": "016e086b63b5a5fbc05fc95ca3277426", "score": "0.5334173", "text": "function legendSetup(legendContent, data, line, lsLine, x, y, svg, selectedOption, updateType) {\n if (legendContent == 'main') {\n //Legend\n d3.select('#legend')\n .append('circle')\n .attr('class', 'legend-first-circle')\n .attr('cx', 20)\n .attr('cy', 20)\n .attr('r', 5)\n .style('fill', '#ffab00')\n\n d3.select('#legend')\n .append('text')\n .attr('class', 'legend-first-text')\n .attr('x', 30)\n .attr('y', 25)\n .style('cursor', 'pointer')\n .text(selectedOption)\n .on('click', () => {\n let choice = d3.select('#selectButton').property('value')\n updateType.name = 'redraw'\n updateType.mainLine = !updateType.mainLine\n update(choice, data, line, lsLine, x, y, svg, updateType)\n d3.select('.legend-first-text').style('opacity', updateType.mainLine ? 1.0 : 0.5)\n })\n\n d3.select('#legend')\n .append('rect')\n .attr('class', 'legend-regression-rect')\n .attr('x', 15)\n .attr('y', 40)\n .attr('width', 10)\n .attr('height', 2)\n .style('fill', 'green')\n d3.select('#legend')\n .append('text')\n .attr('class', 'legend-regression-text')\n .attr('x', 30)\n .attr('y', 45)\n .text('Linear Regression' + ` (${selectedOption})`)\n .style('cursor', 'pointer')\n .on('click', () => {\n let choice = d3.select('#selectButton').property('value')\n updateType.name = 'redraw'\n updateType.mainRegression = !updateType.mainRegression\n update(choice, data, line, lsLine, x, y, svg, updateType)\n d3.select('.legend-regression-text').style('opacity', updateType.mainRegression ? 1.0 : 0.5)\n })\n } else if (legendContent == 'compare') {\n d3.select('#legend')\n .append('circle')\n .attr('class', 'legend-second-circle')\n .attr('cx', 20)\n .attr('cy', 60)\n .attr('r', 5)\n .style('fill', 'black')\n\n d3.select('#legend')\n .append('text')\n .attr('class', 'legend-second-text')\n .attr('x', 30)\n .attr('y', 65)\n .style('cursor', 'pointer')\n .text(selectedOption)\n .on('click', () => {\n let choice = d3.select('#compareSelect').property('value')\n updateType.name = 'redraw'\n updateType.compare = !updateType.compare\n updateCompareLine(choice, data, line, lsLine, x, y, svg, updateType)\n d3.select('.legend-second-text').style('opacity', updateType.compare ? 1.0 : 0.5)\n })\n\n d3.select('#legend')\n .append('rect')\n .attr('class', 'legend-second-rect')\n .attr('x', 15)\n .attr('y', 80)\n .attr('width', 10)\n .attr('height', 2)\n .style('fill', 'blue')\n d3.select('#legend')\n .append('text')\n .attr('class', 'legend-second-regression-text')\n .attr('x', 30)\n .attr('y', 85)\n .text('Linear Regression' + ` (${selectedOption})`)\n .style('cursor', 'pointer')\n .on('click', () => {\n let choice = d3.select('#compareSelect').property('value')\n updateType.name = 'redraw'\n updateType.compareRegression = !updateType.compareRegression\n updateCompareLine(choice, data, line, lsLine, x, y, svg, updateType)\n d3.select('.legend-second-regression-text').style('opacity', updateType.compareRegression ? 1.0 : 0.5)\n })\n }\n}", "title": "" }, { "docid": "6aa321659cda3a1e5f62e41e5a4a45fd", "score": "0.53206855", "text": "function fill_legend(){\r\n var nodes = simulation.nodes();\r\n\tvar links = simulation.force('link').links();\r\n\r\n // TODO: click on legend will unselect nodes. This click should be anyware on the graph.\r\n d3.select(\"#info\")\r\n .on(\"click\", function(e){ unselect_nodes(e); })\r\n\r\n // Fill graph basic info\r\n d3.select(\"#info-nodes\").text(nodes.length);\r\n d3.select(\"#info-links\").text(links.length);\r\n\r\n // Fills areas/colors array based on node information\r\n var all_area_id = [];\r\n var all_area_name = [];\r\n for (var i = 0; i < nodes.length; i++){\r\n if (all_area_id.indexOf(nodes[i].area_id) == -1){ // only unique area ids\r\n all_area_id.push(nodes[i].area_id);\r\n if (nodes[i].area_name != \"\"){\r\n all_area_name.push(nodes[i].area_name);\r\n }else{\r\n all_area_name.push(\"N/A\");\r\n }\r\n }\r\n }\r\n var colors_svg = d3.select(\"#legend-colors\").append(\"svg\")\r\n .attr(\"height\", 15 * all_area_id.length)\r\n .attr(\"width\", 250);\r\n for (var i = 0; i < all_area_id.length; i++){\r\n var g = colors_svg.append(\"g\");\r\n g.append(\"circle\")\r\n .attr(\"r\", 6)\r\n .attr(\"cx\", 9)\r\n .attr(\"cy\", (14*(i+1))-5)\r\n .attr(\"fill\", color(all_area_id[i]));\r\n g.append(\"text\")\r\n .attr(\"x\", 18)\r\n .attr(\"y\", 14*(i+1))\r\n .attr(\"style\", \"font-size: 12px\")\r\n .text(all_area_name[i]);\r\n }\r\n // Example sizes\r\n var example_sizes = [30, 15, 5, 1];\r\n var sizes_svg = d3.select(\"#legend-sizes\").append(\"svg\")\r\n .attr(\"height\", 90)\r\n .attr(\"width\", 250);\r\n for (var i = 0; i < example_sizes.length; i++){\r\n var g = sizes_svg.append(\"g\");\r\n g.append(\"circle\")\r\n .attr(\"r\", node_size(example_sizes[i]))\r\n .attr(\"cx\", 20)\r\n .attr(\"cy\", (20*(i+1))-5)\r\n .attr(\"fill\", \"#999\");\r\n g.append(\"text\")\r\n .attr(\"x\", 40)\r\n .attr(\"y\", 20*(i+1))\r\n .attr(\"style\", \"font-size: 12px\")\r\n .text(example_sizes[i] + \" papers\");\r\n }\r\n var shapes_svg = d3.select(\"#legend-shapes\").append(\"svg\")\r\n .attr(\"height\", 100)\r\n .attr(\"width\", 250);\r\n var g = shapes_svg.append(\"g\");\r\n g.append(\"circle\")\r\n .attr(\"r\", 10)\r\n .attr(\"cx\", 18)\r\n .attr(\"cy\", 12)\r\n .attr(\"fill\", \"#999\");\r\n g.append(\"text\")\r\n .attr(\"x\", 40)\r\n .attr(\"y\", 17)\r\n .attr(\"style\", \"font-size: 12px\")\r\n .text(\"Professors\");\r\n g.append(\"rect\")\r\n .attr(\"x\", 9)\r\n .attr(\"y\", 30)\r\n .attr(\"width\", 20)\r\n .attr(\"height\", 20)\r\n .attr(\"fill\", \"#999\");\r\n g.append(\"text\")\r\n .attr(\"x\", 40)\r\n .attr(\"y\", 45)\r\n .attr(\"style\", \"font-size: 12px\")\r\n .text(\"Students/Alumni/Pos-doc\");\r\n g.append(\"polygon\")\r\n .attr(\"points\", \"9,80 29,80 19,60\")\r\n .attr(\"fill\", \"#999\");\r\n g.append(\"text\")\r\n .attr(\"x\", 40)\r\n .attr(\"y\", 75)\r\n .attr(\"style\", \"font-size: 12px\")\r\n .text(\"External/Others\");\r\n\r\n}", "title": "" }, { "docid": "ce32659b89118fde03818445f52da876", "score": "0.52913016", "text": "_createLegend() {\n const self = this\n const data = []\n for (let item in this._profile.blocks[this._selectedOption].legend) {\n data.push(this._profile.blocks[this._selectedOption].legend[item]);\n }\n const margin = this._margin, width = this._width - this._margin.left - this._margin.right,\n height = this._height - this._margin.top - this._margin.bottom\n const leg = [\n {\n \"text\": this._getTranslation(\"legend\")\n }\n ]\n const legendRectSize = 7\n const legendSpacing = 7\n const legend = this._svg.selectAll(\".hlegend-hover\").data(data).enter().append(\"g\").attr(\"class\", \"legend\").\n style(\"display\", \"none\").attr(\"transform\", (d, i) => {\n const height = legendRectSize + legendSpacing\n const offset = height * 2\n const horizontal = legendRectSize - 15\n const vertical = i * height - offset\n return \"translate(\" + horizontal + \",\" + vertical + \")\"\n })\n legend.append('rect')\n .attr('class', 'legend-rect')\n .attr('x', 15)\n .attr('y', 6 * 6)\n .attr('width', 6)\n .style('stroke', 'black')\n .attr('height', 6)\n .style('fill', (d, i) => d.color);\n legend.append('text')\n .attr('class', 'legend-text')\n .attr('x', 30)\n .attr('y', 6 * 7)\n .text((d, i) => {\n const textProp = d.text\n self._boxBoundY = (height - (2 * height / 3) + 7) * i;\n return textProp;\n });\n let legendHover = this._svg.selectAll('.legend-hover')\n .data(leg)\n .enter()\n .append('g')\n .attr('class', 'legend-hover');\n legendHover.append('text')\n .attr('class', 'legend-menu')\n .attr(\"class\", \"no-select\")\n .attr('x', 15)\n .attr('y', height + 40)\n .text((d, i) => d.text)\n .on('mouseover', () => {\n select('.legend-box')\n .style(\"display\", \"block\");\n selectAll('.legend')\n .style(\"display\", \"block\");\n })\n .on('mouseleave', () => {\n select('.legend-box')\n .style(\"display\", \"none\");\n selectAll('.legend')\n .style(\"display\", \"none\");\n });\n }", "title": "" }, { "docid": "b8bdbc54f5702a6798d8ac547ac95d5e", "score": "0.5269093", "text": "function updateChart (data) { \n lines_wrapper.html(\"\");\n x0.domain(data.map(function(d){return d.key}));\n\n xAxis\n .attr('transform', 'translate(0,' + height + ')')\n .call(d3.axisBottom(x0).tickSizeOuter(0))\n\n d3.select('.nodatatext').remove();\n if(data.length >=1){\n\n d3.select('.legend_wrapper').remove();\n // let valueKeys;\n // if(groupby==\"country\"){ \n // valueKeys = Object.keys(data.map(function(d){return d.values})[0]);\n // }else if(groupby==\"cancer_site\"){\n // valueKeys = Object.keys(data.map(function(d){return d.values})[0]);\n // }else if(groupby==\"sex\"){\n // valueKeys = Object.keys(data.map(function(d){return d.values})[0]);\n // }else if(groupby==\"sub_region\"){\n // valueKeys = Object.keys(data.map(function(d){return d.values})[0]);\n // }\n\nlegends = Object.keys(data[0].value);\n\n var legend = g.append('g').attr('class','legend_wrapper')\n .attr('font-size', 10)\n .attr('text-anchor', 'end')\n\n legend.append('text')\n .text(\"Probability of Dying\")\n .attr('x', width + 70)\n .style('font-weight', 'bold')\n .attr('text-anchor', 'middle')\n .style('text-transform','capitalize')\n .attr('dy', -10)\n .attr('dx', 20)\n\n var legendEnter = legend\n .selectAll('g')\n .data(legends)\n .enter().append('g')\n .attr('transform', function (d, i) { return 'translate(0,' + i * 20 + ')' })\n\n legendEnter.append('rect')\n .attr('x', width + 50)\n .attr('width', 19)\n .attr('height', 19)\n .attr('fill', z)\n\n legendEnter.append('text')\n .attr('x', width + 75)\n .attr('y', 9.5)\n .attr('text-anchor','start')\n .attr('dy', '0.32em')\n .text(function(d){\n if(d == \"people_cancer\"){\n return \"Due to Cancer\";\n }else if(d == \"people_other\"){\n return \"Due to Other\";\n }\n })\n\n z.domain(legends);\n\n y.domain([0,d3.max(data.map(function(d){return d.value.people_cancer + d.value.people_other;}))]).nice();\n\n var g_con = lines_wrapper.selectAll('g.container').data(data).enter().append(\"g\").attr(\"class\",\"container\").attr(\"transform\",function(d){return \"translate(\"+x0(d.key) + \",0)\"}); \n\n g_con.append('line').attr('x1',function(d){return x0.bandwidth()/2}).attr('x2',function(d){return x0.bandwidth()/2}).attr('y1',function(d){return y(d.value.people_cancer)}).attr('y2',function(d){ return y(d.value.people_cancer + d.value.people_other)}).attr(\"stroke\",function(d){return z(\"people_other\")});\n g_con.append('line').attr('x1',function(d){return x0.bandwidth()/2}).attr('x2',function(d){return x0.bandwidth()/2}).attr('y1',function(d){return height}).attr('y2',function(d){ return y(d.value.people_cancer)}).attr(\"stroke\",function(d){return z(\"people_cancer\")});\n g_con.append('circle').attr('cx',function(d){return x0.bandwidth()/2}).attr('cy',function(d){return y(d.value.people_cancer)}).attr('r',5).attr(\"fill\",function(d){return z(\"people_cancer\")});\n g_con.append('circle').attr('cx',function(d){return x0.bandwidth()/2}).attr('cy',function(d){return y(d.value.people_cancer + d.value.people_other)}).attr('r',5).attr(\"fill\",function(d){return z(\"people_other\")});;\n //find max value of a section \n \n yAxis.transition()\n .call(d3.axisLeft(y)) \n \n }else{\n svg.append(\"text\").attr(\"x\", width/2).attr('y',300).text(\"No Data\").attr('class','nodatatext');\n }\n }", "title": "" }, { "docid": "02b22f6c28c033a919109f52ea81fa6e", "score": "0.5269026", "text": "function legendFormatter(data) {\n // If nothing is selected\n if (data.x == null) {\n if (data.dygraph.rawData_.length == 0) {return}\n let t;\n // checks, if it's the harmonic's plot\n if (data.dygraph.rawData_.length != 39) {\n t = data.dygraph.rawData_.length - 1;\n }\n else {\n t = 1\n var x_Value_label = data.dygraph.rawData_;\n }\n let firstDataPoint = data.dygraph.rawData_[t];\n maxData = firstDataPoint.length;\n for (var i=1; i < maxData; i++) {\n data.series[i-1]['firstDataPoint']= firstDataPoint[i];\n }\n x=firstDataPoint[0]\n // checks, if it's the harmonic's plot\n if (data.dygraph.rawData_.length != 39) {\n var x_Value_Label = Dygraph.dateString_(x,0);\n }\n else {\n var x_Value_Label = '2. Harmonische'\n }\n // for the historical values\n if (b==\"aktiv\") {\n var label = '<br>' + data.series.map(function(series) { return series.dashHTML + ' ' + '<b style=\"color: ' + series.color + '\">' + series.labelHTML + '</b>: '}).join('<br>') + '<br>' + '<br>'\n }\n else {\n var label = x_Value_Label + '<br>' + data.series.map(function(series) { return series.dashHTML + ' ' + '<b style=\"color: ' + series.color + '\">' + series.labelHTML + '</b>: ' + series.firstDataPoint }).join('<br>') + '<br>' + '<br>'\n }\n return label;\n }\n // At Mouseover\n // checks, if it's the harmonic's plot\n if (data.dygraph.rawData_.length != 39) {\n var html = data.xHTML\n }\n else {\n var html = data.xHTML + '. Harmonische';\n }\n data.series.forEach(function(series) {\n if (!series.isVisible) {return};\n var labeledData = '<b style=\"color: ' + series.color + '\">' + series.labelHTML + '</b>: ' + series.yHTML;\n if (series.isHighlighted) {\n labeledData = '<b>' + labeledData + '</b>';\n }\n html += '<br>' + series.dashHTML + ' ' + labeledData ;\n });\n html += '<br>' + '<br>';\n return html;\n}", "title": "" }, { "docid": "2565a11927b519d4c7613449bf6a7170", "score": "0.5240002", "text": "function renderLegend() {\r\n\t\t\titemX = initialItemX;\r\n\t\t\titemY = y;\r\n\t\t\toffsetWidth = 0;\r\n\t\t\tlastItemY = 0;\r\n\t\t\t\r\n\t\t\tif (!legendGroup) {\r\n\t\t\t\tlegendGroup = renderer.g('legend')\r\n\t\t\t\t\t.attr({ zIndex: 7 })\r\n\t\t\t\t\t.add();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// add HTML for each series\r\n\t\t\tif (reversedLegend) {\r\n\t\t\t\tseries.reverse();\r\n\t\t\t}\r\n\t\t\teach(series, function(serie) {\r\n\t\t\t\tif (!serie.options.showInLegend) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// use points or series for the legend item depending on legendType\r\n\t\t\t\tvar items = (serie.options.legendType == 'point') ?\r\n\t\t\t\t\tserie.data : [serie];\r\n\t\t\t\t\t\t\r\n\t\t\t\t// render all items\r\n\t\t\t\teach(items, renderItem);\r\n\t\t\t});\r\n\t\t\tif (reversedLegend) { // restore\r\n\t\t\t\tseries.reverse();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Draw the border\r\n\t\t\tboxWidth = widthOption || offsetWidth;\r\n\t\t\tboxHeight = lastItemY - y + lineHeight;\r\n\t\t\t\r\n\t\t\tif (legendBorderWidth || legendBackgroundColor) {\r\n\t\t\t\tboxWidth += 2 * padding;\r\n\t\t\t\tboxHeight += 2 * padding;\r\n\t\t\t\t\r\n\t\t\t\tif (!box) {\r\n\t\t\t\t\tbox = renderer.rect(\r\n\t\t\t\t\t\t0, \r\n\t\t\t\t\t\t0,\r\n\t\t\t\t\t\tboxWidth,\r\n\t\t\t\t\t\tboxHeight,\r\n\t\t\t\t\t\toptions.borderRadius,\r\n\t\t\t\t\t\tlegendBorderWidth || 0\r\n\t\t\t\t\t).attr({\r\n\t\t\t\t\t\tstroke: options.borderColor,\r\n\t\t\t\t\t\t'stroke-width': legendBorderWidth || 0,\r\n\t\t\t\t\t\tfill: legendBackgroundColor || NONE\r\n\t\t\t\t\t})\r\n\t\t\t\t\t.add(legendGroup)\r\n\t\t\t\t\t.shadow(options.shadow);\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbox.attr({ \r\n\t\t\t\t\t\theight: boxHeight,\r\n\t\t\t\t\t\twidth: boxWidth\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// 1.x compatibility: positioning based on style\r\n\t\t\tvar props = ['left', 'right', 'top', 'bottom'],\r\n\t\t\t\tprop,\r\n\t\t\t\ti = 4;\r\n\t\t\twhile(i--) {\r\n\t\t\t\tprop = props[i];\r\n\t\t\t\tif (style[prop] && style[prop] != 'auto') {\r\n\t\t\t\t\toptions[i < 2 ? 'align' : 'verticalAlign'] = prop;\r\n\t\t\t\t\toptions[i < 2 ? 'x' : 'y'] = parseInt(style[prop], 10) * (i % 2 ? -1 : 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\tvar boxPos = getAlignment(extend({\r\n\t\t\t\twidth: boxWidth,\r\n\t\t\t\theight: boxHeight\r\n\t\t\t}, options));\r\n\t\t\tlegendGroup.translate(boxPos.x, boxPos.y);\r\n\t\t\t\r\n\t\t\t// Position the checkboxes after the width is determined \r\n\t\t\teach(allItems, function(item) {\r\n\t\t\t\tvar checkbox = item.checkbox;\r\n\t\t\t\tif (checkbox) {\r\n\t\t\t\t\tcss(checkbox, {\r\n\t\t\t\t\t\tleft: (boxPos.x + item.legendItemWidth + checkbox.x - 40) +PX,\r\n\t\t\t\t\t\ttop: (boxPos.y + checkbox.y - 11) + PX \r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}", "title": "" }, { "docid": "b0c51cfa5ea3b7391c9303e638fb1f53", "score": "0.523624", "text": "function legenda(){\n var colorLegendData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];\n\n //Legend for colors\n var legend = svg.append('g')\n .attr('class', 'legend')\n .attr('transform', 'translate(' + 2*padding + ', 0)');\n \n legend.append('text')\n .text('Not happy')\n .attr('transform', 'translate(' + (svgwidth - 19 * padding) + ',' + 2 * padding + ')');\n \n legend.append('text')\n .text('Very happy')\n .attr('transform', 'translate(' + (svgwidth - 19 * padding) + ',' + 23.5 * padding + ')');\n\n legend.selectAll('rect')\n .data(colorLegendData)\n .enter()\n .append('rect')\n .attr('width', 2 * padding)\n .attr('height', 2 * padding)\n .attr('x', svgwidth - 22 * padding)\n .attr('y', function(d, i){return i * (2*padding);})\n .style('fill', function(d){return colorScale(d);});\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "af0f2ba065bc676737ec79bb40db42b9", "score": "0.5211978", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n }", "title": "" }, { "docid": "b4c186d572234a3020a2bac5909ed4db", "score": "0.51949245", "text": "function checkHopFormDefaults2(arrayIdx) {\n var value = \"\";\n var variable = ibu.add[arrayIdx].hopForm;\n\n value = ibu.add[arrayIdx].hopForm.value;\n if (value == \"(default)\") {\n variable.defaultValue = ibu.defaultHopForm.value;\n variable.value = ibu.defaultHopForm.value;\n variable.userSet = 0;\n if (document.getElementById(variable.id)) {\n document.getElementById(variable.id).value = variable.value;\n if (!variable.userSet && (\"defaultColor\" in variable)) {\n document.getElementById(variable.id).style.color=variable.defaultColor;\n } else {\n document.getElementById(variable.id).style.color = \"black\";\n }\n }\n }\n if (!ibu.add[arrayIdx].freshnessFactor.userSet) {\n ibu.add[arrayIdx].freshnessFactor.defaultValue =\n get_freshnessFactor_default(arrayIdx);\n common.set(ibu.add[arrayIdx].freshnessFactor,0);\n }\n if (!ibu.add[arrayIdx].pelletFactor.userSet) {\n ibu.add[arrayIdx].pelletFactor.defaultValue =\n get_pelletFactor_default(arrayIdx);\n common.set(ibu.add[arrayIdx].pelletFactor,0);\n }\n return;\n}", "title": "" }, { "docid": "bea2ea5a48a3e4cc63d7a028a063bde4", "score": "0.51858103", "text": "function dl_legend() {\r\n var legendsvg = svg.selectAll(\".legend\")\r\n .data(c1_scale.ticks(50).slice(1).reverse())\r\n .enter().append(\"g\")\r\n .attr(\"transform\", function(d, i) { return \"translate(\" + (width + margin.left) + \",\" + ((11.25 * i) + margin.top) + \")\"; })\r\n .attr(\"class\", \"legend\")\r\n\r\n legendsvg.append(\"rect\")\r\n .attr(\"width\", legendWidth)\r\n .attr(\"height\", 10.5)\r\n .style(\"fill\", c1_scale)\r\n .attr(\"class\", \"ColorScale\")\r\n .attr(\"color_val\", function(d) {\r\n return d\r\n })\r\n\r\n svg.append(\"text\")\r\n .attr(\"transform\", \"rotate(90)\")\r\n .attr(\"x\", (margin.top + margin.bottom + height/3))\r\n .attr(\"y\", 0 - (width + margin.right + legendWidth))\r\n .attr(\"dy\", \"0.35em\")\r\n .attr(\"class\", \"axis_text\")\r\n .style(\"font-size\", \"25px\")\r\n .text(\"Deadline\")\r\n}", "title": "" }, { "docid": "e4b594ec4ff164e77d37fb0c5f6f6514", "score": "0.5181278", "text": "markerValidation() {\n\t\tlet data = { success: false, data: [] };\n\n\t\tif (!this.state.legend)\n\t\t\treturn data;\n\n\t\tif (this.state.legend.sites === true) {\n\t\t\tdata.success = true;\n\t\t\tdata.data.push('sites');\n\t\t}\n\n\t\tif (this.state.legend.active_fires === true) {\n\t\t\tdata.success = true;\n\t\t\tdata.data.push('active_fires');\n\t\t}\n\n\t\tif (this.state.legend.firescape === true) {\n\t\t\tdata.success = true;\n\t\t\tdata.data.push('firescape');\n\t\t}\n\t\t\n\t\treturn data;\n\t}", "title": "" }, { "docid": "e0dea5e73a2407e60284255daaddf2ea", "score": "0.51808554", "text": "function DiscreteColorLegendItem(_ref) {\n var color = _ref.color,\n disabled = _ref.disabled,\n onClick = _ref.onClick,\n orientation = _ref.orientation,\n onMouseEnter = _ref.onMouseEnter,\n onMouseLeave = _ref.onMouseLeave,\n title = _ref.title;\n\n var className = 'rv-discrete-color-legend-item ' + orientation;\n if (disabled) {\n className += ' disabled';\n }\n if (onClick) {\n className += ' clickable';\n }\n return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'div',\n { className: className, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave },\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement('span', {\n className: 'rv-discrete-color-legend-item__color',\n style: disabled ? null : { background: color } }),\n __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement(\n 'span',\n { className: 'rv-discrete-color-legend-item__title' },\n title\n )\n );\n}", "title": "" }, { "docid": "8de6116a474740aff3b981b6abd918a3", "score": "0.5172691", "text": "function di_getLegendObject()\n{\n var chartLegend = {\n align: \"center\",\n backgroundColor: \"#ffffff\",\n borderColor: \"#909090\",\n borderRadius: 5,\n borderWidth: 1,\n enabled: true,\n floating: false, \n itemWidth: null,\n layout: \"horizontal\", \n lineHeight: 8,\n margin: 15,\n reversed: false,\n shadow: false,\n itemStyle: {},\n symbolPadding: 5,\n symbolWidth: 10,\n verticalAlign: \"bottom\",\n width: null,\n x:0,\n y:0\n };\n return chartLegend;\n}", "title": "" }, { "docid": "843a1a0d02ba53032a53fd0ffff8c99a", "score": "0.51588875", "text": "function DiscreteColorLegendItem(_ref) {\n var color = _ref.color,\n disabled = _ref.disabled,\n onClick = _ref.onClick,\n orientation = _ref.orientation,\n onMouseEnter = _ref.onMouseEnter,\n onMouseLeave = _ref.onMouseLeave,\n title = _ref.title;\n\n var className = 'rv-discrete-color-legend-item ' + orientation;\n if (disabled) {\n className += ' disabled';\n }\n if (onClick) {\n className += ' clickable';\n }\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\n 'div',\n { className: className, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave },\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement('span', {\n className: 'rv-discrete-color-legend-item__color',\n style: disabled ? null : { background: color } }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\n 'span',\n { className: 'rv-discrete-color-legend-item__title' },\n title\n )\n );\n}", "title": "" }, { "docid": "c2618f3316588af4a49b65a667ee8f76", "score": "0.51440525", "text": "function drawLegend() {\n // Editable options\n const mapLegendTicks = 10;\n const mapLegendWidth = 240;\n\n const [mapLegendMin, mapLegendMax] =\n selectedCountry === \"\"\n ? chloroplethMapColor.domain()\n : selectedMapColor.domain() ;\n\n const [mapLegendPosX, mapLegendPosY] = [mapSvgWidth - mapLegendWidth - 20, 20];\n const mapLegendTickWidth = mapLegendWidth / mapLegendTicks;\n const mapLegendHeight = mapLegendTickWidth / 2;\n\n // Remove the legend if it already exists\n if (mapLegendGroup != null) {\n mapLegendGroup.remove();\n }\n\n mapLegendGroup = mapSVG.append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${mapLegendPosX}, ${mapLegendPosY})`);\n\n const [padding_x, padding_y] = [4, 4];\n mapLegendGroup.append(\"rect\")\n .attr(\"width\", mapLegendWidth + padding_x * 2)\n .attr(\"height\", (mapLegendHeight + padding_y) * 2)\n .attr(\"transform\", `translate(${-padding_x}, ${-(mapLegendHeight + padding_y)})`)\n .attr(\"fill\", \"white\")\n .attr(\"stroke-width\", \"1px\")\n .attr(\"stroke\", \"rgba(0, 0, 0, 0.05)\")\n .attr(\"rx\", \"2px\")\n .attr(\"ry\", \"2px\")\n .classed(\"legend\");\n\n mapLegendGroup.selectAll(\"rect.numbers\")\n .data(d3.range(mapLegendMin, mapLegendMax, (mapLegendMax - mapLegendMin) / mapLegendTicks))\n .enter()\n .append(\"rect\")\n .attr(\"width\", mapLegendTickWidth)\n .attr(\"height\", mapLegendHeight)\n .attr(\"stroke\", \"black\")\n .attr(\"stroke-width\", 0.01)\n .attr(\"x\", function (d, i) {\n return i * mapLegendTickWidth;\n })\n .attr(\"fill\", function(d) {\n if (selectedCountry === \"\") {\n return chloroplethMapColor(d);\n } else {\n return selectedMapColor(d);\n }\n }).classed(\"numbers\");\n\n mapLegendGroup.selectAll(\"text\")\n .data(d3.range(mapLegendMin, mapLegendMax, (mapLegendMax - mapLegendMin) / mapLegendTicks))\n .enter()\n .append(\"text\")\n .attr(\"font-size\", \"9px\")\n .attr(\"fill\", \"black\")\n .attr(\"y\", mapLegendHeight - 3)\n .attr(\"x\", function (d, i) {\n return i * mapLegendTickWidth + 3;\n }).text((d, i) => {\n // Only draw every third tick\n if (i % 3 === 0) {\n return selectedCountry === \"\"\n ? d.toFixed(1)\n : (d*100).toFixed(0) + \"%\";\n }\n });\n\n mapLegendGroup\n .append(\"text\")\n .attr(\"fill\", \"black\")\n .attr(\"font-size\", 11)\n .attr(\"y\", -3)\n .attr(\"x\", 4)\n .text(() => selectedCountry === \"\"\n ? \"number of students incoming per one outgoing\"\n : \"percentage of students \" + studentDirection);\n}", "title": "" }, { "docid": "792b967f5a07def1dda296697f0e6ee9", "score": "0.5137611", "text": "function initLegend() {\n // set legend options if it does not already exist\n if (!self.legendOptions) {\n self.legendOptions = self.getScopeDefaults().legendOptions;\n }\n \n self._legendControl = new L.Control.Legend(self.legendOptions).addTo(self._map);\n }", "title": "" }, { "docid": "b26d4517378250ea8cb76d970a68e3d7", "score": "0.5129228", "text": "configureLegend(el, props) {\n this.createLegend = props.legend;\n // for each color in the legend, remove any existing, then\n // create a g and set its transform\n this.legend.selectAll('.legend-key').remove();\n if (!this.createLegend) return;\n\n const legendRectSize = Math.min(((el.offsetHeight-20) - (this.colorLegend.length-1)*this.legendSpacing)/this.colorLegend.length, 18);\n const legendHeight = this.colorLegend.length * (legendRectSize + this.legendSpacing) - this.legendSpacing;\n this.legend.style('height', legendHeight + 'px')\n .style('width', legendRectSize + 'px')\n .style('top', (el.offsetHeight - legendHeight)/2 + 'px')\n .style('left', 60 + 'px');\n\n const legendKeys = this.legend.selectAll('.legend-key')\n .data(this.colorLegend)\n .enter()\n .append('g')\n .attr('class', 'legend-key')\n .attr('transform', (d, i) => {\n var height = legendRectSize + this.legendSpacing;\n var vert = i * height;\n return 'translate(' + 0 + ',' + vert + ')';\n });\n\n // for each <g> create a rect and have its color... be the color\n legendKeys.append('rect')\n .attr('width', legendRectSize)\n .attr('height', legendRectSize)\n .style('fill', c => c.color)\n .style('stroke', c => c.color);\n\n // add necessary labels to the legend\n legendKeys.append('text')\n .attr('x', legendRectSize + 2)\n .attr('y', legendRectSize - 4)\n .text(c => c.text);\n }", "title": "" }, { "docid": "1d66cb1e0bc90f9fb0ffc9591d5510f1", "score": "0.51225483", "text": "function addLegend(layer, data, options) {\n data = data || {};\n if ( !this.options.fills ) {\n return;\n }\n\n var html = '<dl>';\n var label = '';\n if ( data.legendTitle ) {\n html = '<h2>' + data.legendTitle + '</h2>' + html;\n }\n for ( var fillKey in this.options.fills ) {\n\n if ( fillKey === 'defaultFill') {\n if (! data.defaultFillName ) {\n continue;\n }\n label = data.defaultFillName;\n } else {\n if (data.labels && data.labels[fillKey]) {\n label = data.labels[fillKey];\n } else {\n label= fillKey + ': ';\n }\n }\n html += '<dt>' + label + '</dt>';\n html += '<dd style=\"background-color:' + this.options.fills[fillKey] + '\">&nbsp;</dd>';\n }\n html += '</dl>';\n\n var hoverover = d3.select( this.options.element ).append('div')\n .attr('class', 'datamaps-legend')\n .html(html);\n}", "title": "" }, { "docid": "429f600a483ad578ac72b9db7ad00bb9", "score": "0.51208085", "text": "function _default(seriesType, defaultSymbolType, legendSymbol) {\n // Encoding visual for all series include which is filtered for legend drawing\n return {\n seriesType: seriesType,\n // For legend.\n performRawSeries: true,\n reset: function reset(seriesModel, ecModel, api) {\n var data = seriesModel.getData();\n var symbolType = seriesModel.get('symbol') || defaultSymbolType;\n var symbolSize = seriesModel.get('symbolSize');\n var keepAspect = seriesModel.get('symbolKeepAspect');\n data.setVisual({\n legendSymbol: legendSymbol || symbolType,\n symbol: symbolType,\n symbolSize: symbolSize,\n symbolKeepAspect: keepAspect\n }); // Only visible series has each data be visual encoded\n\n if (ecModel.isSeriesFiltered(seriesModel)) {\n return;\n }\n\n var hasCallback = typeof symbolSize === 'function';\n\n function dataEach(data, idx) {\n if (typeof symbolSize === 'function') {\n var rawValue = seriesModel.getRawValue(idx); // FIXME\n\n var params = seriesModel.getDataParams(idx);\n data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));\n }\n\n if (data.hasItemOption) {\n var itemModel = data.getItemModel(idx);\n var itemSymbolType = itemModel.getShallow('symbol', true);\n var itemSymbolSize = itemModel.getShallow('symbolSize', true);\n var itemSymbolKeepAspect = itemModel.getShallow('symbolKeepAspect', true); // If has item symbol\n\n if (itemSymbolType != null) {\n data.setItemVisual(idx, 'symbol', itemSymbolType);\n }\n\n if (itemSymbolSize != null) {\n // PENDING Transform symbolSize ?\n data.setItemVisual(idx, 'symbolSize', itemSymbolSize);\n }\n\n if (itemSymbolKeepAspect != null) {\n data.setItemVisual(idx, 'symbolKeepAspect', itemSymbolKeepAspect);\n }\n }\n }\n\n return {\n dataEach: data.hasItemOption || hasCallback ? dataEach : null\n };\n }\n };\n}", "title": "" }, { "docid": "ecc0692e5c9c562793bad6b51c4e8e07", "score": "0.510725", "text": "function updateLegend(d) {\n\n catInt = d3.select(catID).property('value');\n\n var newdata = data.filter(function(d){\n return d.Category == catInt;\n });\n\n d3.select(\".clickThis\").style(\"display\",\"none\")\n\n if (filtered.indexOf(d) == -1) {\n filtered.push(d);\n\n if(filtered.length == keysLegend.length) filtered = [];\n }\n\n else {\n filtered.splice(filtered.indexOf(d), 1);\n }\n\n var newKeys = [];\n keysLegend.forEach(function(d) {\n if (filtered.indexOf(d) == -1 ) {\n newKeys.push(d);\n }\n })\n\n x1.domain(newKeys).rangeRound([0, x0.bandwidth()]);\n\n y.domain([0, d3.max(newdata, function(d) {\n return d3.max(keysLegend, function(key) {\n if (filtered.indexOf(key) == -1)\n return +d[key];\n });\n })\n ]).nice();\n\n g.select(\".axis--y\")\n .transition()\n .duration(durations/1.5)\n .call(yAxis);\n\n var barsLegend = g.selectAll(\".layer\").selectAll(\"rect\")\n .data(function(d) {\n return keysLegend.map(function(key) {\n return {key: key, value: d[key]};\n });\n })\n\n barsLegend.filter(function(d) {\n return filtered.indexOf(d.key) > -1;\n })\n .transition()\n .duration(durations/1.5)\n .attr(\"x\", function(d) {\n return (+d3.select(this).attr(\"x\")) +\n (+d3.select(this).attr(\"width\"))/2;\n })\n .attr(\"height\",0)\n .attr(\"width\",0)\n .attr(\"y\", function(d) { return height; });\n\n barsLegend.filter(function(d) {\n return filtered.indexOf(d.key) == -1;\n })\n .transition()\n .duration(durations/1.5)\n .attr(\"x\", function(d) { return x1(d.key); })\n .attr(\"y\", function(d) { return y(d.value); })\n .attr(\"height\", function(d) { return height - y(d.value); })\n .attr(\"width\", x1.bandwidth())\n .attr(\"fill\", function(d) { return z(d.key); });\n\n var barsLegendText = g.selectAll(\".layer\").selectAll(\"text\")\n .data(function(d) {\n return keysLegend.map(function(key) {\n return {key: key, value: d[key]};\n });\n })\n\n barsLegendText.filter(function(d) {\n return filtered.indexOf(d.key) > -1;\n })\n .transition()\n .duration(durations/1.5)\n .attr(\"transform\", function(d, i) {\n let x0 = x1.bandwidth() * i + 2,\n y0 = y(d.value) - 10;\n return \"translate(\" + x0 + \",\" + y0 + \") rotate(0)\";\n })\n .text(\"\");\n\n barsLegendText.filter(function(d) {\n return filtered.indexOf(d.key) == -1;\n })\n .transition()\n .duration(durations/1.5)\n .attr(\"transform\", function(d, i) {\n let x0 = x1.bandwidth() * i + 2,\n y0 = y(d.value) - 10;\n return \"translate(\" + x0 + \",\" + y0 + \") rotate(0)\";\n })\n .text(function(d) {return formatValue(d.value)})\n\n g.selectAll(\".barlegend\")\n .transition()\n .duration(100)\n .attr(\"fill\",function(d) {\n if (filtered.length) {\n if (filtered.indexOf(d) == -1) {\n return z(d);\n } else {\n return \"white\"; }\n } else {\n return z(d);\n }\n });\n\n } // End of updateLegend", "title": "" }, { "docid": "eebf79c1170df89277904b552ec24ea9", "score": "0.51000756", "text": "drawLegend(bounds = null) {\n let self = this,\n steps = D3_CHROMATIC_SCHEME_OrBl9.length,\n wBox,\n hBox;\n const wFactor = 10,\n hFactor = 3;\n\n if (bounds === true) {\n wBox = self.properties.width / wFactor;\n hBox = self.properties.height / hFactor;\n } else {\n wBox = bounds.width;\n hBox = bounds.height;\n }\n\n const wRect = wBox / (wFactor * .75),\n hLegend = hBox - hBox / (hFactor * 1.8),\n offsetText = wRect / 2,\n offsetY = self.properties.height - hBox,\n tr = 'translate(' + offsetText + ',' + offsetText * 3 + ')'; // Remove possibly existing legend, before drawing.\n\n self.svg.select('g.legend').remove(); // Reverse a copy to not alter colors array.\n\n const colors = D3_CHROMATIC_SCHEME_OrBl9.slice().reverse(),\n hRect = hLegend / steps,\n offsetYFactor = hFactor / hRect;\n let legend = self.svg.append('g').attr('class', 'legend').attr('width', wBox).attr('height', hBox).attr('transform', 'translate(0,' + offsetY + ')');\n legend.append('rect').style('fill', '#fff').attr('class', 'legend-bg').attr('width', wBox).attr('height', hBox); // Draw a rectangle around the color scale to add a border.\n\n legend.append('rect').attr('class', 'legend-bar').attr('width', wRect).attr('height', hLegend).attr('transform', tr);\n let sg = legend.append('g').attr('transform', tr); // Draw color scale.\n\n sg.selectAll('rect').data(colors).enter().append('rect').attr('y', (d, i) => i * hRect).attr('fill', (d, i) => colors[i]).attr('width', wRect).attr('height', hRect); // Determine display values for lower and upper thresholds. If the\n // minimum data value is lower than the first element in the domain\n // draw a less than sign. If the maximum data value is larger than the\n // second domain element, draw a greater than sign.\n\n let minDisplay = self.extent[0],\n maxDisplay = self.extent[1],\n addLower = false,\n addGreater = false;\n\n if (self.properties.domain) {\n if (self.properties.domain[1] < maxDisplay) addGreater = true;\n maxDisplay = self.properties.domain[1];\n if (self.properties.domain[0] > minDisplay) addLower = true;\n minDisplay = self.properties.domain[0];\n } // Draw color scale labels.\n\n\n sg.selectAll('text').data(colors).enter().append('text').text((d, i) => {\n // The last element in the colors list corresponds to the lower threshold.\n if (i === steps - 1) {\n let text = self.properties.format(minDisplay);\n if (addLower) text = `< ${text}`;\n return text;\n }\n\n return self.properties.format(self.colorScale.invertExtent(d)[0]);\n }).attr('class', (d, i) => 'text-' + i).attr('x', wRect + offsetText).attr('y', (d, i) => i * hRect + (hRect + hRect * offsetYFactor)); // Draw label for end of extent.\n\n sg.append('text').text(() => {\n let text = self.properties.format(maxDisplay);\n if (addGreater) text = `> ${text}`;\n return text;\n }).attr('x', wRect + offsetText).attr('y', offsetText * offsetYFactor * 2);\n }", "title": "" }, { "docid": "a4366c67dcecb48614a6f21dd85d9c0e", "score": "0.5093755", "text": "get legend() {\n if (this.i.legend != null)\n return this.i.legend.externalObject;\n }", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5081631", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "c77dc427915dd3bc9883e0caf73fcca7", "score": "0.5054291", "text": "function addLegend() {\n\n\tvar legendRectSize = 15;\n\tvar legendSpacing = 6;\n\n\tvar legend = lchartg.selectAll(\".legend\")\n\t\t.data(keys)\n\t\t.enter()\n\t\t.append(\"g\")\n\t\t.attr(\"class\", \"legend\")\n\t\t.on(\"mouseover\", function (d) {\n\t\t\td3.select(this).style(\"fill\", color);\n\t\t\tdocument.body.style.cursor = \"pointer\";\n\t\t})\n\t\t.on(\"mouseout\", function (d) {\n\t\t\td3.select(this).style(\"fill\", \"black\");\n\t\t\tdocument.body.style.cursor = \"auto\";\n\t\t})\n\t\t.on(\"click\", function (d) {\n\t\t\tlegendClick(d);\n\t\t\td3.select(this).style(\"opacity\", opacity);\n\t\t})\n\t\t.style(\"opacity\", opacity);\n\n\tlegend.append(\"circle\")\n\t.attr(\"r\", legendRectSize / 2)\n\t.style(\"fill\", \"none\")\n\t.style(\"stroke\", color)\n\t.style(\"stroke-width\", 2);\n\n\tlegend.append(\"text\")\n\t.attr(\"x\", legendRectSize / 2 + legendSpacing)\n\t.attr(\"y\", legendRectSize / 1.4 - legendSpacing)\n\t.text(function (d) {\n return translate(d);\n\t});\n\n\tlegend.attr(\"xpos\", function (d, i) {\n\t\tvar element = d3.select(this).node();\n\t\tvar elementwidth = 240;\n\t\tvar width = legendRectSize + legendSpacing;\n\t\tvar horz = 50 + elementwidth * i;\n\t\treturn horz;\n\t});\n\tlegend.attr(\"ypos\", 275);\n\tlegend.attr(\"transform\", function (d, i) {\n\t\tvar element = d3.select(this).node();\n\t\tvar elementwidth = 240;\n\t\tvar width = legendRectSize + legendSpacing;\n\t\tvar horz = 25 + i % 2 * elementwidth;\n\t\tvar vert = 295 + parseInt(i / 2) * 35;\n\t\treturn \"translate(\" + (horz) + \",\" + vert + \")\";\n\t});\n\n\tlegend.each(function (d) {\n\t\td3.select(\"body\")\n\t\t.append(\"div\")\n\t\t.style(\"position\", \"absolute\")\n\t\t.style(\"left\", d3.select(this).node().getBoundingClientRect().x + \"px\")\n\t\t.style(\"top\", (d3.select(this).node().getBoundingClientRect().y + 20) + \"px\")\n\t\t.attr(\"id\", \"info\" + d)\n\t\t.attr(\"class\", \"infodiv\");\n\t});\n}", "title": "" }, { "docid": "a182964c1bfeacc22146edef3b589744", "score": "0.5052472", "text": "function setLegend(){\n legend = svg.selectAll('text')\n .data(labels)\n .attr(\"x\", function(d, i) { return legendScale(i) })\n .attr(\"y\", svgHeight - legendMargin)\n .attr(\"dy\", \"0.75em\")\n .attr(\"text-anchor\", function(d) { return d.textAnchor })\n .style(\"fill\", blue)\n .text(function(d) { return d.value }) \n}", "title": "" }, { "docid": "6fdebebe5de78022e8b0a9a879d1fe77", "score": "0.50505006", "text": "function buildLegend() {\n const legend = document.getElementById('legend');\n const legendColors = document.getElementById('legend-colors');\n const legendValues = document.getElementById('legend-values');\n\n if (config.autoLegend) {\n legend.classList.add('block-ml');\n const style = map.getStyle();\n const layer = style.layers.find((i) => i.id === config.studioLayerName);\n const fill = layer.paint['fill-color'];\n // Remove the interpolate expression to get the stops\n const stops = fill.slice(3);\n stops.forEach((stop, index) => {\n // Every other value is a value, and then a color. Only iterate over the values\n if (index % 2 === 0) {\n // Default to 1 decimal unless specified in config\n const valueEl = `<div class='col align-center'>${stop.toFixed(\n typeof config.autoLegendDecimals !== 'undefined'\n ? config.autoLegendDecimals\n : 1,\n )}</div>`;\n const colorEl = `<div class='col h12' style='background-color:${\n stops[index + 1]\n }'></div>`;\n legendColors.innerHTML += colorEl;\n legendValues.innerHTML += valueEl;\n }\n });\n } else if (config.legendValues) {\n legend.classList.add('block-ml');\n config.legendValues.forEach((stop, idx) => {\n const key = `<div class='col h12' style='background-color:${config.legendColors[idx]}'></div>`;\n const value = `<div class='col align-center'>${stop}</div>`;\n legendColors.innerHTML += key;\n legendValues.innerHTML += value;\n });\n }\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5049643", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "090752c240ac99877eb1a61d72bae3d1", "score": "0.5034534", "text": "function makeLegend() {\n\n var newData = [];\n\n var sectionWidth = Math.floor(myNS.legendWidth / myNS.divisions);\n\n for (var i=0; i < myNS.legendWidth; i+= sectionWidth ) {\n newData.push(i);\n }\n\n var legend = myNS.svg2.append(\"g\")\n\t.attr(\"class\", \"legend\")\n\t.attr(\"transform\", \"translate(450,450)\");\n \n var colorScaleLin = d3.scaleLinear()\n .domain([0, newData.length-1])\n .interpolate(d3.interpolateLab)\n .range([myNS.lowColor, myNS.highColor]);\n \n legend.selectAll('rect')\n .data(newData)\n .enter()\n .append('rect')\n .attr(\"x\", function(d) { return d; })\n .attr(\"y\", 10)\n .attr(\"height\", 10)\n .attr(\"width\", sectionWidth)\n .attr('fill', function(d, i) { return colorScaleLin(i)});\n\n legend.append(\"text\")\n\t.text(\n\t function(){return d3.min(myNS.currSetCHL, \n\t\t\t\t function(d){ return d.value0;});\n\t\t })\n\t.attr(\"transform\",\"translate(0,0)\")\n\t.style(\"font-size\", \"10px\");\n \n legend.append(\"text\")\n\t.text(\n\t function(){return d3.max(myNS.currSetCHL, \n\t\t\t\t function(d){ return d.value0;});\n\t\t })\n\t.attr(\"transform\",\"translate(\"+(myNS.legendWidth-20)+\",0)\")\n\t.style(\"font-size\", \"10px\");\n}", "title": "" }, { "docid": "f5db19bec7bd34bacfb44fdb3845672e", "score": "0.5033873", "text": "function handleHover(evt, item, legend) {\n legend.chart.data.datasets[0].backgroundColor.forEach((color, index, colors) => {\n colors[index] = index === item.index || color.length === 9 ? color : color + '4D';\n });\n legend.chart.update();\n}", "title": "" }, { "docid": "724e7cccd9e9a44e99898c6c93567319", "score": "0.50308335", "text": "function initLegend() {\n d3.select(\"#legend-container\")\n .style(\"left\", \"-20%\")\n .style(\"visibility\", \"visible\");\n}", "title": "" }, { "docid": "108a70c312e5004c7400cdda5bc3a587", "score": "0.50253016", "text": "drawLegend (data) {\n const width = this.width\n const height = this.height\n const svg = this.svg\n const color = this.color\n // Prepare the legend dataset\n const legendDataset = data.series.map((d) => {\n return {\n label: d.label,\n selected: false\n }\n })\n\n const legend = svg.selectAll('.legend')\n .data(legendDataset)\n .enter().append('g')\n .attr('class', 'legend')\n .attr('transform', function (d, i) {\n return `translate(0, ${i * 20})`\n })\n\n const self = this\n legend.append('rect')\n .attr('x', width - 18)\n .attr('width', 18)\n .attr('height', 18)\n .attr('fill', function (d, i) {\n return color(d.label)\n })\n .attr('opacity', function (d, i) {\n if (d.selected) return .5\n return 1\n })\n .on('click', function (d, i) {\n console.log(d, i)\n\n legendDataset[i].selected = !legendDataset[i].selected\n\n d3.selectAll('.legend')\n .data(legendDataset).selectAll('rect').attr('fill', function (d, i) {\n return color(d.label)\n })\n .attr('opacity', function (d, i) {\n return d.selected ? 0.5 : 1\n })\n\n // Update the rect\n let updatedData = Object.assign({}, self._data )\n // remove the last one (for e.g.)\n const selection = legendDataset.filter((d) => {\n return d.selected\n }).map((d) => {\n return d.label\n })\n if (legendDataset[i].selected) {\n updatedData.series = updatedData.series.filter((m) => {\n return selection.indexOf(m.label) === -1\n })\n }\n self.update(updatedData)\n // Remove unused data\n })\n\n legend.append('text')\n .attr('x', width - 24)\n .attr('y', 9)\n .attr('dy', '.35em')\n .style('text-anchor', 'end')\n .text(function (d) { return d.label; })\n }", "title": "" } ]
314e98cf78e0875c18e4bcf784ad3dc4
Function to display who the user is buying for
[ { "docid": "1f4217fd17fd8309cf3dda1474eb7227", "score": "0.5245261", "text": "function getWhoImBuyingFor() {\n $.getJSON('/js/snowmap.json', function(data) {\n console.log(JSON.stringify(data));\n $('#your-name').text(data[getNameCookie()]);\n });\n}", "title": "" } ]
[ { "docid": "5705f85dc9db656c6d9f1cfcb7cf6155", "score": "0.6045573", "text": "function User(arg){\n return arg.msg.channel.send('Nothing to show');\n }", "title": "" }, { "docid": "ee87be2ff729f8ccfed8450c84132561", "score": "0.586843", "text": "function showCustomerScreen() {\n\tconsole.log(\"Welcome to Bamazon Sporting Goods!\");\n\t//Use inquirer to prompt user if they would like to see the items on sale today.\n\tvar saleItems = [\n\t {\n\t type: 'confirm',\n\t name: 'seeSaleItems',\n\t message: 'Would you like to see what we have on sale today? ',\n\t\tdefault: true\n\t }\n\t];\n\n\tinquirer.prompt(saleItems).then(answers => {\n\t\t//If the user confirms and wants to see sale items...\n\t\tif (answers.seeSaleItems) {\n\t\t\t//then show list of sale items and their prices.\n\t\t\tshowItemsForSale();\n\t\t}\n\n\t\t//If user decides that they really don't want to shop right now...\n\t\telse {\n\t\t\t//Then, exit application.\n\t\t\tconsole.log(\"Thanks for shopping with us! Have a nice day!\");\n\t\t\tconnection.end();\n\t\t\treturn;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "ccd69b3e42126999ad939cd0ae4ed41a", "score": "0.5841227", "text": "function who () {\n jQuery.get(\"/who\", {}, function (data, status) {\n if (status != \"success\") return;\n nicks = data.nicks;\n outputUsers();\n }, \"json\");\n }", "title": "" }, { "docid": "4c79d0051290f25406be7b2b5c1b689b", "score": "0.58142966", "text": "function getUser(){\r\n user = prompt(\"Bienvenido, ¿cual es su nombre de usuario?\\n¡Vamos a comenzar a jugar!\");\r\n getBingoCard();\r\n }", "title": "" }, { "docid": "e81389ccd4b442acbf3df6b6940c0f81", "score": "0.57478285", "text": "function show() {\n\n var http = new dw.net.HTTPClient();\n http.setTimeout(30000); //30 secs\n\n //Obtain the name:\n //http://open.weibo.com/wiki/2/users/show/en -> https://api.weibo.com/2/users/show.json\n var urlUser = 'https://cp.np-payment.gateway/v1/transactions';\n http.open('POST', urlUser);\n// http.send({\"name\":\"tinhpm\",\"job\":\"developer\"});\n var resultName = http.getText();\n if (200 !== http.statusCode) {\n\t\t return null;\n } else {\n return resultName;\n }\n//\n var rootFolder = require('dw/content/ContentMgr').getSiteLibrary().root;\n require('b_controllers/cartridge/scripts/meta').update(rootFolder);\n app.getView().render('b_core/cartridge/content/home/homepage');\n}", "title": "" }, { "docid": "be3529cda5f2faa71e9c376438d07988", "score": "0.5627359", "text": "function lookupByName() {\n const userObject = self.client.users.find((user) => {\n return user.tag.toLowerCase() == userString.toLowerCase();\n });\n if (userObject) {\n sendPm(msg, userObject, msg.text.split(' ').slice(2).join(' '));\n } else {\n self.common.reply(\n msg, 'I was unable to find that user: ' + userString +\n '\\nYou may use their account ID or Username with the ' +\n '# and number.');\n }\n }", "title": "" }, { "docid": "6f0a7104e0fd244d81588867b61a2654", "score": "0.561144", "text": "getUserInfo(customer, delivery) {\n if(delivery === 'delivery') {\n return (\n <div>\n <p>Customer Name: {customer.name}, tel. {customer.telephone}</p>\n <p>Delivery Method: Pizza Delivered to {customer.address}, {customer.postalCode} {customer.city}</p>\n </div>\n );\n } else {\n return (\n <div>\n <p>Customer Name: {customer.name}, tel. {customer.telephone}</p>\n <p>Delivery Method: Pickup at PizzeriaUno</p>\n </div>\n );\n }\n }", "title": "" }, { "docid": "3d03620d5182549e13d1e1663c23e0e2", "score": "0.5590128", "text": "getName() {\n return (this.record.user || new latte.User()).toString();\n }", "title": "" }, { "docid": "ff24b0275308a8bfe447f9ab5befebbf", "score": "0.5585868", "text": "infoItems() {\n const items = new ItemList();\n const user = this.attrs.user;\n\n items.add('joined', app.translator.trans('core.forum.user.joined_date_text', { ago: humanTime(user.joinTime()) }));\n\n return items;\n }", "title": "" }, { "docid": "693351ed5d2236803ea0393ea1a0eb2b", "score": "0.5568895", "text": "function showUserGifts(){\n \n // get from database mission type assigned for this day and appends to HTML\n appendGifts(userGifts,'neutral')\n\n showProgress()\n\n }", "title": "" }, { "docid": "c330ef73778349341082d6425cbbb90c", "score": "0.556883", "text": "function showCurrentOsmUser () {\n\n\tif (cashMapAuth.authenticated ()) {\n\t\tcashMapAuth.xhr({\n\t\t\tmethod: \"GET\",\n\t\t\tpath: \"/api/0.6/user/details\"\n\n\t\t}, function(err, details) {\n\t\t\tif (err) {\n\n\t\t\t\tsrvLog ('auth error: ' + err);\n\n\t\t\t} else {\n\n\t\t\t\t$('#osmUser').html(details.getElementsByTagName('user')[0].getAttribute(\"display_name\"));\n\t\t\t\t$(\"#osmLoginToggle\").html('<i class=\"fa fa-sign-out\"></i>&nbsp;&nbsp;Abmelden');\n\n\t\t\t}\n\n\t\t});\n\t} else {\n\n\t\t$(\"#osmLoginToggle\").html('<i class=\"fa fa-sign-in\"></i>&nbsp;&nbsp;Anmelden');\n\t\t$('#osmUser').html('nicht angemeldet');\n\n\t}\n}", "title": "" }, { "docid": "51e9f26f067048d918b10f87f4599db7", "score": "0.556551", "text": "function getUser() {\n\tvar user = wialon.core.Session.getInstance().getCurrUser(); // get current user\n // print message \n\tif (!user) msg(\"You are not logged, click 'login' button\"); // user not exists\n\telse msg(\"You are logged as '\" + user.getName() + \"'\"); // print current user name\n}", "title": "" }, { "docid": "56dfaa9c4937c9cd36d4361a2f66b87f", "score": "0.55358523", "text": "function getPoweredUp(who){\n if(who===\"e\"){\n enemyPoweredUp=true;\n }\n else if(who===\"p\"){\n poweredUp=true;\n }\n powerUp.visible=false;\n}", "title": "" }, { "docid": "1c8643c1bfb87e0a33cdf40b7f2f7fcf", "score": "0.5521219", "text": "function allItemsBought(buyerID) {\n\n}", "title": "" }, { "docid": "092dc5d36f29a8c1271b7380cd5f3a4d", "score": "0.5517095", "text": "function showCustomerReport(customer){\n console.log(`Customer Name: ${customer[\"Account Holder\"]}`);\n printPhoneNumbers(customer[\"Phone Numbers\"]);\n showTransactions(customer[\"Transactions\"], customer[\"Starting Balance\"]);\n if (customer[\"Favorite Melon\"] === \"Casaba\" || customer[\"Number of Pets\"] > 5){\n console.log(\"Congratulations on being a premiere customer!\");\n } else {\n console.log(\"Thank you for being a valued customer!\");\n }\n}", "title": "" }, { "docid": "6d8da78e3247a1992046de175c226a18", "score": "0.5515566", "text": "getHotseatName() {\n return Users.findOne({pid: this.props.team.members[this.props.hotseat_index].pid}).name;\n }", "title": "" }, { "docid": "aebdf4aa23afb3a593e5e58ac1e7b05f", "score": "0.5487905", "text": "function sender(from) {\n return \"<span class=\\\"msg-sender\\\">From: \" + from + \"</span><br>\";\n }", "title": "" }, { "docid": "55260e6b7b6b0b42e8cc594ac43a79f1", "score": "0.54772997", "text": "getSpecificUser() {\n\n}", "title": "" }, { "docid": "cb37e85217e59bb19b1a6745914a7a13", "score": "0.54691005", "text": "function displayInventory() {\n connection.query(\"SELECT item_id, product_name, department_name, price FROM bamazon_db.products\", function (err, res) {\n if (err) throw err;\n var inventory = cTable.getTable(res);\n console.log(\"\\n\" + \"ALL INVENTORY: \" + \"\\n\" + inventory);\n itemToBuy(); // call function to prompt cust & ask what they want to buy\n })\n}", "title": "" }, { "docid": "5cf83e17c4edbbd641af7ee8362cce90", "score": "0.5458793", "text": "function information(object){\n console.log(user1)\n}", "title": "" }, { "docid": "86d06ba25c7df764d728611fa90adab7", "score": "0.54565674", "text": "function userName(user, isAlive) {\n Dom.div(function () {\n UserViews.bigName(user);\n \n if (!isAlive) { // the user is not alive\n Dom.style({\n textDecoration: 'line-through',\n color: '#777'\n });\n }\n });\n }", "title": "" }, { "docid": "a31b890f4dd1c6e0aeafa134e48c4292", "score": "0.54517376", "text": "function updateBuyerName() {\n\t$(\"#buyerName\").text(userName);\n}", "title": "" }, { "docid": "7e47cfcad82ea82da4d88afed0bdc0a8", "score": "0.5439832", "text": "function build_owner_name(username, company) {\n\t\treturn username.toLowerCase() + '.' + company;\n\t}", "title": "" }, { "docid": "7e47cfcad82ea82da4d88afed0bdc0a8", "score": "0.5439832", "text": "function build_owner_name(username, company) {\n\t\treturn username.toLowerCase() + '.' + company;\n\t}", "title": "" }, { "docid": "45281bc1e05172b3e78642c0a8139a96", "score": "0.5425775", "text": "function setOpenedBy() {\n\t\t// Check if user exists in sys_user table\n\t\tvar oUser = new GlideRecord('sys_user');\n\t\tif (!oUser.get('name', oData.opened_by)) {\n\t\t\t// if not, set to 'SAP User'\n\t\t\toGr.opened_by.setDisplayValue('SAP User');\n\t\t\toGr.description += \"\\n\\n\" + \"Submitted by \" + oData.opened_by;\n\t\t} else {\n\t\t\t// if yes, set to name sent in request\n\t\t\toGr.opened_by.setDisplayValue(oData.opened_by);\n\t\t\toGr.description += \"\\n\\n\" + \"Submitted by \" + oGr.opened_by.getDisplayValue();\n\t\t}\n\t}", "title": "" }, { "docid": "9fc595ee0e898d5f2d211e2d6e4373f1", "score": "0.5411317", "text": "function displayName(){\n console.log(\"Kevin\");\n}", "title": "" }, { "docid": "1fdff416b30b6a42f331d99013ac2292", "score": "0.5399942", "text": "function getUserInfo() { console.log('get user info') }", "title": "" }, { "docid": "f35235ac8f3144fd705036b3091fd160", "score": "0.5385958", "text": "function set_salutation(items) {\n let hour = new Date().getHours();\n return greeting[hour] + ', ' + items.text_username + '.';\n}", "title": "" }, { "docid": "d8dd551b525dbfafcf3271f140276962", "score": "0.5380824", "text": "function userInfo(user, guild) {\r\n var finalString = '';\r\n \r\n finalString += '**' + user.username + '**, da ID de **' + user.id + '**';\r\n \r\n var userCreated = user.createdAt.toString().split(' ');\r\n finalString += ', Criado em **' + userCreated[1] + ' ' + userCreated[2] + ', ' + userCreated[3] + '**.'\r\n \r\n finalString += ' Alem disso, ele tem ** ' + userData[user.id + guild.id].messagesSent + ' menssagens** neste server.' \r\n \r\n return finalString;\r\n }", "title": "" }, { "docid": "f6a226d2c7abcbac0bd1d6dd39ebb3a4", "score": "0.5371193", "text": "function activeUserInfo(){\n var username = this.username;\n var sessionCount = 0;\n activeUsers = XNAT.data['/xapi/users/active'];\n if (username && activeUsers && activeUsers[username] && activeUsers[username].sessions.length) {\n sessionCount = activeUsers[username].sessions.length\n }\n if (sessionCount) {\n return spawn('!', [\n ['i.hidden.sorting', zeroPad(sessionCount, 6)],\n ['a.active-user', {\n title: username + ': kill ' + sessionCount + ' active session(s)',\n href: '#!',\n style: { display: 'block', padding: '2px' }\n }, [['img', { src: XNAT.url.rootUrl('/images/cg.gif') }]]]\n ])\n }\n else {\n return '<i class=\"hidden\">-1</i>&mdash;'\n }\n }", "title": "" }, { "docid": "a5a4d1403a7221adfb1791347ca89a03", "score": "0.536498", "text": "function getUserInfo() {\n\n}", "title": "" }, { "docid": "6620032935a2e454b843509c8ee08442", "score": "0.536219", "text": "buy(amount) {\n // Let the user know that they just exchanged off-network goods for network tokens\n console.log(`You bought $${amount} of tokens from our Central Payment Processor off-network`);\n }", "title": "" }, { "docid": "95a2a8476f3e9db6b30c3b13018360a6", "score": "0.5346648", "text": "function showUser() {\n let name = 'Dahlia'\n let age = '44';\n let phoneNumber = '604 111 2222';\n let street = 'Laurel st.';\n let postalCode = 'V1V 2V6';\n let maritalStatus = false;\n\n console.log('Your name: %s\\nYour age: %s\\nYour phone number: %s\\nYour street: %s\\nYour postal code: %s\\nMarital Status: %s', name, age, phoneNumber, street, postalCode, maritalStatus);\n}", "title": "" }, { "docid": "35fd414ac55df9afef67ba8ea6effc29", "score": "0.5345941", "text": "currentUserName(state) {\n if (state.firebaseUserObject !== null && typeof state.firebaseUserObject !== \"undefined\") \n {\n if (state.firebaseUserObject.user)\n {\n if(state.firebaseUserObject.user.displayName === null) // just registered user. Who has not changed his profile name and pic\n {\n return \"newcomer\"\n }\n else\n { \n return state.firebaseUserObject.user.displayName;\n }\n }\n else if (state.firebaseUserObject.displayName) \n {\n return state.firebaseUserObject.displayName \n }\n }\n else return \"Unauthorized user\";\n }", "title": "" }, { "docid": "2cbdd3b9b2e372ca45ee1999799b2bc1", "score": "0.5345074", "text": "get userDisplayName() {\n return this._data.display_name;\n }", "title": "" }, { "docid": "a0642c27c70ae9ff525c9541f84afc02", "score": "0.53401124", "text": "getStaffNameOnOrder(){\n \n }", "title": "" }, { "docid": "592c4bae419dd4678a8d11a0b385a7f0", "score": "0.53277797", "text": "function showCurrentCustomerWishList() {\n if (currentCustomer.isLoggedIn()) {\n Alloy.Router.navigateToCart({\n switchToWishList : true\n });\n }\n}", "title": "" }, { "docid": "d6ac901ec4a97140023683609e1fee30", "score": "0.5324232", "text": "function updateDisplayUserName(){\n let user = firebase.auth().currentUser;\n \n if(user){ \n document.querySelector(\".userNameMenuDisplay\").innerHTML = user.displayName;\n }\n}", "title": "" }, { "docid": "d6ac901ec4a97140023683609e1fee30", "score": "0.5324232", "text": "function updateDisplayUserName(){\n let user = firebase.auth().currentUser;\n \n if(user){ \n document.querySelector(\".userNameMenuDisplay\").innerHTML = user.displayName;\n }\n}", "title": "" }, { "docid": "1ac9470392ae6194f3432fb2d4592d04", "score": "0.5323967", "text": "function getUserInfo() {}", "title": "" }, { "docid": "6c836b82cbadb7aef0dcc0df3576a4c9", "score": "0.5322449", "text": "function yourFutureCareer() {\n\tvar career = Math.random()\n\tif (career <= 0.32) {\n\t\treturn 'FrontEnd Developer'\n\t} else if (career <= 0.65) {\n\t\treturn 'BackEnd Developer'\n\t} else {\n\t\treturn 'Full-Stack Developer'\n\t}\n}", "title": "" }, { "docid": "b6805cf2994933b464e7232f24befff6", "score": "0.5317672", "text": "function displayProducts() {\n console.log(\"\\nShowing current inventory...\\n\".info);\n connection.query(\n \"SELECT item_id,product_name,department_name,price,stock_quantity FROM products\", \n function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n promptBuyer();\n });\n}", "title": "" }, { "docid": "deafcc4a7dfd508c6d40dd5514c65f72", "score": "0.5312603", "text": "toString() {\n return this.uname;\n }", "title": "" }, { "docid": "63f58a4b7978fa54e66ca637aa11dcb4", "score": "0.5310049", "text": "function getUserInfo() {\n // Users Current will return information about the user who owns the OAuth\n // token registered above.\n return client.request('GET', 'users/current').then(response => response.body).catch(error => console.log('Error firing from getUserInfo', error));\n}", "title": "" }, { "docid": "2b92906c31ec78949d276596318bff72", "score": "0.53062826", "text": "function getOwnerFullName(house) {\n return house.currentOwner.firstName + \" \" + house.currentOwner.lastName;\n}", "title": "" }, { "docid": "97a8cf8a8dfd52b28ccc01b986ce50cd", "score": "0.5300476", "text": "function me(req, res) {\n res.send(userModel.getClientUser(req.user));\n}", "title": "" }, { "docid": "e0bd9afb2c8357a4b315647dde9b09e3", "score": "0.5281167", "text": "function allInfo() {\n connection.query(\"SELECT * FROM products\",\n function(error, results) {\n if (error) throw error;\n for (var i = 0; i < results.length; i++) {\n \tconsole.log(\"ID \" + results[i].item_id + \" | \" + results[i].product_name + \" | $\" + results[i].price);\n }\n // run the function to prompt user\n promptCustomer();\n });\n}", "title": "" }, { "docid": "65e5bb3826f21d5e219bde4b5074ecc4", "score": "0.5277671", "text": "getCreatedBy() {\n return this.getData().createdBy;\n }", "title": "" }, { "docid": "14fcd738b6b2c9c2d4082bb423f0725d", "score": "0.5266486", "text": "function getUserName() {\n //return firebase.auth().currentUser.displayName;\n var displayName = firebase.auth().currentUser.displayName;\n return displayName;\n \n}", "title": "" }, { "docid": "46351a519482654cb5533b9a74816ccc", "score": "0.52479446", "text": "async function display() {\n try {\n let customer = await getCustomer(1);\n console.log('Customer', customer);\n if (customer.isGold) {\n let movies = await getTopMovies();\n console.log('Movies', movies);\n await sendEmail(customer.email, movies)\n console.log('Email sent to:', customer.email);\n }\n } catch (error) {\n console.log('Error', error);\n }\n}", "title": "" }, { "docid": "9d43f9882d4e8332779529d9a0187e77", "score": "0.5242164", "text": "function greet(name, owner) {\n return (name === owner ? \"Hello boss\" : \"Hello guest\");\n}", "title": "" }, { "docid": "7934a60970637dee4792de156b64c932", "score": "0.5242076", "text": "function takeShower() {\n return 'Showering'\n}", "title": "" }, { "docid": "c3c24a84d079a9a8e0c5d882e6d1b1ee", "score": "0.52367646", "text": "function displayUserInfo() {\n const name = currentUser.name;\n const username = currentUser.username;\n const account_date = currentUser.createdAt;\n $(\"#profile-name\").text(`Name: ${name}`);\n $(\"#profile-username\").text(`Username: ${username}`);\n $(\"#profile-account-date\").text(`Account Created: ${account_date}`);\n $userProfileInfo.show();\n }", "title": "" }, { "docid": "8c79bf3406db3254ac4c9c879496b9dd", "score": "0.5226882", "text": "function getSupport(agent){\n //Varun, 2 members named XXX and XXX are available this weekend.\n console.log(\"getSupport\");\n const userContext = agent.getContext(\"user\"); \n const regionContext = agent.getContext(\"currentregion\");\n if (!userContext) {\n agent.add(`Sorry, I didn't recognise recognise you.`);\n agent.add(`What is your name?`);\n return;\n }\n let user = userContext.parameters.user;\n let region = regionContext.parameters.currentregion;\n console.log(region);\n let weekendemps = alasql(\n `select employename from usage where \n region = '${region}' \n and weekendavailable='yes'`\n ); \n console.log(weekendemps); \n let emptext = \"\",count=0;\n weekendemps.forEach(function(elem){\n emptext+=`${elem.employename}, `\n });\n\n let resp = `${user.username}, ${weekendemps.length} members named ${emptext} are available this weekend.`;\n console.log(resp);\n agent.add(resp);\n }", "title": "" }, { "docid": "1c167eb5c84fd8119e4f0d4fd5810e97", "score": "0.5225846", "text": "getRequestedForDisplayName() {}", "title": "" }, { "docid": "428d67353f876e620474b63429199e81", "score": "0.5225674", "text": "function getInfo(name, number, business) {\n console.log('Account Holder Name: ' + name);\n console.log('Account Holder Number: ' + number);\n console.log('Business Name: ' + business);\n}", "title": "" }, { "docid": "5d9cc3f48b468a483c0dae6e34aaa8ca", "score": "0.5225232", "text": "getShopDescription(character) {\n return \"Party gains +3 Max AP for 30 days.\";\n }", "title": "" }, { "docid": "5645650aecf4c26f4d44ce4c0b3de86c", "score": "0.5224516", "text": "function userName(user){\n var name = '';\n \n if(user) { name = user.first; }\n \n return name;\n}", "title": "" }, { "docid": "f95d723b899539b992ded02a1ba9ccb6", "score": "0.5224259", "text": "function info(msg) {\r\n let users = 0;\r\n let ul = \"\";\r\n\r\n // get all the guilds\r\n const a = msg.user.guilds.array();\r\n\r\n // loop through all guilds\r\n for (let g in a) {\r\n\r\n // if he guild has members\r\n if (a[g].members) {\r\n \r\n // get all users\r\n const x = a[g].members.array();\r\n \r\n // loop through all users\r\n for (let u in x) {\r\n\r\n // if the user exists, and we havent already counted it\r\n if (!isNaN(u) && !ul.contains(x[u].user.id)) {\r\n\r\n // add it to the list so we can check for it later\r\n ul += x[u].user.id + \"\\n\";\r\n \r\n // increase the user coutn\r\n users++;\r\n }\r\n }\r\n }\r\n }\r\n \r\n const embed = new Discord.RichEmbed();\r\n embed.setColor(0);\r\n embed.setAuthor(bot.user.username, bot.user.avatarURL);\r\n embed.setDescription(`\\nHai! My name is ${bot.user.username}\\n[Invite me](https://discordapp.com/oauth2/authorize?client_id=248305269858107402&scope=bot&permissions=8)`);\r\n\r\n // embed.addField('Help Command', p+'help', true);\r\n embed.addField('Servers', bot.guilds.size, true);\r\n embed.addField('Users', users, true);\r\n embed.addField('Author', '[Eve](https://osu.ppy.sh/u/5013564)', true);\r\n embed.addField('Source', '[Github](https://github.com/ayyEve/Cybel)', true);\r\n msg.channel.sendMessage(embed).then(none).catch(console.err);\r\n}", "title": "" }, { "docid": "717e45228dafcc4ca20b4b3355b64c28", "score": "0.52228504", "text": "function getProductSourceText(online, giftWrappable) {\n var toReturn = \"\";\n if (online) {\n toReturn += \"Ships from and sold online.\";\n if (giftWrappable) {\n toReturn += \" Gift-wrap available.\";\n }\n } else {\n toReturn += \"Pick-up in store only.\";\n }\n return toReturn;\n}", "title": "" }, { "docid": "dddcf76f859762aab81d898b73f2b074", "score": "0.5222314", "text": "extractCreatedBy() {\n return this.getCreatedBy() || '';\n }", "title": "" }, { "docid": "7b87366a5694a88dac7e4c1146cb3005", "score": "0.52174443", "text": "get userDisplayName() {\n return this._data.user_name;\n }", "title": "" }, { "docid": "04315ce21e86d0def0472571943b28b2", "score": "0.5211072", "text": "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "title": "" }, { "docid": "ae6b71226df6dc88454f7803f55c297a", "score": "0.5207867", "text": "function print_acct_info (name, number, businessName){\n console.log(\"Account Holder Name: \" + name);\n console.log(\"Account Number \" + number);\n console.log(\"Business Name\" + businessName);\n \n}", "title": "" }, { "docid": "7683fa0e694b6234feea374457b35c88", "score": "0.52050024", "text": "function append_greeting() {\r\n\r\n var current_user = get_current_user();\r\n\r\n var greeting = 'Hello, ' + current_user.u_username;\r\n\r\n $('.footer-datetime-greeting .greeting').append(greeting);\r\n\r\n}", "title": "" }, { "docid": "3f074ff3a62e8998dc2467b3e9efcac9", "score": "0.52041525", "text": "function productsDisplay() {\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n console.table(res);\n //our inquirer prompt\n askCustomer(res);\n });\n}", "title": "" }, { "docid": "8386400f50e862543fab86b052c78b17", "score": "0.5203058", "text": "suggestownerInfo() {\n const currentUser = Meteor.user();\n return Meteor.users.find(\n {\n $and: [\n {\n \"profile.follower\": {\n $not: currentUser._id\n }\n },\n {\n _id: {\n $not: currentUser._id\n }\n }\n ]\n },\n {\n sort: {\n \"profile.follower\": -1\n },\n limit: 1\n }\n );\n }", "title": "" }, { "docid": "3606b6bd15cfa92d8017d6f47634dabc", "score": "0.5201781", "text": "function update_user(user){\n\tlet user_block = document.getElementById(\"current-user\");\n\tif (user == null){\n\t\tuser_block.innerHTML = '';\n\t}\n\telse {\n\t\tlet userText = document.createTextNode(String(user)+\"'s Calendar!\");\n\t\tuser_block.appendChild(userText);\n\t}\n}", "title": "" }, { "docid": "99bfbd89bc979808ebae884c0160f294", "score": "0.51993346", "text": "function displaytheInventory() {\n\t\n \tqueryString = 'SELECT * FROM products';\n\n \tconnection.query(queryString, function(err, data) {\n if (err) throw err;\n\n console.log('Inventory in Stock:');\n console.log('--------------------------------------------------------------------------------------------------------------------------------\\n');\n\n var invent = '';\n for (var i = 0; i < data.length; i++) {\n \tinvent = '';\n \tinvent += 'Item ID: ' +data[i].item_id + ' // ';\n \tinvent += 'Product Name: ' + data[i].product_name + ' // ';\n \tinvent += 'Department: ' + data[i].department_name + ' // ';\n \tinvent += 'Price: $' + data[i].price + '\\n';\n \t\n \tconsole.log(invent);\n }\n\n console.log(\"---------------------------------------------------------------------------------------------------------------------------------\\n\");\n\n //Prompt the customer for item/quantity they would like to purchase\n promptCustPurchase();\n \n})\n}", "title": "" }, { "docid": "92454b8406383e5ad229c12c127c7be1", "score": "0.51985013", "text": "getUserName() {}", "title": "" }, { "docid": "f28e7ba18ff4c6eb94aeaf8a3ef336a4", "score": "0.5194541", "text": "function showCustomer(person) {\n const item = reviews[person];\n userImage.src = item.img;\n userName.textContent = item.name;\n userJob.textContent = item.job;\n userInfo.textContent = item.text;\n}", "title": "" }, { "docid": "0478aff1fa23679ff60094104d083f8a", "score": "0.51929295", "text": "async function useridToName(userID){\n\tlet customerDetails = await getCustomerDetails(userID);\n\tlet fullName = customerDetails.firstName+\" \"+customerDetails.lastName;\n\treturn fullName;\n}", "title": "" }, { "docid": "dc016ad06059b621db49a43509c447f2", "score": "0.51922184", "text": "customizeProposerIcon(username) {\n if (username === \"Dilsher\") return \"directions_bus\";\n return \"event_seat\";\n }", "title": "" }, { "docid": "0f077cc92c5642e64cfc27bbf299a2ba", "score": "0.51909727", "text": "function grGetUserInfo(grUserId){\n\t\t\tvar GOODREADS_API_USER = 'http://fictionset.in/admin/grApi.php?api=getUser&userId=' + grUserId;\n\t\t var grDoUser = function(data) {\n\t\t \tconsole.log(data);\n\t\t \tconsole.log('user data ...');\n\t\t\t\t //console.log(data.shelves.user_shelf);\n\t\t\t\t\tvar grUser = data.user;\n\t\t\t\t\t$scope.grUser = grUser;\n\t\t\t\t\tconsole.log(grUser);\n\t\t\t\t\t// go get the books on the shelves...\n\t\t\t\t\tgrGetUserShelves(grUser, grUserId);\n\t\t\t};\t\n\t\t\tDataSource.get(GOODREADS_API_USER, grDoUser); //get api and then do action with it.\t\n\t\t}", "title": "" }, { "docid": "80eb8efbc82ae48c3ba451ea76c5228b", "score": "0.51899713", "text": "function getOwnerName(pet) {\n return pet.ownerName;\n}", "title": "" }, { "docid": "2beb490d5b2dd2589de149151060d56d", "score": "0.51877034", "text": "get TwineScript_Assignee() {}", "title": "" }, { "docid": "541f20126903212c2a0b4c99a0ebc255", "score": "0.51829225", "text": "function displayUsername(account) {\n const username = account.username;\n $('.username').text(username)\n}", "title": "" }, { "docid": "bae3b4de25ff84829f069c71a02de8ae", "score": "0.51800394", "text": "show (req, res) { res.send('ดูข้อมูลผู้ใช้งาน: ' + req.params.userId)\n }", "title": "" }, { "docid": "7266a3b8572cead1273e1673a6dffe4f", "score": "0.51787513", "text": "function greetCustomer(){\r\n inquirer.prompt(questions).then(function (answers) {\r\n console.log('\\nWe are checking your order:');\r\n console.log(JSON.stringify(answers, null, ' '));\r\n purchase(answers);\r\n });\r\n}", "title": "" }, { "docid": "681e5370bf0de71c5439ffec5c4b6321", "score": "0.5178674", "text": "isCurrentUserOwner() {\n const {comment} = this.props;\n return Director.getProfile().id === comment.createdBy;\n }", "title": "" }, { "docid": "8916292a407e66ecabef425906e4823c", "score": "0.51770025", "text": "function getActiveUser() {\n // TODO: implement authentication\n return \"-JsqE8CQ9Dg7LE0OKQ2P\"\n}", "title": "" }, { "docid": "107bd53243405457d609f0557e70f1e0", "score": "0.51751995", "text": "getPlayerInfo() {\n\treturn Session.get(\"selectedStatistics\");\n }", "title": "" }, { "docid": "2d9f44065d9f6fde3690f73f535b6955", "score": "0.51695794", "text": "function displayCurrentTowerInfo(){\n var tower = new towerTypes[game.currentTower]();\n\n var $towerDamage = $(\"#towerDamage\");\n var $towerFreeze = $(\"#towerFreeze\");\n\n //freezetower doet geen damage, maar heeft wel een freeze %\n if(tower instanceof FreezeTower){\n $towerDamage.parent().css('display', 'none');\n $towerFreeze.parent().css('display', 'block');\n $towerFreeze.text(parseInt(FreezeCondition.prototype.speedMultiplier * 100) + \"%\");\n } else {\n $towerDamage.parent().css('display', 'block');\n $towerFreeze.parent().css('display', 'none');\n $towerDamage.text(Math.floor(tower.damage));\n }\n\n $(\"#towerInfo\").css('visibility', 'visible');\n $(\"#towerImg\").attr(\"src\", \"img/towers/\" + tower.image);\n $(\"#towerRange\").text(Math.floor(tower.range));\n $('#buyPrice').text(tower.cost + \" coins\").parent().css('display', 'inline-block'); // zet de tekst en maakt het zichtbaar\n $(\"#upgradeCost\").text(tower.upgradeCost + \" coins\");\n $('#sellPrice').text(Math.floor(tower.value) + \" coins\");\n\n $(\"#towerLevel\").parent().css('display', 'none');\n $(\"#upgradeTower\").css('display', 'none');\n $(\"#sellTower\").css('display', 'none');\n}", "title": "" }, { "docid": "ef4d9081a39ce5d1a4f542349e557bcc", "score": "0.51692903", "text": "function getUserInfoMarkup() {\n\t\tvar s=[];\n\t\tvar usr = app.currentUserObj;\n\t\t\n\t\ts[s.length] = \"<b>User: \";\n\t\ts[s.length] = usr.userFullName;\n\t\ts[s.length] = \"</b>\";\n\t\t\n\t\ts[s.length] = \"<p>\";\n\t\ts[s.length] = usr.aboutUser;\n\t\ts[s.length] = \"</p>\";\n\t\t\n\t\ts[s.length] = \"<center>\";\n\t\ts[s.length] = \"<p>\";\n\t\t\n\t\t/*\n\t\ts[s.length] = \"<button class='signupBtn' \";\n\t\ts[s.length] = \"style='width:80px;' \";\t\t\n\t\ts[s.length] = \"onclick=\"+Q;\n\t\t// true value means to go into edit mode...\n\t\ts[s.length] = \"showUserProfilePanel(\"+app.currentUserId+\", true)\"+Q+\" \";\n\t\ts[s.length] = \">\";\n\t\ts[s.length] = \"Edit Profile\";\n\t\ts[s.length] = \"</button>&nbsp;&nbsp;\";\n\t\t*/\n\t\t\n\t\ts[s.length] = \"<button class='genericBtn' \";\n\t\ts[s.length] = \"style='width:80px;' \";\n\t\ts[s.length] = \"onclick=\"+Q+\"showLogoffPanel()\"+Q+\" \";\n\t\ts[s.length] = \">\";\n\t\ts[s.length] = \"Log Off\";\n\t\ts[s.length] = \"</button>\";\n\t\ts[s.length] = \"</p>\";\n\t\ts[s.length] = \"</center>\";\n\t\t\n\t\ts[s.length] = getBlurb();\n\t\t\n\t\treturn s.join(\"\");\n\t}", "title": "" }, { "docid": "c5fce0b59a5082a9e1920f3f6e535eab", "score": "0.51681596", "text": "function whatCanWeBuy () {\n let userPurchaseItem;\n let userPurchaseNumber;\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n for (let i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" Product: \" + res[i].product_name + \" Cost: $\" + res[i].price);\n };\n inquirer.prompt([\n {\n type: \"input\",\n name: \"purchaseItem\",\n message: \"What is the ID of the item you wish to purchase?\"\n }]).then(function(purchaseObj) {\n userPurchaseItem=purchaseObj.purchaseItem;\n inquirer.prompt([\n {\n type: \"input\",\n name: \"number\",\n message: \"How many do you wish to purchase?\"\n }]).then(function(numberObj) {\n userPurchaseNumber=numberObj.number;\n canYouBuyThis(userPurchaseNumber, userPurchaseItem);\n });\n\n });\n });\n}", "title": "" }, { "docid": "79835bad5739f2389834c19bd3abaa8c", "score": "0.5162884", "text": "function displayName(){\n console.log(\"My name is Sachin\");\n}", "title": "" }, { "docid": "b9764d08be4b53b574cbdeba1ee845d1", "score": "0.5157942", "text": "function showFormattedInfo(user) {\n console.log(\"User Info\", `\n id: ${user.id}\n username: ${user.username}\n firstName: ${user.firstName}\n `);\n}", "title": "" }, { "docid": "4ab7ed51dad6985c46af993bed4df976", "score": "0.5153384", "text": "function overview() {\n var users = Db.shared.get('users');\n \n Ui.list(function () {\n // rendering the items\n for (var user in users) {\n if (users.hasOwnProperty(user)) {\n citizenItem(user, users[user]);\n }\n }\n });\n }", "title": "" }, { "docid": "9c26fce6782a3dae8c08615a5dc04f9f", "score": "0.5153248", "text": "function showMessageBasedOnUser(user) {\n\treturn totalMessagesCheck(user) || totalBitsDonatedCheck(user) || isUserWhitelisted(user);\n}", "title": "" }, { "docid": "e80819cbccbe06c5452a96ba9e69172a", "score": "0.51491815", "text": "function returnTotalToUser() {\n var total = currentItem.price * currentItem.quantity_requested;\n console.log('Purchase successful! Your total: $%s', total);\n setTimeout(promptForAdditionalPurchases, 1500);\n}", "title": "" }, { "docid": "db1f3cd5db1808cebac3afbfd90f43c5", "score": "0.5148295", "text": "function showLoggedUser(){\n\tuserGet(processUserGetSuccess, processUserGetError);\n}", "title": "" }, { "docid": "1e0049f11b4bf44d0acd558663245598", "score": "0.51393044", "text": "function setUserInfo(clientInfo) {\n //Ti.API.info('user info ' + JSON.stringify(clientInfo));\n if (clientInfo.username) {\n username.setText('user: ' + clientInfo.username);\n } else if (clientInfo.email) {\n username.setText('user: ' + clientInfo.email);\n } else {\n username.setText('');\n }\n syncData.checkPurchases(clientInfo.id, handlePurchases);\n}", "title": "" }, { "docid": "c9c878eb8caf99572e608ff1825542c1", "score": "0.51389086", "text": "function printUserInfo() {\n if (userInfo) {\n console.log(\"User Info, I am outside wiht userInfo:\", userInfo);\n } else {\n console.log(\"User information not available yet.\");\n }\n}", "title": "" }, { "docid": "51ccf9d96ad329989080bf9fbd0f5363", "score": "0.51309067", "text": "function insuredParty() { return \"insuredParty\" }", "title": "" }, { "docid": "88b98efe744df1364c9886ddfbc9584d", "score": "0.51306754", "text": "function userName(){\n var name = prompt(\"Name: \");\n log(name);\n }", "title": "" }, { "docid": "ac2c2a2b97516306372afcf8425652a1", "score": "0.51277775", "text": "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "title": "" }, { "docid": "ac2c2a2b97516306372afcf8425652a1", "score": "0.51277775", "text": "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "title": "" }, { "docid": "ac2c2a2b97516306372afcf8425652a1", "score": "0.51277775", "text": "function getUserName() {\n return firebase.auth().currentUser.displayName;\n}", "title": "" }, { "docid": "02876741317897b0ed1edd1d5baefa30", "score": "0.51259625", "text": "function mgrDisplayName(mgr) {\n var display = $('#' + mgr).html().split(\" - \")[0];\n return (display);\n}", "title": "" }, { "docid": "11e7bdbbb17a47287a470d42d34efa34", "score": "0.51246214", "text": "function getNick() {\n // Return the username of the user\n return con.username;\n}", "title": "" } ]
ddff6d4c228e76121f9d8198d107c753
Handle editing the verified email.
[ { "docid": "c1f0542ea3aa32be6f1c407ac8af80da", "score": "0.6970544", "text": "function editVerifiedEmail(results){\n var src = $('#email_item'),\n display = results.pending.data;\n\n src.find('.secondary-wrapper').show().find('.unverified').text(display);\n src.find('.verified_pressent').show();\n src.find('.edit_btn').closest('div').hide();\n }", "title": "" } ]
[ { "docid": "f8bd1b2dc8932c31386535e0a119656d", "score": "0.68859565", "text": "function onEdit(e){\nsendEmail(); \n}", "title": "" }, { "docid": "094492db1681d448860885f47b9a1d57", "score": "0.68049556", "text": "function changeEmailRequestCallback(data){\n if(data.success) {\n var results = data.data.result;\n if (data.code != error_codes.no_change && data.code == error_codes.profile_updated_successfully) {\n if ('pending' in data.data.result) {\n editVerifiedEmail(results);\n } else {\n editFirstEmail(results.primary);\n }\n }\n closeLine(line);\n }else if(!data.success){\n handleErrors(data, form.attr('id'));\n }\n }", "title": "" }, { "docid": "059f4628ce5530f00dcb24a92e6519fd", "score": "0.66166824", "text": "function editFirstEmail(results){\n var src = $('#email_item'),\n display = results.data;\n\n src.find('.data-label, .unverified').text(display);\n src.find('[name=\"email\"]').update_version_control(display);\n }", "title": "" }, { "docid": "c9fef3b5e34ff2c1c1eaaab00fd5b2bc", "score": "0.6540516", "text": "function updateEmail(e) {\n email = e.target.value;\n }", "title": "" }, { "docid": "4fbc495144340693519a0dce04b3adbd", "score": "0.6325627", "text": "function onVerifyClick() {\n if (validateEmail(email)) {\n actions.requestEmailVerifcation(email);\n }\n }", "title": "" }, { "docid": "fe8766201678d4fe340a293ca431e73f", "score": "0.6210729", "text": "function iLoginEditEmail(entityId,etLink,apiUrl,sessId,lblMessage)\n\t{\n\t\tif(confirm(lblMessage))\n\t\t{\n\t\t\tvar mcForm = getMCForm(etLink,sessId,apiUrl);\n\t\t\tmcForm.appendChild(setEntityId(entityId));\n\t\t\tmcForm.appendChild(setEntityType('Email'));\n\t\t\tmcForm.appendChild(setEntityAction('Edit'));\n\t\t\tsubmitMCForm(mcForm);\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "a21c36783d969d9265b25cbdf74f74b4", "score": "0.61793494", "text": "async function handleEdit(e) {\n e.preventDefault()\n\n if (!nome || !cpf || !endereco || !dataNasc) {\n return alert('Preencha todos os campos obrigatórios!')\n }\n\n const data = {\n nome,\n cpf,\n endereco,\n dataNasc,\n biografia,\n email\n }\n\n console.log(data)\n\n try {\n const response = await api.put('editUser', data, {headers: {'auth-token': localStorage.getItem('userInfo')}})\n localStorage.setItem('completo', JSON.stringify(response.data.completo))\n alert('Edição de informações realizada com sucesso!')\n } catch (err) {\n alert('Erro na edição de informações')\n }\n }", "title": "" }, { "docid": "34c5867a97c06e73d3170cf916db8752", "score": "0.6169948", "text": "handleSendVerify(event) {\n\t\tvar isValid = this.validateField(this);\n\t\tevent.preventDefault();\n\t\tif (isValid) {\n\t\t\tvar userPool = new CognitoUserPool(poolData);\n\t\t\tvar userData = {\n\t\t\t\tUsername: this.state.EmailID,\n\t\t\t\tPool: userPool\n\t\t\t};\n\n\t\t\tvar cognitoUser = new CognitoUser(userData);\n\t\t\tvar thisObj = this;\n\t\t\tcognitoUser.forgotPassword({\n\t\t\t\tonSuccess: function (result) {\n\t\t\t\t\tthisObj.setState({ codeSendMsg: true });\n\t\t\t\t\tthisObj.setState({ codeFailedMsg: false });\n\t\t\t\t\tthisObj.setState({VerificationCode:''});\n\t\t\t\t\tthisObj.setState({NewPassword:''});\n\t\t\t\t\tthisObj.setState({ConfirmPassword:''});\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\tonFailure: function (err) {\n\t\t\t\t\tthisObj.setState({ codeFailedMsg: true });\n\t\t\t\t}\n\t\t\t});\n\t\t\tthisObj.handleEReset(this);\n\t\t}\n\t\tlocalStorage.setItem(\"mailID\", this.state.EmailID);\n\t}", "title": "" }, { "docid": "25b28c463e3c7aecc04906cea2c58d03", "score": "0.6158069", "text": "function processEdit (req, res) {\n User.findOne({ id: req.params.id }, (err, user) => {\n user.email = req.body.email;\n user.password = user.generateHash(req.body.password);\n\n user.save ( (err) => {\n if(err)\n throw err;\n\n req.flash('success', `Successfuly update ${user.email}`);\n res.redirect('/profile');\n });\n });\n}", "title": "" }, { "docid": "ceed6b759bfdf77823a15ceccf93b1d4", "score": "0.6149671", "text": "onEmailChanged(text) {\n this.props.emailAltered(text);\n \n }", "title": "" }, { "docid": "1096e397ecfd4ea7aaacf19bb37dc8bf", "score": "0.6148559", "text": "function editExtraEmail(){\n\tcurrentOperation=\"edit\";\n\tif ($addEmailText.text() !== NO_EXTRA_EMAIL_ADDRESS){\n\t\t$addEmailInput.val($addEmailText.text());\n\t}\n\ttoggleBtn($emailBtn1);\n}", "title": "" }, { "docid": "02170c0a2277b6f8fb87bb3f022fd29f", "score": "0.614827", "text": "handleEmailUpdate() {\n this.setState({ emailSubmitted: true });\n const { email } = this.state;\n \n console.log('sending email' + email);\n // if the current login information is correct:\n // checking to see if the email matches the confirm email\n fetch('/settings', {\n method: 'PATCH',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n storedEmail: this.state.email\n \n })\n });\n\n\n\n\n }", "title": "" }, { "docid": "130fddd0150e49431e0a1ab390eb3450", "score": "0.612106", "text": "onUpdateEmail() {\n\t\tthis.user.onChangeEmail(this.state.newEmail).then((newEmail) => {\n\t\t\tthis.setState({email:newEmail, newEmail:\"\"})\n\t\t})\t\n\t}", "title": "" }, { "docid": "0cbcc7f94b0c2e6574284148c3415d06", "score": "0.5958742", "text": "function updateEmail() {\n\tlet emailValue = $('.userdetails__input[name=\"email\"]').val();\n\t$.post(\"includes/handlers/ajax/updateEmail.php\", \n\t\t{ email: emailValue, username: userLoggedIn }) \n\t\t.done(function(response) {\n\t\t\tnotification(response);\n\t\t});\n}", "title": "" }, { "docid": "90685648a127a0912a2086cb36671b8b", "score": "0.5924588", "text": "function emailChange(e) {\n setEmail(e.target.value)\n }", "title": "" }, { "docid": "46c3a5cc995e6d0c2978753e248586e4", "score": "0.591997", "text": "function onCheckEmail() {\r\n if ($(this).val().length > 0) {\r\n $.get(`/check_email/${$(this).val()}`)\r\n .done((data) => {\r\n $('#email-valid').removeClass('hidden');\r\n $('#email-valid').removeClass('text-success');\r\n $('#email-valid').removeClass('text-danger');\r\n if (data === 'available') {\r\n $('#email-valid').text('Email is available');\r\n $('#email-valid').addClass('text-success');\r\n this.setCustomValidity('')\r\n } else {\r\n $('#email-valid').text('Email is unavailable');\r\n $('#email-valid').addClass('text-danger');\r\n this.setCustomValidity('Email unavailable please login.')\r\n }\r\n });\r\n }\r\n }", "title": "" }, { "docid": "f65c19f20cacfad142d3c8e37ed52515", "score": "0.59072554", "text": "function updateEmail(e) {\n\t\t\tself.setState({ inputEmail: e.target.value });\n\t\t}", "title": "" }, { "docid": "99616fe1bab37573b5ac0ca445d9372c", "score": "0.5902814", "text": "function handleEditProfileEditClick(){\n\tif(validateEditUserForm()){\n\t\tTi.API.info('edit Profile form is valid');\n\t\t\n\t\t//Call signup() on the server\n\t\teditUserProfile(editProfileObject);\t\n\t}\n}", "title": "" }, { "docid": "f81552ee2e8d7416296c34a21eae58f0", "score": "0.58933973", "text": "function changeEmail()\n\t{\n\t\tapp.linkToObject('loginChangeEmail');\n\t}", "title": "" }, { "docid": "d691b891f8781cbd0f943778ce293b7f", "score": "0.5881889", "text": "function vfValidateEmailChange(inpt) {\r\n\t\tinpt = $(inpt);\r\n\r\n\t\tvar value = inpt.val();\r\n\t\t\r\n\t\t// Se o e-mail vazio ou valido\r\n\t\tif (value == \"\" || value == null || vfValidEmail(value)) {\r\n\t\t\t// limpa as mensagens do campo\r\n\t\t\tvfCleanStatus(inpt);\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t// marca o campo como errado\r\n\t\t\tinpt.addClass(\"vfFieldError\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "23017aca7bd1dd32c5b3c04bd89ad38f", "score": "0.587222", "text": "async function handleVerifyEmail() {\n \n $(\"#verify\").show();\n\n try {\n await firebase.applyActionCode(firebase.getAuth(), actionCode);\n } catch (error) {\n handleError(\"[EMAIL ACTION] Invalid / Expired action code.\", error, \"warning\");\n createPopup(\"For your own safety, these links have an expiry time.<br><br> Looks like this email verification link has expired or is invalid.<br><br> Please try verifying your email again.\", \"error\");\n $(\"#verify\").find(\"progress\").remove();\n $(\"#verify-status\").html(\"sorry, looks like this link has expired\");\n return false;\n }\n \n $(\"#verify-status\").html(`\n thank you!<br>\n you have successfully verified your email.\n `);\n\n $(\"#verify\").find(\"progress\").remove();\n\n return true;\n \n}", "title": "" }, { "docid": "15417bc71ddabe2af95c3aee0b1b9406", "score": "0.58614534", "text": "function initEditEmailState() {\n originalEmail = $('#UserEmail').val();\n //alert(originalEmail);\n eb = $('#emailBlock');\n eb.children('div').slideUp();\n// eb.append('<a>Change Email ({$this->request->data[$model]['email']})</a>')\n newE = eb.children('a');\n newE.click(toggleEmail);\n }", "title": "" }, { "docid": "ea89ea137af7182182e8e25c46c24ccc", "score": "0.5853231", "text": "function handleChange(e) {\n setEmail(e.target.value);\n }", "title": "" }, { "docid": "05daab8b6e9fbf000a06c5cc1fa12349", "score": "0.58506185", "text": "function verifyEmail() {\n var objData = {\n rid: $state.params.strRId,\n };\n\n return CioAuthService.verifyEmail(objData, function(objErr) {\n vm.states.emailVerified = true;\n\n if (objErr && '2312' === objErr.code) {\n vm.states.emailVerified = 'expired';\n }\n else if (objErr) {\n vm.states.emailVerified = 'error';\n }\n });\n }", "title": "" }, { "docid": "4f386b79508fbf4052062b619f44efaf", "score": "0.5798779", "text": "onEditDone(e){\n this.modifyUser();\n this.cancelEdit();\n }", "title": "" }, { "docid": "9e345fc517460e4871af838a8237a709", "score": "0.5781249", "text": "onChangeEmail(e) {\n\t\tthis.setState({\n\t\t\tnewEmail:e.target.value\n\t\t})\n\t}", "title": "" }, { "docid": "b09a8b66d46a0ecf3e092b8d0271fca4", "score": "0.5767011", "text": "async updateEmail(newEmail) {\n this.email = newEmail;\n await this.save();\n }", "title": "" }, { "docid": "50880a68c0a30e2d1b0e3c66027cf415", "score": "0.57579815", "text": "function showEmailForm() {\n $(\".modal-dialog\").addClass(\"enter-purchaser-email\");\n\n $(\"#emailAddressForm .action-button\").click(function () {\n var emailAddress = $(\"#emailAddressFormInput\").val();\n if (validateEmail(emailAddress)) {\n $(\"#emailAddressForm .input-wrapper bp-loading-button .action-button\").addClass(\"loading\");\n // Push the email to a server, once the reception is confirmed move on\n srvModel.customerEmail = emailAddress;\n $.ajax({\n url: window.location.pathname + \"/UpdateCustomer?invoiceId=\" + srvModel.invoiceId,\n type: \"POST\",\n data: JSON.stringify({ Email: srvModel.customerEmail }),\n contentType: \"application/json; charset=utf-8\"\n }).done(function () {\n hideEmailForm();\n }).fail(function (jqXHR, textStatus, errorThrown) {\n\n })\n .always(function () {\n $(\"#emailAddressForm .input-wrapper bp-loading-button .action-button\").removeClass(\"loading\");\n });\n } else {\n $(\"#emailAddressForm\").addClass(\"ng-touched ng-dirty ng-submitted ng-invalid\");\n }\n\n return false;\n });\n }", "title": "" }, { "docid": "1daa662322a9e4695b9e144e7cdf7bb0", "score": "0.5737817", "text": "saveEdit(e) {\n // Get to the message wrapper\n let message = e.target.parentNode.parentNode.parentNode.parentNode\n\n // Check that field is not empty before patching database\n if (message.querySelector(\"#message__input\").checkValidity()) {\n let id = message.id.split(\"-\")[1]\n let messageObj = {\n text: message.querySelector(\"#message__input\").value,\n isEdited: true\n }\n\n API.editData(\"messages\", messageObj, id)\n .then(() => {\n clear()\n loadMessages()\n })\n }\n }", "title": "" }, { "docid": "510400e172017cc461f51aadfbf08e8f", "score": "0.57359415", "text": "handleEditMsgSubmit(id, to, event) {\n event.preventDefault();\n const { chat } = this.views;\n const form = event.target;\n const msg = {\n text: form['message__text'].value,\n isPersonal: false,\n };\n if (to) {\n msg.isPersonal = true;\n msg.to = to;\n }\n this.editMessage(id, msg);\n chat.setFormElem((event) => this.handleSendMsgSubmit(event));\n }", "title": "" }, { "docid": "e73ffb27c806b06ba141c592357c4e1e", "score": "0.57354236", "text": "async verifyEmail(){\n\t\tif(this.sendingEmail){\n\t\t\talert(\"We'll get there when we get there! Wait!\");\n\t\t\treturn;\n\t\t}\n\t\tthis.sendingEmail = true;\n\t\tlet result = await this.awaitPost(\"resend-verification-email\");\n\t\tif(result.error!=\"\"){\n\t\t\talert(\"Error! Could not resend email! \"+result.error);\n\t\t}else{\n\t\t\talert(\"Go check your email ;)\");\n\t\t}\n\t\tthis.sendingEmail = false;\n\t}", "title": "" }, { "docid": "a551d895976bc7a9c75b45ae6fbf2594", "score": "0.5724751", "text": "function acceptEdit(e) {\n const editedField = e.target.getAttribute('data-field');\n const newValue = document\n .getElementById(`editing-${editedField}`)\n .value.trim();\n if (newValue === '') return;\n const userId = props.user.id;\n dispatch({\n type: 'users/userEdited',\n payload: {\n id: userId,\n editedField: editedField,\n newFieldValue: newValue,\n },\n });\n setEditingField('');\n }", "title": "" }, { "docid": "74558d40d9766ffeccab0b3a0a79631d", "score": "0.57245094", "text": "function setReceivingEmailOnChange(e){\n setReceivingEmail(e.target.value);\n console.log(currentReceivingEmail);\n }", "title": "" }, { "docid": "da7a93b09217123c754a68b26017ef61", "score": "0.5723755", "text": "function onVerifyOTPClick() {\n let payload = {\n email: email,\n token: localStorage.getItem('userToken'),\n verificationCode: otp\n };\n props.actions.verifyEmail(payload);\n }", "title": "" }, { "docid": "8d5aa3702c06d64ef893c4929e1729f7", "score": "0.57236403", "text": "onEmailChanged(text) {\r\n this.props.emailAltered(text);\r\n if(text != '') {\r\n this.props.email_validator(text);\r\n }\r\n }", "title": "" }, { "docid": "02bee3a8545ad24d54445afefa0f9313", "score": "0.57157874", "text": "handleSubmitEmailForm(evt, self) {\n evt.preventDefault();\n\n const emailValue = document.getElementById('email').value;\n const validEmailValue = GigyaSocialLogin.validateEmail(emailValue);\n\n if (validEmailValue) {\n self.fetchedUserData.email = emailValue;\n self.handleEmailValueValidation(self.fetchedUserData);\n } else {\n const emailError = document.getElementById('emailError');\n const emailInput = document.getElementById('email');\n\n emailError.removeAttribute('hidden');\n emailInput.focus();\n }\n }", "title": "" }, { "docid": "f0bbe1d45d1a509a17af57bbd36734e3", "score": "0.57095736", "text": "_emailTextInputChanged(email) {\n this.email = email;\n }", "title": "" }, { "docid": "ac16876c69501381e8aff74f09e6f065", "score": "0.57024723", "text": "onEmailChange(text) {\n this.props.emailChanged(text);\n }", "title": "" }, { "docid": "fac0b344a99cf90370f10ab0253d857b", "score": "0.56812", "text": "function changeEditable(e) {\n e.preventDefault();\n cancelButton.style.display = \"inline\";\n\n confirmButton.disabled = false;\n confirmButton.className = \"btn btn-success\";\n\n emailaddress.value = profileUser.email;\n emailaddress.readOnly = false;\n\n username.value = profileUser.name;\n username.readOnly = false;\n\n // pass.value = profileUser.password;\n pass.value = '';\n pass.readOnly = false;\n\n descriptionEditable.value = profileUser.description;\n descriptionEditable.readOnly = false;\n}", "title": "" }, { "docid": "f25e04628b08b2210d36e9d92cd859ad", "score": "0.5667361", "text": "function verified() {\n const user = firebase.auth().currentUser;\n user.sendEmailVerification().then(() => {\n alert('Revisa tu correo para que puedas ingresar satisfactoriamente');\n }).catch(() => {\n alert('correo de verificación no enviado');\n });\n}", "title": "" }, { "docid": "2a536c53f1182846bf3af1bbe5d9266c", "score": "0.5629373", "text": "confirmEmail(form){\n return form.put('/api/users/verify').then(response => {\n return response;\n })\n .catch(err => {\n return err;\n })\n }", "title": "" }, { "docid": "6b61c042c0a0f0d0771a51858b502042", "score": "0.56248343", "text": "_handleEdit () {\n // Make necessary calls to get/navigate to edit this item/details.\n alert(\"editing\");\n }", "title": "" }, { "docid": "8871d56b3ae982abd77f9e68dc3ef015", "score": "0.5621446", "text": "function updEmail()\r\n{\r\n updEmails.style.display=\"block\";\r\n PEmail.style.display=\"none\";\r\n butEmail.style.display=\"none\";\r\n saveEmail.style.display=\"block\";\r\n cancelEmail.style.display=\"block\";\r\n updEmails.value=contactList.email;\r\n}", "title": "" }, { "docid": "fe71511ff6e1375c77fcbef854d51642", "score": "0.5620668", "text": "messageEdit(event) {\n this.getConnection().edit(event.detail);\n }", "title": "" }, { "docid": "43b82073084591f1f4af7e7f78f7ab19", "score": "0.56191474", "text": "handleApproval(event) {\n const email = event.target.id;\n let approvedUser = this.getUser(email);\n this.submitDecision(true, approvedUser.username).then(response => {\n alert(approvedUser.firstName + ' approved successfully!');\n this.updatePending(email);\n }).catch(error => {\n alert(approvedUser.firstName + ' could not be approved');\n })\n }", "title": "" }, { "docid": "1d4c69ee645ce84afe8d5fc4ab9961df", "score": "0.5592728", "text": "function handleEdit(person) {\n setEditModal(true);\n setEditPerson(person);\n document.addEventListener(\"click\", clickOutside);\n }", "title": "" }, { "docid": "99069525a4ea3fce78565fffe48ce15b", "score": "0.558155", "text": "SendVerificationMail() {\n return this.afAuth.auth.currentUser.sendEmailVerification()\n .then(() => {\n this.router.navigate(['verify-email-address']);\n });\n }", "title": "" }, { "docid": "a3a6836500feb4e7bee855482284439b", "score": "0.5569502", "text": "function editConfirm(username, validationCode) {\n return utils.httpPromiseHandler($http.post('/user/edit/confirm', {\n username: username,\n validationCode: validationCode\n }))\n .then(function(body) {\n var userInfo = body.userInfo;\n setCurrent(undefined, userInfo);\n return processUserInfo(userInfo);\n });\n }", "title": "" }, { "docid": "5494282c0b9dd29aff0ebf936a45167b", "score": "0.5559608", "text": "async updateEmail({ commit, state }, newEmail) {\n if (!state.currentUser) {\n commit(\"error\", `The updateEmail dispatch was dispatched but the current user profile is empty!`);\n throw new FireModelPluginError(`The updateEmail dispatch was dispatched but the current user profile is empty!`, \"not-ready\");\n }\n try {\n const db = await database();\n const user = (await db.auth()).currentUser;\n await user.updateEmail(newEmail);\n commit(\"updatedEmail\", { uid: user.uid, email: newEmail });\n }\n catch (e) {\n commit(\"error\", {\n stack: e.stack,\n message: `Failure to update the logged in user's email address: ${e.message} [ ${e.code} ${e.name} ]`\n });\n throw e;\n }\n }", "title": "" }, { "docid": "538981e1f53de90309c3997260443a55", "score": "0.55589944", "text": "* edit (request, response) {\n const email = request.input('email')\n const display_name = request.input('display_name')\n const first_name = request.input('first_name')\n const last_name = request.input('last_name')\n\n const affectedRows = yield Database\n .table('users')\n .where({ id: request.currentUser.id })\n .update({ email: email, \n display_name: display_name, \n first_name: first_name, \n last_name: last_name \n })\n\n yield request.session.put({ email: email })\n yield request.session.put({ display_name: display_name })\n yield request.session.put({ first_name: first_name })\n yield request.session.put({ last_name: last_name })\n\n return response.redirect('profile')\n }", "title": "" }, { "docid": "f60f4c590a2f0cb616214dbac2004c09", "score": "0.5549338", "text": "function submit_changes_to_account() {\n const username = document.querySelector(\"#edit-account-username\").value;\n const email = document.querySelector(\"#edit-account-email\").value;\n\n console.log(username)\n console.log(email)\n \n\n fetch(`/edit_account/`, {\n method: 'PUT',\n body: JSON.stringify({\n username: username,\n email: email\n })\n })\n //alert stating that changes have been made\n .then( () => {\n alert(\"Your changes have been made\")\n })\n //return back to Account\n .then( () => {\n load_account()\n })\n //alert error if there is an issue saving changes \n .catch(error => {\n console.log(error, 'error')\n alert(\"There was an error making these changes\")\n });\n }", "title": "" }, { "docid": "0a04023e85c485abc70fc1a1a2d87512", "score": "0.55473787", "text": "function handleEmailChange(e){\n //Clears the error message if the placeholder text is visible again (example: Editing the string back to an empty string).\n if (e.target.value === '' ){\n return setShowEmailError(false)\n }\n //Set the regular expression for a valid email.\n const checkValidInput = new RegExp (/^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,}$/);\n // if the input is invalid update State to true (displays the error message).\n if (!checkValidInput.test(e.target.value)){\n return setShowEmailError(true)\n }\n \n // else update State to false (hides error message).\n return setShowEmailError(false)\n }", "title": "" }, { "docid": "3f701c3e02bca46b792b3db8df4396b2", "score": "0.55450416", "text": "function updateCustomerEmail(form, emailPath) {\n\t\tvar emailField = findField(form, emailPath);\n\n\t\tif (emailField) {\n\t\t\t// If saving a customer's card then the mapped email field required and not allowed to be changed\n\t\t\tif (form.get_saveCustomerCardEnabled()) {\n\t\t\t\tif (emailField.get_isRequired() === \"Never\") {\n\t\t\t\t\temailField.set_isRequired(\"Always\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If the current element is not the mapped email element then find the element and re-render it so the required asterisk is displayed\n\t\t\tvar $emailElement = $(getElementSelector(emailPath));\n\t\t\tif (Cognito.Forms.model.currentElement && Cognito.Forms.model.currentElement.get(0) !== $emailElement.get(0)) {\n\t\t\t\tCognito.refreshElement($emailElement);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "9cc317812c101f8419163f5fc9ff8dd6", "score": "0.55355865", "text": "function change_email() {\n\t$.ajax({\n url: base_url + 'login/update_user_email',\n type: 'POST',\n data: 'new_email='+$('#txt_new_email').val(),\n dataType: 'json',\n success: function(result_query) {\n\n \tif(result_query.code == 1){\n\t \t$('#change_email').modal('hide');\n\t \t$('#alert_send_email').empty();\n $('#alert_send_email').append('<div style=\"display: block\" class=\"alert alert-block\">\\n\\\n \t\t\t\t\t\t\t\t\t\t\t\t\t<p>Se ha enviado un correo a <strong>'+result_query.email+'</strong> para que realices la confirmación.</p>\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>');\n \t}else{\n\t \t$('#change_email').modal('hide');\n\t \t$('#alert_send_email').empty();\n $('#alert_send_email').append('<div style=\"display: block\" class=\"alert alert-block\">\\n\\\n \t\t\t\t\t\t\t\t\t\t\t\t\t<p>Error al intentar cambiar el correo electrónico del usuario.</p>\\n\\\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t </div>');\n \t}\n\n\n \tconsole.log(result_query);\n }, error: function(error) {\n console.log('Ah ocurrido un error: ' + error + ', por favor acuda al admin.');\n }\n });\n}", "title": "" }, { "docid": "1484d12e0a9f97304e5e5910a1a4a635", "score": "0.5503575", "text": "onEmailChange(text){\n this.props.emailChanged(text);\n }", "title": "" }, { "docid": "d180e936b68ecb48f3a137f1021bb371", "score": "0.5502097", "text": "function editUser(e) {\n const fullButtonID = e.target.id;\n const buttonID = fullButtonID.substring(10);\n\n let goodToEditUser = false;\n\n try{\n validateEditContents(buttonID);\n goodToEditUser = true;\n } catch(e) {\n document.getElementById('editDeleteFeedbackResponse').innerHTML = '<p style=\"color: #ff0000\">Sorry, there was an error</p>';\n logIt(\"ERROR: \" + e);\n }\n\n if (goodToEditUser) {\n let payload = setUpPayLoad(buttonID);\n uploadEdit(buttonID, payload);\n }\n event.preventDefault();\n}", "title": "" }, { "docid": "16c2a37eca713c230d7902d5cefb41f5", "score": "0.55011785", "text": "edit_item() {\n // Deep copy the object so we don't change the card's\n // display until the save is successful.\n this.set('item_to_edit', JSON.parse(JSON.stringify(this.user)));\n // Ask for the form to be opened.\n window.dispatchEvent(new CustomEvent(\"open-form\", {\n detail: {\n name: \"edit_user_form\",\n user: this.item_to_edit,\n that: this,\n callback: \"resolve_edit_item_dialog\",\n },\n }));\n }", "title": "" }, { "docid": "e7bf95d91533d35bc14b166ce4cf9270", "score": "0.5484483", "text": "function handleProfileEdit(event) {\n event.preventDefault();\n UserModel.update({ username, bio, email }).then(json => {\n if (json.status === 201) {\n props.history.push(\"/profile\");\n setUser(json.user)\n console.log(json)\n } else {\n console.log(json);\n }\n });\n }", "title": "" }, { "docid": "1d499c320bc8286cb08a1da4128d9889", "score": "0.54841924", "text": "function saveuseredit()\n{\t\n\tvar userid = $(\"#userid\").val();\nvar notification_email= $(\"#notification_email\").val();\n\t\n\tvar userstatus = $('#userstatus').is(':checked');\n\tif($.trim(notification_email)==\"\")\n\t{\n\t\t$(\"#notification_email\").css(\"border-color\", \"red\");\n\t}\n if (!validateEmail(notification_email)) {\n // alert('Email is not valid');\n $(\"#notification_email\").css(\"border-color\", \"red\");\n }\n\tif (validateEmail(notification_email)&&$.trim(notification_email)!=\"\")\n\t{\n\t\t$.ajax({ //Make the Ajax Request\n\t\t\ttype: \"POST\", \n\t\t\turl: \"../ajax_useredit\",\n\t\t\tdata: \"userid=\"+userid+\"&notification_email=\"+notification_email+\"&userstatus=\"+userstatus, //data\n\t\t\tsuccess: function(response) {\n\t\t\t\tif(response=='1')\n\t\t\t\t{\n\t\t\t\t\twindow.location = \"../users_list?edited\";\n\t\t\t\t}\n\t\t\t} \n\t\t});\n\t}\n}", "title": "" }, { "docid": "bd1656b19e3583e54b918c37270aa554", "score": "0.54811394", "text": "function verifiedFormsRequestCallbacks(data){\n if(data.success) {\n if (data.data != '' && data.data != null) {\n $.each(data.data.result, function (key, value) {\n $('.content_static span[data-about=\"' + key + '\"]').set_text((key == 'email') ? handleEmailChanges(value) : handleMobileChanges(value));\n\n var cont = $('span[data-about=\"' + key + '\"]').closest('.content_static');\n hideVerificationNotice(cont);\n cont.find('.saved').set_text(value.primary.display);\n cont.find('.warning.label').set_text(COMMON_LANG.LABEL.VERIFIED).toggleClass('warning success');\n\n $('#verification_code').val('');\n });\n $('#verify_codes').modal_close();\n }\n }else{\n handleErrors(data, form.attr('id'));\n }\n }", "title": "" }, { "docid": "3dcc43a8aa903a281423e57c9bf461e1", "score": "0.5476499", "text": "send() {\n Spark.post(`/settings/${Spark.pluralTeamString}/${this.team.id}/invitations`, this.form).then(() => {\n this.form.email = '';\n\n this.$parent.$emit('updateInvitations');\n });\n }", "title": "" }, { "docid": "a9dd849320a28e6269db60f2631ebac5", "score": "0.54613584", "text": "function setUserEmail() {\n client.data.get('currentCaller')\n .then(function (data) {\n if (!data.email) {\n document.getElementById('email-ticket').value = '';\n }\n if (data.email) {\n document.getElementById('email-ticket').value = data.email;\n getTickets(data.email)\n }\n })\n .catch(function (error) {\n console.error('Unable to fetch current caller', error);\n });\n }", "title": "" }, { "docid": "9b2a20969f2c3b2b6b0e3250b73f4be4", "score": "0.5457932", "text": "function editContact(contact) {\r\n App.viewmodel.setEditContact(contact);\r\n $(\"#contact-dialog\").dialog(\"open\").find(\"form\").validate().resetForm();\r\n return false;\r\n }", "title": "" }, { "docid": "ceadfbd2f95ec61112b26e95f9be6394", "score": "0.545336", "text": "function CallbackEditCustomerMessageConfirm() {\n toastr.success(language.Translate(\"RequestSubmitted\", null));\n self.updatingMessage(false);\n if (self.generalMessages().CustomerDescription != null && self.generalMessages().CustomerDescription != \"\") {\n self.selectedSearchCustomer().daCustomerModel.LastOrderNote = self.generalMessages().CustomerDescription;\n }\n ReinitializeMessages();\n $(\"#editCustomerMessage\").modal(\"hide\");\n self.selectedMessage(null);\n GetCustomerMessages();\n }", "title": "" }, { "docid": "4d046b16cb419d3e3293ef7e9e128ecd", "score": "0.5450383", "text": "isExistEmailOnChange() {\n if (this.state.userId !== undefined) { //id is undefinded edit \n var res = this.isUserExistEmailUpdateApi();\n res.done((response) => {\n if (response.length > 0) {\n $(\".recordexists\").show()\n }\n else {\n $(\".recordexists\").hide()\n }\n\n })\n }\n else {\n var result = this.isUserEmailExistApi(); //save\n result.done((response) => {\n if (response.length > 0) {\n $(\".recordexists\").show()\n } else {\n }\n })\n }\n }", "title": "" }, { "docid": "dac6bb7fd8280d841019f2a444036716", "score": "0.54475796", "text": "sendUserVerificationEmail() {\n return emailVerification.sendVerificationEmail(this.email);\n }", "title": "" }, { "docid": "48646a27914d72f9f25cb16a3ca8852d", "score": "0.5439584", "text": "onConfirmEdit() {\n\n if (this.state.update) {\n Meteor.call('custProperties.update', this.state);\n\n this.clearStateForm();\n this.setState({ update: false, idEditing: '' });\n }\n }", "title": "" }, { "docid": "558820c5b7607fe61eb1254fdf25a1b8", "score": "0.5437722", "text": "function email_check_email()\n{\n\tlet iteam = team_code_to_index (G_selected_team);\n\tlet content = get_substituted_content();\n\tcontent = content.replace(/<p>/g, '<p style=\"padding:0px\">')\n\t$(\"#formatted-html\").html(content);\n}", "title": "" }, { "docid": "ec3c9c1e853df0a85950a6b6caf4853f", "score": "0.5431352", "text": "_receivedEmail (params, cb) {\n var self = this;\n\n var sendEmail = function (params) {\n self._eventBus.emitEvent(events.SEND_EMAIL, {\n to: params.to,\n subject: params.subject,\n body: params.body,\n attachments: null\n });\n };\n\n // Validate\n if (!params || !params.fromEmail) {\n cb('Invalid params passed with RECEIVED_EMAIL');\n return;\n }\n\n // Determine if email is a special update email\n var regex = new RegExp('^\\\\[' + util.EMAIL_DB_UPDATE_TAG + '\\\\].*', 'g');\n var ret = regex.exec(params.subject);\n if (ret) {\n var fullTag = '[' + util.EMAIL_DB_UPDATE_TAG + ']';\n var updateName = params.subject.substring(params.subject.indexOf(fullTag) + fullTag.length).trim();\n\n // Convert email to JSON\n var body = {};\n try {\n var json = JSON.parse(params.body);\n\n // Convert keys to lower case\n Object.keys(json).forEach(function (key) {\n body[key.toLowerCase()] = _.cloneDeep(json[key]);\n if (key.toLowerCase() === 'modify') {\n Object.keys(json[key]).forEach(function (key2) {\n delete body[key.toLowerCase()][key2];\n body[key.toLowerCase()][key2.toLowerCase()] = _.cloneDeep(json[key][key2]);\n });\n }\n });\n } catch (e) {\n // Emit event to respond to email with error\n sendEmail({\n to: params.fromEmail,\n subject: '[JIBO DATABASE UPDATE FAILURE] For update \"' + updateName + '\"',\n body: 'Error parsing email body: ' + e\n });\n cb('Error parsing email body: ' + e);\n return;\n }\n\n // Authenticate request\n self._model.getMatchingCollectionDocs(util.COLLECTION_TYPE.CREDS, {\n type: 'update-password',\n password: body.password\n }, function (err, docs) {\n if (err) {\n sendEmail({\n to: params.fromEmail,\n subject: '[JIBO DATABASE UPDATE FAILURE] For update \"' + updateName + '\"',\n body: err\n });\n cb(err);\n } else if (docs.length === 0) {\n sendEmail({\n to: params.fromEmail,\n subject: '[JIBO DATABASE UPDATE FAILURE] For update \"' + updateName + '\"',\n body: 'Incorrect password'\n });\n cb('Incorrect password');\n } else {\n var funcs = [];\n\n // Make database updates\n Object.keys(body).forEach(function (key) {\n if (key === 'password') {\n return;\n }\n\n // Convert to array to make processing easier\n if (!body[key].length) {\n body[key] = [body[key]];\n }\n\n body[key].forEach(function (doc) {\n // Delete _collection so it's not part of query\n var _collection = doc._collection;\n delete doc._collection;\n if (!_collection) {\n console.log('No _collection found in params');\n return;\n }\n\n // Push all of the add/remove/update funcs to run in parallel\n switch (key) {\n case 'add':\n var _docType = doc._docType;\n delete doc._docType;\n if (!_docType) {\n console.log('No _docType found in params');\n return;\n }\n\n funcs.push(function (cb) {\n self._model.addNewCollectionDoc(\n _collection,\n _docType,\n doc,\n function (err, docs) {\n cb(err, {\n add: docs\n });\n }\n );\n });\n break;\n\n case 'remove':\n funcs.push(function (cb) {\n self._model.removeFromCollection(_collection, doc, function (err, docs) {\n cb(err, {\n remove: docs\n });\n });\n });\n break;\n\n case 'modify':\n funcs.push(function (cb) {\n self._model.updateCollection(\n _collection,\n doc.match,\n doc.changes,\n function (err, numAffected) {\n cb(err, {\n modify: numAffected\n });\n }\n );\n });\n break;\n }\n });\n });\n\n async.parallel(funcs, function (err, ret) {\n // Draft confirmation email\n var subject = '[JIBO DATABASE UPDATE CONFIRMATION] For update \"' + updateName + '\"';\n var body = '';\n\n ret.forEach(function (r) {\n // Don't worry about _id\n delete params._id;\n\n if (r.add) {\n body += '\\nDocument added:\\n';\n body += JSON.stringify(r.add, null, 2) + '\\n';\n }\n if (r.remove) {\n body += '\\n# documents removed: ' + r.remove + '\\n';\n }\n if (r.modify) {\n body += '\\# documents modified: ' + r.modify + '\\n';\n }\n });\n\n // Both emit event for return email and return docs through cb\n sendEmail({\n to: params.fromEmail,\n subject: subject,\n body: body\n });\n cb(err, ret);\n });\n }\n });\n } else {\n // If not, save email to database and fire event to front end\n self._model.addNewCollectionDoc(util.COLLECTION_TYPE.EMAIL, 'default', {\n fromEmail: params.fromEmail,\n fromFirstName: params.fromFirstName,\n fromLastName: params.fromLastName,\n subject: params.subject,\n body: params.body,\n date: params.date\n }, cb);\n }\n }", "title": "" }, { "docid": "6114af9508bf319138394a018d4ad854", "score": "0.54285234", "text": "update() {\n\n if (this.state.email != this.state.chkmail) {\n const newUser = {\n\n email: this.state.email,\n\n }\n emailcheck(newUser).then(res => {\n this.em = res\n if (this.em == \"Not Found\") {\n toast.error(\"Email Not Exists\", {\n position: toast.POSITION.CENTER_CENTER\n });\n this.in();\n\n }\n else {\n alert(\"Email Already Exist\");\n }\n\n })\n\n }\n else {\n\n this.in();\n\n }\n\n\n\n }", "title": "" }, { "docid": "5b8ac132a10bd0177bd61246667ed01b", "score": "0.54109985", "text": "function handlePerfilEdit(){\n // navigation.navigate('PerfilEdit');\n Alert.alert('Editar Perfil','Desculpe! Essa função estará funcionando em um trabalho futuro!');\n }", "title": "" }, { "docid": "6b05f818830231287f7cd4dacf290e99", "score": "0.5409812", "text": "function ErrorCallbackEditCustomerMessageConfirm() {\n self.updatingMessage(false);\n }", "title": "" }, { "docid": "efa7e31d5b0cf48753375f27927172d8", "score": "0.53980625", "text": "function onEmailChange(eventObject) {\n setEmail(eventObject.target.value);\n if (validateEmail(eventObject.target.value)) {\n setIsDsiabled(false);\n }\n }", "title": "" }, { "docid": "9df903462fd08fd1b006a2b50103d424", "score": "0.5394693", "text": "set email(value){\n this._email = value;\n }", "title": "" }, { "docid": "fd4bdb3d6c4d3d8a0291b2c948956d25", "score": "0.539294", "text": "* edit (request, response) { \n yield response.sendView('user/edit') \n }", "title": "" }, { "docid": "297e0006d4a36c039f3537942aaab5da", "score": "0.5392046", "text": "function adminNotification() {\n emailjs.send(\"outlook\",\"lotrAPPROVE\")\n .then(\n function(response) {\n console.log(\"SUCCESS\", response);\n contactForm.reset();\n console.log(\"Form is reset\");\n },\n function(error) {\n console.log(\"FAILED\", error);\n }\n );\n return false;\n}", "title": "" }, { "docid": "609b3b60a60a07b862c639046cc6429e", "score": "0.5372688", "text": "function serviceUpdateUserEmail(req, resp) {\n\t\tlogger.info(\"<Service> UpdateUserEmail.\");\n\t\tvar userData = parseRequest(req, ['userId', 'email']);\n\t\t\n\t\twriteHeaders(resp);\n\t\tupdateUserEmail(userData.userId, userData.email, function(err, status) {\n\t\t\tif (err) error(2, resp);\n\t\t\telse resp.end(JSON.stringify({ status: status })); \n\t\t});\n\t}", "title": "" }, { "docid": "5fd3dd3f545680b77967c4dbca8d9264", "score": "0.53711724", "text": "sendSignInLinkToEmail () {\n var email = document.getElementById('email')\n if (!email.value) return\n\n var addr = window.localStorage.getItem('reqAddr')\n if (!addr) return\n\n contracts.identity.filterClaimRequested(addr, (err, resp) => {\n if (!err) window.location.replace('aa://auth/' + resp.transactionHash)\n })\n\n firebase.auth().sendSignInLinkToEmail(email.value, this.actionCodeSettings)\n }", "title": "" }, { "docid": "af71cb60445a0b2e8979b8adcff9ec19", "score": "0.5370773", "text": "function postConfirmedEditForm() {\n var theForm = document.getElementById('appyEditForm');\n theForm.confirmed.value = \"True\";\n theForm.submit();\n}", "title": "" }, { "docid": "16826a9eff0582b685245529aec623f8", "score": "0.5366628", "text": "resendVerifyAccountEmail () {\n if (!this.props.user.emailVerified) {\n\n this.props.resendVerifyAccountEmail(\n\n /*\n * Success callback\n *\n * In this case, we're now able to move throughout the rest of the application.\n */\n\n () => {\n \n this.refs.container.success(\n \"Almost done!\",\n \"Success. We went ahead and sent a new Verify Account email to you. Check your email.\", {\n timeout: 3000\n });\n\n },\n\n /*\n * Failure callback\n */\n\n () => {\n\n this.refs.container.error(\n \"Please try again later or contact us.\",\n \"Uh oh. Looks like something went wrong trying to resend the Verify Account email.\", {\n timeout: 3000\n });\n\n }\n )\n\n }\n }", "title": "" }, { "docid": "f270195a5c7bda165ff08324470a6e4f", "score": "0.53590184", "text": "function modify(e) {\n //Edit User\n var modyName = e.detail.value.name;\n var modyPhone = e.detail.value.phone;\n var thatName = that.data.nowName;\n var thatPhone = Number(that.data.nowPhone);\n\n if ((modyName != thatName || modyPhone != thatPhone)) {\n if (modyName == \"\" || modyPhone == \"\") {\n Show.showAlert(that, \"warn\", 'Name or Phone can not be empty');\n } else if (!isPhoneValid(modyPhone)) {\n Show.showAlert(that, \"warn\", 'Phone must be 8 digits only');\n } else {\n that.setData({ loading: true })\n var User = Bmob.Object.extend(\"user\");\n var query = new Bmob.Query(User);\n\n query.get(that.data.nowId, {\n success: function (result) {\n result.set('realName', modyName);\n result.set('phone', modyPhone);\n result.save().then(function (result) {\n common.showTip('Success', 'success', function () {\n that.onShow();\n that.setData({\n isModifyUser: false,\n loading: false,\n })\n console.log(\"*****UserListPage: End uploading Edited UserInfo to Bmob *****\");\n });\n });\n },\n error: function (object, error) {\n }\n });\n }\n }\n else if (modyName == \"\" || modyPhone == \"\") {\n Show.showAlert(that, \"warn\", 'Name or Phone can not be empty');\n }\n else {\n that.setData({\n isModifyUser: false\n })\n common.showTip('Success', 'success');\n }\n}", "title": "" }, { "docid": "4b1e1ed726c63a8e86331011c6a1c369", "score": "0.53586936", "text": "async change(e){\n\t\tif(this.waiting){\n\t\t\t$(\"#publish\").val(this.ogValue);\n\t\t\treturn;\n\t\t}\n\t\tthis.waiting = true;\n\t\tif(page.user.currentAccountStatus==1){\n\t\t\talert(\"You cannot change your account visibility until your email is verified!\")\n\t\t\tthis.onRender();\n\n\t\t}else{\n\t\t\tlet result = await this.awaitPost(\"set-card\", {published: ($(\"#publish\").val()==\"Published\")});\n\t\t\t//console.log(result);\n\t\t\tif(result.error!=\"\"){\n\t\t\t\talert(\"Could not change your card visibility! : \"+result.error);\n\t\t\t\t$(\"#publish\").val(this.ogValue);\n\t\t\t}\n\t\t}\n\t\tthis.waiting = false;\n\t}", "title": "" }, { "docid": "0cd8ee00be1cb7635ad9e696ff4073e6", "score": "0.5357321", "text": "function verifyEmail()\n{\n var verified = firebase.auth().currentUser.emailVerified;\n\n if(!verified)\n {\n console.log(\"Not verified\");\n $(\"#verifyContainer\")[0].style.display = \"flex\";\n $(\"#account\").click();\n }\n}", "title": "" }, { "docid": "0e381bff6bb6e31948c4f91926a648c6", "score": "0.53564036", "text": "async verifyEmail() {\n\n\t\tconst user = await this.db.select_row(`select * from users where email=?`, [ this.getCryptr().decrypt(this.params.id) ]);\n\t\t\n\t\tif (!user) this.throw('Email verification issue');\n\t\tawait this.db.update('users', { userId: user.userId, accountVerified: 1 }, 'userId')\n\t\tthis.body = { status: 'Success', sessionToken: this.getSessionToken(user) };\n\n\t\tawait this.db.insert('avatars', { userId: user.userId });\n\t\t\n\t}", "title": "" }, { "docid": "1c4e4160481885b7ef0ebaa7ba741004", "score": "0.53444946", "text": "function emailHandler(e) {\n e.preventDefault(); //prevent default action from sending the form\n\n /* Using emailjs api for sending data to personal e-mail*/\n emailjs\n /* Data required by email js for detecting my account*/\n .sendForm(\n \"service_7gn2tfj\",\n \"template_q2bjryy\",\n e.target,\n \"user_3YMrfoLjO2lTYtxPe25n9\"\n )\n .then(\n (result) => {\n /* Sweet alert triggered when the message has been sent */\n Swal.fire({\n position: \"center\",\n icon: \"success\",\n title: \"El mensaje fue enviado!\", //message displayed\n showConfirmButton: false,\n timer: 1500,\n });\n },\n (error) => {\n console.log(error.text);\n }\n );\n }", "title": "" }, { "docid": "bf57a3a12110c5b5dd3aa50b893d988a", "score": "0.53431934", "text": "function editUser() {\n\t\t$editBtn = $(event.currentTarget);\n\t\tvar userId = $editBtn.parent().attr('userId');\n\t\tfindUserById(userId).then(renderUser);\n\t}", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "be852445a6841568960c4a93ae032f2c", "score": "0.5339657", "text": "async edit ({ params, request, response, view }) {\n }", "title": "" }, { "docid": "53e0e0a87b33f8f321fca34706997240", "score": "0.53362715", "text": "function onSendToMail(e) {\r\n e.preventDefault();\r\n\r\n const { sendToMailInput } = e.target.elements;\r\n const email = sendToMailInput.value;\r\n console.log(email)\r\n \r\n //fetch to check if email in database\r\n fetch('/api/users/forgotPassword', {\r\n method: \"POST\",\r\n body: JSON.stringify({ email }),\r\n headers: {\r\n \"Content-Type\": \"application/json\",\r\n },\r\n })\r\n .then((res) => res.json())\r\n .then((data) => {\r\n const { success } = data;\r\n const { error } = data;\r\n const { info } = data;\r\n if (success) {\r\n\r\n return(history.push(`/KeyPassword/${email}`))\r\n \r\n }\r\n else {\r\n alert(error)\r\n }\r\n });\r\n }", "title": "" }, { "docid": "0885db9f198c3c5649f1e810e97afd71", "score": "0.53348076", "text": "function sendEmailVerification() { //firebase function to send verification email to user\n // [START sendemailverification]\n firebase.auth().currentUser.sendEmailVerification().then(function() { // this will send it to only current user who is singed in \n // Email Verification sent!\n // [START_EXCLUDE]\n tellAppInventor('Email Verification Sent!'); // if all is good it will send the message \n // [END_EXCLUDE]\n });\n // [END sendemailverification]\n }", "title": "" }, { "docid": "716538921d010dc86f6d9081e6e2746e", "score": "0.5333803", "text": "validateEmail(value, callback) {\n\n const edit = this.props.screen === screenEnum.view;\n \n if (!edit && !value) {\n this.setState({emailValidation: \"Email is required.\"});\n return false;\n }\n else if (edit && (!value || value === this.props.viewing.email)) {\n return true;\n }\n else if (!re.testEmail(value)) {\n this.setState({emailValidation: \"Invalid email address.\"}, callback);\n return false;\n }\n else {\n this.setState({emailValidation: \"\"}, callback);\n return true;\n }\n }", "title": "" }, { "docid": "cd1228c84029afd3f05c10eada3b8eea", "score": "0.53292084", "text": "function Edit() {\n const [nome, setNome] = useState('')\n const [cpf, setCpf] = useState('')\n const [endereco, setEndereco] = useState('')\n const [dataNasc, setDataNasc] = useState('')\n const [biografia, setBiografia] = useState('')\n const [email, setEmail] = useState('')\n\n //funcao que realiza a edicao de informacoes\n async function handleEdit(e) {\n e.preventDefault()\n\n if (!nome || !cpf || !endereco || !dataNasc) {\n return alert('Preencha todos os campos obrigatórios!')\n }\n\n const data = {\n nome,\n cpf,\n endereco,\n dataNasc,\n biografia,\n email\n }\n\n console.log(data)\n\n try {\n const response = await api.put('editUser', data, {headers: {'auth-token': localStorage.getItem('userInfo')}})\n localStorage.setItem('completo', JSON.stringify(response.data.completo))\n alert('Edição de informações realizada com sucesso!')\n } catch (err) {\n alert('Erro na edição de informações')\n }\n }\n\n return (\n <div id=\"edit-container\">\n <Header action=\"Logout\" redirect=\"/\" logout={true}/>\n\n\n <div className=\"content\">\n <Menu />\n\n {!isVerified() && (\n <div className=\"links\">\n <Link to=\"/resend\">Reenviar email</Link>\n <Link to=\"/verify/:token\">Verificar email</Link>\n </div>\n )}\n\n {(isVerified()) && (\n <form onSubmit={handleEdit}>\n <h1>Editar informações</h1>\n \n <div className=\"input\">\n <label htmlFor=\"\">Nome</label>\n <input type=\"text\" required placeholder=\"Digite seu nome...\" value={nome} onChange={(e) => setNome(e.target.value)}/>\n </div>\n\n <div className=\"input-group\">\n <div className=\"input\">\n <label htmlFor=\"\">Data de Nascimento</label>\n <input type=\"text\" required placeholder=\"DD/MM/AAAA\" value={dataNasc} onChange={(e) => setDataNasc(e.target.value)}/>\n </div>\n \n <div className=\"input\">\n <label htmlFor=\"\">CPF</label>\n <input type=\"text\" placeholder=\"Digite seu CPF...\" required value={cpf} onChange={(e) => setCpf(e.target.value)}/>\n </div>\n </div>\n\n <div className=\"input\">\n <label htmlFor=\"\">Endereço</label>\n <input type=\"text\" placeholder=\"Digite seu endereço...\" required value={endereco} onChange={(e) => setEndereco(e.target.value)}/>\n </div>\n\n <div className=\"input\">\n <label htmlFor=\"\">Biografia</label>\n <textarea name=\"\" id=\"\" cols=\"30\" rows=\"5\" maxlength=\"200\" placeholder=\"Máximo de 200 caracteres...\" value={biografia} onChange={(e) => setBiografia(e.target.value)}></textarea>\n </div> \n\n <div className=\"input\">\n <label htmlFor=\"\">Email</label>\n <input type=\"text\" placeholder=\"Digite seu email...\" value={email} onChange={(e) => setEmail(e.target.value)}/>\n </div>\n\n <button type=\"submit\">Enviar alterações</button> \n </form>\n )}\n\n\n </div>\n\n </div>\n )\n}", "title": "" }, { "docid": "9e04ab6b4e3991bb548821d03a30075f", "score": "0.5328868", "text": "async edit({ params, request, response, view }) {\n }", "title": "" }, { "docid": "ab27a917e3a8bd2ef25e474cc05c58c1", "score": "0.532059", "text": "function changeEmail() {\n // get the email address from the form\n var email = document.getElementById(\"email\").value;\n // change the _cc field's email to this email\n document.getElementById(\"cc\").value = email;\n}", "title": "" }, { "docid": "fcf067959f874a58330d54503f58d5a3", "score": "0.53188586", "text": "changeProfileEmail(email) {\n if (this.state.user.email !== email){\n //patch user new email\n fetch('http://localhost:443/user?'+'email='+email,{\n method: \"PATCH\",\n headers: {\n Authorization: 'Bearer ' + this.props.token\n }\n })\n .then(res => res.json())\n .then(res => {\n //update frontend version of usedr\n let data = this.state.user;\n data.email = email;\n this.setState({user:data})\n })\n }\n }", "title": "" } ]
d48c750dd3b099d29b88c40443a51127
Retrieve map of local references. The references are retrieved as a map of local reference name to element or directive instance.
[ { "docid": "b7bfe9ad818cc74a26198ff93a14ec4b", "score": "0.6753843", "text": "function getLocalRefs(target) {\n var context = loadLContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n }", "title": "" } ]
[ { "docid": "6bff725054c6b9c12abb3bfed7bbd036", "score": "0.69937795", "text": "function discoverLocalRefs(lViewData, nodeIndex) {\n var tNode = lViewData[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n var localRefName = tNode.localNames[i];\n var directiveIndex = tNode.localNames[i + 1];\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lViewData) : lViewData[directiveIndex];\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "6bff725054c6b9c12abb3bfed7bbd036", "score": "0.69937795", "text": "function discoverLocalRefs(lViewData, nodeIndex) {\n var tNode = lViewData[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n var localRefName = tNode.localNames[i];\n var directiveIndex = tNode.localNames[i + 1];\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lViewData) : lViewData[directiveIndex];\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "94980cdb3f2d45f381bf1971ac66aa9f", "score": "0.6936566", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n var localRefName = tNode.localNames[i];\n var directiveIndex = tNode.localNames[i + 1];\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lView) : lView[directiveIndex];\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "94980cdb3f2d45f381bf1971ac66aa9f", "score": "0.6936566", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n var localRefName = tNode.localNames[i];\n var directiveIndex = tNode.localNames[i + 1];\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lView) : lView[directiveIndex];\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "94980cdb3f2d45f381bf1971ac66aa9f", "score": "0.6936566", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n var localRefName = tNode.localNames[i];\n var directiveIndex = tNode.localNames[i + 1];\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lView) : lView[directiveIndex];\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "94980cdb3f2d45f381bf1971ac66aa9f", "score": "0.6936566", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n var localRefName = tNode.localNames[i];\n var directiveIndex = tNode.localNames[i + 1];\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lView) : lView[directiveIndex];\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "b8ff1a48d78fb33c1b176efc77711b87", "score": "0.6782188", "text": "function getLocalRefs(target) {\n var context = loadLContext(target, false);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "86270753ba86acbf00fc1e5636433d65", "score": "0.6744909", "text": "function getLocalRefs(target) {\n var context = getLContext(target);\n if (context === null) return {};\n\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n\n return context.localRefs || {};\n }", "title": "" }, { "docid": "df1d8c2c23d2df9cbf159158b741751c", "score": "0.6709291", "text": "function getLocalRefs(target) {\n var context = loadContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lViewData, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "df1d8c2c23d2df9cbf159158b741751c", "score": "0.6709291", "text": "function getLocalRefs(target) {\n var context = loadContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lViewData, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "7f6d52a2820055d5f71c176be82bacce", "score": "0.6695139", "text": "function getLocalRefs(target) {\n const context = loadLContext(target, false);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "7f6d52a2820055d5f71c176be82bacce", "score": "0.6695139", "text": "function getLocalRefs(target) {\n const context = loadLContext(target, false);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "7f6d52a2820055d5f71c176be82bacce", "score": "0.6695139", "text": "function getLocalRefs(target) {\n const context = loadLContext(target, false);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "7f6d52a2820055d5f71c176be82bacce", "score": "0.6695139", "text": "function getLocalRefs(target) {\n const context = loadLContext(target, false);\n if (context === null)\n return {};\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "1ccc2aeb3c92139735f9f287d029b5c3", "score": "0.6680493", "text": "function getLocalRefs(target) {\n var context = loadLContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "1ccc2aeb3c92139735f9f287d029b5c3", "score": "0.6680493", "text": "function getLocalRefs(target) {\n var context = loadLContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "1ccc2aeb3c92139735f9f287d029b5c3", "score": "0.6680493", "text": "function getLocalRefs(target) {\n var context = loadLContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "1ccc2aeb3c92139735f9f287d029b5c3", "score": "0.6680493", "text": "function getLocalRefs(target) {\n var context = loadLContext(target);\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n return context.localRefs || {};\n}", "title": "" }, { "docid": "d837980d37722227f976ba64a0b5748e", "score": "0.65839994", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n\n if (tNode && tNode.localNames) {\n var result = {};\n var localIndex = tNode.index + 1;\n\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n\n return result;\n }\n\n return null;\n }", "title": "" }, { "docid": "c981fe9ed7d412f1247a187b78ab1984", "score": "0.6525239", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n var localIndex = tNode.index + 1;\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n }", "title": "" }, { "docid": "fbfa7a98f6f9f203e9cf6293cd1bc3d6", "score": "0.650875", "text": "function discoverLocalRefs(lView, nodeIndex) {\n var tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n var result = {};\n var localIndex = tNode.index + 1;\n for (var i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "13db67f51ba06a9c87ab18619eb03c0f", "score": "0.6465832", "text": "function discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "13db67f51ba06a9c87ab18619eb03c0f", "score": "0.6465832", "text": "function discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "13db67f51ba06a9c87ab18619eb03c0f", "score": "0.6465832", "text": "function discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "13db67f51ba06a9c87ab18619eb03c0f", "score": "0.6465832", "text": "function discoverLocalRefs(lView, nodeIndex) {\n const tNode = lView[TVIEW].data[nodeIndex];\n if (tNode && tNode.localNames) {\n const result = {};\n let localIndex = tNode.index + 1;\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n result[tNode.localNames[i]] = lView[localIndex];\n localIndex++;\n }\n return result;\n }\n return null;\n}", "title": "" }, { "docid": "4cacef3bffef1f71956d61b36ffe3228", "score": "0.60829914", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n }", "title": "" }, { "docid": "4cacef3bffef1f71956d61b36ffe3228", "score": "0.60829914", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n }", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "da7e595239196669f1d0bc72abf24939", "score": "0.60623705", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "22e790ad8ec69ad33e7e4b1a7a07048f", "score": "0.60416126", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : []; // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new RuntimeError(\"301\"\n /* EXPORT_NOT_FOUND */\n , \"Export of name '\".concat(localRefs[i + 1], \"' not found!\"));\n localNames.push(localRefs[i], index);\n }\n }\n }", "title": "" }, { "docid": "bb6f4c0e490a39e9205a7d4efa44dfb0", "score": "0.60311157", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n var localNames = tNode.localNames =\n ngDevMode ? new TNodeLocalNames() : [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (var i = 0; i < localRefs.length; i += 2) {\n var index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(\"Export of name '\" + localRefs[i + 1] + \"' not found!\");\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "31eef8c3a2006bc33e7b6a2ae9ebda1b", "score": "0.60138434", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n const localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(`Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "31eef8c3a2006bc33e7b6a2ae9ebda1b", "score": "0.60138434", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n const localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new Error(`Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "a6d399e56febe15ea0e65b747ad8ea0b", "score": "0.59547704", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n const localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new RuntimeError(\"301\" /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "a6d399e56febe15ea0e65b747ad8ea0b", "score": "0.59547704", "text": "function cacheMatchingLocalNames(tNode, localRefs, exportsMap) {\n if (localRefs) {\n const localNames = tNode.localNames = ngDevMode ? new TNodeLocalNames() : [];\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null)\n throw new RuntimeError(\"301\" /* EXPORT_NOT_FOUND */, `Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}", "title": "" }, { "docid": "09718e8876be88d7c6fc17cf955bdd86", "score": "0.5952186", "text": "findDefinitionForLocalReference(node, captures = null) {\n if (!this.localsQuery) { return []; }\n let name = node.text;\n if (!name) { return []; }\n let localRange = rangeForNode(node);\n let globalScope = this.tree.rootNode;\n\n if (!captures) {\n captures = this.groupLocalsCaptures(\n this.localsQuery.captures(\n globalScope,\n globalScope.startPosition,\n globalScope.endPosition\n )\n );\n }\n\n let { scopes, definitions } = captures;\n\n // Consider only the scopes that can influence our local node.\n let relevantScopes = scopes.filter((scope) => {\n let range = rangeForNode(scope);\n return range.containsRange(localRange);\n }).sort((a, b) => {\n a.range.compare(b.range)\n });\n\n relevantScopes.push(globalScope);\n\n // Consider only the definitions whose names match the target's.\n let relevantDefinitions = definitions.filter(\n (def) => def.text === name\n );\n if (relevantDefinitions.length === 0) { return []; }\n\n let definitionsByBaseScope = new Index();\n for (let rDef of relevantDefinitions) {\n // Find all the scopes that include this definition. The largest of those\n // scopes will be its \"base\" scope. If there are no scopes that include\n // this definition, it must have been defined globally.\n let rDefScopes = scopes.filter(s => {\n return isBetweenPoints(\n rDef.startPosition,\n s.startPosition,\n s.endPosition\n );\n }).sort((a, b) => {\n return rangeForNode(b).compare(rangeForNode(a));\n });\n\n let baseScope = rDefScopes[0] ?? globalScope;\n\n // Group each definition by its scope. Since any variable can be\n // redefined an arbitrary number of times, each scope might include\n // multiple definitions of this identifier.\n definitionsByBaseScope.add(baseScope, rDef);\n }\n\n // Moving from smallest to largest scope, get definitions that were made in\n // that scope, and return the closest one to the reference.\n for (let scope of relevantScopes) {\n let definitionsInScope = definitionsByBaseScope.get(scope) ?? [];\n let { length } = definitionsInScope;\n if (length === 0) { continue; }\n if (length === 1) { return definitionsInScope[0]; }\n\n // Here's how we want to sort these candidates:\n //\n // * In each scope, look for a definitions that happen before the local's\n // position. The closest such definition in the narrowest scope is our\n // ideal target.\n // * Failing that, take note of all the definitions that happened _after_\n // the local's position in all relevant scopes. Choose the closest to\n // the local.\n //\n let definitionsBeforeLocal = [];\n let definitionsAfterLocal = [];\n\n for (let def of definitionsInScope) {\n let result = comparePoints(def.startPosition, localRange.start);\n\n let bucket = result < 0 ?\n definitionsBeforeLocal :\n definitionsAfterLocal;\n\n bucket.push(def);\n }\n\n if (definitionsBeforeLocal.length > 0) {\n let maxBeforeLocal;\n for (let def of definitionsBeforeLocal) {\n if (!maxBeforeLocal) {\n maxBeforeLocal = def;\n continue;\n }\n\n let result = comparePoints(def, maxBeforeLocal);\n if (result > 0) {\n maxBeforeLocal = def;\n }\n }\n return maxBeforeLocal;\n }\n\n // TODO: For definitions that happen after the local in the buffer, it's\n // not 100% clear what the right answer should be. I imagine it varies by\n // language. Best guess for now is the one that's closest to the local\n // reference.\n let minAfterLocal;\n for (let def of definitionsAfterLocal) {\n if (!minAfterLocal) {\n minAfterLocal = def;\n continue;\n }\n\n let result = comparePoints(def, minAfterLocal);\n if (result < 0) {\n minAfterLocal = def;\n }\n }\n\n return minAfterLocal;\n }\n }", "title": "" }, { "docid": "21f98307e70a16bc47e730032cbe9df6", "score": "0.5790632", "text": "function getRefHandles(staticMapRef) {\n return {\n getMap: staticMapRef.current && staticMapRef.current.getMap,\n queryRenderedFeatures: staticMapRef.current && staticMapRef.current.queryRenderedFeatures\n };\n}", "title": "" }, { "docid": "666923818abb1646032b0285ecb29295", "score": "0.5682813", "text": "getObject() {\n return (this.refs || [])\n // First, ensure all refs are mounted, shouldn't be ignored, and have a value.\n .filter(r => r.base && r.base.parentNode && !r.ignore && r.name && r.value !== undefined)\n // Then set each ref's keypath on a new object.\n .reduce((o, r) => setKeypath(o, (r.context.groups || []).map(g => g.keypath).concat([r.name]).join('.'), r.value), {});\n }", "title": "" }, { "docid": "80bf98c52d9f1a0028fdd7b959ab7e60", "score": "0.5556411", "text": "function resolveReferences() {\n\n var elementsById = context.elementsById;\n var references = context.references;\n\n var i, r;\n\n for (i = 0; (r = references[i]); i++) {\n var element = r.element;\n var reference = elementsById[r.id];\n var property = getModdleDescriptor(element).propertiesByName[r.property];\n\n if (!reference) {\n context.addWarning({\n message: 'unresolved reference <' + r.id + '>',\n element: r.element,\n property: r.property,\n value: r.id\n });\n }\n\n if (property.isMany) {\n var collection = element.get(property.name),\n idx = collection.indexOf(r);\n\n // we replace an existing place holder (idx != -1) or\n // append to the collection instead\n if (idx === -1) {\n idx = collection.length;\n }\n\n if (!reference) {\n // remove unresolvable reference\n collection.splice(idx, 1);\n } else {\n // add or update reference in collection\n collection[idx] = reference;\n }\n } else {\n element.set(property.name, reference);\n }\n }\n }", "title": "" }, { "docid": "b3cee1f2fdd1f065429186031623d2bf", "score": "0.5517503", "text": "function saveResolvedLocalsInData() {\n var localNames = previousOrParentNode.tNode.localNames;\n if (localNames) {\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ? previousOrParentNode.native : directives[index];\n data.push(value);\n }\n }\n}", "title": "" }, { "docid": "0c7cf8ceb2f05df26eaab68185fd22ea", "score": "0.5476025", "text": "function saveResolvedLocalsInData() {\n var localNames = previousOrParentNode.tNode.localNames;\n if (localNames) {\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ? previousOrParentNode.native : directives[index];\n viewData.push(value);\n }\n }\n}", "title": "" }, { "docid": "0c7cf8ceb2f05df26eaab68185fd22ea", "score": "0.5476025", "text": "function saveResolvedLocalsInData() {\n var localNames = previousOrParentNode.tNode.localNames;\n if (localNames) {\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ? previousOrParentNode.native : directives[index];\n viewData.push(value);\n }\n }\n}", "title": "" }, { "docid": "0c7cf8ceb2f05df26eaab68185fd22ea", "score": "0.5476025", "text": "function saveResolvedLocalsInData() {\n var localNames = previousOrParentNode.tNode.localNames;\n if (localNames) {\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ? previousOrParentNode.native : directives[index];\n viewData.push(value);\n }\n }\n}", "title": "" }, { "docid": "3e027590e9aa8f6a37830b58baae3369", "score": "0.5470928", "text": "function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n var exportsMap = localRefs ? { '': -1 } : null;\n var matches = tView.currentMatches = findDirectiveMatches(tNode);\n if (matches) {\n for (var i = 0; i < matches.length; i += 2) {\n var def = matches[i];\n var valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches, tView);\n saveNameToExportMap(matches[valueIndex], def, exportsMap);\n }\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n }", "title": "" }, { "docid": "93b0a19bcd3a48ef9a7d9a3fdd38de80", "score": "0.5470313", "text": "function saveResolvedLocalsInData() {\n var localNames = previousOrParentNode.tNode.localNames;\n if (localNames) {\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ? previousOrParentNode.native : directives[index];\n viewData.push(value);\n }\n }\n }", "title": "" }, { "docid": "dbc000b93eab38c674e87a7b6b0712d5", "score": "0.54701084", "text": "function snapshot() {\n var map = new Map();\n\n el.querySelectorAll(options.selector).forEach(function (el) {\n var key = el.dataset.key || el;\n\n // parse original transform\n // i.e. strip inverse transform using \"scale(1)\" marker\n var transform = el.style.transform\n ? el.style.transform.replace(/^.*scale\\(1\\)/, '')\n : '';\n\n map.set(key, {\n key: key,\n el: el,\n rect: el.getBoundingClientRect(),\n ancestor: null,\n transform: transform,\n });\n });\n\n resolveAncestors(map);\n\n return map;\n }", "title": "" }, { "docid": "26d9d55176b369da6b87e9bcb1b89d5e", "score": "0.54669493", "text": "function saveResolvedLocalsInData(localRefExtractor) {\n var localNames = previousOrParentTNode.localNames;\n var tNode = previousOrParentTNode;\n if (localNames) {\n var localIndex = previousOrParentTNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" }, { "docid": "e8e32edcd7ce315d7f9b649261edba34", "score": "0.5451189", "text": "_cacheChildrenWithExternalReferences(element) {\n const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);\n const elements = this._elementsWithExternalReferences =\n this._elementsWithExternalReferences || new Map();\n for (let i = 0; i < elementsWithFuncIri.length; i++) {\n funcIriAttributes.forEach(attr => {\n const elementWithReference = elementsWithFuncIri[i];\n const value = elementWithReference.getAttribute(attr);\n const match = value ? value.match(funcIriPattern) : null;\n if (match) {\n let attributes = elements.get(elementWithReference);\n if (!attributes) {\n attributes = [];\n elements.set(elementWithReference, attributes);\n }\n attributes.push({ name: attr, value: match[1] });\n }\n });\n }\n }", "title": "" }, { "docid": "e8e32edcd7ce315d7f9b649261edba34", "score": "0.5451189", "text": "_cacheChildrenWithExternalReferences(element) {\n const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);\n const elements = this._elementsWithExternalReferences =\n this._elementsWithExternalReferences || new Map();\n for (let i = 0; i < elementsWithFuncIri.length; i++) {\n funcIriAttributes.forEach(attr => {\n const elementWithReference = elementsWithFuncIri[i];\n const value = elementWithReference.getAttribute(attr);\n const match = value ? value.match(funcIriPattern) : null;\n if (match) {\n let attributes = elements.get(elementWithReference);\n if (!attributes) {\n attributes = [];\n elements.set(elementWithReference, attributes);\n }\n attributes.push({ name: attr, value: match[1] });\n }\n });\n }\n }", "title": "" }, { "docid": "1f53c30d9b3748e51bd851c25fc174b6", "score": "0.5424398", "text": "_cacheChildrenWithExternalReferences(element) {\n const elementsWithFuncIri = element.querySelectorAll(funcIriAttributeSelector);\n const elements = this._elementsWithExternalReferences =\n this._elementsWithExternalReferences || new Map();\n for (let i = 0; i < elementsWithFuncIri.length; i++) {\n funcIriAttributes.forEach(attr => {\n const elementWithReference = elementsWithFuncIri[i];\n const value = elementWithReference.getAttribute(attr);\n const match = value ? value.match(funcIriPattern) : null;\n if (match) {\n let attributes = elements.get(elementWithReference);\n if (!attributes) {\n attributes = [];\n elements.set(elementWithReference, attributes);\n }\n attributes.push({ name: attr, value: match[1] });\n }\n });\n }\n }", "title": "" }, { "docid": "1392cc31a60b63da550231dae846fe76", "score": "0.5409808", "text": "function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n var exportsMap = localRefs ? { '': -1 } : null;\n var matches = tView.currentMatches = findDirectiveMatches(tNode);\n if (matches) {\n for (var i = 0; i < matches.length; i += 2) {\n var def = matches[i];\n var valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches, tView);\n saveNameToExportMap(matches[valueIndex], def, exportsMap);\n }\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}", "title": "" }, { "docid": "1392cc31a60b63da550231dae846fe76", "score": "0.5409808", "text": "function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n var exportsMap = localRefs ? { '': -1 } : null;\n var matches = tView.currentMatches = findDirectiveMatches(tNode);\n if (matches) {\n for (var i = 0; i < matches.length; i += 2) {\n var def = matches[i];\n var valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches, tView);\n saveNameToExportMap(matches[valueIndex], def, exportsMap);\n }\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}", "title": "" }, { "docid": "1392cc31a60b63da550231dae846fe76", "score": "0.5409808", "text": "function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n var exportsMap = localRefs ? { '': -1 } : null;\n var matches = tView.currentMatches = findDirectiveMatches(tNode);\n if (matches) {\n for (var i = 0; i < matches.length; i += 2) {\n var def = matches[i];\n var valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches, tView);\n saveNameToExportMap(matches[valueIndex], def, exportsMap);\n }\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}", "title": "" }, { "docid": "1392cc31a60b63da550231dae846fe76", "score": "0.5409808", "text": "function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n var exportsMap = localRefs ? { '': -1 } : null;\n var matches = tView.currentMatches = findDirectiveMatches(tNode);\n if (matches) {\n for (var i = 0; i < matches.length; i += 2) {\n var def = matches[i];\n var valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches, tView);\n saveNameToExportMap(matches[valueIndex], def, exportsMap);\n }\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}", "title": "" }, { "docid": "5266028fc6bb1965ed355516bc86665e", "score": "0.53937733", "text": "function getRefByName(l, d) {\n\tvar r = null, j\n\n\td = (d || document)\n\n\tif (d.images[l]) return d.images[l]\n\telse if (d.anchors[l]) return d.anchors[l];\n\telse if (d.layers && d.layers.length > 0) {\n\t\tfor (j=0; j < d.layers.length; j++) {\n\t\t\tr = getRefByName(l, d.layers[j].document)\n\t\t\tif (r && r.length > 0) return r\n\t\t\telse if (r) return [r, d.layers[j]]\n\t\t}\n\t}\n\n\treturn null\n}", "title": "" }, { "docid": "a8d9996ecf78686d6ba0b55515ce6838", "score": "0.5361218", "text": "getAllLocalIds() {\n const localIdResults = {};\n // Add the localIds and result values from the main library\n localIdResults[this.parent.source.library.identifier.id] = {};\n localIdResults[this.parent.source.library.identifier.id] = this.localId_context;\n // Iterate over support libraries and store localIds\n for (const libName in this.library_context) {\n const lib = this.library_context[libName];\n this.supportLibraryLocalIds(lib, localIdResults);\n }\n return localIdResults;\n }", "title": "" }, { "docid": "aa4f784f8f4563c074de20613fbe0613", "score": "0.5347224", "text": "get map () { return this.#map }", "title": "" }, { "docid": "739f7a0d63912728f6efb7e63ad41868", "score": "0.5343269", "text": "getReference() {\r\n\t\tif(!this.module) return null;\r\n\t\treturn {\r\n\t\t\tmodule: this.module,\r\n\t\t\timportedNames: true, // true: full object, false: only sideeffects/no export, array of strings: the exports with this names\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "8339ac5f7465a037595d1e126a572258", "score": "0.5299941", "text": "function locals(obj_id){\n // used for locals() ; the translation engine adds the argument obj,\n // a dictionary mapping local variable names to their values\n var res = dict()\n var scope = __BRYTHON__.scope[obj_id].__dict__\n for(var name in scope){res.__setitem__(name,scope[name])}\n return res\n}", "title": "" }, { "docid": "efa8d97218c8997b03a4de588dc217d8", "score": "0.52856374", "text": "get referencedRegions() {\n let a = typeCast(RegionGroupCalcReference.$, this._bo(true));\n return NamedReference._bj(a);\n }", "title": "" }, { "docid": "06de18bbeb9f041f4279495491c60225", "score": "0.5277801", "text": "function createDirectivesAndLocals(localRefs) {\n var node = previousOrParentNode;\n if (firstTemplatePass) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null);\n }\n else {\n instantiateDirectivesDirectly();\n }\n saveResolvedLocalsInData();\n }", "title": "" }, { "docid": "56775cb5636b7401e9c88f7054396f11", "score": "0.5269542", "text": "_immediate_references() {\n const refs = new Set();\n for (const prop of this.syncable_properties()) {\n const value = prop.get_value();\n HasProps._value_record_references(value, refs, { recursive: false });\n }\n return refs;\n }", "title": "" }, { "docid": "c6dff03e1b569eb9bcdbdd4ae4324455", "score": "0.5228746", "text": "listReps() {\n if (this.representatives != null) {\n return this.representatives;\n }\n\n let reps = new Map();\n for (let i = 0; i < this.vertices.length; i += 1) {\n let v = this.vertices[i];\n v.addToHashMap(reps);\n }\n return reps;\n }", "title": "" }, { "docid": "ca35096a2effbd36b485b070b8b99008", "score": "0.5216388", "text": "_getRefs (descriptor) {\n const refs = schemaUtils.getRefs(descriptor)\n if (refs && refs.length > 0) {\n refs.forEach((elem) => {\n this.refs[elem.path] = elem\n })\n }\n }", "title": "" }, { "docid": "471bb6169e854a87cb484b84403aba49", "score": "0.5205886", "text": "function createDirectivesAndLocals(localRefs) {\n var node = previousOrParentNode;\n if (firstTemplatePass) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null);\n }\n else {\n instantiateDirectivesDirectly();\n }\n saveResolvedLocalsInData();\n}", "title": "" }, { "docid": "471bb6169e854a87cb484b84403aba49", "score": "0.5205886", "text": "function createDirectivesAndLocals(localRefs) {\n var node = previousOrParentNode;\n if (firstTemplatePass) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null);\n }\n else {\n instantiateDirectivesDirectly();\n }\n saveResolvedLocalsInData();\n}", "title": "" }, { "docid": "471bb6169e854a87cb484b84403aba49", "score": "0.5205886", "text": "function createDirectivesAndLocals(localRefs) {\n var node = previousOrParentNode;\n if (firstTemplatePass) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n cacheMatchingDirectivesForNode(node.tNode, tView, localRefs || null);\n }\n else {\n instantiateDirectivesDirectly();\n }\n saveResolvedLocalsInData();\n}", "title": "" }, { "docid": "95b62c32fbc0df1758a60cd400079b90", "score": "0.5198345", "text": "function page_get_ref_infos(ref_key_array){\n var old_ref_infos = get_context_info(\"page_ref_infos\");\n if(p_is_not_null(old_ref_infos) && old_ref_infos.length>0){\n return old_ref_infos;\n }\n var refMap = page_get_ref_datas(ref_key_array);\n var len = 0;\n var o = {};\n var ref_infos = {};\n for(var key in refMap){ \n o = refMap[key];\n len = o.length; \n var category = [];\n for(var i=0;i<len;i++){\n var tmp = {};\n tmp['id'] = o[i]['ieopRCCode'];\n tmp['name'] = o[i]['ieopRCName'];\n category[i] = tmp;\n }\n ref_infos[key] = category;\n } \n set_context_info(\"page_ref_infos\",ref_infos);\n return ref_infos;\n}", "title": "" }, { "docid": "2c5c7cea052cba3c52a4160472454d9b", "score": "0.51969814", "text": "function extractRefs( node, refs ) {\n\t\t\tvar i, list;\n\t\t\tif ( node.t === types.REFERENCE ) {\n\t\t\t\tif ( refs.indexOf( node.n ) === -1 ) {\n\t\t\t\t\trefs.unshift( node.n );\n\t\t\t\t}\n\t\t\t}\n\t\t\tlist = node.o || node.m;\n\t\t\tif ( list ) {\n\t\t\t\tif ( isObject( list ) ) {\n\t\t\t\t\textractRefs( list, refs );\n\t\t\t\t} else {\n\t\t\t\t\ti = list.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\textractRefs( list[ i ], refs );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( node.x ) {\n\t\t\t\textractRefs( node.x, refs );\n\t\t\t}\n\t\t\tif ( node.r ) {\n\t\t\t\textractRefs( node.r, refs );\n\t\t\t}\n\t\t\tif ( node.v ) {\n\t\t\t\textractRefs( node.v, refs );\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "0c1c216352d5141569386ad6d7189fa2", "score": "0.5183519", "text": "get targetManifest() {\n let targetRefs = [this._target.ref];\n let parent = this._parent;\n while (parent) {\n targetRefs.push(parent._target.ref);\n parent = parent._parent;\n }\n return _.map(targetRefs, ref => helpers_1.deref(ref));\n }", "title": "" }, { "docid": "cef38e11390b739e2928a05e04386a75", "score": "0.515595", "text": "function getCurrentReferences() {\n const url = oclServerUrl + collectionPath + \"references?limit=20000\";\n console.log(\"fetching \" + url);\n return fetch(url, { headers: { \"Authorization\": `Token ${apiToken}` } })\n .then(response => {\n if (response.status >= 200 && response.status < 300) {\n return response.json();\n }\n else {\n logOclConnectionError(response.status + \" \" + response.statusText);\n }\n }, logOclConnectionError)\n .then(references => {\n return references.map(r => r.expression);\n })\n}", "title": "" }, { "docid": "301abf3db9a98b9629faef1ecd440da0", "score": "0.5125665", "text": "function cacheMatchingDirectivesForNode(tNode, tView, localRefs) {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n var exportsMap = localRefs ? { '': -1 } : null;\n var matches = tView.currentMatches = findDirectiveMatches(tNode);\n generateExpandoBlock(tNode, matches);\n var totalHostVars = 0;\n if (matches) {\n for (var i = 0; i < matches.length; i += 2) {\n var def = matches[i];\n var valueIndex = i + 1;\n resolveDirective(def, valueIndex, matches);\n totalHostVars += def.hostVars;\n saveNameToExportMap(matches[valueIndex], def, exportsMap);\n }\n }\n if (exportsMap)\n cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n prefillHostVars(totalHostVars);\n}", "title": "" }, { "docid": "3b5a6e9bc889618201c354fd07bddd8f", "score": "0.5081648", "text": "function getAllLocalDependenciesInfo(moduleName) {\n function getAllLocalDependencies(name) {\n const pMap = getAllMonorepoPackages();\n function getAllDeps(n) {\n const loc = pMap[n].localDependencies;\n let arr = [...loc];\n loc.forEach((ld) => {\n const ldDeps = getAllDeps(ld);\n arr = arr.concat(ldDeps);\n });\n return [...new Set(arr)];\n }\n return getAllDeps(name);\n }\n const pMap = getAllMonorepoPackages();\n if (moduleName) {\n const arr = getAllLocalDependencies(moduleName);\n return arr.map((i) => pMap[i]);\n } else {\n return Object.values(pMap);\n }\n}", "title": "" }, { "docid": "872da4993067a06c27bcea5442c9d654", "score": "0.50755215", "text": "function getRefs(components)\r\n{\r\n //React.findDOMNode is used to get data from refs.\r\n var results={};\r\n Object.keys(components.refs).forEach(function(d){\r\n results[d]=React.findDOMNode(components.refs[d]).value;\r\n });\r\n return results;\r\n}", "title": "" }, { "docid": "635f178ae596383897691b5833b510d7", "score": "0.5071497", "text": "function mapElementReferencesOfRefFileToModuleDefinition(refFile, definitionModule, defName, analysisFileObjs, defRange) {\n\n // console.log(refFile.fileName + ' ' + defName)\n //approximation: Tern cannot retrieve element references\n //inside expressions using the bracket notation reliably\n //in the case that moduleDefinition is not referenced,\n //ensure that no identifiers are defined through moduleDefinition\n let defRefs = refFile.astRootCollection.find(jscodeshift.Identifier).filter(id => {\n\n return id.value.name === defName;\n });\n\n // console.log(defRefs.length)\n if(defRefs.length === 0) {\n\n return [];\n }\n\n //keep only references of moduleDefinition\n //prevent name collisions\n defRefs = defRefs.filter(identifier => {\n \n // console.log(identifier.value.loc);\n let identifierStart = identifier.value.range[0];\n let identifierEnd = identifier.value.range[1];\n\n ternServer.addFile(refFile.fileName, refFile.astRootCollection.toSource());\n \n let requestDetails = {\n query: {\n \n type: \"definition\",\n file: refFile.fileName,\n start: identifierStart,\n end: identifierEnd,\n variable: identifier.value.name\n },\n timeout: 1000,\n files: analysisFileObjs\n };\n\n //is reference modelling an access to a variable defined in refFile?\n let isRefDefinedInRefFile = false;\n let definitionFile;\n let defStart;\n let defEnd;\n\n ternServer.request(requestDetails, function(error, success) {\n \n // console.log(success)\n // console.log(error);\n if(error !== null || Object.keys(success).length === 0) {\n \n return;\n }\n \n //retrieve range of declaration\n definitionFile = success.origin;\n defStart = success.start;\n defEnd = success.end;\n \n });\n\n ternServer.delFile(refFile.fileName);\n\n //definitionFile identical to refFile\n //do not proceed\n if(definitionFile != null &&\n require.resolve(definitionFile) === require.resolve(refFile.fileName)) {\n\n return false;\n }\n\n //find definition of identifier in other modules through a query in ternjs\n //(stop request after 1 sec)\n requestDetails = {\n query: {\n \n type: \"definition\",\n file: refFile.fileName,\n start: identifierStart,\n end: identifierEnd,\n variable: identifier.value.name\n },\n timeout: 1000,\n files: analysisFileObjs\n };\n \n let isRef = false;\n \n ternServer.request(requestDetails, function(error, success) {\n \n // console.log(success)\n // console.log(error);\n if(error !== null || Object.keys(success).length === 0) {\n \n //Ternjs approximation: assume that identifier is a moduleDefinition reference\n //in the case that position is wrongly marked as out of file\n isRef = true;\n return;\n }\n \n //retrieve range of declaration\n definitionFile = success.origin;\n defStart = success.start;\n defEnd = success.end;\n \n });\n\n if(isRef === true) {\n\n return true;\n }\n \n if(definitionFile === undefined) {\n \n //definitionFile not modified with ternjs's results\n return false;\n }\n\n if(require.resolve(definitionFile) === require.resolve(definitionModule.fileName) &&\n defStart === defRange[0] && defEnd === defRange[1]) {\n\n return true;\n }\n \n return false;\n });\n\n let refFileDefRefs = [];\n defRefs.forEach(defRef => {\n\n refFileDefRefs.push({\n\n 'start': defRef.value.range[0],\n 'end': defRef.value.range[1]\n });\n });\n\n return refFileDefRefs;\n}", "title": "" }, { "docid": "78c16fe227008aa9ed64dc43e87bba4a", "score": "0.5056422", "text": "function InvokeDefinitionMap() {\n this.map = [];\n this.lookup_table = {}; // Just for building dictionary\n}", "title": "" }, { "docid": "bc494fc63e02d6aa4a3d0f76cb9fbcd2", "score": "0.50553477", "text": "static getLocalTransforms(elm) {\n let localTransforms = []\n\n if (typeof elm.attr('data-mh-transform-proxied') === 'undefined') {\n if (elm.attr('data-mh-local-transforms')) {\n localTransforms = JSON\n .parse(elm.attr('data-mh-local-transforms'))\n }\n } else {\n const proxyElm = $.closest(\n elm.domElement(),\n '[data-mh-transform-proxy]'\n )\n if (proxyElm && proxyElm.dataset.mhLocalTransforms) {\n localTransforms = JSON\n .parse(proxyElm.dataset.mhLocalTransforms)\n }\n }\n\n return localTransforms\n }", "title": "" }, { "docid": "7dad222d808fbfd29bbf52a6b94c0773", "score": "0.50480264", "text": "scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }", "title": "" }, { "docid": "7dad222d808fbfd29bbf52a6b94c0773", "score": "0.50480264", "text": "scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }", "title": "" }, { "docid": "7dad222d808fbfd29bbf52a6b94c0773", "score": "0.50480264", "text": "scopeRefs(scopeName) {\n return this._extScope.scopeRefs(scopeName, this._values);\n }", "title": "" }, { "docid": "1334c862b6fa2594f55e88aac6a9a9cc", "score": "0.504435", "text": "static getAllExtraMapRefs(): Promise<ExtraMapRefsData[]> {\r\n return LocalStorageService.getStorageData().then((storageData: StorageData) => {\r\n return LocalStorageService.find(storageData, Q.clazz(\"ExtraMapRefsData\"));\r\n });\r\n }", "title": "" }, { "docid": "b95b4a65aed2b2f8b6668660e6eeb227", "score": "0.50417876", "text": "function _getReadableVarMap(vb) {\n var currVB = vb;\n var retMap = new Map();\n while (currVB !== null) {\n var mergedMap = new Map();\n for (var _iterator4 = currVB.instances.values(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {\n var _ref4;\n\n if (_isArray4) {\n if (_i4 >= _iterator4.length) break;\n _ref4 = _iterator4[_i4++];\n } else {\n _i4 = _iterator4.next();\n if (_i4.done) break;\n _ref4 = _i4.value;\n }\n\n var varMap = _ref4;\n\n mergedMap = _unionMap(mergedMap, _convertMap(varMap));\n }\n retMap = _addOnlyMissingMappings(retMap, mergedMap);\n currVB = currVB.paren;\n }\n return retMap;\n}", "title": "" }, { "docid": "8057df05213e20bd837f0c7c620177b4", "score": "0.5018405", "text": "function getMap() {\n return _map;\n }", "title": "" }, { "docid": "19ed59da8f79b96cca57dc72ed6c9c7d", "score": "0.50172734", "text": "function $Refs () {\r\n /**\r\n * Indicates whether the schema contains any circular references.\r\n *\r\n * @type {boolean}\r\n */\r\n this.circular = false;\r\n\r\n /**\r\n * A map of paths/urls to {@link $Ref} objects\r\n *\r\n * @type {object}\r\n * @protected\r\n */\r\n this._$refs = {};\r\n\r\n /**\r\n * The {@link $Ref} object that is the root of the JSON schema.\r\n *\r\n * @type {$Ref}\r\n * @protected\r\n */\r\n this._root$Ref = null;\r\n }", "title": "" }, { "docid": "c72bc9f3e4da9f979d136de6cdef2113", "score": "0.5005893", "text": "function MirrorRefCache(json_refs) {\n var tmp = eval('(' + json_refs + ')');\n this.refs_ = [];\n for (var i = 0; i < tmp.length; i++) {\n this.refs_[tmp[i].handle] = tmp[i];\n }\n}", "title": "" }, { "docid": "7631b22e7970611c02d0faf981f061dd", "score": "0.500218", "text": "function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n var localNames = tNode.localNames;\n if (localNames) {\n var localIndex = tNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ?\n localRefExtractor(tNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" }, { "docid": "7631b22e7970611c02d0faf981f061dd", "score": "0.500218", "text": "function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n var localNames = tNode.localNames;\n if (localNames) {\n var localIndex = tNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ?\n localRefExtractor(tNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" }, { "docid": "7631b22e7970611c02d0faf981f061dd", "score": "0.500218", "text": "function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n var localNames = tNode.localNames;\n if (localNames) {\n var localIndex = tNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ?\n localRefExtractor(tNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" }, { "docid": "7631b22e7970611c02d0faf981f061dd", "score": "0.500218", "text": "function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n var localNames = tNode.localNames;\n if (localNames) {\n var localIndex = tNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ?\n localRefExtractor(tNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" }, { "docid": "7631b22e7970611c02d0faf981f061dd", "score": "0.500218", "text": "function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n var localNames = tNode.localNames;\n if (localNames) {\n var localIndex = tNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ?\n localRefExtractor(tNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" }, { "docid": "7631b22e7970611c02d0faf981f061dd", "score": "0.500218", "text": "function saveResolvedLocalsInData(viewData, tNode, localRefExtractor) {\n var localNames = tNode.localNames;\n if (localNames) {\n var localIndex = tNode.index + 1;\n for (var i = 0; i < localNames.length; i += 2) {\n var index = localNames[i + 1];\n var value = index === -1 ?\n localRefExtractor(tNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}", "title": "" } ]
36aa21af692349ba272291328aff6064
Removes all keyvalue entries from the list cache.
[ { "docid": "051c6c475583233022517635de972be3", "score": "0.0", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}", "title": "" } ]
[ { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "dba73f4aac72eb81c9ba057b88fe3b2d", "score": "0.7357779", "text": "function listCacheClear(){this.__data__=[];}", "title": "" }, { "docid": "07498a341bcb49b37d860d28f0ade73f", "score": "0.7254578", "text": "function listCacheClear() {\n this.__data__ = []\n this.size = 0\n }", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "0722af3dd2b115f1061e86979b9b6a16", "score": "0.7236393", "text": "function listCacheClear(){this.__data__=[];this.size=0;}", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "45e3e18ed3baa54b073cfda12c8d07c5", "score": "0.7234546", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t this.size = 0;\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "1dc0ce38162610f2cb66b7ee7aeeb8b4", "score": "0.7231067", "text": "function listCacheClear() {\n\t this.__data__ = [];\n\t }", "title": "" }, { "docid": "bb85ba78f35c7f9042fe82ddbaf40289", "score": "0.72269374", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "bb85ba78f35c7f9042fe82ddbaf40289", "score": "0.72269374", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "86381fd7295752e8d1d605b13a24817d", "score": "0.7226719", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "c7c627f2640681a0cc54b9ffb6f726ec", "score": "0.7218172", "text": "function listCacheClear(){this.__data__=[],this.size=0}", "title": "" }, { "docid": "5eaac506d61ebda454500928edacce6b", "score": "0.7214961", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "cdadc614ea716531bd83f20051f2bc8d", "score": "0.72018206", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" }, { "docid": "ffff2a14105ffe57d16be5dbb9b35983", "score": "0.71798724", "text": "function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }", "title": "" } ]
0b56b0c53d8a97b59bb2d107bd357677
Constructs a new ParticipantResponse. The created participant.
[ { "docid": "c83e9fc4607c91a1435dbf8e156bec0e", "score": "0.7601044", "text": "constructor() { \n \n ParticipantResponse.initialize(this);\n }", "title": "" } ]
[ { "docid": "397981c86193aec555d1f028ac522c75", "score": "0.6406516", "text": "function Participant() {\n _classCallCheck(this, Participant);\n\n Participant.initialize(this);\n }", "title": "" }, { "docid": "84f4d70c73c613d50914c3bf5bc0a6cd", "score": "0.5872302", "text": "constructor() { \n \n Participant.initialize(this);\n }", "title": "" }, { "docid": "fbba0b550772ad8801f8840575eee387", "score": "0.5583102", "text": "get participant () {\r\n\t\treturn this._participant;\r\n\t}", "title": "" }, { "docid": "6025862dd7b81d8625ebace4d1890060", "score": "0.55211073", "text": "get participant () {\n\t\treturn this._participant;\n\t}", "title": "" }, { "docid": "3079e2c17ec44691223441a3b3bda5e7", "score": "0.5387524", "text": "function createJSONRpcResponseObject(error, result, id) {\n var response = createJSONRpcBaseObject();\n response.id = id;\n\n if (typeof error === \"undefined\" || error === null) {\n response.result = (result === \"undefined\") ? null : result;\n } else {\n response.error = error;\n }\n\n return response;\n }", "title": "" }, { "docid": "ba4cf60c2db1fe97c02f20a1157182f8", "score": "0.5366369", "text": "set participant(participant) {\n\t\tif (Array.isArray(participant)) {\n\t\t\tthis._participant = participant.map((i) => new Participant(i));\n\t\t} else {\n\t\t\tthis._participant = [new Participant(participant)];\n\t\t}\n\t}", "title": "" }, { "docid": "b023aaf40fe140641964e9e76e3cb50d", "score": "0.52516204", "text": "createUser(email, firstName, lastName, participantType) {\n const factory = this.definition.getFactory();\n let newUser = null;\n\n try {\n newUser = factory.newResource(process.env.name_space, participantType, email);\n newUser.firstName = firstName;\n newUser.lastName = lastName;\n } catch (e) {\n console.log(e);\n return null;\n }\n\n return this.connection.getParticipantRegistry(process.env.name_space + '.' + participantType)\n .then((participantRegistry) => {\n return participantRegistry.add(newUser);\n })\n .then(() => {\n return this.connection.issueIdentity(process.env.name_space + '.' + participantType + '#' + email, uuid());\n })\n .then((newUserCred) => {\n console.log(newUserCred);\n return {\n userID: newUserCred.userID,\n userSecret: newUserCred.userSecret,\n email: email,\n firstName: firstName,\n lastName: lastName,\n participantType: participantType,\n businessNetwork: process.env.business_network\n };\n })\n .catch((e) => {\n console.log(e);\n return null;\n });\n }", "title": "" }, { "docid": "532df6bd358d651b74607473fa69ec90", "score": "0.5246565", "text": "async function createTournamentChallenge(req, res) {\n const challengeMock = {\n number: 9,\n name: 'Create a Quarkus Library microservice',\n title: 'Crea una librería',\n subtitle: 'con microservicios de Quarkus',\n mentor: 'Auri Muñoz',\n description: 'Build an application with Quarkus providing several REST endpoints that allow CRUD operations on books stored in a Postgres database. Moreover, deploy the application on',\n bonus: 'Add a simple User Interface to interact with the API.',\n duration: [{\n level: 'Beginner',\n duration: 4,\n }, {\n level: 'Intermediate',\n duration: 2,\n }],\n technologies: ['Red Hat OpenShift', 'Java / Quarkus'],\n deliverable: '',\n hints: 'the extensions to use, even you can do it using Spring Data JPA if you are more comfortable with it.',\n notes: 'RestEasy JAXRS, RestEasy Json, Hibernate ORM Panache, BDD PostgreSQL, SmallRye OpenAPI are the extensions to use.',\n video: 'https://youtu.be/2vrFl5qrRBE',\n tournamentId: '60a909ec62f534c96ab339d7',\n };\n const created = await tournamentChallengeService.createTournamentChallenge(challengeMock);\n\n res.json(created);\n }", "title": "" }, { "docid": "b10890c6add608b5e070fe8871172f40", "score": "0.5210572", "text": "constructor() { \n \n ScheduledMessagesResponse.initialize(this);\n }", "title": "" }, { "docid": "0f9913620b0d180b06c37fdc4624e35a", "score": "0.5209108", "text": "async create() {\n // create\n const promise = this.Service.create(this.ctx.request.body);\n // response\n return this.response('create', promise);\n }", "title": "" }, { "docid": "c1b633306f79ea0cc8abb538c47dddf5", "score": "0.52072793", "text": "constructor() { \n \n CreateComputeResponseProtocol.initialize(this);\n }", "title": "" }, { "docid": "8074f1fbf27d7f4a1a494323a328c2cf", "score": "0.516027", "text": "clone() {\n const { headers, status, statusText } = this;\n return new Response(this, { headers, status, statusText });\n }", "title": "" }, { "docid": "f292c0c138d1d8635c108d126e41eb57", "score": "0.5070344", "text": "function BaseDataResponse(requestId) {\n this.requestId = requestId;\n }", "title": "" }, { "docid": "d18031b478a7b0f81c77659ae59a00be", "score": "0.5054994", "text": "get participantId() {\n return this.privId;\n }", "title": "" }, { "docid": "fe135c173d8c259d103f87f6a77aafbc", "score": "0.5051697", "text": "function buildResponse() {\n return http_mocks.createResponse({eventEmitter: require('events').EventEmitter})\n}", "title": "" }, { "docid": "ac2b994cf6a1622a60f8ae32ba3aa7c2", "score": "0.50414544", "text": "function buildResponse(sessionAttributes, speechletResponse) {\n return {\n version: '1.0',\n sessionAttributes,\n response: speechletResponse,\n };\n}", "title": "" }, { "docid": "3aa7546d3608041abf2a6519a367498e", "score": "0.5034475", "text": "function buildResponse(sessionAttributes, speechletResponse){\n return {\n version: \"1.0\",\n sessionAttributes: sessionAttributes,\n response: speechletResponse\n };\n}", "title": "" }, { "docid": "2f12e69658e4239e5ac1a2cbe3590aa2", "score": "0.50097805", "text": "responseCreation(email, roleName) {\n\t\tlogger.info('responseCreation() initiated');\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tlet sql = `select a.applicant_id, a.account_type, a.next_step, c.email, c.first_name, c.gender, c.last_name, c.mobile,c.phone,\n\t\t\tad.address_line1, ad.address_line2, ad.city, ad.country_id, ad.postal_code, ad.region, ad.town, k.kyc_status\n\t\t\tfrom applicant a, contact c, address ad, kyc k\n\t\t\twhere a.applicant_id=c.applicant_id and a.applicant_id= ad.applicant_id and a.account_type ='${roleName}' and a.applicant_id= k.applicant_id and c.email = '${email}'`;\n\t\t\tDbInstance.executeQuery(sql).then(result => {\n\t\t\t\tlogger.info('responseCreation() execution completed');\n\t\t\t\tresolve(result);\n\t\t\t}).catch((err) => {\n\t\t\t\tlogger.error(err);\n\t\t\t\tlogger.info('responseCreation() execution completed');\n\t\t\t\treject(`${err}`);\n\t\t\t})\n\n\t\t})\n\t}", "title": "" }, { "docid": "95a9df747b67925f531c1602a550f860", "score": "0.5000323", "text": "function buildResponse(sessionAttributes, speechletResponse) {\n return {\n version: \"1.0\",\n sessionAttributes: sessionAttributes,\n response: speechletResponse\n };\n}", "title": "" }, { "docid": "95a9df747b67925f531c1602a550f860", "score": "0.5000323", "text": "function buildResponse(sessionAttributes, speechletResponse) {\n return {\n version: \"1.0\",\n sessionAttributes: sessionAttributes,\n response: speechletResponse\n };\n}", "title": "" }, { "docid": "999264262b2c555457713bccceddf9ed", "score": "0.49827662", "text": "function register_participant(server, experiment_id, version = \"v1.0\", prefix = \"\", attributes = \"\")\n{\n//Build URL based on parameters\nconst url = server + \"/red-api/\" + version + \"/register-participant/\" + experiment_id\n\n//Make Fetch request to register participant for experiment \nfetch(url, {\n method:'POST',\n headers: \n {\n 'Content-Type': 'application/json'\n }\n ,\n //Sends Json request to create-experiment in proper format\n body: JSON.stringify({\n prefix:prefix,\n attributes:attributes,\n })\n})\n //Return string ID of registered participant\n .then(response => { \n return response.json();\n })\n}", "title": "" }, { "docid": "00fa40ef458912e85c2e2b51aff470fa", "score": "0.49813744", "text": "toRESTResponse() {\n return {\n success: false,\n error: {\n innerCode: this.innerCode,\n message: this.message,\n extras: this.extras,\n },\n };\n }", "title": "" }, { "docid": "7e1cd5adc06547255469fad8a314ee79", "score": "0.49670398", "text": "async participant(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error('You must be logged in to do that!');\n }\n // TODO check authorization (being an admin or a researcher of the study)\n\n const participant = await ctx.db.query.profile(\n {\n where: {\n id: args.participantId,\n },\n },\n info\n );\n\n return participant;\n }", "title": "" }, { "docid": "1894f943e2e93476ae899f70798d1e56", "score": "0.4962904", "text": "createParty() {\n\t\t\tif (!this.party) {\n\t\t\t\tthis.party = [];\n\t\t\t\tthis.party.push(new DemoFighter());\n\t\t\t\tthis.hero = 0; // index of the party member who is currently being controlled\n\t\t\t}\n\t\t\treturn Promise.resolve();\n\t\t}", "title": "" }, { "docid": "eae4a35419ad7c5cded2c5d25e30c040", "score": "0.49276835", "text": "constructor(result) {\n this.protoId = result.proto_id;\n this.result = result.result;\n }", "title": "" }, { "docid": "91cea072f156f8119eb0a9b169ce9ccc", "score": "0.48957288", "text": "function addParticipant(p) {\n return knex('events_users')\n .insert({\n event_id: eventId,\n user_id: p.id,\n is_lead: p.lead,\n is_participant: true\n }, '*')\n .then((row) => {\n return Promise.resolve(row)\n })\n }", "title": "" }, { "docid": "1efca267aa82c5a483d32c410bcf51e6", "score": "0.48895037", "text": "createResponseObject(status, success, message, data, token){\n let responseObject = {\n status,\n success,\n message,\n data: null\n }\n if(data != null){\n responseObject.data = data\n }else{\n responseObject = {\n status,\n success,\n message\n }\n }\n if(data != null && token != null){\n responseObject.data = {\n firstName: data.firstName,\n lastName: data.lastName,\n email: data.email,\n token: token\n }\n }\n return responseObject\n }", "title": "" }, { "docid": "b7ca678280c5c5b991b54f7dffa4332e", "score": "0.48865175", "text": "function Response() {\n this['a'] = null;\n this['b'] = null;\n this['overlapN'] = new Vector();\n this['overlapV'] = new Vector();\n this.clear();\n }", "title": "" }, { "docid": "5b0943ac724e1383e05e51acc8bbbe86", "score": "0.48857695", "text": "async function constructResponse(data, trans_id, res){\n let from_balance = await Balance.getAccountBalance(data.from);\n let to_balance = await Balance.getAccountBalance(data.to);\n let body = { id: trans_id, from: {id: data.from, balance: from_balance.balance},\n to: {id: data.to, balance: to_balance.balance}, transfered: data.amount};\n res.status(OK_STATUS).send(body);\n}", "title": "" }, { "docid": "e90e11ec7633fa9648bfb116a9987d32", "score": "0.48815086", "text": "constructor(params){\n\t\tsuper(params);\n\n\t\tif(!this.extra_data.participants){\n\t\t\tthis.extra_data.participants = [];\n\t\t\tthis.extra_data.analytics = {};\n\t\t}\n\t}", "title": "" }, { "docid": "6b55c96002cc3116ec8853540158c049", "score": "0.4879383", "text": "responseObject () {\n const responseObject = {\n id: this.id,\n name: this.name,\n description: this.description,\n }\n\n return responseObject\n }", "title": "" }, { "docid": "f55c2298678ff2c14ab8b61ab28afa33", "score": "0.4878402", "text": "function createResponse(respType,respPayload) {\n let response = {};\n\n if(respType === \"SUCCESS\")\n response.status = \"SUCCESS\";\n else if(respType === \"ERROR\")\n response.status = \"ERROR\";\n\n response.payloadType = \"UTF-8\";\n response.payload = respPayload;\n\n return response;\n}", "title": "" }, { "docid": "cf237de6bff37bc798168f7bd1179bca", "score": "0.48348677", "text": "function Response() {\n this.nestables = [];\n valid_attributes = [];\n elem = '';\n errmsg = '';\n}", "title": "" }, { "docid": "5c4de7b8893d3e439d1c1eb83b09c047", "score": "0.48326665", "text": "function Response() {\n //Create a new response object and set defaults\n this.strest = {\n v: pkg.config.strest_version,\n txn: {\n id: '',\n status: 'completed'\n }\n };\n this.status = {\n code: 200,\n message: 'OK'\n };\n}", "title": "" }, { "docid": "3866c7edf74d311a9b2b6d45cafad394", "score": "0.48299056", "text": "create(request, response) {\n Task.create(request.body)\n .then(task => response.json(task))\n .catch(error => response.json(error));\n }", "title": "" }, { "docid": "e61ba2b697cdbe17b721ab0b60c06ce6", "score": "0.48286805", "text": "async _submitResponse() {\n\n await surveyReporting.create({\n surveyId: this.surveyId,\n userId: this.userId,\n response: this.formResponse\n });\n\n }", "title": "" }, { "docid": "bfc2bdfecb1857ceffaf113a3e1373aa", "score": "0.48137787", "text": "function JitsiParticipant(jid, conference, displayName, isHidden){\n this._jid = jid;\n this._id = Strophe.getResourceFromJid(jid);\n this._conference = conference;\n this._displayName = displayName;\n this._supportsDTMF = false;\n this._tracks = [];\n this._role = 'none';\n this._status = null;\n this._availableDevices = {\n audio: undefined,\n video: undefined\n };\n this._isHidden = isHidden;\n this._properties = {};\n}", "title": "" }, { "docid": "d6c56e5c3164e8c209ea6e56e82886d0", "score": "0.4801377", "text": "function createAMission(missionMetadata, progressMetadata) {\n let metadata = {\n agreeCount: progressMetadata.agree_count,\n completed : missionMetadata.completed,\n disagreeCount: progressMetadata.disagree_count,\n labelsProgress : missionMetadata.labels_progress,\n labelsValidated : missionMetadata.labels_validated,\n labelTypeId : missionMetadata.label_type_id,\n missionId : missionMetadata.mission_id,\n missionType : missionMetadata.mission_type,\n notSureCount: progressMetadata.not_sure_count,\n skipped : missionMetadata.skipped,\n pay: missionMetadata.pay\n };\n let mission = new Mission(metadata);\n addAMission(mission);\n svv.modalMission.setMissionMessage(mission);\n svv.modalInfo.setMissionInfo(mission);\n svv.statusField.refreshLabelCountsDisplay();\n }", "title": "" }, { "docid": "d98c77059a1cd0fa8944d8d486e6a5ef", "score": "0.47981238", "text": "function constructOutgoingResponse(message, options) {\n const CRLF = \"\\r\\n\";\n if (options.statusCode < 100 || options.statusCode > 699) {\n throw new TypeError(\"Invalid statusCode: \" + options.statusCode);\n }\n const reasonPhrase = options.reasonPhrase ? options.reasonPhrase : Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"getReasonPhrase\"])(options.statusCode);\n // SIP responses are distinguished from requests by having a Status-Line\n // as their start-line. A Status-Line consists of the protocol version\n // followed by a numeric Status-Code and its associated textual phrase,\n // with each element separated by a single SP character.\n // https://tools.ietf.org/html/rfc3261#section-7.2\n let response = \"SIP/2.0 \" + options.statusCode + \" \" + reasonPhrase + CRLF;\n // One largely non-method-specific guideline for the generation of\n // responses is that UASs SHOULD NOT issue a provisional response for a\n // non-INVITE request. Rather, UASs SHOULD generate a final response to\n // a non-INVITE request as soon as possible.\n // https://tools.ietf.org/html/rfc3261#section-8.2.6.1\n if (options.statusCode >= 100 && options.statusCode < 200) {\n // TODO\n }\n // When a 100 (Trying) response is generated, any Timestamp header field\n // present in the request MUST be copied into this 100 (Trying)\n // response. If there is a delay in generating the response, the UAS\n // SHOULD add a delay value into the Timestamp value in the response.\n // This value MUST contain the difference between the time of sending of\n // the response and receipt of the request, measured in seconds.\n // https://tools.ietf.org/html/rfc3261#section-8.2.6.1\n if (options.statusCode === 100) {\n // TODO\n }\n // The From field of the response MUST equal the From header field of\n // the request. The Call-ID header field of the response MUST equal the\n // Call-ID header field of the request. The CSeq header field of the\n // response MUST equal the CSeq field of the request. The Via header\n // field values in the response MUST equal the Via header field values\n // in the request and MUST maintain the same ordering.\n // https://tools.ietf.org/html/rfc3261#section-8.2.6.2\n const fromHeader = \"From: \" + message.getHeader(\"From\") + CRLF;\n const callIdHeader = \"Call-ID: \" + message.callId + CRLF;\n const cSeqHeader = \"CSeq: \" + message.cseq + \" \" + message.method + CRLF;\n const viaHeaders = message.getHeaders(\"via\").reduce((previous, current) => {\n return previous + \"Via: \" + current + CRLF;\n }, \"\");\n // If a request contained a To tag in the request, the To header field\n // in the response MUST equal that of the request. However, if the To\n // header field in the request did not contain a tag, the URI in the To\n // header field in the response MUST equal the URI in the To header\n // field; additionally, the UAS MUST add a tag to the To header field in\n // the response (with the exception of the 100 (Trying) response, in\n // which a tag MAY be present). This serves to identify the UAS that is\n // responding, possibly resulting in a component of a dialog ID. The\n // same tag MUST be used for all responses to that request, both final\n // and provisional (again excepting the 100 (Trying)).\n // https://tools.ietf.org/html/rfc3261#section-8.2.6.2\n let toHeader = \"To: \" + message.getHeader(\"to\");\n if (options.statusCode > 100 && !message.parseHeader(\"to\").hasParam(\"tag\")) {\n let toTag = options.toTag;\n if (!toTag) {\n // Stateless UAS Behavior...\n // o To header tags MUST be generated for responses in a stateless\n // manner - in a manner that will generate the same tag for the\n // same request consistently. For information on tag construction\n // see Section 19.3.\n // https://tools.ietf.org/html/rfc3261#section-8.2.7\n toTag = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"newTag\"])(); // FIXME: newTag() currently generates random tags\n }\n toHeader += \";tag=\" + toTag;\n }\n toHeader += CRLF;\n // FIXME: TODO: needs review... moved to InviteUserAgentServer (as it is specific to that)\n // let recordRouteHeaders = \"\";\n // if (request.method === C.INVITE && statusCode > 100 && statusCode <= 200) {\n // recordRouteHeaders = request.getHeaders(\"record-route\").reduce((previous, current) => {\n // return previous + \"Record-Route: \" + current + CRLF;\n // }, \"\");\n // }\n // FIXME: TODO: needs review...\n let supportedHeader = \"\";\n if (options.supported) {\n supportedHeader = \"Supported: \" + options.supported.join(\", \") + CRLF;\n }\n // FIXME: TODO: needs review...\n let userAgentHeader = \"\";\n if (options.userAgent) {\n userAgentHeader = \"User-Agent: \" + options.userAgent + CRLF;\n }\n let extensionHeaders = \"\";\n if (options.extraHeaders) {\n extensionHeaders = options.extraHeaders.reduce((previous, current) => {\n return previous + current.trim() + CRLF;\n }, \"\");\n }\n // The relative order of header fields with different field names is not\n // significant. However, it is RECOMMENDED that header fields which are\n // needed for proxy processing (Via, Route, Record-Route, Proxy-Require,\n // Max-Forwards, and Proxy-Authorization, for example) appear towards\n // the top of the message to facilitate rapid parsing.\n // https://tools.ietf.org/html/rfc3261#section-7.3.1\n // response += recordRouteHeaders;\n response += viaHeaders;\n response += fromHeader;\n response += toHeader;\n response += cSeqHeader;\n response += callIdHeader;\n response += supportedHeader;\n response += userAgentHeader;\n response += extensionHeaders;\n if (options.body) {\n response += \"Content-Type: \" + options.body.contentType + CRLF;\n response += \"Content-Length: \" + Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"utf8Length\"])(options.body.content) + CRLF + CRLF;\n response += options.body.content;\n }\n else {\n response += \"Content-Length: \" + 0 + CRLF + CRLF;\n }\n return { message: response };\n}", "title": "" }, { "docid": "2f0ca59c3ef1e91aecfecc48bb3160c0", "score": "0.47966754", "text": "create({ body }, res) {\n let message = body.Body,\n from = body.From;\n reply(res);\n logMessage('in', from, message, config);\n }", "title": "" }, { "docid": "afb3ffbbad2dbb2c96b21929643b47ee", "score": "0.47918242", "text": "function ModelResponse(subscribe) {\n this._subscribe = subscribe;\n}", "title": "" }, { "docid": "485ed6fe358bfb83f0a8515307fa11fb", "score": "0.47895995", "text": "function createConversation(participants) {\n var conversation = layerSampleApp.client.createConversation({\n participants: participants,\n distinct: true\n });\n selectConversation(conversation.id);\n }", "title": "" }, { "docid": "ecad908401d1ea60831124e7506d0d3d", "score": "0.4774025", "text": "function createPerson(options){\n return new Promise((resolve,reject)=>{\n axios({\n method : \"post\",\n url : `${URL}${PERSONGROUPS}/${options.personGroupId}/persons`,\n headers : {\n \"Content-Type\" : CONTENT_TYPE_JSON,\n \"Ocp-Apim-Subscription-key\" : options.subscriptionKey\n },\n data : {\n \"name\" : options.name,\n \"userData\" : options.userData\n }\n }).then((res)=>{\n return resolve(res.data);\n }).catch((err)=>{\n return reject(err.response.data);\n })\n }) \n}", "title": "" }, { "docid": "481058f27e29f9bda1ca9b1861bc0b01", "score": "0.47725534", "text": "function newMessage(m: MessageParts): Message {\n let message: Object = Object.create(messageProto)\n\n message.message_id = uuid()\n message.upload = m.upload\n message.created = Date.now()\n message.recipient = m.recipient\n message.sender = m.sender\n message.handled = null\n message.handled_by = null\n message.outcome = null\n message.read = null\n\n return message\n}", "title": "" }, { "docid": "857513310b158f1dbcd61dbae76d9789", "score": "0.47544897", "text": "static createInstance(\r\n uuid,\r\n utilityId,\r\n partyId,\r\n fromDate,\r\n thruDate,\r\n emissionsAmount,\r\n renewableEnergyUseAmount,\r\n nonrenewableEnergyUseAmount,\r\n energyUseUom,\r\n factorSource,\r\n url,\r\n md5,\r\n tokenId\r\n ) {\r\n return new EmissionsRecord({\r\n uuid,\r\n utilityId,\r\n partyId,\r\n fromDate,\r\n thruDate,\r\n emissionsAmount,\r\n renewableEnergyUseAmount,\r\n nonrenewableEnergyUseAmount,\r\n energyUseUom,\r\n factorSource,\r\n url,\r\n md5,\r\n tokenId,\r\n });\r\n }", "title": "" }, { "docid": "4e5d6302bccb608b09a2443bb9fe48ce", "score": "0.47463775", "text": "function Response(r) {\n this.status = r.status\n if (r.bodyEncoded) {\n this.body = Base64.decode(r.body)\n } else {\n this.body = r.body\n }\n this.headers = r.headers\n this.headers.get = function(name) {\n return r.headers[name.toLowerCase()]\n }\n this.ok = this.status >= 200 && this.status < 300;\n}", "title": "" }, { "docid": "b8134e9270c959005b84bdccd8e273af", "score": "0.47460553", "text": "async CreatePartner(ctx, partner) {\n partner = JSON.parse(partner);\n\n await ctx.stub.putState(partner.id, Buffer.from(JSON.stringify(partner)));\n\n let allPartners = await ctx.stub.getState(allPartnersKey);\n allPartners = JSON.parse(allPartners);\n allPartners.push(partner);\n await ctx.stub.putState(allPartnersKey, Buffer.from(JSON.stringify(allPartners)));\n \n return JSON.stringify(partner);\n }", "title": "" }, { "docid": "3e35a9d47adf3c8eb85c9b04b0ee7428", "score": "0.47317815", "text": "function checkParticipant(p) {\n const newParticipant = []\n\n return knex('events_users')\n .where({\n event_id: eventId,\n user_id: p.id\n })\n .first()\n .then((row) => {\n if (!row) {\n newParticipant.push(addParticipant(p))\n } else if (row && row.is_lead) {\n newParticipant.push(addLeadAsParticipant(p))\n } else {\n alreadyParticipant.push(p)\n };\n return Promise.resolve(newParticipant)\n })\n}", "title": "" }, { "docid": "2e6992e1849f14737ae1bf58ea307732", "score": "0.47317734", "text": "async create({ request, response, view }) {}", "title": "" }, { "docid": "d4eb49eef60d51aa6cdf3678c2a2071c", "score": "0.47210014", "text": "getResponse() {\n let args = Object.assign({}, this.matchArgs, this.returnArgs),\n json = Object.assign({}, args, { id: this.modelId() });\n this.responseJson = this.fixtureBuilder.convertForBuild(\n this.modelName,\n json\n );\n return super.getResponse();\n }", "title": "" }, { "docid": "02368faaaaa7e776793f59046d0a542f", "score": "0.47187662", "text": "createOffer() {\n\t\tlet that = this;\n\t\tthis.rtcPeerConnection.createOffer(function (offer) {\n\t\t\tthat.sendWS({\n\t\t\t\ttype: 'offer',\n\t\t\t\toffer: offer\n\t\t\t});\n\t\t\tthat.rtcPeerConnection.setLocalDescription(offer);\n\t\t}, function (error) {\n\t\t\tconsole.error('Cannot create WebRTC offer');\n\t\t});\n\t}", "title": "" }, { "docid": "61f02149c925482feb83f3f28d583b33", "score": "0.4707222", "text": "async function _deserializeResponse(serializedResponse) {\n return new Response(\n serializedResponse.body,\n {\n status: serializedResponse.status,\n statusText: serializedResponse.statusText,\n headers: new Headers(serializedResponse.headers)\n }\n );\n}", "title": "" }, { "docid": "61d6ee1be3645e0db49b7f2abb2aa626", "score": "0.4697627", "text": "function newRecorder(r: RecorderParts): Recorder {\n return {\n recorder_id: uuid(),\n registered: Date.now(),\n client_id: r.client_id || uuid(),\n recorder_key_hash: r.recorder_key_hash,\n api_key: r.api_key,\n description: r.description || null,\n gcm_registration_token: null,\n };\n}", "title": "" }, { "docid": "7686ceafb00b72025c2cac95445a0268", "score": "0.4697547", "text": "function generateResponse (user, person, token) {\n const response = {\n _id: user._id,\n email: user.email,\n username: user.username,\n person: {\n firstName: person.firstName,\n lastName: person.lastName\n },\n token\n }\n\n return response\n}", "title": "" }, { "docid": "f19b93312c0c15414bd3bec7577bd3ed", "score": "0.4691923", "text": "function buildResponse(message, shouldEndSession, sessionAttributes) {\n return {\n version: '1.0',\n sessionAttributes: sessionAttributes,\n response: {\n outputSpeech: {\n type: 'PlainText',\n text: message,\n },\n shouldEndSession: shouldEndSession,\n },\n };\n}", "title": "" }, { "docid": "d7d9ffdd3277fe4b40a4882632ef170a", "score": "0.4679757", "text": "constructor() { \n \n KMIPEnvironmentCreateResponse.initialize(this);\n }", "title": "" }, { "docid": "4012eea1d378158263beb5ab3bdefe5c", "score": "0.4664296", "text": "constructor() { \n BaseResponse.initialize(this);GetAllPersonsResponseAllOf.initialize(this);\n GetAllPersonsResponse.initialize(this);\n }", "title": "" }, { "docid": "c73c0eaea1a8c311e6ccd76181093657", "score": "0.46614078", "text": "function onNewParticipant(message) {\r\n \r\n receiveVideoFrom(message.new_user_id,message);\r\n}", "title": "" }, { "docid": "447cde83d235ebb992004a495ce24393", "score": "0.4650393", "text": "function createOffer(){\n\tconsole.log('Creating and Sending offer to peer');\n\tpc.createOffer(function(offerSdp){\t\t\n\t//create offer sdp obj with default params. to change defaults, change with offerSdp.sdp = setSdp(offerSdp)\n\tpc.setLocalDescription(offerSdp);\n\tconsole.log('offer sdp: ', JSON.stringify(offerSdp));\n\tIO.sendMessage(offerSdp);\n\t},\n\tfunction(error){\n\t\tconsole.log('Error occured while creating an offer');\n\t});\t\n}", "title": "" }, { "docid": "68f59b814a77fe9f1a7871089cc47ac4", "score": "0.46492344", "text": "function Part(name, deadline, startTime, location, status, assigned, description, partOf) {\n this.name = name;\n this.deadline = deadline;\n this.startTime = startTime;\n this.location = location;\n this.status = status;\n this.assigned = assigned;\n this.description = description;\n this.partOf = partOf;\n}", "title": "" }, { "docid": "0c90d1ccf6b3793ec9eb6efa81006a0f", "score": "0.464797", "text": "async create ({ request, response, view }) {\n }", "title": "" }, { "docid": "0c90d1ccf6b3793ec9eb6efa81006a0f", "score": "0.464797", "text": "async create ({ request, response, view }) {\n }", "title": "" }, { "docid": "0c90d1ccf6b3793ec9eb6efa81006a0f", "score": "0.464797", "text": "async create ({ request, response, view }) {\n }", "title": "" }, { "docid": "0c90d1ccf6b3793ec9eb6efa81006a0f", "score": "0.464797", "text": "async create ({ request, response, view }) {\n }", "title": "" }, { "docid": "0c90d1ccf6b3793ec9eb6efa81006a0f", "score": "0.464797", "text": "async create ({ request, response, view }) {\n }", "title": "" }, { "docid": "0c90d1ccf6b3793ec9eb6efa81006a0f", "score": "0.464797", "text": "async create ({ request, response, view }) {\n }", "title": "" }, { "docid": "bd698665e47fa2d2874b0fe54d14f2d3", "score": "0.4629046", "text": "function CreateNewPatient(username, password, email, phone, firstname, lastname) {\n\tvar patient = new Object();\n\tpatient.username = username;\n\tpatient.password = password;\n\tpatient.email = email;\n\tpatient.phone = phone;\n\treturn patient;\n}", "title": "" }, { "docid": "40ca067a575a1d33885672fd8cd0f7d2", "score": "0.4619047", "text": "function newAccount(a: AccountParts): Account {\n let account: Account = Object.create(accountProto)\n\n account.account_id = uuid()\n account.email = a.email.toLowerCase()\n account.full_name = a.full_name\n account.pass_hash = a.pass_hash || null\n account.registered = Date.now()\n account.verification_source = a.verification_source\n account.verified = a.verification_source ? Date.now() : null\n account.highwater = Date.now()\n\n return account\n}", "title": "" }, { "docid": "3839eee8b0f96dadb933db8142309443", "score": "0.46186844", "text": "function create_party() {\n // you add a string of the character name you want to invite\n send_party_invite(farmer_names[0]);\n send_party_invite(farmer_names[1]);\n send_party_invite(farmer_names[2]);\n}", "title": "" }, { "docid": "2eb6ea45a1412c80c736e1ba9b25a82f", "score": "0.4615151", "text": "receiveNewPeer({ workerId }) {\n this.logger.log('WebRTC: Adding new peer');\n\n // Create a new peer in the list with a blank candidate cache (to be populated by ICE candidates we receive)\n this.peers[workerId] = {\n candidateCache: []\n };\n\n // Create and initialize the new connection, then add that connection to the peers list\n const pc = new RTCPeerConnection(this.peerConfig, this.peerOptions);\n this.initConnection(pc, workerId, 'offer');\n this.peers[workerId].connection = pc;\n\n // Create a data channel through which messaging will take place, we'll call it \"dataChannel\"\n // Designate who owns that channel and push it onto the peers list\n const channel = pc.createDataChannel('dataChannel');\n channel.owner = workerId;\n channel.binaryType = 'arraybuffer';\n channel.connection = pc;\n this.peers[workerId].channel = channel;\n\n // Set up all our event listeners for this channel so we can hook into them\n this.addDataChannelListeners(channel);\n\n // Create an SDP offer for the peer connection\n pc.createOffer()\n .then(offer => {\n this.logger.log('WebRTC: Offer created');\n\n // Set the offer as the local description\n pc.setLocalDescription(offer)\n .then(this.logger.log('WebRTC: Set offer as local description'))\n .catch(\n this._handleError(\n 'WebRTC: Error setting offer as local description'\n )\n );\n })\n .catch(this._handleError('WebRTC: Error creating offer'));\n }", "title": "" }, { "docid": "011e2ff3da771953d2a98f87390279b5", "score": "0.45963892", "text": "addOrUpdateParticipant(value) {\n if (value === undefined) {\n return;\n }\n const exists = this.getParticipantIndex(value.id);\n if (exists > -1) {\n this.participants.splice(exists, 1, value);\n }\n else {\n this.participants.push(value);\n }\n // ensure it was added ok\n return this.getParticipant(value.id);\n }", "title": "" }, { "docid": "2277dc6dbeac4c91ff2efbd65f74a151", "score": "0.45885426", "text": "async create(data, params) {}", "title": "" }, { "docid": "9d1a28e71c4e2cf4b91f7d15609c725c", "score": "0.45746705", "text": "crearRespuesta(texto, cantidad) {\n return {'textoRespuesta':texto, 'cantidad': cantidad};\n }", "title": "" }, { "docid": "da9d67215c77dad84114a1e8fbbecbee", "score": "0.45715925", "text": "onProgress(inviteResponse) {\n var _a;\n this.logger.log(\"Inviter.onProgress\");\n // validate state\n if (this.state !== _session_state__WEBPACK_IMPORTED_MODULE_3__[\"SessionState\"].Establishing) {\n this.logger.error(`Progress received while in state ${this.state}, dropping response`);\n return Promise.reject(new Error(`Invalid session state ${this.state}`));\n }\n if (!this.outgoingInviteRequest) {\n throw new Error(\"Outgoing INVITE request undefined.\");\n }\n const response = inviteResponse.message;\n const session = inviteResponse.session;\n // Ported - Set assertedIdentity.\n if (response.hasHeader(\"P-Asserted-Identity\")) {\n this._assertedIdentity = _core__WEBPACK_IMPORTED_MODULE_0__[\"Grammar\"].nameAddrHeaderParse(response.getHeader(\"P-Asserted-Identity\"));\n }\n // If a provisional response is received for an initial request, and\n // that response contains a Require header field containing the option\n // tag 100rel, the response is to be sent reliably. If the response is\n // a 100 (Trying) (as opposed to 101 to 199), this option tag MUST be\n // ignored, and the procedures below MUST NOT be used.\n // https://tools.ietf.org/html/rfc3262#section-4\n const requireHeader = response.getHeader(\"require\");\n const rseqHeader = response.getHeader(\"rseq\");\n const rseq = requireHeader && requireHeader.includes(\"100rel\") && rseqHeader ? Number(rseqHeader) : undefined;\n const responseReliable = !!rseq;\n const extraHeaders = [];\n if (responseReliable) {\n extraHeaders.push(\"RAck: \" + response.getHeader(\"rseq\") + \" \" + response.getHeader(\"cseq\"));\n }\n switch (session.signalingState) {\n case _core__WEBPACK_IMPORTED_MODULE_0__[\"SignalingState\"].Initial:\n // INVITE without offer and session still has no offer (and no answer).\n if (responseReliable) {\n // Similarly, if a reliable provisional\n // response is the first reliable message sent back to the UAC, and the\n // INVITE did not contain an offer, one MUST appear in that reliable\n // provisional response.\n // https://tools.ietf.org/html/rfc3262#section-5\n this.logger.warn(\"First reliable provisional response received MUST contain an offer when INVITE does not contain an offer.\");\n // FIXME: Known popular UA's currently end up here...\n inviteResponse.prack({ extraHeaders });\n }\n return Promise.resolve();\n case _core__WEBPACK_IMPORTED_MODULE_0__[\"SignalingState\"].HaveLocalOffer:\n // INVITE with offer and session only has that initial local offer.\n if (responseReliable) {\n inviteResponse.prack({ extraHeaders });\n }\n return Promise.resolve();\n case _core__WEBPACK_IMPORTED_MODULE_0__[\"SignalingState\"].HaveRemoteOffer:\n if (!responseReliable) {\n // The initial offer MUST be in either an INVITE or, if not there,\n // in the first reliable non-failure message from the UAS back to\n // the UAC.\n // https://tools.ietf.org/html/rfc3261#section-13.2.1\n // According to Section 13.2.1 of [RFC3261], 'The first reliable\n // non-failure message' must have an offer if there is no offer in the\n // INVITE request. This means that the User Agent (UA) that receives\n // the INVITE request without an offer must include an offer in the\n // first reliable response with 100rel extension. If no reliable\n // provisional response has been sent, the User Agent Server (UAS) must\n // include an offer when sending 2xx response.\n // https://tools.ietf.org/html/rfc6337#section-2.2\n this.logger.warn(\"Non-reliable provisional response MUST NOT contain an initial offer, discarding response.\");\n return Promise.resolve();\n }\n {\n // If the initial offer is in the first reliable non-failure\n // message from the UAS back to UAC, the answer MUST be in the\n // acknowledgement for that message\n const sdh = this.sessionDescriptionHandlerFactory(this, this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions || {});\n if ((_a = this.delegate) === null || _a === void 0 ? void 0 : _a.onSessionDescriptionHandler) {\n this.delegate.onSessionDescriptionHandler(sdh, true);\n }\n this.earlyMediaSessionDescriptionHandlers.set(session.id, sdh);\n return sdh\n .setDescription(response.body, this.sessionDescriptionHandlerOptions, this.sessionDescriptionHandlerModifiers)\n .then(() => sdh.getDescription(this.sessionDescriptionHandlerOptions, this.sessionDescriptionHandlerModifiers))\n .then((description) => {\n const body = {\n contentDisposition: \"session\",\n contentType: description.contentType,\n content: description.body\n };\n inviteResponse.prack({ extraHeaders, body });\n })\n .catch((error) => {\n this.stateTransition(_session_state__WEBPACK_IMPORTED_MODULE_3__[\"SessionState\"].Terminated);\n throw error;\n });\n }\n case _core__WEBPACK_IMPORTED_MODULE_0__[\"SignalingState\"].Stable:\n // This session has completed an initial offer/answer exchange, so...\n // - INVITE with SDP and this provisional response MAY be reliable\n // - INVITE without SDP and this provisional response MAY be reliable\n if (responseReliable) {\n inviteResponse.prack({ extraHeaders });\n }\n if (this.earlyMedia && !this.earlyMediaDialog) {\n this.earlyMediaDialog = session;\n const answer = session.answer;\n if (!answer) {\n throw new Error(\"Answer is undefined.\");\n }\n const options = {\n sessionDescriptionHandlerModifiers: this.sessionDescriptionHandlerModifiers,\n sessionDescriptionHandlerOptions: this.sessionDescriptionHandlerOptions\n };\n return this.setAnswer(answer, options).catch((error) => {\n this.stateTransition(_session_state__WEBPACK_IMPORTED_MODULE_3__[\"SessionState\"].Terminated);\n throw error;\n });\n }\n return Promise.resolve();\n case _core__WEBPACK_IMPORTED_MODULE_0__[\"SignalingState\"].Closed:\n // Dialog has terminated.\n return Promise.reject(new Error(\"Terminated.\"));\n default:\n throw new Error(\"Unknown session signaling state.\");\n }\n }", "title": "" }, { "docid": "3254c2288ec98135427864fbf2cd3f9d", "score": "0.45578238", "text": "function createAnswer(){\n\tconsole.log('Creating and Sending answer to peer')\n\tpc.createAnswer(function(answerSdp){\t\t\n\t//sending default params. to change defaults, call answerSdp.sdp = setSdp(offerSdp)\n\tpc.setLocalDescription(answerSdp);\n console.log('answer sdp: ', JSON.stringify(answerSdp));\n\tIO.sendMessage(answerSdp);\n\t},\n\tfunction(error){\n\t\tconsole.log('Error occured while creating an answer');\n\t});\t\n}", "title": "" }, { "docid": "da2a4da1d700f727e0a62b201fdc9e73", "score": "0.4553338", "text": "static get __resourceType() {\n\t\treturn 'EncounterParticipant';\n\t}", "title": "" }, { "docid": "12af3c957789dbf81557a2d27e0b5645", "score": "0.4552318", "text": "function deserializeResponse(data) {\r\n\treturn Promise.resolve(new Response(data.body, data));\r\n}", "title": "" }, { "docid": "7a6cf576eeca8811c0c5c4ff53454a9d", "score": "0.45483485", "text": "create(question) {\n return this.contract.new(question)\n .then(_instance => {\n this.instance = _instance\n // console.log(\"contract address\", this.instance.address);\n })\n }", "title": "" }, { "docid": "24fd0462d37b6cff3689a388d7f89146", "score": "0.4541442", "text": "constructor() { \n \n GetSyncResponse.initialize(this);\n }", "title": "" }, { "docid": "ccf577dda8b8ff376997be80cbadd350", "score": "0.45412457", "text": "getParticipantDuration(participant) {\n return this.duration;\n }", "title": "" }, { "docid": "0d49d2ef75f78bc3c9e1b1637f7ab575", "score": "0.4535339", "text": "function createPeer() {\n\t\t\tclient.getAnswer = false //setting initial ans to false\n\t\t\tlet peer = newPeer('init') //getting our peer from the NewPeer() created \n\t\t\t\t//Fired when the peer wants to send signaling data to the remote peer.\n\t\t\tpeer.on('signal', data => {\n\t\t\t\tif(!client.getAnswer) //if ans is true\n\t\t\t\t\tsocket.emit('offer', data) //event is offer here and offer will be made by send data to signaling fn\n\t\t\t})\n\t\t\tclient.peer = peer //setting property of client as peer type\n\t\t}", "title": "" }, { "docid": "fb0babace898129607a16f944347827b", "score": "0.4534959", "text": "async create({ request, response, view }) {\n }", "title": "" }, { "docid": "666052f6001fb8fbe5bedf3d39571a09", "score": "0.45330366", "text": "function buildResponse(choice) {\n\treturn {\n\toutcome: getOutcome( choice, randomGameResponse() ),\n\twins: wins,\n\tlosses: losses,\n\tties: ties,\n\t};\n}", "title": "" }, { "docid": "e28ac542cd440b83e376ecfdce615e00", "score": "0.45313498", "text": "function _createBidResponse(response) {\n const isADomainPresent =\n response.seatbid[0].bid[0].adomain && response.seatbid[0].bid[0].adomain.length;\n const bid = {\n requestId: response.id,\n bidderCode: BIDDER_CODE,\n cpm: response.seatbid[0].bid[0].price,\n width: response.seatbid[0].bid[0].w,\n height: response.seatbid[0].bid[0].h,\n ad: response.seatbid[0].bid[0].adm,\n ttl: response.seatbid[0].bid[0].ttl || 60,\n creativeId: response.seatbid[0].bid[0].crid,\n mediaType: deepAccess(response.seatbid[0].bid[0], 'ext.ttx.mediaType', BANNER),\n currency: response.cur,\n netRevenue: true\n }\n\n if (isADomainPresent) {\n bid.meta = {\n advertiserDomains: response.seatbid[0].bid[0].adomain\n };\n }\n\n if (bid.mediaType === VIDEO) {\n const vastType = deepAccess(response.seatbid[0].bid[0], 'ext.ttx.vastType', 'xml');\n\n if (vastType === 'xml') {\n bid.vastXml = bid.ad;\n } else {\n bid.vastUrl = bid.ad;\n }\n }\n\n return bid;\n}", "title": "" }, { "docid": "84da239b4b7b746a966ed7e2fa867e6e", "score": "0.45284057", "text": "getParticipant(id) {\n return this.participants.find((p) => p.id === id);\n }", "title": "" }, { "docid": "ef297c1e45e7c8fbe11ae8af4aa7d0b0", "score": "0.45279303", "text": "function PartialResponse(){}", "title": "" }, { "docid": "c333a61ed5523a0db9c5dc95bbbbff08", "score": "0.45207372", "text": "function createRemainderPayment(remainderData) {\n let user = JSON.parse(localStorage.getItem(\"userData\"));\n remainderData.createdBy = { id: user.user_id, name: user.user_label };\n return $http.post(baseUrl + \"remainderpayment\", remainderData, { headers: setHeaders() })\n }", "title": "" }, { "docid": "7879f088cd8a5ba685a44a5315803013", "score": "0.45175177", "text": "async function saveParticipantType(req, res) {\n let body = req.body;\n\n let type = {\n name: body.name,\n description: body.description,\n status: body.status || true\n }\n\n await ParticipantType.create(type)\n .then(async type => {\n saveBitacora('ParticipantType', type.id, type.name, 'create', req.user.id);\n res.status(200).json({\n ok: true,\n message: 'Tipo de participante creado con éxito',\n type\n });\n })\n .catch(err => {\n res.status(500).send({\n ok: false,\n message: 'Tipo de participante no creado, ha ocurrido un error',\n error: err.parent.detail\n });\n });;\n}", "title": "" }, { "docid": "f7024062556774b92090b083cf2c06ec", "score": "0.4515632", "text": "function Response(message) {\n\t\tthis.status = message.status;\n\t\tthis.response = message.response;\n\t\tthis.headers = message.headers;\n\t\t//this.responseText = message.responseText;\n\t}", "title": "" }, { "docid": "d657825b00017cce5ecc68cba7bb101a", "score": "0.4510935", "text": "async function createPeering() {\n const subscriptionId = process.env[\"NETWORK_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"NETWORK_RESOURCE_GROUP\"] || \"peerTest\";\n const virtualNetworkName = \"vnet1\";\n const virtualNetworkPeeringName = \"peer\";\n const virtualNetworkPeeringParameters = {\n allowForwardedTraffic: true,\n allowGatewayTransit: false,\n allowVirtualNetworkAccess: true,\n remoteVirtualNetwork: {\n id: \"/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2\",\n },\n useRemoteGateways: false,\n };\n const credential = new DefaultAzureCredential();\n const client = new NetworkManagementClient(credential, subscriptionId);\n const result = await client.virtualNetworkPeerings.beginCreateOrUpdateAndWait(\n resourceGroupName,\n virtualNetworkName,\n virtualNetworkPeeringName,\n virtualNetworkPeeringParameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "1a6245a0de5678b7cd642b1fc8f9f88e", "score": "0.45090866", "text": "static createResult () {\n return new Result()\n }", "title": "" }, { "docid": "ec283bf461af65e70333508d514322b2", "score": "0.44934642", "text": "function createPeer(userID) {\n const peer = new RTCPeerConnection({\n // connecting the two servers\n iceServers: [\n { urls: 'stun:stun.l.google.com:19302' },\n { urls: 'stun:stun1.l.google.com:19302' },\n { urls: 'stun:stun2.l.google.com:19302' },\n { urls: 'stun:stun3.l.google.com:19302' },\n { urls: 'stun:stun4.l.google.com:19302' },\n {\n urls: 'turn:numb.viagenie.ca',\n credential: '',\n username: ''\n },\n ]\n });\n\n peer.onicecandidate = handleICECandidateEvent;\n peer.ontrack = handleTrackEvent;\n peer.onnegotiationneeded = () => handleNegotiationNeededEvent(userID);\n\n return peer;\n }", "title": "" }, { "docid": "9d7a8813df2d04fd2528ed9175df54fe", "score": "0.44931316", "text": "async function createInviteObject(fromAccount, toAddress, efd) {\n const fromSignature = await createRequest(fromAccount, toAddress, efd)\n const fromAddress = await fromAccount.getAddress()\n return {\n fromAddress,\n toAddress,\n fromSignature\n }\n}", "title": "" }, { "docid": "ff96eff1710771f9dc22c0c6b13e5b15", "score": "0.44930658", "text": "create() {\r\n // Validate the provider(local, google, facebook ...) and return the JSON object\r\n return {\r\n local: {\r\n email: this.email,\r\n password: this.password,\r\n subscribed: this.subscribed\r\n }\r\n };\r\n }", "title": "" }, { "docid": "56fd42a5ae0c0b14d86fd42cfe57f032", "score": "0.44872817", "text": "newNote(request,response){\n\t\tconst {email,title,message} = request.query;\t//unpack all values saved in query object\n\t\tconst noteInstance = note.create(email,title,message);\t//invoke note's create method\n\t\tresponse.json({'success': true, 'note': noteInstance});\t\t\t//save the note object an a success message in the response object\n\t}", "title": "" }, { "docid": "ec981458bd97715247ebdfa0c463e51b", "score": "0.44811916", "text": "async function createCredentialModel(newCredential) {\n let attestationObject = new Uint8Array(newCredential.response.attestationObject);\n let clientDataJSON = new Uint8Array(newCredential.response.clientDataJSON);\n let rawId = new Uint8Array(newCredential.rawId);\n\n const data = {\n id: newCredential.id,\n rawId: btoa(String.fromCharCode.apply(null, rawId)),\n type: newCredential.type,\n extensions: newCredential.getClientExtensionResults(),\n response: {\n AttestationObject: btoa(String.fromCharCode.apply(null, attestationObject)),\n clientDataJson: btoa(String.fromCharCode.apply(null, clientDataJSON))\n }\n };\n\n return JSON.stringify(data);\n}", "title": "" }, { "docid": "fc8d7f6f8846d8249784d09e7d2cef92", "score": "0.4480534", "text": "function createMessage(params) {\n var newMessage = new Message();\n newMessage.fullname = params.fullname;\n newMessage.email = params.email;\n newMessage.phoneNumber = params.phoneNumber;\n newMessage.text = params.text;\n newMessage.viewed = false;\n return newMessage;\n}", "title": "" }, { "docid": "ae6a36d5c80bbf938fb2f3a12e1b7ee9", "score": "0.44728068", "text": "function create_party(){\n \n if(parent.party != {} &&\n parent.party[party_list[0]] != undefined &&\n parent.party[party_list[1]] != undefined &&\n parent.party[party_list[2]] != undefined &&\n parent.party[party_list[3]] != undefined){\n\n party_created = true;\n return;\n }\n\n\t//for the party leader\n\tif(character.name == party_list[0]){\n\t\t//send invites\n\t\tif(Object.keys(parent.party).length < party_list.length){\n\t\t\tfor(let i in party_list){\n\t\t\t\tlet player = party_list[i];\n\t\t\t\tif(player != party_list[0]){\n\t\t\t\t\tsend_party_invite(player);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//for party members\n\tif(!character.party){\n\t\tif(character.name != party_list[0]){\n\t\t\t//accept invite\n\t\t\taccept_party_invite(party_list[0])\n\t\t}\n\t\n\t\t\n\t}else{\n\t\tif(character.party != party_list[0]){\n\t\t\t//wrong party, better leave\n\t\t\tleave_party();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "795c6eef47f4f94a8edfb0bdeb2c0c9b", "score": "0.44578788", "text": "constructor (interviewerEmail, intervieweeEmail, date, interviewslot, freeSlot, startTime, \n endTime, interview )\n {\n this.interviewerEmail = interviewerEmail;\n this.intervieweeEmail = intervieweeEmail;\n this.date = date;\n this.interviewslot = interviewslot;\n this.freeSlot = freeSlot;\n this.startTime = startTime;\n this.endTime = endTime;\n this.interview = interview;\n \n this.id= uuid.v4;\n }", "title": "" }, { "docid": "f2c619e74e6a3827738071f056c4b2da", "score": "0.44471428", "text": "createThought({ body }, res) {\n Thought.create(body)\n .then((thoughtData) => res.json(thoughtData))\n .catch((err) => res.json(err));\n }", "title": "" } ]
6bdfd0195602d5fef4551f53023c37c6
this function starts our server and returns a Promise
[ { "docid": "464d800757292d3478a2ebcda0c41041", "score": "0.7044023", "text": "function runServer() {\n const port = process.env.PORT || 8080;\n return new Promise((resolve, reject) => {\n server = app.listen(port, () => {\n console.log(`Your app is listening on port ${port}`);\n resolve(server);\n }).on('error', err => {\n reject(err)\n });\n });\n}", "title": "" } ]
[ { "docid": "a9ed5a39639fa90f2e9b1afb4feae496", "score": "0.8446866", "text": "start() {\n return new Promise((resolve) => {\n let serverOpts = {express: this.express, config: config};\n this.server = new Server(serverOpts);\n resolve(this.server.start());\n })\n }", "title": "" }, { "docid": "a3f7dca8008d1e205e6d24e4f130dc33", "score": "0.8171278", "text": "function startServer() {\n return new Promise((resolve, reject) => {\n server.listen(config.port);\n server.on('error', reject);\n server.on('listening', resolve);\n });\n}", "title": "" }, { "docid": "6362c4515d57b88030871de5687bad57", "score": "0.77220494", "text": "start() {\n return new Promise((resolve, reject) => {\n compose((composeErr, server) => {\n if (composeErr) {\n return reject(composeErr);\n }\n\n return hooks.beforeStart(server, (beforeStartErr) => {\n if (beforeStartErr) {\n return reject(beforeStartErr);\n }\n\n return server.start(() => {\n hooks.afterStart(server, (afterStartErr) => {\n if (afterStartErr) {\n return reject(afterStartErr);\n }\n return resolve(server);\n });\n });\n });\n });\n });\n }", "title": "" }, { "docid": "9722276cb0a69b185514fa0562a5647c", "score": "0.77008694", "text": "async start () {\n return this.serverManager.start()\n }", "title": "" }, { "docid": "a338e9a761a82f102160359057f4762e", "score": "0.7629758", "text": "Start() {\n return new Promise(resolve => {\n _express.listen(_config.PORT, () => {\n console.log(_config.APPLICATION_NAME + \"API running on port: \" + _config.PORT);\n resolve(); //para q termine la promesa\n });\n });\n }", "title": "" }, { "docid": "c42c97348862b98538f0c75e6c27304b", "score": "0.76189786", "text": "function startHttpServer() {\n return new Promise(resolve => { // Wrap in a promise so we can be notified when the server has started.\n const app = express();\n setupHandlers(app);\n\n const port = process.env.PORT && parseInt(process.env.PORT) || 3000;\n app.listen(port, () => {\n resolve(); // HTTP server is listening, resolve the promise.\n });\n });\n}", "title": "" }, { "docid": "98d95dc61ebf405518664d46d9e77068", "score": "0.75641984", "text": "function startServer() {\n return new Promise((resolve, reject) => {\n const server = net.createServer(socket => {\n resolve(socket);\n });\n server.on('error', err => {\n console.error('listener failed', err);\n process.exit(1);\n });\n server.listen('/tmp/swift.sock');\n });\n}", "title": "" }, { "docid": "874633fe6dc7626698accd7021e3e5c1", "score": "0.7495404", "text": "async start() {\n // check if update is available\n updateNotifier({ pkg }).notify();\n\n this._verifyServerlessVersionCompatibility();\n\n // Some users would like to know their environment outside of the handler\n process.env.IS_OFFLINE = true;\n\n return Promise.resolve(this._buildServer())\n .then(() => this.apiGateway._listen())\n .then(() => this.hasWebsocketRoutes && this.apiGatewayWebSocket._listen())\n .then(() =>\n this.options.exec\n ? this._executeShellScript()\n : this._listenForTermination(),\n );\n }", "title": "" }, { "docid": "292e90ec6f6c2db985b105d587768812", "score": "0.74692816", "text": "async function startServer () {\n try {\n // Create a server with a host and port\n const server = new Hapi.server({port: config.server.port, address: config.server.address});\n await validateConfig(config);\n await registerPlugins(server);\n logger.log(`starting service with configuration: ${JSON.stringify(config, null, 2)}`);\n await server.start();\n logger.log('Server running at:', server.info.address);\n } catch (err) {\n logger.error(`error: ${err.stack}`);\n }\n}", "title": "" }, { "docid": "a783f482ebfbaa9d3baf5db940169651", "score": "0.7450412", "text": "start () {\n return new Promise((resolve, reject) => {\n this._server = this._app.listen(this._port, () => {\n this._logger.info(`MetricsServer listening on port ${this._port}`)\n resolve()\n })\n this._app.on('error', err => reject(err))\n })\n }", "title": "" }, { "docid": "43d800d356def8e1ae9759698de807fa", "score": "0.7202341", "text": "async function start () {\n try {\n await server.register(require('hapi-auth-cookie'))\n server.auth.strategy('standard', 'cookie', {\n ...config.hapiAuthCookie,\n validateFunc: (request, data) => authConfig.validateFunc(request, data)\n })\n\n server.auth.default('standard')\n await server.register(pluginsArray)\n // Set up Nunjucks view engine\n server.views(viewEngine)\n\n // Auth plugin\n await server.register(authPlugin)\n\n // Proxy plugin\n await server.register(H2o2)\n\n server.route(routes)\n\n await server.start()\n\n server.log(['info'], `Server started on ${server.info.uri} port ${server.info.port}`)\n } catch (err) {\n logger.error('Failed to start server', err.stack)\n }\n\n return server\n}", "title": "" }, { "docid": "39213ecf18800b0fe7eddc79bcb481a4", "score": "0.7131367", "text": "async start () {\n const port = await tryPort(this.httpServer, this.maxPort, this.basePort)\n this.endpoint = `http://localhost:${port}`\n debug(`server is listening on port ${port}`)\n }", "title": "" }, { "docid": "45c92528471f28a11abf8fa04971c3fd", "score": "0.71126467", "text": "startMainHttpServer () {\n\t\treturn (new Promise ((resolve, reject) => {\n\t\t\tlet http, options;\n\n\t\t\tif (this.httpServer1 != null) {\n\t\t\t\tresolve ();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\toptions = { };\n\t\t\tif (App.EnableHttps) {\n\t\t\t\ttry {\n\t\t\t\t\toptions = {\n\t\t\t\t\t\tkey: Fs.readFileSync (Path.join (App.DATA_DIRECTORY, App.TlsKeyFilename)),\n\t\t\t\t\t\tcert: Fs.readFileSync (Path.join (App.DATA_DIRECTORY, App.TlsCertFilename))\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\treject (e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (App.EnableHttps) {\n\t\t\t\thttp = Https.createServer (options, (request, response) => {\n\t\t\t\t\tthis.handleMainServerRequest (request, response);\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\thttp = Http.createServer ((request, response) => {\n\t\t\t\t\tthis.handleMainServerRequest (request, response);\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.httpServer1 = http;\n\n\t\t\tsetTimeout (() => {\n\t\t\t\thttp.on (\"error\", listenError);\n\t\t\t\thttp.listen (App.TcpPort1, null, 1024, listenComplete);\n\t\t\t}, 0);\n\t\t\tconst listenError = (err) => {\n\t\t\t\thttp.removeListener (\"error\", listenError);\n\t\t\t\treject (err);\n\t\t\t};\n\t\t\tconst runError = (err) => {\n\t\t\t\tLog.err (`HTTP-1 error; err=${err}`);\n\t\t\t};\n\t\t\tconst listenComplete = () => {\n\t\t\t\thttp.removeListener (\"error\", listenError);\n\t\t\t\tconst address = http.address ();\n\t\t\t\tif (typeof address.port != \"number\") {\n\t\t\t\t\treject (Error (\"Internal error: failed to read listen port from HTTP server\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.tcpPort1 = address.port;\n\t\t\t\tif (App.ExtTcpPort1 > 0) {\n\t\t\t\t\tthis.tcpPort1 = App.ExtTcpPort1;\n\t\t\t\t}\n\t\t\t\tthis.resetUrlHostname ();\n\t\t\t\tLog.debug (`HTTP-1 listening; address=${this.urlHostname}:${this.tcpPort1}`);\n\t\t\t\tif (this.tcpPort1 == SystemInterface.Constant.DefaultTcpPort1) {\n\t\t\t\t\tLog.info (`Server address: ${this.urlHostname}`);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tLog.info (`Server address: ${this.urlHostname}:${this.tcpPort1}`);\n\t\t\t\t}\n\n\t\t\t\tconst io = require (\"socket.io\") (http, {\n\t\t\t\t\tpath: this.linkPath,\n\t\t\t\t\tallowEIO3: true\n\t\t\t\t});\n\t\t\t\tio.on (\"connection\", ioConnection);\n\t\t\t\tthis.io = io;\n\n\t\t\t\thttp.on (\"error\", runError);\n\t\t\t\thttp.once (\"close\", () => {\n\t\t\t\t\thttp.removeListener (\"error\", runError);\n\t\t\t\t\tif (this.httpServer1 == http) {\n\t\t\t\t\t\tthis.httpServer1 = null;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tresolve ();\n\t\t\t};\n\t\t\tconst ioConnection = (client) => {\n\t\t\t\tlet token;\n\n\t\t\t\tconst clientaddress = client.request.connection.remoteAddress;\n\t\t\t\ttoken = \"\";\n\t\t\t\tLog.debug (`WebSocket client connected; address=\"${clientaddress}\"`);\n\n\t\t\t\tclient.setMaxListeners (0);\n\t\t\t\tclient.once (\"disconnect\", () => {\n\t\t\t\t\tLog.debug (`WebSocket client disconnected; address=\"${clientaddress}\"`);\n\t\t\t\t\tif (token != \"\") {\n\t\t\t\t\t\tthis.accessControl.setSessionSustained (token, false);\n\t\t\t\t\t\ttoken = \"\";\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tclient.on (SystemInterface.Constant.WebSocketEvent, (cmdInv) => {\n\t\t\t\t\tconst err = SystemInterface.parseCommand (cmdInv);\n\t\t\t\t\tif (SystemInterface.isError (err)) {\n\t\t\t\t\t\tLog.debug (`Discard WebSocket command; address=${clientaddress} cmdInv=${JSON.stringify (cmdInv)} err=${err}`);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((App.AuthorizeSecret != \"\") && (cmdInv.command == SystemInterface.CommandId.Authorize)) {\n\t\t\t\t\t\tconst respcmd = this.accessControl.authorize (cmdInv);\n\t\t\t\t\t\tif (respcmd.command == SystemInterface.CommandId.AuthorizeResult) {\n\t\t\t\t\t\t\tif (token != \"\") {\n\t\t\t\t\t\t\t\tthis.accessControl.setSessionSustained (token, false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttoken = respcmd.params.token;\n\t\t\t\t\t\t\tthis.accessControl.setSessionSustained (token, true);\n\t\t\t\t\t\t\tclient.emit (SystemInterface.Constant.WebSocketEvent, respcmd);\n\t\t\t\t\t\t\tclient.emit (SystemInterface.Constant.WebSocketEvent, this.createCommand (SystemInterface.CommandId.LinkSuccess));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tclient.emit (SystemInterface.Constant.WebSocketEvent, this.createCommand (SystemInterface.CommandId.AuthorizationRequired));\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst fn = this.linkCommandHandlerMap[cmdInv.command];\n\t\t\t\t\tif (typeof fn == \"function\") {\n\t\t\t\t\t\tif (App.AuthorizeSecret != \"\") {\n\t\t\t\t\t\t\tif (! this.accessControl.isCommandAuthorized (cmdInv)) {\n\t\t\t\t\t\t\t\tLog.debug (`Discard WebSocket command (unauthorized); address=${clientaddress}`);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfn (cmdInv, client);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (App.AuthorizeSecret != \"\") {\n\t\t\t\t\tclient.emit (SystemInterface.Constant.WebSocketEvent, this.createCommand (SystemInterface.CommandId.AuthorizationRequired));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tclient.emit (SystemInterface.Constant.WebSocketEvent, this.createCommand (SystemInterface.CommandId.LinkSuccess));\n\t\t\t\t}\n\t\t\t};\n\t\t}));\n\t}", "title": "" }, { "docid": "88650ae5ffb23e75e04ce935b568987a", "score": "0.70996976", "text": "function startServer(){\n var docroot = computeDocroot(),\n deferred = Q.defer();\n\n // create middleware\n var middleware = gateway(docroot, {\n '.php': 'php-cgi'\n });\n\n server = http.createServer(function(req, res){\n // Pass the request to gateway middleware\n middleware(req, res, function(err){\n res.writeHead(204, err);\n res.end();\n });\n }).listen(port, function(){\n deferred.resolve(docroot);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "7de0ee0da45e6713a4cc368942361545", "score": "0.7081154", "text": "start() {\n this.server.bind(this.serverAddress, grpc.ServerCredentials.createInsecure());\n this.server.start();\n this.started = true;\n }", "title": "" }, { "docid": "c3be3fb5a512daa4fa233b2e1d513716", "score": "0.7058844", "text": "function startLiveServer () {\n return new Promise((resolve, reject) => {\n\n // Configure live-server\n const params = Object.assign({\n port: 8080,\n host: \"0.0.0.0\",\n root: \"./dist\",\n file: \"index.html\",\n open: true,\n wait: 50,\n logLevel: 2\n }, serverOptions);\n\n // Start monkey-patched live-server.\n // We remove the listeners so it doesn't watch any files.\n // And add a \"change\" helper so we can manually run the change listener. \n liveServer.start(params);\n liveServer.change = liveServer.watcher.listeners('change')[0];\n liveServer.watcher.removeAllListeners();\n resolve();\n });\n }", "title": "" }, { "docid": "4b5b0330a2943d307a5b6bd0082af2ee", "score": "0.7054081", "text": "async startService() {\n\t\tconst { router, httpServer } = this.assembly;\n\t\tassert(router, 'expected router');\n\t\t// assert(logger, 'expected logger');\n\t\tassert(httpServer, 'expected httpServer');\n\t\tawait router.registerRoutes();\n\t\tawait new Promise(resolve => httpServer.listen(port, () => resolve()));\n\t\tconsole.log('We are live on ' + port);\n\t}", "title": "" }, { "docid": "80b033f038735b411f30c9d2e655e72a", "score": "0.69721776", "text": "async function startExpress() {\n return new Promise((resolve, reject) => {\n const p = spawn('node', ['express']);\n p.on('error', reject);\n p.stdout.on('data', data => {\n if (data.includes('Press Ctrl+C to quit.')) {\n resolve(p);\n }\n });\n });\n}", "title": "" }, { "docid": "ce4d13942453527aa88712f8f4d9dfe1", "score": "0.69608796", "text": "function appStart(opts) {\n return new Promise((resolve, reject) => {\n let server = new Hapi.Server();\n server.connection({\n port: opts.port,\n host: opts.host,\n routes: {\n files: {\n relativeTo: config.path.dist\n }\n }\n });\n\n // register all plugins\n server.register(plugins, err => {\n if (err) return reject(err);\n\n // configure view compilation\n server.views({\n engines: { pug: require('pug') },\n path: config.path.template,\n compileOptions: {\n pretty: true\n }\n });\n\n // apply all routes\n server.route(routes);\n\n resolve(server);\n });\n });\n}", "title": "" }, { "docid": "39caeb27c78623ce6517d0a9395b9209", "score": "0.6954836", "text": "function startHttpServer(messageChannel) {\n return new Promise(resolve => { // Wrap in a promise so we can be notified when the server has started.\n const app = express();\n setupHandlers(app, messageChannel);\n\n const port = process.env.PORT && parseInt(process.env.PORT) || 3000;\n app.listen(port, () => {\n resolve(); // HTTP server is listening, resolve the promise.\n });\n });\n}", "title": "" }, { "docid": "24135b7ae01ad8b5a3dcf737d3469812", "score": "0.69495636", "text": "async function start () {\n try {\n console.log('API server running on http://localhost:3000')\n await fastify.listen(3000)\n } catch (err) {\n fastify.log.error(err)\n process.exit(1)\n }\n}", "title": "" }, { "docid": "f06dd367bb06250a283795a8b20c18bc", "score": "0.69303757", "text": "function startServer(){\n var ps = spawn('forever', [ 'start', base + 'lib/www.js' ]);\n var err = '';\n ps.stderr.on('data', function (data) { \n err += data;\n });\n ps.on('exit', function (code) {\n if(code !== null){\n success('Nserv started on port 8080.');\n }\n else {\n error(err, \"Could not start main nserv server.\");\n }\n });\n}", "title": "" }, { "docid": "0f48ee15732a309aeaf96a1194516392", "score": "0.6927385", "text": "async function start () {\n\n\t// Check for required environment variables\n\tfor (const ev of REQUIRED_ENV) {\n\t\tif (process.env[ev] === undefined) {\n\t\t\tconsole.log(`Missing required env variable: ${ev}`)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Setup server\n\tconst server = Express()\n\tserver.use(Morgan('tiny'))\n\n\t// Setup API\n\tawait api.setup(server)\n\n\t// Setup UI routes\n\tserver.use(Express.static('public'))\n\tserver.get('*', function (req, res) {\n\t res.sendFile('./public/index.html', {\"root\": \".\"})\n\t})\n\n\t// Listen on port\n\tserver.listen(process.env.mt_port, () => console.log(`money-tracker listening on port ${process.env.mt_port}...`))\n}", "title": "" }, { "docid": "1bb0beb8b84200f9ac207b1e62783d2a", "score": "0.6924868", "text": "async function start () {\n\n\tconst swaggerOptions = {\n\t\tinfo: {\n\t\t title: 'Email server API Documentation',\n\t\t version: Pkg.version,\n\t\t description:\n\t\t\t'API server emails'\n\t\t},\n\t\tgrouping: 'tags',\n\t\ttags: [\n\t\t{\n\t\t\tname: 'Email server'\n\t\t}\n\t\t]\n\t}\n\t\n\t// register plugins to server instance\n\tawait server.register([\n\t\t{\n\t\t\tplugin: Inert,\n\t\t},\n\t\t{\n\t\t\tplugin: Vision,\n\t\t},\n\t\t{\n\t\t\tplugin: HapiSwagger,\n\t\t\toptions: swaggerOptions\n\t\t},\n\t\t{ \n\t\t\tplugin: require('./src/api/v1/')\n\t\t},\n\t])\n\n\t// start your server\n\ttry {\n\t\tawait server.start()\n\t\tconsole.log(\"Server started at \" + server.info.uri);\n\t} catch (err) {\n\t\tconsole.log(\"Error starting server!!!\", err);\n\t\tprocess.exit(1)\n\t}\n}", "title": "" }, { "docid": "7cc272a4bd7870973b906e791c4d66b1", "score": "0.6918065", "text": "async function startServer() {\n const app = express();\n try {\n // Await the loaders init the API\n await Loaders({ expressApp: app });\n } catch (err) {\n Logger.error(err);\n }\n}", "title": "" }, { "docid": "c5a2ee139b44c832859c16bff2cd41b2", "score": "0.6892927", "text": "async startup() {}", "title": "" }, { "docid": "f8aba85b8b1bc40210524699c1229edf", "score": "0.6863374", "text": "async function start() {\n await initialize();\n app.listen(port, () => {\n console.log(`API available at http://localhost:${port}/api`);\n });\n}", "title": "" }, { "docid": "5f7f2a65dd4c692c1fb3cd415713b34b", "score": "0.6833735", "text": "async function start() {\n try {\n await fs.access(root);\n await fs.access(root + \"/index.html\");\n db = new sqlite3.Database(\"./data.db\");\n if(setdb) db.serialize(createdb.create);\n types = defineTypes();\n paths = new Set();\n listPaths(paths);\n requestkws = new Set();\n listRequestkws(requestkws);\n let service = http.createServer(handle);\n service.listen(port, \"localhost\");\n let address = \"http://localhost\";\n if (port != 80) address = address + \":\" + port;\n console.log(\"Server running at\", address);\n }\n catch (err) { console.log(err); process.exit(1); }\n}", "title": "" }, { "docid": "879e392ab93ba63fd7375099f15bde4a", "score": "0.68165076", "text": "async listen() {\n this.server = new HTTP2Server({\n key: this.key,\n certificate: this.certificate,\n host: this.host,\n });\n\n\n\n // start answering on the status route immediately\n const router = this.server.getRouter();\n router.get('/esm-status', (request) => {\n request.response()\n .status(200)\n .send({\n server: 'esm',\n loaded: this.isLoaded,\n version: this.version,\n });\n });\n\n\n // keep the server alive as long requests are coming in\n this.server.on('request-notification', () => {\n this.lastHit = Date.now();\n });\n\n\n await this.server.load();\n await this.server.listen(this.port).catch(async (err) => {\n if (err.code === 'EADDRINUSE') {\n // the server is probable running already, \n // validate that assumption\n \n await this.probeServer();\n\n console.log(`server already running`);\n process.exit();\n } else {\n\n // let the user know about this\n throw err;\n }\n });\n\n\n // load controllers, register routes\n await this.setupService(router).then(() => {\n this.isLoaded = true;\n console.log(`The server was loaded in ${Date.now()-this.startTime} milliseconds`);\n });\n }", "title": "" }, { "docid": "b2f732e3877f8c88210f64ed998ae369", "score": "0.68103725", "text": "function runServer() {\r\n\tconst port = process.env.PORT || 8080; \r\n\treturn new Promise((resolve, reject) => {\r\n\t\tapp.listen(port, ()=> {\r\n\t\t\tconsole.log(`Your app is listening on port ${port}`);\r\n\t\t\tresolve();\r\n\t\t})\r\n\t\t.on('error', err => {\r\n\t\t\treject(err);\r\n\t\t});\r\n\t});\r\n\t\t\r\n console.log(`Your app is listening on port ${process.env.PORT || 8080}`);\r\n}", "title": "" }, { "docid": "f5b775ff84fb641892c1b6d26549f9bb", "score": "0.68069434", "text": "async function start () {\n\n\t// Check for required environment variables\n\tfor (const ev of REQUIRED_ENV) {\n\t\tif (process.env[ev] === undefined) {\n\t\t\tconsole.log(`Missing required env variable: ${ev}`)\n\t\t\treturn\n\t\t}\n\t}\n\n\t// Setup server\n\tconst server = Express()\n\tserver.use(Morgan('tiny'))\n\n\t// Setup API\n\tawait api.setup(server)\n\n\t// Setup UI routes\n\tserver.use(Express.static('public'))\n\tserver.get('*', function (req, res) {\n\t res.sendFile('./public/index.html', {root: \".\"})\n\t})\n\n\t// Listen on port\n\tserver.listen(process.env.port, () => console.log(`interactive-map listening on port ${process.env.port}...`))\n}", "title": "" }, { "docid": "6f3ae9ef7e60832d11cc4a8ad3be6f29", "score": "0.67955744", "text": "start() {\n\t\tthis.ipc.serve(() => {\n\t\t\tthis.emit('start');\n\t\t});\n\t\tthis.ipc.server.start();\n\t}", "title": "" }, { "docid": "e9e0b2aed3c21318085b70fe84cc8266", "score": "0.6723192", "text": "start () {\n this.tick()\n return new Promise((resolve) => {\n this.startPromiseResolver = resolve\n })\n }", "title": "" }, { "docid": "e289708cf94963f7200fd6b1fb50d5e2", "score": "0.67202955", "text": "async function startServer() {\n await mongoConnect();\n await loadPlanetsData(); // wait for data to load\n await loadLaunchData();\n\n server.listen(PORT, () => {\n console.log(`Listening on port ${PORT}...`)\n });\n}", "title": "" }, { "docid": "ba6085d1c5974e2cee978b7f7fe6a29d", "score": "0.6714166", "text": "async function start(id: string, disconnect: () => void) {\n // If a --port flag is passed then it takes priority over the env variable\n const normalizedPortFlag = getArg(\"port\", \"p\");\n\n const app = new Koa();\n const server = stoppable(http.createServer(app.callback()));\n const router = new Router();\n\n // install basic middleware shared by all services\n if ((env.DEBUG || \"\").includes(\"http\")) {\n app.use(logger((str, args) => Logger.info(\"http\", str)));\n }\n app.use(compress());\n app.use(helmet());\n\n // catch errors in one place, automatically set status and response headers\n onerror(app);\n app.on(\"error\", requestErrorHandler);\n\n // install health check endpoint for all services\n router.get(\"/_health\", (ctx) => (ctx.body = \"OK\"));\n app.use(router.routes());\n\n // loop through requested services at startup\n for (const name of serviceNames) {\n if (!Object.keys(services).includes(name)) {\n throw new Error(`Unknown service ${name}`);\n }\n\n Logger.info(\"lifecycle\", `Starting ${name} service`);\n const init = services[name];\n await init(app, server);\n }\n\n server.on(\"error\", (err) => {\n throw err;\n });\n\n server.on(\"listening\", () => {\n const address = server.address();\n Logger.info(\"lifecycle\", `Listening on http://localhost:${address.port}`);\n });\n\n server.listen(normalizedPortFlag || env.PORT || \"3000\");\n\n process.once(\"SIGTERM\", shutdown);\n process.once(\"SIGINT\", shutdown);\n\n function shutdown() {\n Logger.info(\"lifecycle\", \"Stopping server\");\n\n server.emit(\"shutdown\");\n server.stop(disconnect);\n }\n}", "title": "" }, { "docid": "c8f4f1dabe8b8825149b517fcecc88b3", "score": "0.6698177", "text": "start(port) {\n return new Promise((resolve, reject) => {\n try {\n // TODO: what about other listener options?\n // TODO: what about asynchronous errors? should we attach a handler for this.server.on('error', ...)?\n // if so, how can we check for only errors related to listening, as opposed to later errors?\n this.server.listen(port, () => {\n resolve(this.server);\n });\n }\n catch (error) {\n reject(error);\n }\n });\n }", "title": "" }, { "docid": "e34ddf5c7ad5cfacb23d3927413e2032", "score": "0.6689268", "text": "function start() {\n startedPromise = connection.start().catch(err => {\n console.error(\"Failed to connect with hub\", err);\n return new Promise((resolve, reject) =>\n setTimeout(\n () =>\n start()\n .then(resolve)\n .catch(reject),\n 5000\n )\n );\n });\n return startedPromise;\n }", "title": "" }, { "docid": "3ac740c690b01d013ae6699cd61e69c6", "score": "0.66830057", "text": "start() {\n\t\treturn this.database.start().then(() => {\n\t\t\treturn this.entities.start()\n\t\t}).then(() => {\n\t\t\treturn this.addons.start()\n\t\t}).then(() => {\n\t\t\treturn this.server.start()\n\t\t})\n\t}", "title": "" }, { "docid": "f17af7821e02cdd205bb943c6368ed16", "score": "0.6678226", "text": "start() {\n return Promise.resolve();\n }", "title": "" }, { "docid": "ccd19a1b0e82183d51a06b3cab487bdd", "score": "0.66677594", "text": "function startServer() {\n\n var listener = server.listen(port, function() {\n var usedPort = listener.address().port\n logger.info(`Server running on port: ${usedPort}`);\n\n //Reanable console.\n console.log = oldConsole;\n\n //We are now finsihed setting up.\n if (callback) {\n callback(server);\n }\n\n //Open browser for user.\n if (options.browser) {\n logger.info('Openening browser...');\n var domain = (options.localhost) ? 'localhost' : '127.0.0.1';\n open(`http://${domain}:${usedPort}`);\n logger.info('Happy coding :)');\n }\n });\n }", "title": "" }, { "docid": "2bf5aadd0f051588f1c6080a9db0be0e", "score": "0.66551185", "text": "async function start() {\n await run(clean);\n await Promise.all([\n run(copy),\n run(compileServer)\n ]);\n await new Promise(resolve => {\n const compiler = webpack(config);\n\n let handleServerBundleComplete = async () => {\n const server = await runServer();\n const browserSync = createBrowserSync.create();\n\n // Initialize browserSync\n browserSync.init({\n ...(isDevelopment ? { open: true } : { notify: false, ui: false }),\n proxy: {\n target: server.host,\n middleware: [\n webpackDevMiddleware(compiler, {\n\n /**\n * IMPORTANT: webpack middleware can't access config,\n * so we should provide publicPath by ourselves\n */\n publicPath: config.output.publicPath,\n\n // Colored output for statistics\n stats: config.stats\n }),\n\n // compiler should be the same as above\n webpackHotMiddleware(compiler)\n ]\n }\n }, resolve);\n handleServerBundleComplete = runServer;\n };\n compiler.run(handleServerBundleComplete);\n });\n}", "title": "" }, { "docid": "bf5d56626b54f9e9d11e5cb8197dd5f7", "score": "0.66517556", "text": "function start() {\n startedPromise = connection.start()\n .catch(err => {\n console.error('Failed to connect with hub', err);\n return new Promise((resolve, reject) => setTimeout(() => start().then(resolve).catch(reject), 5000));\n })\n return startedPromise;\n }", "title": "" }, { "docid": "f0e8cac22bc058acaf53bc1195866ac1", "score": "0.66163677", "text": "async startWorker() {\n //todo: логика запуска обработчика запросов\n this.server = this.transport.createServer().listen(this.PORT);\n \n console.log('Worker with pid : %d is started working and listening on PORT : %d', process.pid, this.PORT);\n }", "title": "" }, { "docid": "50dad90fab9d2a6bc201fc366004f5bb", "score": "0.6593585", "text": "async start() {\n // already starting or started\n if (this.readyState != null) return;\n this.readyState = 0;\n\n // create a percy build as the first immediately queued task\n let buildTask = this.#uploads.push('build/create', () => {\n // pause other queued tasks until after the build is created\n this.#uploads.stop();\n\n return this.client.createBuild()\n .then(({ data: { id, attributes } }) => {\n this.build = { id };\n this.build.number = attributes['build-number'];\n this.build.url = attributes['web-url'];\n this.#uploads.run();\n });\n }, 0);\n\n // handle deferred build errors\n if (this.deferUploads) {\n buildTask.catch(err => {\n this.log.error('Failed to create build');\n this.log.error(err);\n this.close();\n });\n }\n\n try {\n // when not deferred, wait until the build is created first\n if (!this.deferUploads) await buildTask;\n // launch the discovery browser\n await this.browser.launch(this.config.discovery.launchOptions);\n // if there is a server, start listening\n await this.server?.listen(this.port);\n\n // mark this process as running\n this.log.info('Percy has started!');\n this.readyState = 1;\n } catch (error) {\n // on error, close any running server and browser\n await this.server?.close();\n await this.browser.close();\n this.readyState = 3;\n\n // throw an easier-to-understand error when the port is taken\n if (error.code === 'EADDRINUSE') {\n throw new Error('Percy is already running or the port is in use');\n } else {\n throw error;\n }\n }\n }", "title": "" }, { "docid": "07cc0771dd5c3112adf2d2bb124c5db1", "score": "0.65796334", "text": "startServer() {\n this._server = http.createServer(this._app);\n this._server.listen(this._listeningPort, '0.0.0.0');\n this._server.on('error', this._onServerError);\n this._server.on('listening', this._onServerListening);\n }", "title": "" }, { "docid": "dce2863b6302c687b07ed096bd4640cd", "score": "0.6564045", "text": "start({port}) {\n return new Promise((resolve, reject) => {\n this._port = port;\n const oServerSocket = io.listen(port);\n this._io = oServerSocket;\n this.logger.log('service hub : listening on port', port);\n oServerSocket.on('connection', socket => {\n this._hubClientConnected(socket);\n resolve(true);\n });\n });\n }", "title": "" }, { "docid": "3c6c64c127008637a82dc37114756712", "score": "0.6547654", "text": "function startServer(dataBaseUrl, port = PORT) {\n return new Promise((resolve, reject) => {\n //Connect to database\n // mongoose.connect(dataBaseUrl, { useNewUrlParser: true }, err => {\n mongoose.connect(dataBaseUrl, err => {\n if (err) {\n //If error connecting to database - print out error to console and reject promise\n console.error(err);\n return reject(err);\n } else {\n console.log(\"mongo connected\")\n //If database connect successful - Start Express server\n server = app.listen(port, () => {\n //If expressJS server start successfull - print success msg to console and resolve promise\n console.log(`Express server listening on http://localhost:${port}`);\n resolve();\n }).on('error', err => {\n ////If error with expressJS server start - disconnect from MongoDB database, print out error to console and reject promise\n mongoose.disconnect();\n console.error(err);\n reject(err);\n });\n }\n });\n });\n}", "title": "" }, { "docid": "60b7cbba278d48ef26ab342e04dc079d", "score": "0.6545414", "text": "async function start( env, args ) {\n\n // Create an express server as the main mount point.\n const mount = Express();\n\n // Fetch the server property from the environment and attach the\n // express mount point to it.\n const { server } = env;\n if( !server ) {\n throw new Error('No \"server\" property in environment');\n }\n server.mount = mount;\n\n // Configure the server by running the ds:configure command.\n const configure = this['ds:configure'];\n if( !configure ) {\n throw new Error('ds:configure command not found');\n }\n await configure( env, args );\n\n const { config } = server;\n const { port, mountPath } = config;\n\n // Check for non-root mount path.\n let httpServer = mount;\n if( mountPath != '/' ) {\n mountPath = absPath( mountPath );\n httpServer = Express();\n httpServer.use( mountPath, mount );\n }\n\n // The server's (locally) public URL.\n const serverURL = `http://localhost:${port}`;\n\n // Attach proxy endpoints.\n setupProxies( config, httpServer, serverURL );\n\n // Start the HTTP server.\n httpServer.listen( port, () => {\n const url = serverURL+mountPath;\n console.log(`Dev server running @ ${url}`);\n opn( url );\n });\n}", "title": "" }, { "docid": "f4b44590c958fbcd078a7d11e69accc8", "score": "0.65399957", "text": "function createServer() {\n return new Promise((resolve) => {\n let io;\n /**\n * if api ssl is required\n */\n if (config.API_SSL === 'true') {\n /**\n * create ssl credentials\n */\n const privateKey = fs.readFileSync(config.PRIVATE_KEY_PATH, 'utf8');\n const certificate = fs.readFileSync(config.CERTIFICATE_PATH, 'utf8');\n const ca = fs.readFileSync(config.CA_PATH, 'utf8');\n const credentials = {\n key: privateKey,\n cert: certificate,\n // eslint-disable-next-line object-shorthand\n ca: ca,\n };\n const https = httpsClient.createServer(credentials, app);\n https.listen(config.LIVEDATA_API_PORT, () => {\n console.log('server started');\n io = socketio(https);\n resolve(io);\n });\n } else {\n /**\n * create server without ssl\n */\n const http = httpClient.createServer(app);\n http.listen(config.LIVEDATA_API_PORT, () => {\n console.log('server started');\n io = socketio(http);\n resolve(io);\n });\n }\n });\n}", "title": "" }, { "docid": "71c499d414c264a68dd460c7dac16582", "score": "0.6507071", "text": "_run() {\n debug('starting server...');\n const iface = this.config.server_interface;\n const port = this.config.server_port;\n this.server = http.createServer((req, res) => {\n log(req.method, chalk.underline(req.url), `HTTP/${req.httpVersion}`);\n this.app.handle(req, res, this._handleRequest.bind(this, req, res));\n });\n\n this.io = socket(this.server, Object.assign({\n }, this.config.socketOptions));\n initSocket(this.io, this.handler);\n this.server.listen(port, iface, () => {\n log('Listening on', `${iface}:${port}`);\n });\n }", "title": "" }, { "docid": "cceedb87fd1f406cee88135a6040b9ad", "score": "0.6503608", "text": "start() {\n return new Promise((res, rej) => this._task(res, rej));\n }", "title": "" }, { "docid": "b1ae7bc6936fedc8ef6203f324000610", "score": "0.6499948", "text": "function createServer() { \n return spawn('node', ['./app/index.js'], {stdio: \"inherit\", cwd: process.cwd() });\n}", "title": "" }, { "docid": "8dc5513e2d492eef2af6fc3ca2b1cbb1", "score": "0.64979273", "text": "function _startHTTPServer (callback) {\n\tvar proc = cp.spawn('node', [\"app.js\"]);\n\tproc.stdout.on('data', function (data) {\n\t if (!that.isServerStart) {\n\t \tconsole.log('Http Server : '.cyan + data);\n\t \tthat.isServerStart = true;\n\t\tcallback && callback();\n\t }\n\t});\n\n\tproc.stderr.on('data', function (data) {\n\t console.log('stderr: ' + data);\n\t});\n\n\tproc.on('exit', function (code) {\n\t console.log('Exit Http Server...');\n\t});\n\t//记住该服务进程\n\tthat._serverPid = proc.pid;\n}", "title": "" }, { "docid": "c54efb2e020f665d27cf3e1fd937206f", "score": "0.64890015", "text": "async start () {\r\n await this.cherryServerManager.startServers()\r\n await this.ormManager.connectDatabase()\r\n }", "title": "" }, { "docid": "167ec6921c8b2f1a83af4c6da1299881", "score": "0.64712256", "text": "async function start(options) {\n return new Promise((resolve, reject) => {\n try {\n log.info(`${MODULE_NAME} ${start.name} (IN) --> options: ${JSON.stringify(options)}`);\n\n // Swagger config\n const config = {\n appRoot: options.appRoot,\n };\n\n // Instance Expresss\n const app = express();\n\n // Init Security\n securityHelper.initSecurity(app);\n\n // Init Swagger\n SwaggerExpress.create(config, (err, swaggerExpress) => {\n if (err) {\n log.error(`${MODULE_NAME} ${start.name} (ERROR) --> error: ${err.stack}`);\n throw err;\n }\n\n const appPort = options.port || DEFAULT_PORT;\n module.exports.server = app.listen(appPort);\n\n // Socket timeout to 5 minutes\n module.exports.server.timeout = 300000;\n\n // Set the requests timeout\n const serverTimeOut = options.servertimeout || DEFAULT_TIMEOUT;\n module.exports.server.setTimeout(serverTimeOut);\n log.info(`${MODULE_NAME} ${start.name} (MID) --> Express Server timeout set to: ${serverTimeOut} ms`);\n\n // Init Uploader\n uploaderHelper.initUploader(options.upload, app);\n\n // Enable private routes\n if (options.privateRouting.enabled) {\n log.info(`${MODULE_NAME} ${start.name} (MID) --> Enabling private routes at: ${JSON.stringify(options.privateRouting.routes)}`);\n\n options.privateRouting.routes.map(x => app.all(x.route, authMiddleware.authenticate));\n }\n\n // Enable CORS\n if (options.enableCors) {\n log.info(`${MODULE_NAME} ${start.name} (MID) --> Enabling CORS`);\n app.use(cors());\n }\n // Install middleware\n swaggerExpress.register(app);\n\n log.info(`${MODULE_NAME} ${start.name} (OUT) --> App Server started at port: ${appPort} and Running OK!`);\n\n resolve(true);\n });\n } catch (error) {\n log.error(`${MODULE_NAME} ${start.name} (ERROR) --> error: ${error.stack}`);\n reject(new Error('Express did not start correctly!'));\n }\n });\n}", "title": "" }, { "docid": "3ac17e4457da6d2d903aca5c5a338211", "score": "0.6423494", "text": "function start()\n{\n\t// Verify if the server is making his first start\n\tfirstStart();\n\n\t// Create routes\n\trouter();\n\n\tExpressApp.listen(Config.app.port, function(err)\n\t{\n\t\tif(!err)\n\t\t{\n\t\t\tuShare.notice(`App started on port ${Config.app.port}`);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "55c9c738da1a79f8d832e7dbc205d173", "score": "0.64194214", "text": "function startTestServer(port) {\n\t\tconst testServer = spawn('npx', ['svelte-kit', 'dev', `--port=${port}`]);\n\n\t\ttestServer.stderr.on('data', (data) => {\n\t\t\tconsole.error(data.toString());\n\t\t});\n\n\t\ttestServer.stdout.on('data', (data) => {\n\t\t\tconsole.log(data.toString());\n\t\t});\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\ttestServer.stdout.on('data', (data) => {\n\t\t\t\tif (/http:\\/\\/localhost:\\d+/.test(data)) {\n\t\t\t\t\tresolve(testServer);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\ttestServer.on('close', reject);\n\t\t});\n\t}", "title": "" }, { "docid": "3c78d2f464f4f390e2c702c6de845560", "score": "0.64143616", "text": "function startServer() {\n \"use strict\";\n\n var webServer = http.createServer(app);\n PushNotifications.startWebSocketServer(webServer);\n webServer.listen(app.get('port'), function() {\n console.log('server started on port ' + app.get('port') +\n ' in ' + app.get('env') + ' mode; press Ctrl+C to terminate');\n });\n}", "title": "" }, { "docid": "34ed71484f6aebba3a2c053d41c81f03", "score": "0.6406944", "text": "async function start() {\n const server = app.listen(3000, () => {\n log.info(\"Starting server\");\n greet(\"world\");\n });\n\n // We perform a couple of parallel requests\n const names = [\n \"A\",\n \"B\",\n \"C\",\n \"D\",\n \"E\",\n \"F\",\n \"G\",\n \"H\",\n \"I\",\n \"J\",\n \"K\",\n \"L\",\n \"M\",\n ];\n await Promise.all(names.map((name) => sendRequest(name)));\n server.close();\n}", "title": "" }, { "docid": "d96d107e903fa9b6994a84c83120f36f", "score": "0.6404755", "text": "start(cb) {\n return this._http.listen(() => {\n this.serverUrl = `http://localhost:${this._http.address().port}`;\n cb(this.serverUrl);\n });\n }", "title": "" }, { "docid": "68106de998eb4936f70b8e729663fc99", "score": "0.6369019", "text": "function startBackendServer () {\n // if running this from the datatools-server repo, skip this step\n if (!isUiRepo) return Promise.resolve()\n\n return new Promise((resolve, reject) => {\n console.log('prepare to start backend server')\n\n // make sure required environment variables are set\n try {\n requireEnvVars([\n 'AUTH0_CLIENT_ID',\n 'AUTH0_DOMAIN',\n 'AUTH0_SECRET',\n 'AUTH0_TOKEN',\n 'OSM_VEX',\n 'SPARKPOST_EMAIL',\n 'SPARKPOST_KEY',\n 'S3_BUCKET',\n 'TRANSITFEEDS_KEY'\n ])\n } catch (e) {\n console.error(`A required env var is missin: ${e}`)\n return reject(e)\n }\n\n const serverFolder = path.join(\n process.env.TRAVIS_BUILD_DIR,\n '..',\n 'datatools-server'\n )\n const serverJarFile = path.join(serverFolder, serverJarFilename)\n const envFile = path.join(serverFolder, 'env.yml')\n const serverFile = path.join(serverFolder, 'server.yml')\n const baseDtServerGithubConfigUrl = 'https://raw.githubusercontent.com/conveyal/datatools-server/e2e-coverage/configurations/default/'\n\n auto({\n makeServerFolder: callback => {\n console.log('creating directory for server files')\n mkdirp(serverFolder, callback)\n },\n downloadJar: ['makeServerFolder', (results, callback) => {\n console.log('downloading server jar')\n downloadFile(\n `https://s3.amazonaws.com/datatools-builds/${serverJarFilename}`,\n serverJarFile,\n callback\n )\n }],\n downloadEnvTemplate: ['makeServerFolder', (results, callback) => {\n console.log('downloading backend env.yml template')\n downloadFile(\n `${baseDtServerGithubConfigUrl}env.yml.tmp`,\n envFile,\n callback\n )\n }],\n downloadServerTemplate: ['makeServerFolder', (results, callback) => {\n console.log('downloading backend server.yml template')\n downloadFile(\n `${baseDtServerGithubConfigUrl}server.yml.tmp`,\n serverFile,\n callback\n )\n }],\n readEnvTemplate: ['downloadEnvTemplate', (results, callback) => {\n console.log('loading backend env template')\n loadYamlFile(envFile, callback)\n }],\n readServerTemplate: ['downloadServerTemplate', (results, callback) => {\n console.log('loading backend server template')\n loadYamlFile(serverFile, callback)\n }],\n writeEnvFile: ['readEnvTemplate', (results, callback) => {\n console.log('writing backend env.yml')\n\n writeYamlFile(\n envFile,\n merge(\n results.readEnvTemplate,\n pick(\n process.env,\n [\n 'AUTH0_CLIENT_ID',\n 'AUTH0_DOMAIN',\n 'AUTH0_SECRET',\n 'AUTH0_TOKEN',\n 'OSM_VEX',\n 'SPARKPOST_KEY',\n 'SPARKPOST_EMAIL'\n ]\n )\n ),\n callback\n )\n }],\n writeServerFile: ['readServerTemplate', (results, callback) => {\n console.log('writing backend server.yml')\n\n const {\n S3_BUCKET,\n TRANSITFEEDS_KEY\n } = process.env\n\n const serverEnv = results.readServerTemplate\n serverEnv.application.assets_bucket = S3_BUCKET\n serverEnv.application.data.gtfs_s3_bucket = S3_BUCKET\n serverEnv.extensions.transitfeeds.key = TRANSITFEEDS_KEY\n writeYamlFile(\n serverFile,\n serverEnv,\n callback\n )\n }],\n startServer: [\n 'downloadJar',\n 'writeEnvFile',\n 'writeServerFile',\n (results, callback) => {\n console.log('starting backend server')\n\n try {\n spawnDetachedProcess(\n 'java',\n [\n '-Xmx6G',\n '-jar',\n serverJarFile,\n envFile,\n serverFile\n ],\n 'datatools-server'\n )\n } catch (e) {\n console.error(`error starting datatools-server: ${e}`)\n return callback(e)\n }\n callback()\n }\n ]\n }, (err, results) => {\n if (err) {\n console.error(`failed to start backed server due to error: ${err}`)\n return reject(err)\n }\n console.log('backend server started successfully')\n resolve()\n })\n })\n}", "title": "" }, { "docid": "5ec085352e30dc7cbdfc1918696293cb", "score": "0.63622373", "text": "function startClientServer () {\n return new Promise((resolve, reject) => {\n console.log('prepare to start client dev server')\n\n // make sure required environment variables are set\n try {\n requireEnvVars([\n 'AUTH0_CLIENT_ID',\n 'AUTH0_DOMAIN',\n 'E2E_AUTH0_PASSWORD',\n 'E2E_AUTH0_USERNAME',\n 'GRAPH_HOPPER_KEY',\n 'MAPBOX_ACCESS_TOKEN',\n 'S3_BUCKET',\n 'TRANSITFEEDS_KEY'\n ])\n } catch (e) {\n console.error(`A required env var is missin: ${e}`)\n return reject(e)\n }\n\n // set the working directories for datatools-ui\n const datatoolsUiDir = path.join(\n process.env.TRAVIS_BUILD_DIR,\n '..',\n 'datatools-ui'\n )\n const defaultConfigFolder = path.join(\n datatoolsUiDir,\n 'configurations',\n 'default'\n )\n\n // asynchronously complete the remaining tasks as they involve a lot of file\n // writing that can be performed asynchronously.\n auto({\n startClientDevServer: callback => {\n console.log('starting client dev server')\n\n try {\n spawnDetachedProcess(\n 'node', ['__tests__/test-utils/travis-client-dev-server.js'],\n 'client-dev-server'\n )\n } catch (e) {\n console.error(`error starting dev server: ${e}`)\n return callback(e)\n }\n\n callback()\n },\n writeE2eEnvYml: callback => {\n console.log('writing e2e env.yml')\n\n // create e2e config file with valid auth0 login\n // > configurations/end-to-end/env.yml\n writeYamlFile(\n path.join(datatoolsUiDir, 'configurations', 'end-to-end', 'env.yml'),\n {\n password: process.env.E2E_AUTH0_PASSWORD,\n username: process.env.E2E_AUTH0_USERNAME\n },\n callback\n )\n },\n loadDefaultEnvYml: callback => {\n console.log('loading client env.yml template')\n\n loadYamlFile(path.join(defaultConfigFolder, 'env.yml.tmp'), callback)\n },\n loadDefaultSettingsYml: callback => {\n console.log('loading client settings.yml template')\n\n loadYamlFile(path.join(defaultConfigFolder, 'settings.yml'), callback)\n },\n writeDefaultEnvYml: ['loadDefaultEnvYml', (results, callback) => {\n console.log('writing client env.yml template')\n\n writeYamlFile(\n path.join(defaultConfigFolder, 'env.yml'),\n merge(\n results.loadDefaultEnvYml,\n pick(\n process.env,\n [\n 'AUTH0_CLIENT_ID',\n 'AUTH0_DOMAIN',\n 'GRAPH_HOPPER_KEY',\n 'MAPBOX_ACCESS_TOKEN'\n ]\n )\n ),\n callback\n )\n }],\n writeDefaultSettingsYml: ['loadDefaultSettingsYml', (results, callback) => {\n console.log('writing client settings.yml template')\n\n const {\n S3_BUCKET,\n TRANSITFEEDS_KEY\n } = process.env\n\n const clientSettings = results.loadDefaultSettingsYml\n clientSettings.S3_BUCKET = S3_BUCKET\n clientSettings.application.data.gtfs_s3_bucket = S3_BUCKET\n clientSettings.application.data.use_s3_storage = true\n clientSettings.modules.deployment = { enabled: true }\n clientSettings.extensions.transitfeeds.key = TRANSITFEEDS_KEY\n writeYamlFile(\n path.join(defaultConfigFolder, 'settings.yml'),\n clientSettings,\n callback\n )\n }],\n buildClientDistFiles: [\n 'writeE2eEnvYml',\n 'writeDefaultEnvYml',\n 'writeDefaultSettingsYml',\n (results, callback) => {\n console.log('building client dist files')\n\n const args = ['run', 'build-dev', '--prefix', datatoolsUiDir]\n\n // if running in the ui environment, build with instrumented code\n if (isUiRepo) {\n args.push('--')\n args.push('--instrument')\n }\n\n execFile(\n 'npm',\n args,\n (err, stdout, stderr) => {\n if (err) {\n console.error(`An error occurred while building client dist files: ${err}`)\n }\n\n // write the stdout, stderr logs regardless of whether the build\n // was successful\n each(\n [\n { data: stdout, logType: 'out' },\n { data: stderr, logType: 'err' }\n ],\n (output, outputCallback) => {\n fs.writeFile(\n `mastarm-build-${output.logType}.log`,\n output.data,\n outputCallback\n )\n },\n (eachErr) => {\n if (eachErr) {\n console.error(`An error occurred while writing the build log files: ${err}`)\n }\n // callback for build server executing. Don't fail this if\n // the log writing failed as that is not necessary for the\n // rest of the e2e script to run properly\n callback(err)\n }\n )\n }\n )\n }\n ]\n }, (err, results) => {\n if (err) {\n console.error(`failed to start client dev server due to error: ${err}`)\n return reject(err)\n }\n console.log('successfully started client dev server')\n resolve()\n })\n })\n}", "title": "" }, { "docid": "82722e17498278d10cc41aca16c31be7", "score": "0.6359786", "text": "start() {\n this.server.start();\n this._register();\n this.log.info(`Worker ${this.workerId} running at ${this.workerAddr}`);\n }", "title": "" }, { "docid": "3b3378d8c68bb78a7014f1d4c7b3ecd0", "score": "0.6338771", "text": "async _startStreamingServer () {\n return new Promise(async (resolve, reject) => {\n net.createServer((sock) => {\n this.emit('info', `Streaming client connected`)\n\n this._streamingInfo.isConnected = true\n sock.setKeepAlive(true, 1000)\n\n sock.on('error', (err) => {\n console.error(err + ' at ' + sock.address + ' ' + sock.remotePort)\n this.emit('status', this.statusCode.STREAM_DISCONNECTED)\n })\n\n sock.on('close', (data) => {\n console.log('TCP socket closed')\n this._streamingInfo.isConnected = false\n this.emit('status', this.statusCode.STREAM_DISCONNECTED)\n })\n\n this._streamingInfo.sock = sock\n this.emit('status', this.statusCode.STREAM_CONNECTED)\n\n this._listenForAudio()\n\n this.emit('info', 'Chatbot ready!')\n this.emit('status', this.statusCode.CHATBOT_READY)\n resolve(sock)\n }).listen(this._serverPort)\n\n this.emit('info', `Streaming server started on port: ${this._serverPort}`)\n })\n }", "title": "" }, { "docid": "fe78c036e8f8674486ce89bcdd96f2e4", "score": "0.63361806", "text": "async function startServer() {\n const log = {\n contents: '',\n };\n const server = http.createServer(async (req, res) => {\n if (req.method === 'GET') {\n for (const [file, content] of files.entries()) {\n if (req.url?.endsWith(file)) {\n res.writeHead(200, { 'Content-Type': 'text/html' });\n res.end(content);\n return;\n }\n }\n res.writeHead(404, { 'Content-Type': 'text/plain' });\n res.end('Not found');\n return;\n }\n if (req.method === 'POST') {\n const body = await new Promise((resolve) => {\n const body = [];\n req\n .on('data', (chunk) => {\n body.push(chunk);\n })\n .on('end', () => {\n resolve(Buffer.concat(body).toString());\n });\n });\n res.writeHead(200);\n res.end();\n log.contents += body;\n return;\n }\n res.writeHead(400);\n res.end();\n });\n return new Promise((resolve) => {\n server.listen(8907, 'localhost', () => {\n resolve({ server, log });\n });\n });\n}", "title": "" }, { "docid": "385fb956eaf386f048ddf76065455b30", "score": "0.63182247", "text": "run() {\n\n let server;\n\n if (this.httpServer) {\n\n server = this.httpServer;\n\n } else {\n\n server = this.application;\n }\n\n this._server = server.listen(this.config.env.SERVER_PORT, this.config.env.SERVER_HOST, () => {\n\n this.emit(ApplicationEvent.SERVER_STARTED);\n\n const host = this.server.address().address;\n const port = this.server.address().port;\n\n this._logger.debug('Server is UP and Running. Listening at http://%s:%s', host, port);\n });\n }", "title": "" }, { "docid": "f2d1bba8421652dfdaec3c6c323f620b", "score": "0.6308585", "text": "async function startLiveReload() {\n return new Promise((resolve) => {\n // Fails: const child = spawn('ionic', [\"capacitor\", \"run\", \"android\", \"-l\", \"--external\", \"--host=192.168.56.1\"]);\n // A hack: run \"ionic capacitor run android -l --external\" from powershell\n const child = spawn('powershell.exe', [\"./scripts/ionic-live-reload\"]);\n child.stdout.on('data', (chunk) => {\n // server loaded\n if (chunk.includes(\"[INFO] Development server will continue running until manually stopped.\")) {\n // resolve\n resolve();\n }\n });\n child.on('close', (code) => {\n console.log(`Live server exited with code: ${code}`)\n });\n });\n}", "title": "" }, { "docid": "3921665c1f53c2d56e6dc4b3e69d47f5", "score": "0.63045627", "text": "function start (callback) {\n server.listen(options.port, options.hostname, undefined, function () {\n log('SPA server is now accepting requests on port: ' + options.port);\n if ('function' === typeof callback) {\n callback();\n }\n });\n }", "title": "" }, { "docid": "d773778430b0a12641a0cb26531f903c", "score": "0.6300434", "text": "async _processServerCreation() {\n if (this.serverManagerInProcess) {\n return this.promiseServerCreation.then(() => this.findServer());\n }\n this.serverManagerInProcess = true;\n this.promiseServerCreation = new Promise(async resolve => {\n const infosServer = await this._createServerSocket();\n resolve(infosServer);\n this.serverManagerInProcess = false;\n });\n return this.promiseServerCreation;\n }", "title": "" }, { "docid": "b41b36c1bfbb79ec8c4393a1573b6a4d", "score": "0.62994015", "text": "start() {\n return async(this, function* () {\n log.info_t(\"commands.agent.starting\");\n\n // Start api\n yield Api.start();\n\n // Virtual machine is required?\n if (this.vm_enabled && config('agent:requires_vm')) {\n yield this.installVM(true);\n yield this.installShare();\n yield this.mountShare();\n }\n\n // Load balancer\n yield this.installBalancer();\n\n log.info_t(\"commands.agent.started\");\n });\n }", "title": "" }, { "docid": "e165d7add9771ccd3bec873e35920372", "score": "0.62895805", "text": "async start() {\n await Promise.all([\n this.authManager.start(),\n this.fastifyManager.start(),\n ]);\n\n this.emit('clientReady', this);\n\n return this;\n }", "title": "" }, { "docid": "f47e89b9c1ff26e36b17a72da0885f47", "score": "0.62844", "text": "async function startTest(port) {\n var app = spawnTest();\n}", "title": "" }, { "docid": "abe7499cb32af1f83d05532386cfd7ab", "score": "0.62780553", "text": "async start() {\n return Promise.all([\n this.myXVFB.start(),\n addConnectivity(this.options),\n this.myExtensionServer.start()\n ]);\n }", "title": "" }, { "docid": "5fda84044e7c4e011abe65dad15b553a", "score": "0.6271842", "text": "function runServer() {\n return new Promise((resolve, reject) => {\n console.log(DATABASE_URL);\n mongoose.connect(DATABASE_URL, err => {\n if (err) {\n return reject(err);\n }\n server = app.listen(PORT, () => {\n console.log(`Your app is listening on port ${PORT}`);\n\n resolve();\n })\n .on('error', err => {\n mongoose.disconnect();\n reject(err);\n });\n });\n });\n}", "title": "" }, { "docid": "de7b77932a35809077e7ce6bf0915eb4", "score": "0.6269356", "text": "start() {\n const _this = this\n processOptions(this.config, yargs.argv, (config, options) => {\n const compiler = webpack(config)\n const server = new Server(compiler, options)\n server.listen(options.port, options.host, (err) => {\n if(err) {\n _this.emit('error')\n throw err\n }\n })\n })\n }", "title": "" }, { "docid": "fa91a07b6b9dce8e2629bb6f46913c08", "score": "0.62655616", "text": "async start() {\n let exitCode = 0;\n const sdk = this.sdk;\n const die = async (err) => {\n otel.diag.error(err.stack || String(err));\n exitCode = 1;\n await shutdown();\n };\n const shutdown = async () => {\n await this.stop();\n process.exit(exitCode);\n };\n if (sdk) {\n process.once('SIGTERM', shutdown);\n process.once('beforeExit', shutdown);\n process.once('uncaughtException', die);\n process.once('unhandledRejection', async (reason, _) => {\n await die(reason);\n });\n await sdk.start();\n }\n this.started = true;\n }", "title": "" }, { "docid": "ac9a46872973701881e2829ffd3764d3", "score": "0.6260756", "text": "async function init() {\n await server.register({\n plugin: require('hapi-pino'),\n options: {\n prettyPrint: true,\n logEvents: ['response']\n }\n });\n await server.register(require('inert'));\n await server.start();\n console.log(`server has started at: ${Port}`);\n}", "title": "" }, { "docid": "25aade2122ab2315c1cdd0c5eb9ecffa", "score": "0.6249804", "text": "startServer() {\n Logger.info(`Starting ADB server.....`);\n childProcess.execSync(`${ADB_PATH} start-server`);\n }", "title": "" }, { "docid": "6ded7b2da0f75da81178fd3fa631ece8", "score": "0.6241035", "text": "async function startAsync() {\n try {\n logger.info(`App : Startup : Version ${version}`)\n // display NETWORK value\n logger.info(`App : Startup : Network : ${env.NETWORK}`)\n // display Private Mode if running in private mode\n if (env.PRIVATE_NETWORK) logger.info(`App : Startup : Private Network Mode`)\n\n await openStorageConnectionAsync()\n\n // Establish Core connection(s) using Core discovery or provided CHAINPOINT_CORE_CONNECT_IP_LIST values\n await cores.connectAsync()\n\n // Ensure that this Node is registered, exit if not\n // Perform a few retries in case the Node is in the process of being registered\n await checkRegistrationAsync()\n\n // Validate CHAINPOINT_NODE_PUBLIC_URI, CHAINPOINT_NODE_PRIVATE_URI & CHAINPOINT_NODE_REFLECT_PUBLIC_OR_PRIVATE if either env variable is set in .env\n utils.validateNodeUri(env.CHAINPOINT_NODE_PUBLIC_URI, false)\n if (env.CHAINPOINT_NODE_PRIVATE_URI !== '') {\n utils.validateNodeUri(env.CHAINPOINT_NODE_PRIVATE_URI, true)\n }\n if (env.CHAINPOINT_NODE_REFLECT_PUBLIC_OR_PRIVATE !== '') {\n utils.validateReflectedUri(env.CHAINPOINT_NODE_REFLECT_PUBLIC_OR_PRIVATE)\n }\n\n // get the active JWT usage token, refresh/acquire as needed, report any errors on startup\n try {\n await usageToken.getActiveUsageTokenAsync()\n } catch (err) {\n logger.error(`Usage Token : ${err.message}`)\n }\n\n await eventMetrics.loadMetricsAsync()\n await apiServer.startAsync()\n\n // start the interval processes for refreshing the IP blocklist\n apiServer.startIPBlacklistRefreshInterval()\n\n // start the interval processes for aggregating and submitting hashes to Core\n aggregator.startAggInterval()\n\n // start the interval processes for pruning expired proof state data from RocksDB\n rocksDB.startPruningInterval()\n\n // start the interval processes for pruning cached proof data from memory\n cachedProofs.startPruneExpiredItemsInterval()\n\n // start the interval processes for pruning cached transaction data from memory\n cores.startPruneExpiredItemsInterval()\n\n // start the interval processes for saving event metrics data\n eventMetrics.startPersistDataInterval()\n\n // start the reputation chain generation process\n repChain.generateReputationEntryAsync()\n repChain.startRepInterval()\n\n logger.info(`App : Startup : Complete`)\n } catch (err) {\n logger.error(`App : Startup : ${err.message}`)\n // Unrecoverable Error : Exit cleanly (!), so Docker Compose `on-failure` policy\n // won't force a restart since this situation will not resolve itself.\n process.exit(0)\n }\n}", "title": "" }, { "docid": "98080be6b205b094764d545e7e580bf9", "score": "0.6233416", "text": "function startCoverageServer () {\n if (!collectingCoverage) return Promise.resolve()\n\n return new Promise((resolve, reject) => {\n console.log('starting coverage server')\n\n try {\n spawnDetachedProcess(\n 'node',\n ['__tests__/test-utils/e2e-coverage-collector-server.js'],\n 'e2e-coverage-collector-server'\n )\n } catch (e) {\n console.error(`error starting coverage server: ${e}`)\n return reject(e)\n }\n\n console.log('successfully started coverage server')\n resolve()\n })\n}", "title": "" }, { "docid": "32ad650d74d1951cf39bda151307dd95", "score": "0.6207577", "text": "async function start(appRoot, port) {\n return new Promise((resolve, reject) => {\n try {\n // Swagger config\n const config = { appRoot };\n\n // Instance Expresss\n const app = express();\n\n // Init Swagger\n SwaggerExpress.create(config, (err, swaggerExpress) => {\n if (err) {\n log.error(`${MODULE_NAME}:${start.name} (ERROR) --> error: ${err.stack}`);\n throw err;\n }\n\n const appPort = port || DEFAULT_PORT;\n module.exports.server = app.listen(appPort);\n\n // Healthcheck\n app.use('/healthcheck', healthcheck({\n healthy() {\n return { everything: 'is ok' };\n },\n }));\n\n // Install middleware\n swaggerExpress.register(app);\n\n log.info(`${MODULE_NAME}:${start.name} (OUT) --> App Server started at port: ${appPort} and Running OK!`);\n resolve(true);\n });\n } catch (error) {\n log.error(`${MODULE_NAME}:${start.name} (ERROR) --> error: ${error.stack}`);\n reject(new Error('Express did not start correctly!'));\n }\n });\n}", "title": "" }, { "docid": "d63a88a71136826295f4397481ab6b43", "score": "0.62062734", "text": "start() {\n const { port } = this.config;\n this.server = this.express.listen(port, () => {\n this.logger.info(`Listening on ${port}`);\n });\n }", "title": "" }, { "docid": "a5e6c2d049de1a27a73450eb55041b4b", "score": "0.61909115", "text": "start() {\n return Promise.all([\n this.myXVFB.start(),\n connectivity.set(this.options),\n this.myExtensionServer.start()\n ]);\n }", "title": "" }, { "docid": "c0d990ceb29c4d702795559592746fb3", "score": "0.6183386", "text": "function serverStart() {\n app.listen(PORT, () => {\n console.log(`app is running at ${PORT}`);\n });\n}", "title": "" }, { "docid": "3270344ca9f2020a2d3b6a3bab1fa10e", "score": "0.61741716", "text": "start(){\r\n this[BEFORE_START].forEach( (fn) => {\r\n fn.apply(null, this);\r\n });\r\n\r\n this.listen(this.config.port);\r\n this.on('error', err =>\r\n console.error('server error: ', err)\r\n );\r\n debug('App started and listening on port: %s', this.config.port);\r\n\r\n this[AFTER_START].forEach( (fn) => {\r\n fn.apply(null, this);\r\n });\r\n }", "title": "" }, { "docid": "542809d1204bb64886dedc20f35a4a5e", "score": "0.61719745", "text": "async function start() {\n // Init Nuxt.js\n // const nuxt = new Nuxt(config);\n\n // Build only in dev mode\n // if (config.dev) {\n // const builder = new Builder(nuxt);\n // await builder.build();\n // }\n\n middleware.beforeRouter(app);\n\n app.use(\"/api\", api);\n\n middleware.afterRouter(app);\n\n // Give nuxt middleware to express\n // app.use(nuxt.render);\n\n // Listen the server\n app.listen(port, host);\n\n log.info(\"Server listening on http://{0}:{1}\".format(host, port)); // eslint-disable-line no-console\n\n consola.ready({\n message: `Server listening on http://${host}:${port}`,\n badge: true\n });\n}", "title": "" }, { "docid": "7a8c6f6fcb0299d789ed0b655731333a", "score": "0.6137055", "text": "function createServer() {\n\tconst script = getScriptPath();\n\tconst cp = require(\"child_process\");\n\t// if (!isPackaged()) server = cp.spawn(\"python\", \"server.py\");\n\n\tconsole.log(script);\n\n\tif (!isPackaged()) server = cp.spawn(\"python3\", [script, PORT]);\n\telse server = cp.execFile(script, [PORT]);\n\n\tutil.log(\"readingin\");\n\n\tprocess.stdout.on(\"data\", function (chunk) {\n\t\tlet textChunk = chunk.toString(\"utf8\"); // buffer to string\n\n\t\tutil.log(textChunk);\n\t});\n\n\tserver.stderr.on(\"error\", (err) => {\n\t\tconsole.log(\"Server threw an error: \" + err);\n\t});\n\tserver.on(\"close\", (code) => {\n\t\tconsole.log(\"Server exited with code \" + code);\n\t});\n}", "title": "" }, { "docid": "9ab3de169a29b999e158ea2f5fa09b2f", "score": "0.6133448", "text": "async start() {\n await this.updateTopology();\n this._getInitialGateway();\n await this.connect();\n // TODO: a way to somehow await for our authenticate response to be processed\n }", "title": "" }, { "docid": "d975b041c7d2ba29c9a3564864021d29", "score": "0.6128904", "text": "function start() {\n\tthis.startExpressApp();\n}", "title": "" }, { "docid": "ae06f3dbdd0b369e25528250fa91c753", "score": "0.61286885", "text": "function startServer() {\n const server = app.listen(8899, () => {\n const { port } = server.address();\n console.log(`Listening on port ${port}`);\n });\n}", "title": "" }, { "docid": "29d29fbd97042361b9c68a789a40cf78", "score": "0.6126512", "text": "async startTransport() {\n //todo: логика запуска транспорта\n this.server.on('request',function(req,res){\n console.log('%d request received', process.pid);\n \n res.writeHead(200, {'Content-Type': 'text/plain'});\n \n res.end('Hello world!\\n');\n }); \n }", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.611838", "text": "async started() {}", "title": "" }, { "docid": "9200813b84b0f849d1317b45fd8a9435", "score": "0.611838", "text": "async started() {}", "title": "" }, { "docid": "3badeceb05d1fd812650887dff62fcbf", "score": "0.6109998", "text": "function serverStart() {\n var port = server.address().port;\n console.log('Server listening on port '+ port);\n}", "title": "" }, { "docid": "6f2927513adf090b5bcd1f61c69ca7b5", "score": "0.6089579", "text": "static init() {\n if(cluster.isMaster) {\n // fork the process\n os.cpus().forEach((cpu) => {\n cluster.fork();\n });\n\n } else {\n // if we're not in the master thread, start the HTTP server\n ApiHandler.init(3000);\n }\n }", "title": "" }, { "docid": "318a20ca360ab00dcb509080e503617d", "score": "0.60877764", "text": "function startServer () {\n // Close the server if it is running\n if (server && server.close && app.address()) {\n server.close();\n }\n server = app.listen(port, () => {\n console.log(`Example app listening on port ${port}`)\n });\n\n}", "title": "" }, { "docid": "a78480b7dc20361326ca297b6f200ecf", "score": "0.60832036", "text": "async start() {\n return await this.fs.start();\n }", "title": "" }, { "docid": "bc2f5238a086204670fd759955c7b215", "score": "0.6077285", "text": "started() {\n\t\tif (this.settings.middleware)\n\t\t\treturn;\n\n\t\t/* istanbul ignore next */\n\t\tthis.server.listen(this.settings.port, this.settings.ip, err => {\n\t\t\tif (err) \n\t\t\t\treturn this.logger.error(\"API Gateway listen error!\", err);\n\n\t\t\tconst addr = this.server.address();\n\t\t\tthis.logger.info(`API Gateway listening on ${this.isHTTPS ? \"https\" : \"http\"}://${addr.address}:${addr.port}`);\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "aeb75b8bd59ee9c907a1cd98c690f897", "score": "0.60604984", "text": "function start()\n{\n app.listen(port);\n log('HTTP port Started on http://localhost:' + port);\n\n https.createServer(options, apps).listen(httpsPort);\n log(\"HTTPs port Started on https://localhost:\"+httpsPort);\n}", "title": "" }, { "docid": "4d7daf1aab13efecfc9437fca58c2eb3", "score": "0.6059585", "text": "function startWeb() {\n // Starting HTTP server\n const HTTPServer = require(\"srv-server\").HTTPServer;\n HTTPServer.start(function(err) {\n if (err) {\n Log.logger.error({err: err}, \"Failed to start HTTP server\");\n }\n // Starting HTTPS server\n const HTTPSServer = require(\"srv-server\").HTTPSServer;\n HTTPSServer.start(function(err) {\n if (err) {\n Log.logger.error({err: err}, \"Failed to start HTTPS server\");\n }\n let afterStart = Config.getValue(\"afterStart\");\n // If afterStart hook configured - instantiate and execute it\n if (afterStart && afterStart.module) {\n let ModuleClass;\n let moduleInstance;\n try {\n ModuleClass = Util.loadClass(afterStart);\n moduleInstance = new ModuleClass();\n if (afterStart.method) {\n moduleInstance[afterStart.method](function(err) {\n if (err) {\n Log.logger.error({err: err}, \"Failed to execute 'afterStart' hook\");\n stopWeb(1);\n }\n });\n }\n } catch (err) {\n Log.logger.error({err: err}, \"Failed to load and instantiate 'afterStart' hook\");\n stopWeb(1);\n }\n }\n });\n });\n}", "title": "" } ]